AWS Comprehend Medical

2023/06/08 - AWS Comprehend Medical - 6 updated api methods

Changes  This release supports a new set of entities and traits.

DetectEntities (updated) Link ¶
Changes (response)
{'Entities': {'Attributes': {'RelationshipType': {'USAGE', 'QUALITY'}}},
 'UnmappedAttributes': {'Attribute': {'RelationshipType': {'QUALITY',
                                                           'USAGE'}}}}

The DetectEntities operation is deprecated. You should use the DetectEntitiesV2 operation instead.

Inspects the clinical text for a variety of medical entities and returns specific information about them such as entity category, location, and confidence score on that information .

!DANGER!

This operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity.

See also: AWS API Documentation

Request Syntax

client.detect_entities(
    Text='string'
)
type Text

string

param Text

[REQUIRED]

A UTF-8 text string containing the clinical content being examined for entities. Each string must contain fewer than 20,000 bytes of characters.

rtype

dict

returns

Response Syntax

{
    'Entities': [
        {
            'Id': 123,
            'BeginOffset': 123,
            'EndOffset': 123,
            'Score': ...,
            'Text': 'string',
            'Category': 'MEDICATION'|'MEDICAL_CONDITION'|'PROTECTED_HEALTH_INFORMATION'|'TEST_TREATMENT_PROCEDURE'|'ANATOMY'|'TIME_EXPRESSION'|'BEHAVIORAL_ENVIRONMENTAL_SOCIAL',
            'Type': 'NAME'|'DX_NAME'|'DOSAGE'|'ROUTE_OR_MODE'|'FORM'|'FREQUENCY'|'DURATION'|'GENERIC_NAME'|'BRAND_NAME'|'STRENGTH'|'RATE'|'ACUITY'|'TEST_NAME'|'TEST_VALUE'|'TEST_UNITS'|'TEST_UNIT'|'PROCEDURE_NAME'|'TREATMENT_NAME'|'DATE'|'AGE'|'CONTACT_POINT'|'PHONE_OR_FAX'|'EMAIL'|'IDENTIFIER'|'ID'|'URL'|'ADDRESS'|'PROFESSION'|'SYSTEM_ORGAN_SITE'|'DIRECTION'|'QUALITY'|'QUANTITY'|'TIME_EXPRESSION'|'TIME_TO_MEDICATION_NAME'|'TIME_TO_DX_NAME'|'TIME_TO_TEST_NAME'|'TIME_TO_PROCEDURE_NAME'|'TIME_TO_TREATMENT_NAME'|'AMOUNT'|'GENDER'|'RACE_ETHNICITY'|'ALLERGIES'|'TOBACCO_USE'|'ALCOHOL_CONSUMPTION'|'REC_DRUG_USE',
            'Traits': [
                {
                    'Name': 'SIGN'|'SYMPTOM'|'DIAGNOSIS'|'NEGATION'|'PERTAINS_TO_FAMILY'|'HYPOTHETICAL'|'LOW_CONFIDENCE'|'PAST_HISTORY'|'FUTURE',
                    'Score': ...
                },
            ],
            'Attributes': [
                {
                    'Type': 'NAME'|'DX_NAME'|'DOSAGE'|'ROUTE_OR_MODE'|'FORM'|'FREQUENCY'|'DURATION'|'GENERIC_NAME'|'BRAND_NAME'|'STRENGTH'|'RATE'|'ACUITY'|'TEST_NAME'|'TEST_VALUE'|'TEST_UNITS'|'TEST_UNIT'|'PROCEDURE_NAME'|'TREATMENT_NAME'|'DATE'|'AGE'|'CONTACT_POINT'|'PHONE_OR_FAX'|'EMAIL'|'IDENTIFIER'|'ID'|'URL'|'ADDRESS'|'PROFESSION'|'SYSTEM_ORGAN_SITE'|'DIRECTION'|'QUALITY'|'QUANTITY'|'TIME_EXPRESSION'|'TIME_TO_MEDICATION_NAME'|'TIME_TO_DX_NAME'|'TIME_TO_TEST_NAME'|'TIME_TO_PROCEDURE_NAME'|'TIME_TO_TREATMENT_NAME'|'AMOUNT'|'GENDER'|'RACE_ETHNICITY'|'ALLERGIES'|'TOBACCO_USE'|'ALCOHOL_CONSUMPTION'|'REC_DRUG_USE',
                    'Score': ...,
                    'RelationshipScore': ...,
                    'RelationshipType': 'EVERY'|'WITH_DOSAGE'|'ADMINISTERED_VIA'|'FOR'|'NEGATIVE'|'OVERLAP'|'DOSAGE'|'ROUTE_OR_MODE'|'FORM'|'FREQUENCY'|'DURATION'|'STRENGTH'|'RATE'|'ACUITY'|'TEST_VALUE'|'TEST_UNITS'|'TEST_UNIT'|'DIRECTION'|'SYSTEM_ORGAN_SITE'|'AMOUNT'|'USAGE'|'QUALITY',
                    'Id': 123,
                    'BeginOffset': 123,
                    'EndOffset': 123,
                    'Text': 'string',
                    'Category': 'MEDICATION'|'MEDICAL_CONDITION'|'PROTECTED_HEALTH_INFORMATION'|'TEST_TREATMENT_PROCEDURE'|'ANATOMY'|'TIME_EXPRESSION'|'BEHAVIORAL_ENVIRONMENTAL_SOCIAL',
                    'Traits': [
                        {
                            'Name': 'SIGN'|'SYMPTOM'|'DIAGNOSIS'|'NEGATION'|'PERTAINS_TO_FAMILY'|'HYPOTHETICAL'|'LOW_CONFIDENCE'|'PAST_HISTORY'|'FUTURE',
                            'Score': ...
                        },
                    ]
                },
            ]
        },
    ],
    'UnmappedAttributes': [
        {
            'Type': 'MEDICATION'|'MEDICAL_CONDITION'|'PROTECTED_HEALTH_INFORMATION'|'TEST_TREATMENT_PROCEDURE'|'ANATOMY'|'TIME_EXPRESSION'|'BEHAVIORAL_ENVIRONMENTAL_SOCIAL',
            'Attribute': {
                'Type': 'NAME'|'DX_NAME'|'DOSAGE'|'ROUTE_OR_MODE'|'FORM'|'FREQUENCY'|'DURATION'|'GENERIC_NAME'|'BRAND_NAME'|'STRENGTH'|'RATE'|'ACUITY'|'TEST_NAME'|'TEST_VALUE'|'TEST_UNITS'|'TEST_UNIT'|'PROCEDURE_NAME'|'TREATMENT_NAME'|'DATE'|'AGE'|'CONTACT_POINT'|'PHONE_OR_FAX'|'EMAIL'|'IDENTIFIER'|'ID'|'URL'|'ADDRESS'|'PROFESSION'|'SYSTEM_ORGAN_SITE'|'DIRECTION'|'QUALITY'|'QUANTITY'|'TIME_EXPRESSION'|'TIME_TO_MEDICATION_NAME'|'TIME_TO_DX_NAME'|'TIME_TO_TEST_NAME'|'TIME_TO_PROCEDURE_NAME'|'TIME_TO_TREATMENT_NAME'|'AMOUNT'|'GENDER'|'RACE_ETHNICITY'|'ALLERGIES'|'TOBACCO_USE'|'ALCOHOL_CONSUMPTION'|'REC_DRUG_USE',
                'Score': ...,
                'RelationshipScore': ...,
                'RelationshipType': 'EVERY'|'WITH_DOSAGE'|'ADMINISTERED_VIA'|'FOR'|'NEGATIVE'|'OVERLAP'|'DOSAGE'|'ROUTE_OR_MODE'|'FORM'|'FREQUENCY'|'DURATION'|'STRENGTH'|'RATE'|'ACUITY'|'TEST_VALUE'|'TEST_UNITS'|'TEST_UNIT'|'DIRECTION'|'SYSTEM_ORGAN_SITE'|'AMOUNT'|'USAGE'|'QUALITY',
                'Id': 123,
                'BeginOffset': 123,
                'EndOffset': 123,
                'Text': 'string',
                'Category': 'MEDICATION'|'MEDICAL_CONDITION'|'PROTECTED_HEALTH_INFORMATION'|'TEST_TREATMENT_PROCEDURE'|'ANATOMY'|'TIME_EXPRESSION'|'BEHAVIORAL_ENVIRONMENTAL_SOCIAL',
                'Traits': [
                    {
                        'Name': 'SIGN'|'SYMPTOM'|'DIAGNOSIS'|'NEGATION'|'PERTAINS_TO_FAMILY'|'HYPOTHETICAL'|'LOW_CONFIDENCE'|'PAST_HISTORY'|'FUTURE',
                        'Score': ...
                    },
                ]
            }
        },
    ],
    'PaginationToken': 'string',
    'ModelVersion': 'string'
}

