Package ca.uhn.fhir.util
Class ParametersUtil
java.lang.Object
ca.uhn.fhir.util.ParametersUtil
Utilities for dealing with parameters resources in a version indepenedent way
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic IBase
addParameterToParameters
(FhirContext theContext, IBaseParameters theParameters, String theName) Add a parameter with no value (typically because we'll be adding sub-parameters)static void
addParameterToParameters
(FhirContext theContext, IBaseParameters theParameters, String theName, Object theValue) Add a parameter value to a Parameters resourcestatic void
addParameterToParameters
(FhirContext theContext, IBaseParameters theParameters, String theName, String thePrimitiveDatatype, String theValue) Add a parameter value to a Parameters resourcestatic void
addParameterToParametersBoolean
(FhirContext theCtx, IBaseParameters theParameters, String theName, boolean theValue) static void
addParameterToParametersCode
(FhirContext theCtx, IBaseParameters theParameters, String theName, String theValue) static void
addParameterToParametersDecimal
(FhirContext theCtx, IBaseParameters theParameters, String theName, BigDecimal theValue) static void
addParameterToParametersInteger
(FhirContext theCtx, IBaseParameters theParameters, String theName, int theValue) static void
addParameterToParametersLong
(FhirContext theCtx, IBaseParameters theParameters, String theName, long theValue) static void
addParameterToParametersReference
(FhirContext theCtx, IBaseParameters theParameters, String theName, String theReference) static void
addParameterToParametersString
(FhirContext theCtx, IBaseParameters theParameters, String theName, String theValue) static void
addParameterToParametersUri
(FhirContext theCtx, IBaseParameters theParameters, String theName, String theValue) static IBase
addPart
(FhirContext theContext, IBase theParameter, String theName, IBase theValue) static void
addPartBoolean
(FhirContext theContext, IBase theParameter, String theName, Boolean theValue) static void
addPartCode
(FhirContext theContext, IBase theParameter, String theName, String theCode) static void
addPartCoding
(FhirContext theContext, IBase theParameter, String theName, String theSystem, String theCode, String theDisplay) static void
addPartDecimal
(FhirContext theContext, IBase theParameter, String theName, Double theValue) static void
addPartInteger
(FhirContext theContext, IBase theParameter, String theName, Integer theInteger) static void
addPartResource
(FhirContext theContext, IBase theParameter, String theName, IBaseResource theValue) static void
addPartString
(FhirContext theContext, IBase theParameter, String theName, String theValue) static void
addPartUrl
(FhirContext theContext, IBase theParameter, String theName, String theCode) static IPrimitiveType
<?> createCode
(FhirContext theContext, String theValue) static IBase
createPart
(FhirContext theContext, IBase thePart, String theName) static IPrimitiveType
<?> createString
(FhirContext theContext, String theValue) static IPrimitiveType
<?> createUri
(FhirContext theContext, String theValue) static String
static String
extractDescription
(Annotation[] theParameterAnnotations) static String
extractDescription
(AnnotatedElement theType) extractExamples
(Annotation[] theParameterAnnotations) static String
extractShortDefinition
(AnnotatedElement theType) getNamedParameter
(FhirContext theCtx, IBaseResource theParameters, String theParameterName) getNamedParameterPartAsString
(FhirContext theCtx, IBaseParameters theParameters, String thePartName, String theParameterName) static Optional
<IBaseResource> getNamedParameterResource
(FhirContext theCtx, IBaseParameters theParameters, String theParameterName) Returns the resource within a parameter.getNamedParameters
(FhirContext theCtx, IBaseResource theParameters, String theParameterName) getNamedParameterValueAsInteger
(FhirContext theCtx, IBaseParameters theParameters, String theParameterName) getNamedParameterValueAsString
(FhirContext theCtx, IBaseParameters theParameters, String theParameterName) getNamedParameterValuesAsInteger
(FhirContext theCtx, IBaseParameters theParameters, String theParameterName) getNamedParameterValuesAsString
(FhirContext theCtx, IBaseParameters theParameters, String theParameterName) getParameterPart
(FhirContext theCtx, IBase theParameter, String theParameterName) getParameterPartValue
(FhirContext theCtx, IBase theParameter, String theParameterName) getParameterPartValueAsInteger
(FhirContext theCtx, IBase theParameter, String theParameterName) static String
getParameterPartValueAsString
(FhirContext theCtx, IBase theParameter, String theParameterName) static IBaseParameters
newInstance
(FhirContext theContext)
-
Constructor Details
-
ParametersUtil
public ParametersUtil()
-
-
Method Details
-
getNamedParameterValueAsString
public static Optional<String> getNamedParameterValueAsString(FhirContext theCtx, IBaseParameters theParameters, String theParameterName) -
getNamedParameterValuesAsString
public static List<String> getNamedParameterValuesAsString(FhirContext theCtx, IBaseParameters theParameters, String theParameterName) -
getNamedParameterValuesAsInteger
public static List<Integer> getNamedParameterValuesAsInteger(FhirContext theCtx, IBaseParameters theParameters, String theParameterName) -
getNamedParameterValueAsInteger
public static Optional<Integer> getNamedParameterValueAsInteger(FhirContext theCtx, IBaseParameters theParameters, String theParameterName) -
getNamedParameterResource
public static Optional<IBaseResource> getNamedParameterResource(FhirContext theCtx, IBaseParameters theParameters, String theParameterName) Returns the resource within a parameter.- Parameters:
theCtx
- thr FHIR contexttheParameters
- the parameters instance where to look for the resourcetheParameterName
- the parameter name- Returns:
- the resource
-
getNamedParameter
public static Optional<IBase> getNamedParameter(FhirContext theCtx, IBaseResource theParameters, String theParameterName) -
getNamedParameters
public static List<IBase> getNamedParameters(FhirContext theCtx, IBaseResource theParameters, String theParameterName) -
getParameterPart
public static Optional<IBase> getParameterPart(FhirContext theCtx, IBase theParameter, String theParameterName) -
getParameterPartValue
public static Optional<IBase> getParameterPartValue(FhirContext theCtx, IBase theParameter, String theParameterName) -
getParameterPartValueAsString
public static String getParameterPartValueAsString(FhirContext theCtx, IBase theParameter, String theParameterName) -
getParameterPartValueAsInteger
public static Optional<Integer> getParameterPartValueAsInteger(FhirContext theCtx, IBase theParameter, String theParameterName) -
addParameterToParameters
public static void addParameterToParameters(FhirContext theContext, IBaseParameters theParameters, String theName, Object theValue) Add a parameter value to a Parameters resource -
addParameterToParameters
public static void addParameterToParameters(FhirContext theContext, IBaseParameters theParameters, String theName, String thePrimitiveDatatype, String theValue) Add a parameter value to a Parameters resource- Parameters:
theContext
- The FhirContexttheParameters
- The Parameters resourcetheName
- The parameter namethePrimitiveDatatype
- The datatype, e.g. "string", or "uri"theValue
- The value
-
createString
-
createUri
-
createCode
-
newInstance
-
addParameterToParametersBoolean
public static void addParameterToParametersBoolean(FhirContext theCtx, IBaseParameters theParameters, String theName, boolean theValue) -
addParameterToParametersCode
public static void addParameterToParametersCode(FhirContext theCtx, IBaseParameters theParameters, String theName, String theValue) -
addParameterToParametersInteger
public static void addParameterToParametersInteger(FhirContext theCtx, IBaseParameters theParameters, String theName, int theValue) -
addParameterToParametersLong
public static void addParameterToParametersLong(FhirContext theCtx, IBaseParameters theParameters, String theName, long theValue) -
addParameterToParametersDecimal
public static void addParameterToParametersDecimal(FhirContext theCtx, IBaseParameters theParameters, String theName, BigDecimal theValue) -
addParameterToParametersReference
public static void addParameterToParametersReference(FhirContext theCtx, IBaseParameters theParameters, String theName, String theReference) -
addParameterToParametersString
public static void addParameterToParametersString(FhirContext theCtx, IBaseParameters theParameters, String theName, String theValue) -
addParameterToParametersUri
public static void addParameterToParametersUri(FhirContext theCtx, IBaseParameters theParameters, String theName, String theValue) -
addParameterToParameters
public static IBase addParameterToParameters(FhirContext theContext, IBaseParameters theParameters, String theName) Add a parameter with no value (typically because we'll be adding sub-parameters) -
addPartCode
public static void addPartCode(FhirContext theContext, IBase theParameter, String theName, String theCode) -
addPartInteger
public static void addPartInteger(FhirContext theContext, IBase theParameter, String theName, Integer theInteger) -
addPartString
public static void addPartString(FhirContext theContext, IBase theParameter, String theName, String theValue) -
addPartUrl
public static void addPartUrl(FhirContext theContext, IBase theParameter, String theName, String theCode) -
addPartBoolean
public static void addPartBoolean(FhirContext theContext, IBase theParameter, String theName, Boolean theValue) -
addPartDecimal
public static void addPartDecimal(FhirContext theContext, IBase theParameter, String theName, Double theValue) -
addPartCoding
public static void addPartCoding(FhirContext theContext, IBase theParameter, String theName, String theSystem, String theCode, String theDisplay) -
addPart
-
createPart
-
addPartResource
public static void addPartResource(FhirContext theContext, IBase theParameter, String theName, IBaseResource theValue) -
getNamedParameterPartAsString
public static List<String> getNamedParameterPartAsString(FhirContext theCtx, IBaseParameters theParameters, String thePartName, String theParameterName) -
extractDescription
-
extractDescription
-
extractShortDefinition
-
extractDescription
-
extractExamples
-