Package com.ibm.fhir.search.sort
Class Sort
- java.lang.Object
-
- com.ibm.fhir.search.sort.Sort
-
public class Sort extends java.lang.Object
This class implements the _sort URL processing into internal SortParameters. FHIR Specification: _sort
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Sort.Direction
ascending and descending enumeration
-
Field Summary
Fields Modifier and Type Field Description static java.util.List<java.lang.String>
SYSTEM_LEVEL_SORT_PARAMETER_NAMES
-
Constructor Summary
Constructors Constructor Description Sort()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
buildNewInvalidSearchExceptionMessage(java.lang.String sortParmCode)
builds exception message when the sort parameter used is undefined.java.lang.String
buildUndefinedSortParamMessage(java.lang.String resourceTypeName, java.lang.String sortParmCode)
builds exception message when the sort parameter used is undefined.void
checkIfUndefined(java.lang.String resourceTypeName, java.lang.String sortParmCode, SearchParameter sortParmProxy, FHIRSearchContext context)
Checks to see if undefined as a SearchParameter.void
checkSystemLevel(java.lang.String resourceTypeName, java.lang.String code, FHIRSearchContext context)
Check system level searches with DESC/ASC are ONLY with _id and _lastUpdated.void
parseSortParameter(java.lang.Class<?> resourceType, FHIRSearchContext context, java.lang.String sortParmValue, SearchHelper searchHelper)
Parses the _sort parameter.void
parseSortParameter(java.lang.String resourceTypeName, FHIRSearchContext context, java.lang.String sortParmValue, SearchHelper searchHelper)
Parses the _sort parameter.
-
-
-
Method Detail
-
parseSortParameter
public void parseSortParameter(java.lang.Class<?> resourceType, FHIRSearchContext context, java.lang.String sortParmValue, SearchHelper searchHelper) throws java.lang.Exception
Parses the _sort parameter.- Parameters:
resourceType
- the resource typecontext
- the search contextsortParmValue
- the parameter valuesearchHelper
- a SearchUtil instance to retrieve filtered search params- Throws:
java.lang.Exception
- an exception
-
parseSortParameter
public void parseSortParameter(java.lang.String resourceTypeName, FHIRSearchContext context, java.lang.String sortParmValue, SearchHelper searchHelper) throws java.lang.Exception
Parses the _sort parameter.- Parameters:
resourceTypeName
- the resource type namecontext
- the search contextsortParmValue
- the parameter valuesearchHelper
- a SearchUtil instance to retrieve filtered search params- Throws:
java.lang.Exception
- an exception
-
checkIfUndefined
public void checkIfUndefined(java.lang.String resourceTypeName, java.lang.String sortParmCode, SearchParameter sortParmProxy, FHIRSearchContext context) throws FHIRSearchException
Checks to see if undefined as a SearchParameter.- Parameters:
resourceTypeName
- the resource typesortParmCode
- the sort valuesortParmProxy
- the search parametercontext
- the context- Throws:
FHIRSearchException
- if search parameter is undefined
-
checkSystemLevel
public void checkSystemLevel(java.lang.String resourceTypeName, java.lang.String code, FHIRSearchContext context) throws FHIRSearchException
Check system level searches with DESC/ASC are ONLY with _id and _lastUpdated.- Parameters:
resourceTypeName
- one of the FHIR Resources, and must be a non-null valuecode
- the code to check.context
- the context- Throws:
FHIRSearchException
- if system level search and code is not system level
-
buildNewInvalidSearchExceptionMessage
public final java.lang.String buildNewInvalidSearchExceptionMessage(java.lang.String sortParmCode)
builds exception message when the sort parameter used is undefined.- Parameters:
sortParmCode
- the code that is passed in- Returns:
- String representing the exception message
-
buildUndefinedSortParamMessage
public final java.lang.String buildUndefinedSortParamMessage(java.lang.String resourceTypeName, java.lang.String sortParmCode)
builds exception message when the sort parameter used is undefined.- Parameters:
resourceTypeName
- the specific FHIR Resource passed in or general RESOURCEsortParmCode
- the code that is passed in- Returns:
- String representing the exception message
-
-