This is the last week of GSoC. I managed to complete all tasks. The swagger SDK generation postpond due to major version upgrade to STU3. I completed medication request GET, POST and DELETE operations. OpenMRS DrugOrder not allow to edit.

Added Documentation added in https://wiki.openmrs.org/display/projects/MedicationRequest+Resource

Medication request specification https://www.hl7.org/fhir/medicationrequest.html

Challenges and Concerns when implement the MedicationRequest

  • Medication request timing can’t match with DrugOrder

“timing”: {
“repeat”: {
“boundsPeriod”: {
“start”: “2015–01–15”,
“end”: “2015–01–20”
},
“frequency”: 1,
“period”: 6,
“periodMax”: 12,
“periodUnit”: “h”
}
}

  • Medication request fields status, intent, maxDosePerAdministration and validityPeriod can’t map

I’ll add my final presentation in next which is the last post.


The GSoC coming to and end. Past week I publish my video on my current work. Please watch it below.

During this week I implement medication request GET and POST implementations. Now person can create a DrugOrder through FHIR Medication Request. Below content use to create a DrugOrder.

{
“resourceType”: “MedicationRequest”,
“id”: “56b9196c-bcac-4c2f-b3a2–123464a96439”,
“status”: “stopped”,
“intent”: “order”,
“priority”: “routine”,
“medicationCodeableConcept”: {
“id”: “865fceb1-ad0c-4102-aead-26ca25c77b09”,
“coding”: [
{
“system”: “http://openmrs.org”,
“code": “cedf8fc4–6fc9–11e7–9b2b-c4d98716fd91”,
“display”: “Cetirizine”
}
]
},
“subject”: {
“id”: “cf14c415–6fc9–11e7–9b2b-c4d98716fd91”,
“reference”: “Patient/cf14c415–6fc9–11e7–9b2b-c4d98716fd91”,
“display”: “John Patient(Identifier:100)”
},
“context”: {
“id”: “3fcd2047–2aca-404f-ab9d-0d009265d4dd”,
“reference”: “Encounter/3fcd2047–2aca-404f-ab9d-0d009265d4dd”
},
“authoredOn”: “2008–10–19T09:24:10+05:30”,
“requester”: {
“agent”: {
“id”: “b3d97e25–274e-4ed6-b1aa-18848505c33e”,
“reference”: “Practitioner/b3d97e25–274e-4ed6-b1aa-18848505c33e”,
“display”: “Super User(Identifier:Test)”
}
},
“recorder”: {
“id”: “b3d97e25–274e-4ed6-b1aa-18848505c33e”,
“reference”: “Practitioner/b3d97e25–274e-4ed6-b1aa-18848505c33e”,
“display”: “Horatio L Hornblower(Identifier:Test)”
},
“dosageInstruction”: [
{
“sequence”: 1,
“timing”: {
“code”: {
“coding”: [
{
“system”: “http://openmrs.org”,
“code”: “ae984cea-24cb-4e1e-abdd-fd19c9802704”,
“display”: “1/day x 7 days/week”
}
],
“text”: “1/day x 7 days/week”
}
},
“route”: {
“id”: “cee0f244–6fc9–11e7–9b2b-c4d98716fd91”,
“coding”: [
{
“system”: “http://openmrs.org”,
“code”: “cee0f244–6fc9–11e7–9b2b-c4d98716fd91",
“display”: “UNKNOWN”
}
],
“text”: “UNKNOWN”
},
“doseQuantity”: {
“value”: 3.0,
“unit”: “mg”
}
}
],
“dispenseRequest”: {
“quantity”: {
“value”: 1.0, …


This week my target to comple the FHIR Medication resource get requests. I have went through the MedicationRequest resource of FHIR and identified mappings between OpenMRS DrugOrder. There are some fields which we can’t map with DrugOrder. I have discuss it with mentor and did possible workarounds. Plan is to put a OpenMRS talk post.


This week I have able to test the functionality of the code. I tested available FHIR resources of the module and fixed several minor issues due to module upgrade. Afterwards, I checked swagger console and it broken due to the recent upgrade. Then I fixed the issues and now the swagger console works fine as well.

My next target is to implement the medication request resource of the FHIR.


This week I installed the module and do the testing. The swagger resources generator required several changes to compatible with the latest release.

After completing the swagger generator changes, I tested available resources and fixed bugs. I’m at final stages of the testing and need to move quickly to the next phase.


This week I dedicated to test the module. After the version upgrade of the HAPI FHIR library, I encountered several issues during module loading. My mentor asked me to do comprehensive testing for the module. So I’m checking all the available resource and their operations.


Finally this week I’m able to fix all code incompatibility issues during STU3 migration and compile the module. It required lot of effort to understand the API changes and change the code. My mentor advised me to fully test all the features after the migration as it was subject to major changes. Now I’m going to do that during next week.


This week, I entirely worked on migrating the resources to STU3 compatible resources. It’s a very very complicated task as STU3 is subjected to several major changes when comparing to STU3. After the discussion with mentor, I created several JIRA tickets for the changes. My current changes can be seen at [1]. Created below JIRA tickets. There are several changes yet to be done.

[1] https://github.com/openmrs/openmrs-module-fhir/pull/132


This week I have started to migrate the module to FHIR STU3. Many of underline FHIR resources and implementations are completely different in STU3. Migration STU2 to STU3 involves in major changes to some resource implementatios. This week I have sent my initial pull request in [1]. Hope to complete as much as I can during next week.

[1] https://github.com/openmrs/openmrs-module-fhir/pull/132


This week I have to read a lot as I started to migrate FHIR DSTU3 version. With DSTu3 there are major changes to the underline library APIs. I will need to go through each of the FHIR resource of OpenMRS and make necessary changes. Below are the list of changes that I need to incorporate. Hope I can finish them soon.

Package Structure

  • Structures are all found in the org.hl7.fhir.dstu3.model package, instead of the ca.uhn.fhir.model.dstu2.resource, ca.uhn.fhir.model.dstu2.composite, and ca.uhn.fhir.model.dstu2.valueset packages.

Datatypes

  • Primitive Types are renamed from [foo]Dt to [foo]Type, e.g. StringType and DecimalType
  • Composite Types are renamed from [foo]Dt to [foo], e.g. …

Ofori Kwateng

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store