Response Structure

  • (dict) --

    • Entities (list) --

      The collection of medical entities extracted from the input text and their associated information. For each entity, the response provides the entity text, the entity category, where the entity text begins and ends, and the level of confidence that Comprehend Medical; has in the detection and analysis. Attributes and traits of the entity are also returned.

      • (dict) --

        Provides information about an extracted medical entity.

        • Id (integer) --

          The numeric identifier for the entity. This is a monotonically increasing id unique within this response rather than a global unique identifier.

        • BeginOffset (integer) --

          The 0-based character offset in the input text that shows where the entity begins. The offset returns the UTF-8 code point in the string.

        • EndOffset (integer) --

          The 0-based character offset in the input text that shows where the entity ends. The offset returns the UTF-8 code point in the string.

        • Score (float) --

          The level of confidence that Comprehend Medical; has in the accuracy of the detection.

        • Text (string) --

          The segment of input text extracted as this entity.

        • Category (string) --

          The category of the entity.

        • Type (string) --

          Describes the specific type of entity with category of entities.

        • Traits (list) --

          Contextual information for the entity.

          • (dict) --

            Provides contextual information about the extracted entity.

            • Name (string) --

              Provides a name or contextual description about the trait.

            • Score (float) --

              The level of confidence that Comprehend Medical; has in the accuracy of this trait.

        • Attributes (list) --

          The extracted attributes that relate to this entity.

          • (dict) --

            An extracted segment of the text that is an attribute of an entity, or otherwise related to an entity, such as the dosage of a medication taken. It contains information about the attribute such as id, begin and end offset within the input text, and the segment of the input text.

            • Type (string) --

              The type of attribute.

            • Score (float) --

              The level of confidence that Comprehend Medical; has that the segment of text is correctly recognized as an attribute.

            • RelationshipScore (float) --

              The level of confidence that Comprehend Medical; has that this attribute is correctly related to this entity.

            • RelationshipType (string) --

              The type of relationship between the entity and attribute. Type for the relationship is OVERLAP , indicating that the entity occurred at the same time as the Date_Expression .

            • Id (integer) --

              The numeric identifier for this attribute. This is a monotonically increasing id unique within this response rather than a global unique identifier.

            • BeginOffset (integer) --

              The 0-based character offset in the input text that shows where the attribute begins. The offset returns the UTF-8 code point in the string.

            • EndOffset (integer) --

              The 0-based character offset in the input text that shows where the attribute ends. The offset returns the UTF-8 code point in the string.

            • Text (string) --

              The segment of input text extracted as this attribute.

            • Category (string) --

              The category of attribute.

            • Traits (list) --

              Contextual information for this attribute.

              • (dict) --

                Provides contextual information about the extracted entity.

                • Name (string) --

                  Provides a name or contextual description about the trait.

                • Score (float) --

                  The level of confidence that Comprehend Medical; has in the accuracy of this trait.

    • UnmappedAttributes (list) --

      Attributes extracted from the input text that we were unable to relate to an entity.

      • (dict) --

        An attribute that was extracted, but Comprehend Medical; was unable to relate to an entity.

        • Type (string) --

          The type of the unmapped attribute, could be one of the following values: "MEDICATION", "MEDICAL_CONDITION", "ANATOMY", "TEST_AND_TREATMENT_PROCEDURE" or "PROTECTED_HEALTH_INFORMATION".

        • Attribute (dict) --

          The specific attribute that has been extracted but not mapped to an entity.

          • Type (string) --

            The type of attribute.

          • Score (float) --

            The level of confidence that Comprehend Medical; has that the segment of text is correctly recognized as an attribute.

          • RelationshipScore (float) --

            The level of confidence that Comprehend Medical; has that this attribute is correctly related to this entity.

          • RelationshipType (string) --

            The type of relationship between the entity and attribute. Type for the relationship is OVERLAP , indicating that the entity occurred at the same time as the Date_Expression .

          • Id (integer) --

            The numeric identifier for this attribute. This is a monotonically increasing id unique within this response rather than a global unique identifier.

          • BeginOffset (integer) --

            The 0-based character offset in the input text that shows where the attribute begins. The offset returns the UTF-8 code point in the string.

          • EndOffset (integer) --

            The 0-based character offset in the input text that shows where the attribute ends. The offset returns the UTF-8 code point in the string.

          • Text (string) --

            The segment of input text extracted as this attribute.

          • Category (string) --

            The category of attribute.

          • Traits (list) --

            Contextual information for this attribute.

            • (dict) --

              Provides contextual information about the extracted entity.

              • Name (string) --

                Provides a name or contextual description about the trait.

              • Score (float) --

                The level of confidence that Comprehend Medical; has in the accuracy of this trait.

    • PaginationToken (string) --

      If the result of the previous request to DetectEntities was truncated, include the PaginationToken to fetch the next page of entities.

    • ModelVersion (string) --

      The version of the model used to analyze the documents. The version number looks like X.X.X. You can use this information to track the model used for a particular batch of documents.

DetectEntitiesV2 (updated) Link ¶
Changes (response)
{'Entities': {'Attributes': {'RelationshipType': {'USAGE', 'QUALITY'}}},
 'UnmappedAttributes': {'Attribute': {'RelationshipType': {'QUALITY',
                                                           'USAGE'}}}}

Inspects the clinical text for a variety of medical entities and returns specific information about them such as entity category, location, and confidence score on that information. Amazon Comprehend Medical only detects medical entities in English language texts.

The DetectEntitiesV2 operation replaces the DetectEntities operation. This new action uses a different model for determining the entities in your medical text and changes the way that some entities are returned in the output. You should use the DetectEntitiesV2 operation in all new applications.

