Hello all!
Let me preface this by apologizing if this isn't the right space to ask this type of question - let me know and I'll delete the post!
I'm new to the FHIR workspace, and for now I'm trying to get a demo going for a few ideas/projects to come. I'm self-hosting Medplum and trying it out as well as connecting to some external EHR's, such as Epic and Cerner.
I can pull data using backend authorization and Medplum Bots, all working fine.
Now I'm trying to create a standalone app page for a practitioner to log in to an external EHR (Epic's sandbox) and then request Patient data from there. I started out using the SMARTerFHIR library together with Medplum.
Epic's sandbox has login info for a test user with practitioner role, which is what I'm using. I've registered my app as provider-facing in the Epic account.
The auth process works well, I get an access token and use it to query the server. However, I can only get data back if I'm requesting the patient directly (as in R4/Patient/
). If I do even a basic search (R4/Patient?given=camila) I get back a Bundle with total=0 and a warning of "Resource request returns no results", even though there is a patient with given name Camila (and I can get her data by her ID).
I tried the connection and search using the fhirclient library. Same result. Changed it to Medplum Bots, using MedplumClient. No dice.
Also tried a bunch of different scopes, like 'user/Patient.read', 'user/Patient.search', but couldn't get it to work.
So my question, if you can help me, is: Is it possible to get a Bundle of patients with a specific user in their CareTeam while logged in as that user? Is it an access issue for the user? Or am I missing something in the auth process/scope? OR am I missing something even more trivial?
Any tips or suggestions would be super helpful and greatly appreciated! š
Thank you all!