Kulcare Docs
DeveloperCare plans

Clinical Schema

Purpose: Patient care, clinical documentation, AI-assisted care, and FHIR-aligned clinical resources Tenant Scoped: Yes (all tables) RLS Enabled: Yes

Overview

The clinical schema contains all patient care data aligned with FHIR R4 resources. It supports:

  • Longitudinal Health Record (LHR) as a computed view
  • Episode of Care for treatment programs
  • Multi-practitioner encounters
  • Care Plans with versioning
  • AI-Assisted Care (transcription, suggestions)

Entities

Patients

Entity: Patient

Purpose: Individual receiving healthcare services (FHIR: Patient)

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
tenant_idUUIDYesOwning tenant
mrnStringNoMedical Record Number (facility-specific)
abha_idStringNoABHA identifier (India)
first_nameStringYesFirst name
last_nameStringNoLast name
display_nameStringNoPreferred display name
genderEnumNomale, female, other, unknown
birth_dateDateNoDate of birth
deceasedBooleanNoDeceased status
deceased_dateDateNoDate of death
marital_statusEnumNosingle, married, divorced, widowed
photo_urlStringNoPatient photo
emailStringNoEmail address
phoneStringNoPrimary phone
addressJSONBNoAddress information
emergency_contactJSONBNoEmergency contact details
communication_preferencesJSONBNoLanguage, contact preferences
is_activeBooleanYesActive patient

Emergency Contact Structure:

{
  "name": "Jane Doe",
  "relationship": "spouse",
  "phone": "+919876543210",
  "email": "jane@example.com"
}

Relationships:

  • Belongs to: Tenant
  • Has many: PatientFacilities, EpisodesOfCare, Encounters, Conditions, Observations
  • Has many: MedicationRequests, CarePlans, Goals, Appointments

FHIR Mapping: Patient resource


Entity: PatientFacility

Purpose: Links patients to facilities they receive care at

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
tenant_idUUIDYesOwning tenant
patient_idUUIDYesPatient reference
facility_idUUIDYesFacility reference
facility_mrnStringNoFacility-specific MRN
registration_dateDateNoFirst registration
is_primaryBooleanNoPrimary facility
is_activeBooleanYesActive registration

Relationships:

  • Belongs to: Tenant, Patient, Facility

Episodes of Care

Entity: EpisodeOfCare

Purpose: Treatment program container spanning multiple encounters (FHIR: EpisodeOfCare)

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
tenant_idUUIDYesOwning tenant
patient_idUUIDYesPatient reference
facility_idUUIDYesManaging facility
managing_practitioner_idUUIDNoPrimary practitioner
statusEnumYesplanned, waitlist, active, onhold, finished, cancelled
typeEnumNoEpisode type (rehabilitation, chronic_care, mental_health, etc.)
diagnosis_codesJSONBNoPrimary diagnoses for this episode
period_startDateNoEpisode start date
period_endDateNoEpisode end date
descriptionTextNoEpisode description

Status Lifecycle:

planned --> waitlist --> active <--> onhold --> finished
                                          \--> cancelled

Type Values:

  • rehabilitation - Post-surgical or injury recovery
  • chronic_care - Chronic disease management
  • mental_health - Mental health treatment program
  • maternity - Pregnancy and postnatal care
  • oncology - Cancer treatment program
  • preventive - Preventive care program
  • acute - Acute care episode

Relationships:

  • Belongs to: Tenant, Patient, Facility, Practitioner
  • Has many: Encounters, TreatmentGoals, ProgressNotes
  • Referenced by: CarePlans

FHIR Mapping: EpisodeOfCare resource


Entity: TreatmentGoal

Purpose: Goals specific to an episode of care

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
tenant_idUUIDYesOwning tenant
episode_of_care_idUUIDYesParent episode
descriptionTextYesGoal description
target_dateDateNoTarget completion date
statusEnumYesproposed, planned, accepted, active, achieved, cancelled
priorityEnumNohigh, medium, low
outcomeTextNoOutcome description

Relationships:

  • Belongs to: Tenant, EpisodeOfCare

Entity: ProgressNote

