{
    "@context": "http://qiicr.org/dcmqi/contexts/dcmqi.jsonld",
    "id": "https://raw.githubusercontent.com/qiicr/dcmqi/master/doc/schemas/common-schema.json#",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions": {
        "PN": {
            "type": "string",
            "maxLength": 64
        },
        "CS": {
            "type": "string",
            "maxLength": 16
        },
        "IS": {
            "type": "string",
            "maxLength": 12
        },
        "DS": {
            "type": "string",
            "maxLength": 16,
            "pattern": "^( )*(-|\\+)?[0-9]*(.[0-9]+)?((e|E)(-|\\+)?[0-9]+)?( )*$"
        },
        "LO": {
            "type": "string",
            "maxLength": 64
        },
        "SH": {
            "type": "string",
            "maxLength": 64
        },
        "FD": {
            "type": "string",
            "maxLength": 16,
            "pattern": "^( )*(-|\\+)?[0-9]*(.[0-9]+)?((e|E)(-|\\+)?[0-9]+)?( )*$"
        },
        "US": {
            "type": "integer",
            "minimum": 0,
            "maximum": 2e+16
        },
        "UT": {
            "type": "string"
        },
        "UI": {
            "type": "string",
            "pattern": "[0-9\\.]*"
        },
        "RGB": {
            "type": "array",
            "items": {
                "type": "integer",
                "minimum": 0,
                "maximum": 255
            },
            "minItems": 3,
            "maxItems": 3
        },
        "CIELab": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/US"
            },
            "minItems": 3,
            "maxItems": 3
        },
        "codeSequence": {
            "type": "object",
            "additionalProperties": false,
            "required": [
                "CodeValue",
                "CodingSchemeDesignator",
                "CodeMeaning"
            ],
            "properties": {
                "CodeValue": {
                    "$ref": "#/definitions/SH",
                    "default": "85756007"
                },
                "CodingSchemeDesignator": {
                    "$ref": "#/definitions/SH",
                    "default": "SCT"
                },
                "CodeMeaning": {
                    "$ref": "#/definitions/LO",
                    "default": "Tissue"
                }
            }
        },
        "dicomInstancesFileNameList": {
            "type": "array",
            "minItems": 1,
            "items": {
                "type": "string"
            }
        }
    },
    "properties": {
        "PN": {
            "$ref": "#/definitions/PN"
        },
        "CS": {
            "$ref": "#/definitions/CS"
        },
        "IS": {
            "$ref": "#/definitions/IS"
        },
        "DS": {
            "$ref": "#/definitions/DS"
        },
        "LO": {
            "$ref": "#/definitions/LO"
        },
        "SH": {
            "$ref": "#/definitions/SH"
        },
        "FD": {
            "$ref": "#/definitions/FD"
        },
        "US": {
            "$ref": "#/definitions/US"
        },
        "UT": {
            "$ref": "#/definitions/UT"
        },
        "UI": {
            "$ref": "#/definitions/UI"
        },
        "RGB": {
            "$ref": "#/definitions/RGB"
        },
        "CIELab": {
            "$ref": "#/definitions/CIELab"
        },
        "codeSequence": {
            "$ref": "#/definitions/codeSequence"
        },
        "dicomInstancesFileNameList": {
            "$ref": "#/definitions/dicomInstancesFileNameList"
        }
    },
    "required": [
        "PN",
        "CS",
        "IS",
        "DS",
        "LO",
        "SH",
        "FD",
        "US",
        "UT",
        "UI",
        "RGB",
        "CIELab",
        "codeSequence",
        "dicomInstancesFileNameList"
    ]
}