GSoC’20 with OpenMRS | Coding Phase — Week 6

Shivansh Rakesh
2 min readJul 12, 2020

Progress — Week 6

This was the first week of coding phase-2 according to the GSoC timeline. This week involved discussions with my mentors regarding the objectives for coding phase-2 and the approach that is to be followed. There has also been progress towards the same.

Objectives for Coding Phase-2:

Following are the major objectives for Coding Phase-2:

  1. Add support for custom narratives.
  2. Support relative paths prefixed with openmrs: for location of narratives and properties file. For example, the relative path openmrs:configuration/Patient.html would point to the location <OPENMRS_APPLICATION_DATA_DIRECTORY>/configuration/Patient.html.

Approach to be followed:

Support for custom narratives could be provided by giving the implementer an option to specify a properties file containing the location of narrative templates which he/she wants to override. The FHIR Module would give a higher priority to these overrides to serve the intended purpose. In order to support relative paths prefixed with openmrs:, we would need to implement our own narrative generator with the required changes in order to support openmrs: prefixed relative paths.

Tickets:

  • [PR Under Review] FM2–251: Add support for overriding default narratives (link)
  • [In Progress] FM2–252: Add support for relative path with prefix openmrs: for narrative templates (link)

Pull Requests:

Challenges Faced:

One of the main concerns was that for specifying custom narratives, the implementer should not be needing to fork the FHIR repository, make changes to it and rebuild it. Instead, there should be an option to do it without modifying the code of FHIR Module. What we decided upon for solving this was to have a Global Property for the location of the narrative overrides property file. The FHIR Module would check this global property and give the properties file a higher priority while setting the narrative generator.

For supporting the relative paths, the basic change that is needed is an additional check for openmrs: prefix in the static method NarrativeTemplateManifest.loadResource(). Once this is changed, we would be requiring the Narrative Generator to use this modified method. But, there are many private variables and methods which cannot be overridden, because of which some classes cannot be simply inherited. Hence, parts of these have to be re-implemented.

Plan for Week-7

  • Work on FM2–252 (Add support for relative path with prefix openmrs: for narrative templates). The first target would be to implement a basic working version of the modified narrative generator, basing the code on HAPI’s narrative generator. Next target would be to simplify the implementation of the same.
  • Make post-review changes in PR#252 (for FM2–251) if required.

--

--