We have a use case where I need to pull the most recent Encounter using FHIR but all I have is the MRN of the patient to go off of. What parameters should I use to ensure I get the most recent encounter of a patient?
How you solve this will depend on the capabilities of the FHIR server you are connecting to. Assuming that the MRN is sufficient for identifying the right patient, there are some options for getting the most recent encounter:
_sort
, you could sort by date in descending order and take the first Encounter. Be sure to understand how the server handles sorting when there is pagination and how it handles the fact that encounter dates are nested within the period
/actualPeriod
element.