I have been accepted in Google Summer of Code 2008 program for working in a project of OpenMRS. This summer I will be working to create a Patient Note Writer module which will allow to add rich text observations in appropriate places/pages of the OpenMRS application. OpenMRS is an open source medical record system framework for developing countries. Its always nice to get accepted in programs like summer of code and its more nice to work for an Organization with a great cause. Another coincidence is that by profession I also work in software development related to the health care domain. So I am expecting an exciting summer with OpenMRS. I am also hoping to see OpenMRS deployed in Bangladesh in the future.
I have been accepted in Google Summer of Code 2008 program for working in a project of OpenMRS. This summer I will be working to create a Patient Note Writer module which will allow to add rich text observations in appropriate places/pages of the OpenMRS application. OpenMRS is an open source medical record system framework for developing countries. Its always nice to get accepted in programs like summer of code and its more nice to work for an Organization with a great cause. Another coincidence is that by profession I also work in software development related to the health care domain. So I am expecting an exciting summer with OpenMRS. I am also hoping to see OpenMRS deployed in Bangladesh in the future.
I didn't do much coding in first week. Rather it went after discussion of the exact requirement of Patient notes module which will result from my project. I tried to create an wiki page, which will be completed as per my project progress forward.
My module codes will reside here . Now I am trying to build an experimental module with the goals (given by my mentor Andreas) - add a tab to the patientDashboardForm.jsp (using
the extension point) which says something like 'Hello from '. Add a table indexed to patient id which has custom messages from each patient, so the display text could
change to ' says, '. Then adding an edit page for this message.
The current school semester is over, and I've finally started properly on my GSoC project. I've been exploring the Google Maps API, its possibilities and limitations. Yesterday I made a functioning mockup showing how an image viewer might work. Right now only zoom and pan works, but I'm currently reading up on Google Maps' markers and info windows that presumably may be used to implement image annotation.

Note: The mockup is hosted on my own webserver in my flat. I won't be posting any links to it here, because I have limited bandwidth.
OpenMRS 1.3.0 Release Candidate 2 has been released. This candidate mainly consists of a cleanup to the underlying API. See the the release notes for more information.
It can be downloaded from http://download.openmrs.org.
I have checked in the inital version of the tribe module. (I think I changed the id in the .project file.) I will wait and see what my mentor, Ben has to say. There will be changes to make. Or may be completely redo it. I am going start the next project in a few days, may be the end of the week. I have some assignments to do.
Today I got the Google’s payment card. It is a MasterCard credit card in appearance with the name XXXX GSOC 2008 STUDENT.

Why I have used this
smiley in this title?
Answer at the end ![]()
Lets come to the point. The first week had been very hectic to me. I had a lot of trouble in designing project. The trouble is all because of me I have to accept that honestly. I had to satisfy everyone’s ideas like Daniel, Brian, Ben and etc. But I have done successfully in the late Wednesday. I had to speed up my brain and to work fast on coding. Here comes the problem, the biggest headache in everyone’s life EXAMSSSSS. I wanna know who introduced this in the world. It really slowed down my progress. I thought to be on safer i can do the front-end and sql stuffs. I first chose to do the sql thing. I made a very big mistake in sql.diff.xml file. I wrote the queries in two <diff> division. Well it gave me error 150. That error is for foreign key constraint. Finally I asked for Daniel’s help he suggested me to put all the queries under one <diff>. Ha that worked fine:).
In summer we face one more problem in India. The problem is so simple but cant tackle it. Power cuts. I struggled a lot with that last week. We never had so many power cuts in day time. 6 hours a day without power?? nah thats so difficult. Somehow now its alright but still i have exams till 6th :(.
During my coding i had to reload my webapp very often. I had a very hard time with tomcat while reloading it. It slowed down my entire system. I had to find some tool to fix it. Here come Lambda Probe. Really a good work which saved my time and temper. Here’s the link for the screenshot while reloading my app. It dint slow down my system and pretty fast too. Hats off Lambda Probe.
Finally I brought my module under the module management page without any errors. You can have a look at it here. And under the admin page I have brought it successfully. I have created two links one to create the hierarchies another to manage it like editing and deleting the hierarchy. But not yet decided about the second one. I am gonna start the backend work today hope I will get less errors this time :). I am gonna give you two more screenshots have a look at it. Here it is 1 and 2.
Sorry guys I dont want to test your patience by inserting all the images in the page. So if you wish to view them click on the links.
Answer: Because I have used that smiley more than a thousand times this week
.

