Stream: netherlands
Topic: Constraints based on other profiles
David Kijlstra (Aug 27 2021 at 07:35):
Hi all,
My question is whether it's possible to constrain (elements in) a profile based on another profile rather than based on an element within the same profile?
We are building a FHIR bundle for the DICA DHFA quality registry. In the DHFA registry, certain variables are only required when certain conditions are met. For example, the variable for complication only needs to be answered when the therapy variable has been answered as operative instead of conservative treatment. The therapy variable has been modelled in a Procedure profile derived from the zib-Procedure profile. The complication variable has been modelled in a Condition profile derived from the zib-Problem profile.
I would now like to constrain whether the complication profile is provided based on the data provided within the procedure profile. How would I go about doing this? The documentation on FHIR Path (http://hl7.org/fhirpath/) seems to only describe referencing elements within the same profile to build constraints.
Best,
David
Ardon Toonstra (Sep 01 2021 at 10:02):
Hi @David Kijlstra ,
I think you will need to have some kind of resource/profile above these profiles that bundles and describes how to exchange the required information , for example a Bundle, List, Composition, Questionnaire/QuestionnarieResponse or any other relevant resource that will reference both the Procedure and Condition profiles. In this profile, you can use the profile itself and FHIRPath to describe your business rules.
Another option could be to describe it in plain old text in an implementation guide.
Does this help?
Ardon Toonstra (Sep 01 2021 at 10:04):
Ah, I now read that you are doing this based on a Bundle! Very good. Let me try to give an example for how to use FHIRPath. You can use the resolve() function for references, but Bundle.entry.resource is not a reference :) but a resource straight away.
The resolve() function is described by the FHIR spec itself: https://hl7.org/fhir/fhirpath.html#functions
Ardon Toonstra (Sep 01 2021 at 10:12):
Here is an example on how to navigate into a specific resource in a Bundle, mind the where() and is() function. You can use the http://hl7.org/fhirpath/#types functions to specify the resource type.
Bundle.entry.resource.where(is(Binary).not()).where(meta.profile.empty()).empty()
Ardon Toonstra (Sep 01 2021 at 10:15):
If you are crafting FHIRPath statements, I recommend using a FHIRPath tester :D (https://www.microsoft.com/en-us/p/fhirpath-tester/9nxv8qdq154v#activetab=pivot:overviewtab)
Last updated: Apr 12 2022 at 19:14 UTC