athenahealth / apiserver-athenaFlex

Software developers can use sample code and documentation to use athenahealth's athenaPractice/athenaFlow FHIR API Server.
https://mydata.athenahealth.com/home
17 stars 7 forks source link

Unable to get recent encounter from fhir/r4/Encounter endpoints #281

Closed balamurugan-clustrex closed 10 months ago

balamurugan-clustrex commented 1 year ago

Description: I am experiencing issues when trying to retrieve recent encounters from the FHIR R4 Encounter endpoint. Here are the details of the problem:

Steps to Reproduce:

  1. Try OAuth2.0 in Postman or Web UI

Expected behavior: I expect to receive the most recent encounter for the specified patient.

Additional Information: https://ap22sandbox.fhirapi.athenahealth.com/demoAPIServer/fhir/r4/Encounter?patient=1225794134051060&_sort=-date&_count=1. I try this for descending order but not working. It always gives first record only.

I appreciate any assistance or guidance in resolving this issue and obtaining the most recent encounter for the specified patient.

athena-Interop commented 12 months ago

Sorting resources in response Bundles is not supported by the athenaPractice or athenaFlow FHIR servers. The metadata API returns a CapabilityStatement that does not contain _sort in any of the CapabilityStatement.rest.resource.searchParam elements.

We are sorry for the confusion. FHIR specification of _sort search parameter states "The server returns the sort it performs as part of the returned search parameters (see Server Conformance for search.")

Since the _sort parameter value is ignored, the _sort parameter should be omitted from the Bundle.link.url elements. This is a bug.

This issue is a future enhancement request to support a FHIR Encounter request that would return a response with the most recent encounter.

AjeetYadav07 commented 10 months ago

Thanks @balamurugan-clustrex, we will address this issue in future release.