Feature / Architecture for Mobile application with aggressive caching to enable offline working

bubblenet wrote on Wednesday, September 04, 2013:

Please help me refine the feature set / architecture:

Development environment: Appcelerator. Please see: http://www.appcelerator.com/plans-pricing/

First screen: Login

2nd screen: Like the 1st screen of medstar with many tabs for separate applications. Please see: http://www.mi-squared.com/store/mobility-solutions/medmaster-mobility/

The 1st tab will be patients.

Architecture will allow for more tabs can be added when the app is updated.

When a user clicks on patients:

  1. Search box for patients
  2. On search the patient file opens.
  3. Aggressive caching. As soon as the patient data is fetched save it to local device sqllite.
  4. User Disconnected from internet -> even then the user can edit and save changes.

How is the sync maintained between server and mobile device?

  1. Maintain audit log this is a text file describing the edits done.
  2. On reconnection to internet the audit log is sent to server and then the data is synced.

How to prevent conflicts?

  1. Look at last edited on field for the data on the server. If the mobile device fetched the data after the last edited on field on the server only then the changes made by the mobile device are allowed to be synced.
  2. If the mobile device fetched the data before the last edited on field on the server. Then ask the user of the mobile devices to reconcile the edit.

How to communicate with the server?
Use the soap system as used by the patient portal.
See: http://www.zhservices.com/configuring-patient-portal

Open questions:

  1. SOAP vs REST: Should I be using the REST API given that its more efficient ? What do you think?
  2. Licensing (Open source … paying bills): Some options are A. After selling x copies then make it open source B. Use something like zhhealthcare patient portal. C. Code is closed source but x% of revenye is pledged to open-emr … What do you think?

bradymiller wrote on Sunday, September 08, 2013:

Hi,

Do note there is an API that is currently under review (huge amount of code, so will take awhile to get into the codebase) that is being used for a iphone/ipads app by Medmasterpro currently:
http://www.open-emr.org/wiki/index.php/Active_Projects#REST

Regarding the caching, could perhaps tackle this at another level, which could then use in your specific example. The level would be a user that is using OpenEMR on a local instance which needs to intermittently reconnect to a central OpenEMR server/repository. This would be a very useful feature in places that do not have good internet connections but want a central OpenEMR master server. My thoughts would be to extend on the mechanism ZH Healthcare uses for their auditing tables (used in the CCD import tool and in their offsite portal SOAP API) to do this. Then, when this is set up, the mechanism to set up caching per device should be simple by leveraging this syncing mechanism on the server end. Probably would be a good idea to ask ZH Healthcare to ensure they are not already working on this also to avoid duplication.

Regarding licensing and getting paid, this is up to you. I’m a volunteer, so not much input on this but other vendors/professionals can likely provide advice.

-brady
OpenEMR