RetroFHIR is a complete FHIR (STU3) client implemented using Gson serialization and Square’s Retrofit REST client scheme.
GitHub: https://github.com/davidvaccaro/RetroFHIR (and GsonFHIR)
Using this client you can easily compose interactions with any FHIR-server as follows:
Select a Bundle of FHIR DocumentReferences by a specified patient-id and document status:
DocumentReferenceInteractor
.Composer()
.baseUrl(FHIRServerURL)
.setParameter("patient.identifier", "patientId")
.setStatus(DocumentReference.Status.CURRENT)
.compose()
.search(new retrofit2.Callback<Bundle>() {
@Override
public void onResponse(Call<Bundle> call, Response<Bundle> response) {
// TODO – Process the Bundle of DocumentReferences
}
});
RetroFHIR utilizes a basic “builder” scheme (composer) and for each resource there is a requester (interactor) that hosts every FHIR action (read, vread, search, etc.), resource-specific parameter “setters” and even provides support for parameter prefixes and modifiers.
GsonFHIR is a stand-alone library that you can use if you simply want to use Gson to serialize/de-serialize FHIR JSON data (including the entire set of FHIR resources and associated data objects).
I’ll be at the Boston FHIR Dev Days 2018 conference … feel free to reach out (dvaccaro@xinonix.com) if you are on-premisis and would like to see an Android-based demo of this client library in person.