{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/hint-health/main/json-schema/hint-health-provider-patients-controller-update-body-schema.json",
  "title": "Create_Patient",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hint-health-patient-api-openapi.yml#/components/schemas/Provider.PatientsController.update_body",
  "type": "object",
  "properties": {
    "first_name": {
      "type": "string",
      "description": "This should be the patients legal first name."
    },
    "last_name": {
      "type": "string",
      "description": "This should be the patients legal last name."
    },
    "middle_name": {
      "type": "string",
      "description": "This should be the patients legal middle name."
    },
    "title": {
      "type": "string"
    },
    "suffix": {
      "type": "string"
    },
    "chosen_first_name": {
      "type": "string"
    },
    "chosen_last_name": {
      "type": "string"
    },
    "chosen_middle_name": {
      "type": "string"
    },
    "chosen_title": {
      "type": "string"
    },
    "chosen_suffix": {
      "type": "string"
    },
    "pronouns": {
      "type": "string",
      "description": "May be one of `He/Him/His`, `She/Her/Hers` or `They/Them/Theirs`. Other values sent will be stored as free text."
    },
    "email": {
      "type": "string"
    },
    "sex": {
      "type": "string",
      "description": "May send `male`, `female`, or `intersex`."
    },
    "gender": {
      "type": "string",
      "description": "This field will be deprecated on March 31st 2021."
    },
    "gender_identity": {
      "type": "string",
      "description": "May send `man`, `woman`, `trans man`, `trans woman`, `nonbinary`, or `not listed`. If you send `not listed`, please include a description in the `gender_other` field."
    },
    "gender_other": {
      "type": "string",
      "description": "Used to specify gender identity, when not listed."
    },
    "dob": {
      "type": "string",
      "format": "date",
      "description": "Date must be formatted as YYYY-MM-DD."
    },
    "lead_source": {
      "$ref": "#/$defs/Association"
    },
    "practitioner": {
      "$ref": "#/$defs/Association"
    },
    "location": {
      "$ref": "#/$defs/Association"
    },
    "emergency_contact": {
      "$ref": "#/$defs/EmergencyContact"
    },
    "phones": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PhoneNumber"
      }
    },
    "ssn": {
      "$ref": "#/$defs/SocialSecurityNumber"
    },
    "health_insurance_group_id": {
      "type": "string"
    },
    "health_insurance_member_id": {
      "type": "string"
    },
    "health_insurance_payer_name": {
      "type": "string"
    },
    "health_insurance_payer_id": {
      "type": "string"
    },
    "address_line1": {
      "type": "string"
    },
    "address_line2": {
      "type": "string"
    },
    "address_city": {
      "type": "string"
    },
    "address_state": {
      "type": "string"
    },
    "address_zip": {
      "type": "string"
    },
    "address_country": {
      "type": "string"
    },
    "import_id": {
      "type": "string",
      "description": "(deprecated)"
    },
    "import_source": {
      "type": "string",
      "description": "(deprecated)"
    },
    "external_link_id": {
      "type": "string",
      "description": "(deprecated)"
    },
    "integration_record_id": {
      "type": "string"
    },
    "integration_error_message": {
      "type": "string"
    },
    "integration_web_link": {
      "type": "string"
    },
    "last_engagement_date": {
      "type": "string",
      "format": "date",
      "description": "Date must be formatted as YYYY-MM-DD."
    },
    "electronic_communication_consent_accepted": {
      "type": "boolean"
    },
    "patient_agreement_accepted": {
      "type": "boolean"
    }
  },
  "required": [
    "first_name",
    "last_name"
  ],
  "$defs": {
    "Association": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "required": [
        "id"
      ]
    },
    "EmergencyContact": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "relationship": {
          "type": "string",
          "enum": [
            "spouse",
            "parent",
            "sibling",
            "child",
            "grandparent",
            "guardian",
            "other"
          ]
        },
        "relationship_other": {
          "type": "string"
        },
        "phone": {
          "type": "object",
          "properties": {
            "number": {
              "type": "number"
            },
            "type": {
              "type": "string"
            },
            "us_formattable": {
              "type": "boolean",
              "description": "Make this false if your number is not exactly 10 digits"
            }
          },
          "required": [
            "number",
            "type"
          ]
        }
      }
    },
    "PhoneNumber": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "number": {
          "type": "number"
        },
        "type": {
          "type": "string"
        },
        "us_formattable": {
          "type": "boolean",
          "description": "Make this false if your number is not exactly 10 digits"
        }
      },
      "required": [
        "number",
        "type"
      ]
    },
    "SocialSecurityNumber": {
      "title": "Create_SSN",
      "type": "object",
      "properties": {
        "number": {
          "type": "string"
        }
      }
    }
  }
}