Purpose: Progress notes within an episode

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
tenant_idUUIDYesOwning tenant
episode_of_care_idUUIDYesParent episode
encounter_idUUIDNoRelated encounter
author_idUUIDYesNote author (practitioner)
note_dateTimestampYesNote date/time
contentTextYesNote content
note_typeEnumNoprogress, assessment, plan, summary

Relationships:

  • Belongs to: Tenant, EpisodeOfCare, Encounter, Practitioner

Encounters

Entity: Encounter

Purpose: Clinical visit or interaction (FHIR: Encounter)

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
tenant_idUUIDYesOwning tenant
patient_idUUIDYesPatient reference
facility_idUUIDYesFacility where encounter occurs
episode_of_care_idUUIDNoParent episode (optional)
statusEnumYesplanned, arrived, triaged, in-progress, onleave, finished, cancelled
classEnumYesambulatory, inpatient, emergency, virtual, home
typeEnumNoconsultation, follow_up, procedure, therapy, etc.
priorityEnumNoroutine, urgent, emergency
period_startTimestampNoStart time
period_endTimestampNoEnd time
reason_codesJSONBNoReason for visit
diagnosis_codesJSONBNoEncounter diagnoses
hospitalizationJSONBNoAdmission details (inpatient)
service_type_idUUIDNoHealthcare service reference

Class Values:

  • ambulatory - OPD, clinic visit
  • inpatient - Hospital admission
  • emergency - Emergency department
  • virtual - Telemedicine consultation
  • home - Home visit

Hospitalization Structure (for inpatient):

{
  "admit_source": "emergency",
  "re_admission": false,
  "diet_preference": "vegetarian",
  "special_arrangement": ["wheelchair"],
  "discharge_disposition": "home"
}

Relationships:

  • Belongs to: Tenant, Patient, Facility, EpisodeOfCare, HealthcareService
  • Has many: EncounterParticipants, Observations, MedicationRequests, ServiceRequests
  • Has many: TranscriptionSessions, AiSuggestions

FHIR Mapping: Encounter resource


Entity: EncounterParticipant

Purpose: Practitioners involved in an encounter (multi-practitioner support)

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
tenant_idUUIDYesOwning tenant
encounter_idUUIDYesEncounter reference
practitioner_idUUIDYesPractitioner reference
roleEnumYesprimary, consultant, assistant, observer
period_startTimestampNoParticipation start
period_endTimestampNoParticipation end

Role Values:

  • primary - Primary/attending practitioner
  • consultant - Consulting specialist
  • assistant - Assisting practitioner
  • observer - Observer (training, etc.)

Relationships:

  • Belongs to: Tenant, Encounter, Practitioner

FHIR Mapping: Encounter.participant


Clinical Data

Entity: Condition

Purpose: Diagnoses and problems (FHIR: Condition)

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
tenant_idUUIDYesOwning tenant
patient_idUUIDYesPatient reference
encounter_idUUIDNoDiagnosing encounter
recorder_idUUIDNoRecording practitioner
clinical_statusEnumYesactive, recurrence, relapse, inactive, remission, resolved
verification_statusEnumNounconfirmed, provisional, differential, confirmed
categoryEnumNoproblem_list_item, encounter_diagnosis
severityEnumNomild, moderate, severe
codeJSONBYesDiagnosis code (ICD, SNOMED)
body_siteJSONBNoAffected body site
onset_dateDateNoWhen condition started
abatement_dateDateNoWhen condition ended
recorded_dateDateNoWhen recorded
noteTextNoAdditional notes

Code Structure:

{
  "system": "icd-10",
  "code": "E11.9",
  "display": "Type 2 diabetes mellitus without complications"
}

Relationships:

  • Belongs to: Tenant, Patient, Encounter, Practitioner
  • References: reference.icd_codes, reference.snomed_concepts

FHIR Mapping: Condition resource


Entity: Observation

