{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "case_desc.json",
    "title": "Case descriptor — cxr_sextants",
    "description": "Metadata for one case of the cxr_sextants application. Carries no predictions itself: fetch proc_url to obtain the per-zone results. All *_url values are server-relative paths under /data/cxr_sextants/case-{case_uid}/.",
    "type": "object",
    "properties": {
        "app_label": {
            "type": "string",
            "const": "cxr_sextants"
        },
        "case_uid": {
            "type": "string",
            "format": "uuid"
        },
        "case_label": {
            "type": "string",
            "description": "Name of the uploaded file, as submitted."
        },
        "status_text": {
            "type": "string",
            "description": "submitted and running are transient; success, error and rejected are terminal.",
            "enum": [
                "unknown",
                "submitted",
                "rejected",
                "running",
                "error",
                "success"
            ]
        },
        "error_text": {
            "type": "string",
            "description": "Empty unless status_text is error or rejected."
        },
        "input_url": {
            "type": "string",
            "description": "The radiograph as uploaded (NIfTI)."
        },
        "proc_url": {
            "type": "string",
            "description": "Per-zone predictions for cavities, infiltrates and nodules."
        },
        "zip_result_url": {
            "type": "string",
            "description": "Every artifact of the run, archived."
        },
        "input_preview_url": {
            "type": "string",
            "description": "PNG of the radiograph before analysis."
        },
        "proc_preview_url": {
            "type": "string",
            "description": "PNG of the radiograph with each zone tinted by its severity score."
        },
        "proc_rgb_url": {
            "type": "string",
            "description": "Not produced by cxr_sextants. Always an empty string.",
            "const": ""
        },
        "annotation_url": {
            "type": "string",
            "description": "Not produced by cxr_sextants. Always an empty string.",
            "const": ""
        }
    },
    "required": [
        "app_label",
        "case_uid",
        "case_label",
        "status_text",
        "error_text",
        "input_url",
        "proc_url",
        "input_preview_url",
        "proc_preview_url",
        "zip_result_url"
    ],
    "example": {
        "app_label": "cxr_sextants",
        "case_uid": "9ea444e6-7628-11f1-bb8a-2387e58ac733",
        "case_label": "14_4_15437.dcm_norm.nii.gz",
        "status_text": "success",
        "error_text": "",
        "input_url": "/data/cxr_sextants/case-9ea444e6-7628-11f1-bb8a-2387e58ac733/14_4_15437.dcm_norm.nii.gz",
        "proc_url": "/data/cxr_sextants/case-9ea444e6-7628-11f1-bb8a-2387e58ac733/14_4_15437.dcm_norm-cxr_sextants.json",
        "zip_result_url": "/data/cxr_sextants/case-9ea444e6-7628-11f1-bb8a-2387e58ac733/14_4_15437.dcm_norm-cxr_sextants-result.zip",
        "input_preview_url": "/data/cxr_sextants/case-9ea444e6-7628-11f1-bb8a-2387e58ac733/14_4_15437.dcm_norm-preview.png",
        "proc_preview_url": "/data/cxr_sextants/case-9ea444e6-7628-11f1-bb8a-2387e58ac733/14_4_15437.dcm_norm-cxr_sextants-preview.png",
        "proc_rgb_url": "",
        "annotation_url": ""
    }
}
