> ## Documentation Index
> Fetch the complete documentation index at: https://coloradobehavioralhealthadministration.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# File Format Requirements

> CSV parsing rules, encoding standards, and formatting specifications

## File Format Specification

All data files must be submitted in CSV format using pipe (`|`) delimiters, following these specifications:

| Property | Value | Notes |
| - | - | - |
| **File Extension** | `.csv` | Required |
| **Encoding** | UTF-8 | Required |
| **Line Endings** | CRLF or LF | Both accepted |
| **Header Row** | Required | First row must contain column names |

## Delimiter and Quoting

| Property | Value | Notes |
| - | - | - |
| **Field Delimiter** | Pipe (`\|`) | ASCII 124 |
| **Quote Character** | Double quote (`"`) | Use when field contains pipe, newline, or quote |
| **Escape Character** | Backslash (`\`) | Use backslash to escape special characters within quoted fields |
| **Multi-value Delimiter** | Semicolon + space (`; `) | Used for Race, Disabilities, and other multi-value fields |

### Quoting Examples

```csv theme={null}
# Field with pipe - must be quoted
"Smith, Jr."|John|1990-05-15

# Field with quote - escape with backslash
"O\'Brien"|Mary|1985-03-20

# Field with newline - must be quoted
"123 Main St
Apt 4B"|Denver|80202
```

## Data Types

### Text Fields

| Format Code | Description | Example |
| - | - | - |
| `x(n)` | Fixed/variable text up to n characters | `x(50)` = up to 50 characters |

### Date and Time Formats

| Format | Pattern | Example | Notes |
| - | - | - | - |
| Date | `YYYY-MM-DD` | `2024-01-15` | ISO 8601 format |
| Timestamp | `YYYY-MM-DD HH24:MI:SS.FF` | `2024-01-15 14:30:00.00` | 24-hour format, Mountain Time, with fractional seconds |

> [!NOTE]
>
> All timestamps are interpreted as Mountain Time (MT). Do not include timezone offsets.

### Numeric Formats

| Format | Description | Example |
| - | - | - |
| `9(n)` | Integer up to n digits | `9(5)` = 0-99999 |

### Boolean Values

Boolean fields use the `bit` data type and accept strictly:

| Value | Meaning |
| - | - |
| `1` | True / Yes |
| `0` | False / No |

> [!WARNING]
>
> Only `1` and `0` are accepted for boolean (bit) fields. Do **not** use `Y`, `N`, `YES`, `NO`, `TRUE`, or `FALSE`.

## Null and Empty Values

| Representation | Interpretation |
| - | - |
| Empty field (`\|\|`) | NULL / not provided |
| Whitespace only (`\| \|`) | NULL (trimmed to empty) |
| `NULL` (literal text) | Treated as the string "NULL", not as null |

### Example

```csv theme={null}
RECORD_TYPE|TRANSACTION_TYPE|CLIENT_ID|MIDDLE_NAME|SUFFIX
CLI|A|CLT-001||Jr.
CLI|A|CLT-002|James|
```

In this example:

* Row 1: `MIDDLE_NAME` is null, `SUFFIX` is "Jr."
* Row 2: `MIDDLE_NAME` is "James", `SUFFIX` is null

## Column Order

> [!WARNING]
>
> Column order **must be maintained exactly** as defined in each schema specification. All headers must be present and correctly spelled.

### Required Headers

Each schema specifies required headers.

## File Size Limits

| Limit | Value |
| - | - |
| Maximum file size | 100 MB |
| Maximum rows per file | 1,000,000 |

> [!TIP]
>
> For large data sets, split files by record type and submit separately. Each file should contain only one record type.

> [!NOTE]
>
> **Recommendation** — This section contains guidance developed by the documentation team to supplement the CoBHRM specification. Reviewers should evaluate whether to adopt, modify, or remove this content.

## Validation Sequence

Files are processed in this order:

**1. File Format Validation**

Verify CSV structure, encoding, and header presence

**2. Header Validation**

Check that all required headers are present and correctly named

**3. Row-Level Validation**

Validate each row against schema rules (data types, required fields, code values)

**4. Cross-Field Validation**

Check conditional requirements and field relationships

**5. Referential Validation**

Verify foreign key relationships to parent records

> [!NOTE]
>
> **Recommendation** — This section contains guidance developed by the documentation team to supplement the CoBHRM specification. Reviewers should evaluate whether to adopt, modify, or remove this content.

## Common Format Errors

| Error | Cause | Resolution |
| - | - | - |
| Invalid encoding | File not saved as UTF-8 | Re-save file with UTF-8 encoding |
| Missing header row | File does not start with a header row | Add a header row with all column names |
| Missing column | Required column not in header row | Add missing column to the header and data rows |
| Unescaped quote, pipe, or special character | Quote character inside unquoted field | Quote the entire field and escape internal quotes |
| Invalid date | Date not in YYYY-MM-DD format | Reformat dates to ISO 8601 |
| Trailing delimiter | Extra pipe at end of row | Remove trailing pipe |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.