GSoC 2023 : FHIR: Add support for FHIR PATCH operations

Primary Mentor
Backup Mentor
Student

Abstract

OpenMRS is using the FHIR API more and more in place of the REST API. However, the FHIR API is, by default, quite verbose. Supporting PATCH operations would allow us to support partial updates to FHIR resources without needing to send the whole resource from the client to the server.

PATCH requests essentially comprise of instructions on how to modify a resource or resources. Patch requests can be used to avoid sending a whole document when only a part has changed and this is where it basically differs with the PUT request. Patch Request formats include the following JSON PATCH, XML PATCH which have to be implemented within the openmrs fhir2 module and in addition to those, the FHIR PATCH has to be included as well as a way of ensuring that when slight changes are made to the Json document, the entire document does not have to be sent. The Patch operations used within the above mentioned patch formats are add, replace, move, copy, test, remove.

Format for supporting a single patch

  1. Detect the incoming format(either json-merge patch, json-patch or xml-patch)
  2. Load the existing resource in the appropriate format
  3. Apply the patch

Required Skills

  • Excellent Java skills.

Project Length

  • Medium, 175 hours.

Objectives

  • Implement JSON PATCH operations on all OpenMRS FHIR R4 resources and ensure to have the tests working perfectly. - COMPLETED ✅
  • Implement JSON MERGE PATCH operations on all OpenMRS FHIR R4 resources and ensure to have the tests working perfectly. - COMPLETED ✅
  • Implement XML PATCH operations on all OpenMRS FHIR R4 resources and ensure to have the tests working perfectly. - COMPLETED ✅

Repositories: 

Pull Requests: 

Found Issues:

  • Medication Dispense was not added to the landing page of the FhirIG
  • Medication was not added to the landing page of the FhirIG

Fixed Issues:

Other related work:

During this GSoC jouney, i was able to do other work on the FHIR module as assigned by my mentor and below are the pull requests;-

Talk Thread links:

Jira Epic

Weekly Blog Posts:

Throughout the development cycle, I chronicled my progress and insights through weekly blog posts:


Video(Demo)

Resources: