Search Sort

The 1up FHIR Server also supports sorting your search results based on your search parameters.

For example, the search parameter _lastUpdated maps to the meta.lastUpdated value in FHIR® resources. To sort your results by the date each FHIR resource was last updated, you append the _sort parameter to each FHIR resource with the _lastUpdated value. By default, the results are sorted in ascending order.

{baseUrl}/Patient?_sort=_lastUpdated

To sort the results in descending order, prepend - to the _sort value.

{baseUrl}/Patient?_sort=-_lastUpdated