The DetectEntitiesV2 operation returns the Acuity and Direction entities as attributes instead of types.

See also: AWS API Documentation

Request Syntax

client.detect_entities_v2(
    Text='string'
)
type Text

string

param Text

[REQUIRED]

A UTF-8 string containing the clinical content being examined for entities. Each string must contain fewer than 20,000 bytes of characters.

rtype

dict

returns

Response Syntax

{
    'Entities': [
        {
            'Id': 123,
            'BeginOffset': 123,
            'EndOffset': 123,
            'Score': ...,
            'Text': 'string',
            'Category': 'MEDICATION'|'MEDICAL_CONDITION'|'PROTECTED_HEALTH_INFORMATION'|'TEST_TREATMENT_PROCEDURE'|'ANATOMY'|'TIME_EXPRESSION'|'BEHAVIORAL_ENVIRONMENTAL_SOCIAL',
            'Type': 'NAME'|'DX_NAME'|'DOSAGE'|'ROUTE_OR_MODE'|'FORM'|'FREQUENCY'|'DURATION'|'GENERIC_NAME'|'BRAND_NAME'|'STRENGTH'|'RATE'|'ACUITY'|'TEST_NAME'|'TEST_VALUE'|'TEST_UNITS'|'TEST_UNIT'|'PROCEDURE_NAME'|'TREATMENT_NAME'|'DATE'|'AGE'|'CONTACT_POINT'|'PHONE_OR_FAX'|'EMAIL'|'IDENTIFIER'|'ID'|'URL'|'ADDRESS'|'PROFESSION'|'SYSTEM_ORGAN_SITE'|'DIRECTION'|'QUALITY'|'QUANTITY'|'TIME_EXPRESSION'|'TIME_TO_MEDICATION_NAME'|'TIME_TO_DX_NAME'|'TIME_TO_TEST_NAME'|'TIME_TO_PROCEDURE_NAME'|'TIME_TO_TREATMENT_NAME'|'AMOUNT'|'GENDER'|'RACE_ETHNICITY'|'ALLERGIES'|'TOBACCO_USE'|'ALCOHOL_CONSUMPTION'|'REC_DRUG_USE',
            'Traits': [
                {
                    'Name': 'SIGN'|'SYMPTOM'|'DIAGNOSIS'|'NEGATION'|'PERTAINS_TO_FAMILY'|'HYPOTHETICAL'|'LOW_CONFIDENCE'|'PAST_HISTORY'|'FUTURE',
                    'Score': ...
                },
            ],
            'Attributes': [
                {
                    'Type': 'NAME'|'DX_NAME'|'DOSAGE'|'ROUTE_OR_MODE'|'FORM'|'FREQUENCY'|'DURATION'|'GENERIC_NAME'|'BRAND_NAME'|'STRENGTH'|'RATE'|'ACUITY'|'TEST_NAME'|'TEST_VALUE'|'TEST_UNITS'|'TEST_UNIT'|'PROCEDURE_NAME'|'TREATMENT_NAME'|'DATE'|'AGE'|'CONTACT_POINT'|'PHONE_OR_FAX'|'EMAIL'|'IDENTIFIER'|'ID'|'URL'|'ADDRESS'|'PROFESSION'|'SYSTEM_ORGAN_SITE'|'DIRECTION'|'QUALITY'|'QUANTITY'|'TIME_EXPRESSION'|'TIME_TO_MEDICATION_NAME'|'TIME_TO_DX_NAME'|'TIME_TO_TEST_NAME'|'TIME_TO_PROCEDURE_NAME'|'TIME_TO_TREATMENT_NAME'|'AMOUNT'|'GENDER'|'RACE_ETHNICITY'|'ALLERGIES'|'TOBACCO_USE'|'ALCOHOL_CONSUMPTION'|'REC_DRUG_USE',
                    'Score': ...,
                    'RelationshipScore': ...,
                    'RelationshipType': 'EVERY'|'WITH_DOSAGE'|'ADMINISTERED_VIA'|'FOR'|'NEGATIVE'|'OVERLAP'|'DOSAGE'|'ROUTE_OR_MODE'|'FORM'|'FREQUENCY'|'DURATION'|'STRENGTH'|'RATE'|'ACUITY'|'TEST_VALUE'|'TEST_UNITS'|'TEST_UNIT'|'DIRECTION'|'SYSTEM_ORGAN_SITE'|'AMOUNT'|'USAGE'|'QUALITY',
                    'Id': 123,
                    'BeginOffset': 123,
                    'EndOffset': 123,
                    'Text': 'string',
                    'Category': 'MEDICATION'|'MEDICAL_CONDITION'|'PROTECTED_HEALTH_INFORMATION'|'TEST_TREATMENT_PROCEDURE'|'ANATOMY'|'TIME_EXPRESSION'|'BEHAVIORAL_ENVIRONMENTAL_SOCIAL',
                    'Traits': [
                        {
                            'Name': 'SIGN'|'SYMPTOM'|'DIAGNOSIS'|'NEGATION'|'PERTAINS_TO_FAMILY'|'HYPOTHETICAL'|'LOW_CONFIDENCE'|'PAST_HISTORY'|'FUTURE',
                            'Score': ...
                        },
                    ]
                },
            ]
        },
    ],
    'UnmappedAttributes': [
        {
            'Type': 'MEDICATION'|'MEDICAL_CONDITION'|'PROTECTED_HEALTH_INFORMATION'|'TEST_TREATMENT_PROCEDURE'|'ANATOMY'|'TIME_EXPRESSION'|'BEHAVIORAL_ENVIRONMENTAL_SOCIAL',
            'Attribute': {
                'Type': 'NAME'|'DX_NAME'|'DOSAGE'|'ROUTE_OR_MODE'|'FORM'|'FREQUENCY'|'DURATION'|'GENERIC_NAME'|'BRAND_NAME'|'STRENGTH'|'RATE'|'ACUITY'|'TEST_NAME'|'TEST_VALUE'|'TEST_UNITS'|'TEST_UNIT'|'PROCEDURE_NAME'|'TREATMENT_NAME'|'DATE'|'AGE'|'CONTACT_POINT'|'PHONE_OR_FAX'|'EMAIL'|'IDENTIFIER'|'ID'|'URL'|'ADDRESS'|'PROFESSION'|'SYSTEM_ORGAN_SITE'|'DIRECTION'|'QUALITY'|'QUANTITY'|'TIME_EXPRESSION'|'TIME_TO_MEDICATION_NAME'|'TIME_TO_DX_NAME'|'TIME_TO_TEST_NAME'|'TIME_TO_PROCEDURE_NAME'|'TIME_TO_TREATMENT_NAME'|'AMOUNT'|'GENDER'|'RACE_ETHNICITY'|'ALLERGIES'|'TOBACCO_USE'|'ALCOHOL_CONSUMPTION'|'REC_DRUG_USE',
                'Score': ...,
                'RelationshipScore': ...,
                'RelationshipType': 'EVERY'|'WITH_DOSAGE'|'ADMINISTERED_VIA'|'FOR'|'NEGATIVE'|'OVERLAP'|'DOSAGE'|'ROUTE_OR_MODE'|'FORM'|'FREQUENCY'|'DURATION'|'STRENGTH'|'RATE'|'ACUITY'|'TEST_VALUE'|'TEST_UNITS'|'TEST_UNIT'|'DIRECTION'|'SYSTEM_ORGAN_SITE'|'AMOUNT'|'USAGE'|'QUALITY',
                'Id': 123,
                'BeginOffset': 123,
                'EndOffset': 123,
                'Text': 'string',
                'Category': 'MEDICATION'|'MEDICAL_CONDITION'|'PROTECTED_HEALTH_INFORMATION'|'TEST_TREATMENT_PROCEDURE'|'ANATOMY'|'TIME_EXPRESSION'|'BEHAVIORAL_ENVIRONMENTAL_SOCIAL',
                'Traits': [
                    {
                        'Name': 'SIGN'|'SYMPTOM'|'DIAGNOSIS'|'NEGATION'|'PERTAINS_TO_FAMILY'|'HYPOTHETICAL'|'LOW_CONFIDENCE'|'PAST_HISTORY'|'FUTURE',
                        'Score': ...
                    },
                ]
            }
        },
    ],
    'PaginationToken': 'string',
    'ModelVersion': 'string'
}

