From 7d0f99a3de77dc96b57c9f0ec3575d38a8811b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Tue, 8 Aug 2023 01:47:10 +0200 Subject: [PATCH 01/26] miniWorkflowSet not required anymore --- schemas/API/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/API/index.json b/schemas/API/index.json index f1d04b0..a47369b 100644 --- a/schemas/API/index.json +++ b/schemas/API/index.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "0.2", + "version": "0.2.1", "title": "SPINE API", "description": "SPINE API" }, From 84da19cb77e3ac7965ffa6081695c97c2cf2d650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Tue, 8 Aug 2023 01:48:25 +0200 Subject: [PATCH 02/26] wip --- schemas/workflowExecution.schema.json | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/schemas/workflowExecution.schema.json b/schemas/workflowExecution.schema.json index c12f617..d186bd4 100644 --- a/schemas/workflowExecution.schema.json +++ b/schemas/workflowExecution.schema.json @@ -163,7 +163,7 @@ } }, "required": [ - "miniWorkflowSet" + ] }, "subWorkflowConfig": { @@ -457,7 +457,6 @@ "inputs", "label", "reference", - "miniWorkflowSet", "stateOfTasks", "docType", "creationDate" @@ -506,8 +505,7 @@ "required": [ "inputs", "label", - "reference", - "miniWorkflowSet" + "reference" ] }, "getWorkflowExecution": { @@ -563,7 +561,6 @@ "required": [ "inputs", "label", - "miniWorkflowSet", "state", "creationDate", "stateOfTasks" From 0ca60625596a5db9c5e5ce6c070e73a02c7a7183 Mon Sep 17 00:00:00 2001 From: gregblt Date: Tue, 8 Aug 2023 01:49:20 +0200 Subject: [PATCH 03/26] 3.2.0-dev.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fd9b0af..4558fc4 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "workflow" ], "description": "Set of JSON schemas for the SPINE Virtual Laboratory", - "version": "3.1.0-dev.8", + "version": "3.2.0-dev.1", "dependencies": { "ajv": "^6.12.2" }, From 2570b2e8c1c89f3db157701b81db3c14b7a5aa94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Wed, 30 Aug 2023 17:32:45 +0200 Subject: [PATCH 04/26] Add queue name to wf configuration --- schemas/workflowExecution.schema.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/schemas/workflowExecution.schema.json b/schemas/workflowExecution.schema.json index d186bd4..d66a79d 100644 --- a/schemas/workflowExecution.schema.json +++ b/schemas/workflowExecution.schema.json @@ -499,6 +499,10 @@ }, "usePydra": { "type": "boolean" + }, + "queueName": { + "description": "If using Pydra you can send the workflow to a Temporal queue", + "type": "string" } }, "additionalProperties": false, From 7d7d4689b844e51b70a6846c75bedc4605ebb44d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Thu, 31 Aug 2023 12:25:08 +0200 Subject: [PATCH 05/26] Add xf exec plan global action --- .../api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f | 1 + schemas/API/index.json | 3 ++ ...workflowExecutionMatrixIdGlobalAction.json | 54 +++++++++++++++++++ schemas/workflowExecution.schema.json | 9 ++-- schemas/workflowExecutionMatrix.schema.json | 13 +++++ schemas/workflowExecutor.schema.json | 1 + 6 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 schemas/API/workflowExecutionMatrix/workflowExecutionMatrixIdGlobalAction.json diff --git a/.postman/api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f b/.postman/api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f index 6d0ff67..3039051 100644 --- a/.postman/api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f +++ b/.postman/api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f @@ -37,6 +37,7 @@ files[] = {"path":"API/workflow/workflowIdConfigure.json","metaData":{}} files[] = {"path":"API/workflowExecutionMatrix/workflowExecutionMatrix.json","metaData":{}} files[] = {"path":"API/workflowExecutionMatrix/workflowExecutionMatrixId.json","metaData":{}} files[] = {"path":"API/workflowExecutionMatrix/workflowExecutionMatrixIdAction.json","metaData":{}} +files[] = {"path":"API/workflowExecutionMatrix/workflowExecutionMatrixIdGlobalAction.json","metaData":{}} files[] = {"path":"center.schema.json","metaData":{}} files[] = {"path":"cohort.schema.json","metaData":{}} files[] = {"path":"core.schema.json","metaData":{}} diff --git a/schemas/API/index.json b/schemas/API/index.json index a47369b..8507159 100644 --- a/schemas/API/index.json +++ b/schemas/API/index.json @@ -29,6 +29,9 @@ "/workflow-execution-matrix/{workflowExecutionMatrixId}/action": { "$ref": "./workflowExecutionMatrix/workflowExecutionMatrixIdAction.json" }, + "/workflow-execution-matrix/{workflowExecutionMatrixId}/global-action": { + "$ref": "./workflowExecutionMatrix/workflowExecutionMatrixIdGlobalAction.json" + }, "/filter/{filterId}": { "$ref": "./filter/filterId.json" }, diff --git a/schemas/API/workflowExecutionMatrix/workflowExecutionMatrixIdGlobalAction.json b/schemas/API/workflowExecutionMatrix/workflowExecutionMatrixIdGlobalAction.json new file mode 100644 index 0000000..b27d7c9 --- /dev/null +++ b/schemas/API/workflowExecutionMatrix/workflowExecutionMatrixIdGlobalAction.json @@ -0,0 +1,54 @@ +{ + "parameters": [ + { + "name": "workflowExecutionMatrixId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "security": [ + { + "bearerAuth": [] + } + ], + "tags": [ + "workflow execution matrix" + ], + "summary": "/api/workflow-execution-matrix/workflowExecutionMatrixId/global-action", + "description": "This API is used to post an action (launch, ...) to all the case of a wf exec plan", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "../../workflowExecutionMatrix.schema.json#/definitions/postWorkflowExecutionMatrixGlobalActionBody" + }, + "examples": { + "1": { + "value": { + "actionType": "LAUNCH" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "200", + "content": { + "application/json": { + + } + } + }, + "500": { + "description": "Unexpected error" + } + } + } +} \ No newline at end of file diff --git a/schemas/workflowExecution.schema.json b/schemas/workflowExecution.schema.json index d66a79d..8675619 100644 --- a/schemas/workflowExecution.schema.json +++ b/schemas/workflowExecution.schema.json @@ -161,10 +161,7 @@ false ] } - }, - "required": [ - - ] + } }, "subWorkflowConfig": { "type": "object", @@ -436,6 +433,10 @@ "usePydra": { "type": "boolean" }, + "queueName": { + "description": "If using Pydra you can send the workflow to a Temporal queue", + "type": "string" + }, "state": { "$ref": "https://raw.githubusercontent.com/SPINEProject/SPINE-json-schema/master/schemas/execution.schema.json#/definitions/state" }, diff --git a/schemas/workflowExecutionMatrix.schema.json b/schemas/workflowExecutionMatrix.schema.json index 07b1d98..5ee33a7 100644 --- a/schemas/workflowExecutionMatrix.schema.json +++ b/schemas/workflowExecutionMatrix.schema.json @@ -1216,6 +1216,19 @@ "$ref": "#/definitions/postWorkflowExecutionMatrixActionOtherBody" } ] + }, + "postWorkflowExecutionMatrixGlobalActionBody": { + "type": "object", + "additionalProperties": false, + "required": ["actionType"], + "properties": { + "actionType": { + "type": "string", + "enum": [ + "LAUNCH" + ] + } + } } } } \ No newline at end of file diff --git a/schemas/workflowExecutor.schema.json b/schemas/workflowExecutor.schema.json index 5428495..753aba2 100644 --- a/schemas/workflowExecutor.schema.json +++ b/schemas/workflowExecutor.schema.json @@ -5,6 +5,7 @@ "additionalProperties": false, "title": "Workflow Executor", "properties": { + "uuid": { "description":"Task Executor UUID", "type":"string" From 89aa8cfa1dc77ead6e9c31cbd07a6c274a7d0828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Thu, 31 Aug 2023 17:18:21 +0200 Subject: [PATCH 06/26] adding queued --- schemas/workflowExecutionMatrix.schema.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/schemas/workflowExecutionMatrix.schema.json b/schemas/workflowExecutionMatrix.schema.json index 5ee33a7..9b50070 100644 --- a/schemas/workflowExecutionMatrix.schema.json +++ b/schemas/workflowExecutionMatrix.schema.json @@ -42,7 +42,8 @@ "required": [ "configuration", "status", - "similarExecutionList" + "similarExecutionList", + "isQueued" ] } }, @@ -73,6 +74,9 @@ "reused": { "type": "boolean" }, + "isQueued": { + "type": "boolean" + }, "similarExecutionList": { "type": "array", "items": { From d456272e27bcbfb93b9d4f8e57961193d33d4601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Thu, 31 Aug 2023 17:19:16 +0200 Subject: [PATCH 07/26] queued --- schemas/workflowExecutionMatrix.schema.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/schemas/workflowExecutionMatrix.schema.json b/schemas/workflowExecutionMatrix.schema.json index 9b50070..50f065d 100644 --- a/schemas/workflowExecutionMatrix.schema.json +++ b/schemas/workflowExecutionMatrix.schema.json @@ -42,8 +42,7 @@ "required": [ "configuration", "status", - "similarExecutionList", - "isQueued" + "similarExecutionList" ] } }, From 755e65bd754959152b10258018b73ab9f3528f41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Thu, 31 Aug 2023 18:21:50 +0200 Subject: [PATCH 08/26] fix commas --- schemas/workflowExecutor.schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schemas/workflowExecutor.schema.json b/schemas/workflowExecutor.schema.json index 753aba2..ec57366 100644 --- a/schemas/workflowExecutor.schema.json +++ b/schemas/workflowExecutor.schema.json @@ -12,11 +12,11 @@ }, "label":{ "type":"string", - "description": "Label for this workflow instance", + "description": "Label for this workflow instance" }, "miniWorkflowSet":{ "type":"string", - "description": "UUID of a mini workflow set to use for this execution", + "description": "UUID of a mini workflow set to use for this execution" }, "reference": { "description":"References to other entities", From 09c1186f3442d9fd9a0149ef1533b3fcf4faf2e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Fri, 1 Sep 2023 00:50:44 +0200 Subject: [PATCH 09/26] replace is quzeue by queue progress --- schemas/workflowExecutionMatrix.schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schemas/workflowExecutionMatrix.schema.json b/schemas/workflowExecutionMatrix.schema.json index 50f065d..9f9b5aa 100644 --- a/schemas/workflowExecutionMatrix.schema.json +++ b/schemas/workflowExecutionMatrix.schema.json @@ -73,8 +73,8 @@ "reused": { "type": "boolean" }, - "isQueued": { - "type": "boolean" + "queueProgress": { + "type": "string" }, "similarExecutionList": { "type": "array", From f7448e978e5b754c4ea00d6a895698f0b2ee96f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Wed, 6 Sep 2023 12:52:44 +0200 Subject: [PATCH 10/26] launch all --- schemas/workflowExecutionMatrix.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/workflowExecutionMatrix.schema.json b/schemas/workflowExecutionMatrix.schema.json index 9f9b5aa..8f79018 100644 --- a/schemas/workflowExecutionMatrix.schema.json +++ b/schemas/workflowExecutionMatrix.schema.json @@ -1234,4 +1234,4 @@ } } } -} \ No newline at end of file +} From a6911a24bedfb0d5c43f742d788186bd159ab319 Mon Sep 17 00:00:00 2001 From: gregblt Date: Wed, 6 Sep 2023 13:05:28 +0200 Subject: [PATCH 11/26] new version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4558fc4..2f7a7ec 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "workflow" ], "description": "Set of JSON schemas for the SPINE Virtual Laboratory", - "version": "3.2.0-dev.1", + "version": "3.2.0-dev.2", "dependencies": { "ajv": "^6.12.2" }, From 37f74ac83ed89300b8ca8b5e4bdb983d3e9473fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Thu, 7 Sep 2023 16:57:12 +0200 Subject: [PATCH 12/26] Starting 0.2.2 --- schemas/API/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/API/index.json b/schemas/API/index.json index 8507159..0f5ce82 100644 --- a/schemas/API/index.json +++ b/schemas/API/index.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "0.2.1", + "version": "0.2.2", "title": "SPINE API", "description": "SPINE API" }, From 8ba3c075103af380fedc00299ab313f7e7517231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Mon, 13 May 2024 16:13:52 +0200 Subject: [PATCH 13/26] Initial commit for import schema --- .../api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f | 1 + schemas/API/index.json | 2 +- schemas/import.schema.json | 146 ++++++++++++++++++ 3 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 schemas/import.schema.json diff --git a/.postman/api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f b/.postman/api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f index 3039051..a31eaad 100644 --- a/.postman/api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f +++ b/.postman/api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f @@ -49,6 +49,7 @@ files[] = {"path":"helpPanel.schema.json","metaData":{}} files[] = {"path":"imageFilter.schema.json","metaData":{}} files[] = {"path":"imageFilterAttribute.schema.json","metaData":{}} files[] = {"path":"imageFilterSnapshot.schema.json","metaData":{}} +files[] = {"path":"import.schema.json","metaData":{}} files[] = {"path":"livePresenterExperiment.schema.json","metaData":{}} files[] = {"path":"livePresenterExperimentResult.schema.json","metaData":{}} files[] = {"path":"materializedTask.schema.json","metaData":{}} diff --git a/schemas/API/index.json b/schemas/API/index.json index 0f5ce82..97fbde9 100644 --- a/schemas/API/index.json +++ b/schemas/API/index.json @@ -1,7 +1,7 @@ { "openapi": "3.0.0", "info": { - "version": "0.2.2", + "version": "0.2.3-dev", "title": "SPINE API", "description": "SPINE API" }, diff --git a/schemas/import.schema.json b/schemas/import.schema.json new file mode 100644 index 0000000..3cd796f --- /dev/null +++ b/schemas/import.schema.json @@ -0,0 +1,146 @@ +{ + "$id": "https://raw.githubusercontent.com/SPINEProject/SPINE-json-schema/master/schemas/import.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Import", + "definitions": { + "_id": { + "type": "string" + }, + "_rev": { + "type": "string" + }, + "pathToFolder": { + "type": "string" + }, + "endUploadDate": { + "type": "string" + }, + "uploadDate": { + "type": "string" + }, + "dicomFileCount": { + "minimum": 0, + "type": "integer" + }, + "nonDicomFileCount": { + "minimum": 0, + "type": "integer" + }, + "subjectCount": { + "minimum": 0, + "type": "integer" + }, + "visitCount": { + "minimum": 0, + "type": "integer" + }, + "acquisitionCount": { + "minimum": 0, + "type": "integer" + }, + "docType": { + "type": "string", + "enum": [ + "import" + ] + }, + "status": { + "type": "string", + "enum": [ + "LISTING", + "LISTING_DONE", + "PROCESSING_SERIES", + "PROCESSING_SERIES_DONE", + "REPLICATING", + "FAILED", + "DONE" + ] + }, + "reference": { + "type": "object", + "properties": { + "cohortId": { + "type": "string" + } + }, + "required": [ + "cohortId" + ] + }, + "anonymize": { + "type": "boolean" + }, + "importListing": { + "type": "object", + "properties": { + "status": { + "enum": ["LISTING"] + } + }, + "required": [ + + ] + }, + "importDoc": { + "type": "object", + "properties": { + "anonymize": { + "$ref": "#definitions/anonymize" + }, + "_id": { + "$ref": "#/definitions/_id" + }, + "_rev": { + "$ref": "#/definitions/_rev" + }, + "pathToFolder": { + "$ref": "#/definitions/pathToFolder" + }, + "endUploadDate": { + "$ref": "#/definitions/endUploadDate" + }, + "uploadDate": { + "$ref": "#/definitions/uploadDate" + }, + "dicomFileCount": { + "$ref": "#/definitions/dicomFileCount" + }, + "nonDicomFileCount": { + "$ref": "#/definitions/nonDicomFileCount" + }, + "subjectCount": { + "$ref": "#/definitions/subjectCount" + }, + "visitCount": { + "$ref": "#/definitions/visitCount" + }, + "acquisitionCount": { + "$ref": "#/definitions/acquisitionCount" + }, + "docType": { + "$ref": "#/definitions/docType" + }, + "status": { + "$ref": "#/definitions/status" + }, + "reference": { + "$ref": "#/definitions/reference" + } + }, + "oneOf": [ + {"#ref": "#/definitions/importListing"} + ], + "additionalProperties": false, + "required": [ + "reference", + "status", + "docType", + "uploadDate", + "pathToFolder", + "_ìd", + "_rev", + "anonymize" + ] + } + } +} \ No newline at end of file From acd110d34a03cb58f06822f0d88e864d3bc3b505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Mon, 13 May 2024 16:57:59 +0200 Subject: [PATCH 14/26] save progress --- schemas/import.schema.json | 131 ++++++++++++++++++++++++++++++++++--- 1 file changed, 123 insertions(+), 8 deletions(-) diff --git a/schemas/import.schema.json b/schemas/import.schema.json index 3cd796f..f05be54 100644 --- a/schemas/import.schema.json +++ b/schemas/import.schema.json @@ -45,15 +45,21 @@ ] }, "status": { + "type": "string", + "enum": [ + "FAILED", + "DONE", + "RUNNING" + ] + }, + "step": { "type": "string", "enum": [ "LISTING", "LISTING_DONE", "PROCESSING_SERIES", "PROCESSING_SERIES_DONE", - "REPLICATING", - "FAILED", - "DONE" + "REPLICATING" ] }, "reference": { @@ -74,22 +80,125 @@ "type": "object", "properties": { "status": { - "enum": ["LISTING"] + "enum": [ + "LISTING" + ] + }, + "step": { + "enum": [ + "RUNNING" + ] + } + } + }, + "importReplicating": { + "type": "object", + "properties": { + "status": { + "enum": [ + "REPLICATING" + ] } }, "required": [ - + "dicomFileCount", + "nonDicomFileCount", + "subjectCount", + "visitCount", + "acquisitionCount" ] }, + "importListingDone": { + "type": "object", + "properties": { + "status": { + "enum": [ + "LISTING_DONE" + ] + } + }, + "required": [ + "dicomFileCount", + "nonDicomFileCount" + ] + }, + "importProcessingSeries": { + "type": "object", + "properties": { + "status": { + "enum": [ + "PROCESSING_SERIES" + ] + } + }, + "required": [ + "dicomFileCount", + "nonDicomFileCount" + ] + }, + "importProcessingSeriesDone": { + "type": "object", + "properties": { + "status": { + "enum": [ + "PROCESSING_SERIES_DONE" + ] + } + }, + "required": [ + "dicomFileCount", + "nonDicomFileCount", + "subjectCount", + "visitCount", + "acquisitionCount" + ] + }, + "importDone": { + "type": "object", + "properties": { + "status": { + "enum": [ + "DONE" + ] + } + }, + "required": [ + "dicomFileCount", + "nonDicomFileCount", + "subjectCount", + "visitCount", + "acquisitionCount", + "endUploadDate" + ] + }, + "importFailed": { + "type": "object", + "properties": { + "status": { + "enum": [ + "FAILED" + ] + } + }, + "required": [ + "failMessage" + ] + }, + "failMessage": { + "type": "string" + }, "importDoc": { "type": "object", "properties": { "anonymize": { - "$ref": "#definitions/anonymize" + "$ref": "#/definitions/anonymize" }, "_id": { "$ref": "#/definitions/_id" }, + "failMessage": { + "$ref": "#/definitions/failMessage" + }, "_rev": { "$ref": "#/definitions/_rev" }, @@ -123,12 +232,17 @@ "status": { "$ref": "#/definitions/status" }, + "step": { + "$ref": "#/definitions/step" + }, "reference": { "$ref": "#/definitions/reference" } }, "oneOf": [ - {"#ref": "#/definitions/importListing"} + { + "#ref": "#/definitions/importListing" + } ], "additionalProperties": false, "required": [ @@ -137,7 +251,8 @@ "docType", "uploadDate", "pathToFolder", - "_ìd", + "step", + "_id", "_rev", "anonymize" ] From 92d18107c3fc668174838a7406b5d264a46f11e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Tue, 14 May 2024 13:26:23 +0200 Subject: [PATCH 15/26] V1 import schema --- schemas/import.schema.json | 89 ++++++++++++++++++++++++-------------- 1 file changed, 57 insertions(+), 32 deletions(-) diff --git a/schemas/import.schema.json b/schemas/import.schema.json index f05be54..6291426 100644 --- a/schemas/import.schema.json +++ b/schemas/import.schema.json @@ -45,21 +45,17 @@ ] }, "status": { - "type": "string", - "enum": [ - "FAILED", - "DONE", - "RUNNING" - ] - }, - "step": { "type": "string", "enum": [ "LISTING", "LISTING_DONE", + "LISTING_FAILED", "PROCESSING_SERIES", "PROCESSING_SERIES_DONE", - "REPLICATING" + "PROCESSING_SERIES_FAILED", + "REPLICATING", + "REPLICATING_FAILED", + "DONE" ] }, "reference": { @@ -83,44 +79,33 @@ "enum": [ "LISTING" ] - }, - "step": { - "enum": [ - "RUNNING" - ] } } }, - "importReplicating": { + "importListingDone": { "type": "object", "properties": { "status": { "enum": [ - "REPLICATING" + "LISTING_DONE" ] } }, "required": [ "dicomFileCount", - "nonDicomFileCount", - "subjectCount", - "visitCount", - "acquisitionCount" + "nonDicomFileCount" ] }, - "importListingDone": { + "importListingFailed": { "type": "object", "properties": { "status": { "enum": [ - "LISTING_DONE" + "LISTING_FAILED" ] } }, - "required": [ - "dicomFileCount", - "nonDicomFileCount" - ] + "required": ["failMessage"] }, "importProcessingSeries": { "type": "object", @@ -153,12 +138,27 @@ "acquisitionCount" ] }, - "importDone": { + "importProcessingSeriesFailed": { + "type": "object", + "properties": { + "status": { + "enum": [ + "PROCESSING_SERIES_FAILED" + ] + } + }, + "required": [ + "dicomFileCount", + "nonDicomFileCount", + "failMessage" + ] + }, + "importReplicating": { "type": "object", "properties": { "status": { "enum": [ - "DONE" + "REPLICATING" ] } }, @@ -167,23 +167,45 @@ "nonDicomFileCount", "subjectCount", "visitCount", - "acquisitionCount", - "endUploadDate" + "acquisitionCount" ] }, - "importFailed": { + "importReplicatingFailed": { "type": "object", "properties": { "status": { "enum": [ - "FAILED" + "REPLICATING_FAILED" ] } }, "required": [ + "dicomFileCount", + "nonDicomFileCount", + "subjectCount", + "visitCount", + "acquisitionCount", "failMessage" ] }, + "importDone": { + "type": "object", + "properties": { + "status": { + "enum": [ + "REPLICATING_DONE" + ] + } + }, + "required": [ + "dicomFileCount", + "nonDicomFileCount", + "subjectCount", + "visitCount", + "acquisitionCount", + "endUploadDate" + ] + }, "failMessage": { "type": "string" }, @@ -226,6 +248,9 @@ "acquisitionCount": { "$ref": "#/definitions/acquisitionCount" }, + "seriesCount": { + "$ref": "#/definitions/acquisitionCount" + }, "docType": { "$ref": "#/definitions/docType" }, From d773d46bbcb61904958b7d1fbe3482da9a036015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Fri, 24 May 2024 16:10:05 +0200 Subject: [PATCH 16/26] commit --- .../api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f | 2 + schemas/import.schema.json | 238 ++++++++++++++++-- schemas/importSubject.schema.json | 68 +++++ schemas/importVisit.schema.json | 77 ++++++ 4 files changed, 365 insertions(+), 20 deletions(-) create mode 100644 schemas/importSubject.schema.json create mode 100644 schemas/importVisit.schema.json diff --git a/.postman/api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f b/.postman/api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f index a31eaad..f309c3a 100644 --- a/.postman/api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f +++ b/.postman/api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f @@ -50,6 +50,8 @@ files[] = {"path":"imageFilter.schema.json","metaData":{}} files[] = {"path":"imageFilterAttribute.schema.json","metaData":{}} files[] = {"path":"imageFilterSnapshot.schema.json","metaData":{}} files[] = {"path":"import.schema.json","metaData":{}} +files[] = {"path":"importSubject.schema.json","metaData":{}} +files[] = {"path":"importVisit.schema.json","metaData":{}} files[] = {"path":"livePresenterExperiment.schema.json","metaData":{}} files[] = {"path":"livePresenterExperimentResult.schema.json","metaData":{}} files[] = {"path":"materializedTask.schema.json","metaData":{}} diff --git a/schemas/import.schema.json b/schemas/import.schema.json index 6291426..7939a13 100644 --- a/schemas/import.schema.json +++ b/schemas/import.schema.json @@ -9,6 +9,23 @@ "_rev": { "type": "string" }, + "progress": { + "type": "number", + "minimum": 0, + "maximum": 100 + }, + "cohort": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "required": ["name", "id"] + }, "pathToFolder": { "type": "string" }, @@ -22,6 +39,10 @@ "minimum": 0, "type": "integer" }, + "totalFileCount": { + "minimum": 0, + "type": "integer" + }, "nonDicomFileCount": { "minimum": 0, "type": "integer" @@ -47,6 +68,7 @@ "status": { "type": "string", "enum": [ + "INIT", "LISTING", "LISTING_DONE", "LISTING_FAILED", @@ -63,15 +85,32 @@ "properties": { "cohortId": { "type": "string" + }, + "userId": { + "type": "string" } }, "required": [ - "cohortId" + "cohortId", + "userId" ] }, "anonymize": { "type": "boolean" }, + "importInit": { + "type": "object", + "properties": { + "status": { + "enum": [ + "INIT" + ] + } + }, + "required": [ + "status" + ] + }, "importListing": { "type": "object", "properties": { @@ -80,7 +119,12 @@ "LISTING" ] } - } + }, + "required": [ + "uploadDate", + "status", + "totalFileCount" + ] }, "importListingDone": { "type": "object", @@ -93,7 +137,10 @@ }, "required": [ "dicomFileCount", - "nonDicomFileCount" + "nonDicomFileCount", + "uploadDate", + "status", + "totalFileCount" ] }, "importListingFailed": { @@ -105,7 +152,12 @@ ] } }, - "required": ["failMessage"] + "required": [ + "failMessage", + "uploadDate", + "status", + "totalFileCount" + ] }, "importProcessingSeries": { "type": "object", @@ -118,7 +170,10 @@ }, "required": [ "dicomFileCount", - "nonDicomFileCount" + "nonDicomFileCount", + "uploadDate", + "status", + "totalFileCount" ] }, "importProcessingSeriesDone": { @@ -135,7 +190,10 @@ "nonDicomFileCount", "subjectCount", "visitCount", - "acquisitionCount" + "acquisitionCount", + "uploadDate", + "status", + "totalFileCount" ] }, "importProcessingSeriesFailed": { @@ -150,7 +208,10 @@ "required": [ "dicomFileCount", "nonDicomFileCount", - "failMessage" + "failMessage", + "uploadDate", + "status", + "totalFileCount" ] }, "importReplicating": { @@ -167,10 +228,13 @@ "nonDicomFileCount", "subjectCount", "visitCount", - "acquisitionCount" + "acquisitionCount", + "uploadDate", + "status", + "totalFileCount" ] }, - "importReplicatingFailed": { + "importReplicatingFailed": { "type": "object", "properties": { "status": { @@ -185,7 +249,10 @@ "subjectCount", "visitCount", "acquisitionCount", - "failMessage" + "failMessage", + "uploadDate", + "status", + "totalFileCount" ] }, "importDone": { @@ -203,7 +270,10 @@ "subjectCount", "visitCount", "acquisitionCount", - "endUploadDate" + "endUploadDate", + "uploadDate", + "status", + "totalFileCount" ] }, "failMessage": { @@ -242,6 +312,9 @@ "subjectCount": { "$ref": "#/definitions/subjectCount" }, + "totalFileCount": { + "$ref": "#/definitions/totalFileCount" + }, "visitCount": { "$ref": "#/definitions/visitCount" }, @@ -257,16 +330,40 @@ "status": { "$ref": "#/definitions/status" }, - "step": { - "$ref": "#/definitions/step" - }, "reference": { "$ref": "#/definitions/reference" } }, "oneOf": [ { - "#ref": "#/definitions/importListing" + "$ref": "#/definitions/importListing" + }, + { + "$ref": "#/definitions/importListingDone" + }, + { + "$ref": "#/definitions/importListingFailed" + }, + { + "$ref": "#/definitions/importProcessingSeries" + }, + { + "$ref": "#/definitions/importProcessingSeriesDone" + }, + { + "$ref": "#/definitions/importProcessingSeriesFailed" + }, + { + "$ref": "#/definitions/importReplicating" + }, + { + "$ref": "#/definitions/importReplicatingFailed" + }, + { + "$ref": "#/definitions/importDone" + }, + { + "$ref": "#/definitions/importInit" } ], "additionalProperties": false, @@ -274,13 +371,114 @@ "reference", "status", "docType", - "uploadDate", "pathToFolder", - "step", - "_id", - "_rev", "anonymize" ] + }, + "postImport": { + "properties": { + "dicomPath": { + "$ref": "#/definitions/pathToFolder" + }, + "anonymization": { + "$ref": "#/definitions/anonymize" + } + }, + "required": ["dicomPath", "anonymization"] + }, + "postImportResponse": { + "type": "object", + "properties": { + "anonymize": { + "$ref": "#/definitions/anonymize" + }, + "uuid": { + "$ref": "#/definitions/_id" + }, + "failMessage": { + "$ref": "#/definitions/failMessage" + }, + "folder": { + "$ref": "#/definitions/pathToFolder" + }, + "endUploadDate": { + "$ref": "#/definitions/endUploadDate" + }, + "uploadDate": { + "$ref": "#/definitions/uploadDate" + }, + "dicomFileCount": { + "$ref": "#/definitions/dicomFileCount" + }, + "progress": { + "$ref": "#/definitions/progress" + }, + "totalFileCount": { + "$ref": "#/definitions/totalFileCount" + }, + "nonDicomFileCount": { + "$ref": "#/definitions/nonDicomFileCount" + }, + "subjectCount": { + "$ref": "#/definitions/subjectCount" + }, + "visitCount": { + "$ref": "#/definitions/visitCount" + }, + "acquisitionCount": { + "$ref": "#/definitions/acquisitionCount" + }, + "seriesCount": { + "$ref": "#/definitions/acquisitionCount" + }, + "status": { + "$ref": "#/definitions/status" + }, + "cohort": { + "$ref": "#/definitions/cohort" + } + }, + "oneOf": [ + { + "$ref": "#/definitions/importListing" + }, + { + "$ref": "#/definitions/importListingDone" + }, + { + "$ref": "#/definitions/importListingFailed" + }, + { + "$ref": "#/definitions/importProcessingSeries" + }, + { + "$ref": "#/definitions/importProcessingSeriesDone" + }, + { + "$ref": "#/definitions/importProcessingSeriesFailed" + }, + { + "$ref": "#/definitions/importReplicating" + }, + { + "$ref": "#/definitions/importReplicatingFailed" + }, + { + "$ref": "#/definitions/importDone" + }, + { + "$ref": "#/definitions/importInit" + } + ], + "additionalProperties": false, + "required": [ + "status", + "folder", + "anonymize", + "uuid", + "cohort", + "progress" + ] } } -} \ No newline at end of file +} diff --git a/schemas/importSubject.schema.json b/schemas/importSubject.schema.json new file mode 100644 index 0000000..a37ea7b --- /dev/null +++ b/schemas/importSubject.schema.json @@ -0,0 +1,68 @@ +{ + "$id": "https://raw.githubusercontent.com/SPINEProject/SPINE-json-schema/master/schemas/import.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Import", + "definitions": { + "_id": { + "type": "string" + }, + "_rev": { + "type": "string" + }, + "docType": { + "type": "string", + "enum": [ + "importSubject" + ] + }, + "reference": { + "type": "object", + "properties": { + "importId": { + "type": "string" + } + }, + "required": [ + "importId" + ] + }, + "originalCohortId":{ + "type": "string" + }, + "dob":{ + "type": "string" + }, + "sex":{ + "type": "string" + }, + "importSubjectDoc": { + "type": "object", + "properties": { + "_id": { + "$ref": "#/definitions/_id" + }, + "_rev": { + "$ref": "#/definitions/_rev" + }, + "reference": { + "$ref": "#/definitions/reference" + }, + "originalCohortId": { + "$ref": "#/definitions/originalCohortId" + }, + "dob": { + "$ref": "#/definitions/dob" + }, + "sex": { + "$ref": "#/definitions/sex" + } + }, + "additionalProperties": false, + "required": [ + "reference", + "docType", + "originalCohortId" + ] + } + } +} diff --git a/schemas/importVisit.schema.json b/schemas/importVisit.schema.json new file mode 100644 index 0000000..03a7573 --- /dev/null +++ b/schemas/importVisit.schema.json @@ -0,0 +1,77 @@ +{ + "$id": "https://raw.githubusercontent.com/SPINEProject/SPINE-json-schema/master/schemas/importVisit.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Import visit", + "definitions": { + "_id": { + "type": "string" + }, + "_rev": { + "type": "string" + }, + "docType": { + "type": "string", + "enum": [ + "importVisit" + ] + }, + "reference": { + "type": "object", + "properties": { + "importId": { + "type": "string" + }, + "importSubjectId": { + "type": "string" + } + }, + "required": [ + "importId", + "importSubjectId" + ] + }, + "label":{ + "type": "string" + }, + "visitType":{ + "type": "string" + "enum": ["imaging"] + }, + "date":{ + "type": "string" + }, + "importVisitDoc": { + "type": "object", + "properties": { + "_id": { + "$ref": "#/definitions/_id" + }, + "_rev": { + "$ref": "#/definitions/_rev" + }, + "reference": { + "$ref": "#/definitions/reference" + }, + "label": { + "$ref": "#/definitions/label" + }, + "visitType": { + "$ref": "#/definitions/visitType" + }, + "date": { + "$ref": "#/definitions/sex" + }, + "docType": { + "$ref": "#/definitions/docType" + } + }, + "additionalProperties": false, + "required": [ + "reference", + "docType", + "label", + "visitType" + ] + } + } +} From 119f493053d957136623cc48c7857f1bb523a8ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Fri, 24 May 2024 16:43:33 +0200 Subject: [PATCH 17/26] import series schema --- .../api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f | 1 + schemas/importSeries.schema.json | 84 +++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 schemas/importSeries.schema.json diff --git a/.postman/api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f b/.postman/api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f index f309c3a..86d034d 100644 --- a/.postman/api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f +++ b/.postman/api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f @@ -50,6 +50,7 @@ files[] = {"path":"imageFilter.schema.json","metaData":{}} files[] = {"path":"imageFilterAttribute.schema.json","metaData":{}} files[] = {"path":"imageFilterSnapshot.schema.json","metaData":{}} files[] = {"path":"import.schema.json","metaData":{}} +files[] = {"path":"importSeries.schema.json","metaData":{}} files[] = {"path":"importSubject.schema.json","metaData":{}} files[] = {"path":"importVisit.schema.json","metaData":{}} files[] = {"path":"livePresenterExperiment.schema.json","metaData":{}} diff --git a/schemas/importSeries.schema.json b/schemas/importSeries.schema.json new file mode 100644 index 0000000..3addabd --- /dev/null +++ b/schemas/importSeries.schema.json @@ -0,0 +1,84 @@ +{ + "$id": "https://raw.githubusercontent.com/SPINEProject/SPINE-json-schema/master/schemas/importSeries.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Import visit", + "definitions": { + "_id": { + "type": "string" + }, + "_rev": { + "type": "string" + }, + "docType": { + "type": "string", + "enum": [ + "importSeries" + ] + }, + "reference": { + "type": "object", + "properties": { + "importId": { + "type": "string" + }, + "importSubjectId": { + "type": "string" + }, + "importVisitId": { + "type": "string" + } + }, + "required": [ + "importId", + "importSubjectId", + "importVisitId" + ] + }, + "label":{ + "type": "string" + }, + "seriesNumber": { + "type": "string" + }, + "pathToDispatchedFolder": { + "type": "string" + }, + "processed": { + "type": "boolean" + }, + "importSeriesDoc": { + "type": "object", + "properties": { + "_id": { + "$ref": "#/definitions/_id" + }, + "_rev": { + "$ref": "#/definitions/_rev" + }, + "reference": { + "$ref": "#/definitions/reference" + }, + "seriesNumber": { + "$ref": "#/definitions/label" + }, + "pathToDispatchedFolder": { + "$ref": "#/definitions/pathToDispatchedFolder" + }, + "processed": { + "$ref": "#/definitions/processed" + }, + "docType": { + "$ref": "#/definitions/docType" + } + }, + "additionalProperties": false, + "required": [ + "reference", + "docType", + "processed", + "pathToDispatchedFolder", + "seriesNumber" + ] + } + } +} From c2ac41cbc27397bbce3693feadc20df3bf4a8cb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Fri, 31 May 2024 14:31:53 +0200 Subject: [PATCH 18/26] add more params to post import --- schemas/import.schema.json | 108 +++++++++++++++++++++++++++++++------ 1 file changed, 93 insertions(+), 15 deletions(-) diff --git a/schemas/import.schema.json b/schemas/import.schema.json index 7939a13..4bd732d 100644 --- a/schemas/import.schema.json +++ b/schemas/import.schema.json @@ -3,6 +3,64 @@ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Import", "definitions": { + "lutTableItems": { + "type": "object", + "required": [ + "dicomPatientId", + "spineSubjectId", + "fromCohortLut" + ], + "properties": { + "dicomPatientId": { + "type": "string" + }, + "spineSubjectId": { + "type": "string" + }, + "fromCohortLut": { + "type": "boolean" + } + } + }, + "lutTable": { + "type": "array", + "items": { + "$ref": "#/definitions/lutTableItems" + } + }, + "exhaustiveLut": { + "type": "boolean" + }, + "subjectLabelAnonMethod": { + "type": "string", + "enum": [ + "RANDOM_LABEL", + "SAME_LABELS", + "LUT_LABELS" + ] + }, + "fieldsToAnonymizeTable": { + "type": "array", + "items": { + "$ref": "#/definitions/fieldsToAnonymizeTableItems" + } + }, + "fieldsToAnonymizeTableItems": { + "type": "object", + "required": [ + "tag", + "anonValue" + ], + "properties": { + "tag": { + "type": "string", + "pattern": "^\\([0-9A-F]{4},[0-9A-F]{4}\\)$" + }, + "anonValue": { + "type": "string" + } + } + }, "_id": { "type": "string" }, @@ -10,21 +68,24 @@ "type": "string" }, "progress": { - "type": "number", - "minimum": 0, - "maximum": 100 + "type": "number", + "minimum": 0, + "maximum": 100 }, "cohort": { - "type": "object", - "properties": { - "name": { - "type": "string" + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "id": { + "type": "string" + } }, - "id": { - "type": "string" - } - }, - "required": ["name", "id"] + "required": [ + "name", + "id" + ] }, "pathToFolder": { "type": "string" @@ -383,8 +444,25 @@ "anonymization": { "$ref": "#/definitions/anonymize" } + "lut": { + "$ref": "#/definitions/lutTable" + }, + "exhaustiveLut": { + "$ref": "#/definitions/exhaustiveLut" + }, + "subjectLabelAnonMethod": { + "$ref": "#/definitions/subjectLabelAnonMethod" + }, + "fieldsToAnonymize": { + "$ref": "#/definitions/fieldsToAnonymizeTable" + } }, - "required": ["dicomPath", "anonymization"] + "required": [ + "dicomPath", + "anonymization", + "lut", + "exhaustiveLut" + ] }, "postImportResponse": { "type": "object", @@ -411,7 +489,7 @@ "$ref": "#/definitions/dicomFileCount" }, "progress": { - "$ref": "#/definitions/progress" + "$ref": "#/definitions/progress" }, "totalFileCount": { "$ref": "#/definitions/totalFileCount" @@ -481,4 +559,4 @@ ] } } -} +} \ No newline at end of file From 4bd0f309156f6474f9e20b9455ad944ff569d817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Fri, 31 May 2024 14:57:38 +0200 Subject: [PATCH 19/26] wip --- schemas/import.schema.json | 214 ++++++++++++++++++++++++++++++++++++- 1 file changed, 210 insertions(+), 4 deletions(-) diff --git a/schemas/import.schema.json b/schemas/import.schema.json index 4bd732d..63d4d72 100644 --- a/schemas/import.schema.json +++ b/schemas/import.schema.json @@ -20,7 +20,8 @@ "fromCohortLut": { "type": "boolean" } - } + }, + "additionalProperties": false }, "lutTable": { "type": "array", @@ -28,13 +29,34 @@ "$ref": "#/definitions/lutTableItems" } }, + "lutTableExhaustive": { + "type": "array", + "minItems": 1, + "allOf": [ + { + "$ref": "#/definitions/lutTable" + } + ] + }, + "exhaustiveLutTrue": { + "type": "boolean", + "enum": [ + true + ] + }, + "exhaustiveLutFalse": { + "type": "boolean", + "enum": [ + false + ] + }, "exhaustiveLut": { "type": "boolean" }, "subjectLabelAnonMethod": { "type": "string", "enum": [ - "RANDOM_LABEL", + "RANDOM_LABELS", "SAME_LABELS", "LUT_LABELS" ] @@ -59,7 +81,8 @@ "anonValue": { "type": "string" } - } + }, + "additionalProperties": false }, "_id": { "type": "string" @@ -436,14 +459,188 @@ "anonymize" ] }, - "postImport": { + "postImportLutExhaustiveNoAnon": { + "type": "object", + "properties": { + "lut": { + "$ref": "#/definitions/lutTableExhaustive" + }, + "exhaustiveLut": { + "$ref": "#/definitions/exhaustiveLutTrue" + } + }, + "required": [ + "lut", + "exhaustiveLut" + ] + }, + "postImportLutNonExhaustiveNoAnon": { + "type": "object", + "properties": { + "exhaustiveLut": { + "$ref": "#/definitions/exhaustiveLutFalse" + } + }, + "required": [ + "lut", + "exhaustiveLut" + ] + }, + "postImportNoAnon": { + "type": "object", + "properties": { + "dicomPath": { + "$ref": "#/definitions/pathToFolder" + }, + "anonymization": { + "$ref": "#/definitions/anonymize" + }, + "lut": { + "$ref": "#/definitions/lutTable" + }, + "exhaustiveLut": { + "$ref": "#/definitions/exhaustiveLut" + }, + "subjectLabelAnonMethod": { + "$ref": "#/definitions/subjectLabelAnonMethod" + }, + "fieldsToAnonymize": { + "$ref": "#/definitions/fieldsToAnonymizeTable" + } + }, + "required": [ + "dicomPath", + "anonymization", + "lut", + "exhaustiveLut" + ], + "oneOf": [ + { + "$ref": "#/definitions/postImportLutExhaustiveNoAnon" + }, + { + "$ref": "#/definitions/postImportLutNonExhaustiveNoAnon" + } + ], + "additionalProperties": false + }, + "postImportAnonRandomLabels": { + "type": "object", + "properties": { + "subjectLabelAnonMethod": { + "enum": [ + "RANDOM_LABELS" + ] + }, + "exhaustiveLut": { + "$ref": "#/definitions/exhaustiveLutFalse" + } + }, + "required": [ + "subjectLabelAnonMethod", + "exhaustiveLut" + ] + }, + "postImportAnonSameLabels": { + "type": "object", + "properties": { + "subjectLabelAnonMethod": { + "enum": [ + "SAME_LABELS" + ] + }, + "exhaustiveLut": { + "$ref": "#/definitions/exhaustiveLutFalse" + } + }, + "required": [ + "subjectLabelAnonMethod", + "exhaustiveLut" + ] + }, + "postImportAnonLutLabels": { + "type": "object", + "properties": { + "lut": { + "$ref": "#/definitions/lutTableExhaustive" + }, + "subjectLabelAnonMethod": { + "enum": [ + "LUT_LABELS" + ] + }, + "exhaustiveLut": { + "$ref": "#/definitions/exhaustiveLutTrue" + } + }, + "required": [ + "subjectLabelAnonMethod", + "exhaustiveLut", + "lut" + ], + "oneOf": [ + { + "$ref": "#/definitions/postImportAnonRandomLabels" + }, + { + "$ref": "#/definitions/postImportAnonSameLabels" + }, + { + "$ref": "#/definitions/postImportAnonLutLabels" + } + ], + "additionalProperties": false + }, + "postImportAnon": { + "type": "object", "properties": { "dicomPath": { "$ref": "#/definitions/pathToFolder" }, "anonymization": { "$ref": "#/definitions/anonymize" + }, + "lut": { + "$ref": "#/definitions/lutTable" + }, + "exhaustiveLut": { + "$ref": "#/definitions/exhaustiveLut" + }, + "subjectLabelAnonMethod": { + "$ref": "#/definitions/subjectLabelAnonMethod" + }, + "fieldsToAnonymize": { + "$ref": "#/definitions/fieldsToAnonymizeTable" + } + }, + "required": [ + "subjectLabelAnonMethod", + "fieldsToAnonymize", + "exhaustiveLut", + "lut" + ], + "oneOf": [ + { + "$ref": "#/definitions/postImportAnonRandomLabels" + }, + { + "$ref": "#/definitions/postImportAnonSameLabels" + }, + { + "$ref": "#/definitions/postImportAnonLutLabels" } + ], + "additionalProperties": false + }, + "postImport": { + "type": "object", + "properties": { + "dicomPath": { + "$ref": "#/definitions/pathToFolder" + }, + "anonymization": { + "$ref": "#/definitions/anonymize" + }, "lut": { "$ref": "#/definitions/lutTable" }, @@ -462,6 +659,15 @@ "anonymization", "lut", "exhaustiveLut" + ], + "additionalProperties": false, + "oneOf": [ + { + "$ref": "#/definitions/postImportNoAnon" + }, + { + "$ref": "#/definitions/postImportAnon" + } ] }, "postImportResponse": { From a3a8f0f17383b158d36a78aa35c7c0e956f819e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Fri, 31 May 2024 15:42:46 +0200 Subject: [PATCH 20/26] wip --- schemas/import.schema.json | 210 ++++++++++++++++++++++++++++--------- 1 file changed, 161 insertions(+), 49 deletions(-) diff --git a/schemas/import.schema.json b/schemas/import.schema.json index 63d4d72..8e59d81 100644 --- a/schemas/import.schema.json +++ b/schemas/import.schema.json @@ -363,6 +363,142 @@ "failMessage": { "type": "string" }, + "importDocNoAnon": { + "type": "object", + "properties": { + "anonymize": { + "enum": [ + false + ] + } + }, + "required": [ + "anonymize" + ] + }, + "importDocAnonRandomLabels": { + "type": "object", + "properties": { + "subjectLabelAnonMethod": { + "enum": [ + "RANDOM_LABELS" + ] + }, + "exhaustiveLut": { + "$ref": "#/definitions/exhaustiveLutFalse" + } + }, + "required": [ + "subjectLabelAnonMethod", + "exhaustiveLut" + ] + }, + "importDocAnonSameLabels": { + "type": "object", + "properties": { + "subjectLabelAnonMethod": { + "enum": [ + "SAME_LABELS" + ] + }, + "exhaustiveLut": { + "$ref": "#/definitions/exhaustiveLutFalse" + } + }, + "required": [ + "subjectLabelAnonMethod", + "exhaustiveLut" + ] + }, + "importDocAnonLutLabels": { + "type": "object", + "properties": { + "lut": { + "$ref": "#/definitions/lutTableExhaustive" + }, + "subjectLabelAnonMethod": { + "enum": [ + "LUT_LABELS" + ] + }, + "exhaustiveLut": { + "$ref": "#/definitions/exhaustiveLutTrue" + } + }, + "required": [ + "subjectLabelAnonMethod", + "exhaustiveLut", + "lut" + ] + }, + "importDocAnon": { + "type": "object", + "properties": { + "anonymize": { + "enum": [ + true + ] + } + }, + "required": [ + "anonymize" + ], + "oneOf": [ + { + "$ref": "#/definitions/importDocAnonRandomLabels" + }, + { + "$ref": "#/definitions/importDocAnonSameLabels" + }, + { + "$ref": "#/definitions/importDocAnonLutLabels" + } + ] + }, + "importDocStepVariants": { + "oneOf": [ + { + "$ref": "#/definitions/importListing" + }, + { + "$ref": "#/definitions/importListingDone" + }, + { + "$ref": "#/definitions/importListingFailed" + }, + { + "$ref": "#/definitions/importProcessingSeries" + }, + { + "$ref": "#/definitions/importProcessingSeriesDone" + }, + { + "$ref": "#/definitions/importProcessingSeriesFailed" + }, + { + "$ref": "#/definitions/importReplicating" + }, + { + "$ref": "#/definitions/importReplicatingFailed" + }, + { + "$ref": "#/definitions/importDone" + }, + { + "$ref": "#/definitions/importInit" + } + ] + }, + "importDocAnonVariants": { + "oneOf": [ + { + "$ref": "#/definitions/importDocNoAnon" + }, + { + "$ref": "#/definitions/importDocAnon" + } + ] + }, "importDoc": { "type": "object", "properties": { @@ -372,6 +508,18 @@ "_id": { "$ref": "#/definitions/_id" }, + "lutId": { + "$ref": "#/definitions/_id" + }, + "exhaustiveLut": { + "$ref": "#/definitions/exhaustiveLut" + }, + "subjectLabelAnonMethod": { + "$ref": "#/definitions/subjectLabelAnonMethod" + }, + "fieldsToAnonymize": { + "$ref": "#/definitions/fieldsToAnonymizeTable" + }, "failMessage": { "$ref": "#/definitions/failMessage" }, @@ -418,36 +566,12 @@ "$ref": "#/definitions/reference" } }, - "oneOf": [ - { - "$ref": "#/definitions/importListing" - }, - { - "$ref": "#/definitions/importListingDone" - }, - { - "$ref": "#/definitions/importListingFailed" - }, - { - "$ref": "#/definitions/importProcessingSeries" - }, - { - "$ref": "#/definitions/importProcessingSeriesDone" - }, - { - "$ref": "#/definitions/importProcessingSeriesFailed" - }, - { - "$ref": "#/definitions/importReplicating" - }, - { - "$ref": "#/definitions/importReplicatingFailed" - }, + "allOf": [ { - "$ref": "#/definitions/importDone" + "$ref": "#/definitions/importDocStepVariants" }, { - "$ref": "#/definitions/importInit" + "$ref": "#/definitions/importDocAnonVariants" } ], "additionalProperties": false, @@ -456,7 +580,9 @@ "status", "docType", "pathToFolder", - "anonymize" + "anonymize", + "lut", + "exhaustiveLut" ] }, "postImportLutExhaustiveNoAnon": { @@ -493,19 +619,15 @@ "$ref": "#/definitions/pathToFolder" }, "anonymization": { - "$ref": "#/definitions/anonymize" + "enum": [ + false + ] }, "lut": { "$ref": "#/definitions/lutTable" }, "exhaustiveLut": { "$ref": "#/definitions/exhaustiveLut" - }, - "subjectLabelAnonMethod": { - "$ref": "#/definitions/subjectLabelAnonMethod" - }, - "fieldsToAnonymize": { - "$ref": "#/definitions/fieldsToAnonymizeTable" } }, "required": [ @@ -577,19 +699,7 @@ "subjectLabelAnonMethod", "exhaustiveLut", "lut" - ], - "oneOf": [ - { - "$ref": "#/definitions/postImportAnonRandomLabels" - }, - { - "$ref": "#/definitions/postImportAnonSameLabels" - }, - { - "$ref": "#/definitions/postImportAnonLutLabels" - } - ], - "additionalProperties": false + ] }, "postImportAnon": { "type": "object", @@ -598,7 +708,9 @@ "$ref": "#/definitions/pathToFolder" }, "anonymization": { - "$ref": "#/definitions/anonymize" + "enum": [ + true + ] }, "lut": { "$ref": "#/definitions/lutTable" From 793f83cc45f8f9175be1c3b73e5805dc4d7188cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Fri, 31 May 2024 16:12:55 +0200 Subject: [PATCH 21/26] new uploader form almost done --- schemas/import.schema.json | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/schemas/import.schema.json b/schemas/import.schema.json index 8e59d81..e8bd082 100644 --- a/schemas/import.schema.json +++ b/schemas/import.schema.json @@ -413,9 +413,6 @@ "importDocAnonLutLabels": { "type": "object", "properties": { - "lut": { - "$ref": "#/definitions/lutTableExhaustive" - }, "subjectLabelAnonMethod": { "enum": [ "LUT_LABELS" @@ -427,8 +424,7 @@ }, "required": [ "subjectLabelAnonMethod", - "exhaustiveLut", - "lut" + "exhaustiveLut" ] }, "importDocAnon": { @@ -581,7 +577,7 @@ "docType", "pathToFolder", "anonymize", - "lut", + "lutId", "exhaustiveLut" ] }, @@ -875,6 +871,29 @@ "cohort", "progress" ] + }, + "patientIdLutDoc": { + "type": "object", + "properties": { + "lut": { + "$ref": "#/definitions/lutTable" + }, + "_id": { + "$ref": "#/definitions/_id" + }, + "_rev": { + "$ref": "#/definitions/_rev" + }, + "docType": { + "type": "string", + "enum": ["patientIdLut"] + } + }, + "required":[ + "lut", + "docType" + ], + "additionalProperties": false } } -} \ No newline at end of file +} From fc21a1126d5e8cff69461592a5b0f59b0cb3ac1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Fri, 31 May 2024 16:13:03 +0200 Subject: [PATCH 22/26] wip --- schemas/import.schema.json | 44 ++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/schemas/import.schema.json b/schemas/import.schema.json index e8bd082..bd14c89 100644 --- a/schemas/import.schema.json +++ b/schemas/import.schema.json @@ -873,27 +873,29 @@ ] }, "patientIdLutDoc": { - "type": "object", - "properties": { - "lut": { - "$ref": "#/definitions/lutTable" - }, - "_id": { - "$ref": "#/definitions/_id" - }, - "_rev": { - "$ref": "#/definitions/_rev" + "type": "object", + "properties": { + "lut": { + "$ref": "#/definitions/lutTable" + }, + "_id": { + "$ref": "#/definitions/_id" + }, + "_rev": { + "$ref": "#/definitions/_rev" + }, + "docType": { + "type": "string", + "enum": [ + "patientIdLut" + ] + } }, - "docType": { - "type": "string", - "enum": ["patientIdLut"] - } - }, - "required":[ - "lut", - "docType" - ], - "additionalProperties": false + "required": [ + "lut", + "docType" + ], + "additionalProperties": false } } -} +} \ No newline at end of file From 938d17c23710b0565f4dc27a9de3b2cc670d95b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Mon, 3 Jun 2024 20:35:35 +0200 Subject: [PATCH 23/26] wip --- schemas/import.schema.json | 52 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/schemas/import.schema.json b/schemas/import.schema.json index bd14c89..6a90123 100644 --- a/schemas/import.schema.json +++ b/schemas/import.schema.json @@ -361,7 +361,25 @@ ] }, "failMessage": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "properties": { + "reason": { + "type": "string" + }, + "missingPatientIds": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + ] }, "importDocNoAnon": { "type": "object", @@ -778,6 +796,36 @@ } ] }, + "postImportResume": { + "type": "object", + "required": ["stepToResume"], + "additionalProperties": false, + "properties": { + "stepToResume": { + "type": "string", + "enum": ["LISTING", "PROCESSING_SERIES"] + } + "newLutRows": { + "type": "array", + "items": { + "type": "object", + "required": [ + "dicomPatientId", + "spineSubjectId" + ], + "properties": { + "dicomPatientId": { + "type": "string" + }, + "spineSubjectId": { + "type": "string" + } + }, + "additionalProperties": false + } + } + } + }, "postImportResponse": { "type": "object", "properties": { @@ -898,4 +946,4 @@ "additionalProperties": false } } -} \ No newline at end of file +} From aeec423a3ec799b17ba5e5642c51718eb35d1780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Tue, 4 Jun 2024 12:04:17 +0200 Subject: [PATCH 24/26] wip --- schemas/import.schema.json | 59 +++++++++++++++++--------------- schemas/importSeries.schema.json | 24 +++++++++++++ 2 files changed, 56 insertions(+), 27 deletions(-) diff --git a/schemas/import.schema.json b/schemas/import.schema.json index 6a90123..004f375 100644 --- a/schemas/import.schema.json +++ b/schemas/import.schema.json @@ -797,34 +797,39 @@ ] }, "postImportResume": { - "type": "object", - "required": ["stepToResume"], - "additionalProperties": false, - "properties": { - "stepToResume": { - "type": "string", - "enum": ["LISTING", "PROCESSING_SERIES"] - } - "newLutRows": { - "type": "array", - "items": { - "type": "object", - "required": [ - "dicomPatientId", - "spineSubjectId" - ], - "properties": { - "dicomPatientId": { - "type": "string" - }, - "spineSubjectId": { - "type": "string" - } + "type": "object", + "required": [ + "stepToResume" + ], + "additionalProperties": false, + "properties": { + "stepToResume": { + "type": "string", + "enum": [ + "LISTING", + "PROCESSING_SERIES" + ] }, - "additionalProperties": false - } + "newLutRows": { + "type": "array", + "items": { + "type": "object", + "required": [ + "dicomPatientId", + "spineSubjectId" + ], + "properties": { + "dicomPatientId": { + "type": "string" + }, + "spineSubjectId": { + "type": "string" + } + }, + "additionalProperties": false + } + } } - } }, "postImportResponse": { "type": "object", @@ -946,4 +951,4 @@ "additionalProperties": false } } -} +} \ No newline at end of file diff --git a/schemas/importSeries.schema.json b/schemas/importSeries.schema.json index 3addabd..d8b39ca 100644 --- a/schemas/importSeries.schema.json +++ b/schemas/importSeries.schema.json @@ -69,6 +69,30 @@ }, "docType": { "$ref": "#/definitions/docType" + }, + "pathToDicoms": { + "type": "string" + }, + "name": { + "type": "string" + }, + "label": { + "type": "string" + }, + "dicomHeaderSummary": { + "type":"object", + "required": ["all"], + "additionalProperties": false, + "properties": { + "all": { + "type": "object" + } + } + }, + "sopInstanceUids": { + "type":"array", + "items": { + "type": "string" } }, "additionalProperties": false, From d10799c5e8916cb14b1bf76e0bac05314677c1b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Tue, 4 Jun 2024 22:22:50 +0200 Subject: [PATCH 25/26] wip --- schemas/import.schema.json | 35 ++++++++++++++---------- schemas/importSeries.schema.json | 47 +++++++++++++++++--------------- 2 files changed, 46 insertions(+), 36 deletions(-) diff --git a/schemas/import.schema.json b/schemas/import.schema.json index 004f375..8cbf6ed 100644 --- a/schemas/import.schema.json +++ b/schemas/import.schema.json @@ -143,6 +143,14 @@ "minimum": 0, "type": "integer" }, + "acquisitionProcessedCount": { + "minimum": 0, + "type": "integer" + }, + "acquisitionReplicatedCount": { + "minimum": 0, + "type": "integer" + }, "docType": { "type": "string", "enum": [ @@ -272,9 +280,7 @@ "required": [ "dicomFileCount", "nonDicomFileCount", - "subjectCount", - "visitCount", - "acquisitionCount", + "uploadDate", "status", "totalFileCount" @@ -310,9 +316,6 @@ "required": [ "dicomFileCount", "nonDicomFileCount", - "subjectCount", - "visitCount", - "acquisitionCount", "uploadDate", "status", "totalFileCount" @@ -330,9 +333,6 @@ "required": [ "dicomFileCount", "nonDicomFileCount", - "subjectCount", - "visitCount", - "acquisitionCount", "failMessage", "uploadDate", "status", @@ -351,9 +351,6 @@ "required": [ "dicomFileCount", "nonDicomFileCount", - "subjectCount", - "visitCount", - "acquisitionCount", "endUploadDate", "uploadDate", "status", @@ -816,7 +813,8 @@ "type": "object", "required": [ "dicomPatientId", - "spineSubjectId" + "spineSubjectId", + "fromCohortLut" ], "properties": { "dicomPatientId": { @@ -824,6 +822,9 @@ }, "spineSubjectId": { "type": "string" + }, + "fromCohortLut": { + "type": "boolean" } }, "additionalProperties": false @@ -873,6 +874,12 @@ "acquisitionCount": { "$ref": "#/definitions/acquisitionCount" }, + "acquisitionProcessedCount": { + "$ref": "#/definitions/acquisitionProcessedCount" + }, + "acquisitionReplicatedCount": { + "$ref": "#/definitions/acquisitionReplicatedCount" + }, "seriesCount": { "$ref": "#/definitions/acquisitionCount" }, @@ -951,4 +958,4 @@ "additionalProperties": false } } -} \ No newline at end of file +} diff --git a/schemas/importSeries.schema.json b/schemas/importSeries.schema.json index d8b39ca..24980e5 100644 --- a/schemas/importSeries.schema.json +++ b/schemas/importSeries.schema.json @@ -34,17 +34,17 @@ "importVisitId" ] }, - "label":{ - "type": "string" + "label": { + "type": "string" }, "seriesNumber": { - "type": "string" + "type": "string" }, "pathToDispatchedFolder": { - "type": "string" + "type": "string" }, "processed": { - "type": "boolean" + "type": "boolean" }, "importSeriesDoc": { "type": "object", @@ -59,40 +59,43 @@ "$ref": "#/definitions/reference" }, "seriesNumber": { - "$ref": "#/definitions/label" + "$ref": "#/definitions/label" }, "pathToDispatchedFolder": { - "$ref": "#/definitions/pathToDispatchedFolder" + "$ref": "#/definitions/pathToDispatchedFolder" }, "processed": { - "$ref": "#/definitions/processed" + "$ref": "#/definitions/processed" }, "docType": { - "$ref": "#/definitions/docType" + "$ref": "#/definitions/docType" }, "pathToDicoms": { - "type": "string" + "type": "string" }, "name": { - "type": "string" + "type": "string" }, "label": { - "type": "string" + "type": "string" }, "dicomHeaderSummary": { - "type":"object", - "required": ["all"], - "additionalProperties": false, - "properties": { - "all": { - "type": "object" + "type": "object", + "required": [ + "all" + ], + "additionalProperties": false, + "properties": { + "all": { + "type": "object" + } } - } }, "sopInstanceUids": { - "type":"array", - "items": { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } }, "additionalProperties": false, From eb965ff464e45f4c32ce1b6c6291ee4bbdbe88a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Bliault?= Date: Mon, 7 Oct 2024 22:36:14 +0200 Subject: [PATCH 26/26] wip --- schemas/import.schema.json | 90 +++++++++++++++++++++++++++++---- schemas/importVisit.schema.json | 10 +++- 2 files changed, 88 insertions(+), 12 deletions(-) diff --git a/schemas/import.schema.json b/schemas/import.schema.json index 8cbf6ed..e1fed81 100644 --- a/schemas/import.schema.json +++ b/schemas/import.schema.json @@ -3,6 +3,72 @@ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Import", "definitions": { + "filterDicomsRule": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "valueStartsWith", + "valueInList" + ] + }, + "dicom_field": { + "type": "string" + }, + "values": { + "type": "array", + "item": { + "type": "string" + } + } + }, + "required": [ + "type", + "dicom_field", + "values" + ] + }, + "filterDicoms": { + "type": "object", + "properties": { + "filterDicoms": { + "type": "boolean" + }, + "filterDicomsRules": { + "type": "array", + "items": { + "$ref": "#/definitions/filterDicomsRule" + } + } + }, + "required": [ + "filterDicoms" + ], + "oneOf": [ + { + "properties": { + "filterDicoms": { + "enum": [ + true + ] + } + }, + "required": [ + "filterDicomsRules" + ] + }, + { + "properties": { + "filterDicoms": { + "enum": [ + false + ] + } + } + } + ] + }, "lutTableItems": { "type": "object", "required": [ @@ -56,7 +122,6 @@ "subjectLabelAnonMethod": { "type": "string", "enum": [ - "RANDOM_LABELS", "SAME_LABELS", "LUT_LABELS" ] @@ -280,7 +345,6 @@ "required": [ "dicomFileCount", "nonDicomFileCount", - "uploadDate", "status", "totalFileCount" @@ -344,7 +408,7 @@ "properties": { "status": { "enum": [ - "REPLICATING_DONE" + "DONE" ] } }, @@ -575,6 +639,9 @@ }, "reference": { "$ref": "#/definitions/reference" + }, + "filterDicoms": { + "$ref": "#/definitions/filterDicoms" } }, "allOf": [ @@ -593,7 +660,8 @@ "pathToFolder", "anonymize", "lutId", - "exhaustiveLut" + "exhaustiveLut", + "filterDicoms" ] }, "postImportLutExhaustiveNoAnon": { @@ -654,8 +722,7 @@ { "$ref": "#/definitions/postImportLutNonExhaustiveNoAnon" } - ], - "additionalProperties": false + ] }, "postImportAnonRandomLabels": { "type": "object", @@ -752,8 +819,7 @@ { "$ref": "#/definitions/postImportAnonLutLabels" } - ], - "additionalProperties": false + ] }, "postImport": { "type": "object", @@ -775,13 +841,17 @@ }, "fieldsToAnonymize": { "$ref": "#/definitions/fieldsToAnonymizeTable" + }, + "filterDicoms": { + "$ref": "#/definitions/filterDicoms" } }, "required": [ "dicomPath", "anonymization", "lut", - "exhaustiveLut" + "exhaustiveLut", + "filterDicoms" ], "additionalProperties": false, "oneOf": [ @@ -958,4 +1028,4 @@ "additionalProperties": false } } -} +} \ No newline at end of file diff --git a/schemas/importVisit.schema.json b/schemas/importVisit.schema.json index 03a7573..a493577 100644 --- a/schemas/importVisit.schema.json +++ b/schemas/importVisit.schema.json @@ -34,12 +34,15 @@ "type": "string" }, "visitType":{ - "type": "string" + "type": "string", "enum": ["imaging"] }, "date":{ "type": "string" }, + "time":{ + "type": "string" + }, "importVisitDoc": { "type": "object", "properties": { @@ -59,7 +62,10 @@ "$ref": "#/definitions/visitType" }, "date": { - "$ref": "#/definitions/sex" + "$ref": "#/definitions/date" + }, + "time": { + "$ref": "#/definitions/time" }, "docType": { "$ref": "#/definitions/docType"