Purpose: Vitals, measurements, and clinical findings (FHIR: Observation)

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
tenant_idUUIDYesOwning tenant
patient_idUUIDYesPatient reference
encounter_idUUIDNoRelated encounter
performer_idUUIDNoPerforming practitioner
statusEnumYesregistered, preliminary, final, amended, cancelled
categoryEnumYesvital_signs, laboratory, imaging, social_history, exam
codeJSONBYesObservation type (LOINC, SNOMED)
valueJSONBYesObservation value
interpretationEnumNonormal, abnormal, critical_low, critical_high
effective_dateTimestampYesWhen observed
issuedTimestampNoWhen result issued
noteTextNoAdditional notes
reference_rangeJSONBNoNormal range
body_siteJSONBNoBody site
methodStringNoObservation method

Value Structure (varies by type):

// Quantity
{ "type": "quantity", "value": 120, "unit": "mmHg" }

// String
{ "type": "string", "value": "Normal breath sounds" }

// CodeableConcept
{ "type": "code", "system": "snomed", "code": "17621005", "display": "Normal" }

// Boolean
{ "type": "boolean", "value": true }

Common Vital Signs:

  • Blood Pressure (systolic/diastolic)
  • Heart Rate
  • Temperature
  • Respiratory Rate
  • Oxygen Saturation
  • Height, Weight, BMI

Relationships:

  • Belongs to: Tenant, Patient, Encounter, Practitioner
  • References: reference.lab_tests, reference.snomed_concepts

FHIR Mapping: Observation resource


Entity: AllergyIntolerance

Purpose: Patient allergies and intolerances (FHIR: AllergyIntolerance)

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
tenant_idUUIDYesOwning tenant
patient_idUUIDYesPatient reference
encounter_idUUIDNoRecording encounter
recorder_idUUIDNoRecording practitioner
clinical_statusEnumYesactive, inactive, resolved
verification_statusEnumNounconfirmed, confirmed, refuted
typeEnumNoallergy, intolerance
categoryEnumNofood, medication, environment, biologic
criticalityEnumNolow, high, unable_to_assess
codeJSONBYesSubstance/allergen
onset_dateDateNoWhen allergy started
recorded_dateDateNoWhen recorded
reactionsJSONBNoReaction details
noteTextNoAdditional notes

Reactions Structure:

[
  {
    "substance": "Penicillin",
    "manifestation": ["Hives", "Difficulty breathing"],
    "severity": "severe",
    "onset": "immediate"
  }
]

Relationships:

  • Belongs to: Tenant, Patient, Encounter, Practitioner

FHIR Mapping: AllergyIntolerance resource


Medications

Entity: MedicationRequest

Purpose: Prescriptions and medication orders (FHIR: MedicationRequest)

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
tenant_idUUIDYesOwning tenant
patient_idUUIDYesPatient reference
encounter_idUUIDNoPrescribing encounter
requester_idUUIDYesPrescribing practitioner
statusEnumYesactive, on-hold, cancelled, completed, stopped, draft
intentEnumYesproposal, plan, order, original-order, reflex-order
priorityEnumNoroutine, urgent, asap, stat
medicationJSONBYesMedication details
dosage_instructionJSONBYesDosage instructions
dispense_requestJSONBNoDispensing details
substitution_allowedBooleanNoGeneric substitution allowed
reason_codeJSONBNoReason for medication
authored_onTimestampYesWhen prescribed
validity_period_startDateNoPrescription start
validity_period_endDateNoPrescription end
noteTextNoAdditional instructions

Medication Structure:

{
  "drug_id": "uuid",
  "name": "Metformin 500mg",
  "generic_name": "Metformin Hydrochloride",
  "form": "tablet",
  "strength": "500mg"
}

Dosage Instruction Structure:

{
  "sequence": 1,
  "text": "Take 1 tablet twice daily with meals",
  "timing": {
    "frequency": 2,
    "period": 1,
    "period_unit": "day"
  },
  "route": "oral",
  "dose_quantity": {
    "value": 1,
    "unit": "tablet"
  },
  "as_needed": false,
  "duration": {
    "value": 30,
    "unit": "day"
  }
}

Relationships:

  • Belongs to: Tenant, Patient, Encounter, Practitioner
  • References: reference.drugs

FHIR Mapping: MedicationRequest resource


Care Planning

Entity: CarePlan

