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.
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/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:
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.
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.
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
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 json example to get an idea of structure.
Follow the pattern of my previous post.
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:
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.
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.
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.
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?
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?
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 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.
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 ?
@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 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.