Data Structure Specification
January 14, 2026 · View on GitHub
Biochemical Test Data Structure
{
"id": "20251231123456789",
"type": "生化检查",
"date": "2025-12-31",
"hospital": "XX Hospital",
"items": [
{
"name": "White Blood Cell Count",
"value": "6.5",
"unit": "×$10^{9}$/L",
"min_ref": "3.5",
"max_ref": "9.5",
"is_abnormal": false
}
]
}
Field Description
id: Unique identifier (generated from timestamp)type: Examination type, fixed value "生化检查" (Biochemical Test)date: Examination date (YYYY-MM-DD format)hospital: Hospital nameitems: Array of test itemsname: Test item namevalue: Test result valueunit: Measurement unitmin_ref: Reference range lower limitmax_ref: Reference range upper limitis_abnormal: Whether abnormal (boolean)
Medical Imaging Data Structure
{
"id": "20251231123456789",
"type": "影像检查",
"subtype": "Ultrasound",
"date": "2025-12-31",
"hospital": "XX Hospital",
"body_part": "Abdomen",
"findings": {
"description": "Examination findings description",
"measurements": {
"Size": "Specific value"
},
"conclusion": "Examination conclusion"
},
"original_image": "images/original.jpg"
}
Field Description
id: Unique identifier (generated from timestamp)type: Examination type, fixed value "影像检查" (Medical Imaging)subtype: Imaging examination subtype (Ultrasound, CT, MRI, X-ray, etc.)date: Examination date (YYYY-MM-DD format)hospital: Hospital namebody_part: Body part examinedfindings: Examination findings objectdescription: Text description of examination findingsmeasurements: Measurement data objectconclusion: Examination conclusion
original_image: Original image backup path
Radiation Record Data Structure
{
"id": "20251231123456789",
"exam_type": "CT",
"body_part": "Chest",
"exam_date": "2025-12-31",
"standard_dose": 7.0,
"body_surface_area": 1.85,
"adjustment_factor": 1.07,
"actual_dose": 7.5,
"dose_unit": "mSv"
}
Field Description
id: Unique identifier (generated from timestamp)exam_type: Examination type (CT, X-ray, PET-CT, etc.)body_part: Body part examinedexam_date: Examination date (YYYY-MM-DD format)standard_dose: Standard radiation dose (mSv)body_surface_area: User's body surface area (m²)adjustment_factor: Body surface area adjustment factoractual_dose: Actual radiation dose (mSv)dose_unit: Dose unit, fixed value "mSv"
User Profile Data Structure
{
"basic_info": {
"gender": "F",
"height": 175,
"height_unit": "cm",
"weight": 70,
"weight_unit": "kg",
"birth_date": "1990-01-01"
},
"calculated": {
"age": 35,
"bmi": 22.9,
"bmi_status": "Normal",
"body_surface_area": 1.85,
"bsa_unit": "m²"
}
}
Field Description
basic_info: Basic information objectgender: Gender (M=Male, F=Female, other values optional)height: Height valueheight_unit: Height unitweight: Weight valueweight_unit: Weight unitbirth_date: Birth date (YYYY-MM-DD format)
calculated: Auto-calculated information objectage: Age (in years)bmi: BMI indexbmi_status: BMI status (Underweight/Normal/Overweight/Obese)body_surface_area: Body surface area (calculated using Mosteller formula)bsa_unit: Body surface area unit
Global Index Data Structure
{
"biochemical_exams": [
{
"id": "20251231123456789",
"date": "2025-12-31",
"type": "生化检查",
"file_path": "data/生化检查/2025-12/2025-12-31_血常规.json"
}
],
"imaging_exams": [
{
"id": "20251231123456789",
"date": "2025-12-31",
"type": "影像检查",
"subtype": "Ultrasound",
"file_path": "data/影像检查/2025-12/2025-12-31_腹部B超.json"
}
],
"last_updated": "2025-12-31T12:34:56.789Z"
}
Field Description
biochemical_exams: Biochemical examination index arrayimaging_exams: Imaging examination index arraysymptom_records: Symptom record index arraylast_updated: Last update time (ISO 8601 format)
Symptom Record Data Structure
{
"id": "20251231123456789",
"record_date": "2025-12-31",
"symptom_date": "2025-12-31",
"original_input": "User's original input",
"standardized": {
"main_symptom": "Headache",
"category": "Nervous System",
"body_part": "Head",
"severity": "Mild",
"severity_level": 1,
"characteristics": "Distending pain sensation",
"onset_time": "2025-12-31T10:00:00",
"duration": "2 hours",
"frequency": "First occurrence"
},
"associated_symptoms": [
{
"name": "Nausea",
"present": true
},
{
"name": "Vomiting",
"present": false
}
],
"triggers": {
"possible_causes": ["Lack of sleep", "Mental stress"],
"aggravating_factors": [],
"relieving_factors": ["Slightly relieved after rest"]
},
"medical_assessment": {
"urgency": "observation",
"urgency_level": 1,
"recommendation": "Home observation",
"advice": "Recommend adequate rest and ensure sufficient sleep. If symptoms worsen or persist for more than 24 hours, seek medical attention.",
"red_flags": []
},
"follow_up": {
"needs_follow_up": false,
"follow_up_date": null,
"improvement": null
},
"metadata": {
"created_at": "2025-12-31T12:34:56.789Z",
"last_updated": "2025-12-31T12:34:56.789Z"
}
}
Field Description
id: Unique identifier (generated from timestamp)record_date: Record creation date (YYYY-MM-DD format)symptom_date: Symptom occurrence date (YYYY-MM-DD format)original_input: User's original natural language descriptionstandardized: Standardized medical information objectmain_symptom: Standard medical term for main symptomcategory: System classification of symptombody_part: Body part where symptom occursseverity: Severity description (Mild/Moderate/Severe/Critical)severity_level: Severity level (1-4)characteristics: Symptom characteristic descriptiononset_time: Symptom onset time (ISO 8601 format)duration: Duration descriptionfrequency: Occurrence frequency description
associated_symptoms: Associated symptoms arrayname: Symptom namepresent: Whether symptom is present (boolean)
triggers: Triggers and relieving factors objectpossible_causes: Possible causes arrayaggravating_factors: Aggravating factors arrayrelieving_factors: Relieving factors array
medical_assessment: Medical assessment objecturgency: Urgency category (observation/outpatient/urgent/emergency)urgency_level: Urgency level (1-4)recommendation: Medical recommendation categoryadvice: Specific advice contentred_flags: Red flag warning signals array
follow_up: Follow-up information objectneeds_follow_up: Whether follow-up is needed (boolean)follow_up_date: Follow-up date (if applicable)improvement: Improvement status (if applicable)
metadata: Metadata objectcreated_at: Record creation time (ISO 8601 format)last_updated: Last update time (ISO 8601 format)
Urgency Classification
- observation (Level 1): Home observation
- outpatient (Level 2): Outpatient visit (within 1 week)
- urgent (Level 3): Seek medical attention soon (today or tomorrow)
- emergency (Level 4): Immediate medical attention or call emergency services
Symptom System Classification
- Respiratory System: Cough, sputum, dyspnea, chest pain, etc.
- Cardiovascular System: Palpitations, chest tightness, edema, etc.
- Digestive System: Abdominal pain, nausea, vomiting, diarrhea, constipation, etc.
- Nervous System: Headache, dizziness, insomnia, seizures, etc.
- Urinary System: Urinary frequency, urgency, dysuria, hematuria, etc.
- Endocrine System: Polydipsia, polyuria, weight changes, etc.
- Musculoskeletal: Joint pain, muscle pain, limited mobility, etc.
- General Symptoms: Fever, fatigue, weight loss, etc.
Medication Record Data Structure
Medication Information Data Structure
{
"medications": [
{
"id": "med_20251231123456789",
"name": "Aspirin",
"generic_name": "Aspirin",
"dosage": {
"value": 100,
"unit": "mg"
},
"frequency": {
"type": "daily",
"times_per_day": 1,
"interval_days": 1
},
"schedule": [
{
"weekday": 1,
"time": "08:00",
"timing_label": "After breakfast",
"dose": {
"value": 100,
"unit": "mg"
}
},
{
"weekday": 2,
"time": "08:00",
"timing_label": "After breakfast",
"dose": {
"value": 100,
"unit": "mg"
}
}
... (continuing through Sunday, total 7 records)
],
"instructions": "Take after breakfast",
"notes": "",
"active": true,
"created_at": "2025-12-31T12:34:56.789Z",
"last_updated": "2025-12-31T12:34:56.789Z"
}
]
}
Field Description
medications: Medications arrayid: Unique identifier (prefix med_ + timestamp)name: Medication name (generic or brand name)generic_name: Generic namedosage: Dosage information objectvalue: Dosage valueunit: Dosage unit (mg, g, ml, IU, tablet, capsule, etc.)
frequency: Medication frequency objecttype: Frequency type (daily/weekly/every_other_day/as_needed)times_per_day: Number of times per dayinterval_days: Medication interval in days
schedule: Medication schedule array (mandatory explicit specification for each day of week)weekday: Day of week (1-7, 1=Monday, 7=Sunday)time: Medication time (HH:mm format)timing_label: Time label (after breakfast, before bed, etc.)dose: Dose at this time
instructions: Medication instructionsnotes: Note informationactive: Whether active (true=currently taking, false=discontinued)created_at: Creation time (ISO 8601 format)last_updated: Last update time (ISO 8601 format)
Schedule Array Generation Rules
Important: schedule must explicitly generate medication plan records for each day of the week
Once Daily Medications
Generate 7 records (1 for each day Monday through Sunday)
"schedule": [
{"weekday": 1, "time": "08:00", ...},
{"weekday": 2, "time": "08:00", ...},
{"weekday": 3, "time": "08:00", ...},
{"weekday": 4, "time": "08:00", ...},
{"weekday": 5, "time": "08:00", ...},
{"weekday": 6, "time": "08:00", ...},
{"weekday": 7, "time": "08:00", ...}
]
``$
#### \text{Twice} \text{Daily} \text{Medications}
\text{Generate} 14 \text{records} (2 \text{times} \text{per} \text{day} \times 7 \text{days})
$``json
"schedule": [
{"weekday": 1, "time": "08:00", ...}, // Monday morning
{"weekday": 1, "time": "20:00", ...}, // Monday evening
{"weekday": 2, "time": "08:00", ...}, // Tuesday morning
{"weekday": 2, "time": "20:00", ...}, // Tuesday evening
... (continuing through Sunday)
]
``$
#### \text{Three} \text{Times} \text{Daily} \text{Medications}
\text{Generate} 21 \text{records} (3 \text{times} \text{per} \text{day} \times 7 \text{days})
$``json
"schedule": [
{"weekday": 1, "time": "08:00", ...}, // Monday after breakfast
{"weekday": 1, "time": "12:30", ...}, // Monday after lunch
{"weekday": 1, "time": "18:30", ...}, // Monday after dinner
{"weekday": 2, "time": "08:00", ...}, // Tuesday after breakfast
... (continuing through Sunday)
]
Once Weekly Medications
Generate 1 record (specified day of week)
"schedule": [
{"weekday": 1, "time": "08:00", ...} // Every Monday
]
Every Other Day Medications
Generate 4 records (Monday, Wednesday, Friday, Sunday OR Tuesday, Thursday, Saturday)
"schedule": [
{"weekday": 1, "time": "08:00", ...},
{"weekday": 3, "time": "08:00", ...},
{"weekday": 5, "time": "08:00", ...},
{"weekday": 7, "time": "08:00", ...}
]
Medication Log Data Structure
{
"date": "2025-12-31",
"logs": [
{
"id": "log_20251231080000001",
"medication_id": "med_20251231123456789",
"medication_name": "Aspirin",
"scheduled_time": "08:00",
"actual_time": "2025-12-31T08:15:00",
"status": "taken",
"dose": {
"value": 100,
"unit": "mg"
},
"notes": "",
"created_at": "2025-12-31T08:15:00.000Z"
}
]
}
Field Description
date: Medication date (YYYY-MM-DD format)logs: Medication log arrayid: Log unique identifier (prefix log_ + timestamp)medication_id: Associated medication IDmedication_name: Medication namescheduled_time: Scheduled medication time (HH:mm format)actual_time: Actual medication time (ISO 8601 format, null if missed)status: Medication status (taken/missed/skipped/delayed)dose: Actual dosenotes: Notes (e.g., reason for missed dose)created_at: Log creation time (ISO 8601 format)
Medication Status Values
- taken: Taken (on time or delayed)
- missed: Missed (not taken)
- skipped: Skipped (medically discontinued or paused)
- delayed: Delayed (taken but time was delayed)
Frequency Type Values
- daily: Daily (times_per_day indicates number of times per day)
- weekly: Weekly (times_per_day indicates number of times per week)
- every_other_day: Every other day
- as_needed: As needed (compliance not calculated)
Medication Adherence Calculation
``$ \text{Adherence} \text{Percentage} = (\text{Actual} \text{doses} \text{taken} / \text{Scheduled} \text{doses}) \times 100%
\text{Where}:
- \text{Actual} \text{doses} \text{taken} = \text{Number} \text{of} \text{records} \text{with} \text{status} \text{taken} \text{or} \text{delayed}
- \text{Scheduled} \text{doses} = \text{Total} \text{scheduled} \text{doses} (\text{excluding} \text{skipped} \text{and} \text{as_needed})
- \text{Pending} \text{doses} \text{not} \text{included} \text{in} \text{statistics} $``
Adherence Levels
- Excellent: ≥ 90%
- Good: 70% - 89%
- Needs Improvement: < 70%
Global Index Update (Medication Records)
{
"medications": [
{
"id": "med_20251231123456789",
"name": "Aspirin",
"dosage_value": 100,
"dosage_unit": "mg",
"frequency_type": "daily",
"file_path": "data/medications/medications.json",
"active": true,
"created_at": "2025-12-31T12:34:56.789Z"
}
],
"medication_logs": [
{
"id": "log_20251231080000001",
"date": "2025-12-31",
"medication_id": "med_20251231123456789",
"medication_name": "Aspirin",
"status": "taken",
"file_path": "data/medication-logs/2025-12/2025-12-31.json"
}
]
}