Skip to content

Base Components

Encounter

An encounter is like a chapter in the patient's hospital story. It represents each time they interact with healthcare providers - whether it's a quick check at triage, a consultation with a doctor, or a surgical procedure.

Think of encounters as the "scenes" where medical care happens. Each encounter has a beginning and end time, involves specific healthcare providers, and takes place in a particular location within the hospital.

Data Model

FieldTypeDescription
patient_codestringWhich patient this encounter belongs to
visit_codestringWhich hospital visit this is part of
codestringUnique identifier for this specific encounter
classstringType of encounter ("IPD", "OPD", or "EMERGENCY")
namestringWhere it happened (ward name, clinic, etc.)
service_typestringWhat kind of service was provided
started_atdatetimeWhen the encounter began
ended_atdatetimeWhen the encounter ended
encountered_bystringName of the healthcare provider
titlestringProvider's role (Doctor, Nurse, etc.)
created_atdatetimeWhen this record was created
updated_atdatetimeWhen this record was last updated

Example

json
{
  "patient_code": "P25003877",  
  "visit_code": "V420650",  
  "code": "E317001",  
  "class_name": "OPD",  
  "name": "General Medicine",
  "service_type": "General Consultation",  
  "started_at": "2025-03-17T09:35:00.000+07:00",  
  "ended_at": "2025-03-17T10:15:00.000+07:00",  
  "encountered_by": "Dr. Chhun Sovannarith",
  "title": "Doctor",
  "created_at": "2025-03-17T09:35:00.000+07:00",  
  "updated_at": "2025-03-17T10:15:00.000+07:00"  
}

Observations

Observations are like detailed notes that healthcare providers write down about everything they notice, measure, or learn about a patient. Think of them as the "facts" collected during the patient's journey.

These could be anything from "Patient says they have a headache" to "Blood pressure is 120/80" to "Patient traveled to Mondulkiri province recently." Observations are incredibly flexible because healthcare involves collecting many different types of information.

Why are they flexible? Every patient is unique, and every hospital might track different things. Some might record detailed family history, others might focus on specific symptoms. The observation system adapts to capture whatever information is important for that patient's care.

Data Model

FieldTypeDescription
encounter_codestringWhich encounter this observation was made during
observation_codestringLinks to a parent observation (for grouping related observations)
namestringWhat was observed (e.g., "Blood Pressure", "Patient Complaint")
categorystringType of observation (e.g., "Vital Signs", "Social History")
valuevariousThe actual observation data (depends on value_type)
value_typestringWhat kind of data this is (text, number, true/false, etc.)
value_unitstringUnit of measurement (like "mmHg" for blood pressure)

Value Types - The Flexibility System

Since observations can be anything from a simple yes/no answer to complex medical data, we use different "value types" to handle this variety. Think of value types as different containers for different kinds of information.

Boolean (True/False) Example

"Does the patient smoke?"

json
{  
  "encounter_code": "EN20250317001",  
  "observation_code": null,  
  "name": "Smoker",  
  "category": "Social History",  
  "value": false,  
  "value_type": "boolean",  
  "value_unit": null  
}

String (Short Text) Example

"What's the patient's blood type?"

json
{  
  "encounter_code": "EN20250317001",  
  "observation_code": null,  
  "name": "Blood Type",  
  "category": "Laboratory",  
  "value": "O+",  
  "value_type": "string",  
  "value_unit": null  
}

Text (Long Description) Example

"What are the patient's symptoms and recent travel history?"

json
{  
  "encounter_code": "EN20250317001",  
  "observation_code": null,  
  "name": "Clinical Notes",  
  "category": "Assessment",  
  "value": "Patient reports symptoms of malaria including periodic fever, headache, and fatigue. Has history of travel to Mondulkiri province two weeks ago.",  
  "value_type": "text",  
  "value_unit": null  
}

Numeric Example

"What's the patient's blood glucose level?"

json
{  
  "encounter_code": "EN20250317001",  
  "observation_code": null,  
  "name": "Blood Glucose",  
  "category": "Vital Signs",  
  "value": 110,  
  "value_type": "integer",  
  "value_unit": "mg/dL"  
}

Array (List) Example

"What symptoms does the patient have?"

json
{  
  "encounter_code": "EN20250317001",  
  "observation_code": null,  
  "name": "Symptoms",  
  "category": "History",  
  "value": ["Fever", "Headache", "Fatigue", "Joint Pain"],  
  "value_type": "array",  
  "value_unit": null  
}

Complex (Structured Data) Example

"What's the patient's malaria risk assessment?"

