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

Updates HealthDataAiService.Deid with feedback from SDK Review Team #29036

Open
wants to merge 32 commits into
base: healthdataaiservices-deidentification-2024-01-16-preview
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4b12799
Generate new Service for deidentification
GrahamMThomas Jan 29, 2024
188032c
[data-plane] Initial Creation of HealthDataAiServices.Deid 2 (#27563)
GrahamMThomas Feb 1, 2024
fda21b2
Adds errorCode and explanation; Replaces pagination with continuation…
GrahamMThomas Mar 7, 2024
f918770
Updated CompletedAt to LastUpdatedAt for all terminal states (#28349)
GrahamMThomas Mar 29, 2024
371b2ca
Updates parameter validators/defaults/nullability; Replaces checksum …
GrahamMThomas Mar 29, 2024
5e7c412
Updates HealthDataAiService.Deid with feedback from SDK Review Team
Apr 8, 2024
1fafc2a
Updates TSPconfig for c#
May 1, 2024
b96f92e
Adds CSharp special
May 1, 2024
f42d923
Updates version to match live version
May 1, 2024
4271e96
Updates java package name
May 2, 2024
ecbbb25
Fix java namespace name
May 2, 2024
94e86ed
Updates python package name
May 2, 2024
abb88d1
Updates to match version service is currently using
May 2, 2024
0876eda
Updates package names
May 7, 2024
ac8f087
Removes update in cspell
May 7, 2024
4ab7b92
Updates java namespace
May 7, 2024
06e87ed
Fixes cspell.json
May 8, 2024
a37f5e5
Test1
May 8, 2024
b6fd5ea
Convert to diff long running operation
May 13, 2024
8c79649
Adds client config
May 15, 2024
71fbe76
Attempt base LRO
May 15, 2024
8468cf1
Updated naming and LRO config
May 20, 2024
be41e7f
Stash merge
May 20, 2024
eb79c6e
Linter fixes; SDK related Updates
May 29, 2024
50965a0
SDK Related Updates
May 29, 2024
dd605fc
Changes ordering of parameters; Fixes StringIndexType enum values
Jun 4, 2024
caaa6cf
Removes script update
Jun 4, 2024
fa38e1f
Updates examples
Jun 6, 2024
e2f85d2
Don't update vscode settings
Jun 6, 2024
acb228a
Updates examples
Jun 6, 2024
28e1bf7
Fixes linter issues
Jun 10, 2024
b05ee3a
Fixes documentDataType enum value to match casing within service
Jun 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,7 @@
"psqldb"
]
},

