Observations
Observations represent clinical measurements and findings including vital signs, lab results, and other diagnostic data. All observations are stored as FHIR Observation resources.
Endpoints
/api/v1/observations/Create an observation/api/v1/observations/List observations/api/v1/observations/{id}/Get observation details/api/v1/vital-signs/Record vital signs/api/v1/vital-signs/List vital signsThe Observation Object
Attributes
iduuidUnique identifier.
patient_uhidstringPatient UHID.
encounter_iduuidnullableAssociated encounter ID.
statusstringStatus: registered, preliminary, final, amended.
categorystringCategory: vital-signs, laboratory, imaging, etc.
codestringLOINC or SNOMED code for the observation.
code_displaystringHuman-readable name.
valuenumber|stringObservation value.
unitstringnullableUnit of measurement.
reference_range_lownumbernullableLow end of normal range.
reference_range_highnumbernullableHigh end of normal range.
interpretationstringnullableInterpretation: normal, abnormal, critical.
performer_iduuidnullableProvider who recorded the observation.
effective_datetimedatetimeWhen the observation was made.
fhir_observation_idstringFHIR Observation resource ID.
{
"id": "obs-123-456-789",
"patient_uhid": "UG123456789A",
"encounter_id": "enc-abc-123",
"status": "final",
"category": "vital-signs",
"code": "8867-4",
"code_display": "Heart rate",
"value": 72,
"unit": "beats/min",
"reference_range_low": 60,
"reference_range_high": 100,
"interpretation": "normal",
"performer_id": "prov-xyz-789",
"effective_datetime": "2024-01-15T10:30:00Z",
"fhir_observation_id": "Observation/fhir-obs-123"
}Create an Observation
Records a new clinical observation for a patient.
/api/v1/observations/Request Body
patient_uhidstringrequiredPatient UHID
codestringrequiredLOINC or SNOMED code
code_displaystringrequiredHuman-readable name
valuenumber|stringrequiredObservation value
unitstringoptionalUnit of measurement
categorystringoptionalCategory
Default: vital-signs
encounter_iduuidoptionalAssociated encounter
reference_range_lownumberoptionalNormal range low
reference_range_highnumberoptionalNormal range high
interpretationstringoptionalInterpretation code
effective_datetimedatetimeoptionalWhen observed
curl -X POST https://api.mediloop.co/api/v1/observations/ \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"patient_uhid": "UG123456789A",
"code": "8867-4",
"code_display": "Heart rate",
"value": 72,
"unit": "beats/min",
"category": "vital-signs",
"encounter_id": "enc-abc-123",
"reference_range_low": 60,
"reference_range_high": 100
}'{
"id": "obs-new-123",
"patient_uhid": "UG123456789A",
"status": "final",
"code": "8867-4",
"code_display": "Heart rate",
"value": 72,
"unit": "beats/min",
"interpretation": "normal",
"effective_datetime": "2024-01-15T10:30:00Z"
}Record Vital Signs
Record multiple vital signs in a single request.
/api/v1/vital-signs/curl -X POST https://api.mediloop.co/api/v1/vital-signs/ \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"patient_uhid": "UG123456789A",
"encounter_id": "enc-abc-123",
"vitals": {
"heart_rate": 72,
"blood_pressure_systolic": 120,
"blood_pressure_diastolic": 80,
"temperature": 36.8,
"respiratory_rate": 16,
"oxygen_saturation": 98,
"weight": 70,
"height": 175
}
}'{
"success": true,
"patient_uhid": "UG123456789A",
"observations_created": 8,
"observation_ids": [
"obs-hr-001",
"obs-bp-sys-001",
"obs-bp-dia-001",
"obs-temp-001",
"obs-rr-001",
"obs-spo2-001",
"obs-wt-001",
"obs-ht-001"
]
}List Observations
Retrieve observations with filtering options.
/api/v1/observations/Query Parameters
patient_uhidstringoptionalFilter by patient
encounter_iduuidoptionalFilter by encounter
categorystringoptionalFilter by category
codestringoptionalFilter by LOINC code
date_fromdateoptionalFilter from date
date_todateoptionalFilter to date
curl "https://api.mediloop.co/api/v1/observations/?patient_uhid=UG123456789A&category=vital-signs" \
-H "Authorization: Bearer sk_test_..."{
"count": 2,
"results": [
{
"id": "obs-123",
"code_display": "Heart rate",
"value": 72,
"unit": "beats/min",
"effective_datetime": "2024-01-15T10:30:00Z"
},
{
"id": "obs-124",
"code_display": "Blood pressure systolic",
"value": 120,
"unit": "mmHg",
"effective_datetime": "2024-01-15T10:30:00Z"
}
]
}Common LOINC Codes
| Code | Display | Unit |
|---|---|---|
8867-4 | Heart rate | beats/min |
8480-6 | Systolic blood pressure | mmHg |
8462-4 | Diastolic blood pressure | mmHg |
8310-5 | Body temperature | °C |
9279-1 | Respiratory rate | breaths/min |
2708-6 | Oxygen saturation | % |
29463-7 | Body weight | kg |
8302-2 | Body height | cm |
2339-0 | Blood glucose | mg/dL |
Interpretation Codes
| Code | Description |
|---|---|
N | Normal - within reference range |
L | Low - below reference range |
H | High - above reference range |
LL | Critically low |
HH | Critically high |
A | Abnormal |