@azure-rest/health-deidentification 1.0.0 → 1.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +35 -16
  3. package/dist/browser/deidentificationClient.js +13 -11
  4. package/dist/browser/deidentificationClient.js.map +1 -1
  5. package/dist/browser/isUnexpected.js +4 -5
  6. package/dist/browser/isUnexpected.js.map +1 -1
  7. package/dist/browser/models.d.ts +40 -4
  8. package/dist/browser/models.js.map +1 -1
  9. package/dist/browser/outputModels.d.ts +4 -2
  10. package/dist/browser/outputModels.js.map +1 -1
  11. package/dist/browser/paginateHelper.js +43 -73
  12. package/dist/browser/paginateHelper.js.map +1 -1
  13. package/dist/browser/pollingHelper.js +11 -8
  14. package/dist/browser/pollingHelper.js.map +1 -1
  15. package/dist/commonjs/deidentificationClient.js +13 -11
  16. package/dist/commonjs/deidentificationClient.js.map +1 -1
  17. package/dist/commonjs/isUnexpected.js +4 -5
  18. package/dist/commonjs/isUnexpected.js.map +1 -1
  19. package/dist/commonjs/models.d.ts +40 -4
  20. package/dist/commonjs/models.js.map +1 -1
  21. package/dist/commonjs/outputModels.d.ts +4 -2
  22. package/dist/commonjs/outputModels.js.map +1 -1
  23. package/dist/commonjs/paginateHelper.js +43 -73
  24. package/dist/commonjs/paginateHelper.js.map +1 -1
  25. package/dist/commonjs/pollingHelper.js +11 -8
  26. package/dist/commonjs/pollingHelper.js.map +1 -1
  27. package/dist/commonjs/tsdoc-metadata.json +11 -11
  28. package/dist/esm/deidentificationClient.js +13 -11
  29. package/dist/esm/deidentificationClient.js.map +1 -1
  30. package/dist/esm/isUnexpected.js +4 -5
  31. package/dist/esm/isUnexpected.js.map +1 -1
  32. package/dist/esm/models.d.ts +40 -4
  33. package/dist/esm/models.js.map +1 -1
  34. package/dist/esm/outputModels.d.ts +4 -2
  35. package/dist/esm/outputModels.js.map +1 -1
  36. package/dist/esm/paginateHelper.js +43 -73
  37. package/dist/esm/paginateHelper.js.map +1 -1
  38. package/dist/esm/pollingHelper.js +11 -8
  39. package/dist/esm/pollingHelper.js.map +1 -1
  40. package/dist/react-native/deidentificationClient.js +13 -11
  41. package/dist/react-native/deidentificationClient.js.map +1 -1
  42. package/dist/react-native/isUnexpected.js +4 -5
  43. package/dist/react-native/isUnexpected.js.map +1 -1
  44. package/dist/react-native/models.d.ts +40 -4
  45. package/dist/react-native/models.js.map +1 -1
  46. package/dist/react-native/outputModels.d.ts +4 -2
  47. package/dist/react-native/outputModels.js.map +1 -1
  48. package/dist/react-native/paginateHelper.js +43 -73
  49. package/dist/react-native/paginateHelper.js.map +1 -1
  50. package/dist/react-native/pollingHelper.js +11 -8
  51. package/dist/react-native/pollingHelper.js.map +1 -1
  52. package/package.json +42 -60
  53. package/dist/browser/clientDefinitions.d.ts.map +0 -1
  54. package/dist/browser/deidentificationClient.d.ts.map +0 -1
  55. package/dist/browser/index.d.ts.map +0 -1
  56. package/dist/browser/isUnexpected.d.ts.map +0 -1
  57. package/dist/browser/logger.d.ts.map +0 -1
  58. package/dist/browser/models.d.ts.map +0 -1
  59. package/dist/browser/outputModels.d.ts.map +0 -1
  60. package/dist/browser/paginateHelper.d.ts.map +0 -1
  61. package/dist/browser/parameters.d.ts.map +0 -1
  62. package/dist/browser/pollingHelper.d.ts.map +0 -1
  63. package/dist/browser/responses.d.ts.map +0 -1
  64. package/dist/commonjs/clientDefinitions.d.ts.map +0 -1
  65. package/dist/commonjs/deidentificationClient.d.ts.map +0 -1
  66. package/dist/commonjs/index.d.ts.map +0 -1
  67. package/dist/commonjs/isUnexpected.d.ts.map +0 -1
  68. package/dist/commonjs/logger.d.ts.map +0 -1
  69. package/dist/commonjs/models.d.ts.map +0 -1
  70. package/dist/commonjs/outputModels.d.ts.map +0 -1
  71. package/dist/commonjs/paginateHelper.d.ts.map +0 -1
  72. package/dist/commonjs/parameters.d.ts.map +0 -1
  73. package/dist/commonjs/pollingHelper.d.ts.map +0 -1
  74. package/dist/commonjs/responses.d.ts.map +0 -1
  75. package/dist/esm/clientDefinitions.d.ts.map +0 -1
  76. package/dist/esm/deidentificationClient.d.ts.map +0 -1
  77. package/dist/esm/index.d.ts.map +0 -1
  78. package/dist/esm/isUnexpected.d.ts.map +0 -1
  79. package/dist/esm/logger.d.ts.map +0 -1
  80. package/dist/esm/models.d.ts.map +0 -1
  81. package/dist/esm/outputModels.d.ts.map +0 -1
  82. package/dist/esm/paginateHelper.d.ts.map +0 -1
  83. package/dist/esm/parameters.d.ts.map +0 -1
  84. package/dist/esm/pollingHelper.d.ts.map +0 -1
  85. package/dist/esm/responses.d.ts.map +0 -1
  86. package/dist/react-native/clientDefinitions.d.ts.map +0 -1
  87. package/dist/react-native/deidentificationClient.d.ts.map +0 -1
  88. package/dist/react-native/index.d.ts.map +0 -1
  89. package/dist/react-native/isUnexpected.d.ts.map +0 -1
  90. package/dist/react-native/logger.d.ts.map +0 -1
  91. package/dist/react-native/models.d.ts.map +0 -1
  92. package/dist/react-native/outputModels.d.ts.map +0 -1
  93. package/dist/react-native/paginateHelper.d.ts.map +0 -1
  94. package/dist/react-native/parameters.d.ts.map +0 -1
  95. package/dist/react-native/pollingHelper.d.ts.map +0 -1
  96. package/dist/react-native/responses.d.ts.map +0 -1
package/LICENSE CHANGED
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,9 +1,10 @@
1
1
  # Azure Health Data Services de-identification service REST client library for JavaScript
2
2
 
3
- This package contains a client library for the de-identification service in Azure Health Data Services which
3
+ This package contains a client library for the de-identification service in Azure Health Data Services which
4
4
  enables users to tag, redact, or surrogate health data containing Protected Health Information (PHI).
5
5
 
6
6
  Use the client library for the de-identification service to:
7
+
7
8
  - Discover PHI in unstructured text
8
9
  - Replace PHI in unstructured text with placeholder values
9
10
  - Replace PHI in unstructured text with realistic surrogate values
@@ -11,12 +12,6 @@ Use the client library for the de-identification service to:
11
12
 
12
13
  **Please rely heavily on our [REST client docs](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/rest-clients.md) to use this library.**
13
14
 