{
"filename": "**/specification/maps/data-plane/Weather/stable/1.1/weather.json",
"words": [
Expand Down Expand Up @@ -1133,6 +1134,12 @@
"throughputpool"
]
},
{
"filename": "**/specification/purview/data-plane/Azure.Analytics.Purview.DataMap/**/*.json",
"words": [
"timerange"
]
},
{
"filename": "**/specification/healthdataaiservices/**/*.json",
"words": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Cancel a DeID Job",
"operationId": "Jobs_Cancel",
"title": "Cancel a De-Identify Job",
"operationId": "Deidentification_CancelJob",
"parameters": {
"api-version": "2024-01-31-preview",
"api-version": "2024-01-16-preview",
"name": "documents_smith_1",
"x-ms-client-request-id": "00000000-0000-0000-0000-000000000000"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Create a DeID Job",
"operationId": "Jobs_Create",
"title": "Create a De-Identify Job",
"operationId": "Deidentification_CreateJob",
"parameters": {
"api-version": "2024-01-31-preview",
"api-version": "2024-01-16-preview",
"name": "documents_smith_1",
"x-ms-client-request-id": "00000000-0000-0000-0000-000000000000",
"resource": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Realtime Synchronous Deidentification.",
"operationId": "RealtimeOperations_Deid",
"operationId": "Deidentification_Deidentify",
"parameters": {
"api-version": "2024-01-31-preview",
"api-version": "2024-01-16-preview",
"body": {
"inputText": "Hello my name is John Smith.",
"dataType": "PlainText",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Delete a DeID Job",
"operationId": "Jobs_Delete",
"title": "Delete a De-Identify Job",
"operationId": "Deidentification_DeleteJob",
"parameters": {
"api-version": "2024-01-31-preview",
"api-version": "2024-01-16-preview",
"name": "documents_smith_1",
"x-ms-client-request-id": "00000000-0000-0000-0000-000000000000"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Get a DeID Job",
"operationId": "Jobs_Get",
"title": "Get a De-Identify Job",
"operationId": "Deidentification_GetJob",
"parameters": {
"api-version": "2024-01-31-preview",
"api-version": "2024-01-16-preview",
"name": "documents_smith_1",
"x-ms-client-request-id": "00000000-0000-0000-0000-000000000000"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "List processed files within a Job",
"operationId": "Jobs_ListFiles",
"operationId": "Deidentification_ListJobFiles",
"parameters": {
"api-version": "2024-01-31-preview",
"api-version": "2024-01-16-preview",
"name": "documents_smith_1",
"maxpagesize": 10,
"continuationToken": "K1JJRDpzOEtaQWZabUQrQUNBQUFBQUFBQUFBQT09I1JUOjEjVFJDOjEwI0ZQQzpBZ0VBQUFBTUFDUUFBQUFBQUE9PQ==",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "List DeID Jobs",
"operationId": "Jobs_List",
"title": "List De-Identify Jobs",
"operationId": "Deidentification_ListJobs",
"parameters": {
"api-version": "2024-01-31-preview",
"api-version": "2024-01-16-preview",
"maxpagesize": 10,
"continuationToken": "K1JJRDpzOEtaQWZabUQrQUNBQUFBQUFBQUFBQT09I1JUOjEjVFJDOjEwI0ZQQzpBZ0VBQUFBTUFDUUFBQUFBQUE9PQ==",
"x-ms-client-request-id": "00000000-0000-0000-0000-000000000000"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ using Azure.Core.Traits;
title: "HealthDataAIServices.Deidentification Service",
})
@server(
"https://{deid-service-uri}",
"https://{endpoint}",
"Azure Health Deidentification Service",
{
@doc("Uri of your Deid Service.")
`deid-service-uri`: string,
@doc("Url of your Deid Service.")
endpoint: string,
}
)
@versioned(HealthDataAIServices.Deidentification.Versions)
Expand All @@ -40,5 +40,5 @@ model AadToken
@doc("The HealthDataAIServices.Deidentification service versions.")
enum Versions {
@useDependency(Azure.Core.Versions.v1_0_Preview_2)
v2024_01_31_preview: "2024-01-31-preview",
v2024_01_16_preview: "2024-01-16-preview",
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace HealthDataAIServices.Deidentification;

@doc("A job containing a batch of documents to deidentify.")
@resource("jobs")
model Job {
model DeidentifyJob {
@key("name")
@doc("The name of a job.")
@visibility("read")
Expand Down Expand Up @@ -71,8 +71,8 @@ model Job {

@doc("File report once job has completed.")
@resource("files")
@parentResource(Job)
model File {
@parentResource(DeidentifyJob)
model HealthFileDetails {
@key
@doc("Id of the file report.")
@visibility("read")
Expand Down Expand Up @@ -189,8 +189,9 @@ enum StringIndexType {
Utf16CodeUnit,
}

@doc("Request for synchronous DeID operation.")
model DeidRequest {
@doc("Request for synchronous De-Identify operation.")
@projectedName("csharp", "DeidentifyConfig")
model DeidentifyOptions {
@doc("Input text to deidentify.")
@maxLength(100000) // 100KB
inputText: string;
Expand All @@ -209,9 +210,9 @@ model DeidRequest {
redactionFormat?: string;
}

@doc("Response for synchronous DeID operation.")
model DeidResponse {
@doc("Output text after deidentification. Not available for Tag Operation.")
@doc("Response for synchronous De-Identify operation.")
model DeidentifyResult {
@doc("Output text after de-identifying. Not available for Tag Operation.")
outputText?: string;

@doc("Result of the tag operation. Only available for Tag Operation.")
Expand Down Expand Up @@ -245,6 +246,7 @@ enum PhiCategory {
Age,

@doc("Biological Identifier, such as a fingerprint or retinal scan")
@projectedName("python", "BIO_ID")
BioID,

@doc("City.")
Expand Down Expand Up @@ -275,9 +277,11 @@ enum PhiCategory {
Hospital,

@doc("Id Numbers. Such as a passport number.")
@projectedName("python", "ID_NUM")
IDNum,

@doc("IP Address.")
@projectedName("python", "IP_ADDRESS")
IPAddress,

@doc("License. Such as a driver's license or medical license")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,59 +15,57 @@ alias ServiceTraits = NoRepeatableRequests &
NoConditionalRequests &
SupportsClientRequestId;

alias DeidOperations = ResourceOperations<
alias DeidentifyOperations = ResourceOperations<
ServiceTraits,
Azure.Core.Foundations.ErrorResponse
>;

interface Jobs {
@summary("Create a DeID Job")
@pollingOperation(Jobs.get)
create is DeidOperations.LongRunningResourceCreateOrReplace<Job>;
interface Deidentification {
@summary("Create a De-Identify Job")
createJob is DeidentifyOperations.LongRunningResourceCreateOrReplace<DeidentifyJob>;

@summary("Get a DeID Job")
get is DeidOperations.ResourceRead<Job>;
@summary("Get a De-Identify Job")
getJob is DeidentifyOperations.ResourceRead<DeidentifyJob>;

@summary("List DeID Jobs")
list is DeidOperations.ResourceList<
Job,
@summary("List De-Identify Jobs")
listJobs is DeidentifyOperations.ResourceList<
DeidentifyJob,
ListQueryParametersTrait<PaginationByTokenQueryParameters>
>;

@summary("List processed files within a Job")
listFiles is DeidOperations.ResourceList<
File,
listJobFiles is DeidentifyOperations.ResourceList<
HealthFileDetails,
ListQueryParametersTrait<PaginationByTokenQueryParameters>
>;

@summary("Cancel a DeID Job")
@summary("Cancel a De-Identify 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<Job, {}, Job>;
cancelJob is DeidentifyOperations.ResourceAction<
DeidentifyJob,
{},
DeidentifyJob
>;

@summary("Delete a DeID Job")
@summary("Delete a De-Identify Job")
@doc("Removes the record of the job from the service. Does not delete any files.")
delete is DeidOperations.ResourceDelete<Job>;
}
deleteJob is DeidentifyOperations.ResourceDelete<DeidentifyJob>;

interface RealtimeOperations {
@summary("Realtime Synchronous Deidentification.")
@route("/deid")
@post
deid is Azure.Core.RpcOperation<
deidentify is Azure.Core.RpcOperation<
{
@doc("The request body for realtime deidentification.")
@body
@projectedName("csharp", "options")
@projectedName("python", "options")
@projectedName("java", "options")
body: DeidRequest;
body: DeidentifyOptions;
},
DeidResponse
DeidentifyResult
>;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
parameters:
"service-dir":
default: "sdk/deid"
default: "sdk/healthdataaiservices"
"dependencies":
"additionalDirectories": []
default: ""
Expand All @@ -14,24 +14,24 @@ options:
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-dir: "azure-health-deidentification"
package-name: "{package-dir}"
package-mode: dataplane
"@azure-tools/typespec-csharp":
package-dir: "Azure.HealthDataAIServices.Deid"
package-dir: "Azure.Health.Deidentification"
namespace: "{package-dir}"
clear-output-folder: true
model-namespace: false
"@azure-tools/typespec-ts":
package-dir: "azure-healthdataaiservices-deid-rest"
package-dir: "azure-health-deidentification"
generateMetadata: true
generateTest: true
packageDetails:
name: "@azure-rest/azure-healthdataaiservices-deid-rest"
description: "Azure.HealthDataAIServices.Deid Service"
name: "@azure-rest/azure-health-deidentification"
description: "Health Deidentification Service"
"@azure-tools/typespec-java":
package-dir: "azure-healthdataaiservices-deid"
namespace: com.azure.healthdataaiservices.deid
package-dir: "azure-health-deidentification"
namespace: "com.azure.health.deidentification"
linter:
extends:
- "@azure-tools/typespec-azure-core/all"