{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/nextgen-healthcare/main/json-schema/nextgen-healthcare-patient-schema.json",
  "title": "Patient",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nextgen-healthcare-patient-api-openapi.yml#/components/schemas/Patient",
  "type": "object",
  "properties": {
    "resourceType": {
      "type": "string",
      "minLength": 1
    },
    "id": {
      "type": "string",
      "minLength": 1,
      "description": "id of the resource"
    },
    "active": {
      "type": "boolean",
      "description": "Whether this patient's record is in active use."
    },
    "identifier": {
      "type": "array",
      "description": "An identifier for the patient",
      "items": {
        "type": "object",
        "properties": {
          "use": {
            "type": "string"
          },
          "type": {
            "type": "object",
            "properties": {
              "coding": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "system": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "display": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "system",
                    "code",
                    "display"
                  ]
                }
              },
              "text": {
                "type": "string"
              }
            }
          },
          "System": {
            "type": "string"
          },
          "Value": {
            "type": "string",
            "required": [
              "use",
              "type",
              "System",
              "Value"
            ]
          }
        }
      }
    },
    "telcom": {
      "type": "array",
      "description": "contact detail for the individual",
      "items": {
        "type": "object",
        "properties": {
          "system": {
            "type": "string"
          },
          "use": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      }
    },
    "name": {
      "type": "array",
      "description": "name associated with the patient",
      "items": {
        "type": "object",
        "properties": {
          "use": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "family": {
            "type": "string"
          },
          "given": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "givenElement": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "address": {
      "type": "array",
      "description": "address of the patient",
      "items": {
        "type": "object",
        "properties": {
          "line": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "postalCode": {
            "type": "string"
          },
          "period": {
            "type": "object",
            "properties": {
              "start": {
                "format": "date-time",
                "type": "string"
              },
              "end": {
                "format": "date-time",
                "type": "string"
              }
            }
          },
          "use": {
            "type": "string"
          }
        }
      }
    },
    "birthdate": {
      "format": "date-time",
      "type": "string"
    },
    "extension": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "value": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "system": {
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "display": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "communication": {
      "description": "language used to communicate with the patient",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "language": {
            "type": "object",
            "properties": {
              "coding": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "system": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "display": {
                      "type": "string"
                    }
                  }
                }
              },
              "text": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "deceasedBoolean": {
      "type": "boolean",
      "description": "Indicates if the patient is deceased but date of death is not known. Mutually exclusive with 'deceasedDateTime'."
    },
    "deceasedDateTime": {
      "type": "string",
      "format": "date-time",
      "description": "Date and time when the patient died. Only present if patient is deceased and a date of death is known. Mutually exclusive with 'deceasedBoolean'."
    }
  },
  "required": [
    "resourceType",
    "id",
    "active",
    "identifier",
    "telcom",
    "name",
    "address",
    "birthDate",
    "extension",
    "communication"
  ]
}