Creating Observations
For creating Observation resources, the api will support a single POST to an Observation endpoint fhir/R4/Observation
or a Bundle (outlined in detail below) to the fhir/R4
endpoint
warning
The meta.account.reference
must be set with a valid ORGANIZATION_ID
or the request will error out
Posting a single Observation
curl --request POST \
--url ${BASE_URL}/fhir/R4/Observation \
--header 'Authorization: Bearer ${access_token}' \
--header 'Content-Type: application/json' \
--data '{
"resourceType": "Observation",
"status": "final",
"meta": {
"account": {
"reference": "Organization/${ORGANIZATION_ID}"
}
},
"subject": {
"type": "Patient",
"identifier": {
"system": "http://example.org/patient-ids",
"value": "123456",
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "MR"
}
]
}
}
},
"partOf": [
{
"type": "ImagingStudy",
"identifier": {
"system": "http://example.org/filler-order-number",
"value": "1234",
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "ACSN"
}
]
}
}
},
],
"code": {
"coding": [
{
"code": "10231-9",
"display": "Right ventricular Ejection fraction"
}
]
},
"valueQuantity": {
"value": 29,
"unit": "%",
"system": "http://unitsofmeasure.org",
"code": "%"
},
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">29%</div>"
}
}'
Batch POST JSON Body example (HL7 FHIR Bundle)
curl --request POST \
--url ${BASE_URL}/fhir/R4 \
--header 'Authorization: Bearer ${access_token}' \
--header 'Content-Type: application/json' \
--data '{
"resourceType": "Bundle",
"type": "batch",
"entry": [
{
"resource": {
"resourceType": "Observation",
"status": "final",
"meta": {
"account": {
"reference": "Organization/${ORGANIZATION_ID}"
}
},
"subject": {
"type": "Patient",
"identifier": {
"system": "http://example.org/patient-ids",
"value": "123456",
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "MR"
}
]
}
}
},
"partOf": [
{
"type": "ImagingStudy",
"identifier": {
"system": "http://example.org/filler-order-number",
"value": "1234",
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "ACSN"
}
]
}
}
}
],
"code": {
"coding": [
{
"code": "10231-9",
"display": "Right ventricular Ejection fraction"
}
]
},
"valueQuantity": {
"value": 29,
"unit": "%",
"system": "http://unitsofmeasure.org",
"code": "%"
},
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">29%</div>"
}
},
"request": {
"method": "POST",
"url": "Observation"
}
},
{
"resource": {
"resourceType": "Observation",
"status": "final",
"meta": {
"account": {
"reference": "Organization/${ORGANIZATION_ID}"
}
},
"subject": {
"type": "Patient",
"identifier": {
"system": "http://example.org/patient-ids",
"value": "123456",
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "MR"
}
]
}
}
},
"partOf": [
{
"type": "ImagingStudy",
"identifier": {
"system": "http://example.org/filler-order-number",
"value": "1234",
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "ACSN"
}
]
}
}
}
],
"code": {
"coding": [
{
"code": "10231-5",
"display": "Left ventricular Ejection fraction"
}
]
},
"valueQuantity": {
"value": 35,
"unit": "%",
"system": "http://unitsofmeasure.org",
"code": "%"
},
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">35%</div>"
}
},
"request": {
"method": "POST",
"url": "Observation"
}
}
]
}
'