Skip to content

Detect Medical Entities in Text v1.0.0

Inspects text for medical entities and returns information about them. Refers to Named entity recognition (NER).

How can I use the Step?

The Step lets you analyze the context of unstructured text and find information about potential medical conditions, drugs used in patient treatment, protected health information (PHI), and more. You can use Step in various medical-related scenarios, such as conducting clinical trials, collecting medical data, or enforcing specific policies.

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 detected entities, listing them in descending order according to the confidence scores. These scores indicate how accurately found entities match the specific medical concepts. To learn more, review Entity categories and Output and exit behavior.

Input settings

To set up the section, take the following steps:

  1. In the Input text field, provide text to analyze. You can enter text manually or use the Merge fields here.
  2. In the Entity categories list, choose the medical entity categories you want to find in the text.

Input text

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

Entity categories

This Step detects entities in the following categories:

Each entity category has its types, attributes, and traits, that provide additional information related to found medical entities to help you manage the particular task.

Anatomy category

The anatomy category includes references to the parts of the body or body systems and the locations of those parts or systems.

Types

  • systemOrganSite: Body systems, anatomic locations or regions, and body sites.

Attributes

  • direction: Directional terms. For example, left, right medial, lateral, upper, lower, posterior, anterior, distal, proximal, contralateral, bilateral, ipsilateral, dorsal, ventral, and so on.

Medical condition category

The medicalCondition category includes entities related to a health condition, such as pain, nausea, fever, anorexia, or chills.

Types

  • dxName: All medical conditions listed. The dxName type includes present illness, reason for visit, and medical history.

Attributes

  • acuity: Determination of disease instance, such as chronic, acute, sudden, persistent, or gradual.
  • direction: Directional terms. For example, left, right medial, lateral, upper, lower, posterior, anterior, distal, proximal, contralateral, bilateral, ipsilateral, dorsal, or ventral.
  • systemOrganSite: anatomical location.

Traits

  • diagnosis: A medical condition that is determined as the cause or result of the symptoms. Symptoms can be found through physical findings, laboratory or radiological reports, or any other means. Applies only to the dxName type.
  • negation: An indication that a result or action is negative or not being performed.
  • sign: A medical condition that the physician reported. Applies only to the dxName type.
  • symptom: A medical condition reported by the patient. Applies only to the dxName type.

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.

Protected health information category

The protectedHealthInformation category includes references to personally identifiable information associated with the health data content.

Types

  • address: All geographical subdivisions of an address of any facility, units, or wards within a facility.
  • age: All age components, spans of age, or any age mentioned. This includes those of a patient, family members, or others. The default is years unless otherwise noted.
  • email: Any email address.
  • id: Social security number, medical record number, facility identification number, clinical trial number, certificate or license number, vehicle or device number, the place of care, or provider. This also includes any biometric number of the patient, such as height, weight, or a lab value.
  • name: All names. Typically, the names of the patient, family, or provider.
  • phoneOrFax: Any phone, fax, or pager number. Excludes named phone numbers, such as 1-800-QUIT-NOW and 911.
  • profession: Any profession or employer that pertains to the patient or the patient's family. It does not include the profession of the clinician mentioned in the note.

Test, treatment, and procedure category

The testTreatmentProcedure category includes the procedures used to determine a medical condition.

Types

  • procedureName: Interventions as a one-time action performed on the patient to treat a medical condition or to provide patient care.
  • testName: Procedures performed on a patient for diagnostic, measurement, screening, or rating that might have a resulting value. This includes any procedure, process, evaluation, or rating to determine a diagnosis, rule out or find a condition, or scale or score a patient.
  • treatmentName: Interventions performed over a span of time for combating a disease or disorder. This includes groupings of medications, such as antivirals and vaccinations.

Attributes

  • testValue: The result of a test. Applies only to the testName entity type.
  • testUnit: The unit of measure that might accompany the value of the test. Applies only to the testName entity type.

Time expression category

The timeExpression category includes entities related to the dates and time expressions, such as three days ago, today, currently, day of admission, last month, or 16 days.

Types

  • timeToMedicationName: The date medication was taken. The attributes specific to this type are brandName and genericName.
  • timeToDxName: The date a medical condition occurred. The attribute for this type is dxName.
  • timeToTestName: The date a test was performed. The attribute for this type is testName.
  • timeToProcedureName: The date a procedure was performed. The attribute for this type is procedureName.
  • timeToTreatmentName: The date treatment was administered. The attribute for this type is treatmentName.

Relationship Type

The relationship between an entity and an attribute. The recognized relationshipType is: overlap – The timeExpression concurs with the entity detected.

Output and exit behavior

To set up this section, take the following steps:

  1. For Output data options, select the appropriate options to configure the output structure. By default, the Step returns entities in the order found in the text.
  2. In Output data structure, ensure the output structure suits your application.

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 more.

For example, using the input text, "The patient has abdominal pain," with the default settings, the Step returns the following JSON object:

json
{
    "count": 2,
    "byOrder": [
        {
            "id": 1,
            "beginOffset": 16,
            "endOffset": 25,
            "score": 0.9999871253967285,
            "text": "abdominal",
            "category": "anatomy",
            "type": "systemOrganSite",
            "traits": []
        },
        {
            "id": 2,
            "beginOffset": 26,
            "endOffset": 30,
            "score": 0.9733281135559082,
            "text": "pain",
            "category": "medicalCondition",
            "type": "dxName",
            "traits": [
                {
                    "name": "symptom",
                    "score": 0.9228644371032715
                },
                {
                    "name": "negation",
                    "score": 0.5425124168395996
                }
            ],
            "attributes": [
                {
                    "type": "systemOrganSite",
                    "score": 0.9999871253967285,
                    "relationshipScore": 0.9767445921897888,
                    "relationshipType": "systemOrganSite",
                    "id": 1,
                    "beginOffset": 16,
                    "endOffset": 25,
                    "text": "abdominal",
                    "category": "anatomy",
                    "traits": []
                }
            ]
        }
    ]
}
{
    "count": 2,
    "byOrder": [
        {
            "id": 1,
            "beginOffset": 16,
            "endOffset": 25,
            "score": 0.9999871253967285,
            "text": "abdominal",
            "category": "anatomy",
            "type": "systemOrganSite",
            "traits": []
        },
        {
            "id": 2,
            "beginOffset": 26,
            "endOffset": 30,
            "score": 0.9733281135559082,
            "text": "pain",
            "category": "medicalCondition",
            "type": "dxName",
            "traits": [
                {
                    "name": "symptom",
                    "score": 0.9228644371032715
                },
                {
                    "name": "negation",
                    "score": 0.5425124168395996
                }
            ],
            "attributes": [
                {
                    "type": "systemOrganSite",
                    "score": 0.9999871253967285,
                    "relationshipScore": 0.9767445921897888,
                    "relationshipType": "systemOrganSite",
                    "id": 1,
                    "beginOffset": 16,
                    "endOffset": 25,
                    "text": "abdominal",
                    "category": "anatomy",
                    "traits": []
                }
            ]
        }
    ]
}

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