We are currently working on a functionality to exchange data between #UgandaEMR and a central server to facilitate Case Based Surveillance for HIV patients. We are opting to use Hapi FHIR servers for this implementation, however data must be sent as a bundle, i.e, Every Person/Patient record must be sent with all the corresponding client information.
This includes:
Patient Names.
Patient Numbers
Encounter information.
We are looking for a workaround to achieve this.
Thank you. @ssmusoke@slubwama
we can replace the observation resource with the encounter , though i doubt if the fhir2 module fully supports posting encounter yet(work is under-way to support this)…
Just out of curiosity are you going to use hapifhir PLAIN or JPA server to achieve this ?
Hi @solemabrothers ,
you would have to construct a fhir query with include param , to include the related resources on every patient search from FHIR2 module.
If its hard that way , you would create some kind of FHIR client to construct the bundle Resource before exporting it to the Central Server
.this could be the CBR module (i gues its what your using)
Encounter creation via fhir was not support by then which still is the case now I believe, so that we still depend on the ordinary rest webservices api for now. However one could query for a bundle(s) following the pattern shared by @mozzy. Below is an example to query some possible observation bundles (Observation, Encounter, Patient bundle)
@mozzy you are not getting me, I want to build the FHIR bundle in code so that I can submit it to an external API, doing that via the API end-points IMO is not good since I have to do it once per patient
If I can do it in code, I can be creative with how I handle it
So to my mind the ask here is a little underspecified. If the need is to get all information associated with a patient, than the best way to go about it would be to build support for the Patient/$everything operation as this is a standard way of requesting all the data related to a patient. If you want specific information, then it’s a matter of figuring out what specific data you’re interested in and how that is stored.
Similarly a “Bundle” in FHIR is a concept that can represent a number of different things. So the operation I pointed to above (and the operations to search for patients) all return a “searchset” bundle, which is the correct type of bundle to send for a search result. But bundles can also represent many other things (see Bundle.type). If you’re sending a Bundle to an external resource then you almost certainly don’t just want a searchset, but most likely either a “transaction” or “batch” type Bundle (or possibly a “message”, depending on how things are specified on the the other end). These types of Bundles differ from “searchsets” because they require an Bundle.entry.request for each entry in the bundle that specifies how it is to be handled (is it a POST? A PUT? etc.).
In the analytics engine, we do this to translate between a search bundle and a transaction bundle (at least when pushing to another FHIR store).
would get you a set of patients plus the encounters and observations associated with a patient.
On the other hand, if you just have a bunch of OMRS objects and what to convert them into FHIR objects, then you should be able to get instances of any of the translator classes and use them, e.g.:
Of course, you’ll need to handle things similarly for the other types you have available, but the translation layer of the FHIR2 module is intended to be used in this way.
From there, constructing a bundle can be handled similarly to the code from the analytics engine shared above.
@mksd The data is coming from OpenMRS, however architecturally it does not make sense for me to build a bundle via WebServices REST, then submit externally for thousands of patients
I am hoping to leverage the underlying Java API to build a bundle and submit it