Offline Mode

Introduction

ZEPRS, the initial Zcore implementation, was written to support a traditional client-server mode - web browser clients interact w/ a single server to submit/view forms, records, and reports. Zcore can now support a disconnected mode, called offline mode, in which a pc in the clinic can be configured to act as the local clinic server and periodically upload patient records to the main "master" server. Records are synchronized between the local clinic server and the master. This capability is useful in circumstances where network connectivity is unreliable or impossible.

Example Deployment Scenario

A standalone instance of the Zcore-based application is installed on one pc at the remote site. The standalone application runs an embedded web application server that renders pages to a web browser and saves data using the embedded database Derby. (Standalone technical details) Other pc's at the site that perform data entry browse this local instance of the application. Data is periodically sent to the data center.

Development of Zcore Synchronization

Much of the documentation in this "Offline Mode" section builds upon an earlier version of offline mode that was implemented for the ZEPRS application. This original version made a comparison between versions of each patient record in order to achieve synchronization. Although this method worked fairly well, it it was terribly complex and bug-prone. A new version of synchronization addresses the complexity issues by synchronizing on the record level, instead of on the patient level. This new version uses smaller data files (JSON format) in order to reduce bandwidth use and is also better suited to remote sites that do not have static (permanent) ip address.

Pages that describe the old version is labeled "Patient Sync." The new version is labeled "Record Sync." Pages that document the ZEPRS method of Patient Sync are in the ZEPRS Documentation book.

Record Sync Process

This clinic "server" is configured to create a zip archive every 30 minutes that contains the following files:

  • Listing of all of the records that have been created or changed since the last sync process. See the page on Creating the Sync Archive for more information.
  • Records are serialized as data files for the following Zcore objects:
    • encounters
    • patients
    • events
    • edits
    • encounter deletions
    • relationships
    • organizations
    • contacts
    • users
    • courts
    • policeStations
    • adminRecords

The data files can be either in JSON or XML format and may be encrypted. If the network is available, the file is uploaded to the master server, which is configured to accept uploads using the WEBDAV protocol.The master server extracts the files and reads through the record listing, checks if the unique identifier for each record is already in its database. If not, it de-serializes the record's data file and enters it into the database.

Detailed information may be found in the Data Synchronization section.