Skip to content

infer_rx_norm

infer_rx_norm(
    text: OntologyLinkingBoundedLengthString,
    *,
    config_overrides: Optional[ComprehendMedicalClientConfig] = None,
) -> InferRxNormResponse

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.

Parameters:

Raises:

  • InternalServerException –

    An internal server error occurred. Retry your request.

  • InvalidEncodingException –

    The input text was not in valid UTF-8 character encoding. Check your text then retry your request.

  • InvalidRequestException –

    The request that you made is invalid. Check your request to determine why it's invalid and then retry the request.

  • ServiceUnavailableException –

    The Amazon Comprehend Medical service is temporarily unavailable. Please wait and then retry your request.

  • TextSizeLimitExceededException –

    The size of the text you submitted exceeds the size limit. Reduce the size of the text or use a smaller document and then retry your request.

  • TooManyRequestsException –

    You have made too many requests within a short period of time. Wait for a short time and then try your request again. Contact customer support for more information about a service limit increase.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_comprehendmedical/_services/comprehend_medical.py
def infer_rx_norm(
    self,
    text: "capo_comprehendmedical.types.ontology_linking_bounded_length_string.OntologyLinkingBoundedLengthString",
    *,
    config_overrides: Optional[ComprehendMedicalClientConfig] = None,
) -> "capo_comprehendmedical.types.infer_rx_norm_response.InferRxNormResponse":
    """<p>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. </p>

    Args:
        text: <p>The input text used for analysis.</p>

    Raises:
        capo_comprehendmedical.errors.internal_server_exception.InternalServerException: <p> An internal server error occurred. Retry your request. </p>
        capo_comprehendmedical.errors.invalid_encoding_exception.InvalidEncodingException: <p> The input text was not in valid UTF-8 character encoding. Check your text then retry your request.</p>
        capo_comprehendmedical.errors.invalid_request_exception.InvalidRequestException: <p> The request that you made is invalid. Check your request to determine why it's invalid and then retry the request.</p>
        capo_comprehendmedical.errors.service_unavailable_exception.ServiceUnavailableException: <p> The Amazon Comprehend Medical service is temporarily unavailable. Please wait and then retry your request. </p>
        capo_comprehendmedical.errors.text_size_limit_exceeded_exception.TextSizeLimitExceededException: <p> The size of the text you submitted exceeds the size limit. Reduce the size of the text or use a smaller document and then retry your request. </p>
        capo_comprehendmedical.errors.too_many_requests_exception.TooManyRequestsException: <p> You have made too many requests within a short period of time. Wait for a short time and then try your request again. Contact customer support for more information about a service limit increase. </p>
        capo_comprehendmedical.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_comprehendmedical.types.infer_rx_norm_request.InferRxNormRequest]",
    ) -> OperationResponse[
        "capo_comprehendmedical.types.infer_rx_norm_response.InferRxNormResponse"
    ]:
        import capo_comprehendmedical._operations.comprehend_medical_20181030.infer_rx_norm

        output, http_response = (
            capo_comprehendmedical._operations.comprehend_medical_20181030.infer_rx_norm.infer_rx_norm(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("InferRxNorm")
    )
    input_: capo_comprehendmedical.types.infer_rx_norm_request.InferRxNormRequest = {
        "text": text
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output