Stream: hapi
Topic: retrieve the last versionID of resource
Sohrab Hejazi (Jan 06 2020 at 16:00):
Hi,
when we use resource.getMeta().getVersionId(), we get the last versionID of resource. For example the last version ID is 25, I want to retrieve the same resource with versionID 24 from history of server. How can I retrieve it from the server using HAPI FHIR library??
James Agnew (Jan 06 2020 at 16:39):
You are probably looking for something like this:
client.read().resource("Patient").withIdAndVersion("100", "25").execute();
James Agnew (Jan 06 2020 at 16:40):
More examples here if it's helpful: https://hapifhir.io/hapi-fhir/docs/client/generic_client.html#readvread-instance
Last updated: Apr 12 2022 at 19:14 UTC