Creating Observation resources (Test results)
- 1 How
How
When you send the Observation resource, you will assign it a logical id.
Reference the logical ID of a previously created Patient resource in the subject field of the Observation.
A status must be included. See the FHIR R4 spec for the status value set.
A category must be included. For test results, this category should be ‘laboratory'.
Include any other information in the Observation, using coding when possible. Test results should have LOINC codes and appropriate units.
POST https://<client>.fhir-api.sandbox.patientsknowbest.com/fhir/Observation
Very basic Observation resource example (with no coding):
{
"resourceType": "Observation",
"status": "final",
"id": "<Client assigned resource ID>",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "laboratory",
"display": "Laboratory"
}
],
"text": "Laboratory"
}
],
"code": {
"coding": [
{
"display": "C reactive protein"
}
]
},
"subject": {
"reference": "Patient/<Client assigned Patient resource ID>"
},
"effectiveDateTime": "2026-05-03",
"valueQuantity": {
"unit": "mg/L",
"value": 3.3
},
"interpretation": [
{
"text": "Normal"
}
],
"referenceRange": [
{
"low": {
"value": 3
},
"high": {
"value": 5
},
"text": "3.0-5.0"
}
]
}
Very basic Observation resource example (with local coding):
{
"resourceType": "Observation",
"status": "final",
"id": "<Client assigned resource ID>",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "laboratory",
"display": "Laboratory"
}
],
"text": "Laboratory"
}
],
"code": {
"coding": [
{
"system": "<my-local-code-system>",
"code": "54563",
"display": "C reactive protein"
}
]
},
"subject": {
"reference": "Patient/<Client assigned Patient resource ID>"
},
"effectiveDateTime": "2026-05-03",
"valueQuantity": {
"unit": "mg/L",
"value": 3.3
},
"interpretation": [
{
"text": "Normal"
}
],
"referenceRange": [
{
"low": {
"value": 3
},
"high": {
"value": 5
},
"text": "3.0-5.0"
}
]
}Very basic Observation resource example (with LOINC coding):
{
"resourceType": "Observation",
"id": "<Client assigned logical id>",
"status": "final",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "laboratory",
"display": "Laboratory"
}
],
"text": "Laboratory"
}
],
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "1988-5",
"display": "C reactive protein [Mass/volume] in Serum or Plasma"
}
]
},
"subject": {
"reference": "Patient/<Client assigned Patient resource logical ID>
},
"effectiveDateTime": "2026-05-03",
"valueQuantity": {
"unit": "mg/L",
"value": 3.3
},
"interpretation": [
{
"text": "Normal"
}
],
"referenceRange": [
{
"low": {
"value": 3
},
"high": {
"value": 5
},
"text": "3.0-5.0"
}
]
}