Appendix A: API Description - AI-Powered Health Data Masking

Appendix A: API Description

The AI Powered Health Data Masking solution creates the following API calls:

  • Get Image (GET): Returns a pre-signed URL for the image based on the Amazon Simple Storage Service (Amazon S3) bucket and key. To return a successful link, the query parameters must only include the bucket and key, and the AWS Identity and Access Management (IAM) role associated with the AWS Lambda function must have the appropriate permissions to generate the pre-signed URL.

  • Get Image Text (GET): Returns the location of all text in an image. This is a wrapper for the DetectText feature in Amazon Rekognition. To return a successful response, the query parameters must only include the bucket and key, and the IAM role associated with the AWS Lambda function must have the appropriate permissions to make calls using Amazon Rekognition.

  • Get Image PHI (GET): Returns the location of potential protected health information (PHI) in a medical image. This is a wrapper for the DetectText feature in Amazon Rekognition, and is sent to the DetectPHI API in Amazon Comprehend Medical. To return a successful response, the query parameters must only include the bucket and key and an optional PHI threshold parameter, and the IAM role associated with the Lambda function must have the appropriate permissions to make calls with Amazon Rekognition and Amazon Comprehend Medical.

  • Mask PHI in Image (POST): This function contains the same functionality as Get Image PHI but includes the feature for generating a new masked image based on the PHI identified using Amazon Comprehend Medical and the locations of the text using Amazon Rekognition. New images are written to Amazon S3 and the location of the images is returned.

  • Get PHI in Text (POST): Returns the location of the PHI within a body of text. Only allowed parameters are the body of text and an optional parameter of PHI detection threshold. This is a wrapper for the DetectPHI call for Amazon Comprehend Medical.

  • Mask PHI in Text (POST): Masks the PHI in a body of text identified by Amazon Comprehend Medical, and replaces the identified entity with the identified attribute. For example, NAME.