{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Palliative care evidence register: open data",
  "$defs": {
    "figure": {
      "type": "object",
      "required": [
        "id",
        "label",
        "value",
        "unit",
        "geography",
        "refYear",
        "claimType",
        "confidence",
        "status",
        "evidenceLabel",
        "lastChecked",
        "sourceIds"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "value": {
          "type": [
            "number",
            "string"
          ]
        },
        "unit": {
          "type": "string"
        },
        "geography": {
          "type": "string"
        },
        "refYear": {
          "type": "string"
        },
        "claimType": {
          "enum": [
            "observed",
            "modeled-estimate",
            "policy-text",
            "expert-interpretation",
            "program-hypothesis",
            "illustrative"
          ]
        },
        "confidence": {
          "enum": [
            "high",
            "moderate",
            "low",
            "unresolved"
          ]
        },
        "status": {
          "enum": [
            "active",
            "needs-review",
            "conflicting-sources",
            "retired"
          ]
        },
        "currency": {
          "enum": [
            "current",
            "dated-usable",
            "stale",
            "unknown"
          ]
        },
        "series": {
          "enum": [
            "sales-proxy",
            "reported-consumption",
            null
          ]
        },
        "evidenceLabel": {
          "type": "string"
        },
        "lastChecked": {
          "type": "string",
          "format": "date"
        },
        "sourceCheckedOn": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "reviewBy": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "method": {
          "type": [
            "string",
            "null"
          ]
        },
        "limitations": {
          "type": [
            "string",
            "null"
          ]
        },
        "note": {
          "type": [
            "string",
            "null"
          ]
        },
        "conflicts": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "sourceId": {
                "type": "string"
              },
              "value": {
                "type": [
                  "number",
                  "string"
                ]
              },
              "note": {
                "type": "string"
              }
            }
          }
        },
        "sourceIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "reviewReason": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "source": {
      "type": "object",
      "required": [
        "id",
        "kind",
        "title",
        "detail"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "kind": {
          "enum": [
            "primary",
            "peer",
            "official",
            "institutional",
            "news",
            "manufacturer"
          ]
        },
        "tier": {
          "enum": [
            1,
            2,
            3,
            4,
            null
          ]
        },
        "year": {
          "type": [
            "string",
            "null"
          ]
        },
        "title": {
          "type": "string"
        },
        "detail": {
          "type": "string"
        },
        "url": {
          "type": [
            "string",
            "null"
          ]
        },
        "doi": {
          "type": [
            "string",
            "null"
          ]
        },
        "pmid": {
          "type": [
            "string",
            "null"
          ]
        },
        "accessed": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  },
  "properties": {
    "figures.json": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/figure"
      }
    },
    "sources.json": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/source"
      }
    }
  }
}
