@P, Pioline (Cognizant) Welcome to Microsoft Q&A Forum, Thank you for posting your query here!
I understand that your requirement is to fetch the resources that are pushed within a particular time range.
Rest API operations and extended operations are defined here.
_since
parameter is defined in Patient-everything
operation, this will return only resources that have been modified since the time provided. You can also specify the start and end clinical date. More Info here.
For search
operation, you can rely on the _lastupdated parameter is supported for all resources as defined in https://build.fhir.org/search.html#all. The available common search parameters that apply to all resources in FHIR are listed here. For search parameters that have a specific order (numbers, dates, and quantities), you can use a prefix before the parameter value to refine the search criteria (e.g. Patient?_lastUpdated=gt2022-08-01
where the prefix gt
means "greater than").
The following prefixes are supported for the _lastUpdated
field:
-
gt
: Greater than -
lt
: Less than -
ge
: Greater than or equal to -
le
: Less than or equal to
I haven't tested the below API with the query parameters, but definitely worth giving a try. AFAIK, the following request will get all Patient resources that were pushed within the past hour and have a _lastUpdated
value that is less than or equal to 16:00 UTC
GET {{fhirurl}}/Patient?_lastUpdated>2023-06-28T15:00:00Z&_lastUpdated<=2023-06-28T16:00:00Z
We also support sorting by the date last updated: _sort=_lastUpdated
. We also support _sort on FirstName, LastName, BirthDate, and ClinicalDate elements. More info here
Example: Depending on the "lastUpdated": "2021-04-22T09:58:16.7823171+00:00"
returned in the response, you can send the request for REST API as shown below:
GET [your-fhir-server]/Patient?_sort=_lastUpdated`
Hope this helps.
**
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.