GSoC First Evaluation Report


The first coding phase of GSoC just ended and here is my report.

The milestone for this phase was to make it possible to create radiology reports using MRRT report templates. And I’m happy to say the milestone was achieved and it’s now possible to create MRRT reports instead of the traditional free text reports. First I’ll demonstrate how to use it then I’ll go throw my implementation details.

Create an MRRT Report

This still in development so you’ll have to build the radiology module to test this. To build it clone my repo on gitlab

git clone

Then checkout the gsoc2017 branch

cd lh-radiology

git checkout gsoc2017

Now build a the .omod file

mvn clean install

You can now deploy your module to toolkit/core server. To setup a server see standard OpenMRS or LibreHealth Toolkit documentation for instructions. The following instructions assume you already have a server running OpenMRS 2.0.5. For rapid development I setup my server using the OpenMRS SDK. The server runs openmrs version 2.0.5. But any 2.x version should work fine.

To create a radiology report using an MRRT template, first you have to make sure you have at least one MRRT template imported into the system. To import a template, visit the Report Templates Tab on the radiology dashboard. And click on upload new template and select your template file.

Screen Shot 2017-06-28 at 9.13.37 PM

Now if template import is successful then you are one step closer to been ready to use these templates to create a radiology report.

These reports are saved as html files on the file system. We needed to make it possible to query these reports when querying observations for a patient. So instead of the radiology module taking care of saving the file, it’s uses an OpenMRS API Complex Obs. All the radiology module has to do is create a complex obs and set it’s complex data to the contents of the report and hand it over to the openmrs api to save the complex obs with the report. To use complex obs you must have at least one complex concept in the system. Concepts are normally added via a standard concept dictionary or via metadata sharing module. But for development and testing you can go ahead and manually create a complex concept. For that click on the ‘Dictionary’ link on the home page and click add new concept.

Screen Shot 2017-06-28 at 9.29.35 PM

The concept data type must be complex and handler TextHandler

Screen Shot 2017-06-28 at 9.32.16 PM

Save the concept and proceed to creating your report.

To create a report you need a completed radiology order obviously. We are reporting the findings of performing a radiology procedure after all.

Screen Shot 2017-06-28 at 9.35.24 PM

Save your order and you can now claim your report. If you you used the old version of the module you’ll release a drop down that specifies the kind of report you want to create. If you select Free text then you’ll proceed with creating a normal radiology report with using a template file. But if you select MRRT, you’ll be presented with a search box to search a template to use.

Screen Shot 2017-06-28 at 9.39.59 PM

Click on a template from the suggestions

Screen Shot 2017-06-28 at 9.41.23 PM

Click on claim report and you’ll be presented with a report editor that uses the MRRT template as a starting point.

Screen Shot 2017-06-28 at 9.47.16 PM

Fill your report and save it by hitting Complete.

See my next blog post about my implementation of the above feature.


GSoC Week 3

The third week of GSoC ended a few days ago and this my report. During week two updates I reported that I was able to save radiology reports as files on the file system but I didn’t use Complex Obs for that. But due to the different advantages we’ll have in saving as complex obs including making it possible to query a report when all observations on patients are been queried, my mentor Judy requested I save it as an obs and since this is a file we have to use complex obs since it handles files well.

Here is my merge request

To see it work you need at least one complex concept in the system. This concept will normally be added via a standard concept dictionary but for development purposes you can go ahead and manually create a complex concept and copy it’s uuid as shown on the screenshot. Make sure to select TextHandler

Screen Shot 2017-06-20 at 8.01.55 AM

Then copy the uuid of your complex concept and paste it to the radiology global property Complex Concept. For that go to Administration -> Settings -> Radiology  and you’ll see a setting called Complex Concept and paste your uuid there. See screenshot below

Screen Shot 2017-06-20 at 8.11.16 AM.png

Now you can go ahead claim a report for a completed order or just create your new order and set it’s status to completed then claim the report. After saving the report you can see your obs by going to

Administration -> Manage Observations search observations by patient name and you’ll see a link to your report file.

Screen Shot 2017-06-20 at 8.15.35 AM.png

Next steps

The system currently saves only free text reports as complex obs. I’m adding support for saving MRRT reports too. I have already worked on the backend code for handling reports created with MRRT templates and I’m now working on the front end to have something that I can demo.

GSoC Week #2

GSoC Week 2 just ended and I did not accomplish much. I spent a lot of time on making the radiology module a fhir server. I’m moving back to primary goals of my GSoC project this week by moving on the next phase of my timeline which says radiology reports should be stored as files. Here is my first commit to that end Right now when  a report is saved, the contents of the report are been saved in a file on the server and the location of this file is saved in a RadiologyReport.path.

I did not use Complex Obs for this but as per the discussions here, last comment, saving it as complex obs will make it easier for users to see completed report from patient dashboard obs section.

GSoC Week #1

Official coding for GSoC began 30th of May and here is an update of what I have been doing.

My task is to make the radiology module a fhir server. I am following this tutorial and using this code as reference. I kept on having issues with making the radiology module a fhir server. After implementing all the classes in radiology as documented in the fhir docs, my builds kept failing. Also the tutorial does not explain much about the different parts of the example server code on github so I have to make guesses about some things. So I decided to build a fhir server from scratch out of radiology just so I can understand the differents parts of the fhir server architecture. The problem I’ve been having so far is knowing which dependencies I should declare in my pom. The code on github is a multi module maven project and some dependencies in the parent pom have nothing to do with setting up a fhir jpa but they are declared in the pom just because another module needs them. Also there are some dependencies that are declared in the pom that are not directly used in the code.

I joined the fhir mailing list and posted the problems I was having there and though my problem was not directly solved I was pointed to another sample code that sets up a fhir server. This is easier to work with as it’s not a multi module project hence all dependencies in the pom will probably be what’s necessary to setup a fhir server. And this has been helpful, I am beginning to understand why I kept on having build failures and trying to resolve them. But still the same I still have to figure things out just by looking at the code.

Here is the link to fhir server I’m working on I used spring boot. I’ve just implemented the single class necessary to setup a fhir server(a class that extends one of the dstu base classes in this case dstu3). Now when I run the tests spring is unable to initialize the application context due to some missing dependencies. Currently working on that.