LinuxForHealth / FHIR

The LinuxForHealth FHIR® Server and related projects
https://linuxforhealth.github.io/FHIR
Apache License 2.0
320 stars 156 forks source link

_sort in _history #4237

Open Sundaresan-JSE-PMS opened 9 months ago

Sundaresan-JSE-PMS commented 9 months ago

Hi. I'm having an observation resource and when I try to get it's history with the query below, I get the lastUpdated history first. But what I want is the first updated history of that particular day/time period. I tried _sort=-_lastUpdated, but I'm getting the following error: FHIRPersistenceException: Unrecognized history parameter: '_sort'

How do I solve this?

API Query I used to get the history: http://<IP ADDRESS>:9443/fhir-server/api/v4/Observation/18a9731c288-08443bac-c0f7-40ee-8f5a-94b2454f8cc6/_history?_count=1&_since=2023-09-19T00:00:00Z

Environment: Docker image of the server in an Ubuntu machine.

Thanks!

berkant-k commented 6 months ago

I created PR #4245 to address this issue.

Sundaresan-JSE-PMS commented 6 months ago

Hi @berkant-k . Thanks for the PR. This should solve the problem I'm having.