Detect entities - Amazon Comprehend Medical

Detect entities

Note

Do not use this version of the DetectEntities operation for new applications. Use version 2 of the operation instead. All new iterations and enhancements of features will be specific to DetectEntitiesV2. For more information, see Detect entities (Version 2).

Use the DetectEntities operation to detect the medical entities in your text. It detects entities in the following categories:

  • ANATOMY

  • MEDICAL_CONDITION

  • MEDICATION

  • PROTECTED_HEALTH_INFORMATION

  • TEST_TREATMENT_PROCEDURE

All five categories are detected by the DetectEntities operation. The DetectPHI operation detects entities only in the PROTECTED_HEALTH_INFORMATION category. Use it only when protected health information (PHI) is required. For information about this operation, see Detect PHI .

Amazon Comprehend Medical detects information in the following classes:

  • Entity: A textual reference to the name of relevant objects, such as people, treatments, medications, and medical conditions. For example, "Ibuprofen."

  • Category: The generalized grouping to which a detected entity belongs. For example, "Ibuprofen" is part of the MEDICATION category.

  • Type: The type of entity detected, which is scoped to a category. For example, "Ibuprofen" is in the GENERIC_NAME type in the MEDICATION category.

  • Attribute: Information related to a detected entity, such as the dosage of a medication. For example, "200 mg" is an attribute of the "Ibuprofen" entity.

  • Trait: Something that Amazon Comprehend Medical understands about an entity, based on context. For example, a medication has the NEGATION trait if a patient is not taking it.

Amazon Comprehend Medical provides you the location of an entity in the input text. In the Amazon Comprehend console, it shows you the location graphically. When you use the API, it shows you the location by numerical offset.

Each entity and attribute includes a score that indicates the level of confidence that Amazon Comprehend Medical has in the accuracy of the detection. Each attribute also has a relationship score. This score indicates the level of confidence Amazon Comprehend Medical has in the accuracy of the relationship between the attribute and its parent entity. Identify the right confidence threshold for your use case. Use high confidence thresholds in situations that require great accuracy, and filter out data that doesn't meet your thresholds.

Anatomy category

The ANATOMY category detects references to the parts of the body or body systems and the locations of those parts or systems. It contains the following two entity types.

Types

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

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

Example

The text "Patient's left lung" returns the following:

  • "left" is a DIRECTION type.

  • "lung" is a SYSTEM_ORGAN_SITE type.

The DetectEntities operation returns the following JSON structure:

{ "Entities": [ { "Id": 0, "BeginOffset": 10, "EndOffset": 14, "Score": 0.9876197576522827, "Text": "left", "Category": "ANATOMY", "Type": "DIRECTION", "Traits": [] }, { "Id": 1, "BeginOffset": 15, "EndOffset": 19, "Score": 0.9820258021354675, "Text": "lung", "Category": "ANATOMY", "Type": "SYSTEM_ORGAN_SITE", "Traits": [] } ], "UnmappedAttributes": [] }

Medical condition category

The MEDICAL_CONDITION category detects the symptoms and diagnoses of medical conditions. It contains two entity types and seven traits. One or more traits can be associated with a type.

Types

  • ACUITY: Determination of disease instance, such as chronic, acute, sudden, persistent, or gradual.

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

Attribute

  • QUALITY: Any descriptive term of the medical condition, such as stage or grade.

Traits

  • DIAGNOSIS: An identification of a medical condition that is determined by evaluation of the symptoms. This evaluation comes from physical findings, laboratory or radiological reports, or the patient narrative. Applies only to the DX_NAME type.

  • HYPOTHETICAL: An indication that a medical condition is expressed as a hypothesis. Applies only to the DX_NAME type.

  • LOW_CONFIDENCE: An indication that a medical condition is expressed as having high uncertainty. This is not directly related to the confidence scores provided. Applies only to the DX_NAME type.

  • NEGATION: An indication that a result or action is negative or not being performed.

  • PERTAINS_TO_FAMILY: An indication that a medical condition is relevant to the patient’s family, not the patient. Applies only to the DX_NAME type.

  • SIGN: A medical condition that the physician reported. Applies only to the DX_NAME type.

  • SYMPTOM: A medical condition that the patient reported. Applies only to the DX_NAME type.

Example

The text "Patient is suffering from chronic aching pain 4/10" returns the following:

  • "aching pain" is the DX_NAME type.

  • SYMPTOM is a trait of the "aching pain" type.

  • "chronic" is the ACUITY type.

The DetectEntities operation returns the following JSON structure:

{ "Entities": [ { "Id": 0, "BeginOffset": 26, "EndOffset": 33, "Score": 0.9961825013160706, "Text": "chronic", "Category": "MEDICAL_CONDITION", "Type": "ACUITY", "Traits": [] }, { "Id": 1, "BeginOffset": 34, "EndOffset": 45, "Score": 0.8380221724510193, "Text": "aching pain", "Category": "MEDICAL_CONDITION", "Type": "DX_NAME", "Traits": [ { "Name": "SYMPTOM", "Score": 0.6004688739776611 } ] } ], "UnmappedAttributes": [] }

