# GSoC 2024: Integrating OpenELIS with a FHIR-Based Open Client Registry - project updates

**URL:** <https://talk.openelis-global.org/t/gsoc-2024-integrating-openelis-with-a-fhir-based-open-client-registry-project-updates/726>\
**Category:** GSOC\
**Tags:** gsoc2024\
**Created:** [May 6, 2024, 4:02am UTC](https://talk.openelis-global.org/t/gsoc-2024-integrating-openelis-with-a-fhir-based-open-client-registry-project-updates/726 "2024-05-06T04:02:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mherman22](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/mherman22/32/92_2.png) [@mherman22](https://talk.openelis-global.org/u/mherman22)\
**Post date:** [May 6, 2024, 4:02am UTC](https://talk.openelis-global.org/t/gsoc-2024-integrating-openelis-with-a-fhir-based-open-client-registry-project-updates/726/1 "2024-05-06T04:02:26Z")

</div>

Greetings everyone,

I was recently selected as a GSoC student under OpenELIS for the project titled **Integrating OpenELIS with a FHIR-Based Open Client Registry**.

I will be using this thread for all updates for this project and anyother discussions in relation to the project.

### Project Summary

**Project Mentor** : @reagan

This integration aims to connect OpenELIS, a laboratory information system, with a FHIR-Based Open Client Registry which will allow users to search for patients within their local OpenELIS system, If the patient isn’t found locally, search the client registry then Import patient information from the client registry to OpenELIS. In simpler terms, this lets users find patients within their local system and if not found, search for them in a central database and bring their information back into the local system.

### Resources

- [https://www.openclientregistry.org/](https://www.openclientregistry.org/)
- [Server Installation - OpenCR Documentation](https://intrahealth.github.io/client-registry-docs/dev/installation_full/)
- [Welcome! - OpenCR Documentation](https://intrahealth.github.io/client-registry/)
- [http://openhim.org/](http://openhim.org/)
- [https://hapifhir.io/](https://hapifhir.io/)

Regards,  
Herman Muhereza (mherman22)

cc: @reagan @Moses_Mutesasira @Herbert

---

<div class="post-metadata">

**Author:** ![sharif](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/sharif/32/85_2.png) [@sharif](https://talk.openelis-global.org/u/sharif)\
**Post date:** [May 6, 2024, 6:04pm UTC](https://talk.openelis-global.org/t/gsoc-2024-integrating-openelis-with-a-fhir-based-open-client-registry-project-updates/726/2 "2024-05-06T18:04:14Z")

</div>

Congratulations @mherman22 . All the best man.

---

<div class="post-metadata">

**Author:** ![mherman22](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/mherman22/32/92_2.png) [@mherman22](https://talk.openelis-global.org/u/mherman22)\
**Post date:** [May 26, 2024, 10:01pm UTC](https://talk.openelis-global.org/t/gsoc-2024-integrating-openelis-with-a-fhir-based-open-client-registry-project-updates/726/3 "2024-05-26T22:01:44Z")

</div>

Here is a summary blog of the last 3 weeks of community bonding  
[https://hermanmuhereza.blogspot.com/2024/05/gsoc-2024-integrating-openelis-with.html](https://hermanmuhereza.blogspot.com/2024/05/gsoc-2024-integrating-openelis-with.html)

---

<div class="post-metadata">

**Author:** ![mherman22](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/mherman22/32/92_2.png) [@mherman22](https://talk.openelis-global.org/u/mherman22)\
**Post date:** [June 3, 2024, 4:48am UTC](https://talk.openelis-global.org/t/gsoc-2024-integrating-openelis-with-a-fhir-based-open-client-registry-project-updates/726/4 "2024-06-03T04:48:38Z")

</div>

**Week one**

- I created a board on [Trello](https://trello.com/invite/gsoc24integratingopeneliswithafhirbasedopenclientregistry/ATTI63f329472dd4bbc1f42ef96930771f127EFB03F0) to track all the issues i will be working on during this project.

- My first line of action was to transform the match results returned by OpenCR into a FHIR Bundle object which i did in this PR [Return a FHIR Bundle with Auto and Potential matches as entries by mherman22 · Pull Request #137 · intrahealth/client-registry · GitHub](https://github.com/intrahealth/client-registry/pull/137) that is still under reviewed.

- I was able to achieve this by first of all using the patient id to send a request to the FHIR server and return the patient, then append the search object with the [match-grade](https://build.fhir.org/ig/HL7/fhir-extensions/StructureDefinition-match-grade.html) and score to the patient that was returned and then [add](https://github.com/intrahealth/client-registry/blob/f29cc9f237f57c915f54cc4a547da38fe3d31ca9/server/lib/routes/match.js#L1353) that patient to the entry array of the bundle object.

Thats how my first week was and you can find more details at

> **[Week One: Kicking Off the GSoC Project with OpenCR | GSoC'24](https://hermanmuhereza.blogspot.com/2024/06/week-one-kicking-off-gsoc-project-with.html)**

---

<div class="post-metadata">

**Author:** ![mherman22](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/mherman22/32/92_2.png) [@mherman22](https://talk.openelis-global.org/u/mherman22)\
**Post date:** [June 12, 2024, 4:11pm UTC](https://talk.openelis-global.org/t/gsoc-2024-integrating-openelis-with-a-fhir-based-open-client-registry-project-updates/726/5 "2024-06-12T16:11:19Z")

</div>

week two updates

i have worked on a couple of issues to fully translate the dictionary menu into the new ui and using rest controllers. I implemented modifying a dictionary menu and then also implemented the search functionality.

In line with my project, i spent a bit of time understanding the **fhir** layer of openelis, understanding how a patient is translated into a **fhir** object and how i can utilize that existing functionality to send the created patient to openhim after the event is triggered.

This and more can be found at

> **[Week Two: Progress and Insights](https://hermanmuhereza.blogspot.com/2024/06/week-two-progress-and-insights.html)**
>
> In the second week of my GSoC project, I've delved deeper into integrating OpenELIS with a FHIR-based open client registry. My primary focus has been

---

<div class="post-metadata">

**Author:** ![mherman22](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/mherman22/32/92_2.png) [@mherman22](https://talk.openelis-global.org/u/mherman22)\
**Post date:** [July 12, 2024, 5:51am UTC](https://talk.openelis-global.org/t/gsoc-2024-integrating-openelis-with-a-fhir-based-open-client-registry-project-updates/726/6 "2024-07-12T05:51:10Z")

</div>

Greetings, i have not updated this talk thread in a while so i will give a summary of what ive been workingon for the past 3 weeks:

> <https://github.com/I-TECH-UW/OpenELIS-Global-2/pull/1065>
>
> \# Pull Requests Requirements
> 
> \- \[\] The PR title includes a brief description …of the work done, including the Issue number if applicable.
> \- \[\] The PR includes a video showing the changes for the work done.
> \- \[\] The PR title follows conventional commit label standards.
> \- \[\] The changes confirm to the OpenElis Global x3 Styleguide and design documentation.
> \- \[\] The changes include tests or are validated by existing tests.
> \- \[\] I have read and agree to the Contributing Guidelines of this project.
> 
> \## Summary
> 
> \## Screenshots
> 
> \[Add relevant screenshots here if applicable\]
> 
> \## Related Issue
> 
> \[Add a link to the related issue or mention it here if applicable\]
> 
> \## Other
> 
> \[Add any additional information or notes here\]

i had to change course here from creating a new event listener to utilizing the existing async functions in fhirtransformservice class. I also went ahead to create the spring bean needed to connect to a fhir client and added the functionality to make sure there are attempts to reconnect incase the first attempt to connect to the fhir client fails → [checkout here for the reattempts](https://github.com/I-TECH-UW/OpenELIS-Global-2/blob/e10908d0433afde2a4002f12c15023eb72f14f46/src/main/java/org/openelisglobal/dataexchange/fhir/FhirUtil.java#L68).  
I also had to [validate the fhir client](https://github.com/I-TECH-UW/OpenELIS-Global-2/blob/e10908d0433afde2a4002f12c15023eb72f14f46/src/main/java/org/openelisglobal/dataexchange/fhir/FhirUtil.java#L97) to ensure that it has successfully connected to OpenElis by trying to [retrieve a capability statement (client metadata)](https://github.com/I-TECH-UW/OpenELIS-Global-2/blob/e10908d0433afde2a4002f12c15023eb72f14f46/src/main/java/org/openelisglobal/dataexchange/fhir/FhirUtil.java#L107) from the fhir client, if it fails then the connection has probably failed

> <https://github.com/SIGDEP-3/SIGDEP-3-Docker-Setup/pull/43>

This is the repository where i am doing the actual integration of the three (OpenELIS, OpenHIM, OpenCR). I created a docker compose file with the services. I have also gone ahead to ensure i have both the o2 and o3 versions of OpenELIS in the integration.

**Video showing current status**

[![](https://canada1.discourse-cdn.com/flex030/uploads/openelisci/original/1X/67d17386a4125c01b00f56e63be645ca6d210842.jpeg "Current status on integration of OpenELIS with a FHIR-Based Open Client Registry") ](https://www.youtube.com/watch?v=56f-kb2r_5I)

**Next week**

- i will continue fine tuning the connection and find out why o3 is not loading up as expected and then also figure out why the fhir patient from openelis is not properly sending the names of the patient to opencr.
- I will look into sending contacts aswell especially phone, email,home etc.

Cheers,  
Herman Muhereza.

---

<div class="post-metadata">

**Author:** ![mherman22](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/mherman22/32/92_2.png) [@mherman22](https://talk.openelis-global.org/u/mherman22)\
**Post date:** [July 14, 2024, 12:43pm UTC](https://talk.openelis-global.org/t/gsoc-2024-integrating-openelis-with-a-fhir-based-open-client-registry-project-updates/726/7 "2024-07-14T12:43:42Z")

</div>

> [@mherman22](#):
>
> I will look into sending contacts aswell especially phone, email,home etc.

I have added this pull request to try to clean up the json object project and align it more to the patient resource in fhir.

> <https://github.com/I-TECH-UW/OpenELIS-Global-2/pull/1179>
>
> …e not provided then they should not appear in the fhir json
> 
> \# Pull Requests …Requirements
> 
> \- \[x\] The PR title includes a brief description of the work done, including the
> Issue number if applicable.
> \- \[x\] The PR includes a video showing the changes for the work done.
> \- \[x\] The PR title follows conventional commit label standards.
> \- \[x\] The changes confirm to the OpenElis Global x3 Styleguide and design
> documentation.
> \- \[\] The changes include tests or are validated by existing tests.
> \- \[x\] I have read and agree to the Contributing Guidelines of this project.
> 
> \## Summary
> \## Current Implementation
> \`\`\`
> {
> "resourceType": "Patient",
> "identifier": \[
> {
> "system": "http://openelis-global.org/pat\_nationalId",
> "value": "FB8689432CVSnb"
> },
> {
> "system": "http://openelis-global.org/pat\_guid",
> "value": "2b07cdab-1f1c-4249-8640-a93d69489268"
> },
> {
> "system": "http://openelis-global.org/pat\_uuid",
> "value": "2b07cdab-1f1c-4249-8640-a93d69489268"
> }
> \],
> "name": \[
> {
> "family": "KIBALAMA",
> "given": \[
> "IAN"
> \]
> }
> \],
> "telecom": \[
> {
> "system": "phone",
> "value": "+255-43-75-78-58"
> },
> {
> "system": "email"
> },
> {
> "system": "fax"
> }
> \],
> "gender": "male",
> "birthDate": "2024-06-04",
> "address": \[
> {
> "line": \[
> "AMKA",
> "commune: gh"
> \],
> "city": "MUTUNGO"
> }
> \]
> }
> \`\`\`
> 
> \## Improved FHIR Patient Json
> \`\`\`
> {
> "resourceType": "Patient",
> "identifier": \[
> {
> "use": "official",
> "system": "http://openelis-global.org/pat\_nationalId",
> "value": "CM811234326CVSB"
> },
> {
> "use": "usual",
> "system": "http://openelis-global.org/pat\_guid",
> "value": "e90e3351-5a8a-447b-bdda-b868ef56f12e"
> },
> {
> "use": "usual",
> "system": "http://openelis-global.org/pat\_uuid",
> "value": "e90e3351-5a8a-447b-bdda-b868ef56f12e"
> }
> \],
> "name": \[
> {
> "family": "MANDANDA",
> "given": \[
> "GOALIE"
> \]
> }
> \],
> "telecom": \[
> {
> "system": "phone",
> "value": "+255-43-43-78-54",
> "use": "mobile"
> }
> \],
> "gender": "male",
> "birthDate": "2024-05-08",
> "address": \[
> {
> "line": \[
> "AMKA",
> "commune: "
> \],
> "city": "MUTUNGO"
> }
> \]
> }
> \`\`\`
> 
> \[Add relevant screenshots here if applicable\]
> 
> \## Related Issue
> 
> \[Add a link to the related issue or mention it here if applicable\]
> 
> \## Other
> 
> \[Add any additional information or notes here\]

I have also added updating of a patient record in openCR through this commit → [Create an OpenELIS connection to a FHIR-Based Client (OpenHIM) by mherman22 · Pull Request #1065 · I-TECH-UW/OpenELIS-Global-2 · GitHub](https://github.com/I-TECH-UW/OpenELIS-Global-2/pull/1065/commits/63bfe261449708ffa263c9fa9c60feda3f10b39e)

> [@mherman22](#):
>
> i will continue fine tuning the connection and find out why o3 is not loading up as expected

The video below shows the integration of OE o3 and updating of a patient record in openCR

[![](https://canada1.discourse-cdn.com/flex030/uploads/openelisci/original/1X/d071d5d3d4c80540007d7dbaa892800e961e36e1.jpeg "Integration of OpenELIS with a FHIR-Based Open Client Registry (updated)") ](https://www.youtube.com/watch?v=_vVHZG12XwQ)

@reagan @Moses_Mutesasira

---

<div class="post-metadata">

**Author:** ![mherman22](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/mherman22/32/92_2.png) [@mherman22](https://talk.openelis-global.org/u/mherman22)\
**Post date:** [July 16, 2024, 11:26am UTC](https://talk.openelis-global.org/t/gsoc-2024-integrating-openelis-with-a-fhir-based-open-client-registry-project-updates/726/8 "2024-07-16T11:26:25Z")

</div>

I added the commit below to enable the application to startup even when the CR properties are not provided. This is intended to maximize the importance of spring beans so that rather than calling the method everytime we try to connect to a fhir client, we can just autowire the IGenericClient. For more context, take a look at the commit.

> <https://github.com/I-TECH-UW/OpenELIS-Global-2/pull/1065/commits/51296bdc02ae35fecb18e805f9c477864606e9fb>
