Google Summer of Code: Write code and save lives with OpenMRS

Earlier this year OpenMRS participated in Google Summer of Code, a worldwide program organized by Google’s Open Source Programs Office to expose university students to the world of free and open source software, and encourage those students to become long-term contributors to projects that interest them. OpenMRS is a web-based medical record system originally designed for use in the developing world, and is now used on every continent on the globe. OpenMRS is used in all kinds of health care environments, from research laboratories to hospitals to small clinics in remote villages, and even via mobile devices that collect data door-to-door.
OpenMRS has been participating in Google Summer of Code every year since 2007, and our 5th year was arguably our most successful yet. This year, 15 motivated students successfully completed projects to focus or extend the OpenMRS health care IT platform in ways that will have significant impact for our global community of users. Throughout the summer our students became full contributors in good standing in the OpenMRS community. They presented their projects’ work in progress to other developers and users and often contributed their code to our software releases to support health care professionals saving lives around the world. Unlike many other summer internships that students may have during the summer, our students were responsible for planning and delivery of “real-life projects” that came from needs and requests from people installing and using OpenMRS.
Some projects were dedicated to improving the core OpenMRS platform, and some built add-on modules to support specific types of clinical activities. There were projects focused on making the installation of OpenMRS easier, and others focused on helping improve collaboration for our volunteer community. And if the presentations our students made this semester were any indication, all of the projects were exciting ways to write code and save lives. There’s not space here to describe each project in detail, but we encourage you to check out our students and their projects on the OpenMRS Wiki and learn more about them:
  • Balachandiran Ajanthan created an add-on module to deploy reusable “SMART” health care apps inside OpenMRS.
  • Christopher Zakian reimagined a “universal” search within OpenMRS that allows users to search for any system data from anywhere within the system
  • Gaurav Paliwal created an add-on module to allow OpenMRS users to provide application feedback to their system administrators and the larger open source community.
  • Gauthami Pingili improved both the UI of the OpenMRS Patient Matching module and improved its accuracy of finding duplicate patients.
  • Goutham Vasireddi helped make it faster and easier for developers to write add-on modules for OpenMRS by creating a “wizard” for Maven.
  • Jelena Skorucak reworked the attributes a person has within OpenMRS, giving clinics the flexibility to record more information about the persons.
  • João Portela made significant improvements to our HTML Form Entry editor, allowing non-programmers to create more detailed, useful data collection forms for health care.
  • Piotr Bryk enhanced our Metadata Sharing module to make it easier to manage the export and import of OpenMRS system configurations.
  • Rahul Akula’s work helped make it possible for OpenMRS to interoperate with external laboratory information systems.
  • Sai Manohar Nethi worked to create a framework for a comprehensive Human Resource add-on module for OpenMRS, allowing the system to help manage clinic personnel.
  • Sreya Janaswamy created a way for OpenMRS users to translate phrases used by the application into other languages, inside the application itself.
  • Sriskandarajah Suhothayan created a way for the OpenMRS Notifiable Condition Detector module to watch for certain large-scale patterns and send notifications to clinicians via SMS or e-mail.
  • Suranga Kasthurirathne created a new way for OpenMRS to store clinical observations that reference other people or locations.
  • Taras Chorny built a system to allow OpenMRS to be installed and upgraded using a variety of languages.
  • Victor Chircu built an “Atlas” add-on module that allows OpenMRS users to opt-in to report their location, type of clinic, and number of patients on a shared map to represent the active OpenMRS community.
Since we started participating in Google Summer of Code, we’re very proud that so many of our students have stayed active in the OpenMRS community and continued to contribute their talents after the program ended. In fact, three of our students have gone on to become full-time OpenMRS developers paid by various organizations involved in our community.
We continue to be more and more impressed with the students who are interested in our work, and are proud to welcome them into the OpenMRS family! In fact, this year, 2011 Google Summer of Code student Suranga Kasthurirathne was able to join us in October for our annual OpenMRS implementers meeting in Kigali, Rwanda. Suranga provided some excellent feedback about his involvement in Google Summer of Code this year, and about his experience meeting the OpenMRS community face to face. Read his blog post for more of his thoughts.
Once again, this year we were blown away by our amazing students during Google Summer of Code.

Documents List API

 

There are a number of ways to add resources to your Google Documents List using the API. Most commonly, clients need to upload an existing resource, rather than create a new, empty one. Legacy clients may be doing this in an inefficient way. In this post, we’ll walk through why using resumable uploads makes your client more efficient.

