Upgrading the Module Dependencies — GSoC 2022 Week 9

Piumal Rathnayake
3 min readAug 17, 2022

--

Hi All, It’s the end of the 9th week of GSoC 2022. Same as usual, first I’ll tell the main tasks I worked during the week. In the previous week, I had opened a Pull request to add a workflow for the dev3 deployment. The pull request was merged during this week, but the workflows failed due to some missing dependencies and environment variable issues. So my mentor helped me with that by adding those missing data and fixing the workflow.

Update vector created by storyset — www.freepik.com

Upgrading React and Carbon versions

Recently OpenMRS started upgrading its micro frontend modules to React 18 and Carbon v11. Previously we were using React 16 and carbon-components-react v7 for the OCL Module. Due to that, the OCL Subscription Module also had to be upgraded. My mentor initiated this task by creating a new branch called 4.x and upgrading the React and Carbon versions. However, Carbon v11 has many component changes compared to carbon-components-react v7. So, without updating and fixing those, the module doesn’t work properly. I had to manually update all those changes in order to get the module functionalities back. Also I will have to update my previous pull request with these new changes.

Improving the Error Handling

Since the main functionalities of the module is completed now, I thought to improve the error handling process of it. Usually when the import operation is running, the items with errors are skipped. In the end, the errored items are displayed with the Import details. Some of these error messages are bit long and not much user friendly. My aim is to simplify these error message and add the instructions to fix these errors. For that, first I identified the list of errors which can occur in when importing concepts/mappings from OCL.

These are the known errors which can occur when importing concepts:

  1. Cannot create concept conceptUuid. Datatype conceptDataType is not supported by OpenMRS.
    This error occurs if the datatype of the concept is not supported.
  2. Cannot import concept conceptUuid, tried: logError.
    This error is thrown when there is a duplicate concept name error or due to failures in openmrs concept service. The logError varies with the scenario. So the error message can be very long sometimes.

The following are the known errors which can occur when importing mappings:

  1. Cannot create mapping from concept with URL fromConceptUrl, because the concept has not been imported.
    This occurs when the fromConcept required for the mapping is missing from the OpenMRS instance.
  2. Cannot create mapping for oclMappingURL as no from concept is defined.
    This is thrown when the mapping is incomplete (fromConcept is missing)
  3. Cannot create mapping from concept with URL toConceptUrl, because the concept has not been imported.
    This occurs when the toConcept required for the mapping is missing from the OpenMRS instance
  4. Cannot create mapping for oclMappingURL as no to concept is defined.
    This is thrown when the mapping is incomplete (toConcept is missing)

As you can see, most of the error messages are small, but some can be very long and unreadable. So I’ll be researching more on this to provide a better user experience to the module users.

My tasks for the next week are fixing the errors caused due to the dependency upgrade, and finding more information related to error handling. Also I hope to add some improvements like validations and import progress trackers. That’s all for now. Thanks for reading!

--

--

Piumal Rathnayake

I'm a Computer Engineering Undergraduate at University of Peradeniya, Sri Lanka. And I also work as a software engineer at Sustainable Education Foundation.