{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "http://smart.who.int/base/StructureDefinition-KGEvidence.schema.json",
  "title": "Knowledge graph L1: Evidence",
  "description": "The body of evidence behind a recommendation, with its GRADE certainty rating. Class IRI: http://smart.who.int/kg/evidence.",
  "type": "object",
  "properties": {
    "resourceType": {
      "type": "string",
      "const": "KGEvidence",
      "description": "Resource type identifier for KGEvidence logical model"
    },
    "@context": {
      "description": "JSON-LD context for this logical model with ValueSet vocabularies",
      "anyOf": [
        {
          "type": "string",
          "format": "uri",
          "description": "URI reference to external JSON-LD context"
        },
        {
          "type": "object",
          "description": "Inline JSON-LD context",
          "properties": {
            "@version": {
              "type": "number",
              "const": 1.1
            },
            "fhir": {
              "type": "string",
              "const": "http://hl7.org/fhir/"
            }
          },
          "additionalProperties": {
            "type": "string",
            "format": "uri"
          }
        },
        {
          "type": "array",
          "description": "Array of JSON-LD context objects/URIs",
          "items": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "object"
              }
            ]
          }
        }
      ]
    },
    "@type": {
      "type": "string",
      "description": "JSON-LD type identifier for KGEvidence logical model",
      "examples": [
        "LogicalModel-KGEvidence"
      ]
    },
    "summary": {
      "type": "string",
      "description": "Summary of the body of evidence."
    },
    "certainty": {
      "oneOf": [
        {
          "type": "string",
          "description": "Code from ValueSet KGGradeCertaintyVS (plain string)"
        },
        {
          "type": "object",
          "description": "Code from ValueSet KGGradeCertaintyVS (JSON-LD structure)",
          "properties": {
            "@type": {
              "type": "string",
              "const": "http://smart.who.int/base/ValueSet-KGGradeCertaintyVS.jsonld",
              "description": "JSON-LD type reference to ValueSet KGGradeCertaintyVS"
            },
            "@id": {
              "type": "string",
              "format": "uri",
              "description": "Full IRI of the code from ValueSet KGGradeCertaintyVS"
            }
          },
          "required": [
            "@type",
            "@id"
          ],
          "additionalProperties": false
        }
      ],
      "description": "GRADE certainty of the body of evidence."
    },
    "studyCount": {
      "type": "integer",
      "minimum": 0,
      "description": "Number of studies in the body of evidence."
    },
    "citation": {
      "type": "string",
      "description": "Bibliographic citation of the evidence review."
    }
  },
  "required": [
    "resourceType"
  ],
  "resourceDefinition": "http://smart.who.int/base/StructureDefinition/KGEvidence",
  "fhir:parent": "http://hl7.org/fhir/StructureDefinition/Base",
  "jsonld:valuesets": [
    "KGGradeCertaintyVS"
  ],
  "jsonld:contextTemplate": {
    "@version": 1.1,
    "fhir": "http://hl7.org/fhir/",
    "KGGradeCertaintyVS": "http://smart.who.int/base/ValueSet-KGGradeCertaintyVS.jsonld"
  }
}