Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Creation of Azure.Health.Deidentification Dataplane API Typespec #29745

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5c05cbf
Updates HealthDataAiService.Deid with feedback from SDK Review Team (…
GrahamMThomas Jul 9, 2024
300462e
Updates linter extends value
Jul 9, 2024
238b15c
Merge branch 'main' into healthdataaiservices-deidentification-2024-0…
Jul 9, 2024
7d245b3
Merge branch 'main' into healthdataaiservices-deidentification-2024-0…
GrahamMThomas Jul 9, 2024
b8a8c58
Updates typespec with new validations for 0.57
Jul 9, 2024
738701f
Merge branch 'main' into healthdataaiservices-deidentification-2024-0…
GrahamMThomas Jul 9, 2024
37ee8ee
Fixing namespace suppression
Jul 9, 2024
013a244
Fixing namespace suppression 2
Jul 9, 2024
6dde1a4
Fixing namespace suppression 3
Jul 9, 2024
4aff9ce
Fixing namespace suppression 4
Jul 9, 2024
37474f8
Fixes formatting
Jul 9, 2024
96730f7
Merge branch 'main' into healthdataaiservices-deidentification-2024-0…
GrahamMThomas Jul 9, 2024
3694f5b
Updates how StringIndices are handled
Jul 11, 2024
2147003
Update docstring to contain languages
Jul 11, 2024
ffbc1ef
Makes etag optional for PhiTaggerResult on realtime requests
Jul 13, 2024
4f8962b
Removes redundant read decorator on etag
Jul 13, 2024
a869394
Merge branch 'main' into healthdataaiservices-deidentification-2024-0…
GrahamMThomas Jul 15, 2024
d83df7d
Regenerates with new docs
Jul 15, 2024
5604271
Fixes formatting
Jul 15, 2024
c4a3e67
Removes @secret on location
Jul 15, 2024
e9da6b6
Team review updates
Jul 15, 2024
b42779e
Renames folder to match namespace change
Jul 15, 2024
e45d3ff
Merge branch 'main' into healthdataaiservices-deidentification-2024-0…
GrahamMThomas Jul 16, 2024
48e2b9d
Updates client name after namespace change
Jul 16, 2024
343858f
Merge branch 'main' into healthdataaiservices-deidentification-2024-0…
GrahamMThomas Jul 16, 2024
2272f2e
Makes fields with defaults optional
Jul 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -1176,6 +1176,14 @@
"timerange"
]
},
{
"filename": "**/specification/healthdataaiservices/**/*.json",
"words": [
"deidentification",
"deidentify",
"surrogation"
]
},
{
"filename": "**/specification/search/data-plane/Azure.Search/**/*.json",
"words": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import "./main.tsp";
import "@azure-tools/typespec-client-generator-core";

using Azure.ClientGenerator.Core;
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"title": "Cancel a de-identification job.",
"operationId": "CancelJob",
"parameters": {
"api-version": "2024-07-12-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"
},
"operation": "Redact",
"dataType": "Plaintext",
"redactionFormat": "[{type}]",
"status": "Canceled",
"lastUpdatedAt": "2024-01-26T01:15:00.009Z",
"createdAt": "2024-01-25T23:27:43.009Z",
"startedAt": "2024-01-25T23:27:43.009Z",
"summary": {
"successful": 10,
"failed": 0,
"canceled": 2,
"total": 12,
"bytesProcessed": 4096
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"title": "Create a de-identification job.",
"operationId": "CreateJob",
"parameters": {
"api-version": "2024-07-12-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"
},
"operation": "Redact",
"dataType": "Plaintext",
"redactionFormat": "[{type}]",
"status": "NotStarted"
}
},
"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"
},
"operation": "Redact",
"dataType": "Plaintext",
"redactionFormat": "[{type}]",
"status": "NotStarted",
"lastUpdatedAt": "2024-01-26T01:15:00.009Z",
"createdAt": "2024-01-25T23:27:43.009Z"
}
},
"201": {
"headers": {
"original-uri": "https://contoso.com/operationstatus"
},
"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"
},
"operation": "Redact",
"dataType": "Plaintext",
"redactionFormat": "[{type}]",
"status": "NotStarted",
"lastUpdatedAt": "2024-01-26T01:15:00.009Z",
"createdAt": "2024-01-25T23:27:43.009Z"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"title": "De-identify text.",
"operationId": "Deidentify",
"parameters": {
"api-version": "2024-07-12-preview",
"body": {
"inputText": "Hello my name is John Smith.",
"operation": "Redact",
"dataType": "Plaintext",
"redactionFormat": "[{type}]"
}
},
"responses": {
"200": {
"body": {
"outputText": "Hello my name is [name].",
"taggerResult": {
"entities": [
{
"category": "Patient",
"offset": {
"utf8": 17,
"utf16": 17,
"codePoint": 17
},
"length": {
"utf8": 10,
"utf16": 10,
"codePoint": 10
},
"text": "John Smith",
"confidenceScore": 0.83
}
],
"etag": "0x000000000000000"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"title": "Delete a de-identification job.",
"operationId": "DeleteJob",
"parameters": {
"api-version": "2024-07-12-preview",
"name": "documents_smith_1",
"x-ms-client-request-id": "00000000-0000-0000-0000-000000000000"
},
"responses": {
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"title": "Get a de-identification job.",
"operationId": "GetJob",
"parameters": {
"api-version": "2024-07-12-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"
},
"operation": "Redact",
"dataType": "Plaintext",
"redactionFormat": "[{type}]",
"status": "Succeeded",
"lastUpdatedAt": "2024-01-26T01:15:00.009Z",
"createdAt": "2024-01-25T23:27:43.009Z",
"startedAt": "2024-01-25T23:27:43.009Z",
"summary": {
"successful": 10,
"failed": 0,
"canceled": 0,
"total": 10,
"bytesProcessed": 4096
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"title": "List processed documents within a job.",
"operationId": "ListJobDocuments",
"parameters": {
"api-version": "2024-07-12-preview",
"name": "documents_smith_1",
"maxpagesize": 10,
"continuationToken": "K1JJRDpzOEtaQWZabUQrQUNBQUFBQUFBQUFBQT09I1JUOjEjVFJDOjEwI0ZQQzpBZ0VBQUFBTUFDUUFBQUFBQUE9PQ==",
"x-ms-client-request-id": "00000000-0000-0000-0000-000000000000"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "00000000-0000-0000-0000-000000000000",
"input": {
"path": "/documents/patient_doc_1",
"etag": "0x8DB638EEA0CC717"
},
"output": {
"path": "_output/documents/patient_doc_1",
"etag": "0xAB298APO23099ZL"
},
"status": "Failed",
"error": {
"code": "FileNotFound",
"message": "File was moved after job started.",
"target": "SourceFile",
"details": []
}
}
],
"nextLink": "https://deidtest.api.deid.azure.com/jobs/00000000-0000-0000-0000-000000000000/files?top=10&skip=10&maxpagesize=10"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"title": "List de-identification jobs.",
"operationId": "ListJobs",
"parameters": {
"api-version": "2024-07-12-preview",
"maxpagesize": 10,
"continuationToken": "K1JJRDpzOEtaQWZabUQrQUNBQUFBQUFBQUFBQT09I1JUOjEjVFJDOjEwI0ZQQzpBZ0VBQUFBTUFDUUFBQUFBQUE9PQ==",
"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"
},
"operation": "Redact",
"dataType": "Plaintext",
"redactionFormat": "[{type}]",
"status": "Succeeded",
"lastUpdatedAt": "2024-01-26T01:15:00.009Z",
"createdAt": "2024-01-25T23:27:43.009Z",
"startedAt": "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"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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;

// Official Name: Azure Health Data Services de-identification service
@useAuth(AadToken)
@service({
title: "Azure Health Data Services de-identification service",
})
@server(
"https://{endpoint}",
"De-identification Service service endpoint",
{
@doc("Url of your De-identification Service.")
endpoint: string,
}
)
@versioned(HealthDataAIServices.DeidServices.Versions)
namespace HealthDataAIServices.DeidServices;

@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"];
}
]>;

@doc("Azure Health Data Services de-identification service versions.")
enum Versions {
@doc("Public preview release version.")
@useDependency(Azure.Core.Versions.v1_0_Preview_2)
v2024_07_12_preview: "2024-07-12-preview",
}
Loading