Last week OpenMRS GSoC activities

1 06 2009

Last week was really busy forme, I was packaging everything for traveling back to Kigali . At least now, I get time to write a couple of blog posts . I am seating in WA Dulles airport,  waiting for the plane that take me to Brussels; I am waiting  almost for the whole day and I can now summarize what I’ve done on OpenMRS during last week .

My GSoC project is again about Sync: “Data synchronization is a new OpenMRS feature allowing synchronization of data amongst a set of loosely networked servers. Such ability to exchange data is essential for operation of EMR system in rural areas where connectivity amongst sites maybe unreliable yet the need for timely centralized collection and analysis of data from remote sites exists.”

The synchronization feature was designed in a parent-child hierarchical model, to allow data to flow from from remote sites to more central parent and vice versa . A parent OpenMRS server can have many child servers and child can have only one parent . At synchronization, a child server send new change-sets to its model (SYNC REQUEST) and receives all new change-sets from the server (SYNC RESPONSE) . This can be done either via the web or with a disk drive (file) that can be carried over the parent while the child is off-line and  the parent will also issue an off-line sync response to carry back to the child . The sync via file doesn’t mean that you have to move physically to the place where the the parent server is installed ; OpenMRS is a web app and any where you can access the parent app you can sync your off-line child !

There are two additional changes on the OpenMRS data model that synchronization does :

1) synchronization_* tables are added to the data model for storing sync settings & configuration and they also store the temporary sync import/export records .

2) GUID indexes : to ensure data exchange between different OpenMRS systems, the ID fields are not enough to identify a record because there are from different MySql installations, so the GUID index columns are added to all data that can be sync-ed .

My actual project’s main aim is to provide an automated way of creating a new sync node(i.e.child) and provide the appropriate user interface . This was done in manual process and required much administrative knowledge. When creating a new sync node(i.e.child) you had to:

  • register newly created child with parent
  • back up parent server DB and move the backup to the new child server
  • restore parent’s DB
  • assign new server sync ID
  • change any server identifying information from parent to child (i.e. form entry server URL)
  • test sync connection between parent and child and finally establish periodic sync schedule

In order to achieve these project I have to start from the actual sync code . As last year I was commiting to the synchronization-admin-ui branch, I think I am going to commit to it even for this project . So I started by resolving few issues in the actual code and I merged the synchronization_bidirectional branch to the sync-admin-ui branch so that all sync changes after last GSoC be available to the sync-admin-ui . This was not a simple task because the sync_bidirectional branch also merges from trunk .

I just used Subclipse merge feature and I let both the old and new versions of code be there then I removed the old revisions where it was necessary and, sometimes I had to use a piece of regex in order to be fast .

For example, Subclipse should form somewhere two blocks of code with different versions and limit them with

<<<<<<< .working
//Code
=======
// Code
>>>>>>> .merge-right.r7385

Then in that case I used the following regex and replaced it with an empty space in order to keep the merger-right version of the code

(<<<<<<< \.working([\x00-\xFE]*?)=======)|(>>>>>>> \.merge-right\.r7385)

This is how I merged and it’s working perfectly .

My next step now is to find out a way of cloning the MySql database from the parent DB and apply it to the new child instllation automatically . If you have more ideas about how to achieve this, please leave your comments .





Seattle Theaters

1 06 2009

This was really amazing, I spent the last two months doing an internship with RealNetworks, Inc.

I was assigned to a challenging software engineering project and everything went well . My supervisor was always complaining because the internship was so short, and 6 months should be the best . Anyway my project was so successful and it attracted a lot of people in  my team .

Apart of the work, I get to know a lot of people and Seattle especially . This was my first trip to the US , the country where everything is possible !

Sometimes I got to hang out with friends and got to watch movies in the theaters around . Well, this was a very adductive fun and it’s the reason why the title of this post is called so . For my colleagues who like coding, I have a fun of code that always came out after watching one of the SciFi series . Guess which :

try{
energize();
}catch(UnknownUniverseException ex){
ex.printStarTrek();
}