14
- Use the client library for the de-identification service to:
15
- - Discover PHI in unstructured text
16
- - Replace PHI in unstructured text with placeholder values
17
- - Replace PHI in unstructured text with realistic surrogate values
18
- - Manage asynchronous jobs to de-identify documents in Azure Storage
19
-
20
15
  Key links:
21
16
 
22
17
  - [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/healthdataaiservices/health-deidentification-rest)
@@ -64,32 +59,46 @@ Here's an example of setting an environment variable in Bash using Azure CLI:
64
59
 
65
60
  ```bash
66
61
  # Get the service URL for the resource
67
- export DEID_SERVICE_ENDPOINT=$(az deidservice show --name "<resource-name>" --resource-group "<resource-group-name>" --query "properties.serviceUrl")
62
+ export HEALTHDATAAISERVICES_DEID_SERVICE_ENDPOINT=$(az deidservice show --name "<resource-name>" --resource-group "<resource-group-name>" --query "properties.serviceUrl")
68
63
  ```
69
64
 
70
65
  Create a client with the endpoint and credential:
66
+
71
67
  ```ts snippet:CreateClient
72
68
  import { DefaultAzureCredential } from "@azure/identity";
73
69
  import DeidentificationClient from "@azure-rest/health-deidentification";
74
70
 
75
71
  const credential = new DefaultAzureCredential();
76
- const serviceEndpoint = process.env.DEID_SERVICE_ENDPOINT || "https://example.api.deid.azure.com";
72
+ const serviceEndpoint =
73
+ process.env.HEALTHDATAAISERVICES_DEID_SERVICE_ENDPOINT || "https://example.api.deid.azure.com";
77
74
  const client = DeidentificationClient(serviceEndpoint, credential);
78
75
  ```
79
76
 
80
77
  ## Key concepts
81
78
 
82
79
  ### De-identification operations:
80
+
83
81
  Given an input text, the de-identification service can perform three main operations:
82
+
84
83
  - `Tag` returns the category and location within the text of detected PHI entities.
85
84
  - `Redact` returns output text where detected PHI entities are replaced with placeholder text. For example `John` replaced with `[name]`.
86
85
  - `Surrogate` returns output text where detected PHI entities are replaced with realistic replacement values. For example, `My name is John Smith` could become `My name is Tom Jones`.
86
+ - `SurrogateOnly` returns output text where user-defined PHI entities are replaced with realistic replacement values.
87
+
88
+ ### String Encoding
89
+
90
+ When using the `Tag` operation, the service will return the locations of PHI entities in the input text. These locations will be represented as offsets and lengths, each of which is a [StringIndex][string_index] containing
91
+ three properties corresponding to three different text encodings. **JavaScript applications should use the `utf16` property.**
92
+
93
+ For more on text encoding, see [Character encoding in .NET][character_encoding].
87
94
 
88
95
  ### Available endpoints
89
- There are two ways to interact with the de-identification service. You can send text directly, or you can create jobs
96
+
97
+ There are two ways to interact with the de-identification service. You can send text directly, or you can create jobs
90
98
  to de-identify documents in Azure Storage.
91
99
 
92
100
  You can de-identify text directly using the `DeidentificationClient`:
101
+
93
102
  ```ts snippet:DeidentifyText
94
103
  import { DefaultAzureCredential } from "@azure/identity";
95
104
  import DeidentificationClient, {
@@ -98,7 +107,8 @@ import DeidentificationClient, {
98
107
  } from "@azure-rest/health-deidentification";
99
108
 
100
109
  const credential = new DefaultAzureCredential();
101
- const serviceEndpoint = process.env.DEID_SERVICE_ENDPOINT || "https://example.api.deid.azure.com";
110
+ const serviceEndpoint =
111
+ process.env.HEALTHDATAAISERVICES_DEID_SERVICE_ENDPOINT || "https://example.api.deid.azure.com";
102
112
  const client = DeidentificationClient(serviceEndpoint, credential);
103
113
 
104
114
  const content: DeidentificationContent = {
@@ -117,6 +127,7 @@ console.log(response.body.outputText); // Hello, Tom!
117
127
  To de-identify documents in Azure Storage, you'll need a storage account with a container to which the de-identification service has been granted an appropriate role. See [Tutorial: Configure Azure Storage to de-identify documents][deid_configure_storage] for prerequisites and configuration options. You can upload the files in the [test data folder][test_data] as blobs, like: `https://<storageaccount>.blob.core.windows.net/<container>/example_patient_1/doctor_dictation.txt`.
118
128
 
119
129
  You can create jobs to de-identify documents in the source Azure Storage account and container with an optional input prefix. If there's no input prefix, all blobs in the container will be de-identified. Azure Storage blobs can use `/` in the blob name to emulate a folder or directory layout. For more on blob naming, see [Naming and Referencing Containers, Blobs, and Metadata][blob_names]. The files you've uploaded can be de-identified by providing `example_patient_1` as the input prefix:
130
+
120
131
  ```
121
132
  <container>/
122
133
  ├── example_patient_1/
@@ -126,6 +137,7 @@ You can create jobs to de-identify documents in the source Azure Storage account
126
137
  ```
127
138
 
128
139
  Your target Azure Storage account and container where documents will be written can be the same as the source, or a different account or container. In the examples below, the source and target account and container are the same. You can specify an output prefix to indicate where the job's output documents should be written (defaulting to `_output`). Each document processed by the job will have the same relative blob name with the input prefix replaced by the output prefix:
140
+
129
141
  ```
130
142
  <container>/
131
143
  ├── example_patient_1/
@@ -139,13 +151,15 @@ Your target Azure Storage account and container where documents will be written
139
151
  ```
140
152
 
141
153
  Set the following environment variables, updating the storage account and container with real values:
154
+
142
155
  ```bash
143
- export AZURE_STORAGE_ACCOUNT_LOCATION="https://<storageaccount>.blob.core.windows.net/<container>"
156
+ export HEALTHDATAAISERVICES_STORAGE_ACCOUNT_LOCATION="https://<storageaccount>.blob.core.windows.net/<container>"
144
157
  export INPUT_PREFIX="example_patient_1"
145
158
  export OUTPUT_PREFIX="_output"
146
159
  ```
147
160
 
148
161
  You can create and view job status using the client:
162
+
149
163
  ```ts snippet:DeidentifyDocuments
150
164
  import { DefaultAzureCredential } from "@azure/identity";
151
165
  import DeidentificationClient, {
@@ -157,8 +171,10 @@ import DeidentificationClient, {
157
171
 
158
172
  const credential = new DefaultAzureCredential();
159
173
  const serviceEndpoint =
160
- process.env["DEID_SERVICE_ENDPOINT"] || "https://example.api.deid.azure.com";
161
- const storageLocation = `https://${process.env["STORAGE_ACCOUNT_NAME"]}.blob.core.windows.net/${process.env["STORAGE_CONTAINER_NAME"]}`;
174
+ process.env["HEALTHDATAAISERVICES_DEID_SERVICE_ENDPOINT"] || "https://example.api.deid.azure.com";
175
+ const storageLocation =
176
+ process.env["HEALTHDATAAISERVICES_STORAGE_ACCOUNT_LOCATION"] ||
177
+ "https://example.blob.core.windows.net/example-container";
162
178
  const inputPrefix = "example_patient_1";
163
179
  const outputPrefix = process.env["OUTPUT_PREFIX"] || "_output";
164
180
 