Response Structure

  • (dict) --

    • Entities (list) --

      The collection of medical entities extracted from the input text and their associated information. For each entity, the response provides the entity text, the entity category, where the entity text begins and ends, and the level of confidence in the detection and analysis. Attributes and traits of the entity are also returned.

      • (dict) --

        Provides information about an extracted medical entity.

        • Id (integer) --

          The numeric identifier for the entity. This is a monotonically increasing id unique within this response rather than a global unique identifier.

        • BeginOffset (integer) --

          The 0-based character offset in the input text that shows where the entity begins. The offset returns the UTF-8 code point in the string.

        • EndOffset (integer) --

          The 0-based character offset in the input text that shows where the entity ends. The offset returns the UTF-8 code point in the string.

        • Score (float) --

          The level of confidence that Comprehend Medical; has in the accuracy of the detection.

        • Text (string) --

          The segment of input text extracted as this entity.

        • Category (string) --

          The category of the entity.

        • Type (string) --

          Describes the specific type of entity with category of entities.

        • Traits (list) --

          Contextual information for the entity.

          • (dict) --

            Provides contextual information about the extracted entity.

            • Name (string) --

              Provides a name or contextual description about the trait.

            • Score (float) --

              The level of confidence that Comprehend Medical; has in the accuracy of this trait.

        • Attributes (list) --

          The extracted attributes that relate to this entity.

          • (dict) --

            An extracted segment of the text that is an attribute of an entity, or otherwise related to an entity, such as the dosage of a medication taken. It contains information about the attribute such as id, begin and end offset within the input text, and the segment of the input text.

            • Type (string) --

              The type of attribute.

            • Score (float) --

              The level of confidence that Comprehend Medical; has that the segment of text is correctly recognized as an attribute.

            • RelationshipScore (float) --

              The level of confidence that Comprehend Medical; has that this attribute is correctly related to this entity.

            • RelationshipType (string) --

              The type of relationship between the entity and attribute. Type for the relationship is OVERLAP , indicating that the entity occurred at the same time as the Date_Expression .

            • Id (integer) --

              The numeric identifier for this attribute. This is a monotonically increasing id unique within this response rather than a global unique identifier.

            • BeginOffset (integer) --

              The 0-based character offset in the input text that shows where the attribute begins. The offset returns the UTF-8 code point in the string.

            • EndOffset (integer) --

              The 0-based character offset in the input text that shows where the attribute ends. The offset returns the UTF-8 code point in the string.

            • Text (string) --

              The segment of input text extracted as this attribute.

            • Category (string) --

              The category of attribute.

            • Traits (list) --

              Contextual information for this attribute.

              • (dict) --

                Provides contextual information about the extracted entity.

                • Name (string) --

                  Provides a name or contextual description about the trait.

                • Score (float) --

                  The level of confidence that Comprehend Medical; has in the accuracy of this trait.

    • UnmappedAttributes (list) --

      Attributes extracted from the input text that couldn't be related to an entity.

      • (dict) --

        An attribute that was extracted, but Comprehend Medical; was unable to relate to an entity.

        • Type (string) --

          The type of the unmapped attribute, could be one of the following values: "MEDICATION", "MEDICAL_CONDITION", "ANATOMY", "TEST_AND_TREATMENT_PROCEDURE" or "PROTECTED_HEALTH_INFORMATION".

        • Attribute (dict) --

          The specific attribute that has been extracted but not mapped to an entity.

          • Type (string) --

            The type of attribute.

          • Score (float) --

            The level of confidence that Comprehend Medical; has that the segment of text is correctly recognized as an attribute.

          • RelationshipScore (float) --

            The level of confidence that Comprehend Medical; has that this attribute is correctly related to this entity.

          • RelationshipType (string) --

            The type of relationship between the entity and attribute. Type for the relationship is OVERLAP , indicating that the entity occurred at the same time as the Date_Expression .

          • Id (integer) --

            The numeric identifier for this attribute. This is a monotonically increasing id unique within this response rather than a global unique identifier.

          • BeginOffset (integer) --

            The 0-based character offset in the input text that shows where the attribute begins. The offset returns the UTF-8 code point in the string.

          • EndOffset (integer) --

            The 0-based character offset in the input text that shows where the attribute ends. The offset returns the UTF-8 code point in the string.

          • Text (string) --

            The segment of input text extracted as this attribute.

          • Category (string) --

            The category of attribute.

          • Traits (list) --

            Contextual information for this attribute.

            • (dict) --

              Provides contextual information about the extracted entity.

              • Name (string) --

                Provides a name or contextual description about the trait.

              • Score (float) --

                The level of confidence that Comprehend Medical; has in the accuracy of this trait.

    • PaginationToken (string) --

      If the result to the DetectEntitiesV2 operation was truncated, include the PaginationToken to fetch the next page of entities.

    • ModelVersion (string) --

      The version of the model used to analyze the documents. The version number looks like X.X.X. You can use this information to track the model used for a particular batch of documents.

DetectPHI (updated) Link ¶
Changes (response)
{'Entities': {'Attributes': {'RelationshipType': {'USAGE', 'QUALITY'}}}}

Inspects the clinical text for protected health information (PHI) entities and returns the entity category, location, and confidence score for each entity. Amazon Comprehend Medical only detects entities in English language texts.

See also: AWS API Documentation

Request Syntax

client.detect_phi(
    Text='string'
)
type Text

string

param Text

[REQUIRED]

A UTF-8 text string containing the clinical content being examined for PHI entities. Each string must contain fewer than 20,000 bytes of characters.

rtype

dict

returns

Response Syntax

