Closed rahulm577 closed 3 months ago
This is probably too late to help, but your problem was that you were looking at Medication, not MedicationRequest. Medication is not tied to patients, and some EHRs like Cerner don't let you search/bulk-export them, only request them by ID.
MedicationRequest is the patient-oriented version. So if you do:
from fhirclient.models.medicationrequest import MedicationRequest
search = MedicationRequest.where(struct={'patient': patient.id, 'status': 'active'})
medOrders = search.perform_resources(smart.server)
That should work for you.
Hi There,
New to the world of EHR work. I am trying to use client-py to be able to eventually extract admission information from an EHR. I have managed to retrieve basic patient information successfully using this code:
However, I am now trying to search for patient resources and keep getting 404 errors despite being seemingly connected to the server.
which results in:
Any help would be appreciated!