{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://medgauge.org/schemas/0.1.0/standard.schema.json",
  "title": "standard",
  "description": "A standard or guideline the site cites (standards registry): publisher, version, URL, scope and how MedGauge uses it.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^std-[a-z0-9.-]+$"
    },
    "name": {
      "type": "string",
      "minLength": 1
    },
    "name_zh": {
      "type": "string"
    },
    "publisher": {
      "type": "string",
      "minLength": 1
    },
    "version": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri-reference",
      "description": "Absolute URL of the source, or a site-relative path for MedGauge's own pages."
    },
    "scope": {
      "type": "string",
      "minLength": 1
    },
    "how_we_use_zh": {
      "type": "string",
      "minLength": 1
    },
    "how_we_use_en": {
      "type": "string"
    },
    "license_note": {
      "type": "string"
    },
    "region": {
      "type": "string",
      "enum": [
        "international",
        "cn",
        "us",
        "eu",
        "other"
      ]
    },
    "scope_note": {
      "type": "string"
    },
    "source_check": {
      "type": "object",
      "additionalProperties": false,
      "description": "Outcome of the most recent check of this record's name, version and locator against the source itself or the literature, with its date.",
      "properties": {
        "state": {
          "type": "string",
          "enum": [
            "confirmed",
            "not_confirmed"
          ]
        },
        "date": {
          "type": "string",
          "format": "date"
        },
        "note": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": [
        "state",
        "date"
      ]
    },
    "kind": {
      "type": "string",
      "enum": [
        "guideline",
        "consensus",
        "certification",
        "clinical_pathway",
        "drug_label",
        "code_system",
        "data_standard",
        "privacy_standard",
        "reporting_guideline",
        "agent_standard",
        "internal"
      ]
    }
  },
  "required": [
    "id",
    "name",
    "publisher",
    "url",
    "scope",
    "how_we_use_en",
    "region"
  ]
}
