The moment of clarity — GSoC Week 5

Heshan Andrews
2 min readJul 11, 2021

--

I started this week with a working import and export feature with me. But the persisted objects just didn’t work because I was trying to convert them back into original java objects and then use metadata sharing module to save them in the database. This method wasn’t working because when we take a serialized object get the serialized data and convert them back into their original type it doesn’t covert the custom object attributes but just keep them as transient objects. So when these objects are persisted in openMRS they are again converted back into serialized objects. I realized I’m just taking the objects on a lil detour but they anyways end up in the same type in the database level. So without using metadata sharing module or definition services I created a DAO method inside DHIS connector to persist the imported objects as they are without converting them twice back into the same type and it worked. Now it’s working perfecly. I sent a PR with the changes I made and currently it is under review.

Here’s a lil demo video on how it works now.

Catcha!! See ya next week, Bye bye

--

--

Heshan Andrews

Your average software engineering dude from South Asia