Skip to content

DetectPHI

Source: src/AWS/ComprehendMedical/DetectPHI.ts

Runtime binding for comprehendmedical:DetectPHI — detect protected health information (PHI) entities (name, address, age, ID numbers, dates…) in clinical text.

Comprehend Medical is a pure pay-per-call service with no resource to manage: the binding takes no arguments and grants the function comprehendmedical:DetectPHI (the action has no resource-level IAM). Pass the clinical note as raw text — no marshalling.

// init
const detectPHI = yield* AWS.ComprehendMedical.DetectPHI();
// runtime
const result = yield* detectPHI({
Text: "John Doe, age 47, was seen on 2024-01-03.",
});
const phi = (result.Entities ?? []).map((entity) => entity.Type);