developing countries hardware history open source presentation ruby on rails touchscreen volunteer Mike McKay recently took Baobab on the road, after being invited to speak at RailsConf Europe. He went and told the Ruby on Rails world about how rails is helping to fight HIV in Africa. He brought to life the HIV epidemic and showed how healthcare workers are being guided through treatment protocols and getting decision support from the data in realtime. Check out the slides from “Africa On Rails” for more information.
September 28th, 2007
challenges open source vct openmrs migration In a recent migration we needed to calculate the age of the patient at the time of their ARV initiation. Their WHO stage changes based on whether or not the patient is younger than 14. Turns out there is no fancy Ruby function to calculate age. Originally we used the following code based on a suggestion:
age = ((d2.to_time - d1.to_time) / 1.years).to_i
Unfortunately this doesn’t always work because of floating point arithmetic. Consider
d1 = Date.parse("2001-01-01")
d2 = Date.parse("2002-01-01")
age = ((d2.to_time - d1.to_time) / 1.years).to_i
p age
Here the age is 0. Clearly not what we want. But we do need to account for leap years and ignore remainders. So the trick is to treat the days logically:
d1 = Date.parse("2001-01-01")
d2 = Date.parse("2002-01-01")
age = (d2.year - d1.year) + ((d2.month - d1.month) + ((d2.day - d1.day) < 0 ? -1 : 0) < 0 ? -1 : 0)
p age
This accounts for day left overs and month left overs (so that the year is not artificially incremented. As an added bonus, this is the same thing in MySQL:
SET @age = (YEAR(@date_now) - YEAR(@patient_birthdate)) + IF(((MONTH(@date_now) - MONTH(@patient_birthdate)) + IF((DAY(@date_now) - DAY(@patient_birthdate)) < 0, -1, 0)) < 0, -1, 0);
December 9th, 2006
care database developing countries hct open source openmrs software vct vct openmrs migration The Baobab Voluntary Counseling and Testing (VCT) System is currently used in more than ten sites throughout Malawi. It allows clients to anonymously be tested for HIV, Tuberculosis, and other diseases. Registration clerks, counselors and lab technicians enter the collected information into Baobab touchscreen systems in real time. Though counseling, referrals, and general awareness are the primary goals of any VCT centre, data collection and analysis are a close second.
Until now, Baobab has used a proprietary data model for all of the data collection. With the latest release, Baobab has developed a set of SQL scripts that allows existing VCT deployments to migrate their data to the OpenMRS data model. By registering triggers in the MySQL database the system can continue to update the OpenMRS database as the VCT data is updated. This allows site facilitators to utilize open tools for analyzing the VCT data.
Why Choose OpenMRS?
The Open Medical Record System is a common framework upon which medical informatics efforts in developing countries can be built. It is currently in use in Rwanda and implementations are being built around the world. Using a shared data model across disparate installations and regions enables wider analysis of successes, failures, and general trends. The shared data model will enable each site to improve care based on the comparable results, successes, and assessed need making a better experience for each client.
Get the Code
Baobab has published the code under the MIT license on Google Code.
August 30th, 2006
baobab linux hardware linux open source power software touchscreen Baobab Linux is still in its initial stages. The development process has included many approaches and has enlisted the help of many experts. People from Hungary, Australia, England, the United States, and of course Malawi, have all worked directly on Baobab Linux. The consensus is that there are still plenty of innovations that can be made to create the optimal operating system for capturing health related data from the iopener hardware, but that this initial version Baobab Linux is ready for action.
Baobab Linux v1.0 is based on Midori Linux. Midori Linux is a general Linux distribution optimized for flash disk based devices with minimal resources (an embedded Linux by some definitions) . This fits in well with our needs, but unfortunately it did not meet our needs without heavy modifications. Since all of Baobab’s projects will be delivered via a web browser, it was critical to get a standards compliant browser working on Midori Linux. In collaboration with the developers at Opera Software, we determined that Opera version 9 for Linux would match our requirements of being standards compliant, fast, and memory efficient. Opera 9 requires almost 10 megabytes of disk space, hence a lot of effort was required to optimize the footprint of Midori Linux in order to allow it contain all of the operating system as well as the web browser.
The following are some observations to compare Baobab Linux with Windows 98 Lite:
Baobab Linux
Power Consumption: 11.45 Watts
Required disk space: 16MB (fits on internal flash disk)
Startup: 58s
Shutdown: ~1s
Required memory: 32MB
Local Web Page Retrieval: ~1s
Windows 98 Lite
Power Consumption: 17.80 Watts
Required Disk Space: 64MB (requires flash memory)
Startup: 56s
Shutdown: 5s
Required Memory: 32MB
Web Page Retrieval Time: n/a (web browser removed)
Two differences in particular are worth examining. First, note the differences in power consumption. This is the power consumption as measured when the system is idle. Baobab Linux uses almost 40% less power than Windows. This is a critical difference as our systems are increasingly being deployed in places with very unreliable electricity and soon places without any electricity at all. To combat this, we build power backup systems with arrays of deep cycle batteries that can be recharged in a variety of ways (solar, wind, minibuses, wall sockets). The power consumption of our systems directly affects how long a system can run on the batteries, and how long it will take to recharge them. Hence, less power consumption means that our systems will be able to run longer before requiring a recharge.
The other important difference is that Baobab Linux requires just 16MB of memory. This means that we no longer need to have an additional flash card and the custom adapter that goes along with it. Practically this reduces the cost of the IOpener by about $35 - a 10% reduction!
Download Baobab Linux build kit from Google Code.
Download a Baobab Linux disk image.
August 30th, 2006
open source software touchscreen toolkit Overview
The Touchscreen Toolkit generates a wizard-like interface for web forms with additional features for working with touchscreen devices.
The Toolkit currently supports the following form input elements:
- Text boxes
- Drop-down menus (select)
- Radio Buttons
- Check boxes
- List boxes (multiple selections not yet supported)
Download it
How to use the Touchscreen Toolkit
- Create an HTML file with input elements
- Include touchscreenToolkit.js and touch.css
- Add the following attibutes to your input elements: ajaxURL (optional), helpText and validationRegexp (optional). Read the attribute reference below for more information.
- Open the web page and click Enable Touchscreen Toolkit
Try It
Click here to see the touchscreen toolkit transform a normal html form into a touchscreen optimized user interface (no touchscreen required, a mouse will work too).
Get Involved
We need your help. If you are a javascript, css, or html hacker and want to help us solve the health care crisis in Africa check out the code from svn and start helping. Even if you are just a user, and not a hacker, let us know your experiences with it so that we can make it better.
Touchscreen Toolkit Element Attribute Reference
ajaxURL
A relative URL returns a list of items to populate the options box for this element. The toolkit will append the value entered so far to the URL to filter the options (suggestions) after each toolkit keyboard press.
e.g.: ajaxURL=”/cgi-bin/listOfNames.pl?search=”
helpText
Contains instructions for the user when interacting with this element
e.g.: helpText=”Enter the applicant’s first name”
validationRegexp
A Perl Compatible Regular Expression that represents valid input for this element.
e.g.: validationRegexp=”^(\w)+$”
Known Issues
1. TEXTAREA element is not yet supported
2. Multiple selections on SELECT elements are not supported. You can only use single selections
Screenshot
August 30th, 2006
baobab linux hardware linux open source software touchscreen Baobab Linux is a Linux distribution targeted specifically for customized iOpener computers. Linux distributions have already been built for the iOpener, but the iOpeners used by Baobab Health Partnership include such hardware customizations as: touchscreen hardware, USB ethernet adaptor, etc. Furthermore, Baobab Linux requires an integrated web browser able to process AJAX requests. Hence, Baobab Linux initially needs to support a specific set of hardware to run a web browser.
Hardware:
- iOpener computer
- x86 processor (266MHz Rise)
- VGA video card - Trident Cyberblade 7
- LCD monitor running at 800×600
- USB Ethernet (Pegasus)
- Touchscreen - Made by 3M. MERL may create alternative version (serial port support most important, USB support is nice to have)
- Sound card (not top priority, dependent on 16 volt power supply)
- 32 MB of RAM
- 16 MB Flash disk
- Keyboard (bar code scanner)
- Printers (label and laser via parallel port)
Software:
- Web browser that is AJAX capable and starts in full screen mode
- Time for initial power on until web browser appears: 10 seconds (this is a rough goal)
- Screen saver capable of displaying blank screen or full screen web page (not critical)
- Printing program (command line) which takes file as argument, and passes file to local printer. Web browser will have a mime-type configured to pass all “application/print” files (or simply .lpr files) to this program.
- Pressing power button should do a quick shutdown (why not just instantly shut off - everything is read only, right?)
- Consider power management features?
- Everything needs to fit on that 16MB flash disk and run in 32MB of RAM
Build system: Need to be able to configure the home page for the web browser. Need documentation for adding drivers/software in the future. Specifications for the type of machine the build system needs to run on (Baobab is moving to standardize on Ubuntu for all developer machines). We would like to be able to run Baobab Linux in vmplayer for testing. We would like to be able to build Baobab Linux for other hardware - (Wyse terminals, regular laptops, etc) - build system should be designed with this in mind.
August 29th, 2006
hardware linux open source software Server
Each eVectra server runs the Ubuntu Linux distribution. Fault tolerance will be achieved with the addition of high availability extensions to facilitate redundant fail-over between eVectra computers should a problem arise. A lightweight HTTP server called lighttpd is used to process requests from the workstations. The entire solution uses free and open source software.
Workstation
The workstation runs Baobab Linux, a customized operating system optimized for use with the touchscreen hardware. The user interface is created with a combination of HTML, Javascript and CSS delivered by a Ruby on Rails application that runs on the server. This is called a thin client approach since the application exists on the server instead of the workstation. This makes it easy to update the software – updates can even be accomplished remotely via the server’s dial-in mechanism.
Database
The free and open source MySQL database management system is used to capture all data. The OpenMRS data model defines the schema that all of our data is stored in. The OpenMRS data model is an open source project developed as a collaboration between the Regenstrief Institute and Partners In Health and is supported by the World Health Organization. It is the result of decades of experience in medical informatics and has been deployed throughout the world. By using the OpenMRS data model Baobab complies with international standards and will be able to benefit from ongoing development efforts of the OpenMRS team.
August 29th, 2006