Class ResourceCompartmentUtil

java.lang.Object
ca.uhn.fhir.jpa.util.ResourceCompartmentUtil

public class ResourceCompartmentUtil extends Object
  • Constructor Details

  • Method Details

    • getPatientCompartmentIdentity

      public static Optional<String> getPatientCompartmentIdentity(org.hl7.fhir.instance.model.api.IBaseResource theResource, ca.uhn.fhir.context.FhirContext theFhirContext, ISearchParamExtractor theSearchParamExtractor)
      Extract, if exists, the patient compartment identity of the received resource. It must be invoked in patient compartment mode.
      Parameters:
      theResource - the resource to which extract the patient compartment identity
      theFhirContext - the active FhirContext
      theSearchParamExtractor - the configured search parameter extractor
      Returns:
      the optional patient compartment identifier
      Throws:
      ca.uhn.fhir.rest.server.exceptions.MethodNotAllowedException - if received resource is of type "Patient" and ID is not assigned.
    • getResourceCompartment

      public static Optional<String> getResourceCompartment(String theCompartmentName, org.hl7.fhir.instance.model.api.IBaseResource theResource, List<ca.uhn.fhir.context.RuntimeSearchParam> theCompartmentSps, ISearchParamExtractor mySearchParamExtractor)
      Extracts and returns an optional compartment of the received resource
      Parameters:
      theCompartmentName - the name of the compartment
      theResource - source resource which compartment is extracted
      theCompartmentSps - the RuntimeSearchParam list involving the searched compartment
      mySearchParamExtractor - the ISearchParamExtractor to be used to extract the parameter values
      Returns:
      optional compartment of the received resource
    • getPatientCompartmentSearchParams

      @Nonnull public static List<ca.uhn.fhir.context.RuntimeSearchParam> getPatientCompartmentSearchParams(ca.uhn.fhir.context.RuntimeResourceDefinition resourceDef)
      Returns a RuntimeSearchParam list with the parameters extracted from the received RuntimeResourceDefinition, which are of type REFERENCE and have a membership compartment for "Patient" resource
      Parameters:
      resourceDef - the RuntimeResourceDefinition providing the RuntimeSearchParam list
      Returns:
      the RuntimeSearchParam filtered list