Skip to main content

Template Integration

Rad AI Reporting templates use an observationValue(code) formula field to automatically populate values from Observation resources, whether the Observation was posted directly to the FHIR Store or sent via a FHIRcast DiagnosticReport-update event.

Matching​

observationValue(code) matches against Observation.code.coding[0].code, case-insensitively.

info

If a study has more than one Observation with the same code, the most recently updated one is used.

If an Observation has components (related measurements), each component is treated as its own, independently addressable observation, matched by the component's own component.code.coding[0].code.

Value​

observationValue(code) displays, in order:

  1. valueQuantity: {value}{unit} if a unit is present, {value} if not.
  2. valueString: displayed as-is.
  3. If neither is present, the Observation's narrative text (Observation.text.div).

No other value[x] field (e.g. valueBoolean, valueCodeableConcept, valueRange, etc.) is currently supported.

Examples​

valueQuantity​

{
"resourceType": "Observation",
"status": "final",
"code": {
"coding": [
{
"code": "MAMMO_LT_CC_COMPRESSED_THICKNESS"
}
]
},
"valueQuantity": {
"value": 52,
"unit": "mm"
}
}

observationValue("MAMMO_LT_CC_COMPRESSED_THICKNESS") inserts "52 mm" into the report.

valueString​

{
"resourceType": "Observation",
"status": "final",
"code": {
"coding": [
{
"code": "US_CAROTID_RT_WAVEFORM_PATTERN"
}
]
},
"valueString": "Triphasic"
}

observationValue("US_CAROTID_RT_WAVEFORM_PATTERN") inserts "Triphasic" into the report.

Narrative fallback​

{
"resourceType": "Observation",
"status": "final",
"code": {
"coding": [
{
"code": "11726-7",
"display": "Peak systolic velocity"
}
]
},
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">128 cm/s</div>"
}
}

Neither valueQuantity nor valueString is present, so observationValue("11726-7") falls back to the narrative and inserts "128 cm/s" into the report.