Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Introduction

OpenMRS-jr (pronounced OpenMRS junior) is a mobile application developed using the JavaRosa platform. In this version the user can:

  • Specify a base URL for a working OpenMRS installation
  • Login to the app with a valid OpenMRS username and password
  • Download the list of available cohorts of patients
  • Select a cohort of patients to download, and download the patients onto the mobile device
  • Download XForms onto the mobile device from OpenMRS
  • Select a patient, and fill out one or more XForms for that patient
  • Register new patients

The application uses the Xforms module and is built on top of JavaRosa. The application hasn't been tested extensive on different phones but in theory it should work on most J2ME compatible phones.

Prerequisites

Working OpenMRS installation with XForms Module installed

  • Install OpenMRS
  • Install the XForms Module
  • Configure xform module
    • Login to your OpenMRS installation and select "Administration" from the menu bar
    • Select Manage Global Properties from the Maintenance section.
      • Scroll down to xforms.showModelXmlTab and type "true" in place of the "false".
      • Locate xforms.showXformsSourceTab and type "true" in place of the "false".

Use Cases

The functionality supported by OpenMRS-JR allows the user to download a list of patients as well as a list of forms and fill out a form for a patient and then either submit it back to the server or save it for later submission. A JavaRosa-specific form allows users of OpenMRS-JR to submit patient registration information to an OpenMRS server, thus allowing patients to be created. These functions are can be broken down into these two use cases.

Download Forms and Cohorts, and Fill out a form for a patient

  • Download a list of patients based on an existing OpenMRS cohort.
  • Be able to select a patient on the mobile and fill out a downloaded form.
  • Be able to download an existing form, or load a form from memory.
  • Submit back to the xforms module and have it appear in OpenMRS as if you entered it using infopath.

Creating new OpenMRS Patients

  • Load JR
  • Create a new patient registration
  • Submit Registration to Server

Installing the mobile application

The application can be installed on your mobile phone by visiting this link in your phone's browser: http://bitbucket.org/cell_life/openmrs-jr/downloads/OpenMRS-JR.jad If your phone gives problems downloading the application via the JAD, access the JAR directly at: http://bitbucket.org/cell_life/openmrs-jr/downloads/OpenMRS-JR.jar

Developer Guide

OpenMRS-JR requires a JavaROSA build. JavaROSA is hosted at bitbucket.org and can be downloaded using the instructions on their wiki: http://bitbucket.org/javarosa/javarosa/wiki/Home It is highly recommended that the Demo project in JavaROSA be compiling and running as a precursor to OpenMRS-JR.

OpenMRS-JR is also hosted at bitbucket.org and the process of checking out the source is exactly the same as that of JavaROSA:

The bitbucket repository is: http://bitbucket.org/cell_life/openmrs-jr

Once the Eclipse project has been checked out and imported into Eclipse, locate the build.properties and local.properties files and update the following parameters as required:

  • wtk.home=<path-to-sun-wireless-tool-kit-folder>
  • polish.home=<path-to-polish-home-(uses-Polish-2.1)>
  • dir.root=<root-of-openmrs-jr-folder>

A video showing the application at work can be seen here: http://screenr.com/WEA

Feature List

Properties

  • Enter the base URL for the OpenMRS server.  This should include the http://, and a the server port, and implementation directory, such as http://192.168.4.7:8080/openmrs
  • All other URLs are generated off this base URL. If this URL is incorrect, none of the form download, patient download, cohort download, patient creation, user authentication, or form submission features will work.

Login

  • Enter the username and password.
  • If the user has not logged in using the phone before, authenticate the user by contacting the server and saving the user profile.
    • otherwise simply verify the password using the local user profile.

Cohorts

Shows a list of cohorts. Selecting a cohort causes the list of patients to be downloaded. Once the patients are downloaded, proceed to Patient List screen.  Note: you must have a saved cohort (a saved patient search is not adequate).  If you don't have a saved cohort, you cannot proceed to the forms.

Patient Select

This is the central screen of the app. It shows a list of patients. If there are no patients, load the Cohorts screen and download a list of available cohorts from the server. From this screen, it is possible to download more patients (via the cohort screen), view and download forms, create new OpenMRS patients, or view any unsent forms. Selecting a patient moves focus to the Patient Details screen, and then to the Form List screen.

Patient Details

This screen shows the patients= basic demographic details.

Downloading Forms

Show a list of forms already on the phone, and presents the option to download more forms or update the existing forms with newer versions of the forms. Newly downloaded forms overwrite existing forms with the same name. Selecting a form opens the form for filling.

Filling a Form

This screen navigates the user through each question in the form prompting the user for answers. The user can move forwards or backwards through questions, or exit the form.

Saving A Form For Later Sending

When the compulsory questions in a form are filled out, the form becomes able to be saved. Saved forms can be sent at a later stage either individually or as a group of forms.

Viewing Unsent Forms

When the compulsory questions in a form are filled out, the form becomes able to be saved. Saved forms can be sent at a later stage either individually or as a group of forms.

Creating A New Patient

It is possible to create OpenMRS patients. When this feature is selected, a form loads and the user is prompted to fill data for the minimum fields that OpenMRS requires for a patient creation. Once the form is filled out, and the form submitted, the newly created patient should be visible in the patient list in OpenMRS. Note that for the phone to download the new patient, there has to be a cohort that includes this patient, and the user needs to re-download that cohort.

Creating A Compatible XForm

The simplest form acceptable consists of 3 sections: Patient information, Encounter information and Observation information. The following fields MUST be present: PATIENT.PATIENT_ID, ENCOUNTER.ENCOUNTER_DATETIME, ENCOUNTER.LOCATION_ID and ENCOUNTER.PROVIDER_ID.

Designing the XForm

The simplest method of creating a form is to go Administration in your OpenMRS instance and select "Manage Forms"

  • Duplicate the Basic Form
  • Scroll down to "Schema design" and delete all extra fields so that it looks like this:

  • Then Save the form.
  • Click on "Design XForm"

  • Then go to File and click Save (this must be done to ensure the XFORM is created from the form).
  • Once saved, your XForm should be downloaded on the "Download Forms" option in the Form List on the device.

Feedback from Initial Testing (using Nokia N80 and MFU W71)

  • Failure to enter a valid base URL (for example omitting the port number), or if the server is unreachable causes  an "Unhandled exception. Close application?" error, if the user has not logged in previously.
  • The login is insecure.  The username and password are passed through a URL post to OpenMRS. On some phones, it shows the URL including the password in plain text when the user verifies that they want to connect to the server.  The username and password are included in the URL in the program settings for anyone to see also.
  • An "Exit" option should be added to each major section of the program, or some means of navigating to the main screen so you can exit properly.
  • Able to download cohorts, but xforms are not showing up from the server when trying to download forms.
  • No labels