Kulcare Docs
DeveloperCare plansArchitecture

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

ComponentFHIR ResourceBackend ModelFrontendStatus
Patient DemographicsPatientPatient, ClinicPatientPatientDetailImplemented
Problems/ConditionsConditionPatientProblemProblemListManagerImplemented
MedicationsMedicationRequestPatientMedicine, MedicationRequestMedicationTimelineImplemented
AllergiesAllergyIntoleranceAllergyIntolerancePatientDetailImplemented
Vital SignsObservationPatientVitalVitalsTrendChartImplemented
Lab ResultsObservation, DiagnosticReportDiagnosticReportLabResultsSummaryPartial
Imaging/RadiologyImagingStudyN/AN/ANot Implemented
ProceduresProcedureProcedureN/APartial (model only)
ImmunizationsImmunizationImmunization, ChildRecordVaccinationChildRecordPartial (pediatric)
Family HistoryFamilyMemberHistoryN/AN/ANot Implemented
Social HistoryObservationPartial (in patient fields)PatientDetailPartial
Encounter HistoryEncounterAppointment, PrescriptionEncounterHistoryImplemented
Care PlansCarePlanCarePlanN/APartial (model only)
Clinical NotesDocumentReferenceClinicalImpression, ClinicalObservationN/APartial
Documents/AttachmentsDocumentReferenceMedicalRecord, DocumentMedicalRecordsImplemented
GoalsGoalN/AN/ANot Implemented
ReferralsServiceRequestServiceRequestN/APartial
AppointmentsAppointmentAppointmentQueue, CalendarImplemented
Health ScoreN/A (custom)ComputedPatientSummaryDashboardImplemented
Episode of CareEpisodeOfCareN/AN/APlanned

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 medications
    • MedicationRequest - FHIR-compliant requests
    • MedicineAdherence - 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: Procedure model 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: CarePlan model 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)

ComponentReason
Lab Results EnhancementCritical for chronic disease management (diabetes, kidney disease)
Episode of CareEnables program-based care (therapy, physio, nutrition)
GoalsRequired for Episode of Care and care plan effectiveness
Care Plan DisplayModel exists, just needs frontend integration

Medium Priority (Important for comprehensive LHR)

ComponentReason
Family HistoryRisk assessment, preventive care
Social HistoryLifestyle factors affect treatment decisions
ProceduresComplete surgical/procedural history
Immunizations (Adult)Preventive care, travel medicine
Clinical Notes in LHRFull patient narrative

Lower Priority (Nice to have)

ComponentReason
Imaging/RadiologySpecialty-specific, external integrations
Referral HistoryUseful 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
end

Models 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
end

Frontend Component Gaps

Components That Need Creation

ComponentPurposePriority
LabResultsTrend.tsxTrending visualization for serial labsHigh
FamilyHistoryManager.tsxCRUD for family historyMedium
SocialHistoryPanel.tsxDisplay/edit social historyMedium
ProcedureHistory.tsxList of procedures/surgeriesMedium
ImmunizationRecord.tsxAdult immunization trackingMedium
CarePlanDisplay.tsxShow active care plansHigh
EpisodeCard.tsxEpisode summary in LHRHigh
TreatmentGoalTracker.tsxGoal progress visualizationHigh

Components That Need Enhancement

ComponentEnhancement Needed
PatientSummaryDashboard.tsxAdd allergies, active care plans, active episodes
EncounterHistory.tsxGroup by Episode when episodes exist
VitalsTrendChart.tsxAdd episode filter

Summary

Overall LHR Completeness: ~65%

CategoryStatus
Core Patient Data90%
Medications & Problems95%
Vitals & Encounters90%
Lab Results60%
Clinical Notes50%
Family/Social History20%
Care Programs (Episodes)0% (planned)
Specialty Features40%

Next Steps:

  1. Implement Episode of Care infrastructure
  2. Enhance lab results trending
  3. Add care plan display to LHR
  4. Create family/social history components
  5. Integrate clinical notes into LHR timeline

On this page