Introduction
Overview
HCG AI is a comprehensive tracking and analysis platform designed for monitoring clinical markers during the first trimester of pregnancy. Built with a focus on data-driven insights, the application allows users and healthcare providers to log β-hCG levels and ultrasound measurements to generate medical-grade risk assessments and progress visualizations.
By combining traditional clinical algorithms with modern AI capabilities, HCG AI provides a centralized dashboard for managing early pregnancy data, calculating gestational age, and assessing potential risks through standardized medical parameters.
Key Features
The application is structured around four primary clinical pillars:
- β-hCG Monitoring: Track blood test results over time to monitor doubling rates and hormonal progression.
- Ultrasound Analysis: Log measurements for Gestational Sac (GS), Yolk Sac (YS), Crown-Rump Length (CRL), and Fetal Heart Rate (FHR).
- Medical Risk Assessment: Automated analysis of entered data to categorize risk levels (Low, Medium, High) based on clinical z-scores and established pregnancy benchmarks.
- AI Support Assistant: An integrated OpenAI-powered chatbot that provides contextual information and support regarding pregnancy data and terminology.
Core Workflows
1. Tracking HCG Progression
Users can log β-hCG values to monitor the health of the pregnancy. The system supports advanced details such as Last Menstrual Period (LMP) and cycle length to provide more accurate dating.
API Usage Example:
To log a new HCG entry, the client sends a POST request to /api/hcg-entries:
{
"date": "2023-10-25",
"hcgValue": 1500,
"units": "mIU/mL",
"notes": "First blood test",
"lmpDate": "2023-09-20",
"cycleLength": 28
}
2. Ultrasound Data Entry
The platform allows for detailed logging of first-trimester scans, including support for multiple sacs and specific fetal measurements.
Key Data Points Captured:
- Gestational Age: Calculated or manually entered age based on scan data.
- Measurements: GS Size, YS Size, and CRL (in mm).
- Fetal Activity: Fetal Heart Rate (in BPM).
3. Risk Analysis & Visualization
Once data is submitted, the application processes the inputs against medical-grade algorithms stored in the backend.
- Z-Scores: The system calculates deviations from the mean for specific gestational ages.
- Visual Charts: Trends in HCG levels and ultrasound growth are rendered using Chart.js for easy visual interpretation.
- Recommendations: Based on the
risk_level(LOW, MEDIUM, HIGH), the app provides tailored recommendations and follow-up suggestions.
4. Interactive AI Support
The AI chatbot serves as a first-line resource for explaining complex medical terms or trends found in the user's data. It utilizes the OpenAI API to process queries in the context of first-trimester health.
User Interface & Access
The application provides a responsive, vanilla JavaScript-based frontend accessible via any modern web browser. The interface is divided into functional tabs:
- Home: Dashboard overview and quick data entry.
- Entries: Historical log of all blood tests and scans.
- Analysis: Detailed risk assessment reports and z-score breakdowns.
- AI Chat: Direct interface with the pregnancy support bot.
Authentication is handled via secure session-based login, ensuring that sensitive medical data remains private and associated with the specific user profile.