Searching InterSystems FHIR Server for specific Encounter (based on peroid)
Hi guys,
I am looking for a way to search for FHIR Encounter resources from an InterSystems FHIR server where there period.start is before or after a certain time. I can´t get my head around which would be a correct way to do this since docs and FHIR spec is not clear to me which fields can be used for searching with wich prefixes.
In my local InterSystems FHIR server I have a set of Encounter ressources, each set with a period.start and (possibly) a period.end. I´d like to retrieve all Encounters with a start date time prior to a given datetime. I did a little testing with URL parameters.
// retrieve encounters with a start prior to 2024-10-25T15:30:00Z
http://localhost:54107/csp/healthshare/ukerhirservernew/fhir/r4/Encounte...
http://localhost:54107/csp/healthshare/ukerhirservernew/fhir/r4/Encounte...
But none of the calls returned the correct set of encounters I expected. I´am not sure If I get the whole idea of searching for periods wrong or if it has something to do with the way period (datatype) information are stored and indexed within the InterSystems FHIR server.
Any idea or hint would be hihgly apreciated.
Best regards,
sebastian
Hello @Sebastian Thiele
As per the documentation, date is fully supported search parameter. so, This should work prefix lt dates
I've 2 encounter resource in my FHIR server and I've tested with different dates ex: &date=lt2024-10-27T15:29:00Z period and it works to me
Hi Ashok,
thank you for the response. This url is the exact same syntax that I used above (possibly my links contracted by the UI and therefore not fully visible). Anyway in my case there is no filtering applied at all and simply all encounters are returned regardless of the date. Could you post your encounter resources he used for testing so I can test if it is a FHIR server version specific issue?
best regards,
Sebastian
Hi @Sebastian Thiele
Here is the Encounter resource. I'm using
IRIS for Windows (x86-64) 2024.1.1
url :
http://localhost:52773/csp/healthshare/learning/fhir/r4/Encounter?&date=lt2024-10-27T15:29:00Z
Hi Ashok,
seems there is no Encounter resource in your post. Did you missed that?
best regards,
Sebastian
Can you click the Spoiler to view the message.
Hi Ashok,
sorry for the late response. That get me a little further. The approach of ordering by date seem to work only as long as all of the resources have a period.start and period.end provided. In my scenario the most acutal encounter doesn´t have an period.end set since it has not yet ended. The field period.start of one encounter is the the period.end of it´s predecessor. Can you confirm that behaviour of the FHIR server if no period.end is set? If so what would be your approach?
best regards,
sebastian
I think what you are looking for is... (I have not tried this on the InterSystems FHIR server as I use the Microsoft Azure FHIR server)
Search where start date is after a time... /Encounter?date=sa2022-08-15T09:00:00
Search where a start date is before a time /Encounter?date=lt2022-08-15T09:00:00
For me the times I search by are UTC so that might be catching you out?