Class 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.
      theResource - the resource to which extract the patient compartment identity
      theFhirContext - the active FhirContext
      theSearchParamExtractor - the configured search parameter extractor
      the optional patient compartment identifier
      Throws: - if received resource is of type "Patient" and ID is not assigned.
    • getResourceCompartment

      public static Optional<String> getResourceCompartment(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
      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
      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
      resourceDef - the RuntimeResourceDefinition providing the RuntimeSearchParam list
      the RuntimeSearchParam filtered list