You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In terminal, [log in to Microsoft azure.](/cli/azure/authenticate-azure-cli)
80
-
Now, write “python” to open a python shell and paste the following code.
81
-
Be sure to replace your Service URL with the URL you noted when creating a resource.
79
+
In terminal, [log in to Microsoft Azure.](/cli/azure/authenticate-azure-cli)
80
+
The code below references the [python SDK for text.](https://github.com/Azure/azure-sdk-for-python/blob/azure-health-deidentification_1.0.0/sdk/healthdataaiservices/azure-health-deidentification/samples/deidentify_text_redact.py)
81
+
82
+
To use it, create a python file called "deidentify_text_redact.py" and paste the following code in. Run "python deidentify_text_redact.py".
83
+
84
+
Be sure to replace AZURE_HEALTH_DEIDENTIFICATION_ENDPOINT with the URL you noted when creating a resource.
82
85
You can also change the operation type between REDACT, TAG, or SURROGATE.
83
86
84
-
```Bash
85
-
from azure.health.deidentification import *
86
-
from azure.health.deidentification.models import *
87
-
from azure.identity import DefaultAzureCredential
88
-
89
-
SERVICE_URL = "<YOUR SERVICE URL HERE>"### Replace
text = """ Hannah is a 92-year-old admitted on 9/7/23. First presented symptoms two days earlier on Tuesday, 9/5/23 """
94
-
operation=OperationType.SURROGATE ### CHANGE OPERATION TYPE AS NEEDED. Options include OperationType.TAG, OperationType.REDACT, and OperationType.SURROGATE
print(f'Redacted Text: "{result.output_text}"') # Redacted output: "It's great to work at [organization]."
125
+
# [END redact]
126
+
127
+
128
+
if__name__=="__main__":
129
+
deidentify_text_redact()
111
130
112
131
```
113
132
114
133
## Example input & output
115
134
116
135
| Input | Output |
117
136
|----------------|---------|
118
-
|Hannah is a 92-year-old admitted on 9/7/23. First presented symptoms two days earlier on Tuesday, 9/5/23 | Kim is a 90-year-old admitted on 9/30/23. First presented symptoms two days earlier on Thursday, 9/28/23|
137
+
|Kimberly Brown is a 34 y.o. female presenting with bilateral eye discomfort. Last seen by her PCP 2/6/2025 Dr. Orlo at Overlake Clinics Downtown Bellevue PCP.| Britt Macdonough is a 34 y.o. female presenting with bilateral eye discomfort. Last seen by her PCP 1/18/2025 Dr. Defiore at Cardston Hospital PCP.|
0 commit comments