There are a lot of date properties in FHIR resources, but sometimes you don’t have the exact date. For example AllergyIntolerance has an ‘onset’ property which is a dateTime – but what if all we’re told is that they have been allergic to peanuts since childhood?
Well, assuming that a string is not as an option (as it is for Condition.onset for example) then one way is to use an extension. We’d add an onset property, but leave the value blank and just add the extension.
Here's what is looks like in JSON:
"_onsetDateTime": {
"extension": [
{
"url": "hl7.org.nz/fhir",
"valueString": "Since early childhood"
}
]
},
And in XML:
<onsetDateTime>
<extension url="hl7.org.nz/fhir">
<valueString value="Since childhood" />
</extension>
</onsetDateTime>
Just for fun, let’s think about how we’d create an extension definition that describes that (remember that extension definitions are actually StructureDefinition resources).
Read more of this post
Recent Comments