Archive for May 2008

FieldGenHandler for tribe

May 30, 2008

Tonight I got a working FieldGenHandler for the tribe object. The registering of FieldGenHandlers through modules is working now. All the existing FieldGenHandler code exist in the core OpenMRS system. Because the tribe is inside a module, core system cannot have a dependency on the tribe module. Until midnight I could not think of a way to get the core system to work with the tribe objects. I was sleepy and was going to call it a day. But then I started the machine again and tried one last time. In around fifiteen minutes I got it working. I created a generic fieldgen code and added it to the core system and used it to show the tribe objects. All the risky parts of the project are now complete. What remains is creating the SQL to upgrade an existing implementation to use the new tribe module.

Tribe as a person attribute object

May 29, 2008

So far everything was going okay. Tonight I implemented the Attributable interface. Now I can add tribe as a person attribute using the manage person attribute types page in the OpenMRS administration. But I cannot add or edit values for tribe person attribute type. I checked the source to learn how location and other person attributes are doing it.

I have to add a FieldGenHandler for the tribe object to make it editable and to let the user add or make changes to the tribe field. But so far all the FieldGenHandlers are made for core OpenMRS objects. My mentor Ben provided a fix to register handlers outside the core system. For the last 3 days Ben has checked in code to fix some issues I faced within a few minutes after I asked, without which could not proceed with coding.

Web interface of the tribe module

May 28, 2008

Tonight I assembled the tribe module and got it working. So far I have just extracted the code but did not try to run it.  Tribe add, update and retire features are working okay. So far the tribe objects are working separately from the core OpenMRS system. The tribe module can create and update the tribe objects but the tribe objects have no interaction with the rest of the system.

Now what I have to do is transform the tribe object to a person attribute compatible object. I am using the existing Location object as the reference for the implementation. But tribe object is an entity that resides in an external module, while location is an object which exist inside the core OpenMRS system.  I could not find person attribute which exist in a module. Person attributes are objects attached to a person object. By the way the patient and the user objects are derived classes of the person class. To make the tribe object a person attribute compatible object I have to implement the Attributable interface as the first step.

Removing tribe from the core OpenMRS

May 27, 2008

Tonight I went through the OpenMRS source and removed the tribe functionality.  The useful parts were extracted to the new tribe module. The tribe module will host the tribe object and functionality to create, update and delete tribe modules. Tribe administration page will be hooked up to the OpenMRS from the OpenMRS administration page through an extension point. OpenMRS code is a pleasure to work with. In a couple of hours I was able to clean up the tribe code from the OpenMRS code.

Creating a module in OpenMRS

May 26, 2008

Tribe project needs to create a OpenMRS module. There are lots of modules developed already which extend the core OpenMRS system with various enhancements. Some of them are listed in here. I started out with the basicmodule. Basic module provides the skeleton but a working module out of the box. I followed the instructions and created the module for the tribe feature.

Coding begins

May 26, 2008

Google Summer of Code 2008 work officially begins today. I am planning to finish up the Tribe module early as possible. In the OpenMRS domain model the patient object has an association to a tribe object, probably because OpenMRS implemenations started out mainly from African countries. But not all OpenMRS implemenations need to identify the tribe of a patient.  So the objective is to remove the tribe object and the related functionalities out of the core OpenMRS system and make it into a pluggable module. Then the tribe module can be plugged into the core OpenMRS system where it is needed.

Google sent the gift

May 24, 2008

I got the book yesterday, Google is sending for all the Google Summer of Code students. The book, Beautiful Code, is a collection of articles by leading programmers and designers.  They talk about their experiences architecting and designing good code. It is an nice gift, well thought out by Google.

Computer related books go out of date so quickly, sometimes in 2 – 3 months. But this book will last for a long time, I guess.