{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/nextgen-healthcare/main/json-schema/nextgen-healthcare-immunization-bundled-schema.json",
  "title": "ImmunizationBundled",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nextgen-healthcare-immunization-api-openapi.yml#/components/schemas/ImmunizationBundled",
  "type": "object",
  "properties": {
    "resourceType": {
      "type": "string",
      "minLength": 1
    },
    "id": {
      "type": "string",
      "minLength": 1
    },
    "meta": {
      "type": "object",
      "properties": {
        "lastUpdated": {
          "type": "string",
          "description": "Date in format - YYYY-MM-DDThh:mm:ss+zz"
        }
      }
    },
    "type": {
      "type": "string",
      "minLength": 1,
      "description": "Type of Search"
    },
    "total": {
      "type": "integer",
      "description": "Number of immunization in entry field"
    },
    "link": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "relation": {
            "type": "string",
            "minLength": 1,
            "description": "relation of the resource with link provided in url"
          },
          "url": {
            "type": "string",
            "minLength": 1,
            "description": "FHIR URI of the request"
          }
        }
      },
      "required": [
        "relation",
        "url"
      ]
    },
    "entry": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "fullUrl": {
            "type": "string",
            "minLength": 1,
            "description": "FHIR URI of respective Immunization resource in entry"
          },
          "resource": {
            "$ref": "#/$defs/Immunization"
          }
        }
      }
    }
  },
  "required": [
    "id",
    "resourceType",
    "meta",
    "entry",
    "link",
    "total"
  ],
  "$defs": {
    "Immunization": {
      "type": "object",
      "properties": {
        "resourceType": {
          "type": "string",
          "minLength": 1
        },
        "id": {
          "type": "string",
          "minLength": 1
        },
        "meta": {
          "type": "object",
          "properties": {
            "profile": {
              "type": "string"
            }
          }
        },
        "status": {
          "type": "string",
          "description": "completed | entered-in-error | not-done"
        },
        "vaccineCode": {
          "type": "object",
          "description": "Vaccine product administered",
          "properties": {
            "coding": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "system": {
                    "type": "string",
                    "description": "Identity of the terminology system"
                  },
                  "code": {
                    "type": "string",
                    "description": "Symbol in syntax defined by the system"
                  },
                  "display": {
                    "type": "string",
                    "description": "Representation defined by the system"
                  }
                }
              }
            }
          }
        },
        "patient": {
          "type": "string",
          "description": "Who was immunized"
        },
        "statusReason": {
          "type": "object",
          "properties": {
            "coding": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "system": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Symbol in syntax defined by the system"
                  },
                  "code": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Symbol in syntax defined by the system"
                  },
                  "display": {
                    "type": "string",
                    "description": "Representation defined by the system"
                  }
                }
              }
            },
            "text": {
              "type": "string",
              "description": "Plain text representation of the concept"
            }
          }
        },
        "occurrenceDateTime": {
          "type": "string",
          "description": "Date in format - YYYY-MM-DDThh:mm:ss+zz"
        },
        "primarySource": {
          "type": "boolean",
          "description": "Indicates context the data was recorded in"
        }
      },
      "required": [
        "id",
        "resourceType",
        "status",
        "vaccineCode",
        "occurrenceDateTime"
      ]
    }
  }
}