DeveloperCare plansCare planArchitecture
LHR Components Audit
Purpose: Comprehensive audit of all components that should be part of a Longitudinal Health Record, comparing standard requirements against Kulcare's current implementation and plans.
Component Audit Summary
| Component | FHIR Resource | Backend Model | Frontend | Status |
|---|---|---|---|---|
| Patient Demographics | Patient | Patient, ClinicPatient | PatientDetail | Implemented |
| Problems/Conditions | Condition | PatientProblem | ProblemListManager | Implemented |
| Medications | MedicationRequest | PatientMedicine, MedicationRequest | MedicationTimeline | Implemented |
| Allergies | AllergyIntolerance | AllergyIntolerance | PatientDetail | Implemented |
| Vital Signs | Observation | PatientVital | VitalsTrendChart | Implemented |
| Lab Results | Observation, DiagnosticReport | DiagnosticReport | LabResultsSummary | Partial |
| Imaging/Radiology | ImagingStudy | N/A | N/A | Not Implemented |
| Procedures | Procedure | Procedure | N/A | Partial (model only) |
| Immunizations | Immunization | Immunization, ChildRecordVaccination | ChildRecord | Partial (pediatric) |
| Family History | FamilyMemberHistory | N/A | N/A | Not Implemented |
| Social History | Observation | Partial (in patient fields) | PatientDetail | Partial |
| Encounter History | Encounter | Appointment, Prescription | EncounterHistory | Implemented |
| Care Plans | CarePlan | CarePlan | N/A | Partial (model only) |
| Clinical Notes | DocumentReference | ClinicalImpression, ClinicalObservation | N/A | Partial |
| Documents/Attachments | DocumentReference | MedicalRecord, Document | MedicalRecords | Implemented |
| Goals | Goal | N/A | N/A | Not Implemented |
| Referrals | ServiceRequest | ServiceRequest | N/A | Partial |
| Appointments | Appointment | Appointment | Queue, Calendar | Implemented |
| Health Score | N/A (custom) | Computed | PatientSummaryDashboard | Implemented |
| Episode of Care | EpisodeOfCare | N/A | N/A | Planned |
Detailed Component Analysis
Fully Implemented
1. Patient Demographics
- FHIR:
Patient - Backend:
Patient,ClinicPatient - Frontend: PatientDetail page
- Data: Name, DOB, gender, contact info, blood group, address
- Status: Complete
2. Problems/Conditions
- FHIR:
Condition - Backend:
PatientProblem- Fields: name, icd_code, status, severity, onset_date, resolved_date
- Associations: patient, doctor, first_appointment, last_appointment
- Frontend:
ProblemListManager.tsx- CRUD operations
- Severity classification (low, medium, high, critical)
- Status tracking (active, resolved, chronic, improving)
- Medication linking
- Status: Complete
3. Medications
- FHIR:
MedicationRequest,MedicationStatement - Backend:
PatientMedicine- Active medicationsMedicationRequest- FHIR-compliant requestsMedicineAdherence- Tracking
- Frontend:
MedicationTimeline.tsx- Current medications
- Historical timeline
- Dosage changes
- Discontinuation tracking
- Status: Complete
4. Allergies
- FHIR:
AllergyIntolerance - Backend:
AllergyIntolerance- Fields: allergen, reaction, severity, onset_date
- Associations: patient, basic_allergy
- Frontend: Shown in PatientDetail
- Status: Complete (consider adding to LHR dashboard)
5. Vital Signs
- FHIR:
Observation(category: vital-signs) - Backend:
PatientVital,PatientVitalGroup- Supports: BP, heart rate, temperature, weight, height, BMI, SpO2, respiratory rate
- Frontend:
VitalsTrendChart.tsx- Trend visualization with Recharts
- Date range filtering
- Abnormal value flagging
- Multiple vital types
- Status: Complete
6. Encounter History
- FHIR:
Encounter - Backend:
Appointment(acts as encounter),Prescription - Frontend:
EncounterHistory.tsx- List and timeline views
- Filtering by type, date, provider
- Links to full encounter details
- Status: Complete
7. Documents/Attachments
- FHIR:
DocumentReference - Backend:
MedicalRecord,Document - Frontend: Medical Records section
- Status: Complete
8. Appointments
- FHIR:
Appointment - Backend:
Appointment - Frontend: Queue, Calendar, Scheduling
- Status: Complete
9. Health Score (Custom)
- FHIR: N/A (Kulcare custom metric)
- Backend: Computed in LHR interactor
- Frontend:
PatientSummaryDashboard.tsx - Calculation: Based on problems, vitals, medications, compliance
- Status: Complete
Partially Implemented
10. Lab Results
- FHIR:
Observation(category: laboratory),DiagnosticReport - Backend:
DiagnosticReport- Has model with patient, doctor, appointment associations
- Frontend: Basic display in LHR
- Gaps:
- Trending visualization for serial labs (e.g., HbA1c over time)
- Reference range highlighting
- Critical value alerts
- Integration with lab orders from Prescription
- Priority: High
11. Procedures
- FHIR:
Procedure - Backend:
Proceduremodel exists - Frontend: Not shown in LHR
- Gaps:
- Procedure history display
- Surgical history section
- Link to related encounters
- Priority: Medium
12. Immunizations
- FHIR:
Immunization - Backend:
Immunization,ChildRecordVaccination - Frontend: Only in ChildRecord (pediatric module)
- Gaps:
- Adult immunization tracking
- Immunization schedule display
- Integration with LHR for all ages
- Priority: Medium
13. Social History
- FHIR:
Observation(category: social-history) - Backend: Basic fields in Patient (smoking, alcohol may exist)
- Frontend: Limited display
- Gaps:
- Structured social history (smoking, alcohol, occupation, exercise)
- Risk factor tracking
- Lifestyle intervention history
- Priority: Medium
14. Clinical Notes
- FHIR:
DocumentReference,ClinicalImpression - Backend:
ClinicalImpression,ClinicalObservation - Frontend: Part of Prescription
- Gaps:
- Notes visible in LHR timeline
- Full-text search across notes
- Note categorization
- Priority: Medium
15. Care Plans
- FHIR:
CarePlan - Backend:
CarePlanmodel with care_plan_problems - Frontend: Not visible in LHR
- Gaps:
- Care plan display in LHR
- Goal tracking UI
- Care plan templates
- Priority: High (relates to Episode of Care)
16. Referrals
- FHIR:
ServiceRequest - Backend:
ServiceRequest - Frontend: Part of Prescription workflow
- Gaps:
- Referral history in LHR
- Referral status tracking
- Specialist report integration
- Priority: Low
Not Implemented
17. Imaging/Radiology
- FHIR:
ImagingStudy,DiagnosticReport - Backend: Not implemented
- Frontend: Not implemented
- Requirements:
- Imaging order model
- Image/report storage
- DICOM viewer integration (optional)
- Radiology report display
- Priority: Low (specialty-specific)
18. Family History
- FHIR:
FamilyMemberHistory - Backend: Not implemented
- Frontend: Not implemented
- Requirements:
- FamilyMemberHistory model
- Relationship, condition, age at onset
- Family tree visualization (optional)
- Risk factor calculation
- Priority: Medium
19. Goals
- FHIR:
Goal - Backend: Not implemented (planned with Episode of Care)
- Frontend: Not implemented
- Requirements:
- Goal model with targets
- Progress tracking
- Link to care plans and episodes
- Priority: High (part of Episode of Care)
20. Episode of Care
- FHIR:
EpisodeOfCare - Backend: Not implemented (planned)
- Frontend: Not implemented (planned)
- Requirements: See Episode of Care Plan
- Priority: High
Priority Recommendations
High Priority (Should implement next)
| Component | Reason |
|---|---|
| Lab Results Enhancement | Critical for chronic disease management (diabetes, kidney disease) |
| Episode of Care | Enables program-based care (therapy, physio, nutrition) |
| Goals | Required for Episode of Care and care plan effectiveness |
| Care Plan Display | Model exists, just needs frontend integration |
Medium Priority (Important for comprehensive LHR)
| Component | Reason |
|---|---|
| Family History | Risk assessment, preventive care |
| Social History | Lifestyle factors affect treatment decisions |
| Procedures | Complete surgical/procedural history |
| Immunizations (Adult) | Preventive care, travel medicine |
| Clinical Notes in LHR | Full patient narrative |
Lower Priority (Nice to have)
| Component | Reason |
|---|---|
| Imaging/Radiology | Specialty-specific, external integrations |
| Referral History | Useful but not critical for most workflows |
Data Model Gaps
Models That Need Creation
# Episode of Care (High Priority)
class EpisodeOfCare < ApplicationRecord
belongs_to :patient
belongs_to :clinic
belongs_to :primary_provider, class_name: 'User'
has_many :encounters
has_many :treatment_goals
# episode_type, status, start_date, end_date
end
# Treatment Goal (High Priority)
class TreatmentGoal < ApplicationRecord
belongs_to :episode_of_care
belongs_to :patient
# description, target_value, current_value, due_date, status
end
# Family History (Medium Priority)
class FamilyMemberHistory < ApplicationRecord
belongs_to :patient
# relationship, condition, deceased, age_at_onset
end
# Social History (Medium Priority - or extend Patient)
class SocialHistory < ApplicationRecord
belongs_to :patient
# smoking_status, alcohol_use, occupation, exercise_frequency
endModels That Need Enhancement
# Patient - add social history fields
class Patient
# Add: smoking_status, alcohol_use, occupation, marital_status
end
# Immunization - ensure adult support
class Immunization
# Ensure not limited to pediatric use
endFrontend Component Gaps
Components That Need Creation
| Component | Purpose | Priority |
|---|---|---|
LabResultsTrend.tsx | Trending visualization for serial labs | High |
FamilyHistoryManager.tsx | CRUD for family history | Medium |
SocialHistoryPanel.tsx | Display/edit social history | Medium |
ProcedureHistory.tsx | List of procedures/surgeries | Medium |
ImmunizationRecord.tsx | Adult immunization tracking | Medium |
CarePlanDisplay.tsx | Show active care plans | High |
EpisodeCard.tsx | Episode summary in LHR | High |
TreatmentGoalTracker.tsx | Goal progress visualization | High |
Components That Need Enhancement
| Component | Enhancement Needed |
|---|---|
PatientSummaryDashboard.tsx | Add allergies, active care plans, active episodes |
EncounterHistory.tsx | Group by Episode when episodes exist |
VitalsTrendChart.tsx | Add episode filter |
Summary
Overall LHR Completeness: ~65%
| Category | Status |
|---|---|
| Core Patient Data | 90% |
| Medications & Problems | 95% |
| Vitals & Encounters | 90% |
| Lab Results | 60% |
| Clinical Notes | 50% |
| Family/Social History | 20% |
| Care Programs (Episodes) | 0% (planned) |
| Specialty Features | 40% |
Next Steps:
- Implement Episode of Care infrastructure
- Enhance lab results trending
- Add care plan display to LHR
- Create family/social history components
- Integrate clinical notes into LHR timeline
Related Documentation
- LHR Concept - What LHR means and why it matters
- Clinical Data Hierarchy - LHR/Episode/Encounter relationships
- Future State: Episode of Care - Episode implementation plan
- Backend Implementation Progress - Current backend status