json
{  
  "encounter_code": "EN20250317001",  
  "observation_code": null,  
  "name": "Malaria Risk Assessment",  
  "category": "Risk Assessment",  
  "value": {  
    "risk_level": "High",  
    "travel_history": true,  
    "prevention_measures": ["Bed nets", "Repellent"],  
    "endemic_area": "Mondulkiri province"  
  },  
  "value_type": "complex",  
  "value_unit": null  
}

TIP

Note: Medical history conditions use the same flexible structure as observations, but we've simplified them in the Medical History section to make implementation easier.


Conditions

Conditions represent medical diagnoses, health problems, or clinical states that affect a patient. Think of them as the "medical labels" that doctors assign to describe what's wrong with a patient or what health issues they're managing.

Unlike the simplified diagnosis component, conditions provide a more comprehensive way to track ongoing health issues, their severity, when they started, and their current status.

Data Model

FieldTypeDescription
patient_codestringWhich patient this condition belongs to
visit_codestringWhich hospital visit this condition was identified during
encounter_codestringWhich encounter this condition was documented in
codestringUnique identifier for this condition record
condition_codestringStandard medical code for the condition (ICD-10, etc.)
condition_namestringHuman-readable name of the condition
categorystringType of condition (primary, secondary, chronic, etc.)
severitystringHow serious the condition is (mild, moderate, severe)
statusstringCurrent state (active, resolved, inactive, etc.)
onset_datedateWhen the condition first started
recorded_datedatetimeWhen this condition was documented
notestextAdditional clinical notes about the condition
created_atdatetimeWhen this record was created
updated_atdatetimeWhen this record was last updated

Example

json
{
  "patient_code": "P25003877",
  "visit_code": "V420650",
  "encounter_code": "E317001",
  "code": "COND001",
  "condition_code": "E11.9",
  "condition_name": "Type 2 diabetes mellitus without complications",
  "category": "chronic",
  "severity": "moderate",
  "status": "active",
  "onset_date": "2020-05-15",
  "recorded_date": "2025-03-17T09:45:00.000+07:00",
  "notes": "Patient reports good glucose control with metformin",
  "created_at": "2025-03-17T09:45:00.000+07:00",
  "updated_at": "2025-03-17T09:45:00.000+07:00"
}

Services

Services represent the healthcare procedures, treatments, or interventions provided to a patient during their visit. Think of them as the "actions" that healthcare providers perform - from simple consultations to complex surgical procedures.

Services help track what was actually done for the patient, who performed it, when it happened, and often connect to billing and resource management systems.

Data Model

FieldTypeDescription
patient_codestringWhich patient received this service
visit_codestringWhich hospital visit this service was part of
encounter_codestringWhich encounter this service was provided during
codestringUnique identifier for this service record
service_codestringStandard code for the service (CPT, local codes, etc.)
service_namestringHuman-readable name of the service
categorystringType of service (consultation, procedure, diagnostic, etc.)
departmentstringWhich hospital department provided the service
provider_namestringName of the healthcare provider who performed the service
provider_titlestringRole/title of the provider (Doctor, Nurse, Technician)
performed_atdatetimeWhen the service was performed
duration_minutesintegerHow long the service took
quantityintegerHow many units of this service were provided
unit_pricenumberCost per unit of service
total_pricenumberTotal cost for this service
statusstringService status (completed, cancelled, pending, etc.)
notestextAdditional notes about the service
created_atdatetimeWhen this record was created
updated_atdatetimeWhen this record was last updated

Example

json
{
  "patient_code": "P25003877",
  "visit_code": "V420650",
  "encounter_code": "E317001",
  "code": "SRV001",
  "service_code": "99213",
  "service_name": "Office visit for established patient",
  "category": "consultation",
  "department": "General Medicine",
  "provider_name": "Dr. Chhun Sovannarith",
  "provider_title": "Doctor",
  "performed_at": "2025-03-17T09:35:00.000+07:00",
  "duration_minutes": 30,
  "quantity": 1,
  "unit_price": 25000,
  "total_price": 25000,
  "status": "completed",
  "notes": "Routine follow-up for diabetes management",
  "created_at": "2025-03-17T09:35:00.000+07:00",
  "updated_at": "2025-03-17T10:05:00.000+07:00"
}

Service Categories

CategoryDescriptionExamples
ConsultationDoctor visits and medical consultationsGeneral consultation, specialist consultation
DiagnosticTests and examinations to diagnose conditionsBlood tests, X-rays, ultrasounds
TherapeuticTreatments and interventionsWound dressing, injections, physiotherapy
SurgicalSurgical procedures and operationsMinor surgery, major surgery, endoscopy
EmergencyEmergency care servicesEmergency consultation, resuscitation
AdministrativeNon-clinical servicesRegistration, medical certificates