diff --git a/.postman/api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f b/.postman/api_ed3ea5f7-995a-4255-914e-5b12f7b8f03f index 6d0ff67..86d034d 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":{}} @@ -48,6 +49,10 @@ 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":"importSeries.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/package.json b/package.json index ef06489..fcce312 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", + "version": "3.2.0", "dependencies": { "ajv": "^6.12.2" }, diff --git a/schemas/API/index.json b/schemas/API/index.json index f1d04b0..97fbde9 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.3-dev", "title": "SPINE API", "description": "SPINE API" }, @@ -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/import.schema.json b/schemas/import.schema.json new file mode 100644 index 0000000..e1fed81 --- /dev/null +++ b/schemas/import.schema.json @@ -0,0 +1,1031 @@ +{ + "$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": { + "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": [ + "dicomPatientId", + "spineSubjectId", + "fromCohortLut" + ], + "properties": { + "dicomPatientId": { + "type": "string" + }, + "spineSubjectId": { + "type": "string" + }, + "fromCohortLut": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "lutTable": { + "type": "array", + "items": { + "$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": [ + "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" + } + }, + "additionalProperties": false + }, + "_id": { + "type": "string" + }, + "_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" + }, + "endUploadDate": { + "type": "string" + }, + "uploadDate": { + "type": "string" + }, + "dicomFileCount": { + "minimum": 0, + "type": "integer" + }, + "totalFileCount": { + "minimum": 0, + "type": "integer" + }, + "nonDicomFileCount": { + "minimum": 0, + "type": "integer" + }, + "subjectCount": { + "minimum": 0, + "type": "integer" + }, + "visitCount": { + "minimum": 0, + "type": "integer" + }, + "acquisitionCount": { + "minimum": 0, + "type": "integer" + }, + "acquisitionProcessedCount": { + "minimum": 0, + "type": "integer" + }, + "acquisitionReplicatedCount": { + "minimum": 0, + "type": "integer" + }, + "docType": { + "type": "string", + "enum": [ + "import" + ] + }, + "status": { + "type": "string", + "enum": [ + "INIT", + "LISTING", + "LISTING_DONE", + "LISTING_FAILED", + "PROCESSING_SERIES", + "PROCESSING_SERIES_DONE", + "PROCESSING_SERIES_FAILED", + "REPLICATING", + "REPLICATING_FAILED", + "DONE" + ] + }, + "reference": { + "type": "object", + "properties": { + "cohortId": { + "type": "string" + }, + "userId": { + "type": "string" + } + }, + "required": [ + "cohortId", + "userId" + ] + }, + "anonymize": { + "type": "boolean" + }, + "importInit": { + "type": "object", + "properties": { + "status": { + "enum": [ + "INIT" + ] + } + }, + "required": [ + "status" + ] + }, + "importListing": { + "type": "object", + "properties": { + "status": { + "enum": [ + "LISTING" + ] + } + }, + "required": [ + "uploadDate", + "status", + "totalFileCount" + ] + }, + "importListingDone": { + "type": "object", + "properties": { + "status": { + "enum": [ + "LISTING_DONE" + ] + } + }, + "required": [ + "dicomFileCount", + "nonDicomFileCount", + "uploadDate", + "status", + "totalFileCount" + ] + }, + "importListingFailed": { + "type": "object", + "properties": { + "status": { + "enum": [ + "LISTING_FAILED" + ] + } + }, + "required": [ + "failMessage", + "uploadDate", + "status", + "totalFileCount" + ] + }, + "importProcessingSeries": { + "type": "object", + "properties": { + "status": { + "enum": [ + "PROCESSING_SERIES" + ] + } + }, + "required": [ + "dicomFileCount", + "nonDicomFileCount", + "uploadDate", + "status", + "totalFileCount" + ] + }, + "importProcessingSeriesDone": { + "type": "object", + "properties": { + "status": { + "enum": [ + "PROCESSING_SERIES_DONE" + ] + } + }, + "required": [ + "dicomFileCount", + "nonDicomFileCount", + "uploadDate", + "status", + "totalFileCount" + ] + }, + "importProcessingSeriesFailed": { + "type": "object", + "properties": { + "status": { + "enum": [ + "PROCESSING_SERIES_FAILED" + ] + } + }, + "required": [ + "dicomFileCount", + "nonDicomFileCount", + "failMessage", + "uploadDate", + "status", + "totalFileCount" + ] + }, + "importReplicating": { + "type": "object", + "properties": { + "status": { + "enum": [ + "REPLICATING" + ] + } + }, + "required": [ + "dicomFileCount", + "nonDicomFileCount", + "uploadDate", + "status", + "totalFileCount" + ] + }, + "importReplicatingFailed": { + "type": "object", + "properties": { + "status": { + "enum": [ + "REPLICATING_FAILED" + ] + } + }, + "required": [ + "dicomFileCount", + "nonDicomFileCount", + "failMessage", + "uploadDate", + "status", + "totalFileCount" + ] + }, + "importDone": { + "type": "object", + "properties": { + "status": { + "enum": [ + "DONE" + ] + } + }, + "required": [ + "dicomFileCount", + "nonDicomFileCount", + "endUploadDate", + "uploadDate", + "status", + "totalFileCount" + ] + }, + "failMessage": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "properties": { + "reason": { + "type": "string" + }, + "missingPatientIds": { + "type": "array", + "items": { + "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": { + "subjectLabelAnonMethod": { + "enum": [ + "LUT_LABELS" + ] + }, + "exhaustiveLut": { + "$ref": "#/definitions/exhaustiveLutTrue" + } + }, + "required": [ + "subjectLabelAnonMethod", + "exhaustiveLut" + ] + }, + "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": { + "anonymize": { + "$ref": "#/definitions/anonymize" + }, + "_id": { + "$ref": "#/definitions/_id" + }, + "lutId": { + "$ref": "#/definitions/_id" + }, + "exhaustiveLut": { + "$ref": "#/definitions/exhaustiveLut" + }, + "subjectLabelAnonMethod": { + "$ref": "#/definitions/subjectLabelAnonMethod" + }, + "fieldsToAnonymize": { + "$ref": "#/definitions/fieldsToAnonymizeTable" + }, + "failMessage": { + "$ref": "#/definitions/failMessage" + }, + "_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" + }, + "totalFileCount": { + "$ref": "#/definitions/totalFileCount" + }, + "visitCount": { + "$ref": "#/definitions/visitCount" + }, + "acquisitionCount": { + "$ref": "#/definitions/acquisitionCount" + }, + "seriesCount": { + "$ref": "#/definitions/acquisitionCount" + }, + "docType": { + "$ref": "#/definitions/docType" + }, + "status": { + "$ref": "#/definitions/status" + }, + "reference": { + "$ref": "#/definitions/reference" + }, + "filterDicoms": { + "$ref": "#/definitions/filterDicoms" + } + }, + "allOf": [ + { + "$ref": "#/definitions/importDocStepVariants" + }, + { + "$ref": "#/definitions/importDocAnonVariants" + } + ], + "additionalProperties": false, + "required": [ + "reference", + "status", + "docType", + "pathToFolder", + "anonymize", + "lutId", + "exhaustiveLut", + "filterDicoms" + ] + }, + "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": { + "enum": [ + false + ] + }, + "lut": { + "$ref": "#/definitions/lutTable" + }, + "exhaustiveLut": { + "$ref": "#/definitions/exhaustiveLut" + } + }, + "required": [ + "dicomPath", + "anonymization", + "lut", + "exhaustiveLut" + ], + "oneOf": [ + { + "$ref": "#/definitions/postImportLutExhaustiveNoAnon" + }, + { + "$ref": "#/definitions/postImportLutNonExhaustiveNoAnon" + } + ] + }, + "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" + ] + }, + "postImportAnon": { + "type": "object", + "properties": { + "dicomPath": { + "$ref": "#/definitions/pathToFolder" + }, + "anonymization": { + "enum": [ + true + ] + }, + "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" + } + ] + }, + "postImport": { + "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" + }, + "filterDicoms": { + "$ref": "#/definitions/filterDicoms" + } + }, + "required": [ + "dicomPath", + "anonymization", + "lut", + "exhaustiveLut", + "filterDicoms" + ], + "additionalProperties": false, + "oneOf": [ + { + "$ref": "#/definitions/postImportNoAnon" + }, + { + "$ref": "#/definitions/postImportAnon" + } + ] + }, + "postImportResume": { + "type": "object", + "required": [ + "stepToResume" + ], + "additionalProperties": false, + "properties": { + "stepToResume": { + "type": "string", + "enum": [ + "LISTING", + "PROCESSING_SERIES" + ] + }, + "newLutRows": { + "type": "array", + "items": { + "type": "object", + "required": [ + "dicomPatientId", + "spineSubjectId", + "fromCohortLut" + ], + "properties": { + "dicomPatientId": { + "type": "string" + }, + "spineSubjectId": { + "type": "string" + }, + "fromCohortLut": { + "type": "boolean" + } + }, + "additionalProperties": false + } + } + } + }, + "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" + }, + "acquisitionProcessedCount": { + "$ref": "#/definitions/acquisitionProcessedCount" + }, + "acquisitionReplicatedCount": { + "$ref": "#/definitions/acquisitionReplicatedCount" + }, + "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" + ] + }, + "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 diff --git a/schemas/importSeries.schema.json b/schemas/importSeries.schema.json new file mode 100644 index 0000000..24980e5 --- /dev/null +++ b/schemas/importSeries.schema.json @@ -0,0 +1,111 @@ +{ + "$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" + }, + "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, + "required": [ + "reference", + "docType", + "processed", + "pathToDispatchedFolder", + "seriesNumber" + ] + } + } +} 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..a493577 --- /dev/null +++ b/schemas/importVisit.schema.json @@ -0,0 +1,83 @@ +{ + "$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" + }, + "time":{ + "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/date" + }, + "time": { + "$ref": "#/definitions/time" + }, + "docType": { + "$ref": "#/definitions/docType" + } + }, + "additionalProperties": false, + "required": [ + "reference", + "docType", + "label", + "visitType" + ] + } + } +} diff --git a/schemas/workflowExecution.schema.json b/schemas/workflowExecution.schema.json index c12f617..8675619 100644 --- a/schemas/workflowExecution.schema.json +++ b/schemas/workflowExecution.schema.json @@ -161,10 +161,7 @@ false ] } - }, - "required": [ - "miniWorkflowSet" - ] + } }, "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" }, @@ -457,7 +458,6 @@ "inputs", "label", "reference", - "miniWorkflowSet", "stateOfTasks", "docType", "creationDate" @@ -500,14 +500,17 @@ }, "usePydra": { "type": "boolean" + }, + "queueName": { + "description": "If using Pydra you can send the workflow to a Temporal queue", + "type": "string" } }, "additionalProperties": false, "required": [ "inputs", "label", - "reference", - "miniWorkflowSet" + "reference" ] }, "getWorkflowExecution": { @@ -563,7 +566,6 @@ "required": [ "inputs", "label", - "miniWorkflowSet", "state", "creationDate", "stateOfTasks" diff --git a/schemas/workflowExecutionMatrix.schema.json b/schemas/workflowExecutionMatrix.schema.json index 07b1d98..8f79018 100644 --- a/schemas/workflowExecutionMatrix.schema.json +++ b/schemas/workflowExecutionMatrix.schema.json @@ -73,6 +73,9 @@ "reused": { "type": "boolean" }, + "queueProgress": { + "type": "string" + }, "similarExecutionList": { "type": "array", "items": { @@ -1216,6 +1219,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..ec57366 100644 --- a/schemas/workflowExecutor.schema.json +++ b/schemas/workflowExecutor.schema.json @@ -5,17 +5,18 @@ "additionalProperties": false, "title": "Workflow Executor", "properties": { + "uuid": { "description":"Task Executor UUID", "type":"string" }, "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",