{
  "openapi": "3.0.3",
  "info": {
    "title": "ICVP HCERT Payload API",
    "description": "Mininmial DVC payload for use within an HCERT Payload using the ICVP Product Catalogue",
    "version": "1.0.0"
  },
  "paths": {
    "/StructureDefinition-ICVPMin.schema.json": {
      "get": {
        "summary": "JSON Schema definition for the Logical Model StructureDefinition-ICVPMin",
        "description": "This endpoint serves the JSON Schema definition for the Logical Model StructureDefinition-ICVPMin.",
        "responses": {
          "200": {
            "description": "The JSON Schema for StructureDefinition-ICVPMin",
            "content": {
              "application/schema+json": {
                "schema": {
                  "$ref": "./StructureDefinition-ICVPMin.schema.json"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "StructureDefinition-ICVPMin": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "http://smart.who.int/base/StructureDefinition-ICVPMin.schema.json",
        "title": "ICVP HCERT Payload",
        "description": "Mininmial 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": "Person name"
          },
          "dob": {
            "type": "string",
            "format": "date",
            "description": "Date of birth in YYYY-MM-DD format"
          },
          "s": {
            "type": "string",
            "description": "Sex"
          },
          "ntl": {
            "type": "string",
            "description": "Nationality"
          },
          "nid": {
            "type": "string",
            "description": "National Identification Document"
          },
          "ndt": {
            "oneOf": [
              {
                "type": "string",
                "description": "Code from ValueSet v2-0203 (plain string)"
              },
              {
                "type": "object",
                "description": "Code from ValueSet v2-0203 (JSON-LD structure)",
                "properties": {
                  "@type": {
                    "type": "string",
                    "const": "http://smart.who.int/base/ValueSet-v2-0203.jsonld",
                    "description": "JSON-LD type reference to ValueSet v2-0203"
                  },
                  "@id": {
                    "type": "string",
                    "format": "uri",
                    "description": "Full IRI of the code from ValueSet v2-0203"
                  }
                },
                "required": [
                  "@type",
                  "@id"
                ],
                "additionalProperties": false
              }
            ],
            "description": "National ID Document Type"
          },
          "gn": {
            "type": "string",
            "description": "Parent or Guardian Name"
          },
          "v": {
            "type": "array",
            "items": {
              "$ref": "http://smart.who.int/base/StructureDefinition-ICVPMinVaccineDetails.schema.json"
            },
            "minItems": 1,
            "description": "Vaccine Details"
          }
        },
        "required": [
          "resourceType",
          "n",
          "dob",
          "v"
        ],
        "resourceDefinition": "http://smart.who.int/icvp/StructureDefinition/ICVPMin",
        "fhir:parent": "http://smart.who.int/trust-phw/StructureDefinition/DVCMin",
        "jsonld:valuesets": [
          "v2-0203"
        ],
        "jsonld:contextTemplate": {
          "@version": 1.1,
          "fhir": "http://hl7.org/fhir/",
          "v2-0203": "http://smart.who.int/base/ValueSet-v2-0203.jsonld"
        }
      }
    }
  }
}