detectPHI method

Future<DetectPHIResponse> detectPHI({
  1. required String text,
})

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.

May throw InternalServerException. May throw InvalidEncodingException. May throw InvalidRequestException. May throw ServiceUnavailableException. May throw TextSizeLimitExceededException. May throw TooManyRequestsException.

Parameter text : A UTF-8 text string containing the clinical content being examined for PHI entities.

Implementation

Future<DetectPHIResponse> detectPHI({
  required String text,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'ComprehendMedical_20181030.DetectPHI'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Text': text,
    },
  );

  return DetectPHIResponse.fromJson(jsonResponse.body);
}