Tuesday, July 22, 2008

Starting the implementing phase

Last week, I started the implementation of the person portrait module. I created a module by following the instructions from "Creating Your First OpenMRS Module" on the OpenMRS "Developer How-To Guide". The instructions are easy to understand and I was able to run my first module at the first try. The module was accessible through the OpenMRS's Administration page. For this first version, the module had only a jsp file and a controller.

I was also given svn space on openmrs.org, where I can store the module code. I added the module code to the svn repository in the folder "personportrait", the ID of the module. Now, I feel more safer than just having the code on my laptop.

Last week also, after creating the module skeleton, I started the implementation detail. I decided to break down the implementation into two parts. The first part is uploading the person picture and saving it into the OpenMRS database. The second part is retrieving the picture from the database and displaying it on the browser. For the first part, after checking around for a while, I decided to use the FileUpload API from Apache Commons; in particular, the Streaming API. This API provides good performance and low memory profile. However, when I began coding, I realized that the version of the FileUpload included in the Complex-Obs branch (commons-fileupload-1.1.1.0.jar) does not support the Streaming API. The current version of the FileUpload, which provides the Streaming API is 1.2.1. I am planning to talk to my mentor, David Thomas, about this issue. In the mean time, I am using the MultipartFile class to upload the image.

No comments: