eRx
Allergy Search
🚧

The eRx Service is currently in beta.

Allergy Search

Allergy search allows you to search by name. Searching for allergies is an essential part of protecting patients from adverse reactions. In this guide, we'll cover the basic functionality of allergy search as well as a recommended approach to using allergy search with the rest of the eRx service.

Access Policy

To search for allergies, your user needs to have the following access policy:

{
  "rule": [
    {
      "action": "eRx:SearchAllergy",
      "resource": "eRx:Allergy",
    },
  ],
}

Code Examples

Here is an example of how to search for allergies:

allergy-search-by-name.ts
import zapehr from '@zapehr/sdk';
 
zapehr.init({
  ZAPEHR_ACCESS_TOKEN: "<your_access_token>",
});
 
const { allergens } = await zapehr.project.erx.allergySearch({ name: 'lisinopril' });

Example 200 response body:

{
    "allergens": [
        {
            "id": "alg_01GBAPSGCS3XB8NR9GXK1VJRJK",
            "name": "lisinopril",
            "rxcui": "29046"
        },
        {
            "id": "alg_01GBAPSG5HYVBGV1MNF86WVMD0",
            "name": "lisinopril anhydrous",
            "rxcui": "1546022"
        }
    ]
}

Using Allergy Search with the eRx Service

To receive allergy alerts, you'll need to have explicitly synced that allergy for a given patient. So, the expected workflow for adding a new patient allergy looks like this:

  1. Search for an allergy
  2. From the search results, choose the identifier of the correct allergy
  3. Create an AllergyIntolerance (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.
  4. Sync the patient

Once these steps are completed, the eRx service will be aware of the patient's allergy and prescriptions will correctly detect allergy interactions.