{
    'Entities': [
        {
            'Id': 123,
            'BeginOffset': 123,
            'EndOffset': 123,
            'Score': ...,
            'Text': 'string',
            'Category': 'MEDICATION'|'MEDICAL_CONDITION'|'PROTECTED_HEALTH_INFORMATION'|'TEST_TREATMENT_PROCEDURE'|'ANATOMY'|'TIME_EXPRESSION'|'BEHAVIORAL_ENVIRONMENTAL_SOCIAL',
            'Type': 'NAME'|'DX_NAME'|'DOSAGE'|'ROUTE_OR_MODE'|'FORM'|'FREQUENCY'|'DURATION'|'GENERIC_NAME'|'BRAND_NAME'|'STRENGTH'|'RATE'|'ACUITY'|'TEST_NAME'|'TEST_VALUE'|'TEST_UNITS'|'TEST_UNIT'|'PROCEDURE_NAME'|'TREATMENT_NAME'|'DATE'|'AGE'|'CONTACT_POINT'|'PHONE_OR_FAX'|'EMAIL'|'IDENTIFIER'|'ID'|'URL'|'ADDRESS'|'PROFESSION'|'SYSTEM_ORGAN_SITE'|'DIRECTION'|'QUALITY'|'QUANTITY'|'TIME_EXPRESSION'|'TIME_TO_MEDICATION_NAME'|'TIME_TO_DX_NAME'|'TIME_TO_TEST_NAME'|'TIME_TO_PROCEDURE_NAME'|'TIME_TO_TREATMENT_NAME'|'AMOUNT'|'GENDER'|'RACE_ETHNICITY'|'ALLERGIES'|'TOBACCO_USE'|'ALCOHOL_CONSUMPTION'|'REC_DRUG_USE',
            'Traits': [
                {
                    'Name': 'SIGN'|'SYMPTOM'|'DIAGNOSIS'|'NEGATION'|'PERTAINS_TO_FAMILY'|'HYPOTHETICAL'|'LOW_CONFIDENCE'|'PAST_HISTORY'|'FUTURE',
                    'Score': ...
                },
            ],
            'Attributes': [
                {
                    'Type': 'NAME'|'DX_NAME'|'DOSAGE'|'ROUTE_OR_MODE'|'FORM'|'FREQUENCY'|'DURATION'|'GENERIC_NAME'|'BRAND_NAME'|'STRENGTH'|'RATE'|'ACUITY'|'TEST_NAME'|'TEST_VALUE'|'TEST_UNITS'|'TEST_UNIT'|'PROCEDURE_NAME'|'TREATMENT_NAME'|'DATE'|'AGE'|'CONTACT_POINT'|'PHONE_OR_FAX'|'EMAIL'|'IDENTIFIER'|'ID'|'URL'|'ADDRESS'|'PROFESSION'|'SYSTEM_ORGAN_SITE'|'DIRECTION'|'QUALITY'|'QUANTITY'|'TIME_EXPRESSION'|'TIME_TO_MEDICATION_NAME'|'TIME_TO_DX_NAME'|'TIME_TO_TEST_NAME'|'TIME_TO_PROCEDURE_NAME'|'TIME_TO_TREATMENT_NAME'|'AMOUNT'|'GENDER'|'RACE_ETHNICITY'|'ALLERGIES'|'TOBACCO_USE'|'ALCOHOL_CONSUMPTION'|'REC_DRUG_USE',
                    'Score': ...,
                    'RelationshipScore': ...,
                    'RelationshipType': 'EVERY'|'WITH_DOSAGE'|'ADMINISTERED_VIA'|'FOR'|'NEGATIVE'|'OVERLAP'|'DOSAGE'|'ROUTE_OR_MODE'|'FORM'|'FREQUENCY'|'DURATION'|'STRENGTH'|'RATE'|'ACUITY'|'TEST_VALUE'|'TEST_UNITS'|'TEST_UNIT'|'DIRECTION'|'SYSTEM_ORGAN_SITE'|'AMOUNT'|'USAGE'|'QUALITY',
                    'Id': 123,
                    'BeginOffset': 123,
                    'EndOffset': 123,
                    'Text': 'string',
                    'Category': 'MEDICATION'|'MEDICAL_CONDITION'|'PROTECTED_HEALTH_INFORMATION'|'TEST_TREATMENT_PROCEDURE'|'ANATOMY'|'TIME_EXPRESSION'|'BEHAVIORAL_ENVIRONMENTAL_SOCIAL',
                    'Traits': [
                        {
                            'Name': 'SIGN'|'SYMPTOM'|'DIAGNOSIS'|'NEGATION'|'PERTAINS_TO_FAMILY'|'HYPOTHETICAL'|'LOW_CONFIDENCE'|'PAST_HISTORY'|'FUTURE',
                            'Score': ...
                        },
                    ]
                },
            ]
        },
    ],
    'PaginationToken': 'string',
    'ModelVersion': 'string'
}

Response Structure

  • (dict) --

    • Entities (list) --

      The collection of PHI entities extracted from the input text and their associated information. For each entity, the response provides the entity text, the entity category, where the entity text begins and ends, and the level of confidence that Comprehend Medical; has in its detection.

      • (dict) --

        Provides information about an extracted medical entity.

        • Id (integer) --

          The numeric identifier for the entity. This is a monotonically increasing id unique within this response rather than a global unique identifier.

        • BeginOffset (integer) --

          The 0-based character offset in the input text that shows where the entity begins. The offset returns the UTF-8 code point in the string.

        • EndOffset (integer) --

          The 0-based character offset in the input text that shows where the entity ends. The offset returns the UTF-8 code point in the string.

        • Score (float) --

          The level of confidence that Comprehend Medical; has in the accuracy of the detection.

        • Text (string) --

          The segment of input text extracted as this entity.

        • Category (string) --

          The category of the entity.

        • Type (string) --

          Describes the specific type of entity with category of entities.

        • Traits (list) --

          Contextual information for the entity.

          • (dict) --

            Provides contextual information about the extracted entity.

            • Name (string) --

              Provides a name or contextual description about the trait.

            • Score (float) --

              The level of confidence that Comprehend Medical; has in the accuracy of this trait.

        • Attributes (list) --

          The extracted attributes that relate to this entity.

          • (dict) --

            An extracted segment of the text that is an attribute of an entity, or otherwise related to an entity, such as the dosage of a medication taken. It contains information about the attribute such as id, begin and end offset within the input text, and the segment of the input text.

            • Type (string) --

              The type of attribute.

            • Score (float) --

              The level of confidence that Comprehend Medical; has that the segment of text is correctly recognized as an attribute.

            • RelationshipScore (float) --

              The level of confidence that Comprehend Medical; has that this attribute is correctly related to this entity.

            • RelationshipType (string) --

              The type of relationship between the entity and attribute. Type for the relationship is OVERLAP , indicating that the entity occurred at the same time as the Date_Expression .

            • Id (integer) --

              The numeric identifier for this attribute. This is a monotonically increasing id unique within this response rather than a global unique identifier.

            • BeginOffset (integer) --

              The 0-based character offset in the input text that shows where the attribute begins. The offset returns the UTF-8 code point in the string.

            • EndOffset (integer) --

              The 0-based character offset in the input text that shows where the attribute ends. The offset returns the UTF-8 code point in the string.

            • Text (string) --

              The segment of input text extracted as this attribute.

            • Category (string) --

              The category of attribute.

            • Traits (list) --

              Contextual information for this attribute.

              • (dict) --

                Provides contextual information about the extracted entity.

                • Name (string) --

                  Provides a name or contextual description about the trait.

                • Score (float) --

                  The level of confidence that Comprehend Medical; has in the accuracy of this trait.

    • PaginationToken (string) --

      If the result of the previous request to DetectPHI was truncated, include the PaginationToken to fetch the next page of PHI entities.

    • ModelVersion (string) --

      The version of the model used to analyze the documents. The version number looks like X.X.X. You can use this information to track the model used for a particular batch of documents.

