Referential integrity

By default, Oracle HDR-FHIR server blocks the deletion of a resource if any other resources have indexed references to the resource being deleted.

For example:

  • The resource Patient/102 has been saved in the repository, and a second resource Observation/558 is then saved as well, where the Observation.subject reference is a reference to the Patient.
  • In this situation, attempts to delete Patient/102 are blocked unless resources with references to this resource are deleted first (or are deleted as a part of the same transaction in the case of a transactional delete).

Disabling Referential Integrity on Delete

You can disable this referential integrity check on delete operation using below configuration property on the Oracle HDR-FHIR Server.

enforce_referential_integrity_on_delete: false

If it is enabled, resources can only be deleted if there are no other resources with indexed references to the candidate resource for deletion.

Disabling Referential Integrity on Write

You can disable this referential integrity check on write operation using below configuration property on the Oracle HDR-FHIR Server.

enforce_referential_integrity_on_write.: false

If it is enabled, reference targets will be checked. For example, if a patient contains a reference to managing organization Organization/FOO but FOO is not a valid ID for an organization on the server then the operation will be blocked unless this property has been disabled. This property can be used with caution since searches and other FHIR features may not behave as expected when referential integrity is not preserved. In cases, resource references to target resources that do not exist at the time that the source resource is created will not be indexed, even if the target resource is created later.