# Project - FHIR Integration

**URL:** <https://community.open-emr.org/t/project-fhir-integration/13701>\
**Category:** Google Summer of Code\
**Tags:** gsoc2020-chosen, gsoc-project, gsoc2020\
**Created:** [February 21, 2020, 7:01am UTC](https://community.open-emr.org/t/project-fhir-integration/13701 "2020-02-21T07:01:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![brady.miller](https://community.open-emr.org/user_avatar/community.open-emr.org/brady.miller/32/10178_2.png) [@brady.miller](https://community.open-emr.org/u/brady.miller)\
**Post date:** [February 21, 2020, 7:01am UTC](https://community.open-emr.org/t/project-fhir-integration/13701/1 "2020-02-21T07:01:30Z")

</div>

Fast Healthcare Interoperability Resources (FHIR) is a standard for exchanging healthcare information electronically. Goal is to integrate a FHIR server and client with OpenEMR to allow importing and exporting of patient data.

Selected Student:  
@yashrajbothra

Mentors:  
@brady.miller (primary)  
@sjpadgett  
@dixonwhitmire  
@rhausam  
@ken

---

<div class="post-metadata">

**Author:** ![akhil.12345](https://community.open-emr.org/letter_avatar_proxy/v4/letter/a/e8c25b/32.png) [@akhil.12345](https://community.open-emr.org/u/akhil.12345)\
**Post date:** [February 21, 2020, 1:47pm UTC](https://community.open-emr.org/t/project-fhir-integration/13701/3 "2020-02-21T13:47:35Z")

</div>

Dear Mentors,

Hi! I am Akhil from India. I am an undergraduate pursuing my degree in Computer Science.

I have experience with Web Development - PHP, Javascript and would love to be a part of GSOC 2020 under this project.

I request you to kindly let me know of the proceedings on how to begin.

Thanks 😃

---

<div class="post-metadata">

**Author:** ![adunsulag](https://community.open-emr.org/user_avatar/community.open-emr.org/adunsulag/32/12606_2.png) [@adunsulag](https://community.open-emr.org/u/adunsulag)\
**Post date:** [February 21, 2020, 3:31pm UTC](https://community.open-emr.org/t/project-fhir-integration/13701/4 "2020-02-21T15:31:01Z")

</div>

For the benefit of others I’ll post what I did in the slack. Jerry Padgett is much more in this space recently than I have been but I’ll post a few things to get people started and he can confirm / elaborate more on what I’m saying.

You can start by taking a look at the argonaut FHIR implementation guide / specification here: [http://www.fhir.org/guides/argonaut/](https://slack-redir.net/link?url=http%3A%2F%2Fwww.fhir.org%2Fguides%2Fargonaut%2F)We would like to get to the point where we have the Data Query Implementation built. I believe Jerry Padgett has done quite a bit of work on the Questionnaire implementation also and can comment on that. You can see in the codebase the beginnings of our work in implementing FHIR in the following files:

[https://github.com/openemr/openemr/blob/master/\_rest\_routes.inc.php](https://slack-redir.net/link?url=https%3A%2F%2Fgithub.com%2Fopenemr%2Fopenemr%2Fblob%2Fmaster%2F_rest_routes.inc.php)

[https://github.com/openemr/openemr/tree/master/src/FHIR/R4](https://slack-redir.net/link?url=https%3A%2F%2Fgithub.com%2Fopenemr%2Fopenemr%2Ftree%2Fmaster%2Fsrc%2FFHIR%2FR4)

[https://github.com/openemr/openemr/tree/master/src/RestControllers](https://slack-redir.net/link?url=https%3A%2F%2Fgithub.com%2Fopenemr%2Fopenemr%2Ftree%2Fmaster%2Fsrc%2FRestControllers)

Once again, Jerry Padgett has been in this area much heavier than me so he can also offer guidance and direction on what he thinks would be best to start off with.

---

<div class="post-metadata">

**Author:** ![devashish1099](https://community.open-emr.org/letter_avatar_proxy/v4/letter/d/b9e5f3/32.png) [@devashish1099](https://community.open-emr.org/u/devashish1099)\
**Post date:** [February 22, 2020, 4:27am UTC](https://community.open-emr.org/t/project-fhir-integration/13701/5 "2020-02-22T04:27:26Z")

</div>

Dear sir,

Hi! I am Devashish , currently a UG student in IIT ROORKEE, India.

I have some experience with Web Development - PHP, Javascript, React , Vuejs and would love to be a part of GSOC 2020 under this project.

I request you to kindly let me know how to begin.

---

<div class="post-metadata">

**Author:** ![sjpadgett](https://community.open-emr.org/user_avatar/community.open-emr.org/sjpadgett/32/21623_2.png) [@sjpadgett](https://community.open-emr.org/u/sjpadgett)\
**Post date:** [February 23, 2020, 9:35pm UTC](https://community.open-emr.org/t/project-fhir-integration/13701/6 "2020-02-23T21:35:27Z")

</div>

Hi,  
As @adunsulag pointed to some background on OpenEMR Fhir implementation thus far I want to point out that we are not trying to be a full service server implementation of Fhir. This narrows our focus on clinical setting and the resources required to communicate health information leaving much of the Fhir administrative capabilities as an aside for now.

While implementing resource search capabilities is of great import, it is more a priority to get the searchables in place meaning, Fhir resources. Currently we have two main resources, Patient and Encounter with Practitioner tagging along. While these are not complete, mainly because they can rely on resources not currently in place, they can serve as a template to new resource development.  
Namely:

- Create resource Rest controller class src/RestControllers.
- Create service class to support to src/Services. Currently , because i’m frugal i’m using only one class for services: src/Services/FhirResourcesService.php but probably each resource should have its own class. You can look here though on how I use Fhir src/FHIR/R4 classes to build resources.
- I should note that while the R4 classes are not necessary to implement any of the json structures, these classes(R4) are built from the specification and will make changing Fhir release support much easier in future rather than dealing with a hundred different json structures scattered about. You may also parse incoming json to the classes. Though more tedious to use the classes, I feel worthwhile in long run. I’m open on this so speak up if you want to go another way.
- Create routes in \_rest\_routes.inc.php.

So for now let’s concentrate on getting our resources developed. Setting up search will require developing some interface/adapter classes but if anyone feels like starting search, feel free.

So these resources ideas will be of great help:

1. [Organization](https://www.hl7.org/fhir/organization.html)
2. [Condition](https://www.hl7.org/fhir/condition.html)
3. [Procedure](https://www.hl7.org/fhir/procedure.html)
4. [Observation](https://www.hl7.org/fhir/observation.html)
5. [QuestionnaireResponse](https://www.hl7.org/fhir/questionnaireresponse.html) - I’m working this one.
6. Or any clinicals from here: [https://www.hl7.org/fhir/resourcelist.html](https://www.hl7.org/fhir/resourcelist.html)

I’d pick a simpler one to start like condition or organization.

So any taker or questions?

---

<div class="post-metadata">

**Author:** ![Asha\_Sulaiman](https://community.open-emr.org/user_avatar/community.open-emr.org/asha_sulaiman/32/13959_2.png) [@Asha\_Sulaiman](https://community.open-emr.org/u/Asha_Sulaiman)\
**Post date:** [February 25, 2020, 6:33am UTC](https://community.open-emr.org/t/project-fhir-integration/13701/7 "2020-02-25T06:33:09Z")

</div>

Hi @sjpadgett

I’m Asha from Sir Lanka. I would like to work on Organization to get an understanding. could please guide me to get started ?

---

<div class="post-metadata">

**Author:** ![sjpadgett](https://community.open-emr.org/user_avatar/community.open-emr.org/sjpadgett/32/21623_2.png) [@sjpadgett](https://community.open-emr.org/u/sjpadgett)\
**Post date:** [February 25, 2020, 3:00pm UTC](https://community.open-emr.org/t/project-fhir-integration/13701/8 "2020-02-25T15:00:07Z")

</div>

Hi @Asha_Sulaiman,  
Recommend your first step to be getting a OpenEMR instance running then a setup for accessing our APIs via REST(I like to use a REST browser plugin). [openemr/API\_README.md at master · openemr/openemr · GitHub](https://github.com/openemr/openemr/blob/master/API_README.md)  
Review the src/FHIR/R4/FHIRResource.php and src/FHIR/R4/FHIRResource/FHIROrganization/FHIROrganizationContact.php classes along with the [https://www.hl7.org/fhir/organization.html](https://www.hl7.org/fhir/organization.html) json example to get an idea of structure.  
Follow the pattern of my previous post.

---

<div class="post-metadata">

**Author:** ![Shebin\_Silvister](https://community.open-emr.org/user_avatar/community.open-emr.org/shebin_silvister/32/13974_2.png) [@Shebin\_Silvister](https://community.open-emr.org/u/Shebin_Silvister)\
**Post date:** [March 15, 2020, 1:13pm UTC](https://community.open-emr.org/t/project-fhir-integration/13701/9 "2020-03-15T13:13:59Z")

</div>

Hi, I am Shebin Silvister, CSE UG student from India. I am currently going through the codebase for this project and I would like to seek clarification on a few points:

1. I could locate the tables for the Patient and Encounter Resources. However I’m unable to trace the tables/attributes for the Organization and the Condition Resources. Could you please guide me on the same and provide few details regarding the relationship among the tables.
2. The getOne() and getAll() functions have already been implemented in the FhirRestController Class. The implementations for the functions getVital(), postVital(), putVital(), etc. are not yet done; so would like to know if there is a requirement for including these implementations.

Thank You.

---

<div class="post-metadata">

**Author:** ![sjpadgett](https://community.open-emr.org/user_avatar/community.open-emr.org/sjpadgett/32/21623_2.png) [@sjpadgett](https://community.open-emr.org/u/sjpadgett)\
**Post date:** [March 17, 2020, 6:46pm UTC](https://community.open-emr.org/t/project-fhir-integration/13701/10 "2020-03-17T18:46:34Z")

</div>

Hi,  
I don’t understand what you’re doing.  
The fhir rest interface follows the same pattern as our standard api’s.  
Regarding api pattern for fhir: you’d want to create a controller and service for the fhir Organization Resource(or whatever resource you are working). Then setup your route in \_rest\_routes.inc.php.

Use the already included R4 classes for creating your resources. It is not necessary to use FhirRestController Class and is there as a guide however, you can go ahead and place your resource json builder there as I think we may want to keep all the resources in the same class.  
By looking at our standard api controllers and services you can get a feel for openemr tables and the various tools available by them to access patient data. These reside in openemr/src directory.

Best advice I can give is to look at the src/RestControllers/FhirPatientRestController.php and follow that logic.  
First task is to setup your development platform for testing then call some existing api’s.

---

<div class="post-metadata">

**Author:** ![yashrajbothra](https://community.open-emr.org/user_avatar/community.open-emr.org/yashrajbothra/32/14078_2.png) [@yashrajbothra](https://community.open-emr.org/u/yashrajbothra)\
**Post date:** [March 18, 2020, 2:08pm UTC](https://community.open-emr.org/t/project-fhir-integration/13701/11 "2020-03-18T14:08:38Z")

</div>

Hello Everyone,

On the first look i was not able to understand this project specially because of the jargon FHIR. But today i thought to take a look on it and when i read the docs of FHIR i was able to understand the purpose of FHIR and implementation as well. So now i am intrested to contribute in this and for first thing todo i think i should implement search capablity in Practitioner to get more understanding of it.

Should I add Patient.active function in FhirPatientRestController?

---

<div class="post-metadata">

**Author:** ![yashrajbothra](https://community.open-emr.org/user_avatar/community.open-emr.org/yashrajbothra/32/14078_2.png) [@yashrajbothra](https://community.open-emr.org/u/yashrajbothra)\
**Post date:** [March 18, 2020, 2:29pm UTC](https://community.open-emr.org/t/project-fhir-integration/13701/12 "2020-03-18T14:29:04Z")

</div>

While Trying to implement this i saw something. if we call ` FhirPatientRestController(PId))->getOne()` and Pid in not assigned then also It returns the PatientResource is it okay?

As Per Docs -\> [https://www.hl7.org/fhir/bundle-search-warning.html](https://www.hl7.org/fhir/bundle-search-warning.html)

---

<div class="post-metadata">

**Author:** ![brady.miller](https://community.open-emr.org/user_avatar/community.open-emr.org/brady.miller/32/10178_2.png) [@brady.miller](https://community.open-emr.org/u/brady.miller)\
**Post date:** [March 19, 2020, 6:10am UTC](https://community.open-emr.org/t/project-fhir-integration/13701/13 "2020-03-19T06:10:38Z")

</div>

hi @yashrajbothra ,

Agreed that it is very odd to return an empty PatientResource. For example, here is what I get with the [http://localhost:8300/apis/fhir/Patient/3](http://localhost:8300/apis/fhir/Patient/3) endpoint if there is no patient with pid of 3. If there is a standard to follow in this situation, then we should follow it.

 ![image](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/1/1debeafa42816284a5d91680e14f69b588c6cc2b.png)

---

<div class="post-metadata">

**Author:** ![yashrajbothra](https://community.open-emr.org/user_avatar/community.open-emr.org/yashrajbothra/32/14078_2.png) [@yashrajbothra](https://community.open-emr.org/u/yashrajbothra)\
**Post date:** [March 19, 2020, 11:55am UTC](https://community.open-emr.org/t/project-fhir-integration/13701/14 "2020-03-19T11:55:05Z")

</div>

While i was creating my proposal i got a small little doubt. When we create a restController as of now there are two functions `getOne()` and `getAll()` but i can’t find anything like that in docs are we suppose to create only two methods for every resource or there are more ?

---

<div class="post-metadata">

**Author:** ![yashrajbothra](https://community.open-emr.org/user_avatar/community.open-emr.org/yashrajbothra/32/14078_2.png) [@yashrajbothra](https://community.open-emr.org/u/yashrajbothra)\
**Post date:** [March 19, 2020, 12:02pm UTC](https://community.open-emr.org/t/project-fhir-integration/13701/15 "2020-03-19T12:02:29Z")

</div>

Oops, Gotcha [https://www.hl7.org/fhir/operations.html](https://www.hl7.org/fhir/operations.html) , [https://www.hl7.org/fhir/http.html](https://www.hl7.org/fhir/http.html) 👍

---

<div class="post-metadata">

**Author:** ![sjpadgett](https://community.open-emr.org/user_avatar/community.open-emr.org/sjpadgett/32/21623_2.png) [@sjpadgett](https://community.open-emr.org/u/sjpadgett)\
**Post date:** [March 22, 2020, 7:23am UTC](https://community.open-emr.org/t/project-fhir-integration/13701/16 "2020-03-22T07:23:08Z")

</div>

Don’t know why I haven’t been getting notifications for this thread so sorry.

---

<div class="post-metadata">

**Author:** ![wizdom](https://community.open-emr.org/user_avatar/community.open-emr.org/wizdom/32/14129_2.png) [@wizdom](https://community.open-emr.org/u/wizdom)\
**Post date:** [March 22, 2020, 1:59pm UTC](https://community.open-emr.org/t/project-fhir-integration/13701/17 "2020-03-22T13:59:23Z")

</div>

Dear Mentors,

Hi! I am Wisdom Matthew from Nigeria. I am an undergraduate pursuing my degree in Computer Science.

I have experience with Web Development - PHP, Javascript, MySQL, HTML and would love to be a part of GSOC 2020 under this project.

Thanks

---

<div class="post-metadata">

**Author:** ![yashrajbothra](https://community.open-emr.org/user_avatar/community.open-emr.org/yashrajbothra/32/14078_2.png) [@yashrajbothra](https://community.open-emr.org/u/yashrajbothra)\
**Post date:** [March 22, 2020, 2:32pm UTC](https://community.open-emr.org/t/project-fhir-integration/13701/18 "2020-03-22T14:32:01Z")

</div>

Welcome @wizdom 🎉

---

<div class="post-metadata">

**Author:** ![yashrajbothra](https://community.open-emr.org/user_avatar/community.open-emr.org/yashrajbothra/32/14078_2.png) [@yashrajbothra](https://community.open-emr.org/u/yashrajbothra)\
**Post date:** [March 22, 2020, 2:36pm UTC](https://community.open-emr.org/t/project-fhir-integration/13701/19 "2020-03-22T14:36:39Z")

</div>

I have a Doubt regarding [Terminologies](http://hl7.org/fhir/r4/terminologies.html). Are Planing to use codes in resources. If so how can we integrate [Valuesets](http://hl7.org/fhir/r4/terminologies.html#valuesets)?

---

<div class="post-metadata">

**Author:** ![rhausam](https://community.open-emr.org/letter_avatar_proxy/v4/letter/r/779978/32.png) [@rhausam](https://community.open-emr.org/u/rhausam)\
**Post date:** [March 22, 2020, 9:31pm UTC](https://community.open-emr.org/t/project-fhir-integration/13701/20 "2020-03-22T21:31:00Z")

</div>

@yashrajbothra I may be able to help answer your question on value sets and using codes in resources. Maybe a start could be the tutorial that I give on FHIR Terminology at the HL7 meetings, which probably should cover at least some of your questions. Here’s a [link](https://github.com/FHIR/documents/blob/master/presentations/2020-03%20Webinars/FHIR%20Terminology.pptx) to the latest copy (from a webinar I gave 2 weeks ago - it’s Creative Commons licensed). And if you can ask some additional more specific questions, that would be great.

---

<div class="post-metadata">

**Author:** ![yashrajbothra](https://community.open-emr.org/user_avatar/community.open-emr.org/yashrajbothra/32/14078_2.png) [@yashrajbothra](https://community.open-emr.org/u/yashrajbothra)\
**Post date:** [March 23, 2020, 1:41pm UTC](https://community.open-emr.org/t/project-fhir-integration/13701/21 "2020-03-23T13:41:25Z")

</div>

Thanks @rhausam for your refrence it will definetly help us integrating FHIR.

[Next page](https://community.open-emr.org/t/project-fhir-integration/13701.md?page=2)
