GSoC 2016 Final Evaluation

This blog post documents the work I did for GSoC 2016 on the OpenMRS Radiology Module.


Radiology Reporting Enhancement


The OpenMRS Radiology Module adds features of a Radiology Information System to OpenMRS. Currently the OpenMRS radiology reporting module has a poor support for building reports. To report a completed radiology order such as an x-ray examination, users of the module are presented with simple text field that they fill in their reports and on submission this text is stored inside the database as a string. But this was too limiting as radiologists use templates to create reports.

My task as GSoC student was to provide a means where users of this module will be able to use already developed templates to report their observations and store them as Complex Obs. Some of these templates can be downloaded from These templates are in HTML 5 format.


The OpenMRS Community was also very helpful in responding to my queries on and on freenode at #openmrs. Amongst the very helpful community members are

Daniel KayiwaPascal Brandt, Darius Jazayeri, Dimitri Renault, and Lluis Martinez

What I did

After been accepted by OpenMRS as a GSoC  2016 student I first worked on  a few introductory issues that helped me learn more about the code base and the standards and conventions used.

The big issues I worked on started with RAD-272. In this issue my responsibility was to provide support for report templates called MRRT templates. I had to parse the templates that are in HTML 5 format and extract metadata and store these metadata inside the database and store the files in a directory controlled by the module. After some research, I decided to use the jsoup HTML java parser to parse these templates files and extract metadata. You can see all this work here PULL-REQUEST-364. This work and other small issues mentioned above spanned up through midterms. And after midterms was school exams.

After my exams on the 18th of July, I picked up back work actively and was working mostly the whole day as I had nothing else to do. I think I was even working more than 12 hours some days but usually take a few breaks and watch one or two episodes of Fairy Tail(yes tail, I wonder if fairies have tails). At that time this pull request pull-364 had not been merged yet. And I had a lot of comments from mentors which I had to resolve all and also write unit test for all my changes. When this was finally merged I started working on template validation. Before my code was just importing the templates without validation them to make sure they follow the MRRT standards. So my next task was to implement template validation so that the system will reject template files that did not follow this standard. I used xsd 1.0  for the validation. But there was one feature that could not be implemented with xsd 1.0 but xsd 1.1 and standard Java did not support xsd 1.1 and the only two libraries I could find was xerces and saxon. The version of xerces that supported xsd 1.1 did not have an official maven repo and the version of saxon the supported xsd 1.1 did not have an open source license. I later implemented validation with standard java and xsd 1.0 and the missing feature I made up for it with a custom java validator that validates areas that could not be validated with xsd. Pull request for this can be found here pull-429. My next and current issue is RAD-273.

At this point the system is able to import templates, validate them upon importation and also display these templates on the UI. What’s left is to use these templates to create reports. The initial idea was to use openmrs complex obs. I took sometime to figure out how to use complex obs in code and when I finally got comfortable with complex obs and then I realized that there was a bug in the openmrs api with the feature we wanted to use with complex obs. This needed to be fixed before I can move forward. Initially I had to wait for this bug to be fixed or fix it but my mentor says it’s not a problem if my current pull request don’t get merged before 23rd August which was the last day for final evaluation submission. Good thing my commitments to the project and OpenMRS go way beyond GSoC and one summer. So I’ll definitely continue working on this project even after GSoC.

My Next Plans

I will be going in for GCI this year as a mentor. I look forward to apply all the skills I learnt from my mentors to mentor high school kids work on the Radiology Module.

Also as one of the GDG(Google Developers Group) Buea organizers, I’ll be mentoring some students this year on Java programming and introducing them to open source and OpenMRS. I hope one of them will be able to do GSoC next year too.

Also we’ll be hosting a lot of GSoC meetups to help other students get into GSoC 2017. So I look forward to learn more from the open source community.

For Prospective GSoC 2017 Students