The resumable upload process allows your client to send small segments of an upload over time, and confirm that each segment arrived intact. This has a number of advantages.

Resumable uploads have a customizable memory footprint on client systems

Since only one small segment of data is sent to the API at a time, clients can store less data in memory as they send data to the API. For example, consider a client uploading a PDF via a regular, non-resumable upload in a single request. The client might follow these steps:

  1. Open file pointer to PDF
  2. Pass file pointer and PDF to client library
  3. Client library starts request
  4. Client library reads 100,000 bytes and immediately sends 100,000 bytes
  5. Client library repeats until all bytes sent
  6. Client library returns response

But that 100,000 bytes isn’t a customizable value in most client libraries. In some environments, with limited memory, applications need to choose a custom chunk size that is either smaller or larger.

The resumable upload mechanism allows for a custom chunk size. That means that if your application only has 500KB of memory available, you can safely choose a chunk size of 256KB.

Resumable uploads are reliable even though a connection may not be

In the previous example, if any of the bytes fail to transmit, this non-resumable upload fails entirely. This often happens in mobile environments with unreliable connections. Uploading 99% of a file, failing, and restarting the entire upload creates a bad user experience. A better user experience is to resume and upload only the remaining 1%.

Resumable uploads support larger files

Traditional non-resumable uploads via HTTP have size limits depending on both the client and server systems. These limits are not applicable to resumable uploads with reasonable chunk sizes, as individual HTTP requests are sent for each chunk of a file. Since the Documents List API now supports file sizes up to 10GB, this is very important.

Resumable upload support is already in the client libraries for Google Data APIs

The Java, Python, Objective-C, and .NET Google Data API client libraries all include a mechanism by which you can initiate a resumable upload session. Examples of uploading a document with resumable upload using the client libraries is detailed in the documentation. Additionally, the new Documents List API Python client library now uses only the resumable upload mechanism. To use that version, make sure to follow these directions.

Google Custom Maps

Do you love to explore the outdoors with Google Maps but sometimes wish it had the details of a trail map or a tourist attractions map of a foreign city? Do you sometimes wish you could take one of those “You are here” maps with you to help you find places in an unfamiliar environment? Do you prefer maps on your phone rather than on paper?

If you answered “yes” to even some of these questions, you may want to take a closer look at a new Android app called Custom Maps — recently released as open source at code.google.com.

Custom Maps showing a birdwatcher’s location overlaid on a photo of a posted park map.
The Custom Maps app allows for easy creation of digital maps from any map image. The image can be a photo of a paper map, a photo of a brochure map, or a picture of the map posted at a trailhead or at the entrance to an amusement park. It could also be a .jpeg or .png image hosted on the internet or a screenshot of a PDF map. All you have to do is choose two (or more) matching points that are common to both the map image and Google Maps, and Custom Maps can show your GPS location on the map. This makes it an excellent mapping option in situations where data signal is not available like in state parks or abroad, or when alternate map images show details that are not included in Google Maps.

Custom Maps showing a hiker’s location on Mist Trail in Yosemite National Park.
Custom Maps stores the geo aligned map images into KMZ files, which are simply ZIP files containing the geo location information in KML format, and the map image file. This makes it possible to take the map image out of the KMZ file, add some personal markup in the map using an image editor, and put the image back into the KMZ file. As long as the image is not resized in the process, the marked up map image can now display the user’s GPS location.
Custom Maps users can share created geo aligned map images as email attachments or by using QR codes. When a Custom Maps compatible QR code is scanned by a barcode scanner application, users can open the link directly in the Custom Maps app instead of a web browser.
Google has published the source code for Custom Maps under Apache License 2.0 at http://code.google.com/p/custom-maps/. The source code can be studied for examples of how to deal with the following topics on Android mobile apps:
  • dealing with large images in constrained memory environment of mobile devices
  • parsing XML (KML) documents using XML Pull API
  • using the Google Maps Android API and displaying translucent overlays on MapView widget
  • declaring an app as able to handle special URLs and file types so it can be launched by QR codes and so mail applications can direct attachments to it
  • triggering file sharing intents from an app
But Custom Maps is not finished yet. Several new features are planned including distance measurement, marking map locations with icons, making it possible to geolocate map images without Google Maps or data connection, working around the app memory limit to load larger map images, and automatically switching between stored maps based on user’s location and zoom level. Join the open source project to add these and more features to Custom Maps.