Building a Medication List

Medication data come from several types of data sources including prescriptions (from EMRs like Epic and Cerner), pharmacy claims (from payor systems), pharmacy fills (from networks like Surescripts or pharmacy benefits managers like CVS/CareMark), and patient entry. To build a medication list from such a diversity of data, you likely want to translate medication terms into a common standard vocabulary and use ValueSets to consolidate into a single list organized by generic ingredients.

Scenario

An application developer has a set of data for one patient containing medication data from multiple sources:

code=HBNEHJDJ5       name=Zestoretic 10/12.5 tabs    system = North Plains EMR
code=HJDBN8382       name=metformin                  system = North Plains EMR
code=HBNEHJDJ        name=zoloft                     system = North Plains EMR
code=0591-0406-01    name=                           system = CVS CareMark NDC
code=HH4B84742       name=hydrocortisone cream       system = Patient Reported
code=29046           name=hctz lisinopril            system = East Side HIE
code=312938          name=sertraline oral tablet     system = East Side HIE

Translating into RxNorm

To make use of medication grouping built into RxNorm, first retrieve RxNorm codes for NDC codes and/or free text using the /ConceptMap/$translate operation with domain=Medication.

For example, GET https://api.careevolutionapi.com/terminology/v1/fhir/r4/ConceptMap/$translate?domain=Medication&code=HBNEHJDJ5 lisinopril 5mg tabs&system=North Plains EMR

Example response:

{"resourceType": "Parameters",
    "parameter": [
        {"name": "match",
            "part": [
                {"name": "equivalence",
                    "valueCode": "equal"},
                {"name": "concept",
                    "valueCoding": {
                        "extension": [
                            {"url": "https://rosetta.careevolution.com/api/translate-dependency/domain",
                                "valueString": "Reference"}
                        ],
                        "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
                        "code": "823986",
                        "display": "hydrochlorothiazide 12.5 MG / lisinopril 10 MG Oral Tablet [Zestoretic]"}
                },
                {"name": "source",
                    "valueString": "https://api.careevolutionapi.com/terminology/v1/fhir/r4/ConceptMap/RxNorm"}
            ]
        },
        {"name": "result",
            "valueBoolean": true
        },
        {"name": "Rosetta.ApiVersion",
            "valueString": "20210527.4-master"
        },
        {"name": "Rosetta.TermsVersion",
            "valueString": "20210526.1-master"
...
}

The other responses are summarized below:

Parameters
code=

system=
Responses/Matches
concept.code

concept.display
HBNEHJDJ5 Zestoretic 10/12.5 tabs North Plains EMR 823986 hydrochlorothiazide 12.5 MG / lisinopril 10 MG Oral Tablet [Zestoretic]
HJDBN8382 metformin North Plains EMR 6809 metformin
HBNEHJDJ zoloft North Plains EMR 82728 Zoloft
0591-0406-01 CVS CareMark NDC 311354 lisinopril 5 MG Oral Tablet
HH4B84742 hydrocortisone cream Patient Reported 5492 hydrocortisone
29046 hctz lisinopril East Side HIE 214618 hydrochlorothiazide / lisinopril
312938 sertraline oral tablet East Side HIE 373868 sertraline Oral Tablet

Grouping into a Medication List

Many clinical use cases require a single med list summarized by medication irrespective of different brands, formulations, and dosages. To create a single med list from RxNorm codes, group meds by generic ingredient.

  1. POST to the $classify operation with Parameters Resource where scope=RxNorm – Ingredient and system=http://www.nlm.nih.gov/research/umls/rxnorm for the RxNorm code for each medication
  2. Medications can then be grouped by ingredient (the resulting ValueSet names).

For example, the following is the body for a POST to the $classify operation:

{"resourceType": "Parameters",
    "parameter": [
        {   "name": "system",
            "valueString": "http://www.nlm.nih.gov/research/umls/rxnorm"},
        {   "name": "scope",
            "valueString": "RxNorm - Ingredient"},
        {   "name": "code",
            "valueString": "823986"},
        {   "name": "code",
            "valueString": "6809"},
        {   "name": "code",
            "valueString": "82728"},
        {   "name": "code",
            "valueString": "311354"},
        {   "name": "code",
            "valueString": "5492"},
        {   "name": "code",
            "valueString": "214618"},
        {   "name": "code",
            "valueString": "373868"}
    ] 
}

Example response:

{"resourceType": "Parameters",
    "parameter": [
        {"name": "item",
            "part": [
                {"name": "code",
                    "valueString": "823986"
                },
                {"name": "classification",
                    "part": [
                        {"name": "scope",
                            "valueString": "RxNorm - Ingredient"
                        },
                        {"name": "name",
                            "valueString": "hydrochlorothiazide"}
...
}

The other responses are summarized below:

Parameters
code=
Responses/Matches
Ingredient name
823986 hydrochlorothiazide
lisinopril
6809 metformin
82728 sertraline
311354 lisinopril
5492 hydrocortisone
214618 hydrochlorothiazide
lisinopril
373868 sertraline

Identifying Brand Names

Often users want to identify whether a medication is branded or generic, and if branded which brand name. The $classify operation can be used for this purpose.

  1. POST to the $classify operation with Parameters Resource where scope=RxNorm – Brands and system=http://www.nlm.nih.gov/research/umls/rxnorm for the RxNorm code for each medication
  2. If an RxNorm code is for a generic medication, that code will not be included in the results
  3. If an RxNorm code is for a branded medication, it will be included in the ValueSet Resource where the ValueSet name is the medication’s brand name.

Example response:

{"resourceType": "Parameters",
    "parameter": [
        {   "name": "item",
            "part": [
                {   "name": "code",
                    "valueString": "823986"},
                {   "name": "classification",
                    "part": [
                        {   "name": "scope",
                            "valueString": "RxNorm - Brands"
                        },
                        {   "name": "name",
                            "valueString": "AllBrandedDrugs"}  ]   },
                {   "name": "classification",
                    "part": [
                        {   "name": "scope",
                            "valueString": "RxNorm - Brands"
                        },
                            {
                            "name": "name",
                            "valueString": "Zestoretic"} 
...
}

The other responses are summarized below:

Parameters
code=

system=
Responses/Matches
concept.code

concept.display
HBNEHJDJ5 Zestoretic 10/12.5 tabs North Plains EMR 823986 hydrochlorothiazide 12.5 MG / lisinopril 10 MG Oral Tablet [Zestoretic]
HJDBN8382 metformin North Plains EMR 6809 metformin
HBNEHJDJ zoloft North Plains EMR 82728 Zoloft
0591-0406-01 CVS CareMark NDC 311354 lisinopril 5 MG Oral Tablet
HH4B84742 hydrocortisone cream Patient Reported 5492 hydrocortisone
29046 hctz lisinopril East Side HIE 214618 hydrochlorothiazide / lisinopril
312938 sertraline oral tablet East Side HIE 373868 sertraline Oral Tablet

For example, here 4 medications have been grouped into ‘Amoxicillin, Clavulanate (Augmentin)’. The grouping was found using /ValueSet/$classify with scope=RxNorm - Multi Ingredient, system=http://www.nlm.nih.gov/research/umls/rxnorm and code= 1152875 and 562508

Note that Augmentin is the brand name of the medication, shown here in parentheses to indicate that the branded version was filled.