InferICD10CM (updated) Link ¶
Changes (response)
{'Entities': {'Attributes': {'RelationshipType': {'QUALITY'}}}}

InferICD10CM detects medical conditions as entities listed in a patient record and links those entities to normalized concept identifiers in the ICD-10-CM knowledge base from the Centers for Disease Control. Amazon Comprehend Medical only detects medical entities in English language texts.

See also: AWS API Documentation

Request Syntax

client.infer_icd10_cm(
    Text='string'
)
type Text

string

param Text

[REQUIRED]

The input text used for analysis. The input for InferICD10CM is a string from 1 to 10000 characters.

rtype

dict

returns

Response Syntax

{
    'Entities': [
        {
            'Id': 123,
            'Text': 'string',
            'Category': 'MEDICAL_CONDITION',
            'Type': 'DX_NAME'|'TIME_EXPRESSION',
            'Score': ...,
            'BeginOffset': 123,
            'EndOffset': 123,
            'Attributes': [
                {
                    'Type': 'ACUITY'|'DIRECTION'|'SYSTEM_ORGAN_SITE'|'QUALITY'|'QUANTITY'|'TIME_TO_DX_NAME'|'TIME_EXPRESSION',
                    'Score': ...,
                    'RelationshipScore': ...,
                    'Id': 123,
                    'BeginOffset': 123,
                    'EndOffset': 123,
                    'Text': 'string',
                    'Traits': [
                        {
                            'Name': 'NEGATION'|'DIAGNOSIS'|'SIGN'|'SYMPTOM'|'PERTAINS_TO_FAMILY'|'HYPOTHETICAL'|'LOW_CONFIDENCE',
                            'Score': ...
                        },
                    ],
                    'Category': 'DX_NAME'|'TIME_EXPRESSION',
                    'RelationshipType': 'OVERLAP'|'SYSTEM_ORGAN_SITE'|'QUALITY'
                },
            ],
            'Traits': [
                {
                    'Name': 'NEGATION'|'DIAGNOSIS'|'SIGN'|'SYMPTOM'|'PERTAINS_TO_FAMILY'|'HYPOTHETICAL'|'LOW_CONFIDENCE',
                    'Score': ...
                },
            ],
            'ICD10CMConcepts': [
                {
                    'Description': 'string',
                    'Code': 'string',
                    'Score': ...
                },
            ]
        },
    ],
    'PaginationToken': 'string',
    'ModelVersion': 'string'
}

Response Structure

  • (dict) --

    • Entities (list) --

      The medical conditions detected in the text linked to ICD-10-CM concepts. If the action is successful, the service sends back an HTTP 200 response, as well as the entities detected.

      • (dict) --

        The collection of medical entities extracted from the input text and their associated information. For each entity, the response provides the entity text, the entity category, where the entity text begins and ends, and the level of confidence that Amazon Comprehend Medical has in the detection and analysis. Attributes and traits of the entity are also returned.

        • Id (integer) --

          The numeric identifier for the entity. This is a monotonically increasing id unique within this response rather than a global unique identifier.

        • Text (string) --

          The segment of input text that is matched to the detected entity.

        • Category (string) --

          The category of the entity. InferICD10CM detects entities in the MEDICAL_CONDITION category.

        • Type (string) --

          Describes the specific type of entity with category of entities. InferICD10CM detects entities of the type DX_NAME and TIME_EXPRESSION .

        • Score (float) --

          The level of confidence that Amazon Comprehend Medical has in the accuracy of the detection.

        • BeginOffset (integer) --

          The 0-based character offset in the input text that shows where the entity begins. The offset returns the UTF-8 code point in the string.

        • EndOffset (integer) --

          The 0-based character offset in the input text that shows where the entity ends. The offset returns the UTF-8 code point in the string.

        • Attributes (list) --

          The detected attributes that relate to the entity. An extracted segment of the text that is an attribute of an entity, or otherwise related to an entity, such as the nature of a medical condition.

          • (dict) --

            The detected attributes that relate to an entity. This includes an extracted segment of the text that is an attribute of an entity, or otherwise related to an entity. InferICD10CM detects the following attributes: Direction , System, Organ or Site , and Acuity .

            • Type (string) --

              The type of attribute. InferICD10CM detects entities of the type DX_NAME .

            • Score (float) --

              The level of confidence that Amazon Comprehend Medical has that the segment of text is correctly recognized as an attribute.

            • RelationshipScore (float) --

              The level of confidence that Amazon Comprehend Medical has that this attribute is correctly related to this entity.

            • Id (integer) --

              The numeric identifier for this attribute. This is a monotonically increasing id unique within this response rather than a global unique identifier.

            • BeginOffset (integer) --

              The 0-based character offset in the input text that shows where the attribute begins. The offset returns the UTF-8 code point in the string.

            • EndOffset (integer) --

              The 0-based character offset in the input text that shows where the attribute ends. The offset returns the UTF-8 code point in the string.

            • Text (string) --

              The segment of input text which contains the detected attribute.

            • Traits (list) --

              The contextual information for the attribute. The traits recognized by InferICD10CM are DIAGNOSIS , SIGN , SYMPTOM , and NEGATION .

              • (dict) --

                Contextual information for the entity. The traits recognized by InferICD10CM are DIAGNOSIS , SIGN , SYMPTOM , and NEGATION .

                • Name (string) --

                  Provides a name or contextual description about the trait.

                • Score (float) --

                  The level of confidence that Comprehend Medical; has that the segment of text is correctly recognized as a trait.

            • Category (string) --

              The category of attribute. Can be either of DX_NAME or TIME_EXPRESSION .

            • RelationshipType (string) --

              The type of relationship between the entity and attribute. Type for the relationship can be either of OVERLAP or SYSTEM_ORGAN_SITE .

        • Traits (list) --

          Provides Contextual information for the entity. The traits recognized by InferICD10CM are DIAGNOSIS , SIGN , SYMPTOM , and NEGATION.

          • (dict) --

            Contextual information for the entity. The traits recognized by InferICD10CM are DIAGNOSIS , SIGN , SYMPTOM , and NEGATION .

            • Name (string) --

              Provides a name or contextual description about the trait.

            • Score (float) --

              The level of confidence that Comprehend Medical; has that the segment of text is correctly recognized as a trait.

        • ICD10CMConcepts (list) --

          The ICD-10-CM concepts that the entity could refer to, along with a score indicating the likelihood of the match.

          • (dict) --

            The ICD-10-CM concepts that the entity could refer to, along with a score indicating the likelihood of the match.

            • Description (string) --

              The long description of the ICD-10-CM code in the ontology.

            • Code (string) --

              The ICD-10-CM code that identifies the concept found in the knowledge base from the Centers for Disease Control.

            • Score (float) --

              The level of confidence that Amazon Comprehend Medical has that the entity is accurately linked to an ICD-10-CM concept.

    • PaginationToken (string) --

      If the result of the previous request to InferICD10CM was truncated, include the PaginationToken to fetch the next page of medical condition entities.

    • ModelVersion (string) --

      The version of the model used to analyze the documents, in the format n .*n* .*n* You can use this information to track the model used for a particular batch of documents.

InferRxNorm (updated) Link ¶
Changes (response)
{'Entities': {'Attributes': {'Traits': {'Name': {'PAST_HISTORY'}}},
              'Traits': {'Name': {'PAST_HISTORY'}}}}

