Overview - What this module does
The module is developed for patient registration, and is able to create new patients including recording of relevant demographics and a standard national address hierarchy, identify previous patients, create barcode with unique ID, scan barcode, record patient vital signs, scan national ID and record which service the patient is attending.
The patient registration runs as a touch screen application. The module uses Baobab Touchscreen Toolkit to simplify the development of touch-friendly user interfaces without requiring each page to be individually and consistently customized for touchscreens. See http://github.com/baobab/touchscreentoolkit.
The touch-screen computers will be configured to start OpenMRS using this form .../openmrs/module/rwandaprimarycare/login/login.form
Documentation / How-To
Instructions: Server Side Setup
- Download the module from the repository and install it. This module depends on the idgen, addresshierarchyrwanda, and namephonetics modules, so these must be downloaded and installed prior to installing primary care. The idgen module provides an architecture for assigning ID numbers to patients during registration. The addresshierarchyrwanda module contains the entire address structure for the country of Rwanda, and provides an architecture for structured and unstructured addresses. The addresshierarchyrwanda module (since version 1.2.3) provides an htmlformentry custom tag that essentially renders its AJAX-style rwanda address fields and then records the user-selected values to the database. Finally, the namephonetics module ensures that searches by name are smart about common phonemes in the Kinyarwanda language.
- Go through global properties and save all registration properties, in particular
--the Rwanda location code is expected to be the three-digit code assigned to each health center by the Rwanda Ministry of Health. For example, the three-digit code for Rwinkwavu Health Center is 416. The primaryIdentifierType should be the identifier type that you just created for primary care registration IDs. If there is the possibility of receiving transfer patients from other health centers where they may have received a barcode, setup the global property: registration.rwandaLocationCodes. These are pipe delimited pairs of Health Centers by name, and Health Center MoH three-digit location code. For example, a valid entry would be "Rwinkwavu Health Center:416|Kirehe Health Center:477|Rusumo Health Center|412". (please verify your location codes before going live).
- Then, to prepare primary care-issued IDs, first make sure all idgen tables are empty, if migrating from a test database.
- Create a Primary Care ID Type – choose the Rwandan ID validator.
- Go into the idgen module administration pages, choose the primary care ID type you just created, and Local Identifier Generator
- Here's the base character set: 0123456789ACEFHJKMNPUWXY, First identifier base is: 00001, and the length is 10.
- Click 'view', and test by exporting a couple of identifiers.
- Check the relationship type used during registration to record a patient's mothers and father's name (global property
registration.parentChildRelationshipTypeId). If this global property is empty, check the database to determine the ID of the parent to child relationship type (or create one).
- You may need to add the core openmrs global property
- You may need to add two privileges to the default user role – Manage Identifier Sources, and Generate Batch of Identifiers.
- In the name phonetics "Generate Phonetics for All Patients" page, select Double Metaphone for Given Name, and Kinyarwanda Soundex for Family Name and save properties.
- Generate name phonetics on this same page. (NOTE: this can run for a couple of hours, if you have thousands of names in your database).
- In Rinkwavu, we have overwritten a couple of core openmrs text properties. To do this, in your OpenMRS runtime properties file, add the following line: custom.messages=<<path>>/custom_messages.properties, where you set the <<path>> to wherever you want to create a custom_messages.properties file. Then in the custom_messages file, add the following lines:
Person.name=Name (Christian name, KINYARWANDA name)
Instructions: Touchscreen Client
(Note: this section already assumes that you have installed Ubuntu on your touchscreen, and that the touchscreen drivers are working correctly. These do not have to be powerful machines in the least -- all the touchscreen has to do is run Firefox or Chrome. In Rwinkwavu, we're using J2 touchscreens, which are heavy-duty, and suitable for outdoor use.)
1) Configure Firefox for the touchscreen user:
- At the terminal, run firefox -ProfileManager to open the profile management dialog
- Create a profile called Registration, set this to automatic
- Set firefox homepage to be touchscreen registration openmrs page
- Disable all automatic updates (Edit > Preferences > Advanced)
- Install the _rkiosk _firefox add-on from the internet
- Find the Firefox profile folder in ~/.mozilla/firefox
- (optional) edit the pref.js file and the following line (this can also be set from about:config through the firefox interface):
- Download _http://github.com/baobab/firefox-daemon/blob/master/default.profile/chrome/userContent.css and save it the _chrome _folder
- Find the folder for the rkiosk extension, and open chrome.manifest
- Remove the last line 'overlay chrome://mozapps/content/downloads/unknownContentType.xul .....' (barcode printing doesn't work otherwise)
- (added Feb 9, 2011) We've run into a problem where the browser sometimes opens in offline mode if the internet is down, and then stays stuck in offline mode when the internet comes back. To fix this, open the page about:config in firefox, and then change the value of 'browser.offline-apps.notify' to false. This should prevent firefox from opening in offline mode, even if there is no internet.
2) Lock-down Ubuntu into a Firefox kiosk
- Go to System > Preferences > Startup Applications
- Add a new startup program called Patient registration_ _and specify /usr/bin/firefox -P "Registration" as the command
- Uncheck the following programs: Check for new hardware drivers, Disk notifications, Update notifier
- Open gconf-editor and browse to /apps/update-notifier, and uncheck the the auto_launch option
- Open the file /etc/update-manager/release-upgrades as root and change the value of Prompt to never
- (optional) Add a shortcut to Firefox on the desktop, and also a shortcut to Firefox in safe mode (i.e. firefox -safe-mode)
3) Configure automatic login
- Go to System > Administration > Login Screen
- Click on Security, select "Enable Automatic Login", and select the name of your user in the box below it
4) setup barcode printer. In Rinkwavu, we're using the Zebra TLP2844 (NOT the LP2844, and NOT the TLP2844-z), with ELP2 support.
Plug the printer into USB port
Create a two-line file barcodeprint.sh:
cat $1 > /dev/usb/lp0
When Firefox asks which program to open barCode.epl with, pick barcodeprint.sh
In order for this to work, you must add the linux user to the lp group.
Finally, in the current builds of Firefox, the 'remember my selection and do this from now on' checkbox that SHOULD remember that you want to open the .epl file with barcodeprint.sh doesn't currently work. The firefox plugin Web Page Fixer can be used to fix this. This plug-in is available here: https://addons.mozilla.org/en-US/firefox/addon/10422/.
5) configure scanner for pdf417, and code128
need to download the manual and print relevant configuration codes; maybe we can make the beep less obnoxious
6) interfaces file needs:
iface eth0 inet dhcp
(this also seems to work??):
iface lo inet loopback
7) it is also recommended that once a firefox profile is established that works correctly in touchscreen mode, and prints barcodes correctly, that a tar file is created of the firefox profile, and that this tar file overwrites the existing firefox profile at startup. We have seen several instances where the barcode file that is downloaded becomes linked to the wrong application, or the firefox homepage gets reset to something other than the touchscreen interface page in OpenMRS. By restoring the firefox profile at startup, these errors can be fixed with a simple reboot.
to create your tar file:
1. go to touchscreen <<user's home directory>>/.mozilla/firefox
2. read the profiles.ini file to determine the profile folder used by the user when accessing the OpenMRS registration module. This should be the profile that has the kiosk setup. Mine was called i2c33y1i.Registration.
3. create the tar file with the command: tar -cvf /home/<<username>> ./<<firefox profile folder>>. For me this was tar -cvf /home/user ./i2c33y1i.Registration
4. chmod 777 on the newly created tar file in the user's home directory
5. now sudo to root and create an init.d script, referred to in these instructions as <<firefox reset script name>>, to unpack the tar file and overwrite the firefox profile at startup. To do this create a text file with a name like 'firefox-reset' in /etc/init.d and chmod 755 on this file.
6. here are the file contents (fill this in with your local settings):
#! /bin/sh -e
tar -xvf /home/<<username>>/<<tarfile name>> --overwrite --absolute-names --preserve-permissions --directory /home/<<username>>/.mozilla/firefox
7. finally, to add the init.d script you've just created to the right run levels, type: update-rc.d <<firefox reset script name>> defaults
If the script doesn't work, or you want to stop running this script at startup, just type update-rc.d -f <<firefox reset script name>> remove
And, note, update-rc.d doesn't expect the path to your firefox reset script. Just type the name of the file. update-rc.d already knows to look in /etc/init.d.
Instructions: Frequently Asked Questions
Where is the Firefox profile folder?
Help > Troubleshooting Information > Open Containing Folder
Printer can't recognize the break between stickers OR the printer doesn't recognize the correct HEIGHT of my stickers:
Here's the auto-sense printer startup routine:
1. Make sure the printer power is off and that the stickers and ribbon are loaded.
2. Press and hold the feed button then turn on the printer power.
3. Continue to hold the feed button until the status light LED flashes.
Release the feed button.
4. The printer will set the media sensor for the label backing being used.
After the printer is done making this adjustment, the roll will
automatically feed until a label is positioned at the print head.
5. The configuration settings will print. Upon completion, the printer will save the new settings in memory and
remain in diagnostic dump mode.
6. Press the feed button on more time. The printer will dispense another label with the
message "Out of DUMP" and be ready for normal operation.
How do I tell the printer the width of my barcode labels?
For the Zebra TLP2844, the dpi (or print resolution) is 203, meaning that there are 203 dots in an inch. Our new label width is 2 inches, meaning that we needed to tell the printer that the media width is 406. The strategy that we used was to send EPL directly to the printer. This is pretty easy. All you need to do is login as someone with rights to the lp group in /etc/group, and then type the following command at the command line:
echo q406 >> /dev/usb/lp0
What this does is send the 'q' command (the EPL command to set the label width) to the printer, which is located at lp0. the '406' argument is the 406 dot length that corresponds to the 2 inch width of our stickers. After doing this, it is a good idea to then do the 'autosense' routine above, so the printer auto-detects the label height and the break between stickers.
How does the barcode printing work:
Barcode printing works as follows: when you click Print Barcode in the OpenMRS Touchscreen application, OpenMRS generates an .epl file that contains EPL2-language instructions that are to be interpreted by the printer. What you do is then configure firefox to automatically open the file with barcodeprint.sh. The barcodeprint.sh file is basically just a three line command file that routes the epl instructions to the printer device, which on Ubuntu should be /dev/usb/lp0 (see the code of barcodeprint.sh above). Then, the printer should execute the instructions. For more information on the EPL2 language, just do a google search for 'Zebra EPL2 Programmer's Manual'. This strategy is designed to do two things: first, you don't need a driver to install the printer. barcodeprint.sh basically fulfills this function. And second, we don't want to see a popup 'print' dialogue in Firefox -- when you click the 'Print Barcode' button, you just want the printer to spit out a barcode, no questions asked.
- RPC-44 -Duplicates of parents should not be saved
- RPC-43 - Handle MoH FOSA codes with less than 3 digits correctly
- RPC-39 - NumberFormatException is thrown if age contains floating points
- RPC-38 - Print ID Barcodes For Offline Use prints <spring:message code= ...
- RPC-37 - Display only patient names in autocomplete name list
- RPC-36 - set MIME type EPL in JSP