The Breakup

Sometimes we have to break away from the master branch

Jayasanka Weerasinghe
3 min readJul 13, 2020

This is the 6th week of my GSoC project. In the previous week, I went through a struggle of implementing the ADX disaggregations without breaking the module. And finally, I realized it was a bad idea because we have to face big trouble to maintain them while doing the necessary changes. Therefore I had a discussion with my mentor and came up with a conclusion to create a separate branch for this feature. So, it’s time to break up from the master branch.

Then I removed the previous classes which get affected by the new model. It was a full cleanup and I had to remove nearly 90% code of the module.

The next task was creating the models. According to the designed class diagram, I implemented the model and mapped them with hibernate. Hibernate is a Java framework that simplifies the development of Java application to interact with the database. Writing a CRUD (Create, Read, Update, Delete) in Hibernate is pretty fast and quite easy.

As I mentioned in my previous blog post, it was a time-consuming task. Then I started working on importing datasets to the module. In DHIS2, we can export a dataset using the Metadata Dependency export page. It will create an XML file that contains all details about the dataset including Categories, Category Options, Data Elements, etc. We can use that file to import it to the OpenMRS. There’s an API to export a dataset in DHIS2 as well. Since we need to deliver a working product quickly, I moved all the fancy things to the ‘Nice to Have’ tasks list.

At the time I’m writing this post, I was able to save a dataset on the DB using the exported XML file. I had to learn JAXB. JAXB stands for Java Architecture for XML Binding. Simply, JAXB provides the ability to convert objects into XML and XML into objects.

Since the module I’m working on is based on DHIS2, I had to actively communicate with the DHIS2 community as well. I was selected for the “New user of the month award” for June 2020 in the DHIS2 community. The members of the DHIS2 community are very friendly and they have helped me a lot to solve most of my questions.

Next week I’m planning to finish importing Data Elements, Categories, Category Options, and generating the Data Value Templates.

--

--

Jayasanka Weerasinghe

A professional key presser who turns characters into interesting web things 🙂