Skip to content

Extract Medication Entities from Text (RxNorm) v1.0.0 Help

Detects medications as entities and links them to concept identifiers (RxCUI) from the RxNorm database from the National Library of Medicine. Refers to Named entity recognition (NER).

How can I use the Step?

The Step lets you find medications in unstructured clinical text such as physician's notes, prescriptions, and patient records. You can use the Step to screen for uses, indications, and side effects of drugs; check the dosage and frequency of medicine; extract drug information from clinical trials; and more.

Warning: This Step is not a substitute for professional medical advice, diagnosis, or treatment. In any medical scenario, review and validate results before use.

How does the Step work?

The Step returns the matching RxCUI code and descriptions for each detected medication, listing them in descending order according to the confidence scores. These scores indicate confidence in the accuracy of the entities matched to the RxNorm concepts. To learn more, review Entity categories and Output example.

Input settings

  • To set up this section, provide the text to analyze in the Input text field. You can enter text manually or use the Merge fields here.

Input text

The input text must be a UTF-8 string. The string must contain at least one character. The maximum string size is 10 KB. English is the only valid language.

Entity categories

This Step detects entities in the Medical condition category. The category has its types, attributes, and traits, that provide additional information related to found entities to help you manage the particular task.

Medication category

The medication category includes medication and dosage information for the patient.

Types

  • brandName: The copyrighted brand name of the medication or therapeutic agent.
  • genericName: The non-brand name, ingredient name, or formula mixture of the medication or therapeutic agent.

Attributes

  • dosage: The amount of medication ordered.
  • duration: How long the medication should be administered.
  • form: The form of the medication.
  • frequency: How often to administer the medication.
  • rate: The administration rate of the medication (Primarily for medication infusions or IVs).
  • routeOrMode: The administration method of medication.
  • strength: The medication's strength.

Traits

  • negation: Any indication that the patient is not taking medication.

Merge field settings

The Step returns the result as a JSON object and stores it in the Merge field variable. Thus you can access the output JSON object from any point of your Flow.

Output example

The Step's output contains information about each entity detected, including its category, type, score, attributes, traits, and RxNorm concepts.

For example, using the input text "fluoride topical ( fluoride 1.1 % topical gel ) 1 application Topically daily Brush onto teeth before bedtime, spit, do not rinse, eat or drink for 20-30 minutes," the Step returns the following entity:

json
{
  ...
  "entities": [
    {
      "id": 0,
      "text": "fluoride",
      "category": "medication",
      "type": "genericName",
      "score": 0.9765048027038574,
      "beginOffset": 19,
      "endOffset": 27,
      "attributes": [],
      "traits": [],
      "rxNormConcepts": [
        {
          "description": "fluorine",
          "code": "1310123",
          "score": 0.9384168982505798
        },
        {
          "description": "sodium fluoride",
          "code": "9873",
          "score": 0.9174549579620361
        },
        {
          "description": "magnesium fluoride",
          "code": "1435860",
          "score": 0.8124921917915344
        },
        {
          "description": "sulfuryl fluoride",
          "code": "2289224",
          "score": 0.5632417798042297
        },
        {
          "description": "acidulated phosphate fluoride",
          "code": "236",
          "score": 0.41748538613319397
        }
      ]
    }
  ]
}
{
  ...
  "entities": [
    {
      "id": 0,
      "text": "fluoride",
      "category": "medication",
      "type": "genericName",
      "score": 0.9765048027038574,
      "beginOffset": 19,
      "endOffset": 27,
      "attributes": [],
      "traits": [],
      "rxNormConcepts": [
        {
          "description": "fluorine",
          "code": "1310123",
          "score": 0.9384168982505798
        },
        {
          "description": "sodium fluoride",
          "code": "9873",
          "score": 0.9174549579620361
        },
        {
          "description": "magnesium fluoride",
          "code": "1435860",
          "score": 0.8124921917915344
        },
        {
          "description": "sulfuryl fluoride",
          "code": "2289224",
          "score": 0.5632417798042297
        },
        {
          "description": "acidulated phosphate fluoride",
          "code": "236",
          "score": 0.41748538613319397
        }
      ]
    }
  ]
}

Error Handling

By default, the Step handles errors using a separate exit. So if any error occurs during the Step execution, the Flow proceeds down the error exit.

Note: If you disable the Handle error toggle, the Step does not handle errors. With this setup, if any error occurs during the Step execution, the Flow fails immediately after exceeding the Flow's timeout. To prevent the Flow from being suspended while continuing to handle errors in the Flow, place the Flow Error Handling Step before the main Flow logic.

Reporting

The Step reports once after its execution. You can change the Step log level and add new tags in the section.

Log level

By default, the Step inherits its log level from Flow's log level. You can change the Step's log level by selecting an appropriate option from the Log level list.

Tags

Tags help organize and filter session information when generating reports. You can specify the tag category, label, and value when adding a new tag.

Service dependencies

  • flow builder - v2.28.3
  • event-manager - v2.3.0
  • deployer - v2.6.0
  • comprehend medical provider - v1.0.0

Release notes

v1.0.0

  • Initial release