{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "http://smart.who.int/base/StructureDefinition-IMMZ_D1_Capture_or_update_client_history.schema.json",
  "title": "IMMZ.D1.Capture or update client history",
  "description": "Data elements for the IMMZ.D1.Capture or update client history Data Dictionary Activity.",
  "type": "object",
  "properties": {
    "resourceType": {
      "type": "string",
      "const": "IMMZD1",
      "description": "Resource type identifier for IMMZ_D1_Capture_or_update_client_history 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 IMMZ_D1_Capture_or_update_client_history logical model",
      "examples": [
        "LogicalModel-IMMZ_D1_Capture_or_update_client_history"
      ]
    },
    "IMMZD1": {
      "type": "array",
      "items": {
        "type": "object",
        "description": "FHIR "
      },
      "description": "Data elements for the IMMZ.D1.Capture or update client history Data Dictionary Activity."
    },
    "patient": {
      "type": "object",
      "description": "The patient."
    },
    "birthDose": {
      "type": "boolean",
      "description": "Indicates if the client received a dose within 24 hours of birth. Whether a birth dose is counted as part of the primary series will depend on the antigen"
    },
    "typeOfDose": {
      "oneOf": [
        {
          "type": "object",
          "description": "FHIR Coding from ValueSet IMMZ.D.DE258",
          "properties": {
            "system": {
              "type": "string",
              "description": "Code system URI"
            },
            "code": {
              "type": "string",
              "description": "Code value"
            },
            "display": {
              "type": "string",
              "description": "Human readable display text"
            }
          },
          "required": [
            "system",
            "code"
          ]
        },
        {
          "type": "object",
          "description": "Coding from ValueSet IMMZ.D.DE258 (JSON-LD structure)",
          "properties": {
            "@type": {
              "type": "string",
              "const": "http://smart.who.int/base/ValueSet-IMMZ.D.DE258.jsonld",
              "description": "JSON-LD type reference to ValueSet IMMZ.D.DE258"
            },
            "@id": {
              "type": "string",
              "format": "uri",
              "description": "Full IRI of the code from ValueSet IMMZ.D.DE258"
            }
          },
          "required": [
            "@type",
            "@id"
          ],
          "additionalProperties": false
        }
      ],
      "description": "The type of dose in a series that the client received"
    },
    "completedThePrimaryVaccinationSeries": {
      "type": "boolean",
      "description": "Indicates if the client has completed the primary vaccination series of a product/antigen. If the client has not yet completed their primary series, it means they may be expected to receive more doses to complete their vaccination regimen for the respective product/antigen"
    },
    "completedTheBoosterSeries": {
      "type": "boolean",
      "description": "Indicates if the client has completed the booster series of a product/antigen"
    },
    "dateWhenPrimaryVaccinationSeriesWasCompleted": {
      "type": "string",
      "format": "date",
      "description": "The date when the client completed the primary vaccination series (per product/antigen)"
    },
    "hivStatus": {
      "oneOf": [
        {
          "type": "object",
          "description": "FHIR Coding from ValueSet IMMZ.D.DE204",
          "properties": {
            "system": {
              "type": "string",
              "description": "Code system URI"
            },
            "code": {
              "type": "string",
              "description": "Code value"
            },
            "display": {
              "type": "string",
              "description": "Human readable display text"
            }
          },
          "required": [
            "system",
            "code"
          ]
        },
        {
          "type": "object",
          "description": "Coding from ValueSet IMMZ.D.DE204 (JSON-LD structure)",
          "properties": {
            "@type": {
              "type": "string",
              "const": "http://smart.who.int/base/ValueSet-IMMZ.D.DE204.jsonld",
              "description": "JSON-LD type reference to ValueSet IMMZ.D.DE204"
            },
            "@id": {
              "type": "string",
              "format": "uri",
              "description": "Full IRI of the code from ValueSet IMMZ.D.DE204"
            }
          },
          "required": [
            "@type",
            "@id"
          ],
          "additionalProperties": false
        }
      ],
      "description": "The current HIV status of the client"
    },
    "pretermBirth": {
      "type": "boolean",
      "description": "The infant was preterm; the mother gave birth to the infant when gestational age was less than 37 weeks"
    },
    "immunocompromised": {
      "type": "boolean",
      "description": "The client is known to be immunocompromised. This means the client has a weakened immune system and having a reduced ability to fight infections and other diseases"
    },
    "currentlyOnArt": {
      "type": "boolean",
      "description": "The client is currently receiving antiretroviral therapy (ART)"
    },
    "typeOfTbInfectionTestPerformed": {
      "oneOf": [
        {
          "type": "object",
          "description": "FHIR Coding from ValueSet IMMZ.D.DE243",
          "properties": {
            "system": {
              "type": "string",
              "description": "Code system URI"
            },
            "code": {
              "type": "string",
              "description": "Code value"
            },
            "display": {
              "type": "string",
              "description": "Human readable display text"
            }
          },
          "required": [
            "system",
            "code"
          ]
        },
        {
          "type": "object",
          "description": "Coding from ValueSet IMMZ.D.DE243 (JSON-LD structure)",
          "properties": {
            "@type": {
              "type": "string",
              "const": "http://smart.who.int/base/ValueSet-IMMZ.D.DE243.jsonld",
              "description": "JSON-LD type reference to ValueSet IMMZ.D.DE243"
            },
            "@id": {
              "type": "string",
              "format": "uri",
              "description": "Full IRI of the code from ValueSet IMMZ.D.DE243"
            }
          },
          "required": [
            "@type",
            "@id"
          ],
          "additionalProperties": false
        }
      ],
      "description": "The type of tuberculosis (TB) infection test performed"
    },
    "tbInfectionTestResult": {
      "oneOf": [
        {
          "type": "object",
          "description": "FHIR Coding from ValueSet IMMZ.D.DE246",
          "properties": {
            "system": {
              "type": "string",
              "description": "Code system URI"
            },
            "code": {
              "type": "string",
              "description": "Code value"
            },
            "display": {
              "type": "string",
              "description": "Human readable display text"
            }
          },
          "required": [
            "system",
            "code"
          ]
        },
        {
          "type": "object",
          "description": "Coding from ValueSet IMMZ.D.DE246 (JSON-LD structure)",
          "properties": {
            "@type": {
              "type": "string",
              "const": "http://smart.who.int/base/ValueSet-IMMZ.D.DE246.jsonld",
              "description": "JSON-LD type reference to ValueSet IMMZ.D.DE246"
            },
            "@id": {
              "type": "string",
              "format": "uri",
              "description": "Full IRI of the code from ValueSet IMMZ.D.DE246"
            }
          },
          "required": [
            "@type",
            "@id"
          ],
          "additionalProperties": false
        }
      ],
      "description": "Records the result of the TB infection test"
    },
    "immunologicallyStable": {
      "type": "boolean",
      "description": "The client is living with HIV and is immunologically stable with CD4 count or percentage above a minimum as defined in the HIV guidelines"
    },
    "clinicallyWell": {
      "type": "boolean",
      "description": "The client is living with HIV and is clinically well, as defined in HIV guidelines and WHO clinical staging"
    },
    "birthWeightInGrams": {
      "type": "number",
      "description": "Represents the client's birth weight value measures in grams"
    },
    "typeOfPoliovirusDose": {
      "oneOf": [
        {
          "type": "object",
          "description": "FHIR Coding from ValueSet IMMZ.D.DE212",
          "properties": {
            "system": {
              "type": "string",
              "description": "Code system URI"
            },
            "code": {
              "type": "string",
              "description": "Code value"
            },
            "display": {
              "type": "string",
              "description": "Human readable display text"
            }
          },
          "required": [
            "system",
            "code"
          ]
        },
        {
          "type": "object",
          "description": "Coding from ValueSet IMMZ.D.DE212 (JSON-LD structure)",
          "properties": {
            "@type": {
              "type": "string",
              "const": "http://smart.who.int/base/ValueSet-IMMZ.D.DE212.jsonld",
              "description": "JSON-LD type reference to ValueSet IMMZ.D.DE212"
            },
            "@id": {
              "type": "string",
              "format": "uri",
              "description": "Full IRI of the code from ValueSet IMMZ.D.DE212"
            }
          },
          "required": [
            "@type",
            "@id"
          ],
          "additionalProperties": false
        }
      ],
      "description": "The type of the poliovirus vaccine dose administered to the client"
    },
    "artStartDate": {
      "type": "string",
      "format": "date",
      "description": "The date on which the client started or restarted ART"
    },
    "highRiskOfPneumococcalInfection": {
      "type": "boolean",
      "description": "The client is at high risk for pneumococcal infection because of underlying medical conditions (i.e. HIV infection or sickle-cell disease)"
    },
    "typeOfJeDose": {
      "oneOf": [
        {
          "type": "object",
          "description": "FHIR Coding from ValueSet IMMZ.D.DE216",
          "properties": {
            "system": {
              "type": "string",
              "description": "Code system URI"
            },
            "code": {
              "type": "string",
              "description": "Code value"
            },
            "display": {
              "type": "string",
              "description": "Human readable display text"
            }
          },
          "required": [
            "system",
            "code"
          ]
        },
        {
          "type": "object",
          "description": "Coding from ValueSet IMMZ.D.DE216 (JSON-LD structure)",
          "properties": {
            "@type": {
              "type": "string",
              "const": "http://smart.who.int/base/ValueSet-IMMZ.D.DE216.jsonld",
              "description": "JSON-LD type reference to ValueSet IMMZ.D.DE216"
            },
            "@id": {
              "type": "string",
              "format": "uri",
              "description": "Full IRI of the code from ValueSet IMMZ.D.DE216"
            }
          },
          "required": [
            "@type",
            "@id"
          ],
          "additionalProperties": false
        }
      ],
      "description": "The type of Japanese encephalitis (JE) vaccine dose administered to the client"
    },
    "typeOfTbeDose": {
      "oneOf": [
        {
          "type": "object",
          "description": "FHIR Coding from ValueSet IMMZ.D.DE220",
          "properties": {
            "system": {
              "type": "string",
              "description": "Code system URI"
            },
            "code": {
              "type": "string",
              "description": "Code value"
            },
            "display": {
              "type": "string",
              "description": "Human readable display text"
            }
          },
          "required": [
            "system",
            "code"
          ]
        },
        {
          "type": "object",
          "description": "Coding from ValueSet IMMZ.D.DE220 (JSON-LD structure)",
          "properties": {
            "@type": {
              "type": "string",
              "const": "http://smart.who.int/base/ValueSet-IMMZ.D.DE220.jsonld",
              "description": "JSON-LD type reference to ValueSet IMMZ.D.DE220"
            },
            "@id": {
              "type": "string",
              "format": "uri",
              "description": "Full IRI of the code from ValueSet IMMZ.D.DE220"
            }
          },
          "required": [
            "@type",
            "@id"
          ],
          "additionalProperties": false
        }
      ],
      "description": "The type of tick-borne encephalitis (TBE) vaccine dose administered"
    },
    "typeOfTyphoidDose": {
      "oneOf": [
        {
          "type": "object",
          "description": "FHIR Coding from ValueSet IMMZ.D.DE225",
          "properties": {
            "system": {
              "type": "string",
              "description": "Code system URI"
            },
            "code": {
              "type": "string",
              "description": "Code value"
            },
            "display": {
              "type": "string",
              "description": "Human readable display text"
            }
          },
          "required": [
            "system",
            "code"
          ]
        },
        {
          "type": "object",
          "description": "Coding from ValueSet IMMZ.D.DE225 (JSON-LD structure)",
          "properties": {
            "@type": {
              "type": "string",
              "const": "http://smart.who.int/base/ValueSet-IMMZ.D.DE225.jsonld",
              "description": "JSON-LD type reference to ValueSet IMMZ.D.DE225"
            },
            "@id": {
              "type": "string",
              "format": "uri",
              "description": "Full IRI of the code from ValueSet IMMZ.D.DE225"
            }
          },
          "required": [
            "@type",
            "@id"
          ],
          "additionalProperties": false
        }
      ],
      "description": "The type of typhoid vaccine dose administered to the client"
    },
    "typeOfCholeraDose": {
      "oneOf": [
        {
          "type": "object",
          "description": "FHIR Coding from ValueSet IMMZ.D.DE229",
          "properties": {
            "system": {
              "type": "string",
              "description": "Code system URI"
            },
            "code": {
              "type": "string",
              "description": "Code value"
            },
            "display": {
              "type": "string",
              "description": "Human readable display text"
            }
          },
          "required": [
            "system",
            "code"
          ]
        },
        {
          "type": "object",
          "description": "Coding from ValueSet IMMZ.D.DE229 (JSON-LD structure)",
          "properties": {
            "@type": {
              "type": "string",
              "const": "http://smart.who.int/base/ValueSet-IMMZ.D.DE229.jsonld",
              "description": "JSON-LD type reference to ValueSet IMMZ.D.DE229"
            },
            "@id": {
              "type": "string",
              "format": "uri",
              "description": "Full IRI of the code from ValueSet IMMZ.D.DE229"
            }
          },
          "required": [
            "@type",
            "@id"
          ],
          "additionalProperties": false
        }
      ],
      "description": "The type of cholera vaccine dose administered to the client"
    },
    "typeOfMeningococcalDose": {
      "oneOf": [
        {
          "type": "object",
          "description": "FHIR Coding from ValueSet IMMZ.D.DE232",
          "properties": {
            "system": {
              "type": "string",
              "description": "Code system URI"
            },
            "code": {
              "type": "string",
              "description": "Code value"
            },
            "display": {
              "type": "string",
              "description": "Human readable display text"
            }
          },
          "required": [
            "system",
            "code"
          ]
        },
        {
          "type": "object",
          "description": "Coding from ValueSet IMMZ.D.DE232 (JSON-LD structure)",
          "properties": {
            "@type": {
              "type": "string",
              "const": "http://smart.who.int/base/ValueSet-IMMZ.D.DE232.jsonld",
              "description": "JSON-LD type reference to ValueSet IMMZ.D.DE232"
            },
            "@id": {
              "type": "string",
              "format": "uri",
              "description": "Full IRI of the code from ValueSet IMMZ.D.DE232"
            }
          },
          "required": [
            "@type",
            "@id"
          ],
          "additionalProperties": false
        }
      ],
      "description": "The type of meningococcal vaccine dose administered to the client"
    },
    "ageInMonthsWhenClientReceivedFirstMeningococcalDose": {
      "type": "number",
      "description": "The age in months when client received their first meningococcal dose"
    },
    "typeOfHepatitisADose": {
      "oneOf": [
        {
          "type": "object",
          "description": "FHIR Coding from ValueSet IMMZ.D.DE237",
          "properties": {
            "system": {
              "type": "string",
              "description": "Code system URI"
            },
            "code": {
              "type": "string",
              "description": "Code value"
            },
            "display": {
              "type": "string",
              "description": "Human readable display text"
            }
          },
          "required": [
            "system",
            "code"
          ]
        },
        {
          "type": "object",
          "description": "Coding from ValueSet IMMZ.D.DE237 (JSON-LD structure)",
          "properties": {
            "@type": {
              "type": "string",
              "const": "http://smart.who.int/base/ValueSet-IMMZ.D.DE237.jsonld",
              "description": "JSON-LD type reference to ValueSet IMMZ.D.DE237"
            },
            "@id": {
              "type": "string",
              "format": "uri",
              "description": "Full IRI of the code from ValueSet IMMZ.D.DE237"
            }
          },
          "required": [
            "@type",
            "@id"
          ],
          "additionalProperties": false
        }
      ],
      "description": "The type of hepatitis A-containing vaccine dose administered to the client"
    },
    "typeOfHepatitisBDose": {
      "oneOf": [
        {
          "type": "object",
          "description": "FHIR Coding from ValueSet IMMZ.D.DE254",
          "properties": {
            "system": {
              "type": "string",
              "description": "Code system URI"
            },
            "code": {
              "type": "string",
              "description": "Code value"
            },
            "display": {
              "type": "string",
              "description": "Human readable display text"
            }
          },
          "required": [
            "system",
            "code"
          ]
        },
        {
          "type": "object",
          "description": "Coding from ValueSet IMMZ.D.DE254 (JSON-LD structure)",
          "properties": {
            "@type": {
              "type": "string",
              "const": "http://smart.who.int/base/ValueSet-IMMZ.D.DE254.jsonld",
              "description": "JSON-LD type reference to ValueSet IMMZ.D.DE254"
            },
            "@id": {
              "type": "string",
              "format": "uri",
              "description": "Full IRI of the code from ValueSet IMMZ.D.DE254"
            }
          },
          "required": [
            "@type",
            "@id"
          ],
          "additionalProperties": false
        }
      ],
      "description": "The type of hepatitis B-containing vaccine dose administered to the client"
    },
    "vnaLevel": {
      "type": "number",
      "description": "Vaccine-induced neutralizing antibody (VNA) level, measured as a serum antibody concentration from the result of the concentrated, purified cell culture-derived and embryonated egg-based rabies vaccines (CCEEV)"
    },
    "riskOfOccupationalExposureToRabiesVirus": {
      "type": "boolean",
      "description": "Professional at risk of occupational exposure to rabies virus, particularly animal health workers. Also considered for medical professionals who regularly provide care to persons with rabies"
    },
    "dengueSerostatus": {
      "oneOf": [
        {
          "type": "object",
          "description": "FHIR Coding from ValueSet IMMZ.D.DE241",
          "properties": {
            "system": {
              "type": "string",
              "description": "Code system URI"
            },
            "code": {
              "type": "string",
              "description": "Code value"
            },
            "display": {
              "type": "string",
              "description": "Human readable display text"
            }
          },
          "required": [
            "system",
            "code"
          ]
        },
        {
          "type": "object",
          "description": "Coding from ValueSet IMMZ.D.DE241 (JSON-LD structure)",
          "properties": {
            "@type": {
              "type": "string",
              "const": "http://smart.who.int/base/ValueSet-IMMZ.D.DE241.jsonld",
              "description": "JSON-LD type reference to ValueSet IMMZ.D.DE241"
            },
            "@id": {
              "type": "string",
              "format": "uri",
              "description": "Full IRI of the code from ValueSet IMMZ.D.DE241"
            }
          },
          "required": [
            "@type",
            "@id"
          ],
          "additionalProperties": false
        }
      ],
      "description": "Indicates the result of a serological test determining whether the client has antibodies against the dengue virus"
    },
    "vaccineType": {
      "type": "array",
      "items": {
        "oneOf": [
          {
            "type": "object",
            "description": "FHIR Coding from ValueSet IMMZ.Z.VS",
            "properties": {
              "system": {
                "type": "string",
                "description": "Code system URI"
              },
              "code": {
                "type": "string",
                "description": "Code value"
              },
              "display": {
                "type": "string",
                "description": "Human readable display text"
              }
            },
            "required": [
              "system",
              "code"
            ]
          },
          {
            "type": "object",
            "description": "Coding from ValueSet IMMZ.Z.VS (JSON-LD structure)",
            "properties": {
              "@type": {
                "type": "string",
                "const": "http://smart.who.int/base/ValueSet-IMMZ.Z.VS.jsonld",
                "description": "JSON-LD type reference to ValueSet IMMZ.Z.VS"
              },
              "@id": {
                "type": "string",
                "format": "uri",
                "description": "Full IRI of the code from ValueSet IMMZ.Z.VS"
              }
            },
            "required": [
              "@type",
              "@id"
            ],
            "additionalProperties": false
          }
        ],
        "description": "Coding from ValueSet IMMZ.Z.VS. Supports both FHIR Coding structure and JSON-LD structure."
      },
      "minItems": 1,
      "description": "Vaccine type/category that was administered or was to be administered. Any vaccine code available in the IMMZ.Z Vaccine library list of codes applies in this data element"
    },
    "dateAndTimeOfVaccination": {
      "type": "string",
      "format": "date-time",
      "description": "Represents the visit/encounter date, which is the date and time when each vaccine was administered to the client"
    },
    "contactDate": {
      "type": "string",
      "format": "date-time",
      "description": "The date and time of the client's contact"
    },
    "ancContactNumber": {
      "type": "integer",
      "description": "The antenatal care (ANC) contact or visit number"
    },
    "doseNumber": {
      "type": "integer",
      "description": "Vaccine dose number including dose number within series"
    }
  },
  "required": [
    "resourceType",
    "patient",
    "typeOfDose",
    "vaccineType",
    "dateAndTimeOfVaccination",
    "doseNumber"
  ],
  "resourceDefinition": "http://smart.who.int/immunizations/StructureDefinition/IMMZD1",
  "fhir:parent": "http://hl7.org/fhir/StructureDefinition/Base",
  "jsonld:valuesets": [
    "IMMZ.D.DE216",
    "IMMZ.D.DE204",
    "IMMZ.D.DE243",
    "IMMZ.D.DE229",
    "IMMZ.D.DE254",
    "IMMZ.D.DE258",
    "IMMZ.D.DE212",
    "IMMZ.D.DE220",
    "IMMZ.D.DE237",
    "IMMZ.D.DE232",
    "IMMZ.D.DE225",
    "IMMZ.D.DE241",
    "IMMZ.D.DE246",
    "IMMZ.Z.VS"
  ],
  "jsonld:contextTemplate": {
    "@version": 1.1,
    "fhir": "http://hl7.org/fhir/",
    "IMMZ.D.DE216": "http://smart.who.int/base/ValueSet-IMMZ.D.DE216.jsonld",
    "IMMZ.D.DE204": "http://smart.who.int/base/ValueSet-IMMZ.D.DE204.jsonld",
    "IMMZ.D.DE243": "http://smart.who.int/base/ValueSet-IMMZ.D.DE243.jsonld",
    "IMMZ.D.DE229": "http://smart.who.int/base/ValueSet-IMMZ.D.DE229.jsonld",
    "IMMZ.D.DE254": "http://smart.who.int/base/ValueSet-IMMZ.D.DE254.jsonld",
    "IMMZ.D.DE258": "http://smart.who.int/base/ValueSet-IMMZ.D.DE258.jsonld",
    "IMMZ.D.DE212": "http://smart.who.int/base/ValueSet-IMMZ.D.DE212.jsonld",
    "IMMZ.D.DE220": "http://smart.who.int/base/ValueSet-IMMZ.D.DE220.jsonld",
    "IMMZ.D.DE237": "http://smart.who.int/base/ValueSet-IMMZ.D.DE237.jsonld",
    "IMMZ.D.DE232": "http://smart.who.int/base/ValueSet-IMMZ.D.DE232.jsonld",
    "IMMZ.D.DE225": "http://smart.who.int/base/ValueSet-IMMZ.D.DE225.jsonld",
    "IMMZ.D.DE241": "http://smart.who.int/base/ValueSet-IMMZ.D.DE241.jsonld",
    "IMMZ.D.DE246": "http://smart.who.int/base/ValueSet-IMMZ.D.DE246.jsonld",
    "IMMZ.Z.VS": "http://smart.who.int/base/ValueSet-IMMZ.Z.VS.jsonld"
  }
}