@@ -190,7 +206,7 @@ Find a bug, or have feedback? Raise an issue with the [Health Deidentification][
190
206
  ## Troubleshooting
191
207
 
192
208
  - **Unable to Access Source or Target Storage**
193
- - Ensure you create your deid service with a system assigned managed identity
209
+ - Ensure you create your de-identification service with a system assigned managed identity
194
210
  - Ensure your storage account has given permissions to that managed identity
195
211
 
196
212
  ### Logging
@@ -206,12 +222,15 @@ setLogLevel("info");
206
222
  For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
207
223
 
208
224
  <!-- LINKS -->
225
+
209
226
  [azure_sub]: https://azure.microsoft.com/free/
210
227
  [deid_quickstart]: https://learn.microsoft.com/azure/healthcare-apis/deidentification/quickstart
228
+ [string_index]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/healthdataaiservices/health-deidentification-rest/src/outputModels.ts#L175
229
+ [character_encoding]: https://learn.microsoft.com/dotnet/standard/base-types/character-encoding-introduction
211
230
  [deid_redact]: https://learn.microsoft.com/azure/healthcare-apis/deidentification/redaction-format
212
231
  [deid_rbac]: https://learn.microsoft.com/azure/healthcare-apis/deidentification/manage-access-rbac
213
232
  [deid_managed_identity]: https://learn.microsoft.com/azure/healthcare-apis/deidentification/managed-identities
214
233
  [deid_configure_storage]: https://learn.microsoft.com/azure/healthcare-apis/deidentification/configure-storage
215
234
  [azure_cli]: https://learn.microsoft.com/cli/azure/healthcareapis/deidservice?view=azure-cli-latest
216
235
  [azure_portal]: https://ms.portal.azure.com
217
- [github_issue_label]: https://github.com/Azure/azure-sdk-for-js/labels/Health%20Deidentification
236
+ [github_issue_label]: https://github.com/Azure/azure-sdk-for-js/labels/Health%20Deidentification
@@ -1,6 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { __rest } from "tslib";
4
3
  import { getClient } from "@azure-rest/core-client";
5
4
  import { logger } from "./logger.js";
6
5
  /**
@@ -9,21 +8,24 @@ import { logger } from "./logger.js";
9
8
  * @param credentials - uniquely identify client credential
10
9
  * @param options - the parameter for all optional parameters
11
10
  */
12
- export default function createClient(endpointParam, credentials, _a = {}) {
13
- var _b, _c, _d, _e, _f, _g;
14
- var { apiVersion = "2024-11-15" } = _a, options = __rest(_a, ["apiVersion"]);
15
- const endpointUrl = (_c = (_b = options.endpoint) !== null && _b !== void 0 ? _b : options.baseUrl) !== null && _c !== void 0 ? _c : `${endpointParam}`;
11
+ export default function createClient(endpointParam, credentials, { apiVersion = "2025-07-15-preview", ...options } = {}) {
12
+ const endpointUrl = options.endpoint ?? `${endpointParam}`;
16
13
  const userAgentInfo = `azsdk-js-health-deidentification-rest/1.0.0-beta.1`;
17
14
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
18
15
  ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
19
16
  : `${userAgentInfo}`;
20
- options = Object.assign(Object.assign({}, options), { userAgentOptions: {
17
+ options = {
18
+ ...options,
19
+ userAgentOptions: {
21
20
  userAgentPrefix,
22
- }, loggingOptions: {
23
- logger: (_e = (_d = options.loggingOptions) === null || _d === void 0 ? void 0 : _d.logger) !== null && _e !== void 0 ? _e : logger.info,
24
- }, credentials: {
25
- scopes: (_g = (_f = options.credentials) === null || _f === void 0 ? void 0 : _f.scopes) !== null && _g !== void 0 ? _g : ["https://deid.azure.com/.default"],
26
- } });
21
+ },
22
+ loggingOptions: {
23
+ logger: options.loggingOptions?.logger ?? logger.info,
24
+ },
25
+ credentials: {
26
+ scopes: options.credentials?.scopes ?? ["https://deid.azure.com/.default"],
27
+ },
28
+ };
27
29
  const client = getClient(endpointUrl, credentials, options);
28
30
  client.pipeline.removePolicy({ name: "ApiVersionPolicy" });
29
31
  client.pipeline.addPolicy({
@@ -1 +1 @@
1
- {"version":3,"file":"deidentificationClient.js","sourceRoot":"","sources":["../../src/deidentificationClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAqB,EACrB,WAA4B,EAC5B,KAA2E,EAAE;;QAA7E,EAAE,UAAU,GAAG,YAAY,OAAkD,EAA7C,OAAO,cAAvC,cAAyC,CAAF;IAEvC,MAAM,WAAW,GAAG,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,GAAG,aAAa,EAAE,CAAC;IAC9E,MAAM,aAAa,GAAG,oDAAoD,CAAC;IAC3E,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,EACD,cAAc,EAAE;YACd,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,cAAc,0CAAE,MAAM,mCAAI,MAAM,CAAC,IAAI;SACtD,EACD,WAAW,EAAE;YACX,MAAM,EAAE,MAAA,MAAA,OAAO,CAAC,WAAW,0CAAE,MAAM,mCAAI,CAAC,iCAAiC,CAAC;SAC3E,GACF,CAAC;IACF,MAAM,MAAM,GAAG,SAAS,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAA2B,CAAC;IAEtF,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC;QACxB,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YACzB,qDAAqD;YACrD,yEAAyE;YACzE,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,UAAU,EAAE,CAAC;gBACvD,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,GAClB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { DeidentificationClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface DeidentificationClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `DeidentificationClient`\n * @param endpointParam - Url of your De-identification Service.\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpointParam: string,\n credentials: TokenCredential,\n { apiVersion = \"2024-11-15\", ...options }: DeidentificationClientOptions = {},\n): DeidentificationClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}`;\n const userAgentInfo = `azsdk-js-health-deidentification-rest/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://deid.azure.com/.default\"],\n },\n };\n const client = getClient(endpointUrl, credentials, options) as DeidentificationClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
1
+ {"version":3,"file":"deidentificationClient.js","sourceRoot":"","sources":["../../src/deidentificationClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAqB,EACrB,WAA4B,EAC5B,EAAE,UAAU,GAAG,oBAAoB,EAAE,GAAG,OAAO,KAAoC,EAAE;IAErF,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,IAAI,GAAG,aAAa,EAAE,CAAC;IAC3D,MAAM,aAAa,GAAG,oDAAoD,CAAC;IAC3E,MA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nB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { DeidentificationClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface DeidentificationClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `DeidentificationClient`\n * @param endpointParam - Url of your De-identification Service.\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpointParam: string,\n credentials: TokenCredential,\n { apiVersion = \"2025-07-15-preview\", ...options }: DeidentificationClientOptions = {},\n): DeidentificationClient {\n const endpointUrl = options.endpoint ?? `${endpointParam}`;\n const userAgentInfo = `azsdk-js-health-deidentification-rest/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://deid.azure.com/.default\"],\n },\n };\n const client = getClient(endpointUrl, credentials, options) as DeidentificationClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
@@ -11,7 +11,7 @@ const responseMap = {
11
11
  };
12
12
  export function isUnexpected(response) {
13
13
  const lroOriginal = response.headers["x-ms-original-url"];
14
- const url = new URL(lroOriginal !== null && lroOriginal !== void 0 ? lroOriginal : response.request.url);
14
+ const url = new URL(lroOriginal ?? response.request.url);
15
15
  const method = response.request.method;
16
16
  let pathDetails = responseMap[`${method} ${url.pathname}`];
17
17
  if (!pathDetails) {
@@ -20,7 +20,6 @@ export function isUnexpected(response) {
20
20
  return !pathDetails.includes(response.status);
21
21
  }
22
22
  function getParametrizedPathSuccess(method, path) {
23
- var _a, _b, _c, _d;
24
23
  const pathParts = path.split("/");
25
24
  // Traverse list to match the longest candidate
26
25
  // matchedLen: the length of candidate path
@@ -39,13 +38,13 @@ function getParametrizedPathSuccess(method, path) {
39
38
  // track if we have found a match to return the values found.
40
39
  let found = true;
41
40
  for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
42
- if (((_a = candidateParts[i]) === null || _a === void 0 ? void 0 : _a.startsWith("{")) && ((_b = candidateParts[i]) === null || _b === void 0 ? void 0 : _b.indexOf("}")) !== -1) {
43
- const start = candidateParts[i].indexOf("}") + 1, end = (_c = candidateParts[i]) === null || _c === void 0 ? void 0 : _c.length;
41
+ if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) {
42
+ const start = candidateParts[i].indexOf("}") + 1, end = candidateParts[i]?.length;
44
43
  // If the current part of the candidate is a "template" part
45
44
  // Try to use the suffix of pattern to match the path
46
45
  // {guid} ==> $
47
46
  // {guid}:export ==> :export$
48
- const isMatched = new RegExp(`${(_d = candidateParts[i]) === null || _d === void 0 ? void 0 : _d.slice(start, end)}`).test(pathParts[j] || "");
47
+ const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(pathParts[j] || "");
49
48
  if (!isMatched) {
50
49
  found = false;
51
50
  break;
@@ -1 +1 @@
1
- {"version":3,"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nB,CAAC;gBAEF,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,KAAK,GAAG,KAAK,CAAC;oBACd,MAAM;gBACR,CAAC;gBACD,SAAS;YACX,CAAC;YAED,8CAA8C;YAC9C,wDAAwD;YACxD,2CAA2C;YAC3C,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvC,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;YACR,CAAC;QACH,CAAC;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC;YAC/C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n GetJob200Response,\n GetJobDefaultResponse,\n DeidentifyDocuments200Response,\n DeidentifyDocuments201Response,\n DeidentifyDocumentsLogicalResponse,\n DeidentifyDocumentsDefaultResponse,\n DeleteJob204Response,\n DeleteJobDefaultResponse,\n ListJobs200Response,\n ListJobsDefaultResponse,\n ListJobDocuments200Response,\n ListJobDocumentsDefaultResponse,\n CancelJob200Response,\n CancelJobDefaultResponse,\n DeidentifyText200Response,\n DeidentifyTextDefaultResponse,\n} from \"./responses.js\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /jobs/{name}\": [\"200\"],\n \"PUT /jobs/{name}\": [\"200\", \"201\"],\n \"DELETE /jobs/{name}\": [\"204\"],\n \"GET /jobs\": [\"200\"],\n \"GET /jobs/{name}/documents\": [\"200\"],\n \"POST /jobs/{name}:cancel\": [\"200\"],\n \"POST /deid\": [\"200\"],\n};\n\nexport function isUnexpected(\n response: GetJob200Response | GetJobDefaultResponse,\n): response is GetJobDefaultResponse;\nexport function isUnexpected(\n response:\n | DeidentifyDocuments200Response\n | DeidentifyDocuments201Response\n | DeidentifyDocumentsLogicalResponse\n | DeidentifyDocumentsDefaultResponse,\n): response is DeidentifyDocumentsDefaultResponse;\nexport function isUnexpected(\n response: DeleteJob204Response | DeleteJobDefaultResponse,\n): response is DeleteJobDefaultResponse;\nexport function isUnexpected(\n response: ListJobs200Response | ListJobsDefaultResponse,\n): response is ListJobsDefaultResponse;\nexport function isUnexpected(\n response: ListJobDocuments200Response | ListJobDocumentsDefaultResponse,\n): response is ListJobDocumentsDefaultResponse;\nexport function isUnexpected(\n response: CancelJob200Response | CancelJobDefaultResponse,\n): response is CancelJobDefaultResponse;\nexport function isUnexpected(\n response: DeidentifyText200Response | DeidentifyTextDefaultResponse,\n): response is DeidentifyTextDefaultResponse;\nexport function isUnexpected(\n response:\n | GetJob200Response\n | GetJobDefaultResponse\n | DeidentifyDocuments200Response\n | DeidentifyDocuments201Response\n | DeidentifyDocumentsLogicalResponse\n | DeidentifyDocumentsDefaultResponse\n | DeleteJob204Response\n | DeleteJobDefaultResponse\n | ListJobs200Response\n | ListJobsDefaultResponse\n | ListJobDocuments200Response\n | ListJobDocumentsDefaultResponse\n | CancelJob200Response\n | CancelJobDefaultResponse\n | DeidentifyText200Response\n | DeidentifyTextDefaultResponse,\n): response is\n | GetJobDefaultResponse\n | DeidentifyDocumentsDefaultResponse\n | DeleteJobDefaultResponse\n | ListJobsDefaultResponse\n | ListJobDocumentsDefaultResponse\n | CancelJobDefaultResponse\n | DeidentifyTextDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
1
+ {"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAqBlC,MAAM,WAAW,GAA6B;IAC5C,kBAAkB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CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;gBACvC,KAAK,GAAG,KAAK,CAAC;gBACd,MAAM;YACR,CAAC;QACH,CAAC;QAED,qDAAqD;QACrD,sEAAsE;QACtE,IAAI,KAAK,IAAI,aAAa,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC;YAC/C,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC;YAClC,YAAY,GAAG,KAAK,CAAC;QACvB,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n GetJob200Response,\n GetJobDefaultResponse,\n DeidentifyDocuments200Response,\n DeidentifyDocuments201Response,\n DeidentifyDocumentsLogicalResponse,\n DeidentifyDocumentsDefaultResponse,\n DeleteJob204Response,\n DeleteJobDefaultResponse,\n ListJobs200Response,\n ListJobsDefaultResponse,\n ListJobDocuments200Response,\n ListJobDocumentsDefaultResponse,\n CancelJob200Response,\n CancelJobDefaultResponse,\n DeidentifyText200Response,\n DeidentifyTextDefaultResponse,\n} from \"./responses.js\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /jobs/{name}\": [\"200\"],\n \"PUT /jobs/{name}\": [\"200\", \"201\"],\n \"DELETE /jobs/{name}\": [\"204\"],\n \"GET /jobs\": [\"200\"],\n \"GET /jobs/{name}/documents\": [\"200\"],\n \"POST /jobs/{name}:cancel\": [\"200\"],\n \"POST /deid\": [\"200\"],\n};\n\nexport function isUnexpected(\n response: GetJob200Response | GetJobDefaultResponse,\n): response is GetJobDefaultResponse;\nexport function isUnexpected(\n response:\n | DeidentifyDocuments200Response\n | DeidentifyDocuments201Response\n | DeidentifyDocumentsLogicalResponse\n | DeidentifyDocumentsDefaultResponse,\n): response is DeidentifyDocumentsDefaultResponse;\nexport function isUnexpected(\n response: DeleteJob204Response | DeleteJobDefaultResponse,\n): response is DeleteJobDefaultResponse;\nexport function isUnexpected(\n response: ListJobs200Response | ListJobsDefaultResponse,\n): response is ListJobsDefaultResponse;\nexport function isUnexpected(\n response: ListJobDocuments200Response | ListJobDocumentsDefaultResponse,\n): response is ListJobDocumentsDefaultResponse;\nexport function isUnexpected(\n response: CancelJob200Response | CancelJobDefaultResponse,\n): response is CancelJobDefaultResponse;\nexport function isUnexpected(\n response: DeidentifyText200Response | DeidentifyTextDefaultResponse,\n): response is DeidentifyTextDefaultResponse;\nexport function isUnexpected(\n response:\n | GetJob200Response\n | GetJobDefaultResponse\n | DeidentifyDocuments200Response\n | DeidentifyDocuments201Response\n | DeidentifyDocumentsLogicalResponse\n | DeidentifyDocumentsDefaultResponse\n | DeleteJob204Response\n | DeleteJobDefaultResponse\n | ListJobs200Response\n | ListJobsDefaultResponse\n | ListJobDocuments200Response\n | ListJobDocumentsDefaultResponse\n | CancelJob200Response\n | CancelJobDefaultResponse\n | DeidentifyText200Response\n | DeidentifyTextDefaultResponse,\n): response is\n | GetJobDefaultResponse\n | DeidentifyDocumentsDefaultResponse\n | DeleteJobDefaultResponse\n | ListJobsDefaultResponse\n | ListJobDocumentsDefaultResponse\n | CancelJobDefaultResponse\n | DeidentifyTextDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
@@ -3,7 +3,7 @@ export interface DeidentificationJob {
3
3
  /**
4
4
  * Operation to perform on the input documents.
5
5
  *
6
- * Possible values: "Redact", "Surrogate", "Tag"
6
+ * Possible values: "Redact", "Surrogate", "Tag", "SurrogateOnly"
7
7
  */
8
8
  operation?: DeidentificationOperationType;
9
9
  /** Storage location to perform the operation on. */
@@ -44,11 +44,13 @@ export interface TargetStorageLocation {
44
44
  export interface DeidentificationJobCustomizationOptions {
45
45
  /**
46
46
  * Format of the redacted output. Only valid when Operation is Redact.
47
- * Please refer to https://learn.microsoft.com/en-us/azure/healthcare-apis/deidentification/redaction-format for more details.
47
+ * Please refer to https://learn.microsoft.com/azure/healthcare-apis/deidentification/redaction-format for more details.
48
48
  */
49
49
  redactionFormat?: string;
50
50
  /** Locale in which the output surrogates are written. */
51
51
  surrogateLocale?: string;
52
+ /** Locale of the input text. Used for better PHI detection. Defaults to 'en-US'. */
53
+ inputLocale?: string;
52
54
  }
53
55
  /** Summary metrics of a job. */
54
56
  export interface DeidentificationJobSummary {
@@ -70,24 +72,58 @@ export interface DeidentificationContent {
70
72
  /**
71
73
  * Operation to perform on the input documents.
72
74
  *
73
- * Possible values: "Redact", "Surrogate", "Tag"
75
+ * Possible values: "Redact", "Surrogate", "Tag", "SurrogateOnly"
74
76
  */
75
77
  operation?: DeidentificationOperationType;
78
+ /** Grouped PHI entities with single encoding specification for SurrogateOnly operation. */
79
+ taggedEntities?: TaggedPhiEntities;
76
80
  /** Customization parameters to override default service behaviors. */
77
81
  customizations?: DeidentificationCustomizationOptions;
78
82
  }
83
+ /** Grouped PHI entities with shared encoding specification. */
84
+ export interface TaggedPhiEntities {
85
+ /**
86
+ * The encoding type used for all entities in this group.
87
+ *
88
+ * Possible values: "Utf8", "Utf16", "CodePoint"
89
+ */
90
+ encoding: TextEncodingType;
91
+ /** List of PHI entities using the specified encoding. */
92
+ entities: Array<SimplePhiEntity>;
93
+ }
94
+ /** Simple PHI entity with encoding-specific offset and length values. */
95
+ export interface SimplePhiEntity {
96
+ /**
97
+ * PHI Category of the entity.
98
+ *
99
+ * Possible values: "Unknown", "Account", "Age", "BioID", "City", "CountryOrRegion", "Date", "Device", "Doctor", "Email", "Fax", "HealthPlan", "Hospital", "IDNum", "IPAddress", "License", "LocationOther", "MedicalRecord", "Organization", "Patient", "Phone", "Profession", "SocialSecurity", "State", "Street", "Url", "Username", "Vehicle", "Zip"
100
+ */
101
+ category: PhiCategory;
102
+ /** Starting index of the location from within the input text using the group's encoding. */
103
+ offset: number;
104
+ /** Length of the input text using the group's encoding. */
105
+ length: number;
106
+ /** Text of the entity (optional). */
107
+ text?: string;
108
+ }
79
109
  /** Customizations options to override default service behaviors for synchronous usage. */
80
110
  export interface DeidentificationCustomizationOptions {
81
111
  /**
82
112
  * Format of the redacted output. Only valid when Operation is Redact.
83
- * Please refer to https://learn.microsoft.com/en-us/azure/healthcare-apis/deidentification/redaction-format for more details.
113
+ * Please refer to https://learn.microsoft.com/azure/healthcare-apis/deidentification/redaction-format for more details.
84
114
  */
85
115
  redactionFormat?: string;
86
116
  /** Locale in which the output surrogates are written. */
87
117
  surrogateLocale?: string;
118
+ /** Locale of the input text. Used for better PHI detection. Defaults to 'en-US'. */
119
+ inputLocale?: string;
88
120
  }
89
121
  /** Alias for DeidentificationOperationType */
90
122
  export type DeidentificationOperationType = string;
91
123
  /** Alias for OperationState */
92
124
  export type OperationState = string;
125
+ /** Alias for TextEncodingType */
126
+ export type TextEncodingType = string;
127
+ /** Alias for PhiCategory */
128
+ export type PhiCategory = string;
93
129
  //# sourceMappingURL=models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** A job containing a batch of documents to de-identify. */\nexport interface DeidentificationJob {\n /**\n * Operation to perform on the input documents.\n *\n * Possible values: \"Redact\", \"Surrogate\", \"Tag\"\n */\n operation?: DeidentificationOperationType;\n /** Storage location to perform the operation on. */\n sourceLocation: SourceStorageLocation;\n /** Target location to store output of operation. */\n targetLocation: TargetStorageLocation;\n /** Customization parameters to override default service behaviors. */\n customizations?: DeidentificationJobCustomizationOptions;\n}\n\n/** Storage location. */\nexport interface SourceStorageLocation {\n /** URL to storage location. */\n location: string;\n /** Prefix to filter path by. */\n prefix: string;\n /** List of extensions to filter path by. */\n extensions?: string[];\n}\n\n/** Storage location. */\nexport interface TargetStorageLocation {\n /** URL to storage location. */\n location: string;\n /**\n * Replaces the input prefix of a file path with the output prefix, preserving the rest of the path structure.\n *\n * Example:\n * File full path: documents/user/note.txt\n * Input Prefix: \"documents/user/\"\n * Output Prefix: \"output_docs/\"\n *\n * Output file: \"output_docs/note.txt\"\n */\n prefix: string;\n /** When set to true during a job, the service will overwrite the output location if it already exists. */\n overwrite?: boolean;\n}\n\n/** Customizations options to override default service behaviors for job usage. */\nexport interface DeidentificationJobCustomizationOptions {\n /**\n * Format of the redacted output. Only valid when Operation is Redact.\n * Please refer to https://learn.microsoft.com/en-us/azure/healthcare-apis/deidentification/redaction-format for more details.\n */\n redactionFormat?: string;\n /** Locale in which the output surrogates are written. */\n surrogateLocale?: string;\n}\n\n/** Summary metrics of a job. */\nexport interface DeidentificationJobSummary {\n /** Number of documents that have completed. */\n successful: number;\n /** Number of documents that have failed. */\n failed: number;\n /** Number of documents that have been canceled. */\n canceled: number;\n /** Number of documents total. */\n total: number;\n /** Number of bytes processed. */\n bytesProcessed: number;\n}\n\n/** Request body for de-identification operation. */\nexport interface DeidentificationContent {\n /** Input text to de-identify. */\n inputText: string;\n /**\n * Operation to perform on the input documents.\n *\n * Possible values: \"Redact\", \"Surrogate\", \"Tag\"\n */\n operation?: DeidentificationOperationType;\n /** Customization parameters to override default service behaviors. */\n customizations?: DeidentificationCustomizationOptions;\n}\n\n/** Customizations options to override default service behaviors for synchronous usage. */\nexport interface DeidentificationCustomizationOptions {\n /**\n * Format of the redacted output. Only valid when Operation is Redact.\n * Please refer to https://learn.microsoft.com/en-us/azure/healthcare-apis/deidentification/redaction-format for more details.\n */\n redactionFormat?: string;\n /** Locale in which the output surrogates are written. */\n surrogateLocale?: string;\n}\n\n/** Alias for DeidentificationOperationType */\nexport type DeidentificationOperationType = string;\n/** Alias for OperationState */\nexport type OperationState = string;\n"]}
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** A job containing a batch of documents to de-identify. */\nexport interface DeidentificationJob {\n /**\n * Operation to perform on the input documents.\n *\n * Possible values: \"Redact\", \"Surrogate\", \"Tag\", \"SurrogateOnly\"\n */\n operation?: DeidentificationOperationType;\n /** Storage location to perform the operation on. */\n sourceLocation: SourceStorageLocation;\n /** Target location to store output of operation. */\n targetLocation: TargetStorageLocation;\n /** Customization parameters to override default service behaviors. */\n customizations?: DeidentificationJobCustomizationOptions;\n}\n\n/** Storage location. */\nexport interface SourceStorageLocation {\n /** URL to storage location. */\n location: string;\n /** Prefix to filter path by. */\n prefix: string;\n /** List of extensions to filter path by. */\n extensions?: string[];\n}\n\n/** Storage location. */\nexport interface TargetStorageLocation {\n /** URL to storage location. */\n location: string;\n /**\n * Replaces the input prefix of a file path with the output prefix, preserving the rest of the path structure.\n *\n * Example:\n * File full path: documents/user/note.txt\n * Input Prefix: \"documents/user/\"\n * Output Prefix: \"output_docs/\"\n *\n * Output file: \"output_docs/note.txt\"\n */\n prefix: string;\n /** When set to true during a job, the service will overwrite the output location if it already exists. */\n overwrite?: boolean;\n}\n\n/** Customizations options to override default service behaviors for job usage. */\nexport interface DeidentificationJobCustomizationOptions {\n /**\n * Format of the redacted output. Only valid when Operation is Redact.\n * Please refer to https://learn.microsoft.com/azure/healthcare-apis/deidentification/redaction-format for more details.\n */\n redactionFormat?: string;\n /** Locale in which the output surrogates are written. */\n surrogateLocale?: string;\n /** Locale of the input text. Used for better PHI detection. Defaults to 'en-US'. */\n inputLocale?: string;\n}\n\n/** Summary metrics of a job. */\nexport interface DeidentificationJobSummary {\n /** Number of documents that have completed. */\n successful: number;\n /** Number of documents that have failed. */\n failed: number;\n /** Number of documents that have been canceled. */\n canceled: number;\n /** Number of documents total. */\n total: number;\n /** Number of bytes processed. */\n bytesProcessed: number;\n}\n\n/** Request body for de-identification operation. */\nexport interface DeidentificationContent {\n /** Input text to de-identify. */\n inputText: string;\n /**\n * Operation to perform on the input documents.\n *\n * Possible values: \"Redact\", \"Surrogate\", \"Tag\", \"SurrogateOnly\"\n */\n operation?: DeidentificationOperationType;\n /** Grouped PHI entities with single encoding specification for SurrogateOnly operation. */\n taggedEntities?: TaggedPhiEntities;\n /** Customization parameters to override default service behaviors. */\n customizations?: DeidentificationCustomizationOptions;\n}\n\n/** Grouped PHI entities with shared encoding specification. */\nexport interface TaggedPhiEntities {\n /**\n * The encoding type used for all entities in this group.\n *\n * Possible values: \"Utf8\", \"Utf16\", \"CodePoint\"\n */\n encoding: TextEncodingType;\n /** List of PHI entities using the specified encoding. */\n entities: Array<SimplePhiEntity>;\n}\n\n/** Simple PHI entity with encoding-specific offset and length values. */\nexport interface SimplePhiEntity {\n /**\n * PHI Category of the entity.\n *\n * Possible values: \"Unknown\", \"Account\", \"Age\", \"BioID\", \"City\", \"CountryOrRegion\", \"Date\", \"Device\", \"Doctor\", \"Email\", \"Fax\", \"HealthPlan\", \"Hospital\", \"IDNum\", \"IPAddress\", \"License\", \"LocationOther\", \"MedicalRecord\", \"Organization\", \"Patient\", \"Phone\", \"Profession\", \"SocialSecurity\", \"State\", \"Street\", \"Url\", \"Username\", \"Vehicle\", \"Zip\"\n */\n category: PhiCategory;\n /** Starting index of the location from within the input text using the group's encoding. */\n offset: number;\n /** Length of the input text using the group's encoding. */\n length: number;\n /** Text of the entity (optional). */\n text?: string;\n}\n\n/** Customizations options to override default service behaviors for synchronous usage. */\nexport interface DeidentificationCustomizationOptions {\n /**\n * Format of the redacted output. Only valid when Operation is Redact.\n * Please refer to https://learn.microsoft.com/azure/healthcare-apis/deidentification/redaction-format for more details.\n */\n redactionFormat?: string;\n /** Locale in which the output surrogates are written. */\n surrogateLocale?: string;\n /** Locale of the input text. Used for better PHI detection. Defaults to 'en-US'. */\n inputLocale?: string;\n}\n\n/** Alias for DeidentificationOperationType */\nexport type DeidentificationOperationType = string;\n/** Alias for OperationState */\nexport type OperationState = string;\n/** Alias for TextEncodingType */\nexport type TextEncodingType = string;\n/** Alias for PhiCategory */\nexport type PhiCategory = string;\n"]}
@@ -6,7 +6,7 @@ export interface DeidentificationJobOutput {
6
6
  /**
7
7
  * Operation to perform on the input documents.
8
8
  *
9
- * Possible values: "Redact", "Surrogate", "Tag"
9
+ * Possible values: "Redact", "Surrogate", "Tag", "SurrogateOnly"
10
10
  */
11
11
  operation?: DeidentificationOperationTypeOutput;
12
12
  /** Storage location to perform the operation on. */
@@ -69,11 +69,13 @@ export interface TargetStorageLocationOutput {
69
69
  export interface DeidentificationJobCustomizationOptionsOutput {
70
70
  /**
71
71
  * Format of the redacted output. Only valid when Operation is Redact.
72
- * Please refer to https://learn.microsoft.com/en-us/azure/healthcare-apis/deidentification/redaction-format for more details.
72
+ * Please refer to https://learn.microsoft.com/azure/healthcare-apis/deidentification/redaction-format for more details.
73
73
  */
74
74
  redactionFormat?: string;
75
75
  /** Locale in which the output surrogates are written. */
76
76
  surrogateLocale?: string;
77
+ /** Locale of the input text. Used for better PHI detection. Defaults to 'en-US'. */
78
+ inputLocale?: string;
77
79
  }
78
80
  /** Summary metrics of a job. */
79
81
  export interface DeidentificationJobSummaryOutput {
@@ -1 +1 @@
1
- {"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ErrorModel } from \"@azure-rest/core-client\";\n\n/** A job containing a batch of documents to de-identify. */\nexport interface DeidentificationJobOutput {\n /** The name of a job. */\n readonly name: string;\n /**\n * Operation to perform on the input documents.\n *\n * Possible values: \"Redact\", \"Surrogate\", \"Tag\"\n */\n operation?: DeidentificationOperationTypeOutput;\n /** Storage location to perform the operation on. */\n sourceLocation: SourceStorageLocationOutput;\n /** Target location to store output of operation. */\n targetLocation: TargetStorageLocationOutput;\n /** Customization parameters to override default service behaviors. */\n customizations?: DeidentificationJobCustomizationOptionsOutput;\n /**\n * Current status of a job.\n *\n * Possible values: \"NotStarted\", \"Running\", \"Succeeded\", \"Failed\", \"Canceled\"\n */\n readonly status: OperationStateOutput;\n /** Error when job fails in it's entirety. */\n readonly error?: ErrorModel;\n /**\n * Date and time when the job was completed.\n *\n * If the job is canceled, this is the time when the job was canceled.\n *\n * If the job failed, this is the time when the job failed.\n */\n readonly lastUpdatedAt: string;\n /** Date and time when the job was created. */\n readonly createdAt: string;\n /** Date and time when the job was started. */\n readonly startedAt?: string;\n /** Summary of a job. Exists only when the job is completed. */\n readonly summary?: DeidentificationJobSummaryOutput;\n}\n\n/** Storage location. */\nexport interface SourceStorageLocationOutput {\n /** URL to storage location. */\n location: string;\n /** Prefix to filter path by. */\n prefix: string;\n /** List of extensions to filter path by. */\n extensions?: string[];\n}\n\n/** Storage location. */\nexport interface TargetStorageLocationOutput {\n /** URL to storage location. */\n location: string;\n /**\n * Replaces the input prefix of a file path with the output prefix, preserving the rest of the path structure.\n *\n * Example:\n * File full path: documents/user/note.txt\n * Input Prefix: \"documents/user/\"\n * Output Prefix: \"output_docs/\"\n *\n * Output file: \"output_docs/note.txt\"\n */\n prefix: string;\n /** When set to true during a job, the service will overwrite the output location if it already exists. */\n overwrite?: boolean;\n}\n\n/** Customizations options to override default service behaviors for job usage. */\nexport interface DeidentificationJobCustomizationOptionsOutput {\n /**\n * Format of the redacted output. Only valid when Operation is Redact.\n * Please refer to https://learn.microsoft.com/en-us/azure/healthcare-apis/deidentification/redaction-format for more details.\n */\n redactionFormat?: string;\n /** Locale in which the output surrogates are written. */\n surrogateLocale?: string;\n}\n\n/** Summary metrics of a job. */\nexport interface DeidentificationJobSummaryOutput {\n /** Number of documents that have completed. */\n successful: number;\n /** Number of documents that have failed. */\n failed: number;\n /** Number of documents that have been canceled. */\n canceled: number;\n /** Number of documents total. */\n total: number;\n /** Number of bytes processed. */\n bytesProcessed: number;\n}\n\n/** Paged collection of DeidentificationJob items */\nexport interface PagedDeidentificationJobOutput {\n /** The DeidentificationJob items on this page */\n value: Array<DeidentificationJobOutput>;\n /** The link to the next page of items */\n nextLink?: string;\n}\n\n/** Paged collection of DeidentificationDocumentDetails items */\nexport interface PagedDeidentificationDocumentDetailsOutput {\n /** The DeidentificationDocumentDetails items on this page */\n value: Array<DeidentificationDocumentDetailsOutput>;\n /** The link to the next page of items */\n nextLink?: string;\n}\n\n/** Details of a single document in a job. */\nexport interface DeidentificationDocumentDetailsOutput {\n /** Id of the document details. */\n readonly id: string;\n /** Location for the input. */\n input: DeidentificationDocumentLocationOutput;\n /** Location for the output. */\n output?: DeidentificationDocumentLocationOutput;\n /**\n * Status of the document.\n *\n * Possible values: \"NotStarted\", \"Running\", \"Succeeded\", \"Failed\", \"Canceled\"\n */\n status: OperationStateOutput;\n /** Error when document fails. */\n error?: ErrorModel;\n}\n\n/** Location of a document. */\nexport interface DeidentificationDocumentLocationOutput {\n /** Location of document in storage. */\n location: string;\n /** The entity tag for this resource. */\n readonly etag: string;\n}\n\n/** Response body for de-identification operation. */\nexport interface DeidentificationResultOutput {\n /** Output text after de-identification. Not available for \"Tag\" operation. */\n outputText?: string;\n /** Result of the \"Tag\" operation. Only available for \"Tag\" Operation. */\n taggerResult?: PhiTaggerResultOutput;\n}\n\n/** Result of the \"Tag\" operation. */\nexport interface PhiTaggerResultOutput {\n /** List of entities detected in the input. */\n entities: Array<PhiEntityOutput>;\n}\n\n/** PHI Entity tag in the input. */\nexport interface PhiEntityOutput {\n /**\n * PHI Category of the entity.\n *\n * Possible values: \"Unknown\", \"Account\", \"Age\", \"BioID\", \"City\", \"CountryOrRegion\", \"Date\", \"Device\", \"Doctor\", \"Email\", \"Fax\", \"HealthPlan\", \"Hospital\", \"IDNum\", \"IPAddress\", \"License\", \"LocationOther\", \"MedicalRecord\", \"Organization\", \"Patient\", \"Phone\", \"Profession\", \"SocialSecurity\", \"State\", \"Street\", \"Url\", \"Username\", \"Vehicle\", \"Zip\"\n */\n category: PhiCategoryOutput;\n /** Starting index of the location from within the input text. */\n offset: StringIndexOutput;\n /** Length of the input text. */\n length: StringIndexOutput;\n /** Text of the entity. */\n text?: string;\n /** Confidence score of the category match. */\n confidenceScore?: number;\n}\n\n/** String index encoding model. */\nexport interface StringIndexOutput {\n /** The offset or length of the substring in UTF-8 encoding */\n utf8: number;\n /**\n * The offset or length of the substring in UTF-16 encoding.\n *\n * Primary encoding used by .NET, Java, and JavaScript.\n */\n utf16: number;\n /**\n * The offset or length of the substring in CodePoint encoding.\n *\n * Primary encoding used by Python.\n */\n codePoint: number;\n}\n\n/** Alias for DeidentificationOperationTypeOutput */\nexport type DeidentificationOperationTypeOutput = string;\n/** Alias for OperationStateOutput */\nexport type OperationStateOutput = string;\n/** Alias for PhiCategoryOutput */\nexport type PhiCategoryOutput = string;\n"]}
1
+ {"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ErrorModel } from \"@azure-rest/core-client\";\n\n/** A job containing a batch of documents to de-identify. */\nexport interface DeidentificationJobOutput {\n /** The name of a job. */\n readonly name: string;\n /**\n * Operation to perform on the input documents.\n *\n * Possible values: \"Redact\", \"Surrogate\", \"Tag\", \"SurrogateOnly\"\n */\n operation?: DeidentificationOperationTypeOutput;\n /** Storage location to perform the operation on. */\n sourceLocation: SourceStorageLocationOutput;\n /** Target location to store output of operation. */\n targetLocation: TargetStorageLocationOutput;\n /** Customization parameters to override default service behaviors. */\n customizations?: DeidentificationJobCustomizationOptionsOutput;\n /**\n * Current status of a job.\n *\n * Possible values: \"NotStarted\", \"Running\", \"Succeeded\", \"Failed\", \"Canceled\"\n */\n readonly status: OperationStateOutput;\n /** Error when job fails in it's entirety. */\n readonly error?: ErrorModel;\n /**\n * Date and time when the job was completed.\n *\n * If the job is canceled, this is the time when the job was canceled.\n *\n * If the job failed, this is the time when the job failed.\n */\n readonly lastUpdatedAt: string;\n /** Date and time when the job was created. */\n readonly createdAt: string;\n /** Date and time when the job was started. */\n readonly startedAt?: string;\n /** Summary of a job. Exists only when the job is completed. */\n readonly summary?: DeidentificationJobSummaryOutput;\n}\n\n/** Storage location. */\nexport interface SourceStorageLocationOutput {\n /** URL to storage location. */\n location: string;\n /** Prefix to filter path by. */\n prefix: string;\n /** List of extensions to filter path by. */\n extensions?: string[];\n}\n\n/** Storage location. */\nexport interface TargetStorageLocationOutput {\n /** URL to storage location. */\n location: string;\n /**\n * Replaces the input prefix of a file path with the output prefix, preserving the rest of the path structure.\n *\n * Example:\n * File full path: documents/user/note.txt\n * Input Prefix: \"documents/user/\"\n * Output Prefix: \"output_docs/\"\n *\n * Output file: \"output_docs/note.txt\"\n */\n prefix: string;\n /** When set to true during a job, the service will overwrite the output location if it already exists. */\n overwrite?: boolean;\n}\n\n/** Customizations options to override default service behaviors for job usage. */\nexport interface DeidentificationJobCustomizationOptionsOutput {\n /**\n * Format of the redacted output. Only valid when Operation is Redact.\n * Please refer to https://learn.microsoft.com/azure/healthcare-apis/deidentification/redaction-format for more details.\n */\n redactionFormat?: string;\n /** Locale in which the output surrogates are written. */\n surrogateLocale?: string;\n /** Locale of the input text. Used for better PHI detection. Defaults to 'en-US'. */\n inputLocale?: string;\n}\n\n/** Summary metrics of a job. */\nexport interface DeidentificationJobSummaryOutput {\n /** Number of documents that have completed. */\n successful: number;\n /** Number of documents that have failed. */\n failed: number;\n /** Number of documents that have been canceled. */\n canceled: number;\n /** Number of documents total. */\n total: number;\n /** Number of bytes processed. */\n bytesProcessed: number;\n}\n\n/** Paged collection of DeidentificationJob items */\nexport interface PagedDeidentificationJobOutput {\n /** The DeidentificationJob items on this page */\n value: Array<DeidentificationJobOutput>;\n /** The link to the next page of items */\n nextLink?: string;\n}\n\n/** Paged collection of DeidentificationDocumentDetails items */\nexport interface PagedDeidentificationDocumentDetailsOutput {\n /** The DeidentificationDocumentDetails items on this page */\n value: Array<DeidentificationDocumentDetailsOutput>;\n /** The link to the next page of items */\n nextLink?: string;\n}\n\n/** Details of a single document in a job. */\nexport interface DeidentificationDocumentDetailsOutput {\n /** Id of the document details. */\n readonly id: string;\n /** Location for the input. */\n input: DeidentificationDocumentLocationOutput;\n /** Location for the output. */\n output?: DeidentificationDocumentLocationOutput;\n /**\n * Status of the document.\n *\n * Possible values: \"NotStarted\", \"Running\", \"Succeeded\", \"Failed\", \"Canceled\"\n */\n status: OperationStateOutput;\n /** Error when document fails. */\n error?: ErrorModel;\n}\n\n/** Location of a document. */\nexport interface DeidentificationDocumentLocationOutput {\n /** Location of document in storage. */\n location: string;\n /** The entity tag for this resource. */\n readonly etag: string;\n}\n\n/** Response body for de-identification operation. */\nexport interface DeidentificationResultOutput {\n /** Output text after de-identification. Not available for \"Tag\" operation. */\n outputText?: string;\n /** Result of the \"Tag\" operation. Only available for \"Tag\" Operation. */\n taggerResult?: PhiTaggerResultOutput;\n}\n\n/** Result of the \"Tag\" operation. */\nexport interface PhiTaggerResultOutput {\n /** List of entities detected in the input. */\n entities: Array<PhiEntityOutput>;\n}\n\n/** PHI Entity tag in the input. */\nexport interface PhiEntityOutput {\n /**\n * PHI Category of the entity.\n *\n * Possible values: \"Unknown\", \"Account\", \"Age\", \"BioID\", \"City\", \"CountryOrRegion\", \"Date\", \"Device\", \"Doctor\", \"Email\", \"Fax\", \"HealthPlan\", \"Hospital\", \"IDNum\", \"IPAddress\", \"License\", \"LocationOther\", \"MedicalRecord\", \"Organization\", \"Patient\", \"Phone\", \"Profession\", \"SocialSecurity\", \"State\", \"Street\", \"Url\", \"Username\", \"Vehicle\", \"Zip\"\n */\n category: PhiCategoryOutput;\n /** Starting index of the location from within the input text. */\n offset: StringIndexOutput;\n /** Length of the input text. */\n length: StringIndexOutput;\n /** Text of the entity. */\n text?: string;\n /** Confidence score of the category match. */\n confidenceScore?: number;\n}\n\n/** String index encoding model. */\nexport interface StringIndexOutput {\n /** The offset or length of the substring in UTF-8 encoding */\n utf8: number;\n /**\n * The offset or length of the substring in UTF-16 encoding.\n *\n * Primary encoding used by .NET, Java, and JavaScript.\n */\n utf16: number;\n /**\n * The offset or length of the substring in CodePoint encoding.\n *\n * Primary encoding used by Python.\n */\n codePoint: number;\n}\n\n/** Alias for DeidentificationOperationTypeOutput */\nexport type DeidentificationOperationTypeOutput = string;\n/** Alias for OperationStateOutput */\nexport type OperationStateOutput = string;\n/** Alias for PhiCategoryOutput */\nexport type PhiCategoryOutput = string;\n"]}