Skip to content

Commit 65ebc48

Browse files
Merge pull request #291434 from GrahamMThomas/dev/gthomas/redaction-format
Custom Redaction Format tutorial for Azure Heatlh Deidentification
2 parents 6749e0b + b1a549b commit 65ebc48

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
title: "Use a custom redaction format with the Azure Health De-identification service"
3+
description: "Learn how to redact using a custom format with the Azure Health De-identification service."
4+
author: GrahamMThomas
5+
ms.author: gthomas
6+
ms.service: azure-health-data-services
7+
ms.subservice: deidentification-service
8+
ms.topic: tutorial
9+
ms.date: 12/05/2024
10+
---
11+
12+
# Tutorial: Use a custom redaction format with the de-identification service
13+
14+
In this tutorial, you:
15+
16+
> [!div class="checklist"]
17+
> * Learn how to specify a custom redaction format
18+
> * Learn how to use variables in a custom redaction format
19+
20+
## Usage
21+
22+
Within the de-identification service, we support an operation called `Redact` that allows you to redact PHI from a text document. You can specify
23+
what that redaction looks like using a custom format.
24+
25+
For example:
26+
27+
| Text | RedactedText |
28+
| ---------------------- | ------------------ |
29+
| My name is John Smith. | My name is [name]. |
30+
31+
### Specify a custom redaction format
32+
33+
1. Must select `Redact` as `Operation`. `RedactionFormat` is only supported for `Redact` operation.
34+
2. Pass `RedactionFormat` parameter within the `CustomizationOptions` model to the API or Job parameters.
35+
36+
37+
## Variables
38+
39+
Redaction format variables refer to special placeholders that can be used to create a custom redaction format.
40+
41+
The following variables are supported:
42+
43+
### Type
44+
45+
`{type} => patient`
46+
47+
```text
48+
Text = "Hi my name is John Smith"
49+
RedactionFormat = "<{type}>"
50+
51+
# Output:
52+
Hi my name is <patient>
53+
```
54+
55+
Also supports Upper and Title cases.
56+
57+
```text
58+
{type} => patient
59+
{Type} => Patient
60+
{TYPE} => PATIENT
61+
```
62+
63+
### Length
64+
65+
This variable allows you to create a string matching the length of the PHI.
66+
67+
It duplicates the previous character to match the length of the tagged entity.
68+
69+
```text
70+
Text = "Hi my name is John Smith"
71+
RedactionFormat = "*{len}"
72+
73+
# Output:
74+
Hi my name is **********
75+
```
76+
77+
## Limits
78+
79+
- The redaction format can be up to 16 characters long.
80+
- Each variable type can only be used once in the format.

articles/healthcare-apis/deidentification/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ items:
3232
items:
3333
- name: Configure Azure Storage to de-identify documents
3434
href: configure-storage.md
35+
- name: Customize format of redacted text during de-identification
36+
href: redaction-format.md
3537
- name: How-to
3638
expanded: true
3739
items:

0 commit comments

Comments
 (0)