I have but one advice for you. Start preparing now. If you want to have a shot at been accepted, you don’t need to wait until when Google announces accepted organizations because by that time popular organizations would have already had all the students they need. This is the exact same time in 2015 I started preparing for GSoC 2016. I saw a lot of students that get into the community after the organizations have been announced, some of them worked on so many issues in a short time, but that was enough to get them ahead of competition. Also when applying, avoid easy projects, they tend to have a lot of competitors. But that will depend on you skill level too. Good luck.

Links to all Merged pull requests

RAD-334 Add MrrtReportTemplateValidator

RAD-307 View report templates from list

RAD-312 add MrrtReportTemplateSearchCriteria

RAD-272: Providing suport for template import

RAD-248 Add orders tab

RAD-247: Create radiology menu

For list of pull request, see

Links to unmerged commits.

The work am doing currently is on this branch,

Skills Acquired

  • My knowledge in Java, Java EE, and JavaScript increased greatly. Learnt a lot of best practices from my mentor and the community  and stackoverflow too.
  • Increased debugging and troubleshooting skills
  • Experience with relational databases (MySQL)
  • Experience with contributing to free software projects, and communicating within a free software community
  • Mastery of HTML, Javascript, and CSS, jQuery
  • Experience with Spring MVC Framework
  • Gained mastery of REST webservices and perfect understanding of the OpenMRS REST framework
  • Comfortable using git source control
  • Used Apache Maven as a build tool
  • Experience with unit testing with JUnit
  • Learnt to follow standards and conventions
  • Increased communication skills, able to ask questions better and after a lot of research.
  • Got to work under pressure and strict deadlines
  • Experience with EMR Systems.
  • Team work










GSoC Week 12

This week has not been productive at all. For this week I was suppose to be working on letting users use the new template feature to create reports. Me and my mentors agreed that we’ll store these reports as complex obs. I have read a lot of docs about complex obs but I still have not really understood how to proceed with this phase of the project. I even asked a question on talk and had a quick response. The response was helpful but its almost the same thing my mentors have been telling me so I it did not still give me enough to start coding. I guess there is something in their explanations that I just don’t get but I hope I do before the 23rd.

GSoC Updates Week 11

This week was really productive. I was working on template validation RAD-334. I had to use xsd with a template schema to validate templates according to the MRRT standard. So I started of by learning about xsd and xml validation. After that I started by creating and xsd file that will be used to validate templates. Unfortunately standard java only supports XSD 1.0 and we needed to use some features that were only present in XSD 1.1. The only two libraries I could find that support xsd 1.1 are xerces and saxon. The version of xerces that supported xsd 1.1 did not have an official maven repo and the version of saxon that supports xsd 1.1 had a commercial license. So I stayed with standard java and xsd 1.0. I made up for the weakness xsd 1.0 by implementing another validator in java that validated areas that could not be specified in the schema file. Merged pull request can be found here, pull-426.

Next am working on letting users use templates to create reports RAD-273

Here is a screenshot of what happens now when an invalid template is imported.





GSoC Week 10

This week I worked on a few tickets, but my primary goal was to let users be able to view reports templates from the list imported reports. Thats possible now. I also made a few modifications to the report templates tab and made a little cleaner.

What’s left now to do is

  • implement validation of templates on import
  • also use templates as an alternative to a free text report

This is still much work but I pray I finish on time. Below are screenshots of the report templates tab and a view of an imported template.

GSoC Week 9

Finished writing my exams this week Monday 18th. This week i spent time resolving comments on pull request, implement all missing test cases and make sure they pass. Code should be merged by now but I’ve been struggling with a jquery bug for like 2 days now. Its causing the UI to break. Still looking into it.

GSoC Week 6

This week i did not do much. I am writing my end of semester exams. I started on the Tuesday June 28 and i will be writing till Wednesday 13 July. I was writing just two courses this week so i tried to do a little work. There was a lot of comments on my pull request after midterm, i have resolved all of them so that my pull request can be merged. From next week I will not be able to do any work since i will be writing 8 courses in a row skipping only Sunday. So i plan to continue working only after my exams. I believe once my exams are done I will have enough time to complete this project. I have come this far while i still had school and was not giving all of my time to the project so i know once i finish my exams and start working 8 hours a day. I will finish my project even before final evaluations.

