GSoC’20 with OpenMRS | Coding Phase — Week 2

Shivansh Rakesh
2 min readJun 14, 2020

Progress - Week 2

The second week of the GSoC period ended. This week went as it was planned. Default narratives for the following resources were created:

  • Encounter
  • Condition
  • Observation
  • Location
  • Generic datatypes used in the above (eg. SampledData, etc.)

Also, the tests were restructured and class organisation was improvised.

Tickets worked on:

  • [Under final review] FM2–194: Create default narratives for resources (AllergyIntolerance, MedicationRequest, Condition) (link)
  • [Under review] FM2–207: Create default narratives for resources (Encounter, Observation, Location) (link)

Pull Requests:

  • [Final Review Pending] FM2: PR#198 (link)
  • [Draft Under Review] FM2: PR#207 (link)

Issue Faced:

Inconsistency in timezone during tests.

In the tests for Narrative Generation, we had to assert that the generated narrative and the expected narrative matched. In some narratives, there are elements which depend on the timezone used. By default, the tests considered the local timezone because of which they failed in such assertions.

Solution: The issue was solved by using the following code in BaseFhirNarrativeTest class to keep the timezone consistent during tests (OpenMRS Talk discussion link).

protected static TimeZone defaultTimeZone;@BeforeClass public static void setupTimeZone() {
defaultTimeZone = TimeZone.getDefault();
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
}
@AfterClass public static void resetTimeZone() {
TimeZone.setDefault(defaultTimeZone);
}

Plan for Week 3

Creation of Default Narratives for the following:

  • Person
  • Practitioner
  • ServiceRequest
  • Generic datatypes used in the above

--

--