diff --git a/cSpell.json b/cSpell.json index 03b19285d2af..1345a57bd41a 100644 --- a/cSpell.json +++ b/cSpell.json @@ -777,7 +777,6 @@ "psqldb" ] }, - { "filename": "**/specification/maps/data-plane/Microsoft.Maps/Render/preview/1.0/render.json", "words": [ @@ -989,6 +988,14 @@ "throughputpool" ] }, + { + "filename": "**/specification/healthdataaiservices/**/*.json", + "words": [ + "deidentification", + "deidentify", + "surrogation" + ] + }, { "filename": "**/specification/search/data-plane/Azure.Search/**/*.json", "words": [ diff --git a/specification/deidentification/data-plane/Microsoft.HealthDataAIServices/preview/2024-01-31-preview/deidentification.json b/specification/deidentification/data-plane/Microsoft.HealthDataAIServices/preview/2024-01-31-preview/deidentification.json deleted file mode 100644 index 62ec528b8068..000000000000 --- a/specification/deidentification/data-plane/Microsoft.HealthDataAIServices/preview/2024-01-31-preview/deidentification.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "version": "2024-01-31-preview", - "title": "deidentification", - "description": "Description of the new service", - "x-ms-code-generation-settings": { - "name": "deidentificationClient" - } - }, - "host": "management.azure.com", - "schemes": ["https"], - "consumes": ["application/json"], - "produces": ["application/json"], - "security": [ - { - "azure_auth": ["user_impersonation"] - } - ], - "securityDefinitions": { - "azure_auth": { - "type": "oauth2", - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", - "flow": "implicit", - "description": "Azure Active Directory OAuth2 Flow", - "scopes": { - "user_impersonation": "impersonate your user account" - } - } - }, - "paths": { - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/operations": { - "get": { - "tags": ["Tag1"], - "operationId": "OperationGroup_Get", - "x-ms-examples": { - "BatchAccountDelete": { "$ref": "./examples/OperationGroupGet.json" } - }, - "description": "This is a sample get operation, please see guidelines in azure-rest-api-specs repository for more info", - "parameters": [ - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ResourceGroupNameParameter" - } - ], - "responses": { - "200": { - "description": "Describe the result of a successful operation.", - "schema": { - "$ref": "#/definitions/Result" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - } - } - } - }, - "definitions": { - "Result": { - "description": "Sample result definition", - "properties": { - "sampleProperty": { - "type": "string", - "description": "Sample property of type string" - } - } - }, - "ErrorResponse": { - "description": "Error response.", - "properties": { - "error": { - "$ref": "#/definitions/ErrorDefinition", - "description": "The error details." - } - } - }, - "ErrorDefinition": { - "description": "Error definition.", - "properties": { - "code": { - "description": "Service specific error code which serves as the substatus for the HTTP error code.", - "type": "string", - "readOnly": true - }, - "message": { - "description": "Description of the error.", - "type": "string", - "readOnly": true - }, - "details": { - "description": "Internal error details.", - "type": "array", - "items": { - "$ref": "#/definitions/ErrorDefinition" - }, - "readOnly": true - } - } - } - }, - "parameters": { - "SubscriptionIdParameter": { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string", - "description": "The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)" - }, - "ResourceGroupNameParameter": { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group.", - "x-ms-parameter-location": "method" - }, - "ApiVersionParameter": { - "name": "api-version", - "in": "query", - "required": true, - "type": "string", - "description": "The API version to be used with the HTTP request." - } - } -} diff --git a/specification/deidentification/data-plane/Microsoft.HealthDataAIServices/preview/2024-01-31-preview/examples/OperationGroupGet.json b/specification/deidentification/data-plane/Microsoft.HealthDataAIServices/preview/2024-01-31-preview/examples/OperationGroupGet.json deleted file mode 100644 index f9ba8151eea0..000000000000 --- a/specification/deidentification/data-plane/Microsoft.HealthDataAIServices/preview/2024-01-31-preview/examples/OperationGroupGet.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "parameters": { - "accountName": "sampleacct", - "resourceGroupName": "deidentificationClient", - "api-version": "2024-01-31-preview", - "subscriptionId": "subid" - }, - "responses": { - "200": { - "body": { - "sampleProperty": "sampleProperty" - } - } - } -} diff --git a/specification/healthdataaiservices/HealthDataAIServices.Deidentification/client.tsp b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/client.tsp new file mode 100644 index 000000000000..164fc28c837f --- /dev/null +++ b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/client.tsp @@ -0,0 +1,5 @@ +/** + * PLACEHOLDER + * Add readme and sample + */ +import "./main.tsp"; diff --git a/specification/healthdataaiservices/HealthDataAIServices.Deidentification/examples/2024-01-31-preview/Jobs_Cancel.json b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/examples/2024-01-31-preview/Jobs_Cancel.json new file mode 100644 index 000000000000..94b107557736 --- /dev/null +++ b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/examples/2024-01-31-preview/Jobs_Cancel.json @@ -0,0 +1,41 @@ +{ + "title": "Cancel a DeID Job", + "operationId": "Jobs_Cancel", + "parameters": { + "api-version": "2024-01-31-preview", + "name": "documents_smith_1", + "x-ms-client-request-id": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "name": "documents_smith_1", + "sourceLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents", + "extensions": [ + "*" + ] + }, + "targetLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents" + }, + "dataType": "PlainText", + "operation": "Redact", + "redactionFormat": "[{type}]", + "status": "Canceled", + "createdAt": "2024-01-25T23:27:43.009Z", + "startedAt": "2024-01-25T23:27:43.009Z", + "completedAt": "2024-01-25T23:27:43.009Z", + "summary": { + "successful": 10, + "failed": 0, + "canceled": 2, + "total": 12, + "bytesProcessed": 4096 + } + } + } + } +} diff --git a/specification/healthdataaiservices/HealthDataAIServices.Deidentification/examples/2024-01-31-preview/Jobs_Create.json b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/examples/2024-01-31-preview/Jobs_Create.json new file mode 100644 index 000000000000..7982b7ced074 --- /dev/null +++ b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/examples/2024-01-31-preview/Jobs_Create.json @@ -0,0 +1,72 @@ +{ + "title": "Create a DeID Job", + "operationId": "Jobs_Create", + "parameters": { + "api-version": "2024-01-31-preview", + "name": "documents_smith_1", + "x-ms-client-request-id": "00000000-0000-0000-0000-000000000000", + "resource": { + "sourceLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents", + "extensions": [ + "*" + ] + }, + "targetLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents" + }, + "dataType": "PlainText", + "operation": "Redact", + "redactionFormat": "[{type}]" + } + }, + "responses": { + "200": { + "body": { + "name": "documents_smith_1", + "sourceLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents", + "extensions": [ + "*" + ] + }, + "targetLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents" + }, + "dataType": "PlainText", + "operation": "Redact", + "redactionFormat": "[{type}]", + "status": "NotStarted", + "createdAt": "2024-01-25T23:27:43.009Z" + } + }, + "201": { + "headers": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D" + }, + "body": { + "name": "documents_smith_1", + "sourceLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents", + "extensions": [ + "*" + ] + }, + "targetLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents" + }, + "dataType": "PlainText", + "operation": "Redact", + "redactionFormat": "[{type}]", + "status": "NotStarted", + "createdAt": "2024-01-25T23:27:43.009Z" + } + } + } +} diff --git a/specification/healthdataaiservices/HealthDataAIServices.Deidentification/examples/2024-01-31-preview/Jobs_Delete.json b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/examples/2024-01-31-preview/Jobs_Delete.json new file mode 100644 index 000000000000..b0ae94ac1450 --- /dev/null +++ b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/examples/2024-01-31-preview/Jobs_Delete.json @@ -0,0 +1,12 @@ +{ + "title": "Delete a DeID Job", + "operationId": "Jobs_Delete", + "parameters": { + "api-version": "2024-01-31-preview", + "name": "documents_smith_1", + "x-ms-client-request-id": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "204": {} + } +} diff --git a/specification/healthdataaiservices/HealthDataAIServices.Deidentification/examples/2024-01-31-preview/Jobs_Get.json b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/examples/2024-01-31-preview/Jobs_Get.json new file mode 100644 index 000000000000..a9289d29bcd1 --- /dev/null +++ b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/examples/2024-01-31-preview/Jobs_Get.json @@ -0,0 +1,41 @@ +{ + "title": "Get a DeID Job", + "operationId": "Jobs_Get", + "parameters": { + "api-version": "2024-01-31-preview", + "name": "documents_smith_1", + "x-ms-client-request-id": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "name": "documents_smith_1", + "sourceLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents", + "extensions": [ + "*" + ] + }, + "targetLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents" + }, + "dataType": "PlainText", + "operation": "Redact", + "redactionFormat": "[{type}]", + "status": "Succeeded", + "createdAt": "2024-01-25T23:27:43.009Z", + "startedAt": "2024-01-25T23:27:43.009Z", + "completedAt": "2024-01-25T23:27:43.009Z", + "summary": { + "successful": 10, + "failed": 0, + "canceled": 0, + "total": 10, + "bytesProcessed": 4096 + } + } + } + } +} diff --git a/specification/healthdataaiservices/HealthDataAIServices.Deidentification/examples/2024-01-31-preview/Jobs_List.json b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/examples/2024-01-31-preview/Jobs_List.json new file mode 100644 index 000000000000..6cd2cc52e1ae --- /dev/null +++ b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/examples/2024-01-31-preview/Jobs_List.json @@ -0,0 +1,48 @@ +{ + "title": "List DeID Jobs", + "operationId": "Jobs_List", + "parameters": { + "api-version": "2024-01-31-preview", + "top": 10, + "skip": 10, + "maxpagesize": 10, + "x-ms-client-request-id": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "documents_smith_1", + "sourceLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents", + "extensions": [ + "*" + ] + }, + "targetLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents" + }, + "dataType": "PlainText", + "operation": "Redact", + "redactionFormat": "[{type}]", + "status": "Succeeded", + "createdAt": "2024-01-25T23:27:43.009Z", + "startedAt": "2024-01-25T23:27:43.009Z", + "completedAt": "2024-01-25T23:27:43.009Z", + "summary": { + "successful": 10, + "failed": 0, + "canceled": 0, + "total": 10, + "bytesProcessed": 4096 + } + } + ], + "nextLink": "https://deidtest.api.deid.azure.com/jobs?top=10&skip=10&maxpagesize=10" + } + } + } +} diff --git a/specification/healthdataaiservices/HealthDataAIServices.Deidentification/examples/2024-01-31-preview/Jobs_ListFiles.json b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/examples/2024-01-31-preview/Jobs_ListFiles.json new file mode 100644 index 000000000000..e1966a2f2cc1 --- /dev/null +++ b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/examples/2024-01-31-preview/Jobs_ListFiles.json @@ -0,0 +1,27 @@ +{ + "title": "List processed files within a Job", + "operationId": "Jobs_ListFiles", + "parameters": { + "api-version": "2024-01-31-preview", + "name": "documents_smith_1", + "top": 10, + "skip": 10, + "maxpagesize": 10, + "x-ms-client-request-id": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "path": "/documents/patient_doc_1", + "status": "Failed", + "explanation": "File was moved after job started.", + "etag": "0x8DB638EEA0CC717" + } + ], + "nextLink": "https://deidtest.api.deid.azure.com/jobs/00000000-0000-0000-0000-000000000000/files?top=10&skip=10&maxpagesize=10" + } + } + } +} diff --git a/specification/healthdataaiservices/HealthDataAIServices.Deidentification/examples/2024-01-31-preview/RealtimeOperations_Deid.json b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/examples/2024-01-31-preview/RealtimeOperations_Deid.json new file mode 100644 index 000000000000..9a390544e35c --- /dev/null +++ b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/examples/2024-01-31-preview/RealtimeOperations_Deid.json @@ -0,0 +1,33 @@ +{ + "title": "Realtime Synchronous Deidentification.", + "operationId": "RealtimeOperations_Deid", + "parameters": { + "api-version": "2024-01-31-preview", + "body": { + "inputText": "Hello my name is John Smith.", + "dataType": "PlainText", + "operation": "Redact", + "stringIndexType": "TextElement_v8", + "redactionFormat": "[{type}]" + } + }, + "responses": { + "200": { + "body": { + "outputText": "Hello my name is [name].", + "taggerResult": { + "entities": [ + { + "category": "Patient", + "offset": 17, + "length": 10, + "text": "John Smith", + "confidenceScore": 0.83 + } + ], + "stringIndexType": "TextElement_v8" + } + } + } + } +} diff --git a/specification/healthdataaiservices/HealthDataAIServices.Deidentification/main.tsp b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/main.tsp new file mode 100644 index 000000000000..564ca9047d86 --- /dev/null +++ b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/main.tsp @@ -0,0 +1,44 @@ +import "@typespec/rest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-core"; +import "./routes.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Azure.Core; +using Azure.Core.Traits; + +#suppress "@azure-tools/typespec-azure-core/casing-style" +@useAuth(AadToken) +@service({ + title: "HealthDataAIServices.Deidentification Service", +}) +@server( + "https://{deid-service-uri}", + "Azure Health Deidentification Service", + { + @doc("Uri of your Deid Service.") + `deid-service-uri`: string, + } +) +@versioned(HealthDataAIServices.Deidentification.Versions) +namespace HealthDataAIServices.Deidentification; + +@doc("The Azure Active Directory OAuth2 Flow") +model AadToken + is OAuth2Auth<[ + { + type: OAuth2FlowType.authorizationCode; + authorizationUrl: "https://login.microsoftonline.com/common/oauth2/v2.0/authorize"; + tokenUrl: "https://login.microsoftonline.com/common/oauth2/token"; + scopes: ["https://deid.azure.com/.default"]; + } + ]>; + +#suppress "@azure-tools/typespec-azure-core/documentation-required" +@doc("The HealthDataAIServices.Deidentification service versions.") +enum Versions { + @useDependency(Azure.Core.Versions.v1_0_Preview_2) + v2024_01_31_preview: "2024-01-31-preview", +} diff --git a/specification/healthdataaiservices/HealthDataAIServices.Deidentification/models.tsp b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/models.tsp new file mode 100644 index 000000000000..8f78fab2412f --- /dev/null +++ b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/models.tsp @@ -0,0 +1,328 @@ +import "@typespec/http"; +import "@typespec/rest"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using Azure.Core; + +namespace HealthDataAIServices.Deidentification; + +@doc("A job containing a batch of documents to deidentify.") +@resource("jobs") +model Job { + @key("name") + @doc("The name of a job.") + @visibility("read") + @maxLength(36) + @minLength(1) + @pattern("^[a-zA-Z0-9][a-zA-Z0-9-_]+[a-zA-Z0-9]$") + @path + name: string; + + @doc("Storage location to perform the operation on.") + sourceLocation: SourceStorageLocation; + + @doc("Target location to store output of operation.") + targetLocation: TargetStorageLocation; + + @doc("Data type of the input documents.") + dataType: DocumentDataType = DocumentDataType.PlainText; + + @doc("Operation to perform on the input documents.") + operation: OperationType = OperationType.Redact; + + @maxLength(16) + @minLength(1) + @doc("Format of the redacted output. Only valid when Operation is Redact.") + redactionFormat?: string; + + // Readonly Properties + + @doc("Current status of a job.") + @visibility("read") + status: JobStatus; + + @doc("Date and time when the job was created.") + @visibility("read") + createdAt: utcDateTime; + + @doc("Date and time when the job was started.") + @visibility("read") + startedAt?: utcDateTime; + + @doc(""" + Date and time when the job was completed. + + If the job is canceled, this is the time when the job was canceled. + + If the job failed, this is the time when the job failed. + """) + @visibility("read") + completedAt?: utcDateTime; + + @doc("Summary of a job. Exists only when the job is completed.") + @visibility("read") + summary?: JobSummary; +} + +@doc("File report once job has completed.") +@resource("files") +@parentResource(Job) +model File { + @key + @doc("Relative path to file from location prefix.") + @visibility("read") + @maxLength(1024) + path: string; + + @doc("Status of the file.") + status: Azure.Core.Foundations.OperationState; + + // TODO: Maybe this should be called reason? + @doc("Explanation of current status. If needed.") + explanation?: string; + + ...EtagProperty; +} + +@doc("Summary metrics the documents pertaining to a job.") +model JobSummary { + @doc("Number of blobs that have completed.") + successful: int32; + + @doc("Number of blobs that have failed.") + failed: int32; + + @doc("Number of blobs that have been canceled.") + canceled: int32; + + @doc("Number of blobs total.") + total: int32; + + @doc("Number of bytes processed.") + bytesProcessed: int64; +} + +@doc("List of statuses a job can have.") +enum JobStatus { + ...Azure.Core.Foundations.OperationState, + + // Canceled + // Failed + // Succeeded + // NotStarted + // Running + + @doc("Job has completed with at least 1 file failing.") + PartialFailed, +} + +@doc("Storage location.") +model SourceStorageLocation { + @doc("URL to storage location. Must be a valid Azure Storage SAS URI.") + location: url; + + @doc("Prefix to filter blobs by.") + prefix: string; + + @doc("List of extensions to filter blobs by.") + @minItems(1) + extensions?: Array = ["*"]; +} + +@doc("Storage location.") +model TargetStorageLocation { + @doc("URL to storage location. Must be a valid Azure Storage SAS URI.") + location: url; + + @doc("Prefix to filter blobs by.") + prefix: string; +} + +@doc("Enum of supported Data Types.") +enum DocumentDataType { + @doc("Unknown data type.") + Unknown, + + @doc("Plain text data type.") + PlainText, +} + +@doc("Enum of supported Operation Types.") +enum OperationType { + @doc("Redact Operation will remove all entities of PHI and replace them with a placeholder value.") + Redact, + + @doc("Surrogation Operation will replace all entities of PHI with a surrogate value.") + Surrogate, + + @doc("Tag Operation will detect all entities of PHI, their type, and return their locations in the document.") + Tag, +} + +// Source: Text Analytics +@doc("List of supported index encodings.") +enum StringIndexType { + @doc("Iterates over graphemes as defined by the Unicode 8.0.0 standard.") + TextElement_v8, + + @doc("Iterates over Unicode Code Points, the default scheme for Python 3.") + UnicodeCodePoint, + + @doc("Iterates over UTF-16 Code Units, the default scheme for JavaScript, Java, and .NET.") + Utf16CodeUnit, +} + +@doc("Request for synchronous DeID operation.") +model DeidRequest { + @doc("Input text to deidentify.") + @maxLength(100000) // 100KB + @minLength(1) + inputText: string; + + @doc("Data type of the input.") + dataType: DocumentDataType; + + @doc("Operation to perform on the input.") + operation: OperationType; + + @doc("Requested Encoding of the tag response indices.") + stringIndexType?: StringIndexType = StringIndexType.TextElement_v8; + + @maxLength(16) + @doc("Format of the redacted output. Only valid when OperationType is Redact.") + redactionFormat?: string; +} + +@doc("Response for synchronous DeID operation.") +model DeidResponse { + @doc("Output text after deidentification. Not available for Tag Operation.") + outputText?: string; + + @doc("Result of the tag operation. Only available for Tag Operation.") + taggerResult?: PhiTaggerResult; +} + +@doc("Result of the tag operation.") +model PhiTaggerResult { + @doc("List of entities detected in the input.") + entities: Array; + + @doc("Requested Encoding of the tag response indices.") + stringIndexType: StringIndexType = StringIndexType.TextElement_v8; + + @doc("Path to the file in the storage container.") + @maxLength(1024) // Max length for Blob Name + path?: string; + + @doc("Checksum of the file.") + checksum?: string; +} + +@doc("List of PHI Entities.") +enum PhiCategory { + @doc("Unknown PHI Type.") + Unknown, + + @doc("Account Number.") + Account, + + @doc("Age.") + Age, + + @doc("Biological Identifier, such as a fingerprint or retinal scan") + BioID, + + @doc("City.") + City, + + @doc("Country or Region.") + CountryOrRegion, + + @doc("Date.") + Date, + + @doc("Device ID or serial numbers.") + Device, + + @doc("Doctor's Name.") + Doctor, + + @doc("Email Addresses.") + Email, + + @doc("Fax Number.") + Fax, + + @doc("Health Plan ID Numbers.") + HealthPlan, + + @doc("Hospital Name.") + Hospital, + + @doc("Id Numbers. Such as a passport number.") + IDNum, + + @doc("IP Address.") + IPAddress, + + @doc("License. Such as a driver's license or medical license") + License, + + @doc("Location Other. Such as Golden Gate Park.") + LocationOther, + + @doc("Medical Record Number.") + MedicalRecord, + + @doc("Organization. Such as a company name") + Organization, + + @doc("Patient Name.") + Patient, + + @doc("Phone Number.") + Phone, + + @doc("Profession.") + Profession, + + @doc("Social Security Numbers in the US.") + SocialSecurity, + + @doc("State") + State, + + @doc("Street.") + Street, + + @doc("Web URL.") + Url, + + @doc("Usernames, such as a social media handle") + Username, + + @doc("Vehicle IDs, such as license plates or VIN numbers") + Vehicle, + + @doc("Zip Code.") + Zip, +} + +@doc("Phi Entity tag in the input.") +model PhiEntity { + @doc("Phi Category of the entity.") + category: PhiCategory; + + @doc("Starting index of the location from within the input text.") + offset: int32; + + @doc("Length of the input text.") + length: int32; + + @doc("Text of the entity.") + text?: string; + + @doc("Confidence score of the text/type pairing.") + confidenceScore?: float64; +} diff --git a/specification/healthdataaiservices/HealthDataAIServices.Deidentification/routes.tsp b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/routes.tsp new file mode 100644 index 000000000000..d4d2bb65ebff --- /dev/null +++ b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/routes.tsp @@ -0,0 +1,73 @@ +import "@azure-tools/typespec-azure-core"; +import "@typespec/http"; +import "@typespec/rest"; +import "./models.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Azure.Core; +using Azure.Core.Traits; + +namespace HealthDataAIServices.Deidentification; + +alias ServiceTraits = NoRepeatableRequests & + NoConditionalRequests & + SupportsClientRequestId; + +alias DeidOperations = ResourceOperations< + ServiceTraits, + Azure.Core.Foundations.ErrorResponse +>; + +interface Jobs { + @summary("Create a DeID Job") + @pollingOperation(Jobs.get) + create is DeidOperations.LongRunningResourceCreateOrReplace; + + @summary("Get a DeID Job") + get is DeidOperations.ResourceRead; + + @summary("List DeID Jobs") + list is DeidOperations.ResourceList< + Job, + ListQueryParametersTrait + >; + + @summary("List processed files within a Job") + listFiles is DeidOperations.ResourceList< + File, + ListQueryParametersTrait + >; + + @summary("Cancel a DeID Job") + @doc(""" + Cancels a job that is in progress. + + The job will be marked as canceled and the service will stop processing the job. The service will not delete any files that have already been processed. + + If the job is already complete, this will have no effect. + """) + cancel is DeidOperations.ResourceAction; + + @summary("Delete a DeID Job") + @doc("Removes the record of the job from the service. Does not delete any files.") + delete is DeidOperations.ResourceDelete; +} + +interface RealtimeOperations { + @summary("Realtime Synchronous Deidentification.") + @route("/deid") + @post + deid is Azure.Core.RpcOperation< + { + @doc("The request body for realtime deidentification.") + @body + @projectedName("csharp", "options") + @projectedName("python", "options") + @projectedName("java", "options") + body: DeidRequest; + }, + DeidResponse + >; +} diff --git a/specification/healthdataaiservices/HealthDataAIServices.Deidentification/tspconfig.yaml b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/tspconfig.yaml new file mode 100644 index 000000000000..726d0fc52e01 --- /dev/null +++ b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/tspconfig.yaml @@ -0,0 +1,37 @@ +parameters: + "service-dir": + default: "sdk/deid" + "dependencies": + "additionalDirectories": [] + default: "" +emit: + - "@azure-tools/typespec-autorest" +options: + "@azure-tools/typespec-autorest": + azure-resource-provider-folder: "data-plane" + emitter-output-dir: "{project-root}/.." + examples-directory: "{project-root}/examples/" + output-file: "{project-root}/../data-plane/{service-name}/{version-status}/{version}/{service-name}.json" + omit-unreachable-types: true + "@azure-tools/typespec-python": + package-dir: "azure-healthdataaiservices-deid" + package-name: "{package-dir}" + package-mode: dataplane + "@azure-tools/typespec-csharp": + package-dir: "Azure.HealthDataAIServices.Deid" + namespace: "{package-dir}" + clear-output-folder: true + model-namespace: false + "@azure-tools/typespec-ts": + package-dir: "azure-healthdataaiservices-deid-rest" + generateMetadata: true + generateTest: true + packageDetails: + name: "@azure-rest/azure-healthdataaiservices-deid-rest" + description: "Azure.HealthDataAIServices.Deid Service" + "@azure-tools/typespec-java": + package-dir: "azure-healthdataaiservices-deid" + namespace: com.azure.healthdataaiservices.deid +linter: + extends: + - "@azure-tools/typespec-azure-core/all" diff --git a/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/HealthDataAIServices.Deidentification.json b/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/HealthDataAIServices.Deidentification.json new file mode 100644 index 000000000000..9b166b84acda --- /dev/null +++ b/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/HealthDataAIServices.Deidentification.json @@ -0,0 +1,1348 @@ +{ + "swagger": "2.0", + "info": { + "title": "HealthDataAIServices.Deidentification Service", + "version": "2024-01-31-preview", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "x-ms-parameterized-host": { + "hostTemplate": "https://{deid-service-uri}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "deid-service-uri", + "in": "path", + "description": "Uri of your Deid Service.", + "required": true, + "type": "string" + } + ] + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "AadToken": [ + "https://deid.azure.com/.default" + ] + } + ], + "securityDefinitions": { + "AadToken": { + "type": "oauth2", + "description": "The Azure Active Directory OAuth2 Flow", + "flow": "accessCode", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", + "scopes": { + "https://deid.azure.com/.default": "" + }, + "tokenUrl": "https://login.microsoftonline.com/common/oauth2/token" + } + }, + "tags": [], + "paths": { + "/deid": { + "post": { + "operationId": "RealtimeOperations_Deid", + "summary": "Realtime Synchronous Deidentification.", + "description": "A remote procedure call (RPC) operation.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "body", + "in": "body", + "description": "The request body for realtime deidentification.", + "required": true, + "schema": { + "$ref": "#/definitions/DeidRequest" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/DeidResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Realtime Synchronous Deidentification.": { + "$ref": "./examples/RealtimeOperations_Deid.json" + } + } + } + }, + "/jobs": { + "get": { + "operationId": "Jobs_List", + "summary": "List DeID Jobs", + "description": "Resource list operation template.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "$ref": "#/parameters/Azure.Core.TopQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.SkipQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedJob" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "List DeID Jobs": { + "$ref": "./examples/Jobs_List.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/jobs/{name}": { + "get": { + "operationId": "Jobs_Get", + "summary": "Get a DeID Job", + "description": "Resource read operation template.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of a job.", + "required": true, + "type": "string", + "minLength": 1, + "maxLength": 36, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]+[a-zA-Z0-9]$" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Job" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Get a DeID Job": { + "$ref": "./examples/Jobs_Get.json" + } + } + }, + "put": { + "operationId": "Jobs_Create", + "summary": "Create a DeID Job", + "description": "Long-running resource create or replace operation template.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of a job.", + "required": true, + "type": "string", + "minLength": 1, + "maxLength": 36, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]+[a-zA-Z0-9]$" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + }, + { + "name": "resource", + "in": "body", + "description": "The resource instance.", + "required": true, + "schema": { + "$ref": "#/definitions/JobCreateOrUpdate" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Job" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + }, + "Operation-Location": { + "type": "string", + "format": "uri", + "description": "The location for monitoring the operation state." + } + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/Job" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + }, + "Operation-Location": { + "type": "string", + "format": "uri", + "description": "The location for monitoring the operation state." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Create a DeID Job": { + "$ref": "./examples/Jobs_Create.json" + } + }, + "x-ms-long-running-operation": true + }, + "delete": { + "operationId": "Jobs_Delete", + "summary": "Delete a DeID Job", + "description": "Removes the record of the job from the service. Does not delete any files.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of a job.", + "required": true, + "type": "string", + "minLength": 1, + "maxLength": 36, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]+[a-zA-Z0-9]$" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. ", + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Delete a DeID Job": { + "$ref": "./examples/Jobs_Delete.json" + } + } + } + }, + "/jobs/{name}:cancel": { + "post": { + "operationId": "Jobs_Cancel", + "summary": "Cancel a DeID Job", + "description": "Cancels a job that is in progress. \n\nThe job will be marked as canceled and the service will stop processing the job. The service will not delete any files that have already been processed.\n\nIf the job is already complete, this will have no effect. ", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of a job.", + "required": true, + "type": "string", + "minLength": 1, + "maxLength": 36, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]+[a-zA-Z0-9]$" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Job" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Cancel a DeID Job": { + "$ref": "./examples/Jobs_Cancel.json" + } + } + } + }, + "/jobs/{name}/files": { + "get": { + "operationId": "Jobs_ListFiles", + "summary": "List processed files within a Job", + "description": "Resource list operation template.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of a job.", + "required": true, + "type": "string", + "minLength": 1, + "maxLength": 36, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]+[a-zA-Z0-9]$" + }, + { + "$ref": "#/parameters/Azure.Core.TopQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.SkipQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedFile" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "List processed files within a Job": { + "$ref": "./examples/Jobs_ListFiles.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + } + }, + "definitions": { + "Azure.Core.Foundations.Error": { + "type": "object", + "description": "The error object.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "message": { + "type": "string", + "description": "A human-readable representation of the error." + }, + "target": { + "type": "string", + "description": "The target of the error." + }, + "details": { + "type": "array", + "description": "An array of details about specific errors that led to this reported error.", + "items": { + "$ref": "#/definitions/Azure.Core.Foundations.Error" + }, + "x-ms-identifiers": [] + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "An object containing more specific information than the current object about the error." + } + }, + "required": [ + "code", + "message" + ] + }, + "Azure.Core.Foundations.ErrorResponse": { + "type": "object", + "description": "A response containing error details.", + "properties": { + "error": { + "$ref": "#/definitions/Azure.Core.Foundations.Error", + "description": "The error object." + } + }, + "required": [ + "error" + ] + }, + "Azure.Core.Foundations.InnerError": { + "type": "object", + "description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "Inner error." + } + } + }, + "Azure.Core.Foundations.OperationState": { + "type": "string", + "description": "Enum describing allowed operation states.", + "enum": [ + "NotStarted", + "Running", + "Succeeded", + "Failed", + "Canceled" + ], + "x-ms-enum": { + "name": "OperationState", + "modelAsString": true, + "values": [ + { + "name": "NotStarted", + "value": "NotStarted", + "description": "The operation has not started." + }, + { + "name": "Running", + "value": "Running", + "description": "The operation is in progress." + }, + { + "name": "Succeeded", + "value": "Succeeded", + "description": "The operation has completed successfully." + }, + { + "name": "Failed", + "value": "Failed", + "description": "The operation has failed." + }, + { + "name": "Canceled", + "value": "Canceled", + "description": "The operation has been canceled by the user." + } + ] + } + }, + "Azure.Core.eTag": { + "type": "string", + "description": "The ETag (or entity tag) HTTP response header is an identifier for a specific version of a resource.\nIt lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content was not changed.\n\nIt is a string of ASCII characters placed between double quotes, like \"675af34563dc-tr34\"." + }, + "DeidRequest": { + "type": "object", + "description": "Request for synchronous DeID operation.", + "properties": { + "inputText": { + "type": "string", + "description": "Input text to deidentify.", + "minLength": 1, + "maxLength": 100000 + }, + "dataType": { + "$ref": "#/definitions/DocumentDataType", + "description": "Data type of the input." + }, + "operation": { + "$ref": "#/definitions/OperationType", + "description": "Operation to perform on the input." + }, + "stringIndexType": { + "$ref": "#/definitions/StringIndexType", + "description": "Requested Encoding of the tag response indices.", + "default": "TextElement_v8" + }, + "redactionFormat": { + "type": "string", + "description": "Format of the redacted output. Only valid when OperationType is Redact.", + "maxLength": 16 + } + }, + "required": [ + "inputText", + "dataType", + "operation" + ] + }, + "DeidResponse": { + "type": "object", + "description": "Response for synchronous DeID operation.", + "properties": { + "outputText": { + "type": "string", + "description": "Output text after deidentification. Not available for Tag Operation." + }, + "taggerResult": { + "$ref": "#/definitions/PhiTaggerResult", + "description": "Result of the tag operation. Only available for Tag Operation." + } + } + }, + "DocumentDataType": { + "type": "string", + "description": "Enum of supported Data Types.", + "enum": [ + "Unknown", + "PlainText" + ], + "x-ms-enum": { + "name": "DocumentDataType", + "modelAsString": true, + "values": [ + { + "name": "Unknown", + "value": "Unknown", + "description": "Unknown data type." + }, + { + "name": "PlainText", + "value": "PlainText", + "description": "Plain text data type." + } + ] + } + }, + "File": { + "type": "object", + "description": "File report once job has completed.", + "properties": { + "path": { + "type": "string", + "description": "Relative path to file from location prefix.", + "maxLength": 1024, + "readOnly": true + }, + "status": { + "$ref": "#/definitions/Azure.Core.Foundations.OperationState", + "description": "Status of the file." + }, + "explanation": { + "type": "string", + "description": "Explanation of current status. If needed." + }, + "etag": { + "$ref": "#/definitions/Azure.Core.eTag", + "description": "The entity tag for this resource.", + "readOnly": true + } + }, + "required": [ + "path", + "status", + "etag" + ] + }, + "Job": { + "type": "object", + "description": "A job containing a batch of documents to deidentify.", + "properties": { + "name": { + "type": "string", + "description": "The name of a job.", + "minLength": 1, + "maxLength": 36, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]+[a-zA-Z0-9]$", + "readOnly": true + }, + "sourceLocation": { + "$ref": "#/definitions/SourceStorageLocation", + "description": "Storage location to perform the operation on." + }, + "targetLocation": { + "$ref": "#/definitions/TargetStorageLocation", + "description": "Target location to store output of operation." + }, + "dataType": { + "$ref": "#/definitions/DocumentDataType", + "description": "Data type of the input documents.", + "default": "PlainText" + }, + "operation": { + "$ref": "#/definitions/OperationType", + "description": "Operation to perform on the input documents.", + "default": "Redact" + }, + "redactionFormat": { + "type": "string", + "description": "Format of the redacted output. Only valid when Operation is Redact.", + "minLength": 1, + "maxLength": 16 + }, + "status": { + "$ref": "#/definitions/JobStatus", + "description": "Current status of a job.", + "readOnly": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "Date and time when the job was created.", + "readOnly": true + }, + "startedAt": { + "type": "string", + "format": "date-time", + "description": "Date and time when the job was started.", + "readOnly": true + }, + "completedAt": { + "type": "string", + "format": "date-time", + "description": "Date and time when the job was completed.\n\nIf the job is canceled, this is the time when the job was canceled.\n\nIf the job failed, this is the time when the job failed.", + "readOnly": true + }, + "summary": { + "$ref": "#/definitions/JobSummary", + "description": "Summary of a job. Exists only when the job is completed.", + "readOnly": true + } + }, + "required": [ + "name", + "sourceLocation", + "targetLocation", + "dataType", + "operation", + "status", + "createdAt" + ] + }, + "JobCreateOrUpdate": { + "type": "object", + "description": "A job containing a batch of documents to deidentify.", + "properties": { + "sourceLocation": { + "$ref": "#/definitions/SourceStorageLocation", + "description": "Storage location to perform the operation on." + }, + "targetLocation": { + "$ref": "#/definitions/TargetStorageLocation", + "description": "Target location to store output of operation." + }, + "dataType": { + "$ref": "#/definitions/DocumentDataType", + "description": "Data type of the input documents.", + "default": "PlainText" + }, + "operation": { + "$ref": "#/definitions/OperationType", + "description": "Operation to perform on the input documents.", + "default": "Redact" + }, + "redactionFormat": { + "type": "string", + "description": "Format of the redacted output. Only valid when Operation is Redact.", + "minLength": 1, + "maxLength": 16 + } + }, + "required": [ + "sourceLocation", + "targetLocation", + "dataType", + "operation" + ] + }, + "JobStatus": { + "type": "string", + "description": "List of statuses a job can have.", + "enum": [ + "NotStarted", + "Running", + "Succeeded", + "Failed", + "Canceled", + "PartialFailed" + ], + "x-ms-enum": { + "name": "JobStatus", + "modelAsString": true, + "values": [ + { + "name": "NotStarted", + "value": "NotStarted", + "description": "The operation has not started." + }, + { + "name": "Running", + "value": "Running", + "description": "The operation is in progress." + }, + { + "name": "Succeeded", + "value": "Succeeded", + "description": "The operation has completed successfully." + }, + { + "name": "Failed", + "value": "Failed", + "description": "The operation has failed." + }, + { + "name": "Canceled", + "value": "Canceled", + "description": "The operation has been canceled by the user." + }, + { + "name": "PartialFailed", + "value": "PartialFailed", + "description": "Job has completed with at least 1 file failing." + } + ] + } + }, + "JobSummary": { + "type": "object", + "description": "Summary metrics the documents pertaining to a job.", + "properties": { + "successful": { + "type": "integer", + "format": "int32", + "description": "Number of blobs that have completed." + }, + "failed": { + "type": "integer", + "format": "int32", + "description": "Number of blobs that have failed." + }, + "canceled": { + "type": "integer", + "format": "int32", + "description": "Number of blobs that have been canceled." + }, + "total": { + "type": "integer", + "format": "int32", + "description": "Number of blobs total." + }, + "bytesProcessed": { + "type": "integer", + "format": "int64", + "description": "Number of bytes processed." + } + }, + "required": [ + "successful", + "failed", + "canceled", + "total", + "bytesProcessed" + ] + }, + "OperationType": { + "type": "string", + "description": "Enum of supported Operation Types.", + "enum": [ + "Redact", + "Surrogate", + "Tag" + ], + "x-ms-enum": { + "name": "OperationType", + "modelAsString": true, + "values": [ + { + "name": "Redact", + "value": "Redact", + "description": "Redact Operation will remove all entities of PHI and replace them with a placeholder value." + }, + { + "name": "Surrogate", + "value": "Surrogate", + "description": "Surrogation Operation will replace all entities of PHI with a surrogate value." + }, + { + "name": "Tag", + "value": "Tag", + "description": "Tag Operation will detect all entities of PHI, their type, and return their locations in the document." + } + ] + } + }, + "PagedFile": { + "type": "object", + "description": "Paged collection of File items", + "properties": { + "value": { + "type": "array", + "description": "The File items on this page", + "items": { + "$ref": "#/definitions/File" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PagedJob": { + "type": "object", + "description": "Paged collection of Job items", + "properties": { + "value": { + "type": "array", + "description": "The Job items on this page", + "items": { + "$ref": "#/definitions/Job" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "PhiCategory": { + "type": "string", + "description": "List of PHI Entities.", + "enum": [ + "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" + ], + "x-ms-enum": { + "name": "PhiCategory", + "modelAsString": true, + "values": [ + { + "name": "Unknown", + "value": "Unknown", + "description": "Unknown PHI Type." + }, + { + "name": "Account", + "value": "Account", + "description": "Account Number." + }, + { + "name": "Age", + "value": "Age", + "description": "Age." + }, + { + "name": "BioID", + "value": "BioID", + "description": "Biological Identifier, such as a fingerprint or retinal scan" + }, + { + "name": "City", + "value": "City", + "description": "City." + }, + { + "name": "CountryOrRegion", + "value": "CountryOrRegion", + "description": "Country or Region." + }, + { + "name": "Date", + "value": "Date", + "description": "Date." + }, + { + "name": "Device", + "value": "Device", + "description": "Device ID or serial numbers." + }, + { + "name": "Doctor", + "value": "Doctor", + "description": "Doctor's Name." + }, + { + "name": "Email", + "value": "Email", + "description": "Email Addresses." + }, + { + "name": "Fax", + "value": "Fax", + "description": "Fax Number." + }, + { + "name": "HealthPlan", + "value": "HealthPlan", + "description": "Health Plan ID Numbers." + }, + { + "name": "Hospital", + "value": "Hospital", + "description": "Hospital Name." + }, + { + "name": "IDNum", + "value": "IDNum", + "description": "Id Numbers. Such as a passport number." + }, + { + "name": "IPAddress", + "value": "IPAddress", + "description": "IP Address." + }, + { + "name": "License", + "value": "License", + "description": "License. Such as a driver's license or medical license" + }, + { + "name": "LocationOther", + "value": "LocationOther", + "description": "Location Other. Such as Golden Gate Park." + }, + { + "name": "MedicalRecord", + "value": "MedicalRecord", + "description": "Medical Record Number." + }, + { + "name": "Organization", + "value": "Organization", + "description": "Organization. Such as a company name" + }, + { + "name": "Patient", + "value": "Patient", + "description": "Patient Name." + }, + { + "name": "Phone", + "value": "Phone", + "description": "Phone Number." + }, + { + "name": "Profession", + "value": "Profession", + "description": "Profession." + }, + { + "name": "SocialSecurity", + "value": "SocialSecurity", + "description": "Social Security Numbers in the US." + }, + { + "name": "State", + "value": "State", + "description": "State" + }, + { + "name": "Street", + "value": "Street", + "description": "Street." + }, + { + "name": "Url", + "value": "Url", + "description": "Web URL." + }, + { + "name": "Username", + "value": "Username", + "description": "Usernames, such as a social media handle" + }, + { + "name": "Vehicle", + "value": "Vehicle", + "description": "Vehicle IDs, such as license plates or VIN numbers" + }, + { + "name": "Zip", + "value": "Zip", + "description": "Zip Code." + } + ] + } + }, + "PhiEntity": { + "type": "object", + "description": "Phi Entity tag in the input.", + "properties": { + "category": { + "$ref": "#/definitions/PhiCategory", + "description": "Phi Category of the entity." + }, + "offset": { + "type": "integer", + "format": "int32", + "description": "Starting index of the location from within the input text." + }, + "length": { + "type": "integer", + "format": "int32", + "description": "Length of the input text." + }, + "text": { + "type": "string", + "description": "Text of the entity." + }, + "confidenceScore": { + "type": "number", + "format": "double", + "description": "Confidence score of the text/type pairing." + } + }, + "required": [ + "category", + "offset", + "length" + ] + }, + "PhiTaggerResult": { + "type": "object", + "description": "Result of the tag operation.", + "properties": { + "entities": { + "type": "array", + "description": "List of entities detected in the input.", + "items": { + "$ref": "#/definitions/PhiEntity" + }, + "x-ms-identifiers": [] + }, + "stringIndexType": { + "$ref": "#/definitions/StringIndexType", + "description": "Requested Encoding of the tag response indices.", + "default": "TextElement_v8" + }, + "path": { + "type": "string", + "description": "Path to the file in the storage container.", + "maxLength": 1024 + }, + "checksum": { + "type": "string", + "description": "Checksum of the file." + } + }, + "required": [ + "entities", + "stringIndexType" + ] + }, + "SourceStorageLocation": { + "type": "object", + "description": "Storage location.", + "properties": { + "location": { + "type": "string", + "format": "uri", + "description": "URL to storage location. Must be a valid Azure Storage SAS URI." + }, + "prefix": { + "type": "string", + "description": "Prefix to filter blobs by." + }, + "extensions": { + "type": "array", + "description": "List of extensions to filter blobs by.", + "default": [ + "*" + ], + "minItems": 1, + "items": { + "type": "string" + } + } + }, + "required": [ + "location", + "prefix" + ] + }, + "StringIndexType": { + "type": "string", + "description": "List of supported index encodings.", + "enum": [ + "TextElement_v8", + "UnicodeCodePoint", + "Utf16CodeUnit" + ], + "x-ms-enum": { + "name": "StringIndexType", + "modelAsString": true, + "values": [ + { + "name": "TextElement_v8", + "value": "TextElement_v8", + "description": "Iterates over graphemes as defined by the Unicode 8.0.0 standard." + }, + { + "name": "UnicodeCodePoint", + "value": "UnicodeCodePoint", + "description": "Iterates over Unicode Code Points, the default scheme for Python 3." + }, + { + "name": "Utf16CodeUnit", + "value": "Utf16CodeUnit", + "description": "Iterates over UTF-16 Code Units, the default scheme for JavaScript, Java, and .NET." + } + ] + } + }, + "TargetStorageLocation": { + "type": "object", + "description": "Storage location.", + "properties": { + "location": { + "type": "string", + "format": "uri", + "description": "URL to storage location. Must be a valid Azure Storage SAS URI." + }, + "prefix": { + "type": "string", + "description": "Prefix to filter blobs by." + } + }, + "required": [ + "location", + "prefix" + ] + } + }, + "parameters": { + "Azure.Core.ClientRequestIdHeader": { + "name": "x-ms-client-request-id", + "in": "header", + "description": "An opaque, globally-unique, client-generated string identifier for the request.", + "required": false, + "type": "string", + "format": "uuid", + "x-ms-parameter-location": "method", + "x-ms-client-name": "clientRequestId" + }, + "Azure.Core.Foundations.ApiVersionParameter": { + "name": "api-version", + "in": "query", + "description": "The API version to use for this operation.", + "required": true, + "type": "string", + "minLength": 1, + "x-ms-parameter-location": "method", + "x-ms-client-name": "apiVersion" + }, + "Azure.Core.MaxPageSizeQueryParameter": { + "name": "maxpagesize", + "in": "query", + "description": "The maximum number of result items per page.", + "required": false, + "type": "integer", + "format": "int32", + "x-ms-parameter-location": "method" + }, + "Azure.Core.SkipQueryParameter": { + "name": "skip", + "in": "query", + "description": "The number of result items to skip.", + "required": false, + "type": "integer", + "format": "int32", + "default": 0, + "x-ms-parameter-location": "method" + }, + "Azure.Core.TopQueryParameter": { + "name": "top", + "in": "query", + "description": "The number of result items to return.", + "required": false, + "type": "integer", + "format": "int32", + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/examples/Jobs_Cancel.json b/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/examples/Jobs_Cancel.json new file mode 100644 index 000000000000..94b107557736 --- /dev/null +++ b/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/examples/Jobs_Cancel.json @@ -0,0 +1,41 @@ +{ + "title": "Cancel a DeID Job", + "operationId": "Jobs_Cancel", + "parameters": { + "api-version": "2024-01-31-preview", + "name": "documents_smith_1", + "x-ms-client-request-id": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "name": "documents_smith_1", + "sourceLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents", + "extensions": [ + "*" + ] + }, + "targetLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents" + }, + "dataType": "PlainText", + "operation": "Redact", + "redactionFormat": "[{type}]", + "status": "Canceled", + "createdAt": "2024-01-25T23:27:43.009Z", + "startedAt": "2024-01-25T23:27:43.009Z", + "completedAt": "2024-01-25T23:27:43.009Z", + "summary": { + "successful": 10, + "failed": 0, + "canceled": 2, + "total": 12, + "bytesProcessed": 4096 + } + } + } + } +} diff --git a/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/examples/Jobs_Create.json b/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/examples/Jobs_Create.json new file mode 100644 index 000000000000..7982b7ced074 --- /dev/null +++ b/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/examples/Jobs_Create.json @@ -0,0 +1,72 @@ +{ + "title": "Create a DeID Job", + "operationId": "Jobs_Create", + "parameters": { + "api-version": "2024-01-31-preview", + "name": "documents_smith_1", + "x-ms-client-request-id": "00000000-0000-0000-0000-000000000000", + "resource": { + "sourceLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents", + "extensions": [ + "*" + ] + }, + "targetLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents" + }, + "dataType": "PlainText", + "operation": "Redact", + "redactionFormat": "[{type}]" + } + }, + "responses": { + "200": { + "body": { + "name": "documents_smith_1", + "sourceLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents", + "extensions": [ + "*" + ] + }, + "targetLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents" + }, + "dataType": "PlainText", + "operation": "Redact", + "redactionFormat": "[{type}]", + "status": "NotStarted", + "createdAt": "2024-01-25T23:27:43.009Z" + } + }, + "201": { + "headers": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D" + }, + "body": { + "name": "documents_smith_1", + "sourceLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents", + "extensions": [ + "*" + ] + }, + "targetLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents" + }, + "dataType": "PlainText", + "operation": "Redact", + "redactionFormat": "[{type}]", + "status": "NotStarted", + "createdAt": "2024-01-25T23:27:43.009Z" + } + } + } +} diff --git a/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/examples/Jobs_Delete.json b/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/examples/Jobs_Delete.json new file mode 100644 index 000000000000..b0ae94ac1450 --- /dev/null +++ b/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/examples/Jobs_Delete.json @@ -0,0 +1,12 @@ +{ + "title": "Delete a DeID Job", + "operationId": "Jobs_Delete", + "parameters": { + "api-version": "2024-01-31-preview", + "name": "documents_smith_1", + "x-ms-client-request-id": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "204": {} + } +} diff --git a/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/examples/Jobs_Get.json b/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/examples/Jobs_Get.json new file mode 100644 index 000000000000..a9289d29bcd1 --- /dev/null +++ b/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/examples/Jobs_Get.json @@ -0,0 +1,41 @@ +{ + "title": "Get a DeID Job", + "operationId": "Jobs_Get", + "parameters": { + "api-version": "2024-01-31-preview", + "name": "documents_smith_1", + "x-ms-client-request-id": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "name": "documents_smith_1", + "sourceLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents", + "extensions": [ + "*" + ] + }, + "targetLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents" + }, + "dataType": "PlainText", + "operation": "Redact", + "redactionFormat": "[{type}]", + "status": "Succeeded", + "createdAt": "2024-01-25T23:27:43.009Z", + "startedAt": "2024-01-25T23:27:43.009Z", + "completedAt": "2024-01-25T23:27:43.009Z", + "summary": { + "successful": 10, + "failed": 0, + "canceled": 0, + "total": 10, + "bytesProcessed": 4096 + } + } + } + } +} diff --git a/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/examples/Jobs_List.json b/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/examples/Jobs_List.json new file mode 100644 index 000000000000..6cd2cc52e1ae --- /dev/null +++ b/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/examples/Jobs_List.json @@ -0,0 +1,48 @@ +{ + "title": "List DeID Jobs", + "operationId": "Jobs_List", + "parameters": { + "api-version": "2024-01-31-preview", + "top": 10, + "skip": 10, + "maxpagesize": 10, + "x-ms-client-request-id": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "documents_smith_1", + "sourceLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents", + "extensions": [ + "*" + ] + }, + "targetLocation": { + "location": "https://blobtest.blob.core.windows.net/container?sp=r&st=2024-01-24T18:11:10Z&se=2024-01-25T02:11:10Z&spr=https&sv=2022-11-02&sr=c&sig=signature%3D", + "prefix": "/documents" + }, + "dataType": "PlainText", + "operation": "Redact", + "redactionFormat": "[{type}]", + "status": "Succeeded", + "createdAt": "2024-01-25T23:27:43.009Z", + "startedAt": "2024-01-25T23:27:43.009Z", + "completedAt": "2024-01-25T23:27:43.009Z", + "summary": { + "successful": 10, + "failed": 0, + "canceled": 0, + "total": 10, + "bytesProcessed": 4096 + } + } + ], + "nextLink": "https://deidtest.api.deid.azure.com/jobs?top=10&skip=10&maxpagesize=10" + } + } + } +} diff --git a/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/examples/Jobs_ListFiles.json b/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/examples/Jobs_ListFiles.json new file mode 100644 index 000000000000..e1966a2f2cc1 --- /dev/null +++ b/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/examples/Jobs_ListFiles.json @@ -0,0 +1,27 @@ +{ + "title": "List processed files within a Job", + "operationId": "Jobs_ListFiles", + "parameters": { + "api-version": "2024-01-31-preview", + "name": "documents_smith_1", + "top": 10, + "skip": 10, + "maxpagesize": 10, + "x-ms-client-request-id": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "path": "/documents/patient_doc_1", + "status": "Failed", + "explanation": "File was moved after job started.", + "etag": "0x8DB638EEA0CC717" + } + ], + "nextLink": "https://deidtest.api.deid.azure.com/jobs/00000000-0000-0000-0000-000000000000/files?top=10&skip=10&maxpagesize=10" + } + } + } +} diff --git a/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/examples/RealtimeOperations_Deid.json b/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/examples/RealtimeOperations_Deid.json new file mode 100644 index 000000000000..9a390544e35c --- /dev/null +++ b/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/preview/2024-01-31-preview/examples/RealtimeOperations_Deid.json @@ -0,0 +1,33 @@ +{ + "title": "Realtime Synchronous Deidentification.", + "operationId": "RealtimeOperations_Deid", + "parameters": { + "api-version": "2024-01-31-preview", + "body": { + "inputText": "Hello my name is John Smith.", + "dataType": "PlainText", + "operation": "Redact", + "stringIndexType": "TextElement_v8", + "redactionFormat": "[{type}]" + } + }, + "responses": { + "200": { + "body": { + "outputText": "Hello my name is [name].", + "taggerResult": { + "entities": [ + { + "category": "Patient", + "offset": 17, + "length": 10, + "text": "John Smith", + "confidenceScore": 0.83 + } + ], + "stringIndexType": "TextElement_v8" + } + } + } + } +} diff --git a/specification/deidentification/data-plane/readme.md b/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/readme.md similarity index 56% rename from specification/deidentification/data-plane/readme.md rename to specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/readme.md index 57b61085b26f..02d1fbb2d498 100644 --- a/specification/deidentification/data-plane/readme.md +++ b/specification/healthdataaiservices/data-plane/HealthDataAIServices.Deidentification/readme.md @@ -1,8 +1,8 @@ -# deidentification +# HealthDataAIServices.Deidentification > see https://aka.ms/autorest -This is the AutoRest configuration file for deidentification. +This is the AutoRest configuration file for HealthDataAIServices.Deidentification. ## Getting Started @@ -22,14 +22,15 @@ For other options on installation see [Installing AutoRest](https://aka.ms/autor ### Basic Information -These are the global settings for the deidentification. +These are the global settings for the HealthDataAIServices.Deidentification. ```yaml openapi-type: data-plane tag: package-2024-01-31-preview -title: [[Title]] +title: Health Deidentifcation Service security: AADToken -security-scopes: [[SecurityScopes]] +security-scopes: + - "https://deid.azure.com/.default" ``` ### Tag: package-2024-01-31-preview @@ -38,9 +39,11 @@ These settings apply only when `--tag=package-2024-01-31-preview` is specified o ```yaml $(tag) == 'package-2024-01-31-preview' input-file: - - Microsoft.HealthDataAIServices/preview/2024-01-31-preview/deidentification.json + - preview/2024-01-31-preview/HealthDataAIServices.Deidentification.json ``` +--- + # Code Generation ## Swagger to SDK @@ -50,8 +53,26 @@ This is not used by Autorest itself. ```yaml $(swagger-to-sdk) swagger-to-sdk: - - repo: azure-sdk-for-js - - repo: azure-sdk-for-python - - repo: azure-sdk-for-java - repo: azure-sdk-for-net-track2 -``` \ No newline at end of file + - repo: azure-sdk-for-python-track2 + - repo: azure-sdk-for-java + - repo: azure-sdk-for-js + - repo: azure-cli-extensions + - repo: azure-powershell +``` + +## Az + +See configuration in [readme.az.md](./readme.az.md) + +## Python + +See configuration in [readme.python.md](./readme.python.md) + +## TypeScript + +See configuration in [readme.typescript.md](./readme.typescript.md) + +## CSharp + +See configuration in [readme.csharp.md](./readme.csharp.md) \ No newline at end of file