Isn’t that fun ? The really came out once I wanted to write ex.printStackTrace and I wrote ex.printStarTrek instead .

Here is alist of the movies I enjoyed while in Seattle :

1- Fringe : a kind of new X-Files ; you know what ,  I already saw someone in Olivia’s face here in Seattle and I am applying for a Computational Bio-Chemical Engineering internship position with Massive Dinamic , WHAT CAN’T WE DO ?  (  — This is a joke )

2-Star Trek : This was awesome and I enjoyed it even before I knew it was so famous (at the time when they released the new season).

3-Angels & Demons : Oh my goodness , what a Camerlengo ? I was happy to see the movie starting in the LHC near Switzerland but I didn’t imagine it’s gonna be a Da Vinci Code of some sort . Anyway I am not a part of Illuminati ! And at the end of the movie the guy(Camarlengo) got into trouble , and I remembered my old high school latin text about Catilina: Quo usque tandem abutere, Catilina, patientia nostra?

and

4- Drag me to Hell was the Killer ! Don’t even dream of the story because it can be so harmful .
That was my fun time, tell me what you think about these movies .





Pushing it forward, The Summer of Love !

23 04 2009

A couple of weeks ago, I definitely started using Ubuntu “officially”  on my new laptop, and I realized that it’s really SUPER-COOL . This is one of the most successful Desktop Linux distros .The reasons are so many : I was obviously tired of windows and most of my colleague coders are using Unix-based O.S. This was also one of my great goals of 2009 and it may be a reason to say “GanBei” in Chinese for those who knows . I will no more rely on Cygwin or MinGwin for coding C/C++ or Qt with Eclipse .

The are really big efforts deployed in open-source world to produce for free those SUPER-COOL tools like Linux or other tools we use in our everyday life or others used by institutions and organizations . Open-source is a kind of “green business” whose model is not understood by many people, vulnerable to failure but very remarkable for their success . There isn’t a single development on this world which is not aware of this kind of revolution . It should be the change we wish to see !

2009socwithlogoOne of the greatest programs in contribution to open-sourrce is the  Google Summer of Code(TM) ,“Since its inception in 2005, the program has brought together nearly 2500 successful student participants and 2500 mentors from 98 countries worldwide , all for the love of open source coding – Google . I am happy to be accepted again for the 2009 version of GSoC . I will be working with OpenMRS an open source medical record platform for developing countries . I will be working on the Data Synchronization feature of OpenMRS and my primary mentor Maros is also a kind of super-cool ; I met him last year in Kigali .

OpenMRS has been deployed in different african countries especially as EMR system for fighting against AIDS, Malaria and Tuberculosis , ” Our world continues to be ravaged by a pandemic of epic proportions, as over 40 million people are infected with or dying from HIV/AIDS — most (up to 95%) in developing countries. Prevention and treatment of HIV/AIDS on this scale requires efficient information management, which is critical as HIV/AIDS care must increasingly be entrusted to less skilled providers. Whether for lack of time, developers, or money, most HIV/AIDS programs in developing countries manage their information with simple spreadsheets or small, poorly designed databases…if anything at all. To help them, we need to find a way not only to improve management tools, but also to reduce unnecessary, duplicative efforts. As a response to these challenges, Open Medical Record System (OpenMRS®) formed in 2004 as a open source medical record system framework for developing countries — a tide which rises all ships. OpenMRS is a multi-institution, nonprofit collaborative led by Regenstrief Institute, Inc. (http://regenstrief.org), a world-renowned leader in medical informatics research, and Partners In Health (http://pih.org), a Boston-based philanthropic organization with a focus on improving the lives of underprivileged people worldwide through health care service and advocacy.     – OpenMRS “

There are many special things in this Summer of Code : I have a neighbour summer of code student, Mugisha in Kampala (Makerere University student), who is working with the same OpernMRS project, so we should even have our meet-up in East Africa . This is the fifth anniversary of Google Summer of Code, I hope we will make it the best summer of code, yet the Summer of Love, love for coding . I love coding on my Ubuntu Laptop !