{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rethink-behavioral-health/json-schema/rethink-behavioral-health-client-schema.json",
  "title": "Client",
  "x-generated": "2026-11-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rethink-behavioral-health-openapi.json#/components/schemas/Client",
  "required": [
    "dateOfBirth",
    "firstName",
    "genderId",
    "lastName",
    "locationId",
    "serviceIntensityId",
    "statusId"
  ],
  "type": "object",
  "properties": {
    "clientId": {
      "type": "integer",
      "format": "int32"
    },
    "firstName": {
      "maxLength": 100,
      "minLength": 0,
      "type": "string"
    },
    "middleName": {
      "maxLength": 100,
      "minLength": 0,
      "type": [
        "string",
        "null"
      ]
    },
    "lastName": {
      "maxLength": 100,
      "minLength": 0,
      "type": "string"
    },
    "dateOfBirth": {
      "maxLength": 10,
      "minLength": 0,
      "type": "string"
    },
    "genderId": {
      "maximum": 3,
      "minimum": 1,
      "type": "integer",
      "format": "int32"
    },
    "addressStreet": {
      "maxLength": 100,
      "minLength": 0,
      "type": [
        "string",
        "null"
      ]
    },
    "city": {
      "maxLength": 100,
      "minLength": 0,
      "type": [
        "string",
        "null"
      ]
    },
    "stateId": {
      "maximum": 52,
      "minimum": 1,
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "zipCode": {
      "maxLength": 9,
      "minLength": 0,
      "type": [
        "string",
        "null"
      ]
    },
    "clientExternalID": {
      "maxLength": 20,
      "minLength": 0,
      "type": [
        "string",
        "null"
      ]
    },
    "uniqueClientIdentifierNumber": {
      "maxLength": 20,
      "minLength": 0,
      "type": [
        "string",
        "null"
      ]
    },
    "clientOrder": {
      "maximum": 2147483647,
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    },
    "reasonForReferral": {
      "maxLength": 200,
      "minLength": 0,
      "type": [
        "string",
        "null"
      ]
    },
    "noticeOfPrivacyPracticeDate": {
      "type": [
        "string",
        "null"
      ]
    },
    "locationId": {
      "type": "integer",
      "format": "int32"
    },
    "statusId": {
      "type": "integer",
      "format": "int32"
    },
    "serviceIntensityId": {
      "maximum": 2,
      "minimum": 1,
      "type": "integer",
      "format": "int32"
    },
    "notes": {
      "maxLength": 500,
      "minLength": 0,
      "type": [
        "string",
        "null"
      ]
    },
    "stateAbbreviation": {
      "type": [
        "string",
        "null"
      ]
    },
    "dateCreated": {
      "type": "string",
      "format": "date-time"
    },
    "dateLastModified": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "dateDeleted": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "clientFunders": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ClientFunder"
      }
    },
    "clientAuthorizations": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ClientAuthorization"
      }
    },
    "clientAvailabilities": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ClientAvailability"
      }
    },
    "clientNotes": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/ClientNote"
      }
    },
    "responseStatus": {
      "$ref": "#/$defs/ResponseStatus"
    },
    "enrollmentNumber": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "additionalProperties": false,
  "$defs": {
    "AuthDiagnosis": {
      "required": [
        "diagnosisCode"
      ],
      "type": "object",
      "properties": {
        "diagnosisCode": {
          "maxLength": 10,
          "minLength": 1,
          "type": "string"
        },
        "diagnosisTypeId": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        }
      },
      "additionalProperties": false
    },
    "AuthorizationDistributionTypes": {
      "enum": [
        1,
        2
      ],
      "type": "integer",
      "format": "int32"
    },
    "ClientAuthorization": {
      "required": [
        "authEndDate",
        "authorizationNumber",
        "authorizationReceived",
        "authStartDate",
        "diagnosis",
        "funderId",
        "renderingProviderTypeId",
        "serviceLineId"
      ],
      "type": "object",
      "properties": {
        "authorizationId": {
          "type": "integer",
          "format": "int32"
        },
        "authorizationReceived": {
          "maximum": 3,
          "minimum": 1,
          "type": "integer",
          "format": "int32"
        },
        "funderId": {
          "type": "integer",
          "format": "int32"
        },
        "serviceLineId": {
          "type": "integer",
          "format": "int32"
        },
        "authStartDate": {
          "minLength": 1,
          "type": "string"
        },
        "authEndDate": {
          "minLength": 1,
          "type": "string"
        },
        "authorizationNumber": {
          "maxLength": 100,
          "minLength": 0,
          "type": "string"
        },
        "diagnosis": {
          "$ref": "#/$defs/AuthDiagnosis"
        },
        "renderingProviderTypeId": {
          "maximum": 3,
          "minimum": 1,
          "type": "integer",
          "format": "int32"
        },
        "renderingProviderStaffId": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "totalNumberOfUnits": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "childProfileReferringProviderId": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "distributionTypeId": {
          "$ref": "#/$defs/AuthorizationDistributionTypes"
        },
        "authorizationServices": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/ClientBillingCode"
          }
        },
        "responseStatus": {
          "$ref": "#/$defs/ResponseStatus"
        }
      },
      "additionalProperties": false
    },
    "ClientAvailability": {
      "required": [
        "dayId",
        "endTime",
        "startTime"
      ],
      "type": "object",
      "properties": {
        "clientAvailabilityId": {
          "type": "integer",
          "format": "int32"
        },
        "dayId": {
          "maximum": 6,
          "minimum": 0,
          "type": "integer",
          "format": "int32"
        },
        "startTime": {
          "minLength": 1,
          "type": "string"
        },
        "endTime": {
          "minLength": 1,
          "type": "string"
        },
        "responseStatus": {
          "$ref": "#/$defs/ResponseStatus"
        }
      },
      "additionalProperties": false
    },
    "ClientBillingCode": {
      "required": [
        "authorizedFrequency",
        "authorizedUnits",
        "billingCodeId"
      ],
      "type": "object",
      "properties": {
        "authorizationBillingCodeId": {
          "type": "integer",
          "format": "int32"
        },
        "billingCodeId": {
          "type": "integer",
          "format": "int32"
        },
        "authorizedUnits": {
          "maximum": 2147483647,
          "minimum": 1,
          "type": "integer",
          "format": "int32"
        },
        "authorizedFrequency": {
          "maximum": 4,
          "minimum": 1,
          "type": "integer",
          "format": "int32"
        },
        "deletedAuthorizationBillingCodeId": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "responseStatus": {
          "$ref": "#/$defs/ResponseStatus"
        }
      },
      "additionalProperties": false
    },
    "ClientFunder": {
      "required": [
        "authPaymentId",
        "authReleaseId",
        "funderId",
        "insuredGenderId",
        "insuredId",
        "relationshipId",
        "serviceLineIds"
      ],
      "type": "object",
      "properties": {
        "clientFunderId": {
          "type": "integer",
          "format": "int32"
        },
        "funderSequence": {
          "maximum": 3,
          "minimum": 1,
          "type": "integer",
          "format": "int32"
        },
        "funderId": {
          "type": "integer",
          "format": "int32"
        },
        "caseManagerId": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "clientMedicalRecordNumber": {
          "maxLength": 15,
          "minLength": 0,
          "type": [
            "string",
            "null"
          ]
        },
        "relationshipId": {
          "maximum": 2,
          "minimum": 1,
          "type": "integer",
          "format": "int32"
        },
        "serviceLineIds": {
          "minItems": 1,
          "type": "array",
          "items": {
            "type": "integer",
            "format": "int32"
          }
        },
        "insuredFirstName": {
          "maxLength": 100,
          "minLength": 0,
          "type": [
            "string",
            "null"
          ]
        },
        "insuredLastName": {
          "maxLength": 100,
          "minLength": 0,
          "type": [
            "string",
            "null"
          ]
        },
        "insuredAddressLine1": {
          "maxLength": 500,
          "minLength": 0,
          "type": [
            "string",
            "null"
          ]
        },
        "insuredCity": {
          "maxLength": 100,
          "minLength": 0,
          "type": [
            "string",
            "null"
          ]
        },
        "insuredStateId": {
          "maximum": 52,
          "minimum": 1,
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "insuredZip": {
          "maxLength": 9,
          "minLength": 0,
          "type": [
            "string",
            "null"
          ]
        },
        "insuredPhone": {
          "maxLength": 13,
          "minLength": 0,
          "type": [
            "string",
            "null"
          ]
        },
        "insuredEmail": {
          "maxLength": 50,
          "minLength": 0,
          "type": [
            "string",
            "null"
          ],
          "format": "email"
        },
        "insuredDob": {
          "type": [
            "string",
            "null"
          ]
        },
        "insuredGenderId": {
          "maximum": 3,
          "minimum": 1,
          "type": "integer",
          "format": "int32"
        },
        "insuredMaritalStatusId": {
          "maximum": 3,
          "minimum": 1,
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "insuredId": {
          "maxLength": 20,
          "minLength": 0,
          "type": "string"
        },
        "policyStartDate": {
          "type": [
            "string",
            "null"
          ]
        },
        "policyEndDate": {
          "type": [
            "string",
            "null"
          ]
        },
        "policyGroup": {
          "maxLength": 100,
          "minLength": 0,
          "type": [
            "string",
            "null"
          ]
        },
        "planId": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "authReleaseId": {
          "maximum": 2,
          "minimum": 1,
          "type": "integer",
          "format": "int32"
        },
        "authPaymentId": {
          "maximum": 2,
          "minimum": 1,
          "type": "integer",
          "format": "int32"
        },
        "authReleaseDate": {
          "type": [
            "string",
            "null"
          ]
        },
        "responseStatus": {
          "$ref": "#/$defs/ResponseStatus"
        }
      },
      "additionalProperties": false
    },
    "ClientNote": {
      "required": [
        "notes",
        "noteTitle",
        "noteTypeId"
      ],
      "type": "object",
      "properties": {
        "noteId": {
          "type": "integer",
          "format": "int32"
        },
        "private": {
          "type": "boolean"
        },
        "noteTypeId": {
          "type": "integer",
          "format": "int32"
        },
        "noteTitle": {
          "maxLength": 250,
          "minLength": 0,
          "type": "string"
        },
        "notes": {
          "maxLength": 1000,
          "minLength": 0,
          "type": "string"
        },
        "responseStatus": {
          "$ref": "#/$defs/ResponseStatus"
        }
      },
      "additionalProperties": false
    },
    "ResponseStatus": {
      "type": "object",
      "properties": {
        "status": {
          "type": [
            "string",
            "null"
          ]
        },
        "messages": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    }
  }
}