{
  "openapi": "3.1.0",
  "info": {
    "title": "ICVP - Vaccine Details API",
    "description": "Vaccine Data elements for the International Certificate of Vaccination or Prophylaxis",
    "version": "1.0.0"
  },
  "paths": {
    "/StructureDefinition-ICVPVaccineDetails.schema.json": {
      "get": {
        "summary": "JSON Schema definition for the Logical Model StructureDefinition-ICVPVaccineDetails",
        "description": "This endpoint serves the JSON Schema definition for the Logical Model StructureDefinition-ICVPVaccineDetails.",
        "responses": {
          "200": {
            "description": "The JSON Schema for StructureDefinition-ICVPVaccineDetails",
            "content": {
              "application/schema+json": {
                "schema": {
                  "$ref": "./StructureDefinition-ICVPVaccineDetails.schema.json"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "StructureDefinition-ICVPVaccineDetails": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "http://smart.who.int/base/StructureDefinition-ICVPVaccineDetails.schema.json",
        "title": "ICVP - Vaccine Details",
        "description": "Vaccine Data elements for the International Certificate of Vaccination or Prophylaxis",
        "type": "object",
        "properties": {
          "resourceType": {
            "type": "string",
            "const": "ICVPVaccineDetails",
            "description": "Resource type identifier for ICVPVaccineDetails 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 ICVPVaccineDetails logical model",
            "examples": [
              "LogicalModel-ICVPVaccineDetails"
            ]
          },
          "vaccine[x]": {
            "type": "object",
            "description": "Vaccine or prophylaxis product"
          },
          "id": {
            "type": "object",
            "description": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."
          },
          "reference": {
            "type": "string",
            "description": "A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources."
          },
          "type": {
            "$ref": "./ValueSet-identifier-type|5.0.0.schema.json",
            "description": "A coded type for the identifier that can be used to determine which identifier to use for a specific purpose."
          },
          "identifier": {
            "type": "object",
            "description": "An identifier for the target resource. This is used when there is no way to reference the other resource directly, either because the entity it represents is not available through a FHIR server, or because there is no way for the author of the resource to convert a known identifier to an actual location. There is no requirement that a Reference.identifier point to something that is actually exposed as a FHIR instance, but it SHALL point to a business concept that would be expected to be exposed as a FHIR instance, and that instance would need to be of a FHIR resource type allowed by the reference."
          },
          "use": {
            "$ref": "./ValueSet-identifier-use|5.0.0.schema.json",
            "description": "The purpose of this identifier."
          },
          "system": {
            "type": "string",
            "format": "uri",
            "description": "Establishes the namespace for the value - that is, an absolute URL that describes a set values that are unique."
          },
          "value": {
            "type": "string",
            "description": "The portion of the identifier typically relevant to the user and which is unique within the context of the system."
          },
          "period": {
            "type": "object",
            "description": "Time period during which identifier is/was valid for use."
          },
          "assigner": {
            "type": "object",
            "description": "Organization that issued/manages the identifier."
          },
          "display": {
            "type": "string",
            "description": "Plain text narrative that identifies the resource in addition to the resource reference."
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "Date of vaccination"
          },
          "issuer": {
            "type": "object",
            "description": "Relevant authoring responsible for issuing the certificate, or for overseeing the administration center"
          },
          "clinicianName": {
            "type": "string",
            "description": "Name of supervising clinician, of relevant authority responsible for issuing this certificate, or for overseeing the administering centre"
          },
          "manufacturer": {
            "type": "object",
            "description": "Manufacturer of vaccine or prophylaxis"
          },
          "batchNo": {
            "type": "object",
            "description": "Batch No. of vaccine or prophylaxis"
          },
          "validity": {
            "type": "object",
            "description": "Certificate valid from... until..."
          }
        },
        "required": [
          "resourceType",
          "vaccine[x]",
          "date",
          "manufacturer",
          "batchNo",
          "validity"
        ],
        "allOf": [
          {
            "$ref": "./StructureDefinition-FHIRSchemaBase.schema.json"
          },
          {
            "type": "object",
            "properties": {
              "resourceDefinition": {
                "type": "string",
                "format": "uri",
                "const": "http://smart.who.int/icvp/StructureDefinition/ICVPVaccineDetails"
              },
              "fhir:parent": {
                "type": "string",
                "const": "http://smart.who.int/trust-phw/StructureDefinition/DVCVaccineDetailsPreQual"
              },
              "jsonld:valuesets": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "const": [
                  "ICVPProductIds",
                  "identifier-type|5.0.0",
                  "identifier-use|5.0.0",
                  "resource-types|5.0.0"
                ]
              },
              "jsonld:contextTemplate": {
                "type": "object",
                "const": {
                  "@version": 1.1,
                  "fhir": "http://hl7.org/fhir/",
                  "identifier-use|5.0.0": "http://smart.who.int/base/ValueSet-identifier-use|5.0.0.jsonld",
                  "ICVPProductIds": "http://smart.who.int/base/ValueSet-ICVPProductIds.jsonld",
                  "identifier-type|5.0.0": "http://smart.who.int/base/ValueSet-identifier-type|5.0.0.jsonld",
                  "resource-types|5.0.0": "http://smart.who.int/base/ValueSet-resource-types|5.0.0.jsonld"
                }
              }
            }
          }
        ]
      }
    }
  }
}