FHIR Chat · Bundle - Transaction Import via Identifier -> Dependencies · hapi

Stream: hapi

Topic: Bundle - Transaction Import via Identifier -> Dependencies


view this post on Zulip David Meyers (Mar 15 2021 at 13:23):

We currently import data via bundle into our HAPI server using the "?identifier" syntax and PUT. The problem: When sending the bundle, resources do not yet exist on the FHIR server which reference some of the resources.
Prominent example: KdsMedikationsModul. The bundle basically contains the resources Medication, MedicationAdministration and MedicationStatement. MedicationAdministration and MedicationStatement reference Medication.Since the entry order in the processing on the server is random (?), it can of course happen that MedicationAdministration is processed first, at a time when Medication does not yet exist.

The first error message reads:
"Invalid match URL \"Medication?identifier=55555\" - No resources match this search".
(when re-executing / or trying to perform a batch operation, messages like "ConstraintViolentException" appear).

Is there a solution for this and is this a HAPI specific problem at all? I have attached a minimal example and it would be good if one of the experts could answer me whether this can work at all.
One solution, of course, would be to disassemble the bundle, separate it by resources and run it separately, but that would be anything but a nice solution. MedicationPUT_Example.json

view this post on Zulip Dexter (Mar 16 2021 at 09:01):

I think you can temporarily disable referential integrity when starting the server up in application.yaml. Specifically, these keys (are they called keys?). Relevant docs here.

# allow_external_references: true
allow_placeholder_references: true
enforce_referential_integrity_on_delete: false
enforce_referential_integrity_on_write: false

Example yaml here

I could be wrong though, I'm barely scratching the surface of HAPI and FHIR. I hope this helps :)

view this post on Zulip David Meyers (Mar 16 2021 at 14:17):

thx for that advice @Dexter
Weve tried this out, but unfortunately the issue type is still the same.


Last updated: Apr 12 2022 at 19:14 UTC