๐ฅ Medical System Database Overview
Comprehensive view of all data storage systems in the medical project
๐ฏ Data Organization Strategy
Current Status: The medication data exists in static HTML files (Emergency Medical French.html, Emergency Medical Information.html) but should be migrated to database storage for dynamic updates.
๐ Recommended Migration Path
medical_words.db
SQLitePurpose: Real-time voice logging (insulin, medications, symptoms, todos)
clarity_clean.db
SQLitePurpose: Processed Dexcom glucose data from Clarity exports
christina_medical_knowledge.db
SQLitePurpose: Comprehensive medical knowledge base (EMPTY - ready for medication migration)
medical_history.db
SQLitePurpose: Medical events and appointments from PKB sync
symptom_diary.db
SQLitePurpose: Symptom tracking and pattern analysis (EMPTY - ready for data)
document_index.db
SQLitePurpose: Medical document indexing and search
simple_docs.db
SQLitePurpose: Simple document storage (EMPTY)
๐ฉธ Blood Test Data (80+ Individual Marker Files)
Each blood marker has its own CSV file for time-series tracking:
dexcom_glucose_readings.csv
CSVPurpose: Real-time glucose monitoring from Dexcom API
Structure: Timestamp, Timezone_Abbr, Value_mmol, Trend, Seconds_Between_Readings
bp_complete_dataset_fixed.csv
CSVPurpose: Complete blood pressure history
Structure: Source, Date, Heart rate, Systolic, Diastolic
blood_c-reactive_protein.csv
CSVPurpose: CRP inflammation marker tracking
Note: One of 80+ individual blood marker CSV files
blood_creatinine.csv
CSVPurpose: Kidney function marker tracking
Note: Critical for medical correlation analysis
๐ Blood Marker Categories
- Kidney Function: creatinine, eGFR, urea, albumin
- Cardiac Markers: BNP, NT-pro BNP, troponin
- Inflammation: CRP, lymphocytes, neutrophils
- Metabolic: glucose, HbA1c, cholesterol, triglycerides
- Immunology: IgG subclasses, ANCA, complement
- Vitamins/Minerals: Vitamin D, calcium, magnesium
pkb_sync_database.json
JSONPurpose: PatientsKnowBest synchronization state
Usage: Tracks last sync dates, processed appointments
pkb_appointments.json
JSONPurpose: Raw appointment data from PKB portal
Usage: Intermediate storage before processing
google-credentials.json
JSONPurpose: Google Cloud service account credentials
Usage: Speech-to-text, Calendar integration
latest_glucose_word.json
JSONPurpose: Cache for current glucose status
Usage: Quick access for web interface
g7_overlap_periods.json
JSONPurpose: G6/G7 sensor transition analysis
Usage: Gap detection and calibration tracking
process_status.json
JSONPurpose: System health monitoring
Usage: Process Manager status tracking
๐ Current Medication Data Status
Problem: Medication data is hardcoded in static HTML files, making updates manual and error-prone.
Files with medication tables:
Emergency Medical French.html- French emergency cardEmergency Medical Information.html- English emergency card
๐ฏ Proposed Migration Strategy
| Step | Action | Target Database | Priority |
|---|---|---|---|
| 1 | Extract medication tables from HTML files | christina_medical_knowledge.db | High |
| 2 | Create medication management API endpoints | Flask application | High |
| 3 | Update HTML files to read from database | Template system | Medium |
| 4 | Add web interface for medication management | New HTML template | Low |
๐๏ธ christina_medical_knowledge.db Schema
The medications table is already designed and ready:
medications table:
- id (INTEGER, PRIMARY KEY)
- document_id (INTEGER, Foreign Key)
- medication_name (TEXT) - e.g., "Novorapid insulin"
- dose (TEXT) - e.g., "Variable units"
- frequency (TEXT) - e.g., "With meals"
- timing (TEXT) - e.g., "Before eating"
- route (TEXT) - e.g., "Subcutaneous injection"
- essential (BOOLEAN) - Critical medications
- start_date (DATE)
- stop_date (DATE)
๐ Data Integration Architecture
๐ฏ Future Integration Opportunities
- VictoriaMetrics: Time series database for high-performance analytics
- Google Sheets: External sharing and collaboration
- Home Assistant: Location tracking for timezone automation
- Document Processing: AI extraction from medical PDFs
๐ Data Quality Priorities
High Priority
- medical_words.db - Real-time voice logging
- clarity_clean.db - Glucose continuity
- Medication database migration
Medium Priority
- Blood marker CSV consolidation
- PKB sync reliability
- Document indexing expansion
Future Development
- Symptom pattern analysis
- Predictive health analytics
- Cross-correlation studies