Purpose: Treatment and care planning (FHIR: CarePlan)

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
tenant_idUUIDYesOwning tenant
patient_idUUIDYesPatient reference
encounter_idUUIDNoCreating encounter
episode_of_care_idUUIDNoRelated episode
author_idUUIDNoPlan author
statusEnumYesdraft, active, on-hold, revoked, completed
intentEnumYesproposal, plan, order
categoryEnumNoassess-plan, orders, overall-plan
titleStringNoPlan title
descriptionTextNoPlan description
period_startDateNoPlan start date
period_endDateNoPlan end date
activitiesJSONBNoPlanned activities
addressesJSONBNoConditions addressed
versionIntegerYesVersion number (default: 1)
replaces_idUUIDNoPrevious version reference
created_atTimestampYesCreation timestamp

Activities Structure:

[
  {
    "detail": {
      "kind": "ServiceRequest",
      "code": "Physical therapy",
      "status": "scheduled",
      "scheduled": "2024-02-01",
      "performer_id": "uuid"
    }
  },
  {
    "detail": {
      "kind": "MedicationRequest",
      "code": "Pain management",
      "status": "in-progress"
    }
  }
]

Versioning Pattern:

  • New versions created via replaces_id chain
  • Old versions remain immutable
  • Only one version can be active at a time

Relationships:

  • Belongs to: Tenant, Patient, Encounter, EpisodeOfCare, Practitioner
  • Has many: Goals
  • Self-referential: replaces_id for version chain

FHIR Mapping: CarePlan resource


Entity: Goal

Purpose: Patient health goals (FHIR: Goal)

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
tenant_idUUIDYesOwning tenant
patient_idUUIDYesPatient reference
care_plan_idUUIDNoRelated care plan
expressed_by_idUUIDNoWho expressed goal
lifecycle_statusEnumYesproposed, planned, accepted, active, on-hold, completed, cancelled
achievement_statusEnumNoin-progress, improving, worsening, no-change, achieved, not-achieved
priorityEnumNohigh, medium, low
categoryEnumNodietary, safety, behavioral, physiotherapy
descriptionTextYesGoal description
start_dateDateNoTarget start
targetJSONBNoTarget measures
status_dateDateNoLast status update
status_reasonTextNoReason for current status
noteTextNoAdditional notes

Target Structure:

{
  "measure": "HbA1c",
  "detail": {
    "type": "quantity",
    "value": 6.5,
    "comparator": "<=",
    "unit": "%"
  },
  "due_date": "2024-06-01"
}

Relationships:

  • Belongs to: Tenant, Patient, CarePlan, Practitioner

FHIR Mapping: Goal resource


Orders and Results

Entity: ServiceRequest

Purpose: Lab orders, imaging orders, referrals (FHIR: ServiceRequest)

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
tenant_idUUIDYesOwning tenant
patient_idUUIDYesPatient reference
encounter_idUUIDNoOrdering encounter
requester_idUUIDYesOrdering practitioner
statusEnumYesdraft, active, on-hold, revoked, completed
intentEnumYesproposal, plan, order, original-order
priorityEnumNoroutine, urgent, asap, stat
categoryEnumYeslaboratory, imaging, procedure, referral, consultation
codeJSONBYesService/test code
order_detailJSONBNoAdditional order details
quantityIntegerNoNumber of repetitions
occurrenceJSONBNoWhen service should occur
authored_onTimestampYesWhen ordered
reason_codeJSONBNoReason for order
supporting_infoJSONBNoAdditional clinical context
specimenJSONBNoSpecimen requirements
noteTextNoAdditional instructions

Relationships:

  • Belongs to: Tenant, Patient, Encounter, Practitioner
  • Has many: DiagnosticReports
  • References: reference.lab_tests, reference.procedures

FHIR Mapping: ServiceRequest resource


Entity: DiagnosticReport

Purpose: Lab results, imaging results (FHIR: DiagnosticReport)

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
tenant_idUUIDYesOwning tenant
patient_idUUIDYesPatient reference
encounter_idUUIDNoRelated encounter
service_request_idUUIDNoOriginal order
performer_idUUIDNoPerforming lab/center
statusEnumYesregistered, partial, preliminary, final, amended, cancelled
categoryEnumYeslaboratory, radiology, pathology, cardiology
codeJSONBYesReport type
effective_dateTimestampNoClinically relevant time
issuedTimestampNoWhen report issued
resultsJSONBNoObservation references
conclusionTextNoClinical conclusion
conclusion_codeJSONBNoCoded conclusions
presented_formJSONBNoAttached reports/images
noteTextNoAdditional comments

