Monday, May 31, 2010

Started the New Journey - First Week of Coding



The official coding period for Google Summer of Code 2010 started on the 24th of May. I was prepared to kickoff with coding. One the very first day, my mentor created a svn location for my module named "flowsheet". Since the name, Longitudinal Dataview Model was somewhat lengthy, we decided to go with "flowsheet" as the module name. I was having conversations with my mentor Sy via Skype and Sy assigned me the first task. It was to make the module's tab available in the patient dashboard.

I created a new module using the OpenMRS Eclipse studio, modified the configurations and started working on getting the tab available in the patient dashboard. After some amount of time looking at other module's code and module wiki I managed to find how to do that task. I created a class inside the package org.openmrs.module.flowsheet.extension.html named FlowsheetTabExt which extends the class PatientDashboardTabExt. I got a new tab called "Flowsheet" available on the patient dashboard. I informed Sy about it and Sy asked me to check in the code to the svn. I did my first commit on Monday it self to the svn location http://svn.openmrs.org/openmrs-modules/flowsheet/.

Even though we decided to GWT, for the purpose of getting the idea about retrieving patient data, I worked on to get the patient history printed on the jsp page of the module. It was just a throw-away work to get knowing the stuff. I managed to list all the obs of a patient in reverse chronological order in a jsp page. The figure below, shows the output I got.

Next, I listed the obs grouped by encounters as shown in the figure below.

After doing these two tasks, I got more understanding of how the patient history can be retrieved from the existing OpenMRS services.

Next, I worked on integrating a simple GWT UI under the Flowsheet tab of the patient dashboard. I referred the existing Xforms module code which uses GWT. I created a separate GWT project, compiled the code and copied the generated folder to module/resources. Then I used the generated javascript by a call in the jsp page. The figure below shows the output I got.

Apart from coding, we had a nice demonstration on OpenMRS by Ben Wolfe. During the demo Ben explained how OpenMRS is used in a typical system, answered questions and discussed some code as well. I got to know many things and my doubts cleared about Obs,Encounters & Concepts. The demo was very useful for all new interns.

My next goal is to write some services to retrieve data in the GWT UI. Since it requires integration of both the OpenMRS module and the GWT module, it is a challenging task. I started working on it..
The first week of coding was lot of new experience... I felt that I am learning something new and was very happy... Expecting this fun will continue through out the summer...

Sunday, May 23, 2010

Getting ready towards a new journey...


During the last two weeks my main focus was on preparing myself with the technologies which I am going to use in the project. I read about GXT and Spring mostly. While reading on Spring, I referred the OpenMRS code base (both trunk and modules) to get a clear understanding of how Spring Controllers, Handlers etc are used in the project. Honestly I progressed quickly with my reading because of the real world solution I was looking at. I read more on Spring Controllers since it will be handy for me when implementing the project.

As the next step I searched for possible libraries to be used for the purpose of GXT+Spring integration. As my mentor Sy suggested, I read about GWT-SL library and looked at some code hosted online. I got the basic idea about it and I am sure that I will get more understanding once I start using it. Meanwhile I requested for svn access and I got it. The developers at OpenMRS had long discussions about the name of the module and finally decided to have "flowsheet" replacing the existing flowsheet module.

In brief the last two weeks were full of new learning experience. Now another new journey is going to start... Yes, it is the GSoC coding period... the coding period officially starts on 24th May. I am looking forward for a nice period ahead.. Also I am sure that I will be learning a lot during the next developer call on Thursday through the demonstration on OpenMRS by Ben Wolfe.

The new journey starts here and I am getting ready to give my best...

Monday, May 10, 2010

Write Code! Save Lives!


It has been two weeks since I got the surprise mail from Google! Yes, I got accepted to the OpenMRS project : Longitudinal Data Review Module. My mentors are Sy Haas and Paul Biondich.

Since I was already working on tickets it wasn't hard for me to kick off and start with preparing for the project. On one side I was continuing with creating patches for the tickets and it really helped me to understand the OpenMRS code base. At the other side, I started to read and learn about the possible technology to be used to create the widget for the module. The possible candidates were : jQuery, GWT, GXT etc... As my mentor Sy suggested, I read about these technologies and did some sample apps following some tutorials. After initial reading, I decided to choose either GWT or GXT. GXT is an extended library of GWT. I did sample GWT applications using the GWT plugin for Eclipse. It was very easy to use the IDE to develop the applications. Then I tried samples with GXT and found that it has more features and GWT.

But there seems to be a drawback of using either GWT or GXT than normal JavaScript; that is the performance issues. Since there are some OpenMRS deployments used in less-speed internet connections. But according to my further reading I found that the latest version of GWT has handled it in a nicer way to make it efficient. So me and Sy decided to go with GXT. I started to read about integrating GXT with Spring and Hibernate as suggested by Sy.

Meanwhile I was looking in to the code base related to Patient data. I used the Patient dashboard in the web application to learn more about the Observations, Encounters and Concepts related to Patients. Finally I came up with some plans to break down the tasks to be done in to smaller steps. I will continue working with this and will finalize the requirements and timeline after discussing with my mentor Sy.

The first two weeks were full of new learning experiences! I am looking forward to learn more things in the coming two weeks and prepare my self well enough to start coding on May, 24th.

I had another good experience too in the last week. On last Saturday all four Sri Lankan OpenMRS interns met and had a good time sharing our experiences. It was a really nice experience to meet the talented guys Shazin, Ruwan and Firzhan. We are planning to have meetups in the future too...