Discrepancies in OpenEMR data retrieval through FHIR API

Hello Team,

I am having 3 issues while working with OpenEMR. I have posted the three issues one by one below :

  1. PractitionerRole API returns 0 results when searching with practitioner FHIR ID
    I am trying to get the PractitionerRole resource by passing the practitioner FHIR ID as a “practitioner” search parameter when doing a GET call on PractitionerRole API. Doing so i get 0 results even when the Practitioner ID is correct and 2 roles for that practitioner exists in the system.
    When i change the GET request to use only PractitionerRole API without any search parameters, it correctly returns all the PractitionerRole resources for all the Practitioners in the system. However, query with search parameter is not returning the expected results

  2. DiagnosticReport API returns resources with incorrect reference of subject (patient)
    I added clinical notes for a patient in OpenEMR, when reading these CN through API, the result count is 0 when a patient FHIR ID is passed as the search parameter to DiagnosticReport API. When the search parameter is removed the returned resources have incorrect reference of resource.
    This issue is exactly same as Diagnostic Report FHIR API - #4 by adunsulag . However, there is no resolution posted. Did we resolved this issue?

  3. What are the SMART App considerations we need to make when designing our application that would integrate with OpenEMR’s SMART APP launch Framework.

  • Should the app support a specific browser?

  • Do we have any limited headers that needs to be set and used?

  • During a SMART on FHIR launch, what are the other details passed along with access_token and Id_toke? Does it include patient context like patient FHIR ID, encounter FHIR ID, patient name etc. Do we already have this documented as i couldnot find it.

OpenEMR Version
I’m using OpenEMR version 7.0.0

I’m using: Edge

Operating System
I’m using: Linux

Did you check the logs? Yes
Was there anything pertinent in them? No. I cannot see any logs added in Admin >> System >> Logs for the FHIR APIs that i try to access through postman.
Please paste them here (surround with three backticks (```) for readability.
You can also turn on User Debugging under Administration->Globals->Logging User Debugging Options=>All

Can you tell me what patches you have installed on your server? Do you have patch 1 & 2 on the machine?

  1. I never got back to looking into this as neither Jerry or I were able to reproduce the issue. Do the notes show up when you view them in the encounter forms using the browser GUI? I’m still scratching my head as the data in that post you linked to was being saved incorrectly inside of OpenEMR and didn’t have anything to do with the apis.

3.1 Are you planning on building a stand alone launch or an in-ehr launch? The In-EHR launch currently shows up in a dialog window launched from the patient demographics page so you may want to be aware of size constraints in your app.

3.2 I can’t think of too many browser restrictions, we’ve tested smart apps on Chrome, Firefox, and Safari. I can’t say I’ve done much testing on Edge, but the latest versions of Edge should support everything we do with the SMART App Launch.

3.3 Headers are just the standard authorization bearer token. We do use some custom headers in the response when dealing with the bulk export system operations, but that’s part of the ONC specification.

3.4 We pass back the patient fhir id if you request the launch/patient scope or for an EHR launch if you request the ‘launch’ scope. EHR launch also will pass back the currently selected encounter id if there is one selected in the EHR. We do not pass back patient name information in the access token. I don’t recall what comes back in the ID Token and I’m not sure if we have that documented anywhere.

Hello Stephen,

  1. We have installed the OEMR 7.0.0 base package that includes all the previous packages + patch 2.

  2. Yes, the clinical notes added for the patient are seen under the visit summary of the same patient in the clinical notes section. It is just when the data is retrieved via DiagnosticReport API the subject property of the DiagnosticReport resource refers to the FHIR ID of another patient.

    1. We are planning to build an in-EHR launch, the application context I select when registering the app is the Multipurpose application as i don’t see an app context specific to “Provider/user”. Other options are:
  • Single Patient application, Multiple patient app, System client app and are not applicable to my use-case

3.2. & 3.3 Noted

3.4 Is there any way i can double check the contexts being passed?. I want to be able to see/verify the patient ID, Encounter ID being returned. Thus wondering if the launch can be configured to open the app in a new browser. ??(For testing purposes)

Thank You for all the help provided so far!!