{ "$schema":                            "https://json-schema.org/draft/2020-12/schema",
  "$id":                                "https://schemas.mpai.community/OSD/V1.5/data/UltrasoundObject.json",
  "title":                              "Ultrasound Object V1.5", 
  "type":                               "object", 
  "required":                           [ "Header", "UltrasoundObjectID", "UltrasoundObjectSpaceTime" ], 
  "additionalProperties":               false, 
  "properties":                         {

    "Header":                           { "type": "string", "pattern": "^OSD-USO-V[0-9]{1,2}[.][0-9]{1,2}$" },
    "MInstanceID":                      { "type": "string" },
    "UEnvironmentID":                   { "type": "string" },
    "UltrasoundObjectID":               { "type": "string" },
    "UltrasoundObjectSpaceTime":        { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/SpaceTime.json" },

    "BasicUltrasoundObjectCount":       { "type": "integer", "minimum": 0 },

    "BasicUltrasoundObjects":           { "type": "array", "items": { "type": "object", "required": [ "BUSOIDOrBUSO" ],
                                          "additionalProperties": false, "properties": {

      "BasicUltrasoundObjectSpaceTime": { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/SpaceTime.json" },
      "BUSOIDOrBUSO":                   { "$ref": "#/$defs/BUSOIDOrBUSO" } } } },

    "SubUltrasoundObjectCount":         { "type": "integer", "minimum": 0 },

    "SubUltrasoundObjects":             { "type": "array", "items": { "type": "object", "required": [ "SubUSOIDOrSubUSO" ],
                                          "additionalProperties": false, "properties": {

      "SubUltrasoundObjectSpaceTime":   { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/SpaceTime.json" },
      "SubUSOIDOrSubUSO":               { "$ref": "#/$defs/SubUSOIDOrSubUSO" } } } },

    "BUSOOrUSO":                        { "$ref": "#/$defs/BUSOOrUSO" },

    "DataXMData":                       { "$ref": "https://schemas.mpai.community/PTF/V1.0/data/DataExchangeMetadata.json" },
    "DescrMetadata":                    { "type": "string", "maxLength": 2048 } },

  "$defs":                              {

    "BUSOOrUSO":                        { "type": "array", "items": { "oneOf": [
                                          { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/BasicUltrasoundObject.json" },
                                          { "$ref": "#/$defs/BUSOOrUSO" } ] } },

    "BUSOIDOrBUSO":                     { "type": "array", "minItems": 1, "maxItems": 1, "items": { "oneOf": [
                                          { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/BasicUltrasoundObject.json" },
                                          { "type": "string" } ] } },

    "SubUSOIDOrSubUSO":                 { "type": "array", "minItems": 1, "maxItems": 1, "items": { "oneOf": [
                                          { "$ref": "https://schemas.mpai.community/OSD/V1.5/data/UltrasoundObject.json" },
                                          { "type": "string" } ] } } } }