This is the better one. It’s identical
This is the 8th week of my GSoC project. The major task for the week was Mapping DataSets and Data Value Templates with OpenMRS reports.
Read my previous article to get an idea about how these mappings works,
This is the seventh week of my GSoC project. Yet another challenging week of my GSoC journey. The major task for this…
First, I had to map a Data Set with an OpenMRS Period Indicator Report. A Period Indicator Report is a special type of OpenMRS report which has three parameters; start date, end date, and location. As same as a DHIS2 DataSet does.
Every report has an attribute named UUID. I used the UUID to map a report with a Data Set. A UUID is something interesting to talk about. UUID stands for universally unique identifier. It looks like a 32-character sequence of letters separated using dashes. Here are some examples,
Creating a random UUID with java is much simple as,
The interesting thing is every UUID comes with a promise; no two UUIDs are identical. The chance of having a duplicate is very rare. In other words, the annual risk of a given person being hit by a meteorite is estimated to be one chance in 17 billion, which means the probability is about 0.00000000006. It is equivalent to the odds of creating a few tens of trillions of UUIDs in a year and having one duplicate. Interesting eh? So, the UUIDs are a great way to give entities a unique id. 
Anyway, after mapping the reports, the next task was mapping report indicators with Data Value Templates. In the previous implementation, Data Value Templates had an attribute to store Report’s UUID. Since the reports have been mapped with Data Sets, that attribute becomes redundant. Therefore I removed it. Also, the report indicators are mapped using the label of the indicator; which is not unique at all. I removed it and added a new attribute to store the UUID of the corresponding indicator.
Next week I’m planning to complete the exporting data to DHIS2. With that, I can complete the functionality of the module end to end.
 P. Leach, M. Mealling, R. Salz. (2015) A Universally Unique IDentifier (UUID) URN Namespace. Available at: https://www.hjp.at/doc/rfc/rfc4122.html [Accessed 27 Jul. 2020].