Tribe module is ready to be checked in. I have attached the core OpenMRS system changes to the ticket. There is another update to the core system to allow registering module level FieldGenHandlers. I have written an SQL script to upgrade an existing implementation, by moving the patient tribe values to a person attribute type value as follows.
– disable auto commit
SET @currentAutoCommit = @@autocommit;
SET @@autocommit = 0;
START TRANSACTION;
– create the tribe person attribute type
INSERT INTO person_attribute_type
(name, description, format, creator, date_created)
VALUES (’Tribe’, ‘Tribe of the person’, ‘org.openmrs.module.tribe.Tribe’, 1, NOW());
SET @tribeTypeId = LAST_INSERT_ID();
– insert person attributes for patient tribe values
INSERT INTO person_attribute (person_id, value, person_attribute_type_id, creator, date_created)
SELECT patient_id, tribe, @tribeTypeId, 1, now() FROM patient WHERE tribe IS NOT NULL;
– remove tribe column
ALTER TABLE patient DROP FOREIGN KEY belongs_to_tribe;
ALTER TABLE patient DROP COLUMN tribe;
– commit everything and restore auto commit value
COMMIT;
SET @@autocommit = @currentAutoCommit;

I wrote a MySQL stored procedure to upgrade the existing patient tribe values to a person attribute type. This method is not going to be used, so it will not be checked in. So I am putting it here so that somebody may get some use out of it.
– define the procedure
DELIMITER $$
DROP PROCEDURE IF EXISTS `openmrs`.`convert_tribe`$$
CREATE PROCEDURE `openmrs`.`convert_tribe` ()
BEGIN
DECLARE currentAutoCommit BOOLEAN;
DECLARE tribeTypeId INT(11); — tribe person attribute type id
– fetched values of patients with tribe are stored in the following variables
DECLARE patientId INT(11);
DECLARE tribeId INT(11);
DECLARE noMoreRows INT(11) DEFAULT 0;
DECLARE patientsWithTribe CURSOR FOR
SELECT patient_id, tribe FROM patient WHERE tribe IS NOT NULL;
DECLARE CONTINUE HANDLER FOR NOT FOUND
BEGIN
SET noMoreRows = 1;
END;
– disable auto commit
SELECT @@autocommit INTO currentAutoCommit;
SET autocommit = 0;
START TRANSACTION;
– create the tribe person attribute type
INSERT INTO person_attribute_type
(name, description, format, creator, date_created)
VALUES (’Tribe’, ‘Tribe of the person’, ‘org.openmrs.module.tribe.Tribe’, 1, NOW());
– get the created tribe person attribute type id
SELECT person_attribute_type_id into tribeTypeId FROM person_attribute_type WHERE name = ‘Tribe’;
– read patient tribe values and add new person attributes
OPEN patientsWithTribe;
cursorLoop : LOOP
FETCH patientsWithTribe INTO patientId, tribeId;
IF noMoreRows = 1 THEN
LEAVE cursorLoop;
END IF;
INSERT INTO person_attribute (person_id, value, person_attribute_type_id, creator, date_created)
VALUES (patientId, tribeId, tribeTypeId, 1, now());
END LOOP cursorLoop;
CLOSE patientsWithTribe;
– remove tribe column
ALTER TABLE patient DROP FOREIGN KEY belongs_to_tribe;
ALTER TABLE patient DROP COLUMN tribe;
– commit everything and restore auto commit value
COMMIT;
SET autocommit = currentAutoCommit;
END$$
DELIMITER ;
– run the procedure
CALL convert_tribe;
– drop the procedure
DROP PROCEDURE convert_tribe;

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.

The work on the OpenMRS module continues and I have just got a little more excited because of the barcode scanner that I just purchased. The Barcode Scanner is required to test the working of the module, which will be able to identify patients based on barcodes present on patient identity cards. The Barcodes will help solve problems where patients don't give correct information leading to duplicate records for the same patient.
The Barcode Scanner that I purchased is Argox AS-8000, near-range CCD scanner. Detailed specification on the product can be found here. I tested the scanner and it was able to detect a variety of barcodes. Its a low-end CCD scanner, but it detected nearly every thing I put in front of it. Even round jars and bottle!! Brian advised me not to spend much and hence I brought this open-box one. So was in a hurry to test, coz they have just 3-day testing warranty on these stuff.
Screenshots of the Barcode Scanner:
The Barcode Scanner works just like a keyboard and when scanning, the OS feels someone typed in from the keyboard. The scanner works on the PS/2 port of the keyboard and not on the PS/2 port of the mouse. My keyboard is connected to the PS/2 port and hence probably I'll buy a USB converter which will enable me to connect the scanner to the USB port. The Barcode Scanner won't be required by me until I reach the end of the search routines of the registration module... I'm still stuck on getting multiple patients from a search query!!