Medication category

The MEDICATION category detects medication and dosage information for the patient. It contains two entity types, seven attributes, and one trait. One or more attributes can apply to a type.

Types

  • BRAND_NAME: The copyrighted brand name of the medication or therapeutic agent.

  • GENERIC_NAME: 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 used for medication infusions or IVs).

  • ROUTE_OR_MODE: The administration method of the medication.

  • STRENGTH: The medication strength.

Traits

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

  • PAST_HISTORY: An indication that a medication detected is from the patient’s past (prior to current encounter).

Example

The text "Infuse Sodium Chloride 0.9% solution 1000 mL intravenously daily Rate - 200 mL/hr for next 3 days" returns the following:

  • "Infuse" as a "ROUTE_OR_MODE" attribute related to the "Sodium Chloride" type.

  • "Sodium Chloride" as a GENERIC_NAME type.

  • "0.9%" as a STRENGTH attribute related to the "Sodium Chloride" type.

  • "solution" as a FORM attribute related to the "Sodium Chloride" type.

  • "100 mL as a DOSAGE attribute related to the "Sodium Chloride" type.

  • "intravenously" as a ROUTE_OR_MODE attribute related to the "Sodium Chloride" type.

  • "daily" as a FREQUENCY attribute related to the "Sodium Chloride" type.

  • "200 ml/hr" as a RATE attribute related to the "Sodium Chloride" type.

  • "next 3 days" as a DURATION attribute related to the "Sodium Chloride" type.

The DetectEntities operation returns the following JSON structure:

{ "Entities": [ { "Id": 1, "BeginOffset": 7, "EndOffset": 22, "Score": 0.9998517036437988, "Text": "Sodium Chloride", "Category": "MEDICATION", "Type": "GENERIC_NAME", "Traits": [], "Attributes": [ { "Type": "ROUTE_OR_MODE", "Score": 0.32359644770622253, "RelationshipScore": 0.9719992280006409, "Id": 0, "BeginOffset": 0, "EndOffset": 6, "Text": "Infuse", "Traits": [] }, { "Type": "STRENGTH", "Score": 0.9976715445518494, "RelationshipScore": 0.7892051339149475, "Id": 2, "BeginOffset": 23, "EndOffset": 27, "Text": "0.9%", "Traits": [] }, { "Type": "FORM", "Score": 0.9930835962295532, "RelationshipScore": 0.9956902861595154, "Id": 3, "BeginOffset": 28, "EndOffset": 36, "Text": "solution", "Traits": [] }, { "Type": "ROUTE_OR_MODE", "Score": 0.9990690350532532, "RelationshipScore": 0.9801701903343201, "Id": 5, "BeginOffset": 45, "EndOffset": 58, "Text": "intravenously", "Traits": [] }, { "Type": "FREQUENCY", "Score": 0.9539222121238708, "RelationshipScore": 0.9864235520362854, "Id": 6, "BeginOffset": 59, "EndOffset": 64, "Text": "daily", "Traits": [] }, { "Type": "DURATION", "Score": 0.9392423033714294, "RelationshipScore": 0.9961885809898376, "Id": 8, "BeginOffset": 91, "EndOffset": 97, "Text": "3 days", "Traits": [] } ] } ], "UnmappedAttributes": [ { "Type": "MEDICATION", "Attribute": { "Type": "DOSAGE", "Score": 0.9922149777412415, "Id": 4, "BeginOffset": 37, "EndOffset": 44, "Text": "1000 mL", "Traits": [] } }, { "Type": "MEDICATION", "Attribute": { "Type": "RATE", "Score": 0.9728594422340393, "Id": 7, "BeginOffset": 72, "EndOffset": 81, "Text": "200 mL/hr", "Traits": [] } } ] }

Protected Health Information category

The PROTECTED_HEALTH_INFORMATION category detects the patient's personal information. It contains eight entity types. For complete information about the PROTECTED_HEALTH_INFORMATION category and how it is detected, see Detect PHI .

Types

  • ADDRESS: All geographical subdivisions of an address of any facility, named medical facilities, or wards within a facility.

  • AGE: All components of age, spans of age, or any age mentioned in the clinical note of a patient or others. The default is in years unless otherwise noted.

  • EMAIL: Any email address.

  • ID: Any identification numbers that are associated with the patient. This includes patient specific numbers such as Social Security number, medical record number, certificate or license number, vehicle or device number, or any biometric numbers. It also includes the facility identification number, clinical trial number, place of care, or provider.

  • DATE: Any date related to the patient or patient care.

  • NAME: All names mentioned in the clinical note. Typically, names belonging to the patient, family, or provider.

  • PHONE_OR_FAX: Any phone, fax, or pager number. Excludes named phone numbers, such as 1-800-QUIT-NOW and 911.

  • PROFESSION: Any profession or employer mentioned in the clinical note that pertains to the patient or the patient's family. This does not refer to the profession of the clinician mentioned in the note.

