Package com.ibm.fhir.search.sort
Class Sort
- java.lang.Object
 - 
- com.ibm.fhir.search.sort.Sort
 
 
- 
public class Sort extends 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 classSort.Directionascending and descending enumeration 
- 
Field Summary
Fields Modifier and Type Field Description static List<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 StringbuildNewInvalidSearchExceptionMessage(String sortParmCode)builds exception message when the sort parameter used is undefined.StringbuildUndefinedSortParamMessage(String resourceTypeName, String sortParmCode)builds exception message when the sort parameter used is undefined.voidcheckSystemLevel(String resourceTypeName, String code)check system level searches with DESC/ASC are ONLY with _id and _lastUpdatedbooleanisUndefinedOrLenient(String resourceTypeName, String sortParmCode, SearchParameter sortParmProxy, boolean lenient)checks to see if undefined as a SearchParameter or LenientvoidparseSortParameter(Class<?> resourceType, FHIRSearchContext context, String sortParmValue, boolean lenient)Parses the _sort parameter.voidparseSortParameter(String resourceTypeName, FHIRSearchContext context, String sortParmValue, boolean lenient)Parses the _sort parameter. 
 - 
 
- 
- 
Method Detail
- 
parseSortParameter
public void parseSortParameter(Class<?> resourceType, FHIRSearchContext context, String sortParmValue, boolean lenient) throws Exception
Parses the _sort parameter.- Parameters:
 resourceType- the resource typecontext- the search contextsortParmValue- the parameter valuelenient- true if lenient, false if strict- Throws:
 Exception- an exception
 
- 
parseSortParameter
public void parseSortParameter(String resourceTypeName, FHIRSearchContext context, String sortParmValue, boolean lenient) throws Exception
Parses the _sort parameter.- Parameters:
 resourceTypeName- the resource type namecontext- the search contextsortParmValue- the parameter valuelenient- true if lenient, false if strict- Throws:
 Exception- an exception
 
- 
isUndefinedOrLenient
public boolean isUndefinedOrLenient(String resourceTypeName, String sortParmCode, SearchParameter sortParmProxy, boolean lenient) throws FHIRSearchException
checks to see if undefined as a SearchParameter or Lenient- Parameters:
 resourceTypeName-sortParmCode-sortParmProxy-lenient-- Returns:
 - Throws:
 FHIRSearchException
 
- 
checkSystemLevel
public void checkSystemLevel(String resourceTypeName, String code) 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.- Throws:
 FHIRSearchException
 
- 
buildNewInvalidSearchExceptionMessage
public final String buildNewInvalidSearchExceptionMessage(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 String buildUndefinedSortParamMessage(String resourceTypeName, 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
 
 
 - 
 
 -