Package com.ibm.fhir.search.parameters
Class ParametersUtil
- java.lang.Object
-
- com.ibm.fhir.search.parameters.ParametersUtil
-
public final class ParametersUtil extends Object
Refactored the PopulateSearchParameterMap code, and marked class as final so there are no 'children' and inheritance which overwrites the behaviors of the buildInSearchParameters.
Callinit()
before using the class in order to avoid a slight performance hit on first use.
-
-
Field Summary
Fields Modifier and Type Field Description static String
BUILTIN_ERROR_EXCEPTION
static String
ERROR_EXCEPTION
static String
FHIR_DEFAULT_SEARCH_PARAMETERS_FILE
static String
FHIR_PATH_BUNDLE_ENTRY
static String
FROM_STEAM
static String
LOG_HEADER
static String
LOG_PARAMETERS
static String
LOG_SIZE
static String
MISSING_EXPRESSION_WARNING
static String
STREAM_ERROR_EXCEPTION
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,ParametersMap>
buildSearchParametersMapFromBundle(Bundle bundle)
Builds a Map of ParameterMaps from the passed Bundle.(package private) static void
checkAndWarnForIssueWithCodeAndName(String code, String name)
checks and warns if name and code are not equivalent.static Map<String,ParametersMap>
getBuiltInSearchParametersMap()
static void
init()
Loads the class in the classloader to initialize static members.static void
print(PrintStream out)
convenience method to print the output of the Search Parameters.static void
printSearchParameter(SearchParameter parameter, PrintStream out)
outputs the search parameter.
-
-
-
Field Detail
-
FHIR_PATH_BUNDLE_ENTRY
public static final String FHIR_PATH_BUNDLE_ENTRY
- See Also:
- Constant Field Values
-
FHIR_DEFAULT_SEARCH_PARAMETERS_FILE
public static final String FHIR_DEFAULT_SEARCH_PARAMETERS_FILE
- See Also:
- Constant Field Values
-
FROM_STEAM
public static final String FROM_STEAM
- See Also:
- Constant Field Values
-
ERROR_EXCEPTION
public static final String ERROR_EXCEPTION
- See Also:
- Constant Field Values
-
BUILTIN_ERROR_EXCEPTION
public static final String BUILTIN_ERROR_EXCEPTION
-
STREAM_ERROR_EXCEPTION
public static final String STREAM_ERROR_EXCEPTION
-
LOG_PARAMETERS
public static final String LOG_PARAMETERS
- See Also:
- Constant Field Values
-
MISSING_EXPRESSION_WARNING
public static final String MISSING_EXPRESSION_WARNING
- See Also:
- Constant Field Values
-
LOG_HEADER
public static final String LOG_HEADER
- See Also:
- Constant Field Values
-
LOG_SIZE
public static final String LOG_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public static void init()
Loads the class in the classloader to initialize static members. Call this before using the class in order to avoid a slight performance hit on first use.
-
buildSearchParametersMapFromBundle
public static Map<String,ParametersMap> buildSearchParametersMapFromBundle(Bundle bundle)
Builds a Map of ParameterMaps from the passed Bundle.- Parameters:
bundle
- a Bundle of type Collection with entries of type SearchParameter- Returns:
- a Map of ParameterMaps, keyed by resourceType
- Throws:
ClassCastException
- if the Bundle contains entries of any type other than SearchParameter
-
checkAndWarnForIssueWithCodeAndName
static void checkAndWarnForIssueWithCodeAndName(String code, String name)
checks and warns if name and code are not equivalent.- Parameters:
code
-name
-
-
getBuiltInSearchParametersMap
public static Map<String,ParametersMap> getBuiltInSearchParametersMap()
- Returns:
- a map of maps The outer map is keyed by resource type. The inner map is keyed by both SearchParameter.code and SearchParameter.url
-
print
public static void print(PrintStream out)
convenience method to print the output of the Search Parameters.- Parameters:
out
-
-
printSearchParameter
public static void printSearchParameter(SearchParameter parameter, PrintStream out)
outputs the search parameter.- Parameters:
parameter
-out
-
-
-