Class FhirSearchAndSortParameters<T extends IBaseResource>
java.lang.Object
org.openehealth.ipf.commons.ihe.fhir.FhirSearchAndSortParameters<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
FhirSearchParameters
- Direct Known Subclasses:
AllergyIntoleranceSearchParameters
,ConditionSearchParameters
,DiagnosticReportSearchParameters
,EncounterSearchParameters
,ImmunizationSearchParameters
,Iti66SearchParameters
,Iti67SearchParameters
,Iti78SearchParameters
,Iti81SearchParameters
,MedicationRequestSearchParameters
,MedicationStatementSearchParameters
,ObservationSearchParameters
,Pharm5SearchParameters
,ProcedureSearchParameters
public abstract class FhirSearchAndSortParameters<T extends IBaseResource>
extends Object
implements FhirSearchParameters
Extension of FhirSearchParameters that add sorting capabilities. Implementing classes must overwrite
comparatorFor(String)
to provide explicit sorting before a search response bundle is returned.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Optional<Comparator<T>>
comparatorFor
(String paramName) Returns aComparator
to sort resources of type T by given sort parameter name.abstract SortSpec
static <K> Comparator<K>
noop()
void
Can be called to sort a result list according to itsSortSpec
as indicated in the queryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.openehealth.ipf.commons.ihe.fhir.FhirSearchParameters
getFhirContext, getIncludeSpec, getPatientIdParam
-
Constructor Details
-
FhirSearchAndSortParameters
public FhirSearchAndSortParameters()
-
-
Method Details
-
getSortSpec
- Returns:
- the sort specification as requested by the client
-
sort
Can be called to sort a result list according to itsSortSpec
as indicated in the query- Parameters:
resultList
- (unsorted) result list
-
comparatorFor
Returns aComparator
to sort resources of type T by given sort parameter name. This default implementation keeps the current order, i.e. to implement actual sorting you MUST overwrite this method.- Parameters:
paramName
- sort parameter- Returns:
- comparator
-
noop
-