Ultrasound Analysis
Ultrasound Analysis
The Ultrasound Analysis module allows users to track fetal development during the first trimester by recording key biometric measurements. These data points are stored to monitor growth trends and contribute to the application's medical risk assessment engine.
Key Measurements Tracked
The system accepts the following clinical parameters for each ultrasound entry:
| Parameter | Unit | Description | | :--- | :--- | :--- | | Gestational Age | String | The age of the pregnancy (e.g., "6w 3d"). | | GS Size | mm | Mean Gestational Sac diameter. | | YS Size | mm | Yolk Sac diameter. | | CRL Size | mm | Crown-Rump Length (the length of the embryo/fetus from top to bottom). | | Heart Rate | bpm | Fetal heart rate in beats per minute. | | Number of Sacs | Integer | Support for singleton, twin, or higher-order multiple pregnancies. |
Data Entry via API
Ultrasound data is managed via the /api/ultrasound-entries endpoint. All requests require a valid session cookie.
Create an Entry
Endpoint: POST /api/ultrasound-entries
Request Body Example:
{
"date": "2023-10-25",
"gestationalAge": "7w 2d",
"gsSize": 22,
"ysSize": 4,
"crlSize": 11,
"heartRate": 145,
"numberOfSacs": 1,
"notes": "Flicker seen, regular rhythm.",
"sacData": {
"sac_1": {
"gs": 22,
"crl": 11
}
}
}
Retrieve Entries
Endpoint: GET /api/ultrasound-entries
Response Example:
[
{
"id": 101,
"userId": "uuid-string",
"date": "2023-10-25",
"gestationalAge": "7w 2d",
"gsSize": 22,
"ysSize": 4,
"crlSize": 11,
"heartRate": 145,
"numberOfSacs": 1,
"sacData": { ... },
"notes": "Flicker seen, regular rhythm.",
"createdAt": "2023-10-25T10:00:00Z"
}
]
Multiple Sac Support
For non-singleton pregnancies, the sacData field (Type: JSONB) allows for the storage of individual measurements for each embryo. When numberOfSacs is greater than 1, the frontend provides additional input fields to ensure specific growth metrics are captured for each sac independently.
Analysis & Risk Assessment
Once an ultrasound entry is saved, the backend triggers an analysis via the analysis_results table. This process evaluates the measurements against standard clinical ranges to generate:
- Risk Level: Categorized as
LOW,MEDIUM, orHIGH. - Z-Scores: Statistical deviations for GS and CRL based on the provided gestational age.
- Recommendations: Automated insights (e.g., "Growth within expected range" or "Follow-up scan recommended in 7 days").
UI Interaction
Users can access the Ultrasound features via the Analysis tab.
- Input: Use the form to enter measurements directly from a radiology report.
- Visualization: The system generates charts comparing the recorded CRL and GS size against standard growth curves.
- History: Previous scans are listed in the Entries tab for easy comparison over time.