Example

The text "Patient is John Smith, a 48-year old teacher and resident of Seattle, Washington." returns the following:

  • "John Smith" is a NAME type.

  • "48" is an AGE type.

  • "teacher" is a PROFESSION type.

  • "Seattle, Washington" is an ADDRESS type.

The DetectEntities operation returns the following JSON structure:

{ "Entities": [ { "Id": 0, "BeginOffset": 11, "EndOffset": 21, "Score": 0.9967977404594421, "Text": "John Smith", "Category": "PROTECTED_HEALTH_INFORMATION", "Type": "NAME", "Traits": [] }, { "Id": 1, "BeginOffset": 25, "EndOffset": 27, "Score": 0.9998422861099243, "Text": "48", "Category": "PROTECTED_HEALTH_INFORMATION", "Type": "AGE", "Traits": [] }, { "Id": 2, "BeginOffset": 37, "EndOffset": 44, "Score": 0.9079490900039673, "Text": "teacher", "Category": "PROTECTED_HEALTH_INFORMATION", "Type": "PROFESSION", "Traits": [] }, { "Id": 3, "BeginOffset": 61, "EndOffset": 80, "Score": 0.986108124256134, "Text": "Seattle, Washington", "Category": "PROTECTED_HEALTH_INFORMATION", "Type": "ADDRESS", "Traits": [] } ], "UnmappedAttributes": [] }

Test, treatment, and procedure category

The TEST_TREATMENT_PROCEDURE category detects the procedures used to determine a medical condition. It contains two entity types and two attributes. One or more attributes can be related to an entity of the TEST_NAME type.

Types

  • PROCEDURE_NAME: Interventions as a one-time action performed on the patient to treat a medical condition or to provide patient care.

  • TEST_NAME: Procedures performed on a patient for diagnostic, measurement, screening, or rating that might have a resulting value. This includes any procedure, evaluation, or rating to determine a diagnosis, to rule out a condition, or to scale or score a patient.

  • TREATMENT_NAME: Interventions performed over a span of time for combating a disease or disorder. This includes groupings of medications, such as antivirals and vaccinations.

Attributes

  • TEST_VALUE: The result of a test. Applies only to the TEST_NAME entity type.

  • TEST_UNIT: The unit of measure that might accompany the value of the test. Applies only to the TEST_NAME entity type.

Traits

  • FUTURE: An indication that a test, treatment, or procedure refers to an action or event that will occur after the subject of the notes.

  • HYPOTHETICAL: An indication that a test, treatment, or procedure is expressed as a hypothesis

  • NEGATION: An indication that a test, treatment, or procedure is negative or not being performed.

  • PAST_HISTORY: An indication that a test, treatment, or procedure is from the patient’s past (prior to the current encounter).

Example

The text Abdominal ultrasound noted acute appendicitis, recommend appendectomy followed by several series of broad spectrum antibiotics returns the following:

  • "Abdominal ultrasound" is a TEST_NAME type.

  • "acute" is an ACUITY type.

  • "appendicitis" is a DX_NAME type.

  • DIAGNOSIS is a trait of the "appendicitis" type.

  • "appendectomy" is a PROCEDURE_NAME type.

  • "broad spectrum antibiotics" is a TREATMENT_NAME type.

The DetectEntities operation returns the following JSON structure:

{ "Entities": [ { "Id": 0, "BeginOffset": 0, "EndOffset": 20, "Score": 0.94855135679245, "Text": "Abdominal ultrasound", "Category": "TEST_TREATMENT_PROCEDURE", "Type": "TEST_NAME", "Traits": [] }, { "Id": 3, "BeginOffset": 27, "EndOffset": 32, "Score": 0.9067845940589905, "Text": "acute", "Category": "MEDICAL_CONDITION", "Type": "ACUITY", "Traits": [] }, { "Id": 4, "BeginOffset": 33, "EndOffset": 45, "Score": 0.9954161643981934, "Text": "appendicitis", "Category": "MEDICAL_CONDITION", "Type": "DX_NAME", "Traits": [ { "Name": "DIAGNOSIS", "Score": 0.9528769254684448 } ] }, { "Id": 1, "BeginOffset": 57, "EndOffset": 69, "Score": 0.9957893490791321, "Text": "appendectomy", "Category": "TEST_TREATMENT_PROCEDURE", "Type": "PROCEDURE_NAME", "Traits": [] }, { "Id": 2, "BeginOffset": 100, "EndOffset": 126, "Score": 0.9437107443809509, "Text": "broad spectrum antibiotics", "Category": "TEST_TREATMENT_PROCEDURE", "Type": "TREATMENT_NAME", "Traits": [] } ], "UnmappedAttributes": [] }