From f918770c8fb9ebaac458043fb29b9b93075d5b42 Mon Sep 17 00:00:00 2001 From: Graham Thomas Date: Fri, 29 Mar 2024 09:53:11 -0700 Subject: [PATCH] Updated CompletedAt to LastUpdatedAt for all terminal states (#28349) * Updated CompletedAt to LastUpdatedAt for all terminal states * Updates examples; Moves error order * Set examples to more realistic value * Updates File model for future expansion * Adds Input FileLocation --------- Co-authored-by: Graham Thomas --- .../2024-01-31-preview/Jobs_Cancel.json | 2 +- .../2024-01-31-preview/Jobs_Create.json | 6 +- .../examples/2024-01-31-preview/Jobs_Get.json | 2 +- .../2024-01-31-preview/Jobs_List.json | 2 +- .../2024-01-31-preview/Jobs_ListFiles.json | 13 ++++- .../models.tsp | 33 +++++++---- ...HealthDataAIServices.Deidentification.json | 55 ++++++++++++------- .../examples/Jobs_Cancel.json | 2 +- .../examples/Jobs_Create.json | 6 +- .../2024-01-31-preview/examples/Jobs_Get.json | 2 +- .../examples/Jobs_List.json | 2 +- .../examples/Jobs_ListFiles.json | 13 ++++- 12 files changed, 90 insertions(+), 48 deletions(-) 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 index 94b107557736..fe81e0ff2929 100644 --- 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 @@ -27,7 +27,7 @@ "status": "Canceled", "createdAt": "2024-01-25T23:27:43.009Z", "startedAt": "2024-01-25T23:27:43.009Z", - "completedAt": "2024-01-25T23:27:43.009Z", + "lastUpdatedAt": "2024-01-26T01:15:00.009Z", "summary": { "successful": 10, "failed": 0, 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 index 7982b7ced074..3874013ac376 100644 --- 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 @@ -41,7 +41,8 @@ "operation": "Redact", "redactionFormat": "[{type}]", "status": "NotStarted", - "createdAt": "2024-01-25T23:27:43.009Z" + "createdAt": "2024-01-25T23:27:43.009Z", + "lastUpdatedAt": "2024-01-26T01:15:00.009Z" } }, "201": { @@ -65,7 +66,8 @@ "operation": "Redact", "redactionFormat": "[{type}]", "status": "NotStarted", - "createdAt": "2024-01-25T23:27:43.009Z" + "createdAt": "2024-01-25T23:27:43.009Z", + "lastUpdatedAt": "2024-01-26T01:15:00.009Z" } } } 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 index a9289d29bcd1..97431df34baf 100644 --- 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 @@ -27,7 +27,7 @@ "status": "Succeeded", "createdAt": "2024-01-25T23:27:43.009Z", "startedAt": "2024-01-25T23:27:43.009Z", - "completedAt": "2024-01-25T23:27:43.009Z", + "lastUpdatedAt": "2024-01-26T01:15:00.009Z", "summary": { "successful": 10, "failed": 0, 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 index 4bb3ca01a6d9..d29b519bb15c 100644 --- 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 @@ -30,7 +30,7 @@ "status": "Succeeded", "createdAt": "2024-01-25T23:27:43.009Z", "startedAt": "2024-01-25T23:27:43.009Z", - "completedAt": "2024-01-25T23:27:43.009Z", + "lastUpdatedAt": "2024-01-26T01:15:00.009Z", "summary": { "successful": 10, "failed": 0, 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 index d63577611ce2..e320faa23baa 100644 --- 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 @@ -13,15 +13,22 @@ "body": { "value": [ { - "path": "/documents/patient_doc_1", + "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": [] - }, - "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/models.tsp b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/models.tsp index 574de3592ff0..ab2feef97784 100644 --- a/specification/healthdataaiservices/HealthDataAIServices.Deidentification/models.tsp +++ b/specification/healthdataaiservices/HealthDataAIServices.Deidentification/models.tsp @@ -29,7 +29,7 @@ model Job { dataType: DocumentDataType = DocumentDataType.PlainText; @doc("Operation to perform on the input documents.") - operation: OperationType = OperationType.Redact; + operation: OperationType = OperationType.Surrogate; @maxLength(16) @minLength(1) @@ -42,14 +42,14 @@ model Job { @visibility("read") status: JobStatus; - @doc("Date and time when the job was created.") - @visibility("read") - createdAt: utcDateTime; - @doc("Error when job fails in it's entirety.") @visibility("read") error?: Azure.Core.Foundations.Error; + @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; @@ -62,7 +62,7 @@ model Job { If the job failed, this is the time when the job failed. """) @visibility("read") - completedAt?: utcDateTime; + lastUpdatedAt?: utcDateTime; @doc("Summary of a job. Exists only when the job is completed.") @visibility("read") @@ -74,16 +74,28 @@ model Job { @parentResource(Job) model File { @key - @doc("Relative path to file from location prefix.") + @doc("Id of the file report.") @visibility("read") - @maxLength(1024) - path: string; + id: string; + + @doc("File Location for the input.") + input: FileLocation; + + @doc("File Location for the output.") + output?: FileLocation; @doc("Status of the file.") status: Azure.Core.Foundations.OperationState; @doc("Error when file fails.") error?: Azure.Core.Foundations.Error; +} + +@doc("Location of a file.") +model FileLocation { + @doc("Absolute path to the file in storage.") + @maxLength(1024) + path: string; ...EtagProperty; } @@ -144,9 +156,6 @@ model TargetStorageLocation { @doc("Enum of supported Data Types.") enum DocumentDataType { - @doc("Unknown data type.") - Unknown, - @doc("Plain text data type.") PlainText, } 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 index 13e5b78fc605..5939254240b3 100644 --- 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 @@ -636,18 +636,12 @@ "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", @@ -660,12 +654,19 @@ "type": "object", "description": "File report once job has completed.", "properties": { - "path": { + "id": { "type": "string", - "description": "Relative path to file from location prefix.", - "maxLength": 1024, + "description": "Id of the file report.", "readOnly": true }, + "input": { + "$ref": "#/definitions/FileLocation", + "description": "File Location for the input." + }, + "output": { + "$ref": "#/definitions/FileLocation", + "description": "File Location for the output." + }, "status": { "$ref": "#/definitions/Azure.Core.Foundations.OperationState", "description": "Status of the file." @@ -673,6 +674,22 @@ "error": { "$ref": "#/definitions/Azure.Core.Foundations.Error", "description": "Error when file fails." + } + }, + "required": [ + "id", + "input", + "status" + ] + }, + "FileLocation": { + "type": "object", + "description": "Location of a file.", + "properties": { + "path": { + "type": "string", + "description": "Absolute path to the file in storage.", + "maxLength": 1024 }, "etag": { "$ref": "#/definitions/Azure.Core.eTag", @@ -682,7 +699,6 @@ }, "required": [ "path", - "status", "etag" ] }, @@ -714,7 +730,7 @@ "operation": { "$ref": "#/definitions/OperationType", "description": "Operation to perform on the input documents.", - "default": "Redact" + "default": "Surrogate" }, "redactionFormat": { "type": "string", @@ -727,24 +743,24 @@ "description": "Current status of a job.", "readOnly": true }, + "error": { + "$ref": "#/definitions/Azure.Core.Foundations.Error", + "description": "Error when job fails in it's entirety.", + "readOnly": true + }, "createdAt": { "type": "string", "format": "date-time", "description": "Date and time when the job was created.", "readOnly": true }, - "error": { - "$ref": "#/definitions/Azure.Core.Foundations.Error", - "description": "Error when job fails in it's entirety.", - "readOnly": true - }, "startedAt": { "type": "string", "format": "date-time", "description": "Date and time when the job was started.", "readOnly": true }, - "completedAt": { + "lastUpdatedAt": { "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.", @@ -786,7 +802,7 @@ "operation": { "$ref": "#/definitions/OperationType", "description": "Operation to perform on the input documents.", - "default": "Redact" + "default": "Surrogate" }, "redactionFormat": { "type": "string", @@ -927,8 +943,7 @@ "description": "The File items on this page", "items": { "$ref": "#/definitions/File" - }, - "x-ms-identifiers": [] + } }, "nextLink": { "type": "string", 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 index 94b107557736..fe81e0ff2929 100644 --- 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 @@ -27,7 +27,7 @@ "status": "Canceled", "createdAt": "2024-01-25T23:27:43.009Z", "startedAt": "2024-01-25T23:27:43.009Z", - "completedAt": "2024-01-25T23:27:43.009Z", + "lastUpdatedAt": "2024-01-26T01:15:00.009Z", "summary": { "successful": 10, "failed": 0, 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 index 7982b7ced074..3874013ac376 100644 --- 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 @@ -41,7 +41,8 @@ "operation": "Redact", "redactionFormat": "[{type}]", "status": "NotStarted", - "createdAt": "2024-01-25T23:27:43.009Z" + "createdAt": "2024-01-25T23:27:43.009Z", + "lastUpdatedAt": "2024-01-26T01:15:00.009Z" } }, "201": { @@ -65,7 +66,8 @@ "operation": "Redact", "redactionFormat": "[{type}]", "status": "NotStarted", - "createdAt": "2024-01-25T23:27:43.009Z" + "createdAt": "2024-01-25T23:27:43.009Z", + "lastUpdatedAt": "2024-01-26T01:15:00.009Z" } } } 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 index a9289d29bcd1..97431df34baf 100644 --- 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 @@ -27,7 +27,7 @@ "status": "Succeeded", "createdAt": "2024-01-25T23:27:43.009Z", "startedAt": "2024-01-25T23:27:43.009Z", - "completedAt": "2024-01-25T23:27:43.009Z", + "lastUpdatedAt": "2024-01-26T01:15:00.009Z", "summary": { "successful": 10, "failed": 0, 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 index 4bb3ca01a6d9..d29b519bb15c 100644 --- 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 @@ -30,7 +30,7 @@ "status": "Succeeded", "createdAt": "2024-01-25T23:27:43.009Z", "startedAt": "2024-01-25T23:27:43.009Z", - "completedAt": "2024-01-25T23:27:43.009Z", + "lastUpdatedAt": "2024-01-26T01:15:00.009Z", "summary": { "successful": 10, "failed": 0, 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 index d63577611ce2..e320faa23baa 100644 --- 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 @@ -13,15 +13,22 @@ "body": { "value": [ { - "path": "/documents/patient_doc_1", + "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": [] - }, - "etag": "0x8DB638EEA0CC717" + } } ], "nextLink": "https://deidtest.api.deid.azure.com/jobs/00000000-0000-0000-0000-000000000000/files?top=10&skip=10&maxpagesize=10"