| 1 | import type * as comprehendmedical from "@distilled.cloud/aws/comprehendmedical"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `comprehendmedical:DetectPHI` — detect protected health |
| 7 | * information (PHI) entities (name, address, age, ID numbers, dates…) in |
| 8 | * clinical text. |
| 9 | * |
| 10 | * Comprehend Medical is a pure pay-per-call service with no resource to |
| 11 | * manage: the binding takes no arguments and grants the function |
| 12 | * `comprehendmedical:DetectPHI` (the action has no resource-level IAM). Pass |
| 13 | * the clinical note as raw text — no marshalling. |
| 14 | * |
| 15 | * ### Detecting PHI |
| 16 | * **Example:** Detect PHI in a Clinical Note |
| 17 | * ```typescript |
| 18 | * // init |
| 19 | * const detectPHI = yield* AWS.ComprehendMedical.DetectPHI(); |
| 20 | * |
| 21 | * // runtime |
| 22 | * const result = yield* detectPHI({ |
| 23 | * Text: "John Doe, age 47, was seen on 2024-01-03.", |
| 24 | * }); |
| 25 | * const phi = (result.Entities ?? []).map((entity) => entity.Type); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface DetectPHI extends Binding.Service< |
| 31 | DetectPHI, |
| 32 | "AWS.ComprehendMedical.DetectPHI", |
| 33 | () => Effect.Effect< |
| 34 | ( |
| 35 | request: comprehendmedical.DetectPHIRequest, |
| 36 | ) => Effect.Effect< |
| 37 | comprehendmedical.DetectPHIResponse, |
| 38 | comprehendmedical.DetectPHIError |
| 39 | > |
| 40 | > |
| 41 | > {} |
| 42 | export const DetectPHI = Binding.Service<DetectPHI>( |
| 43 | "AWS.ComprehendMedical.DetectPHI", |
| 44 | ); |