GSoC Week 08: Started FHIR Flag mapping

Manojlakshan
3 min readJun 28, 2024

--

Hi everyone,

This week marks GSoC Week 08, equivalent to Week 05 of the coding phase. In this week my primary focus has been on two tasks, updating the unit tests in the patient flag module and starting work on the FHIR flag resource mapping.

Updating Unit Tests

My primary task this week was to update the unit tests in the patient flag module. This involved:

  • Reviewing Existing Tests: I started by thoroughly reviewing the current unit tests to identify areas of improvement and potential gaps.
  • Enhancing Test Coverage: I added new tests to cover edge cases and ensure that all functionalities are thoroughly tested
  • Refactoring Tests: Some of the existing tests were refactored for better readability and efficiency
  • Update test dataset : Current test data contain only for test in flags not the logic in the service, I added new test data to test the service logic

Working on FHIR Flag Resource

My GSoC project contains four key objectives, including overhauling the patient flag module performance issues, adding Java 17 support, FHIR flag resource mapping and ensuring alignment with current OMRS standards. Most of these objectives are nearing completion and are currently in the review stage. The last objective remaining is to finish mapping the FHIR flag resource, In parallel with updating the unit tests, I began working on the FHIR flag resource mapping.

If you’re not aware of what FHIR is,

FHIR (Fast Healthcare Interoperability Resources) is a standard for sharing healthcare information electronically. It makes it easier for different healthcare systems to exchange and understand patient data. FHIR uses modern web technologies to ensure information is shared accurately and efficiently.

  • Understanding FHIR Standards: I spent time understanding the FHIR standards and how the flag resource fits within these guidelines.
  • Drafting the Mapping: I came up with a draft version of the mapping for the FHIR flag resource. This draft outlines how data from flag model will be mapped to the FHIR flag resource.

omrs flag data models

public class Flag{ 

Integer flagId; // FHIR: Identifier
String name; // FHIR: name / Description
String criteria;
String evaluator;
String message; // FHIR: Description
Priority priority; // FHIR: Code
Boolean enabled; // FHIR: Status
Set<Tag> tags; // FHIR: Category

}

public class PatientFlag {
Integer patientFlagId; // FHIR: Identifier
Patient patient; // FHIR: Subject
Flag flag;
String message; // FHIR: Description
}

public class Tag {
Integer tagId; // FHIR: Category.Identifier
String name; // FHIR: Category.text
Set<Role> roles;
Set<DisplayPoint> displayPoints;
}

public class Priority{
Integer priorityId;
String name; // FHIR: Code
String style; // FHIR: code
Integer rank;
}

OMRS flag data mapped with FHIR flag resources


{
"resourceType" : "Flag",

"id" : "patinetflag ID",

"identifier" : [{
"value" : "12345"
}],

"status" : "patinet flag status",

"category" : [{
"text" : "tag name"
}],

"code" : {
"text" : "flag message"
},

"subject" : {
"reference" : "Patient/patinet id",
"display" : "Patient name"
},

"period" : {
"start" : "2015-01-17",
"end" : "2016-12-01"
},

"author" : {
"reference" : "Practitioner/example",
"display" : "Nancy Nurse"
}
}

It’s important to discuss the FHIR mapping with my mentor, OpenMRS FHIR squad, and project leads to finalize and validate the mapping.

Plan for week 09

  1. Finalize the FHIR mapping
  2. Start the implementation of FHIR flag mapping

Stay tuned for more updates, and thank you for following along with my GSoC journey!

Thank you for the reading, Join me on this tech adventure! Follow my profile to stay updated on the cool world of technology and innovation. Your support means a lot, and I can’t wait to share more exciting stuff with you. Let’s stay connected for more insights and fun discoveries ahead!

Github: https://github.com/ManojLL

LinkedIn : https://www.linkedin.com/in/manoj-lakshan/

--

--