From f09d41b0127488392ed762e4d5e721b7f75c2911 Mon Sep 17 00:00:00 2001 From: Jamie Gilbert Date: Mon, 15 Jan 2024 11:07:18 -0800 Subject: [PATCH] Created first draft of study json schema object --- inst/analysis-specification-schema.json | 169 ++++++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 inst/analysis-specification-schema.json diff --git a/inst/analysis-specification-schema.json b/inst/analysis-specification-schema.json new file mode 100644 index 00000000..ef605ed7 --- /dev/null +++ b/inst/analysis-specification-schema.json @@ -0,0 +1,169 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "apiVersion": { + "type": "string" + }, + "sharedResources": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "cohortDefinitionSet": { + "type": "object", + "properties": { + "cohortDefinitions": { + "type": "array", + "items": { + "oneOf": [ + { + "type": "object", + "properties": { + "_links": { + "type": "object", + "properties": { + "self": { + "type": "object", + "properties": { + "href": { + "type": "string" + } + } + } + }, + "required": ["self"] + }, + "cohortName": { + "type": "string" + }, + "cohortDefinitionId": { + "type": "integer" + } + }, + "required": ["_links", "cohortName", "cohortDefinitionId"] + }, + { + "type": "object", + "properties": { + "cohortDefinitionId": {"type": "integer"}, + "targetCohortDefinitionId": {"type": "integer"}, + "subsetDefinitionId": {"type": "integer"}, + "cohortName": { + "type": "string" + } + }, + "required": ["cohortDefinitionId", "targetCohortDefinitionId", "subsetDefinitionId"] + } + ] + } + }, + "subsetDefinitions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "_links": { + "type": "object", + "properties": { + "self": {"type": "object", "properties": {"href": {"type": "string"}}} + }, + "required": ["self"] + }, + "subsetDefinitionName": {"type": "string"}, + "subsetDefinitionId": {"type": "integer"} + }, + "required": ["_links", "subsetDefinitionName", "subsetDefinitionId"] + } + } + }, + "required": ["cohortDefinitions", "subsetDefinitions"] + } + }, + "required": ["cohortDefinitionSet"] + }, + { + "type": "object", + "properties": { + "conceptSetDefinition": { + "type": "object", + "properties": { + "id": {"type": "integer"}, + "conceptSetName": {"type": "string"}, + "isNegativeControlConceptSet": {"type": "boolean"}, + "concepts": { + "type": "array", + "items": { + "type": "object", + "properties": { + "conceptId": {"type": "integer"}, + "conceptName": {"type": "string"}, + "standardConcept": {"type": "boolean"}, + "standardConceptCaption": {"type": "string"}, + "invalidReason": {"type": "string"}, + "invalidReasonCaption": {"type": "string"}, + "conceptCode": {"type": "string"}, + "domainId": {"type": "integer"}, + "vocabularyId": {"type": "integer"}, + "conceptClassId": {"type": "integer"}, + "validStartDate": {"type": "string", "format": "date"}, + "validEndDate": {"type": "string", "format": "date"}, + "cohortDefinitionId": {"type": "integer"} + }, + "required": ["conceptId", "conceptName", "standardConcept", "standardConceptCaption", "invalidReason", "invalidReasonCaption", "conceptCode", "domainId", "vocabularyId", "conceptClassId", "validStartDate", "validEndDate"] + } + } + }, + "required": ["id", "conceptSetName", "concepts"] + } + }, + "required": ["conceptSetDefinition"] + }, + { + "type": "object", + "properties": { + "sharedResource": { + "type": "object", + "properties": { + "name": {"type": "string"}, + "schemaRef": {"type": "string", "format": "uri"} + }, + "required": ["name", "schemaRef"] + } + }, + "required": ["sharedResource"] + } + ] + } + }, + "renv": { + "type": "object", + "properties": { + "_links": { + "type": "object", + "properties": { + "self": {"type": "object", "properties": {"href": {"type": "string"}}} + }, + "required": ["self"] + } + }, + "required": ["_links"] + }, + "modules": { + "type": "array", + "items": { + "type": "object", + "properties": { + "module": {"type": "string"}, + "version": {"type": "string"}, + "schemaRef": {"type": "string", "format": "uri"}, + "settings": {"$ref": "#"} + }, + "required": ["module", "version", "schemaRef", "settings"] + } + } + }, + "required": ["apiVersion", "sharedResources", "renv", "modules"] +}