GSoC 2021: Support for Extended Operations in FHIR
Primary mentor | @Varun Gupta |
Backup mentor | @Ian Bacher |
Assigned to | @Medhavi Srivastava |
Abstract
FHIR is an emerging standard for healthcare interoperability. While OpenMRS has been an early adopter of the FHIR standard and there has been some work done on it already, there is a scope to do more in that area. FHIR defines a very detailed API for searching that is fundamental to providing the correct data to any front-end application. Currently, the OpenMRS FHIR module supports a good amount of search functionality including the capability to search across multiple properties and support advanced search parameters such as _include/_revinclude along with pagination.
This project aims to extend the FHIR module to include support for extended operations. Operations (for these purposes) serve as stored queries where there is some logic built into the semantics of the operation itself. For example, the $lastn operation on the Observation resource (invoked using [base]/Observation/$lastn?subject=Patient/123&max=3 endpoint for example) should return the most recent 3 Observations associated with the specified Patient reference. The aim is to implement extended operations that would prove useful for clients using the FHIR module.
Project Champions
@Ian Bacher
Skills Needed
Good Java skills
Familiarity with SQL
Bonus points for familiarity with Hibernate and especially the Criteria API
Bonus points for knowledge of how to write efficient queries and how to optimise queries
Objectives
Define, implement and execute the following type-level extended operations on the Observation resource:
$lastn → The operation to fetch the most recent N Observations corresponding to the specified Patient resources.
URL: [base]/Observation/$lastn?[query]$lastn-encounters → The operation to fetch all Observations matching the most recent N Encounters corresponding to the specified Patient resources.
URL: [base]/Observation/$lastn-encounters?[query]
Improve the implementation of Observation.category to allow for enhanced filtering using the $lastn-type operations. In essence, helping in filtering out the "vitals" from other types of Observations.
Define, implement and execute the $everything instance-level operations on:
Patient resource → The operation to fetch all the information related to the specified Patient reference including links to any other resources.
URL: [base]/Patient/[id]/$everythingEncounter resource → The operation to fetch all the information related to the specified Encounter reference including links to any other resources.
URL: [base]/Encounter/[id]/$everything
The scope includes implementation for both the R3 and R4 versions of the resources and addition of appropriate unit and integration tests.
Extra Credit
Implement the $everything type-level extended operation for:
Patient resource (URL: [base]/Patient/$everything)
Encounter resource (URL:[base]/Encounter/$everything)
Weekly Reports
Week 1 : GSoC’21 @OpenMRS - Week 1
Week 2 : GSoC’21 @OpenMRS - Week 2
Week 3 : GSoC’21 @OpenMRS - Week 3
Week 4 : GSoC’21 @OpenMRS - Week 4
Week 5 : GSoC’21 @OpenMRS - Week 5
Week 6 : GSoC’21 @OpenMRS - Week 6
Week 7 : GSoC’21 @OpenMRS - Week 7
Week 8 : GSoC’21 @OpenMRS - Week 8
Week 9 : GSoC’21 @OpenMRS - Week 9
Week 10 : GSoC’21 @OpenMRS - Week 10
Final Presentation
Resources / Getting Started
Read up on FHIR. Good introductions can be found in this post, in this slide show, or this video.
Read up on the HAPI FHIR library which we use for FHIR support, especially the part on search and extended operations.
Read up on the Hibernate Criteria API.
Read up on the extended operations (defining, implementing, executing) from the FHIR spec.
Look through the FHIR module source code, especially the search implementation for Observation.
Read up on the FHIR Lastn operation.
Read up on the FHIR Patient everything.