Aidbox & FHIR formats
Difference between Aidbox and FHIR formats
Aidbox stores FHIR resources almost as is with 3 types of isomorphic transformations:
References
Union (Choice Types)
First-Class Extensions
References:
In FHIR, references are represented as URI string. In most cases, you are interested in discrete parts of references like resource id and type. For performance and accuracy reasons Aidbox parses reference and stores its parts in discrete fields. There are three types of references - absolute, relative, and local. Aidbox parses them into different attributes.
Relative (interpreted as a reference to a resource on the same server; trigger referential consistency check) :
reference is parsed into a pair of {id,resourceType}
attributes
Absolute (interpreted as a reference to an external resource; no ref validation)
reference is parsed into the uri attribute
Local (interpreted as a local ref to contained resources )
reference is parsed into a ref attribute
To enable referential integrity checks in extensions (extension.valueReference
) create a first-class extension.
Union (Choice) Types:
Some elements can have multiple types. Such elements in FHIR spec prefixed with [x]
like Observation.value[x]
and represented in JSON in a wrong (postfixed) way likeObservation.valueString
. The simple logical check "why it's wrong" is "you could not have a collection of union elements in FHIR JSON!". Aidbox fixes this moving type as a key inside a nested object - valueString:... => value: {string: ...}
First-Class Extensions
While FHIR uses two different ways to define core elements and extensions, Aidbox provides unified framework to describe both. Aidbox supports user-defined attributes or "first-class extensions". In Aidbox, you can define new attributes (elements) for existing (FHIR) resources. Let's illustrate this on race complex attribute for Patient from US-Core FHIR Profile.
This is how a patient with race looks in FHIR format:
If you try to save this resource in "default", Aidbox will keep these extensions as is. But if you define attributes for these extensions, Aidbox will store them in a more friendly format.
Now you can test how a resource will be stored in Aidbox with:
Read more about /$to-format Operation.
The response should be:
Last updated