Kulcare Docs
DeveloperCare plansCare planFuture state

LHR Completion Plan: FHIR Resource Coverage

Goal: Complete all FHIR resource coverage in LHR before adding Episode of Care

Current Status

CategoryImplementedPartialMissingCoverage
Core Patient Data300100%
Clinical Data44075%
History02225%
Planning02133%
Total78365%

Target: 95% coverage (18/19 components, excluding Imaging which is specialty-specific)


Phase 1: Quick Wins (Low Effort, High Value)

Components where backend exists, just need frontend integration.

1.1 Add Allergies to LHR Dashboard

  • FHIR: AllergyIntolerance
  • Backend: Already exists (AllergyIntolerance model)
  • Task: Add Allergies card to PatientSummaryDashboard
  • Effort: 2-4 hours
// Add to PatientSummaryDashboard.tsx
<AllergiesCard allergies={patientData.allergies} />

1.2 Add Care Plan Summary to LHR

  • FHIR: CarePlan
  • Backend: Already exists (CarePlan model with care_plan_problems)
  • Task: Display active care plans in LHR
  • Effort: 4-6 hours

1.3 Add Clinical Notes to LHR Timeline

  • FHIR: DocumentReference, ClinicalImpression
  • Backend: Already exists (ClinicalImpression, ClinicalObservation)
  • Task: Include notes in EncounterHistory timeline
  • Effort: 4-6 hours

1.4 Add Procedures to LHR

  • FHIR: Procedure
  • Backend: Already exists (Procedure model)
  • Task: Create ProcedureHistory component for LHR
  • Effort: 4-6 hours

1.5 Add Referrals to LHR

  • FHIR: ServiceRequest
  • Backend: Already exists (ServiceRequest model)
  • Task: Show referral history and status in LHR
  • Effort: 4-6 hours

Phase 1 Total: ~20-28 hours | Coverage after Phase 1: ~80%


Phase 2: Enhancements (Medium Effort)

Components that need frontend improvements.

  • FHIR: Observation (category: laboratory), DiagnosticReport
  • Backend: DiagnosticReport exists
  • Tasks:
    • Create LabResultsTrend.tsx component with Recharts
    • Add reference range highlighting
    • Add critical value alerts (visual indicators)
    • Support common lab panels (lipid, metabolic, CBC)
  • Effort: 8-12 hours

2.2 Immunizations (Adult Support)

  • FHIR: Immunization
  • Backend: Immunization model exists
  • Tasks:
    • Verify Immunization model supports adults (not just children)
    • Create ImmunizationRecord.tsx component
    • Show immunization history in LHR
    • Add due/overdue indicators
  • Effort: 6-8 hours

Phase 2 Total: ~14-20 hours | Coverage after Phase 2: ~85%


Phase 3: New Models (Higher Effort)

Components that need backend models created.

3.1 Family History

  • FHIR: FamilyMemberHistory
  • Backend: NEW model needed
  • Tasks:
    • Create FamilyMemberHistory migration and model
    • Create backend endpoints (CRUD)
    • Create FamilyHistoryManager.tsx component
    • Add to LHR dashboard
  • Effort: 12-16 hours
# Migration
class CreateFamilyMemberHistories < ActiveRecord::Migration[7.0]
  def change
    create_table :family_member_histories do |t|
      t.references :patient, null: false, foreign_key: true
      t.references :clinic, foreign_key: true
      t.string :relationship, null: false  # mother, father, sibling, etc.
      t.string :condition_name
      t.string :condition_code  # ICD-10
      t.boolean :deceased, default: false
      t.integer :age_at_onset
      t.integer :age_at_death
      t.text :notes
      t.timestamps
    end
  end
end

3.2 Social History (Structured)

  • FHIR: Observation (category: social-history)
  • Backend: Extend Patient or create SocialHistory model
  • Tasks:
    • Add structured fields to Patient or create new model
    • Create SocialHistoryPanel.tsx component
    • Fields: smoking, alcohol, occupation, exercise, diet, stress
  • Effort: 8-12 hours
