โ๏ธ Patient Creation โ Field Reference
This endpoint creates new patient records for a single clinic. All validations follow CreatePatientDto constraints.
| Field | Type | Description | Required |
|---|---|---|---|
| x-api-key | String | API Key for authentication | Y |
| clinicId | String | Clinic ID in header overrides route parameter | Y |
| Field | Type | Description | Required |
|---|---|---|---|
| ext_userid | String | Optional unique identifier, this is user_id/username in client systems, will be used in callbacks to send information. | N |
| First Name | String | Letters only โ mandatory | Y |
| Last Name | String | Letters, spaces, hyphens, apostrophes allowed โ mandatory | Y |
| Middle Name | String | optional | N |
| Date of Birth | String | Must follow โYYYY-MM-DDโ โ mandatory | Y |
| Gender | String | โMโ, โFโ, or โOโ (case-insensitive) โ mandatory | Y |
| isSmoker | boolean | Accepts โy/yes/true/n/no/falseโ โ optional | N |
| isPregnant | boolean | Same boolean pattern โ optional | N |
| isDiabetic | boolean | Same boolean pattern โ optional | N |
| heightInInches | Number | If provided needs to be a positive number โ optional | N |
| weightInPounds | Number | If provided needs to be a positive number and below 600 lbs โ optional | N |
| Field | Type | Description | Required |
|---|---|---|---|
| String | Conditional mandatory โ required only if SMS consent is not given. | Y | |
| Phone | String | Must be 10 digits; โ+1โ allowed โ mandatory | Y |
| Field | Type | Description | Required |
|---|---|---|---|
| Address1 | String | Standard special characters are allowed. P O Boxes not allowed โ mandatory | Y |
| Address2 | String | If present standard special characters are allowed โ optional | N |
| City | String | Standard special characters allowed for cities are allowed โ mandatory | Y |
| State | String | US two character state codes are allowed โ mandatory | Y |
| ZipCode | Number | Standard 5 digit zip code is allowed no characters are allowed โ mandatory | Y |
| Field | Type | Description | Required |
|---|---|---|---|
| Driver License # | String | Encouraged to provide as it will be a mandatory field for Controlled Drugs.(future) โ optional | Y |
| Driver License State | String | Required if license # is provided โ valid US state code. | Y/N |
| SSN | String | mandatory if driver license number is not provided; must be valid SSN format โ optional | Y/N |
| Field | Type | Description | Required |
|---|---|---|---|
| authSmsConsent | boolean | Boolean-style (โy/yes/true/n/no/falseโ) โ mandatory | Y |
| smsConsent | boolean | optional | N |
| dataRatesSmsConsent | boolean | Defaults to true โ optional | N |
| Field | Type | Description | Required |
|---|---|---|---|
| riskFactors | JSON | Object includes allergies, medications, conditions. Must follow validation rules โ mandatory | Y |
| allergies | string | Uses โcodeโ:โdescriptionโ format โ mandatory | Y |
| Notice | Details |
|---|---|
| Request Limit | This endpoint allows up to 10 patients per request. |
| Validation | All field-level, boolean, date, and clinic/API checks are applied before processing. Unless otherwise specified objects are required and need to be present. |
| Status Code | Error | Description | Solution |
|---|---|---|---|
| 401 | Authentication failed | Invalid API key or clinicId combination | Correct combination of ClinicId and API key to be provided |
| 400 | Validation failed | First name is required and can only contain letters (A-Z, a-z). No spaces, hyphens, apostrophes, numbers, special, binary, or SQL injection characters allowed. | First name cannot be empty. Provide name satisfying the conditions |
| 400 | Validation failed | Last name is required and can only contain letters (A-Z, a-z). No spaces, hyphens, apostrophes, numbers, special, binary, or SQL injection characters allowed. | Last Name cannot be empty. Provide name satisfying the conditions |
| 400 | Validation failed | Date of Birth is required, must be in YYYY-MM-DD format, year must be after 1900, and age must be 18 or older | DOB should be in proper format. |
| 400 | Validation failed | gender is required and must be one of โMโ, โFโ, or โOโ | Provide proper Gender |
| 400 | Validation failed | email must be a valid, email address and only contain letters, numbers, @, and . (no multiple consecutive dots or more than one @ symbol) | |
| 400 | Validation failed | phone must be 10 digits, optionally prefixed by +1, and contain only numbers | |
| 400 | Validation failed | primaryLanguage must be a supported language code (EN, ES, FR, DE, ZH, HI) | |
| 400 | Validation failed | heightInches must be > 1 and < 210 | |
| 400 | Validation failed | weightPounds must be > 1 and < 600 | |
| 400 | Validation failed | address.address1 isrequired, must not contain โP.O Boxโ, โPO Boxโ, or โPost Office Boxโ, cannot have special, binary, or SQL injection characters, and must not contain script injection | |
| 400 | Validation failed | address.zipCode must be exactly 5 digits or 9 digits in format 12345-1234 | |
| 400 | Validation failed | identity.driverLicenseState is required when driverLicenseNumber is present | |
| 400 | Validation failed | identity must have either driverLicenseNumber or socialSecurityNumber present and not null | |
| 400 | Validation failed | socialSecurityNumber must be in the format NNN-NN-NNNN (9 digits, no letters) | |
| 400 | Bad Request | Invalid allergies format. Expected โCODE:DESCRIPTION | Allergy format should be 00000: None or 00000xxxxx: Description |