The Observation resource represents clinical measurements and assertions. All observations must reference a valid Patient resource.
Endpoints
Create Observation
Requires admin or practitioner role.
POST /api/fhir/Observation
Authorization: Bearer {token}
Content-Type: application/json
Observation status: registered, preliminary, final, amended, corrected, cancelled, entered-in-error, unknown
What was observed (LOINC, SNOMED CT, or local codes)
Reference to Patient in format {"reference": "Patient/{id}"}
Clinically relevant time/date for the observation
Actual result value with unit
Result as a string (alternative to valueQuantity)
Comments about the observation
Example Request
curl -X POST https://api.example.com/api/fhir/Observation \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"resourceType": "Observation",
"status": "final",
"code": {
"coding": [{
"system": "http://loinc.org",
"code": "8867-4",
"display": "Heart rate"
}]
},
"subject": {
"reference": "Patient/65f1234567890abcdef12345"
},
"effectiveDateTime": "2024-03-15T10:30:00Z",
"valueQuantity": {
"value": 72,
"unit": "beats/minute",
"system": "http://unitsofmeasure.org",
"code": "/min"
},
"interpretation": [{
"coding": [{
"system": "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation",
"code": "N",
"display": "Normal"
}]
}]
}'
Response
{
"resourceType": "Observation",
"id": "65f2345678901abcdef23456",
"status": "final",
"code": {
"coding": [{
"system": "http://loinc.org",
"code": "8867-4",
"display": "Heart rate"
}]
},
"subject": {
"reference": "Patient/65f1234567890abcdef12345"
},
"effectiveDateTime": "2024-03-15T10:30:00Z",
"valueQuantity": {
"value": 72,
"unit": "beats/minute",
"system": "http://unitsofmeasure.org",
"code": "/min"
}
}
List Observations
GET /api/fhir/Observation
Authorization: Bearer {token}
Filter by patient: Patient/{id}
Results per page (default: 20)
Pagination offset (default: 0)
Example Request
curl -X GET "https://api.example.com/api/fhir/Observation?subject=Patient/65f1234567890abcdef12345" \
-H "Authorization: Bearer YOUR_TOKEN"
Get Observation by ID
GET /api/fhir/Observation/:id
Authorization: Bearer {token}
Update Observation
Requires admin or practitioner role.
PUT /api/fhir/Observation/:id
Authorization: Bearer {token}
Content-Type: application/json
Common Vital Signs
Blood Pressure
LOINC: 85354-9 (systolic), 85354-9 (diastolic)
Oxygen Saturation
LOINC: 2708-6
Role Permissions
| Role | Create | Read | Update |
|---|
| Admin | ✅ | ✅ | ✅ |
| Practitioner | ✅ | ✅ | ✅ |
| Auditor | ❌ | ✅ | ❌ |