Stream: hapi
Topic: deriving from BackboneElement
Georg Fette (Dec 02 2019 at 09:00):
I would like to automatically map openEHR archetypes into FHIR logical models (StructureDefinitions). In a subsequent step I would like to use a FHIR server (e.g. VONK or HAPI) to use these logical models as the basis to receive, store and provide query capabilities in order to handle resource instances of those models. What I heard of, VONK supports a mechanism out-of-the-box, so that a StructureDefinition can be given and the server can automatically handle those models as active profiles. In HAPI I tried a bit myself to create such a mechanism, so that the respective Java classes are automatically created so that the HAPI server can manage the models as active profiles.
However, I encountered a problem in my whole approach: In FHIR branching in models is done using BackboneElements. BackboneElements carry no information in themselves, but only provide the capability to contain subnodes. In openEHR the branching nodes are derivatives of classes from the openEHR reference model, so they contain fields that are inherited from their parent classes. It were beneficial concerning my approach that BackboneElements could also be derived by other profiles. I would like to get the opinion of implementers of VONK and HAPI what would happen, if derivatives of BackboneElement would be used in a StructureDefinition. Would the existing code out-of-the-box be able to handle such a modeling paradigm ?
Alexander Zautke (Dec 02 2019 at 13:47):
I guess in practice that you are "limited" by StructureDefinition.snapshot / differential. Both contain a list of elements of type ElementDefinition. ElementDefinition itself is derived from BackboneElement. That can't be changed. Therefore you have only the option to create a custom data type in your logical model which is derived from BackboneElement (see https://www.hl7.org/fhir/backboneelement.html -> Timing / Dosage data type), however that would only solve the issue for a single element. I don't see how you could create a nested structure with it.
Alexander Zautke (Dec 02 2019 at 13:48):
If you really need to, you could try to add an extension on BackboneElement
Georg Fette (Dec 02 2019 at 19:37):
The StructureDefinition.snapshots are composed of ElementDefinitions, but in the "type" of those ElementDefinitions that represent nodes with children, the "code" is always "BackboneElement" in all Profiles. I wonder if it were possible to use a derivative of BackboneElement in those cases. Extensions on BackboneElements are another option I haven't thought of yet. However, I think that none of those options are actually supported by FHIR server implementations as they are not used nowhere.
Grahame Grieve (Dec 02 2019 at 19:40):
I think you are asking about logical models. You can derive logical models from Element or BackboneElement - though really, why BackboneElement? - just use Element. But I don't know to what degree HAPI supports this
Georg Fette (Dec 02 2019 at 19:42):
hm, okay, when not even BackboneElement is needed, even better. Then my question could boil down to if resource instances of logical models can be managed with HAPI
Last updated: Apr 12 2022 at 19:14 UTC