From b16cf1da1c95eba0405bcf5a8fc914217c57d50b Mon Sep 17 00:00:00 2001 From: Greg Rushton Date: Wed, 9 Aug 2023 12:06:44 -0400 Subject: [PATCH] update schema and update script documentation --- scripts/compile-jsonschema.sh | 8 ++++++-- src/assets/schemas/DataRegistrationV1.json | 4 ++++ src/assets/schemas/DataRegistrationV1Validation.js | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/compile-jsonschema.sh b/scripts/compile-jsonschema.sh index 680c31365..b12f791eb 100755 --- a/scripts/compile-jsonschema.sh +++ b/scripts/compile-jsonschema.sh @@ -4,9 +4,13 @@ # ./src/assets/schemas. The schemas downloaded are based on the # backend configured in ./public/config.json. # -# You MUST have jq and ajv installed to be able to use this script. +# You MUST have jq, ajv, and ajv-cli installed to be able to use this script. # -# USAGE: ./compile-jsonschema.sh +# npm install ajv +# npm install -g ajv-cli +# npm install -g ajv-formats +# +# USAGE: From the project root directory, run: ./scripts/compile-jsonschema.sh # set -eu diff --git a/src/assets/schemas/DataRegistrationV1.json b/src/assets/schemas/DataRegistrationV1.json index 6b6837004..63fe01c98 100644 --- a/src/assets/schemas/DataRegistrationV1.json +++ b/src/assets/schemas/DataRegistrationV1.json @@ -604,6 +604,10 @@ } ], "properties": { + "datasetId": { + "type": "integer", + "description": "Dataset Id" + }, "consentGroupName": { "type": "string", "label": "Consent Group Name", diff --git a/src/assets/schemas/DataRegistrationV1Validation.js b/src/assets/schemas/DataRegistrationV1Validation.js index 575cef0a0..fdb440832 100644 --- a/src/assets/schemas/DataRegistrationV1Validation.js +++ b/src/assets/schemas/DataRegistrationV1Validation.js @@ -1 +1 @@ -/* eslint-disable */ "use strict";module.exports = validate28;module.exports.default = validate28;const schema32 = {"$id":"https://consent.dsde-prod.broadinstitute.org/schemas/dataset-registration","$schema":"https://json-schema.org/draft/2019-09/schema","title":"Dataset Registration Schema","version":1,"type":"object","required":["studyName","studyDescription","dataTypes","dataSubmitterUserId","publicVisibility","nihAnvilUse","piName","consentGroups"],"allOf":[{"$comment":"require GSR explanation if the user selected yes","if":{"required":["controlledAccessRequiredForGenomicSummaryResultsGSR"],"properties":{"controlledAccessRequiredForGenomicSummaryResultsGSR":{"const":true}}},"then":{"required":["controlledAccessRequiredForGenomicSummaryResultsGSRRequiredExplanation"]}},{"$comment":"include dbGaP related fields if they have one","if":{"required":["nihAnvilUse"],"properties":{"nihAnvilUse":{"type":"string","enum":["I am NHGRI funded and I have a dbGaP PHS ID already"]}}},"then":{"$ref":"#/$defs/dbGaPInfo"}},{"$comment":"include NIH related fields if using AnVil","if":{"required":["nihAnvilUse"],"properties":{"nihAnvilUse":{"type":"string","enum":["I am NHGRI funded and I have a dbGaP PHS ID already","I am NHGRI funded and I do not have a dbGaP PHS ID","I am not NHGRI funded but I am seeking to submit data to AnVIL"]}}},"then":{"$ref":"#/$defs/nihAdministrativeInformation"}},{"$comment":"require alternative data sharing plan fields if the DS needs one","if":{"required":["alternativeDataSharingPlan"],"properties":{"alternativeDataSharingPlan":{"const":true}}},"then":{"required":["alternativeDataSharingPlanExplanation","alternativeDataSharingPlanReasons"],"properties":{"alternativeDataSharingPlanReasons":{"minItems":1}}}}],"properties":{"studyName":{"type":"string","label":"Study Name","description":"The study name","minLength":1},"studyType":{"type":"string","enum":["Observational","Interventional","Descriptive","Analytical","Prospective","Retrospective","Case report","Case series","Cross-sectional","Cohort study"],"label":"Study Type","description":"The study type"},"studyDescription":{"type":"string","label":"Study Description","description":"Description of the study","minLength":1},"dataTypes":{"type":"array","label":"Data Types","description":"All data types that study encompasses","items":{"type":"string"},"minItems":1},"phenotypeIndication":{"type":"string","label":"Phenotype/Indication Studied","description":"Phenotype/Indication Studied"},"species":{"type":"string","label":"Species","description":"Species"},"piName":{"type":"string","label":"Principal Investigator Name","description":"Principal Investigator Name","minLength":1},"dataSubmitterUserId":{"type":"integer","label":"Data Submitter","description":"The user creating the dataset submission"},"dataCustodianEmail":{"type":"array","label":"Data Custodian Email","description":"Data Custodian Email","items":{"type":"string","format":"email"}},"publicVisibility":{"type":"boolean","label":"Public Visibility","description":"Public Visibility of this study","prompt":"Please select if you would like your dataset to be publicly visible for the requesters to see and select for an access request"},"nihAnvilUse":{"type":"string","enum":["I am NHGRI funded and I have a dbGaP PHS ID already","I am NHGRI funded and I do not have a dbGaP PHS ID","I am not NHGRI funded but I am seeking to submit data to AnVIL","I am not NHGRI funded and do not plan to store data in AnVIL"],"description":"NIH Anvil Use"},"targetDeliveryDate":{"type":"string","format":"date","label":"Target Delivery Date","description":"Target Delivery Date"},"targetPublicReleaseDate":{"type":"string","format":"date","label":"Target Public Release Date","description":"Target Public Release Date"},"consentGroups":{"type":"array","minItems":1,"label":"Consent Groups","description":"Consent Groups","items":{"$ref":"#/$defs/consentGroup"}}},"$defs":{"fileTypeObject":{"type":"object","properties":{"fileType":{"type":"string","description":"File Type","enum":["Arrays","Genome","Exome","Survey","Phenotype"]},"functionalEquivalence":{"type":"string","description":"Functional Equivalence"}}},"dbGaPInfo":{"required":["dbGaPPhsID"],"properties":{"dbGaPPhsID":{"type":"string","label":"dbGaP phs ID","description":"dbGaP phs ID","minLength":1},"dbGaPStudyRegistrationName":{"type":"string","label":"dbGaP Study Registration Name","description":"dbGaP Study Registration Name"},"embargoReleaseDate":{"type":"string","format":"date","label":"Embargo Release Date","description":"Embargo Release Date"},"sequencingCenter":{"type":"string","label":"Sequencing Center","description":"Sequencing Center"}}},"nihAdministrativeInformation":{"required":["piInstitution","nihGrantContractNumber"],"properties":{"piInstitution":{"type":"integer","label":"Principal Investigator Institution","description":"Principal Investigator Institution"},"nihGrantContractNumber":{"type":"string","label":"NIH Grant or Contract Number","description":"NIH Grant or Contract Number","minLength":1},"nihICsSupportingStudy":{"type":"array","label":"NIH ICs Supporting the Study","description":"NIH ICs Supporting the Study","items":{"type":"string","enum":["NCI","NEI","NHLBI","NHGRI","NIA","NIAAA","NIAID","NIAMS","NIBIB","NICHD","NIDCD","NIDCR","NIDDK","NIDA","NIEHS","NIGMS","NIMH","NIMHD","NINDS","NINR","NLM","CC","CIT","CSR","FIC","NCATS","NCCIH"]}},"nihProgramOfficerName":{"type":"string","label":"NIH Program Officer Name","description":"NIH Program Officer Name"},"nihInstitutionCenterSubmission":{"type":"string","label":"NIH Institution/Center for Submission","description":"NIH Institution/Center for Submission","enum":["NCI","NEI","NHLBI","NHGRI","NIA","NIAAA","NIAID","NIAMS","NIBIB","NICHD","NIDCD","NIDCR","NIDDK","NIDA","NIEHS","NIGMS","NIMH","NIMHD","NINDS","NINR","NLM","CC","CIT","CSR","FIC","NCATS","NCCIH"]},"nihGenomicProgramAdministratorName":{"type":"string","label":"NIH Genomic Program Administrator Name","description":"NIH Genomic Program Administrator Name"},"multiCenterStudy":{"type":"boolean","label":"Is this a multi-center study?","description":"Is this a multi-center study?"},"collaboratingSites":{"type":"array","label":"What are the collaborating sites?","description":"What are the collaborating sites?","items":{"type":"string"}},"controlledAccessRequiredForGenomicSummaryResultsGSR":{"type":"boolean","label":"Is controlled access required for genomic summary results (GSR)?","description":"Is controlled access required for genomic summary results (GSR)?"},"controlledAccessRequiredForGenomicSummaryResultsGSRRequiredExplanation":{"type":"string","label":"If yes, explain why controlled access is required for GSR","description":"If yes, explain why controlled access is required for GSR","minLength":1},"alternativeDataSharingPlan":{"type":"boolean","label":"Are you requesting an Alternative Data Sharing Plan for samples that cannot be shared through a public repository or database?","description":"Are you requesting an Alternative Data Sharing Plan for samples that cannot be shared through a public repository or database?"},"alternativeDataSharingPlanReasons":{"type":"array","label":"Please mark the reasons for which you are requesting an Alternative Data Sharing Plan (check all that apply)","description":"Please mark the reasons for which you are requesting an Alternative Data Sharing Plan (check all that apply)","items":{"type":"string","enum":["Legal Restrictions","Informed consent processes are inadequate to support data for sharing for the following reasons:","The consent forms are unavailable or non-existent for samples collected after January 25, 2015","The consent process did not specifically address future use or broad data sharing for samples collected after January 25, 2015","The consent process inadequately addresses risks related to future use or broad data sharing for samples collected after January 25, 2015","The consent process specifically precludes future use or broad data sharing (including a statement that use of data will be limited to the original researchers)","Other informed consent limitations or concerns","Other"]}},"alternativeDataSharingPlanExplanation":{"type":"string","label":"Explanation of Request","description":"Explanation of Request"},"alternativeDataSharingPlanFileName":{"type":"string","label":"Upload your alternative sharing plan (file upload)","description":"Upload your alternative sharing plan (file upload)"},"alternativeDataSharingPlanDataSubmitted":{"type":"string","label":"Data will be submitted","description":"Upload your alternative sharing plan (file upload)","enum":["Within 3 months of the last data generated or last clinical visit","By batches over Study Timeline (e.g. based on clinical trial enrollment benchmarks)"]},"alternativeDataSharingPlanDataReleased":{"type":"boolean","label":"Data to be released will meet the timeframes specified in the NHGRI Guidance for Data Submission and Data Release","description":"Data to be released will meet the timeframes specified in the NHGRI Guidance for Data Submission and Data Release"},"alternativeDataSharingPlanTargetDeliveryDate":{"type":"string","format":"date","label":"Target Delivery Date","description":"Target Delivery Date"},"alternativeDataSharingPlanControlledOpenAccess":{"type":"string","label":"Does the data need to be managed under Controlled or Open Access?","description":"Does the data need to be managed under Controlled or Open Access?","enum":["Controlled Access","Open Access"]}}},"consentGroup":{"type":"object","required":["consentGroupName","fileTypes","numberOfParticipants"],"allOf":[{"if":{"properties":{"dataLocation":{"const":"Not Determined"}}},"then":{},"else":{"required":["url"]}},{"$comment":"if openAccess is false OR not present, then require dac id & add secondary consent fields","if":{"properties":{"openAccess":{"const":false}}},"then":{"required":["dataAccessCommitteeId"],"properties":{"nmds":{"type":"boolean","label":"No Methods Development or validation studies (NMDS)","description":"No Methods Development or validation studies (NMDS)"},"gso":{"type":"boolean","label":"Genetic studies only (GSO)","description":"Genetic studies only (GSO)"},"pub":{"type":"boolean","label":"Publication Required (PUB)","description":"Publication Required (PUB)"},"col":{"type":"boolean","label":"Collaboration Required (COL)","description":"Collaboration Required (COL)"},"irb":{"type":"boolean","label":"Ethics Approval Required (IRB)","description":"Ethics Approval Required (IRB)"},"gs":{"type":"string","label":"Geographic Restriction (GS-)","description":"Geographic Restriction (GS-)"},"mor":{"type":"boolean","label":"Publication Moratorium (MOR)","description":"Publication Moratorium (MOR)"},"morDate":{"type":"string","format":"date","label":"Publication Moratorium Date (MOR)","description":"Publication Moratorium Date (MOR)"},"npu":{"type":"boolean","label":"Non-profit Use Only (NPU)","description":"Non-profit Use Only (NPU)"},"otherSecondary":{"type":"string","label":"Other","description":"Other"},"dataAccessCommitteeId":{"type":"integer","label":"Please select which DAC should govern requests for this dataset","description":"Data Access Committee ID"}}}},{"$comment":"ensure one (and only one) primary consent is selected","oneOf":[{"properties":{"openAccess":{"const":true}},"required":["openAccess"]},{"properties":{"generalResearchUse":{"const":true}},"required":["generalResearchUse"]},{"properties":{"hmb":{"const":true}},"required":["hmb"]},{"properties":{"poa":{"const":true}},"required":["poa"]},{"properties":{"diseaseSpecificUse":{"minItems":1}},"required":["diseaseSpecificUse"]},{"properties":{"otherPrimary":{"minLength":1}},"required":["otherPrimary"]}]}],"properties":{"consentGroupName":{"type":"string","label":"Consent Group Name","description":"Consent Group Name","minLength":1},"openAccess":{"type":"boolean","label":"No Restrictions","description":"No Restrictions"},"generalResearchUse":{"type":"boolean","label":"General Research Use","description":"General Research Use"},"hmb":{"type":"boolean","label":"Health/Medical/Biomedical Research Use","description":"Health/Medical/Biomedical Research Use"},"diseaseSpecificUse":{"type":"array","label":"Disease-Specific Research Use","description":"Disease-Specific Research Use","items":{"type":"string"}},"poa":{"type":"boolean","label":"Populations, Origins, Ancestry Use","description":"Populations, Origins, Ancestry Use"},"otherPrimary":{"type":"string","label":"Other","description":"Other"},"dataLocation":{"type":"string","enum":["AnVIL Workspace","Terra Workspace","TDR Location","Not Determined"],"label":"Please provide the location of your data resource for this consent group","description":"Data Location"},"url":{"type":"string","format":"uri","label":"Free text field for entering URL of data","description":"Free text field for entering URL of data","minLength":1},"numberOfParticipants":{"type":"integer","description":"# of Participants"},"fileTypes":{"type":"array","minItems":1,"items":{"$ref":"#/$defs/fileTypeObject"},"description":"List of File Types"}}}}};const schema33 = {"required":["dbGaPPhsID"],"properties":{"dbGaPPhsID":{"type":"string","label":"dbGaP phs ID","description":"dbGaP phs ID","minLength":1},"dbGaPStudyRegistrationName":{"type":"string","label":"dbGaP Study Registration Name","description":"dbGaP Study Registration Name"},"embargoReleaseDate":{"type":"string","format":"date","label":"Embargo Release Date","description":"Embargo Release Date"},"sequencingCenter":{"type":"string","label":"Sequencing Center","description":"Sequencing Center"}}};const schema34 = {"required":["piInstitution","nihGrantContractNumber"],"properties":{"piInstitution":{"type":"integer","label":"Principal Investigator Institution","description":"Principal Investigator Institution"},"nihGrantContractNumber":{"type":"string","label":"NIH Grant or Contract Number","description":"NIH Grant or Contract Number","minLength":1},"nihICsSupportingStudy":{"type":"array","label":"NIH ICs Supporting the Study","description":"NIH ICs Supporting the Study","items":{"type":"string","enum":["NCI","NEI","NHLBI","NHGRI","NIA","NIAAA","NIAID","NIAMS","NIBIB","NICHD","NIDCD","NIDCR","NIDDK","NIDA","NIEHS","NIGMS","NIMH","NIMHD","NINDS","NINR","NLM","CC","CIT","CSR","FIC","NCATS","NCCIH"]}},"nihProgramOfficerName":{"type":"string","label":"NIH Program Officer Name","description":"NIH Program Officer Name"},"nihInstitutionCenterSubmission":{"type":"string","label":"NIH Institution/Center for Submission","description":"NIH Institution/Center for Submission","enum":["NCI","NEI","NHLBI","NHGRI","NIA","NIAAA","NIAID","NIAMS","NIBIB","NICHD","NIDCD","NIDCR","NIDDK","NIDA","NIEHS","NIGMS","NIMH","NIMHD","NINDS","NINR","NLM","CC","CIT","CSR","FIC","NCATS","NCCIH"]},"nihGenomicProgramAdministratorName":{"type":"string","label":"NIH Genomic Program Administrator Name","description":"NIH Genomic Program Administrator Name"},"multiCenterStudy":{"type":"boolean","label":"Is this a multi-center study?","description":"Is this a multi-center study?"},"collaboratingSites":{"type":"array","label":"What are the collaborating sites?","description":"What are the collaborating sites?","items":{"type":"string"}},"controlledAccessRequiredForGenomicSummaryResultsGSR":{"type":"boolean","label":"Is controlled access required for genomic summary results (GSR)?","description":"Is controlled access required for genomic summary results (GSR)?"},"controlledAccessRequiredForGenomicSummaryResultsGSRRequiredExplanation":{"type":"string","label":"If yes, explain why controlled access is required for GSR","description":"If yes, explain why controlled access is required for GSR","minLength":1},"alternativeDataSharingPlan":{"type":"boolean","label":"Are you requesting an Alternative Data Sharing Plan for samples that cannot be shared through a public repository or database?","description":"Are you requesting an Alternative Data Sharing Plan for samples that cannot be shared through a public repository or database?"},"alternativeDataSharingPlanReasons":{"type":"array","label":"Please mark the reasons for which you are requesting an Alternative Data Sharing Plan (check all that apply)","description":"Please mark the reasons for which you are requesting an Alternative Data Sharing Plan (check all that apply)","items":{"type":"string","enum":["Legal Restrictions","Informed consent processes are inadequate to support data for sharing for the following reasons:","The consent forms are unavailable or non-existent for samples collected after January 25, 2015","The consent process did not specifically address future use or broad data sharing for samples collected after January 25, 2015","The consent process inadequately addresses risks related to future use or broad data sharing for samples collected after January 25, 2015","The consent process specifically precludes future use or broad data sharing (including a statement that use of data will be limited to the original researchers)","Other informed consent limitations or concerns","Other"]}},"alternativeDataSharingPlanExplanation":{"type":"string","label":"Explanation of Request","description":"Explanation of Request"},"alternativeDataSharingPlanFileName":{"type":"string","label":"Upload your alternative sharing plan (file upload)","description":"Upload your alternative sharing plan (file upload)"},"alternativeDataSharingPlanDataSubmitted":{"type":"string","label":"Data will be submitted","description":"Upload your alternative sharing plan (file upload)","enum":["Within 3 months of the last data generated or last clinical visit","By batches over Study Timeline (e.g. based on clinical trial enrollment benchmarks)"]},"alternativeDataSharingPlanDataReleased":{"type":"boolean","label":"Data to be released will meet the timeframes specified in the NHGRI Guidance for Data Submission and Data Release","description":"Data to be released will meet the timeframes specified in the NHGRI Guidance for Data Submission and Data Release"},"alternativeDataSharingPlanTargetDeliveryDate":{"type":"string","format":"date","label":"Target Delivery Date","description":"Target Delivery Date"},"alternativeDataSharingPlanControlledOpenAccess":{"type":"string","label":"Does the data need to be managed under Controlled or Open Access?","description":"Does the data need to be managed under Controlled or Open Access?","enum":["Controlled Access","Open Access"]}}};const func3 = require("ajv/dist/runtime/ucs2length").default;const formats0 = require("ajv-formats/dist/formats").fullFormats.date;const formats4 = /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i;const schema35 = {"type":"object","required":["consentGroupName","fileTypes","numberOfParticipants"],"allOf":[{"if":{"properties":{"dataLocation":{"const":"Not Determined"}}},"then":{},"else":{"required":["url"]}},{"$comment":"if openAccess is false OR not present, then require dac id & add secondary consent fields","if":{"properties":{"openAccess":{"const":false}}},"then":{"required":["dataAccessCommitteeId"],"properties":{"nmds":{"type":"boolean","label":"No Methods Development or validation studies (NMDS)","description":"No Methods Development or validation studies (NMDS)"},"gso":{"type":"boolean","label":"Genetic studies only (GSO)","description":"Genetic studies only (GSO)"},"pub":{"type":"boolean","label":"Publication Required (PUB)","description":"Publication Required (PUB)"},"col":{"type":"boolean","label":"Collaboration Required (COL)","description":"Collaboration Required (COL)"},"irb":{"type":"boolean","label":"Ethics Approval Required (IRB)","description":"Ethics Approval Required (IRB)"},"gs":{"type":"string","label":"Geographic Restriction (GS-)","description":"Geographic Restriction (GS-)"},"mor":{"type":"boolean","label":"Publication Moratorium (MOR)","description":"Publication Moratorium (MOR)"},"morDate":{"type":"string","format":"date","label":"Publication Moratorium Date (MOR)","description":"Publication Moratorium Date (MOR)"},"npu":{"type":"boolean","label":"Non-profit Use Only (NPU)","description":"Non-profit Use Only (NPU)"},"otherSecondary":{"type":"string","label":"Other","description":"Other"},"dataAccessCommitteeId":{"type":"integer","label":"Please select which DAC should govern requests for this dataset","description":"Data Access Committee ID"}}}},{"$comment":"ensure one (and only one) primary consent is selected","oneOf":[{"properties":{"openAccess":{"const":true}},"required":["openAccess"]},{"properties":{"generalResearchUse":{"const":true}},"required":["generalResearchUse"]},{"properties":{"hmb":{"const":true}},"required":["hmb"]},{"properties":{"poa":{"const":true}},"required":["poa"]},{"properties":{"diseaseSpecificUse":{"minItems":1}},"required":["diseaseSpecificUse"]},{"properties":{"otherPrimary":{"minLength":1}},"required":["otherPrimary"]}]}],"properties":{"consentGroupName":{"type":"string","label":"Consent Group Name","description":"Consent Group Name","minLength":1},"openAccess":{"type":"boolean","label":"No Restrictions","description":"No Restrictions"},"generalResearchUse":{"type":"boolean","label":"General Research Use","description":"General Research Use"},"hmb":{"type":"boolean","label":"Health/Medical/Biomedical Research Use","description":"Health/Medical/Biomedical Research Use"},"diseaseSpecificUse":{"type":"array","label":"Disease-Specific Research Use","description":"Disease-Specific Research Use","items":{"type":"string"}},"poa":{"type":"boolean","label":"Populations, Origins, Ancestry Use","description":"Populations, Origins, Ancestry Use"},"otherPrimary":{"type":"string","label":"Other","description":"Other"},"dataLocation":{"type":"string","enum":["AnVIL Workspace","Terra Workspace","TDR Location","Not Determined"],"label":"Please provide the location of your data resource for this consent group","description":"Data Location"},"url":{"type":"string","format":"uri","label":"Free text field for entering URL of data","description":"Free text field for entering URL of data","minLength":1},"numberOfParticipants":{"type":"integer","description":"# of Participants"},"fileTypes":{"type":"array","minItems":1,"items":{"$ref":"#/$defs/fileTypeObject"},"description":"List of File Types"}}};const schema36 = {"type":"object","properties":{"fileType":{"type":"string","description":"File Type","enum":["Arrays","Genome","Exome","Survey","Phenotype"]},"functionalEquivalence":{"type":"string","description":"Functional Equivalence"}}};const formats12 = require("ajv-formats/dist/formats").fullFormats.uri;function validate29(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate29.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}const _errs2 = errors;let valid1 = true;const _errs3 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.dataLocation !== undefined){if("Not Determined" !== data.dataLocation){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}}var _valid0 = _errs3 === errors;errors = _errs2;if(vErrors !== null){if(_errs2){vErrors.length = _errs2;}else {vErrors = null;}}if(!_valid0){const _errs5 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.url === undefined){const err1 = {instancePath,schemaPath:"#/allOf/0/else/required",keyword:"required",params:{missingProperty: "url"},message:"must have required property '"+"url"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}var _valid0 = _errs5 === errors;valid1 = _valid0;}if(!valid1){const err2 = {instancePath,schemaPath:"#/allOf/0/if",keyword:"if",params:{failingKeyword: "else"},message:"must match \"else\" schema"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}const _errs8 = errors;let valid3 = true;const _errs9 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.openAccess !== undefined){if(false !== data.openAccess){const err3 = {};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}}var _valid1 = _errs9 === errors;errors = _errs8;if(vErrors !== null){if(_errs8){vErrors.length = _errs8;}else {vErrors = null;}}if(_valid1){const _errs11 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.dataAccessCommitteeId === undefined){const err4 = {instancePath,schemaPath:"#/allOf/1/then/required",keyword:"required",params:{missingProperty: "dataAccessCommitteeId"},message:"must have required property '"+"dataAccessCommitteeId"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.nmds !== undefined){if(typeof data.nmds !== "boolean"){const err5 = {instancePath:instancePath+"/nmds",schemaPath:"#/allOf/1/then/properties/nmds/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.gso !== undefined){if(typeof data.gso !== "boolean"){const err6 = {instancePath:instancePath+"/gso",schemaPath:"#/allOf/1/then/properties/gso/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.pub !== undefined){if(typeof data.pub !== "boolean"){const err7 = {instancePath:instancePath+"/pub",schemaPath:"#/allOf/1/then/properties/pub/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.col !== undefined){if(typeof data.col !== "boolean"){const err8 = {instancePath:instancePath+"/col",schemaPath:"#/allOf/1/then/properties/col/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.irb !== undefined){if(typeof data.irb !== "boolean"){const err9 = {instancePath:instancePath+"/irb",schemaPath:"#/allOf/1/then/properties/irb/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.gs !== undefined){if(typeof data.gs !== "string"){const err10 = {instancePath:instancePath+"/gs",schemaPath:"#/allOf/1/then/properties/gs/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.mor !== undefined){if(typeof data.mor !== "boolean"){const err11 = {instancePath:instancePath+"/mor",schemaPath:"#/allOf/1/then/properties/mor/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.morDate !== undefined){let data9 = data.morDate;if(typeof data9 === "string"){if(!(formats0.validate(data9))){const err12 = {instancePath:instancePath+"/morDate",schemaPath:"#/allOf/1/then/properties/morDate/format",keyword:"format",params:{format: "date"},message:"must match format \""+"date"+"\""};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}else {const err13 = {instancePath:instancePath+"/morDate",schemaPath:"#/allOf/1/then/properties/morDate/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data.npu !== undefined){if(typeof data.npu !== "boolean"){const err14 = {instancePath:instancePath+"/npu",schemaPath:"#/allOf/1/then/properties/npu/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.otherSecondary !== undefined){if(typeof data.otherSecondary !== "string"){const err15 = {instancePath:instancePath+"/otherSecondary",schemaPath:"#/allOf/1/then/properties/otherSecondary/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data.dataAccessCommitteeId !== undefined){let data12 = data.dataAccessCommitteeId;if(!((typeof data12 == "number") && (!(data12 % 1) && !isNaN(data12)))){const err16 = {instancePath:instancePath+"/dataAccessCommitteeId",schemaPath:"#/allOf/1/then/properties/dataAccessCommitteeId/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}}var _valid1 = _errs11 === errors;valid3 = _valid1;if(valid3){var props0 = {};props0.nmds = true;props0.gso = true;props0.pub = true;props0.col = true;props0.irb = true;props0.gs = true;props0.mor = true;props0.morDate = true;props0.npu = true;props0.otherSecondary = true;props0.dataAccessCommitteeId = true;props0.openAccess = true;}}if(!valid3){const err17 = {instancePath,schemaPath:"#/allOf/1/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}if(props0 !== true){props0 = props0 || {};props0.dataLocation = true;}const _errs36 = errors;let valid6 = false;let passing0 = null;const _errs37 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.openAccess === undefined){const err18 = {instancePath,schemaPath:"#/allOf/2/oneOf/0/required",keyword:"required",params:{missingProperty: "openAccess"},message:"must have required property '"+"openAccess"+"'"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}if(data.openAccess !== undefined){if(true !== data.openAccess){const err19 = {instancePath:instancePath+"/openAccess",schemaPath:"#/allOf/2/oneOf/0/properties/openAccess/const",keyword:"const",params:{allowedValue: true},message:"must be equal to constant"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}}var _valid2 = _errs37 === errors;if(_valid2){valid6 = true;passing0 = 0;var props1 = {};props1.openAccess = true;}const _errs39 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.generalResearchUse === undefined){const err20 = {instancePath,schemaPath:"#/allOf/2/oneOf/1/required",keyword:"required",params:{missingProperty: "generalResearchUse"},message:"must have required property '"+"generalResearchUse"+"'"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}if(data.generalResearchUse !== undefined){if(true !== data.generalResearchUse){const err21 = {instancePath:instancePath+"/generalResearchUse",schemaPath:"#/allOf/2/oneOf/1/properties/generalResearchUse/const",keyword:"const",params:{allowedValue: true},message:"must be equal to constant"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}}var _valid2 = _errs39 === errors;if(_valid2 && valid6){valid6 = false;passing0 = [passing0, 1];}else {if(_valid2){valid6 = true;passing0 = 1;if(props1 !== true){props1 = props1 || {};props1.generalResearchUse = true;}}const _errs41 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.hmb === undefined){const err22 = {instancePath,schemaPath:"#/allOf/2/oneOf/2/required",keyword:"required",params:{missingProperty: "hmb"},message:"must have required property '"+"hmb"+"'"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}if(data.hmb !== undefined){if(true !== data.hmb){const err23 = {instancePath:instancePath+"/hmb",schemaPath:"#/allOf/2/oneOf/2/properties/hmb/const",keyword:"const",params:{allowedValue: true},message:"must be equal to constant"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}}var _valid2 = _errs41 === errors;if(_valid2 && valid6){valid6 = false;passing0 = [passing0, 2];}else {if(_valid2){valid6 = true;passing0 = 2;if(props1 !== true){props1 = props1 || {};props1.hmb = true;}}const _errs43 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.poa === undefined){const err24 = {instancePath,schemaPath:"#/allOf/2/oneOf/3/required",keyword:"required",params:{missingProperty: "poa"},message:"must have required property '"+"poa"+"'"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}if(data.poa !== undefined){if(true !== data.poa){const err25 = {instancePath:instancePath+"/poa",schemaPath:"#/allOf/2/oneOf/3/properties/poa/const",keyword:"const",params:{allowedValue: true},message:"must be equal to constant"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}}var _valid2 = _errs43 === errors;if(_valid2 && valid6){valid6 = false;passing0 = [passing0, 3];}else {if(_valid2){valid6 = true;passing0 = 3;if(props1 !== true){props1 = props1 || {};props1.poa = true;}}const _errs45 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.diseaseSpecificUse === undefined){const err26 = {instancePath,schemaPath:"#/allOf/2/oneOf/4/required",keyword:"required",params:{missingProperty: "diseaseSpecificUse"},message:"must have required property '"+"diseaseSpecificUse"+"'"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}if(data.diseaseSpecificUse !== undefined){let data17 = data.diseaseSpecificUse;if(Array.isArray(data17)){if(data17.length < 1){const err27 = {instancePath:instancePath+"/diseaseSpecificUse",schemaPath:"#/allOf/2/oneOf/4/properties/diseaseSpecificUse/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}}}var _valid2 = _errs45 === errors;if(_valid2 && valid6){valid6 = false;passing0 = [passing0, 4];}else {if(_valid2){valid6 = true;passing0 = 4;if(props1 !== true){props1 = props1 || {};props1.diseaseSpecificUse = true;}}const _errs47 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.otherPrimary === undefined){const err28 = {instancePath,schemaPath:"#/allOf/2/oneOf/5/required",keyword:"required",params:{missingProperty: "otherPrimary"},message:"must have required property '"+"otherPrimary"+"'"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}if(data.otherPrimary !== undefined){let data18 = data.otherPrimary;if(typeof data18 === "string"){if(func3(data18) < 1){const err29 = {instancePath:instancePath+"/otherPrimary",schemaPath:"#/allOf/2/oneOf/5/properties/otherPrimary/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}}}var _valid2 = _errs47 === errors;if(_valid2 && valid6){valid6 = false;passing0 = [passing0, 5];}else {if(_valid2){valid6 = true;passing0 = 5;if(props1 !== true){props1 = props1 || {};props1.otherPrimary = true;}}}}}}}if(!valid6){const err30 = {instancePath,schemaPath:"#/allOf/2/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}else {errors = _errs36;if(vErrors !== null){if(_errs36){vErrors.length = _errs36;}else {vErrors = null;}}}if(props0 !== true && props1 !== undefined){if(props1 === true){props0 = true;}else {props0 = props0 || {};Object.assign(props0, props1);}}if(data && typeof data == "object" && !Array.isArray(data)){if(data.consentGroupName === undefined){const err31 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "consentGroupName"},message:"must have required property '"+"consentGroupName"+"'"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}if(data.fileTypes === undefined){const err32 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "fileTypes"},message:"must have required property '"+"fileTypes"+"'"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}if(data.numberOfParticipants === undefined){const err33 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "numberOfParticipants"},message:"must have required property '"+"numberOfParticipants"+"'"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}if(props0 !== true){props0 = props0 || {};props0.consentGroupName = true;props0.openAccess = true;props0.generalResearchUse = true;props0.hmb = true;props0.diseaseSpecificUse = true;props0.poa = true;props0.otherPrimary = true;props0.dataLocation = true;props0.url = true;props0.numberOfParticipants = true;props0.fileTypes = true;}if(data.consentGroupName !== undefined){let data19 = data.consentGroupName;if(typeof data19 === "string"){if(func3(data19) < 1){const err34 = {instancePath:instancePath+"/consentGroupName",schemaPath:"#/properties/consentGroupName/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}else {const err35 = {instancePath:instancePath+"/consentGroupName",schemaPath:"#/properties/consentGroupName/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data.openAccess !== undefined){if(typeof data.openAccess !== "boolean"){const err36 = {instancePath:instancePath+"/openAccess",schemaPath:"#/properties/openAccess/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}if(data.generalResearchUse !== undefined){if(typeof data.generalResearchUse !== "boolean"){const err37 = {instancePath:instancePath+"/generalResearchUse",schemaPath:"#/properties/generalResearchUse/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data.hmb !== undefined){if(typeof data.hmb !== "boolean"){const err38 = {instancePath:instancePath+"/hmb",schemaPath:"#/properties/hmb/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}if(data.diseaseSpecificUse !== undefined){let data23 = data.diseaseSpecificUse;if(Array.isArray(data23)){const len0 = data23.length;for(let i0=0; i0