# OpenMRS Support for a FHIR-based Facility Registry

**URL:** https://talk.openmrs.org/t/openmrs-support-for-a-fhir-based-facility-registry/34908
**Category:** FHIR
**Tags:** fhir, facility-data, referrals
**Created:** [October 19, 2021, 5:16pm UTC](https://talk.openmrs.org/t/openmrs-support-for-a-fhir-based-facility-registry/34908 "2021-10-19T17:16:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![pmanko](https://talk.openmrs.org/user_avatar/talk.openmrs.org/pmanko/32/16247_2.png) [@pmanko](https://talk.openmrs.org/u/pmanko)
#### Post date: [October 19, 2021, 5:16pm UTC](https://talk.openmrs.org/t/openmrs-support-for-a-fhir-based-facility-registry/34908/1 "2021-10-19T17:16:57Z")

</div>

# OpenMRS Support for a FHIR-based Facility Registry: A Concept Note

* * *

This post is meant to serve as an overview and concept note for the OpenMRS Facility Registry project. Any and all questions, suggestions, or concerns are welcome!

## Goals

1. Enable OpenMRS to act as a client (or [Care Services Update Consumer](https://github.com/intrahealth/gofr)) of a Facility Registry like [GoFR](https://github.com/intrahealth/gofr).

2. Enable OpenMRS to upload and synchronize the implementation-specific Location hierarchy with a centralized Facility Registry.

## Proposed Tasks

(See the [Facility Registry Workflow Epic](https://issues.openmrs.org/browse/FM2-387) for related issues)

### 1. Determine what OpenMRS support for the mCSD profile looks like:

- How would external facility lists be used within current OpenMRS Workflows?
- Would OpenMRS be solely a consumer of Facility Registry data, or would there be a need to upload data as well?
- Does the scope of the mCSD profile align with the OpenMRS approach to locations, referrals, and healthcare service information?
- etc…

### 2. Explore the mappings between the [mCSD Data Model](https://intrahealth.github.io/gofr/working_with_fhir/mcsd/#mcsd-facility-location-and-organization) and the OpenMRS `Location` Hierachy.

Related Issues: [FM2-433](https://issues.openmrs.org/browse/FM2-433), [FM2-434](https://issues.openmrs.org/browse/FM2-434)

Draft Mapping Spreadsheet: [mCSD -OpenMRS FHIR Mappings - Google Sheets](https://docs.google.com/spreadsheets/d/1ga3ZSHJl0SJTuC3IgDcqCvqOA61VI0f4LBlCWwKJn7g/edit#gid=)

### 3. Document the proposed OpenMRS FHIR Module support for mCSD-related resources in the FHIR2 Module Implementation Guide.

IG Github: [GitHub - openmrs/openmrs-contrib-fhir2-ig: Implementation Guide for the FHIR2 module](https://github.com/openmrs/openmrs-contrib-fhir2-ig) CI Build: [https://fhir.openmrs.org](https://fhir.openmrs.org)

### 4. Add functionality for OpenMRS to consume and cache FR data

Any relevant information obtained from the FR can be stored as tagged `Locations` in the OpenMRS data model. We can leverage custom attributes to add required data that does not currently have dedicated support in the OpenMRS `Location` class.

### 5. Demonstrate the use of FR data in one of the target OpenMRS Use Cases

[See below](#openmrs-facility-registry-use-cases-12)

### 6. Determine the utility of being able to synchronize the OpenMRS Location hierarchy with a centralized representation.

Similar to communication with a Client Registry or Terminology Service.

### 7. Implement any required but not implemented FHIR2 module support for FR workflows

The FHIR2 Module should support:

1. Creating and updating a local representation of a FR dataset as an independent `Location` hierarchy
2. Translating the OpenMRS Location hierarchy into a FR-compatible form for upload into a [GoFR partition](https://github.com/intrahealth/gofr/search?o=desc&q=partition&s=indexed)

### 8. Develop an IG-based testing framework for validating OpenMRS support for the mCSD profile and the related FR workflows.

1. Overview of FHIR Implementation Guides: [IG Home Page - Guidance for FHIR IG Creation v0.1.0](https://build.fhir.org/ig/FHIR/ig-guidance/)
2. Official FHIR IG Documentation: [ImplementationGuide - FHIR v5.0.0](https://www.hl7.org/fhir/implementationguide.html)
3. Way of Working Artifact Metamodel: [http://build.fhir.org/ig/hl7-be/hl7-be-wow/index.html](http://build.fhir.org/ig/hl7-be/hl7-be-wow/index.html)
4. [OpenHIE Testing Concept Note](https://docs.google.com/document/d/1GAi59hjVOYSePA5rxfVENIBlyY6iy_c0t1QfTnTLIuY/edit?usp=sharing)
5. [Testing (against) FHIR Specifications](https://docs.google.com/document/d/1L4mAvQffg342gvLw0gfY9ssgUwbjDRLrICkHg6pYh7o/edit?usp=sharing)

## OpenMRS Facility Registry Use Cases

- drop down population in UI
- reporting
- referrals
- transfer in/outs
- source of required information - Facility ID (national identifier not internal), Name, Address/Location, Active/Not-active, Services Offered, Facility Type

## Challenges and Open Questions

1. To what extent does the scope of our work overlap with the efforts to provide referral functionality in OpenMRS? (See [Referrals in OpenMRS](https://talk.openmrs.org/t/referrals-in-openmrs/19381/) for more context)
2. How should we architect the communication and use of centralized HIE components such as a Facility Registry, Client Registry, or Terminology Service by OpenMRS in general?
  - Should data from these sources be integrated with the OpenMRS data model?
  - Should OpenMRS strictly act as a consumer of these resources?
  - In what cases does instance-specific data need to be uploaded from OpenMRS to such a service?

## FHIR Data Model for Facility Registry Data

[![](https://intrahealth.github.io/gofr/img/coreonly.png) ](https://intrahealth.github.io/gofr/img/coreonly.png)

[![](https://intrahealth.github.io/gofr/img/mcsd1.png) ](https://intrahealth.github.io/gofr/img/mcsd1.png)

[![](https://intrahealth.github.io/gofr/img/mcsd_entities.png) ](https://intrahealth.github.io/gofr/img/mcsd_entities.png)

## References

1. [(Draft) Concept Note - Facility Registry IG - Google Docs](https://docs.google.com/document/d/17br8hI6BpWeaa6E8zWdea_hbHY5-oiXm9391Gzmu_DU/edit)
2. [https://ihe.github.io/ITI.mCSD/index.html](https://ihe.github.io/ITI.mCSD/index.html)
3. [Target mCSD Use Case - Master Facility List](https://ihe.github.io/ITI.mCSD/1464_overview.html#146424-use-case-4-master-facility-list)
4. [Global Open Facility Registry](https://intrahealth.github.io/gofr/)
5. [https://intrahealth.github.io/gofr/working\_with\_fhir/working\_with\_fhir/](https://intrahealth.github.io/gofr/working_with_fhir/working_with_fhir/)

---

<div class="post-metadata">

### Author: ![herbert24](https://talk.openmrs.org/user_avatar/talk.openmrs.org/herbert24/32/8178_2.png) [@herbert24](https://talk.openmrs.org/u/herbert24)
#### Post date: [October 19, 2021, 11:53pm UTC](https://talk.openmrs.org/t/openmrs-support-for-a-fhir-based-facility-registry/34908/2 "2021-10-19T23:53:26Z")

</div>

> [@pmanko](#):
>
> Registry

Thanks @pmanko do you want to create a wiki page for this too where you will organize things

---

<div class="post-metadata">

### Author: ![burke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/burke/32/17_2.png) [@burke](https://talk.openmrs.org/u/burke)
#### Post date: [October 20, 2021, 6:17pm UTC](https://talk.openmrs.org/t/openmrs-support-for-a-fhir-based-facility-registry/34908/3 "2021-10-20T18:17:44Z")

</div>

> [@pmanko](#):
>
> To what extent does the scope of our work overlap with the efforts to provide referral functionality in OpenMRS? (See [Referrals in OpenMRS](https://talk.openmrs.org/t/referrals-in-openmrs/19381/) for more context)

As discussed on today’s Platform Team call, we can add `location.type` as a Concept to link between physical locations / facilities and the more abstract (types of) locations needed for most referrals.

We expect that most orderable concepts will have the service pre-coordinated (e.g., “Physical Therapy referral” or “Cardiology referral”). So, a location/department would be implied within the orderable concept for most standard referrals. When a location is needed for a referral, we plan on using concepts. Those concepts could be optionally linked to specific locations through `location.type`.

> [@pmanko](#):
>
> How should we architect the communication and use of centralized HIE components such as a Facility Registry, Client Registry, or Terminology Service by OpenMRS in general?
> 
> - Should data from these sources be integrated with the OpenMRS data model?
> - Should OpenMRS strictly act as a consumer of these resources?
> - In what cases does instance-specific data need to be uploaded from OpenMRS to such a service?

I would expect the primary use wouldn’t be directly using a FR within OpenMRS application; rather, creating tooling – as you suggest – to help an OpenMRS instance import locations from a FR and export locations to a FR – i.e., simplify the process of aligning locations used within OpenMRS with locations being managed or centralized within a HIE’s FR.

---

<div class="post-metadata">

### Author: ![pmanko](https://talk.openmrs.org/user_avatar/talk.openmrs.org/pmanko/32/16247_2.png) [@pmanko](https://talk.openmrs.org/u/pmanko)
#### Post date: [October 27, 2021, 8:32pm UTC](https://talk.openmrs.org/t/openmrs-support-for-a-fhir-based-facility-registry/34908/4 "2021-10-27T20:32:37Z")

</div>

@herbert24 I created a Wiki page under the FHIR Wiki: [Facility Registry Workflows - Projects - OpenMRS Wiki](https://wiki.openmrs.org/display/projects/Facility+Registry+Workflows)

Let me know what you think!
