The eRx Service is currently in beta.
Medication Search
Medication search allows you to search by name or National Drug Code. Searching for medications is essential for recording patient medication history such that the eRx service can protect patients from drug interactions. In this guide, we'll cover the basic functionality of medication search as well as a recommended approach for how and when to use medication search in your EHR.
Access Policy
To search for medications, your user needs to have the following access policy:
{
"rule": [
{
"action": "eRx:SearchMedication",
"resource": "eRx:Medication",
},
],
}
Code Examples
Here is an example of how to search for medications.
Note, this example uses medicationSearchV2
. The original version is still accessible as shown in our API documentation (opens in a new tab), but will be removed in a future version of Oystehr.
import Oystehr from '@oystehr/sdk';
const osytehr = new Oystehr({
accessToken: "<your_access_token>",
});
const { medications } = await oystehr.erx.medicationSearchV2({
name: 'lisinopril',
});
You can also search by National Drug Code (NDC) (opens in a new tab).
import Oystehr from '@oystehr/sdk';
const oystehr = new Oystehr({
accessToken: "<your_access_token>",
});
const { medications } = await oystehr.erx.medicationSearchV2({ code: '55289-0346-30' });
Example 200 response:
{
"medications": [
{
"id": "med_01J8G9NYBGNS1K9XY2EB4K7B9T",
"name": "Tylenol 8 Hour Arthritis Pain Oral Tablet Extended Release 650 MG",
"codes": {
"productNDC": "00045-0838-24"
},
"type": "OTC",
"schedule": "UNCONTROLLED",
"controlled": false,
"strength": "650 MG",
"form": "Tablet Extended Release"
}
]
}
Using Medication Search with the eRx Service
To receive medication interaction alerts for a patient's medication history, you'll need to have explicitly synced that medication for a given patient. So, the expected workflow for adding to the patient's medication history looks like this:
- Search for a medication
- From the search results, choose the identifier of the correct medication
- Create a MedicationStatement (opens in a new tab) FHIR resource for this patient. For a code sample of how to create this resource, see the patient sync documentation.
- Sync the patient
Once these steps are completed, the eRx service will be aware of the new medication in the patient's medication history and prescriptions to this patient will correctly detect drug interactions.