Results Structure (links to Observations):

[
  { "observation_id": "uuid", "name": "Hemoglobin", "value": "14.5 g/dL" },
  { "observation_id": "uuid", "name": "WBC Count", "value": "7500 /uL" }
]

Relationships:

  • Belongs to: Tenant, Patient, Encounter, ServiceRequest
  • Has many: Observations

FHIR Mapping: DiagnosticReport resource


Appointments

Entity: Appointment

Purpose: Scheduled clinical appointments (FHIR: Appointment)

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
tenant_idUUIDYesOwning tenant
patient_idUUIDYesPatient reference
facility_idUUIDYesFacility reference
practitioner_idUUIDNoPractitioner reference
service_idUUIDNoHealthcare service
statusEnumYesproposed, pending, booked, arrived, fulfilled, cancelled, noshow
service_typeEnumNoconsultation, follow_up, procedure, therapy
appointment_typeEnumNoroutine, walk_in, checkup, emergency
reason_codeJSONBNoReason for appointment
priorityIntegerNoPriority (1-10)
startTimestampYesStart time
endTimestampNoEnd time
slot_idUUIDNoBooked slot reference
createdTimestampYesWhen booked
cancellation_reasonTextNoIf cancelled
patient_instructionTextNoInstructions for patient
noteTextNoAdditional notes

Relationships:

  • Belongs to: Tenant, Patient, Facility, Practitioner, HealthcareService
  • Has one: Encounter (created on arrival)

FHIR Mapping: Appointment resource


AI-Assisted Care

Entity: TranscriptionSession

Purpose: AI Scribe transcription sessions linked to encounters

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
tenant_idUUIDYesOwning tenant
encounter_idUUIDYesRelated encounter
practitioner_idUUIDYesConducting practitioner
statusEnumYesrecording, processing, completed, failed
started_atTimestampYesSession start
ended_atTimestampNoSession end
duration_secondsIntegerNoTotal duration
audio_urlStringNoAudio recording URL
languageStringNoTranscription language
ai_providerEnumNoopenai, anthropic, google
ai_modelStringNoModel used
raw_transcriptTextNoRaw transcription
processed_transcriptJSONBNoStructured transcript
confidence_scoreDecimalNoOverall confidence (0.0-1.0)
error_messageTextNoIf failed

Processed Transcript Structure:

{
  "segments": [
    {
      "speaker": "practitioner",
      "start_time": 0,
      "end_time": 5.5,
      "text": "How are you feeling today?",
      "confidence": 0.95
    },
    {
      "speaker": "patient",
      "start_time": 6.0,
      "end_time": 12.0,
      "text": "I've been having headaches for the past week.",
      "confidence": 0.92
    }
  ],
  "summary": "Patient presents with one-week history of headaches..."
}

Relationships:

  • Belongs to: Tenant, Encounter, Practitioner
  • Has many: AiSuggestions

Entity: AiSuggestion

Purpose: AI-generated clinical suggestions (CDS)

Attributes:

AttributeTypeRequiredDescription
idUUIDYesPrimary identifier
tenant_idUUIDYesOwning tenant
encounter_idUUIDYesRelated encounter
transcription_session_idUUIDNoSource transcription
suggestion_typeEnumYesdiagnosis, medication, order, observation, care_plan, goal
categoryEnumNoclinical, documentation, administrative
contentJSONBYesSuggestion content
confidence_scoreDecimalNoAI confidence (0.0-1.0)
statusEnumYespending, accepted, rejected, modified
reviewed_by_idUUIDNoReviewing practitioner
reviewed_atTimestampNoReview timestamp
modification_noteTextNoIf modified, what changed
source_referenceJSONBNoSource evidence
created_resource_idUUIDNoIf accepted, created resource ID
created_resource_typeStringNoType of created resource

