Class ResourceCompartmentUtil

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

public class ResourceCompartmentUtil extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    static List<ca.uhn.fhir.context.RuntimeSearchParam>
    getPatientCompartmentSearchParams(ca.uhn.fhir.context.RuntimeResourceDefinition theResourceDef)
    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
    static List<ca.uhn.fhir.context.RuntimeSearchParam>
    getPatientCompartmentSearchParams(ca.uhn.fhir.context.RuntimeResourceDefinition theResourceDef, boolean theIncludeSupersets)
    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
    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
    static Stream<org.hl7.fhir.instance.model.api.IBaseReference>
    getResourceCompartmentReferences(org.hl7.fhir.instance.model.api.IBaseResource theResource, List<ca.uhn.fhir.context.RuntimeSearchParam> theCompartmentSps, ISearchParamExtractor mySearchParamExtractor)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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
    • getResourceCompartmentReferences

      @Nonnull public static Stream<org.hl7.fhir.instance.model.api.IBaseReference> getResourceCompartmentReferences(org.hl7.fhir.instance.model.api.IBaseResource theResource, List<ca.uhn.fhir.context.RuntimeSearchParam> theCompartmentSps, ISearchParamExtractor mySearchParamExtractor)
    • getPatientCompartmentSearchParams

      @Nonnull public static List<ca.uhn.fhir.context.RuntimeSearchParam> getPatientCompartmentSearchParams(@Nonnull ca.uhn.fhir.context.RuntimeResourceDefinition theResourceDef)
      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:
      theResourceDef - the RuntimeResourceDefinition providing the RuntimeSearchParam list
      Returns:
      the RuntimeSearchParam filtered list
    • getPatientCompartmentSearchParams

      @Nonnull public static List<ca.uhn.fhir.context.RuntimeSearchParam> getPatientCompartmentSearchParams(@Nonnull ca.uhn.fhir.context.RuntimeResourceDefinition theResourceDef, boolean theIncludeSupersets)
      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:
      theResourceDef - the RuntimeResourceDefinition providing the RuntimeSearchParam list
      theIncludeSupersets - If false, include only the parameters explicitly defined as being a part of the Patient compartment. If true, include other parameters whose path would include the same resources. For example, for the Observation resource type, the superset would include both the subject and patient parameters, where the non-superset would include only the patient parameter.
      Returns:
      the RuntimeSearchParam filtered list
      Since:
      8.6.0