InferRxNorm detects medications as entities listed in a patient record and links to the normalized concept identifiers in the RxNorm database from the National Library of Medicine. Amazon Comprehend Medical only detects medical entities in English language texts.

See also: AWS API Documentation

Request Syntax

client.infer_rx_norm(
    Text='string'
)
type Text

string

param Text

[REQUIRED]

The input text used for analysis. The input for InferRxNorm is a string from 1 to 10000 characters.

rtype

dict

returns

Response Syntax

{
    'Entities': [
        {
            'Id': 123,
            'Text': 'string',
            'Category': 'MEDICATION',
            'Type': 'BRAND_NAME'|'GENERIC_NAME',
            'Score': ...,
            'BeginOffset': 123,
            'EndOffset': 123,
            'Attributes': [
                {
                    'Type': 'DOSAGE'|'DURATION'|'FORM'|'FREQUENCY'|'RATE'|'ROUTE_OR_MODE'|'STRENGTH',
                    'Score': ...,
                    'RelationshipScore': ...,
                    'Id': 123,
                    'BeginOffset': 123,
                    'EndOffset': 123,
                    'Text': 'string',
                    'Traits': [
                        {
                            'Name': 'NEGATION'|'PAST_HISTORY',
                            'Score': ...
                        },
                    ]
                },
            ],
            'Traits': [
                {
                    'Name': 'NEGATION'|'PAST_HISTORY',
                    'Score': ...
                },
            ],
            'RxNormConcepts': [
                {
                    'Description': 'string',
                    'Code': 'string',
                    'Score': ...
                },
            ]
        },
    ],
    'PaginationToken': 'string',
    'ModelVersion': 'string'
}

Response Structure

  • (dict) --

    • Entities (list) --

      The medication entities detected in the text linked to RxNorm concepts. If the action is successful, the service sends back an HTTP 200 response, as well as the entities detected.

      • (dict) --

        The collection of medical entities extracted from the input text and their associated information. For each entity, the response provides the entity text, the entity category, where the entity text begins and ends, and the level of confidence that Amazon Comprehend Medical has in the detection and analysis. Attributes and traits of the entity are also returned.

        • Id (integer) --

          The numeric identifier for the entity. This is a monotonically increasing id unique within this response rather than a global unique identifier.

        • Text (string) --

          The segment of input text extracted from which the entity was detected.

        • Category (string) --

          The category of the entity. The recognized categories are GENERIC or BRAND_NAME .

        • Type (string) --

          Describes the specific type of entity. For InferRxNorm, the recognized entity type is MEDICATION .

        • Score (float) --

          The level of confidence that Amazon Comprehend Medical has in the accuracy of the detected entity.

        • BeginOffset (integer) --

          The 0-based character offset in the input text that shows where the entity begins. The offset returns the UTF-8 code point in the string.

        • EndOffset (integer) --

          The 0-based character offset in the input text that shows where the entity ends. The offset returns the UTF-8 code point in the string.

        • Attributes (list) --

          The extracted attributes that relate to the entity. The attributes recognized by InferRxNorm are DOSAGE , DURATION , FORM , FREQUENCY , RATE , ROUTE_OR_MODE , and STRENGTH .

          • (dict) --

            The extracted attributes that relate to this entity. The attributes recognized by InferRxNorm are DOSAGE , DURATION , FORM , FREQUENCY , RATE , ROUTE_OR_MODE .

            • Type (string) --

              The type of attribute. The types of attributes recognized by InferRxNorm are BRAND_NAME and GENERIC_NAME .

            • Score (float) --

              The level of confidence that Comprehend Medical has that the segment of text is correctly recognized as an attribute.

            • RelationshipScore (float) --

              The level of confidence that Amazon Comprehend Medical has that the attribute is accurately linked to an entity.

            • Id (integer) --

              The numeric identifier for this attribute. This is a monotonically increasing id unique within this response rather than a global unique identifier.

            • BeginOffset (integer) --

              The 0-based character offset in the input text that shows where the attribute begins. The offset returns the UTF-8 code point in the string.

            • EndOffset (integer) --

              The 0-based character offset in the input text that shows where the attribute ends. The offset returns the UTF-8 code point in the string.

            • Text (string) --

              The segment of input text which corresponds to the detected attribute.

            • Traits (list) --

              Contextual information for the attribute. InferRxNorm recognizes the trait NEGATION for attributes, i.e. that the patient is not taking a specific dose or form of a medication.

              • (dict) --

                The contextual information for the entity. InferRxNorm recognizes the trait NEGATION , which is any indication that the patient is not taking a medication.

                • Name (string) --

                  Provides a name or contextual description about the trait.

                • Score (float) --

                  The level of confidence that Amazon Comprehend Medical has in the accuracy of the detected trait.

        • Traits (list) --

          Contextual information for the entity.

          • (dict) --

            The contextual information for the entity. InferRxNorm recognizes the trait NEGATION , which is any indication that the patient is not taking a medication.

            • Name (string) --

              Provides a name or contextual description about the trait.

            • Score (float) --

              The level of confidence that Amazon Comprehend Medical has in the accuracy of the detected trait.

        • RxNormConcepts (list) --

          The RxNorm concepts that the entity could refer to, along with a score indicating the likelihood of the match.

          • (dict) --

            The RxNorm concept that the entity could refer to, along with a score indicating the likelihood of the match.

            • Description (string) --

              The description of the RxNorm concept.

            • Code (string) --

              RxNorm concept ID, also known as the RxCUI.

            • Score (float) --

              The level of confidence that Amazon Comprehend Medical has that the entity is accurately linked to the reported RxNorm concept.

    • PaginationToken (string) --

      If the result of the previous request to InferRxNorm was truncated, include the PaginationToken to fetch the next page of medication entities.

    • ModelVersion (string) --

      The version of the model used to analyze the documents, in the format n .*n* .*n* You can use this information to track the model used for a particular batch of documents.

InferSNOMEDCT (updated) Link ¶
Changes (response)
{'Entities': {'Attributes': {'RelationshipType': {'TEST_UNIT'}}}}

InferSNOMEDCT detects possible medical concepts as entities and links them to codes from the Systematized Nomenclature of Medicine, Clinical Terms (SNOMED-CT) ontology

See also: AWS API Documentation

Request Syntax

client.infer_snomedct(
    Text='string'
)
type Text

string

param Text

[REQUIRED]

The input text to be analyzed using InferSNOMEDCT. The text should be a string with 1 to 10000 characters.

rtype

dict

returns

Response Syntax

