{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "http://smart.who.int/base/StructureDefinition-ICVPMin.schema.json",
  "title": "ICVP HCERT Payload",
  "description": "Minimal DVC payload for use within an HCERT Payload using the ICVP Product Catalogue",
  "type": "object",
  "properties": {
    "resourceType": {
      "type": "string",
      "const": "ICVPMin",
      "description": "Resource type identifier for ICVPMin 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 ICVPMin logical model",
      "examples": [
        "LogicalModel-ICVPMin"
      ]
    },
    "n": {
      "type": "string",
      "description": "Name"
    },
    "dob": {
      "type": "string",
      "format": "date",
      "description": "Date of birth"
    },
    "s": {
      "$ref": "./ValueSet-administrative-gender.schema.json",
      "description": "Sex"
    },
    "nt": {
      "$ref": "./ValueSet-iso3166-1-3.schema.json",
      "description": "Nationality"
    },
    "id": {
      "type": "string",
      "description": "National Identification Document"
    },
    "dt": {
      "$ref": "./ValueSet-v2-0203|3.0.0.schema.json",
      "description": "National ID Document Type"
    },
    "gn": {
      "type": "string",
      "description": "Parent or Guardian Name"
    },
    "vx": {
      "$ref": "StructureDefinition-ICVPMinVaccineDetails.schema.json",
      "description": "Vaccine Details"
    },
    "v": {
      "type": "string",
      "description": "Version of the certificate template"
    }
  },
  "required": [
    "resourceType",
    "n",
    "dob",
    "s",
    "nt",
    "vx",
    "v"
  ],
  "allOf": [
    {
      "$ref": "./StructureDefinition-FHIRSchemaBase.schema.json"
    },
    {
      "type": "object",
      "properties": {
        "resourceDefinition": {
          "type": "string",
          "format": "uri",
          "const": "http://smart.who.int/icvp/StructureDefinition/ICVPMin"
        },
        "fhir:parent": {
          "type": "string",
          "const": "http://smart.who.int/trust-phw/StructureDefinition/DVCMin"
        },
        "jsonld:valuesets": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "const": [
            "administrative-gender",
            "iso3166-1-3",
            "v2-0203|3.0.0"
          ]
        },
        "jsonld:contextTemplate": {
          "type": "object",
          "const": {
            "@version": 1.1,
            "fhir": "http://hl7.org/fhir/",
            "v2-0203|3.0.0": "http://smart.who.int/base/ValueSet-v2-0203|3.0.0.jsonld",
            "administrative-gender": "http://smart.who.int/base/ValueSet-administrative-gender.jsonld",
            "iso3166-1-3": "http://smart.who.int/base/ValueSet-iso3166-1-3.jsonld"
          }
        }
      }
    }
  ]
}