Clinical resources
Observation
Learn about the Observation resource for clinical measurements and results.
Set up the SDK server client to run the examples using esus. The REST examples use a session token. To run them with the SDK’s API key, send X-API-Key instead of Authorization.
The Observation resource is one of the most widely used in FHIR. It records vital signs, lab results, imaging findings, and other clinical measurements.
API convention: the patient and encounter references are sent as flat string fields (
subjectId,encounterId). All ids are raw UUIDs (v4).
Types of Observations
The kind is set in category (system http://terminology.hl7.org/CodeSystem/observation-category):
vital-signs— blood pressure, heart rate, temperature, weightlaboratory— blood tests, urinalysis, pathologyimaging— imaging findingssocial-history— smoking, alcohol useexam— physical exam findings
Creating an Observation
curl -X POST https://api.esus.health/fhir/Observation \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/fhir+json" \
-d '{
"status": "final",
"subjectId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"encounterId": "c1a2e3d4-5b6f-7890-abcd-ef1234567890",
"category": [{
"coding": [{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "vital-signs",
"display": "Vital Signs"
}]
}],
"code": {
"coding": [{
"system": "http://loinc.org",
"code": "8867-4",
"display": "Heart rate"
}]
},
"effectiveDateTime": "2026-04-21T10:30:00Z",
"valueQuantity": {
"value": 72,
"unit": "beats/minute",
"system": "http://unitsofmeasure.org",
"code": "/min"
}
}'
const created = await esus.fhir.create("Observation", {
"status": "final",
"subjectId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"encounterId": "c1a2e3d4-5b6f-7890-abcd-ef1234567890",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "vital-signs",
"display": "Vital Signs"
}
]
}
],
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "8867-4",
"display": "Heart rate"
}
]
},
"effectiveDateTime": "2026-04-21T10:30:00Z",
"valueQuantity": {
"value": 72,
"unit": "beats/minute",
"system": "http://unitsofmeasure.org",
"code": "/min"
}
});
Required: subjectId and code. If you omit status, it is stored as final. The patient and encounter must exist in your organization; otherwise the API answers 400.
Value Types
| Field | Example |
|---|---|
valueQuantity | 72 beats/minute (value, unit, system, code) |
valueCodeableConcept | Coded value (e.g. “positive”) |
valueString | Free-text observation |
Multi-part observations, such as blood pressure, use component[], where each component has its own code and valueQuantity:
{
"status": "final",
"subjectId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"category": [{ "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/observation-category", "code": "vital-signs" }] }],
"code": { "coding": [{ "system": "http://loinc.org", "code": "85354-9", "display": "Blood pressure" }] },
"component": [
{
"code": { "coding": [{ "system": "http://loinc.org", "code": "8480-6", "display": "Systolic" }] },
"valueQuantity": { "value": 120, "unit": "mmHg" }
},
{
"code": { "coding": [{ "system": "http://loinc.org", "code": "8462-4", "display": "Diastolic" }] },
"valueQuantity": { "value": 80, "unit": "mmHg" }
}
]
}
Other optional fields: performer[] (references, e.g. { "reference": "Practitioner/<uuid>" }), interpretation, referenceRange, bodySite, method, note, and identifier (identifier can only be sent on create).
Observation Statuses
| Status | Meaning |
|---|---|
registered | Registered, no result yet |
preliminary | Preliminary result, not yet confirmed |
final | Complete and verified |
amended | Changed after being final |
corrected | Corrected after being final (data error) |
cancelled | Ordered but not performed |
entered-in-error | Error, should be ignored |
unknown | Status cannot be determined |
Searching Observations
| Parameter | Behavior |
|---|---|
_id | Exact id |
patient / subject | Patient id (<uuid> or Patient/<uuid>) |
encounter | Encounter id |
status | Exact |
code, category | Exact system|code, or partial text |
date | Date of effectiveDateTime, with optional prefix eq, gt, lt, ge, or le; repeat it for a range (date=ge2026-01-01&date=lt2026-02-01) |
value-quantity | Numeric value of valueQuantity.value, with optional prefix eq (default), gt, lt, ge, or le (e.g. value-quantity=gt100) |
identifier | Partial text |
Page with _count and _offset, and sort with _sort by _lastUpdated, date, or status.
curl "https://api.esus.health/fhir/Observation?patient=3fa85f64-5717-4562-b3fc-2c963f66afa6&code=http://loinc.org|8867-4&_sort=-date" \
-H "Authorization: Bearer YOUR_TOKEN"
const { resources, total } = await esus.fhir.search("Observation", {
"patient": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"code": "http://loinc.org|8867-4",
"_sort": "-date"
});
Read, update (PUT/PATCH), delete, and _history work the same as for Patient: see CRUD Operations.