What are people using for offline data models?

I believe several of you are developing offline apps. One aspect that may unify these projects is the approach to the offline data model. I’d love to see any documentation you’ve developed for this model.

  1. What underlying technology are you using? sqlite? indexeddb? pouchdb? others?
  2. Do you have documentation on your approach?
  3. Do you have an api?

Would love to hear thoughts on a common approach to this problem.

1 Like

Hi Jonathan,

We are trying to build offline feature in Bahmni. Most of our design decisions have been documented.

We use LoveField & SQLite for Chrome and Android respectively. More details are captured in the link given below. https://bahmni.atlassian.net/wiki/pages/viewpage.action?pageId=38600738

Yes, it can be found in the link below - https://bahmni.atlassian.net/wiki/display/BAH/Offline

What type of API you are looking for? Is it for pulling data? Or for pushing data ?


Thank you @vinkesh for your quick response.

Much like one could use OpenMRS as a platform and build a customized user interface (via REST) on top of it, I’d love for the community to have available a similar offline platform. This scaled down offline OpenMRS platform would store the data somewhere (perhaps a polyfill mechanism) and provide an api for interacting with the various endpoints.

There is limited documentation on the Bhamni approach to the offline data model at this link https://bahmni.atlassian.net/wiki/display/BAH/Offline+database+design. Perhaps you could share with us any additional docs you have.

This is an interesting question. Can you please elaborate what you mean by api in this context?

In our more specific case, we’d likely build an app using ionic + angular.

In angular, we’d load a javascript file like:

<script src="./offline-openmrs.js"></script>

This would provide us the library for retrieving/accessing/locally saving common OpenMRS data like patients, obs, encounters, visits, encounter_types, location, etc.

We could then build on top of this our own angular app which consumed this offline data.

Ideally the offline-openmrs.js file would follow a pseudo rest approach to it’s interaction with the offline data.

In Bahmni we are focussing on creating an end user application with some flexibility to add other applications developed by community. This is available for the online system and the model is quite simple because of very loose coupling with rest of the Bahmni apps. Having said that, we haven’t had anyone else try that yet so there may be issues in this.

For offline, it is lot more involved, as we will have to create a complete platform with API, lifecycle hooks, deployment configurability etc. In our current roadmap we haven’t planned to make Bahmni also an offline platform and this will be a lower priority for us for quite some time. We understand that this is limiting, but given that we have just started developing offline, we are not in position to take this up any time soon. Sorry.