{
  "openapi": "3.0.3",
  "info": {
    "title": "DVC Icvp with Selective Disclosure API",
    "description": "DVC Icvp with Selective Disclosure",
    "version": "1.0.0"
  },
  "paths": {
    "/StructureDefinition-ICVPSD.schema.json": {
      "get": {
        "summary": "JSON Schema definition for the Logical Model StructureDefinition-ICVPSD",
        "description": "This endpoint serves the JSON Schema definition for the Logical Model StructureDefinition-ICVPSD.",
        "responses": {
          "200": {
            "description": "The JSON Schema for StructureDefinition-ICVPSD",
            "content": {
              "application/schema+json": {
                "schema": {
                  "$ref": "./StructureDefinition-ICVPSD.schema.json"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "StructureDefinition-ICVPSD": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "http://smart.who.int/base/StructureDefinition-ICVPSD.schema.json",
        "title": "DVC Icvp with Selective Disclosure",
        "description": "DVC Icvp with Selective Disclosure",
        "type": "object",
        "properties": {
          "resourceType": {
            "type": "string",
            "const": "ICVPSD",
            "description": "Resource type identifier for ICVPSD 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 ICVPSD logical model",
            "examples": [
              "LogicalModel-ICVPSD"
            ]
          },
          "ICVP": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "FHIR "
            },
            "description": "Data elements for the Model International Certificate of Vaccination or Prophylaxis."
          },
          "name": {
            "type": "string",
            "description": "The full name of the client"
          },
          "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."
          },
          "value": {
            "type": "object",
            "description": "The actual value"
          },
          "dob": {
            "type": "string",
            "format": "date",
            "description": "Date of Birth"
          },
          "sex": {
            "type": "string",
            "description": "Sex"
          },
          "nationality": {
            "type": "string",
            "description": "Nationality"
          },
          "nid": {
            "type": "object",
            "description": "National Identification Document"
          },
          "use": {
            "oneOf": [
              {
                "type": "string",
                "description": "Code from ValueSet identifier-use|4.0.1 (plain string)"
              },
              {
                "type": "object",
                "description": "Code from ValueSet identifier-use|4.0.1 (JSON-LD structure)",
                "properties": {
                  "@type": {
                    "type": "string",
                    "const": "http://smart.who.int/base/ValueSet-identifier-use|4.0.1.jsonld",
                    "description": "JSON-LD type reference to ValueSet identifier-use|4.0.1"
                  },
                  "@id": {
                    "type": "string",
                    "format": "uri",
                    "description": "Full IRI of the code from ValueSet identifier-use|4.0.1"
                  }
                },
                "required": [
                  "@type",
                  "@id"
                ],
                "additionalProperties": false
              }
            ],
            "description": "The purpose of this identifier."
          },
          "type": {
            "type": "string",
            "format": "uri",
            "description": "The expected type of the target of the reference. If both Reference.type and Reference.reference are populated and Reference.reference is a FHIR URL, both SHALL be consistent.\n\nThe type is the Canonical URL of Resource Definition that is the type this reference refers to. References are URLs that are relative to http://hl7.org/fhir/StructureDefinition/ e.g. \"Patient\" is a reference to http://hl7.org/fhir/StructureDefinition/Patient. Absolute URLs are only allowed for logical models (and can only be used in references in logical models, not resources)."
          },
          "system": {
            "type": "string",
            "format": "uri",
            "description": "Establishes the namespace for the value - that is, a URL that describes a set values that are unique."
          },
          "period": {
            "type": "object",
            "description": "Time period during which identifier is/was valid for use."
          },
          "assigner": {
            "type": "object",
            "description": "Organization that issued/manages the identifier."
          },
          "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"
          },
          "guardian": {
            "type": "string",
            "description": "Name of Parent or Guardian"
          },
          "issuer": {
            "type": "object",
            "description": "Document issuer"
          },
          "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."
          },
          "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."
          },
          "display": {
            "type": "string",
            "description": "Plain text narrative that identifies the resource in addition to the resource reference."
          },
          "vaccineDetails": {
            "type": "array",
            "items": {
              "$ref": "http://smart.who.int/base/StructureDefinition-ICVPVaccineDetails.schema.json"
            },
            "minItems": 1,
            "description": "Vaccine Details"
          }
        },
        "required": [
          "resourceType",
          "name",
          "dob",
          "vaccineDetails"
        ],
        "resourceDefinition": "http://smart.who.int/icvp/StructureDefinition/ICVPSD",
        "fhir:parent": "http://smart.who.int/icvp/StructureDefinition/ICVP",
        "jsonld:valuesets": [
          "identifier-type|4.0.1",
          "identifier-use|4.0.1",
          "resource-types|4.0.1",
          "v2-0203"
        ],
        "jsonld:contextTemplate": {
          "@version": 1.1,
          "fhir": "http://hl7.org/fhir/",
          "identifier-type|4.0.1": "http://smart.who.int/base/ValueSet-identifier-type|4.0.1.jsonld",
          "identifier-use|4.0.1": "http://smart.who.int/base/ValueSet-identifier-use|4.0.1.jsonld",
          "resource-types|4.0.1": "http://smart.who.int/base/ValueSet-resource-types|4.0.1.jsonld",
          "v2-0203": "http://smart.who.int/base/ValueSet-v2-0203.jsonld"
        }
      }
    }
  }
}