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 Details

    • FhirSearchAndSortParameters

      public FhirSearchAndSortParameters()
  • Method Details

    • getSortSpec

      public abstract SortSpec getSortSpec()
      Returns:
      the sort specification as requested by the client
    • sort

      public void sort(List<T> resultList)
      Can be called to sort a result list according to its SortSpec as indicated in the query
      Parameters:
      resultList - (unsorted) result list
    • comparatorFor

      protected Optional<Comparator<T>> comparatorFor(String paramName)
      Returns a Comparator 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

      public static <K> Comparator<K> noop()