Class CascadingDeleteInterceptor

  • public class CascadingDeleteInterceptor
    extends Object
    Interceptor that allows for cascading deletes (deletes that resolve constraint issues).

    For example, if DiagnosticReport/A has a reference to Observation/B it is not normally possible to delete Observation/B without first deleting DiagnosticReport/A. With this interceptor in place, it is.

    When using this interceptor, client requests must include the parameter _cascade=delete on the DELETE URL in order to activate cascading delete, or include the request header X-Cascade-Delete: delete

    • Constructor Detail

      • CascadingDeleteInterceptor

        public CascadingDeleteInterceptor​(@Nonnull
                                          ca.uhn.fhir.context.FhirContext theFhirContext,
                                          ca.uhn.fhir.jpa.api.dao.DaoRegistry theDaoRegistry,
                                          ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster theInterceptorBroadcaster)
        theDaoRegistry - The DAO registry (must not be null)
    • Method Detail

      • handleDeleteConflicts

        public DeleteConflictOutcome handleDeleteConflicts​(ca.uhn.fhir.jpa.api.model.DeleteConflictList theConflictList,
      • outgoingFailureOperationOutcome

        public void outgoingFailureOperationOutcome​( theRequestDetails,
                                                    org.hl7.fhir.instance.model.api.IBaseOperationOutcome theResponse)
      • outgoingResponse

        public void outgoingResponse​( theRequestDetails,
                                     org.hl7.fhir.instance.model.api.IBaseResource theResponse)
      • shouldCascade

        protected shouldCascade​(@Nullable
        Subclasses may override
        theRequest - The REST request (may be null)
        Returns true if cascading delete should be allowed