# Option A: Add to Patient model
add_column :patients, :smoking_status, :string  # never, former, current
add_column :patients, :alcohol_use, :string     # none, occasional, moderate, heavy
add_column :patients, :occupation, :string
add_column :patients, :exercise_frequency, :string  # sedentary, light, moderate, active
add_column :patients, :marital_status, :string

# Option B: Create SocialHistory model (better for history tracking)
class CreateSocialHistories < ActiveRecord::Migration[7.0]
  def change
    create_table :social_histories do |t|
      t.references :patient, null: false, foreign_key: true
      t.string :category  # smoking, alcohol, occupation, etc.
      t.string :status
      t.string :value
      t.date :recorded_date
      t.text :notes
      t.timestamps
    end
  end
end

3.3 Goals

  • FHIR: Goal
  • Backend: NEW model needed
  • Tasks:
    • Create Goal migration and model
    • Create backend endpoints
    • Create GoalTracker.tsx component
    • Link goals to problems and care plans
  • Effort: 10-14 hours
class CreateGoals < ActiveRecord::Migration[7.0]
  def change
    create_table :goals do |t|
      t.references :patient, null: false, foreign_key: true
      t.references :clinic, foreign_key: true
      t.references :patient_problem, foreign_key: true, optional: true
      t.references :care_plan, foreign_key: true, optional: true
      t.string :description, null: false
      t.string :category  # clinical, behavioral, functional
      t.string :status, default: 'in_progress'  # proposed, in_progress, achieved, cancelled
      t.string :priority  # high, medium, low
      t.date :start_date
      t.date :target_date
      t.string :target_value  # e.g., "HbA1c < 7.0"
      t.string :current_value
      t.text :notes
      t.timestamps
    end
  end
end

Phase 3 Total: ~30-42 hours | Coverage after Phase 3: ~95%


Implementation Summary

PhaseComponentsEffortCoverage
Phase 1Allergies, Care Plans, Notes, Procedures, Referrals20-28 hrs65% → 80%
Phase 2Lab Trending, Immunizations14-20 hrs80% → 85%
Phase 3Family History, Social History, Goals, Imaging40-50 hrs85% → 95%
Total74-98 hrs95%

Component Checklist

Phase 1 Checklist

  • 1.1 Allergies card in LHR dashboard
  • 1.2 Care Plan summary in LHR
  • 1.3 Clinical notes in timeline
  • 1.4 Procedure history component
  • 1.5 Referral history component

Phase 2 Checklist

  • 2.1 Lab results trending chart
  • 2.2 Immunization record (adult support)

Phase 3 Checklist

  • 3.1 FamilyMemberHistory model + UI
  • 3.2 Social history structured fields + UI
  • 3.3 Goal model + UI
  • 3.4 ImagingStudy model + UI

After LHR Completion

Once LHR is at 95% coverage:

  1. Episode of Care - Add program containers
  2. Multi-Practitioner Documents - Add EncounterDocument model
  3. Role-Based Views - Customize LHR by practitioner type

FHIR Resource Mapping (Complete)

LHR ComponentFHIR ResourceStatus After Plan
DemographicsPatientComplete
ProblemsConditionComplete
MedicationsMedicationRequestComplete
AllergiesAllergyIntoleranceComplete (Phase 1)
Vital SignsObservationComplete
Lab ResultsObservation, DiagnosticReportComplete (Phase 2)
ProceduresProcedureComplete (Phase 1)
ImmunizationsImmunizationComplete (Phase 2)
Family HistoryFamilyMemberHistoryComplete (Phase 3)
Social HistoryObservationComplete (Phase 3)
EncountersEncounterComplete
Care PlansCarePlanComplete (Phase 1)
Clinical NotesDocumentReferenceComplete (Phase 1)
DocumentsDocumentReferenceComplete
GoalsGoalComplete (Phase 3)
ReferralsServiceRequestComplete (Phase 1)
AppointmentsAppointmentComplete
ImagingImagingStudyComplete (Phase 3)
Episode of CareEpisodeOfCareAfter LHR complete

On this page