In the middle of GSoC: The Summer of Sync

14 07 2009

It’s been quite a while, truth be told, quite some time without posting updates to this blog.
My GSoC project have been going through a mix being busy, many events happening, trying to find love for new things but I am sure my project is still interesting .
Today I want just to mention the status of my GSoC project ; it’s in the mid-term evaluation and we expect Google paying for all ‘well-going’ projects .

I have a detailed wiki page about my project : OpenMRS Sync, Create a new Sync Node .Everyone is welcome to leave useful comments on this project. The source code is available under the terms of OpenMRS Public Licence and can be browsed from OpenMRS website as well as they can be ‘checked-out'(downloaded) via subversion with the command

svn checkout http://svn.openmrs.org/openmrs/branches/data-synchronization-admin-ui

Other things actually are happening in my coding environment:I have been undergoing series of switching Operating Systems between Windows, Linux and Solaris and I have some insight about what does things in the best way; I have been trying to find love for Groovy/Grails at the same time I am trying the Qt toolkit .Groovy seems to be a powerfull Jav-based agile framework, easy to configure and deploy. Touching it is like drinking milk from your grandma, and when you get satisfied you feel and find that you have more energy . Qt is a cross-platform desktop GUI framework using C++and acquired by Nokia last year, Qt is the parent of KDE Desktop environment for Linux.Trying Qt is like eating bread from your granddad tagged with honey inside; you get stronger and healthier. The reality behind things like these(trying new things) should be :”Always, there is a place where you want to go, there is a person who you want to be with, there is something you always want to see happenning, there a level you always wish to be on, the is a goal you always want to achieve ! The list doesn’t end and when you feel you don’t have neither one of these desire, you don’t enjoy your life .” .

I the past 40 days, I have seen many other things happening around us and among them as I am writing: ATRACO club from Rwanda won the East-African soccer cup(CECAFA), Rwanda has named other new born gorillas (Kwitizina<www.kwitizina.org>: this is really a new brand for the Gorilla tourism in Rwanda, and it demonstrates the efforts deployed in both tourism promotion and conservation ) , Rwanda has celebrated 15 years after National Liberation and the end of Tutsis Jenocide <www.rwanda15.org>. An other event was the departurte of MJJ , the King of Pop, to the land of peace, and I can’t say anything more personal than “In paradisum deducant te Angeli; in tuo adventu suscipiant te martyres, et perducant te in civitatem sanctam Ierusalem. Chorus angelorum te suscipiat, et cum Lazaro quondam paupere æternam habeas requiem.“.

This is not the end, please stay turned to my blog and I love to hear your comments .

svn checkout http://svn.openmrs.org/openmrs/branches/data-synchronization-admin-ui




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 .





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 !