Package ca.uhn.fhir.util
Class SearchParameterUtil
java.lang.Object
ca.uhn.fhir.util.SearchParameterUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic List
<RuntimeSearchParam> getAllPatientCompartmenRuntimeSearchParams
(FhirContext theFhirContext) static List
<RuntimeSearchParam> getAllPatientCompartmentRuntimeSearchParamsForResourceType
(FhirContext theFhirContext, String theResourceType) getAllResourceTypesThatAreInPatientCompartment
(FhirContext theFhirContext) getBaseAsStrings
(FhirContext theContext, IBaseResource theResource) static String
getCode
(FhirContext theContext, IBaseResource theResource) static String
getExpression
(FhirContext theFhirContext, IBaseResource theResource) static RuntimeSearchParam
getOnlyPatientCompartmentRuntimeSearchParam
(FhirContext theFhirContext, String theResourceType) Search the resource definition for a compartment named 'patient' and return its related Search Parameter.static RuntimeSearchParam
getOnlyPatientCompartmentRuntimeSearchParam
(RuntimeResourceDefinition runtimeResourceDefinition) static RuntimeSearchParam
getOnlyPatientCompartmentRuntimeSearchParam
(RuntimeResourceDefinition runtimeResourceDefinition, List<RuntimeSearchParam> theSearchParams) static Optional
<RuntimeSearchParam> getOnlyPatientSearchParamForResourceType
(FhirContext theFhirContext, String theResourceType) Given the resource type, fetch its patient-based search parameter name 1.getPatientSearchParamsForResourceType
(FhirContext theFhirContext, String theResourceType) Given the resource type, fetch all its patient-based search parameter name that's availablestatic String
getURL
(FhirContext theContext, IBaseResource theResource) static boolean
isResourceTypeInPatientCompartment
(FhirContext theFhirContext, String theResourceType) Return true if any search parameter in the resource can point at a patient, false otherwisestatic String
stripModifier
(String theSearchParam)
-
Constructor Details
-
SearchParameterUtil
public SearchParameterUtil()
-
-
Method Details
-
getBaseAsStrings
-
getOnlyPatientSearchParamForResourceType
public static Optional<RuntimeSearchParam> getOnlyPatientSearchParamForResourceType(FhirContext theFhirContext, String theResourceType) Given the resource type, fetch its patient-based search parameter name 1. Attempt to find one called 'patient' 2. If that fails, find one called 'subject' 3. If that fails, find one by Patient Compartment. 3.1 If that returns exactly 1 result then return it 3.2 If that doesn't return exactly 1 result and is R4, fall to 3.3, otherwise, 3.5 3.3 If that returns >1 result, throw an error 3.4 If that returns 1 result, return it 3.5 Find the search parameters by patient compartment using the R4 FHIR path, and return it if there is 1 result, otherwise, fall to 3.3 -
getPatientSearchParamsForResourceType
public static Set<String> getPatientSearchParamsForResourceType(FhirContext theFhirContext, String theResourceType) Given the resource type, fetch all its patient-based search parameter name that's available -
getOnlyPatientCompartmentRuntimeSearchParam
public static RuntimeSearchParam getOnlyPatientCompartmentRuntimeSearchParam(FhirContext theFhirContext, String theResourceType) Search the resource definition for a compartment named 'patient' and return its related Search Parameter. -
getOnlyPatientCompartmentRuntimeSearchParam
public static RuntimeSearchParam getOnlyPatientCompartmentRuntimeSearchParam(RuntimeResourceDefinition runtimeResourceDefinition) -
getOnlyPatientCompartmentRuntimeSearchParam
public static RuntimeSearchParam getOnlyPatientCompartmentRuntimeSearchParam(RuntimeResourceDefinition runtimeResourceDefinition, List<RuntimeSearchParam> theSearchParams) -
getAllPatientCompartmentRuntimeSearchParamsForResourceType
public static List<RuntimeSearchParam> getAllPatientCompartmentRuntimeSearchParamsForResourceType(FhirContext theFhirContext, String theResourceType) -
getAllPatientCompartmenRuntimeSearchParams
public static List<RuntimeSearchParam> getAllPatientCompartmenRuntimeSearchParams(FhirContext theFhirContext) -
getAllResourceTypesThatAreInPatientCompartment
public static Set<String> getAllResourceTypesThatAreInPatientCompartment(FhirContext theFhirContext) -
isResourceTypeInPatientCompartment
public static boolean isResourceTypeInPatientCompartment(FhirContext theFhirContext, String theResourceType) Return true if any search parameter in the resource can point at a patient, false otherwise -
getCode
-
getURL
-
getExpression
-
stripModifier
-