Content Structure (varies by type):

// Diagnosis suggestion
{
  "type": "diagnosis",
  "icd_code": "G43.909",
  "display": "Migraine, unspecified, not intractable",
  "confidence": 0.85,
  "evidence": ["Patient reports recurring headaches", "Photophobia mentioned"]
}

// Medication suggestion
{
  "type": "medication",
  "drug_name": "Sumatriptan",
  "dosage": "50mg",
  "frequency": "as needed",
  "confidence": 0.78,
  "rationale": "First-line treatment for acute migraine"
}

Status Flow:

pending --> accepted --> (creates resource)
       \--> rejected
       \--> modified --> (creates modified resource)

Relationships:

  • Belongs to: Tenant, Encounter, TranscriptionSession, Practitioner
  • Creates: Conditions, MedicationRequests, ServiceRequests, Observations, CarePlans, Goals

Schema Diagram

+---------------+
|   patients    |
+---------------+
       |
       +---------------------------------------------+
       |                    |                        |
       | 1:N                | 1:N                    | 1:N
       v                    v                        v
+---------------+    +---------------+        +---------------+
| patient_      |    | episodes_of_  |        | appointments  |
| facilities    |    | care          |        +---------------+
+---------------+    +---------------+
                            |
                            | 1:N
                            v
                     +---------------+       +---------------+
                     |  encounters   |------>| encounter_    |
                     +---------------+       | participants  |
                            |                +---------------+
                            |
       +--------------------+--------------------+
       |          |         |         |          |
       v          v         v         v          v
+----------+ +----------+ +------+ +--------+ +-------------+
|conditions| |observa-  | |medica| |service_| |transcription|
|          | |tions     | |tion_ | |requests| |_sessions    |
+----------+ +----------+ |reqs  | +--------+ +-------------+
                          +------+      |            |
                                        v            v
                                 +----------+  +----------+
                                 |diagnostic|  |ai_       |
                                 |_reports  |  |suggestions|
                                 +----------+  +----------+

+---------------+       +---------------+
|  care_plans   |------>|    goals      |
+---------------+       +---------------+
       |
       | (replaces_id)
       v
+---------------+
|  care_plans   | (previous version)
+---------------+

FHIR Resource Mapping

Internal EntityFHIR ResourceNotes
PatientPatientCore patient identity
EpisodeOfCareEpisodeOfCareTreatment program container
EncounterEncounterClinical visit/interaction
EncounterParticipantEncounter.participantMulti-practitioner support
ConditionConditionDiagnoses and problems
ObservationObservationVitals, labs, findings
AllergyIntoleranceAllergyIntoleranceAllergies and intolerances
MedicationRequestMedicationRequestPrescriptions
CarePlanCarePlanTreatment planning
GoalGoalPatient goals
ServiceRequestServiceRequestLab/imaging orders
DiagnosticReportDiagnosticReportResults
AppointmentAppointmentScheduled visits
TranscriptionSessionN/AAI Scribe (platform-specific)
AiSuggestionN/ACDS suggestions (platform-specific)

RLS Policies

-- All clinical tables: tenant isolation
CREATE POLICY tenant_isolation ON clinical.patients
    USING (tenant_id = current_setting('app.current_tenant_id')::uuid);

CREATE POLICY tenant_isolation ON clinical.encounters
    USING (tenant_id = current_setting('app.current_tenant_id')::uuid);

-- Similar policies for all tenant-scoped tables

LHR (Longitudinal Health Record) Implementation

The LHR is NOT stored as a table. It is a computed view aggregated on demand from:

  • Patient demographics
  • Conditions (problem list)
  • Medications (active prescriptions)
  • Observations (vitals history)
  • Allergies
  • Care Plans
  • Encounters (grouped by Episode)
  • Goals

LHR Computation Pattern:

LHR = aggregate(
  patient.demographics,
  conditions.where(clinical_status: active),
  medication_requests.where(status: active),
  observations.recent(90.days),
  allergy_intolerances.all,
  care_plans.where(status: active),
  encounters.grouped_by(episode_of_care),
  goals.where(lifecycle_status: active)
)

Reference: Clinical Data Hierarchy

On this page