Stream: implementers
Topic: Validating a FHIR Bundle
Alexander Dimitrov (Apr 19 2021 at 13:04):
Hi, after having uploaded a FHIR Bundle (type document) to a FHIR Server, is it possible to validate a resource within the Bundle (for example a MedicationStatement) against a specific profile with a GET Request?
For example like this, but I would like to validate a specific instance of the FHIR Bundle:
GET {{host}}/Bundle/1989598/$validate?_profile=http://hl7.org/fhir/uv/ips/StructureDefinition/MedicationStatement-uv-ips HTTP/1.1
Or would such a validation be only possible with the FHIR Validator?
Thanks in advance!
Vassil Peytchev (Apr 19 2021 at 13:57):
I don't think this is possible - as far as I know, resources within a Bundle cannot be directly addressed.
Oliver Egger (Apr 19 2021 at 13:59):
This is not directly possible (also not with the FHIR Validator). But you can create a Bundle document profile which indicates that the entries to follow the MedicationStatement-uv-ips profile.
E.g we do this for our exchange formats that we write first a profile requiring that the bundle needs a composition (http://fhir.ch/ig/ch-emed/StructureDefinition-ch-emed-document-medicationcard.html) and then profile the composition with its section and entries (http://fhir.ch/ig/ch-emed/StructureDefinition-ch-emed-composition-medicationcard.html) to the individual medication statement profile.
Yunwei Wang (Apr 19 2021 at 14:19):
I found a strange behavior. Assume a bundle profile requires [1..1] Patient entry with profile A which mandates [1..1] Patient.name. If a Bundle instance contains only one Patient resource but without Patient.name, the validator reports that the bundle requires [1..1] Patient entry with profile A but found 0. This message is correct but not pointing out the real error that Patient is missing Patient.name
Lloyd McKenzie (Apr 19 2021 at 14:22):
The validator's process is perfectly logical because you haven't said that all Patient resources must correspond to your profile. If you sliced by type and then declared the profile, that might give you a clearer result.
Alexander Dimitrov (Apr 19 2021 at 16:27):
Thanks for the responses! Writing a profile for the bundle seems like a clean solution, will try it!
Kevin Mayfield (Apr 19 2021 at 18:57):
We've done a small extension for bundle type=message to validate according to a MessageDefintion (based on MessageHeader.eventCoding)
I'd probably do similar for type=document to validate against a Composition profile - profile for validation is selected based on Composition.type
Kevin Mayfield (Apr 19 2021 at 18:57):
Last updated: Apr 12 2022 at 19:14 UTC