From 08167de93bc74d2d5cb69ec2fa28b76ddabce9ea Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 7 Mar 2024 16:04:54 -0500 Subject: [PATCH] FIX: Update PET metadata dependencies --- .../validators/json/schemas/pet.json | 126 ++++++++---------- 1 file changed, 55 insertions(+), 71 deletions(-) diff --git a/bids-validator/validators/json/schemas/pet.json b/bids-validator/validators/json/schemas/pet.json index 24f5f827a..495d90448 100644 --- a/bids-validator/validators/json/schemas/pet.json +++ b/bids-validator/validators/json/schemas/pet.json @@ -154,74 +154,6 @@ "$ref": "common_definitions.json#/definitions/Instructions" } }, - "allOf": [ - { - "if": { - "properties": { - "InjectedMass": { - "enum": ["n/a"] - }, - "InjectedMassUnits": { - "enum": ["n/a"] - } - } - }, - "then": {}, - "else": { - "required": ["InjectedMass", "InjectedMassUnits"] - } - }, - { - "if": { - "properties": { - "SpecificRadioactivity": { - "enum": ["n/a"] - }, - "SpecificRadioactivityUnits": { - "enum": ["n/a"] - } - } - }, - "then": {}, - "else": { - "required": ["SpecificRadioactivity", "SpecificRadioactivityUnits"] - } - }, - { - "if": { - "properties": { - "ReconFilterType": { - "enum": ["n/a"] - }, - "ReconFilterSize": { - "enum": ["n/a"] - } - } - }, - "then": {}, - "else": { - "required": ["ReconFilterType", "ReconFilterSize"] - } - }, - { - "if": { - "properties": { - "ModeOfAdministration": { - "enum": ["bolus-infusion"] - } - } - }, - "then": { - "required": [ - "InfusionRadioactivity", - "InfusionStart", - "InfusionSpeed", - "InjectedVolume" - ] - }, - "else": {} - } - ], "required": [ "Manufacturer", @@ -249,12 +181,20 @@ "ImageDecayCorrectionTime", "ReconMethodName", "ReconMethodParameterLabels", - "ReconMethodParameterUnits", - "ReconMethodParameterValues", "ReconFilterType", - "ReconFilterSize", "AttenuationCorrection" ], + "allOf": [ + { + "$ref": "#/dependency-definitions/if-ReconMethodParameterLabels-then-Units-and-Values" + }, + { + "$ref": "#/dependency-definitions/if-bolus-infusion-then-infusion-details" + }, + { + "$ref": "#/dependency-definitions/if-ReconFilterType-then-ReconFilterSize" + } + ], "dependencies": { "TracerMolecularWeight": ["TracerMolecularWeightUnits"], "InjectedRadioactivity": ["InjectedRadioactivityUnits"], @@ -265,5 +205,49 @@ "ReconMethodParameterUnits", "ReconMethodParameterValues" ] + }, + "dependency-definitions": { + "if-ReconMethodParameterLabels-then-Units-and-Values": { + "if": { + "type": "object", + "properties": { + "ReconMethodParameterLabels": { "const": "none" } + }, + "required": ["ReconMethodParameterLabels"] + }, + "then": {}, + "else": { + "required": ["ReconMethodParameterUnits", "ReconMethodParameterValues"] + } + }, + "if-bolus-infusion-then-infusion-details": { + "if": { + "type": "object", + "properties": { + "ModeOfAdministration": { "const": "bolus-infusion" } + }, + "required": ["ModeOfAdministration"] + }, + "then": { + "required": [ + "InfusionRadioactivity", + "InfusionStart", + "InfusionSpeed", + "InfusionSpeedUnits", + "InjectedVolume" + ] + } + }, + "if-ReconFilterType-then-ReconFilterSize": { + "if": { + "type": "object", + "properties": { + "ReconFilterType": { "const": "none" } + }, + "required": ["ReconFilterType"] + }, + "then": {}, + "else": { "required": ["ReconFilterSize"] } + } } }