GSoC Updates Week 5

This week was a real successful one.

Right now it is possible import templates into the system and have them displayed on the user interface.


Also the REST API for MRRT templates is working fine, here is a response to the url, http://localhost:8080/openmrs/ws/rest/v1/mrrtreporttemplate/15d6ab6b-56a7-4c2e-8c56-47e77d4c1012?v=full


Currently i am working on resolving all mentors comments on pull request, PR-304 so that i can be merged.

GSoC Coding Week 4 updates

This week was a great one. I made much progress compared to previous weeks. As of now you can import MRRT templates from the UI. These templates are properly parsed and meta data stored in a table(radiology_report_template) in the database. This was committed here can now import templates from ui . See screenshot below


My next step is to try to use REST to get report templates from the system and display them on the interface and also look into how to render these templates. I already implemented a rest resource for templates, you can see that in this commit Added Link to my complete pull request is PR-304

GSoC Coding Week 3 updates

The third week of GSoC is over and here is my report.

This week i had a blocker with the radiology module. “mvn clean install” was freezing and I had to kill it to make it stop. I even opened a thread about it on talk. I had input from my mentor and different members of the community like @dkayiwa and @maany. But it was only resolved on Thursday  9 June by @teleivo(my mentor). After that i could continue with my work but could not meet the objectives I had set out for this week. But hopefully next week will be more fruitful. But I learnt a lot while trying to resolve the blocker with the radiology code. I learnt a lot about spring framework and asked a lot of questions from my mentor who was very helpful. Here is my pull request for this week.

Also spent some time responding to comments on my pull request and resolving them as soon as possible.

I have already created the tab for report templates but still need to provide it with data to display. Next week I will be working on a REST API for the report templates resource which will handle getAll and pagination.

GSoC Coding Week 2 updates

Project progress report

For this week due to school mid-semester exams, i did not do much but now am finished with exams (until july when i will be writing final semester exams).

For this week i was suppose to be working on how to make the system support templates at the backend. I think i almost completed this despite exam distractions but code still needs to be tested and mentors still need to give their review.

Below is a list of things i accomplished

  • Installed the openmrs eclipse unit test plugin to help me generate test cases
  • Researched on possible java libraries to parse html 5 compatible files. Found jsoup. You can know more about jsoup form their website
  • Looked at xforms module to understand how it stores forms and data entered inside the forms. I learnt that, every form is stored in the filesystem as an xml file and the database only stores metadata of forms. Also, when data is entered using these xforms, another xml file is created that has data entered. In collaboration with @teleivo, we decided that we will use a similar approach but instead of xml files we will follow the MRRT specification of using html 5(awaiting @judy thoughts on this ). You can view this discussion here on talk
  • Went through the mrrt doc multiple times to understand what objects and methods i will be creating to handle templates
  • Created for template objects and went ahead and created all services and DAOs following the openmrs convention and that used in the radiology module. Created,, etc. The rest of the files can be found on this commit
  • Implemented my mrrt template parser. Using the jsoup library, i extracted metadata from the mrrt html file and stored them inside mrrt template object i created. Wrote unit test for parser to make sure it works. Still to add some more unit test to cover other scenarios like; invalid templates formats, missing templates, etc.
  • Created an mrrt template manager that basically calls the parser to parse the template file and initialize a template object and if no errors are encountered, the parsed file is copied to the openmrs application data directory and then store the template object containing metadata inside the database.
  • Created some skeleton classes to help me model project. All skeleton classes will have a well tested implementation before the end of today.
  • Used openmrs unit plugin to create test cases(some have no implementation yet but will before the end of today) for all classes i created even the skeleton classes. This will remind me to provide valid implementation for all skeleton classes i created since project will not build if these test don’t pass.

Next plans:

Before the end of today June 5, 2016 all skeleton classes will have implementation and test cases updated to test these implementation.

Next week from Monday June 6 to Friday June 10 2016, i will be working on the jsp and controllers to implement the templates tab on the legacyui interface. And from there i can test from the ui, my changes so far.