{
    'Entities': [
        {
            'Id': 123,
            'Text': 'string',
            'Category': 'MEDICAL_CONDITION'|'ANATOMY'|'TEST_TREATMENT_PROCEDURE',
            'Type': 'DX_NAME'|'TEST_NAME'|'PROCEDURE_NAME'|'TREATMENT_NAME',
            'Score': ...,
            'BeginOffset': 123,
            'EndOffset': 123,
            'Attributes': [
                {
                    'Category': 'MEDICAL_CONDITION'|'ANATOMY'|'TEST_TREATMENT_PROCEDURE',
                    'Type': 'ACUITY'|'QUALITY'|'DIRECTION'|'SYSTEM_ORGAN_SITE'|'TEST_VALUE'|'TEST_UNIT',
                    'Score': ...,
                    'RelationshipScore': ...,
                    'RelationshipType': 'ACUITY'|'QUALITY'|'TEST_VALUE'|'TEST_UNITS'|'DIRECTION'|'SYSTEM_ORGAN_SITE'|'TEST_UNIT',
                    'Id': 123,
                    'BeginOffset': 123,
                    'EndOffset': 123,
                    'Text': 'string',
                    'Traits': [
                        {
                            'Name': 'NEGATION'|'DIAGNOSIS'|'SIGN'|'SYMPTOM'|'PERTAINS_TO_FAMILY'|'HYPOTHETICAL'|'LOW_CONFIDENCE'|'PAST_HISTORY'|'FUTURE',
                            'Score': ...
                        },
                    ],
                    'SNOMEDCTConcepts': [
                        {
                            'Description': 'string',
                            'Code': 'string',
                            'Score': ...
                        },
                    ]
                },
            ],
            'Traits': [
                {
                    'Name': 'NEGATION'|'DIAGNOSIS'|'SIGN'|'SYMPTOM'|'PERTAINS_TO_FAMILY'|'HYPOTHETICAL'|'LOW_CONFIDENCE'|'PAST_HISTORY'|'FUTURE',
                    'Score': ...
                },
            ],
            'SNOMEDCTConcepts': [
                {
                    'Description': 'string',
                    'Code': 'string',
                    'Score': ...
                },
            ]
        },
    ],
    'PaginationToken': 'string',
    'ModelVersion': 'string',
    'SNOMEDCTDetails': {
        'Edition': 'string',
        'Language': 'string',
        'VersionDate': 'string'
    },
    'Characters': {
        'OriginalTextCharacters': 123
    }
}

Response Structure

  • (dict) --

    • Entities (list) --

      The collection of medical concept entities extracted from the input text and their associated information. For each entity, the response provides the entity text, the entity category, where the entity text begins and ends, and the level of confidence that Comprehend Medical has in the detection and analysis. Attributes and traits of the entity are also returned.

      • (dict) --

        The collection of medical entities extracted from the input text and their associated information. For each entity, the response provides the entity text, the entity category, where the entity text begins and ends, and the level of confidence that Comprehend Medical has in the detection and analysis. Attributes and traits of the entity are also returned.

        • Id (integer) --

          The numeric identifier for the entity. This is a monotonically increasing id unique within this response rather than a global unique identifier.

        • Text (string) --

          The segment of input text extracted as this entity.

        • Category (string) --

          The category of the detected entity. Possible categories are MEDICAL_CONDITION, ANATOMY, or TEST_TREATMENT_PROCEDURE.

        • Type (string) --

          Describes the specific type of entity with category of entities. Possible types include DX_NAME, ACUITY, DIRECTION, SYSTEM_ORGAN_SITE, TEST_NAME, TEST_VALUE, TEST_UNIT, PROCEDURE_NAME, or TREATMENT_NAME.

        • Score (float) --

          The level of confidence that Comprehend Medical has in the accuracy of the detected entity.

        • BeginOffset (integer) --

          The 0-based character offset in the input text that shows where the entity begins. The offset returns the UTF-8 code point in the string.

        • EndOffset (integer) --

          The 0-based character offset in the input text that shows where the entity ends. The offset returns the UTF-8 code point in the string.

        • Attributes (list) --

          An extracted segment of the text that is an attribute of an entity, or otherwise related to an entity, such as the dosage of a medication taken.

          • (dict) --

            The extracted attributes that relate to an entity. An extracted segment of the text that is an attribute of an entity, or otherwise related to an entity, such as the dosage of a medication taken.

            • Category (string) --

              The category of the detected attribute. Possible categories include MEDICAL_CONDITION, ANATOMY, and TEST_TREATMENT_PROCEDURE.

            • Type (string) --

              The type of attribute. Possible types include DX_NAME, ACUITY, DIRECTION, SYSTEM_ORGAN_SITE,TEST_NAME, TEST_VALUE, TEST_UNIT, PROCEDURE_NAME, and TREATMENT_NAME.

            • Score (float) --

              The level of confidence that Comprehend Medical has that the segment of text is correctly recognized as an attribute.

            • RelationshipScore (float) --

              The level of confidence that Comprehend Medical has that this attribute is correctly related to this entity.

            • RelationshipType (string) --

              The type of relationship that exists between the entity and the related attribute.

            • Id (integer) --

              The numeric identifier for this attribute. This is a monotonically increasing id unique within this response rather than a global unique identifier.

            • BeginOffset (integer) --

              The 0-based character offset in the input text that shows where the attribute begins. The offset returns the UTF-8 code point in the string.

            • EndOffset (integer) --

              The 0-based character offset in the input text that shows where the attribute ends. The offset returns the UTF-8 code point in the string.

            • Text (string) --

              The segment of input text extracted as this attribute.

            • Traits (list) --

              Contextual information for an attribute. Examples include signs, symptoms, diagnosis, and negation.

              • (dict) --

                Contextual information for an entity.

                • Name (string) --

                  The name or contextual description of a detected trait.

                • Score (float) --

                  The level of confidence that Comprehend Medical has in the accuracy of a detected trait.

            • SNOMEDCTConcepts (list) --

              The SNOMED-CT concepts specific to an attribute, along with a score indicating the likelihood of the match.

              • (dict) --

                The SNOMED-CT concepts that the entity could refer to, along with a score indicating the likelihood of the match.

                • Description (string) --

                  The description of the SNOMED-CT concept.

                • Code (string) --

                  The numeric ID for the SNOMED-CT concept.

                • Score (float) --

                  The level of confidence Comprehend Medical has that the entity should be linked to the identified SNOMED-CT concept.

        • Traits (list) --

          Contextual information for the entity.

          • (dict) --

            Contextual information for an entity.

            • Name (string) --

              The name or contextual description of a detected trait.

            • Score (float) --

              The level of confidence that Comprehend Medical has in the accuracy of a detected trait.

        • SNOMEDCTConcepts (list) --

          The SNOMED concepts that the entity could refer to, along with a score indicating the likelihood of the match.

          • (dict) --

            The SNOMED-CT concepts that the entity could refer to, along with a score indicating the likelihood of the match.

            • Description (string) --

              The description of the SNOMED-CT concept.

            • Code (string) --

              The numeric ID for the SNOMED-CT concept.

            • Score (float) --

              The level of confidence Comprehend Medical has that the entity should be linked to the identified SNOMED-CT concept.

    • PaginationToken (string) --

      If the result of the request is truncated, the pagination token can be used to fetch the next page of entities.

    • ModelVersion (string) --

      The version of the model used to analyze the documents, in the format n.n.n You can use this information to track the model used for a particular batch of documents.

    • SNOMEDCTDetails (dict) --

      The details of the SNOMED-CT revision, including the edition, language, and version date.

      • Edition (string) --

        The edition of SNOMED-CT used. The edition used for the InferSNOMEDCT editions is the US edition.

      • Language (string) --

        The language used in the SNOMED-CT ontology. All Amazon Comprehend Medical operations are US English (en).

      • VersionDate (string) --

        The version date of the SNOMED-CT ontology used.

    • Characters (dict) --

      The number of characters in the input request documentation.

      • OriginalTextCharacters (integer) --

        The number of characters present in the input text document as processed by Comprehend Medical.