> ## 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.

# Cross-Tab Dependencies

> Foreign key relationships and referential integrity between schemas

## Overview

The CoBHRM data model uses referential integrity to link records across schemas. Understanding these dependencies is critical for successful data submission - parent records must exist before child records can be created.

## Dependency Diagram

```mermaid theme={null}
graph TD
    CLI[CLIENT<br/>CLI] --> ADM[ADMISSION<br/>ADM]
    ADM --> DIS[DISCHARGE<br/>DIS]
    ADM --> DXA[DIAGNOSIS<br/>DXA]
    ADM --> SIA[SUBSTANCE USE<br/>SIA]
    ADM --> ACT[ACT<br/>ACT]
    ADM --> ASA[ASCENT ADMISSION<br/>ASA]
    ADM --> BAB[SC BABY<br/>BAB]
    ADM --> PRS[SC PREGNANCY RISK<br/>PRS]
    ADM --> DXD[DIAGNOSIS<br/>DXD]
    ADM --> SID[SUBSTANCE USE<br/>SID]
    ASA --> ASQ[ASCENT QUARTERLY<br/>ASQ]
    ASA --> ASD[ASCENT DISCHARGE<br/>ASD]
```

## Foreign Key Reference

| Child Schema | Parent Schema | Foreign Key Field(s) | Constraint |
| - | - | - | - |
| ADMISSION | CLIENT | `BHASO_CLIENT_IDENTIFIER` | Client must exist |
| DISCHARGE | ADMISSION | `BHASO_ADMISSION_IDENTIFIER` | Admission must exist |
| DIAGNOSIS (DXA) | ADMISSION | `BHASO_ADMISSION_IDENTIFIER` | Admission must exist |
| DIAGNOSIS (DXD) | ADMISSION | `BHASO_ADMISSION_IDENTIFIER` | Admission must exist; filled out at discharge |
| SUBSTANCE USE (SIA) | ADMISSION | `BHASO_ADMISSION_IDENTIFIER` | Admission must exist |
| SUBSTANCE USE (SID) | ADMISSION | `BHASO_ADMISSION_IDENTIFIER` | Admission must exist; filled out at discharge |
| ACT | ADMISSION | `BHASO_ADMISSION_IDENTIFIER` | Admission must exist |
| ASCENT (ASA) | ADMISSION | `BHASO_ADMISSION_IDENTIFIER` | Admission must exist |
| ASCENT (ASQ) | ASCENT (ASA) | `BHASO_ADMISSION_IDENTIFIER` | ASA must exist |
| ASCENT (ASD) | ASCENT (ASA) | `BHASO_ADMISSION_IDENTIFIER` | ASA must exist |
| SC BABY | ADMISSION | `BHASO_ADMISSION_IDENTIFIER` | Admission must exist |
| SC PREGNANCY RISK | ADMISSION | `BHASO_ADMISSION_IDENTIFIER` | Admission must exist |

## Submission Order

Records must be submitted in dependency order:

**1. Level 1: CLIENT**

Submit all CLIENT (CLI) records first

**2. Level 2: ADMISSION**

Submit ADMISSION (ADM) records that reference existing clients

**3. Level 3a: Admission Children**

Submit records that depend only on ADMISSION:

* DIAGNOSIS at Admission (DXA)
* SUBSTANCE USE at Admission (SIA)
* ACT
* ASCENT Admission (ASA)
* SC BABY (BAB)
* SC PREGNANCY RISK (PRS)

**4. Level 3b: DISCHARGE and Discharge Records**

Submit DISCHARGE (DIS) records, plus records filled out at discharge:

* DIAGNOSIS at Discharge (DXD)
* SUBSTANCE USE at Discharge (SID)

**5. Level 4: ASCENT Follow-ups**

Submit ASCENT records that depend on ASA:

* ASCENT Quarterly (ASQ)
* ASCENT Discharge (ASD)

## Key Fields

### BHASO\_CLIENT\_IDENTIFIER

* **Purpose**: Uniquely identifies a client across all records
* **Assigned by**: BHASO (provider organization)
* **Format**: Alphanumeric, no length limit
* **Scope**: Client and Admission schemas only

```csv theme={null}
# All records for the same client use the same identifier
BHASO_CLIENT_IDENTIFIER
CLT-000001
```

### BHASO\_ADMISSION\_IDENTIFIER

* **Purpose**: Uniquely identifies a treatment episode
* **Assigned by**: BHASO (provider organization)
* **Format**: Alphanumeric, no length limit
* **Scope**: ADMISSION and all child schemas

```csv theme={null}
# Admission creates the case identifier
RECORD_TYPE|BHASO_CLIENT_IDENTIFIER|BHASO_ADMISSION_IDENTIFIER
ADM|CLT-000001|CSE-000001

# Child records reference the admission identifier
RECORD_TYPE|BHASO_ADMISSION_IDENTIFIER
DIS|CSE-000001
DXA|CSE-000001
SIA|CSE-000001
```

## Legal Status / Service Identifier Cross-Validation

> [!WARNING]
>
> **Pending update:** Both the Legal Status codes and Service Identifier codes have been renumbered (see their respective Appendix A pages for current values). The cross-validation matrix below still references the **previous** code numbering and is expected to be replaced before April 1, 2026 once the new mapping is finalized at the Co-BHRM meeting.

At discharge, the **Legal Status** must be compatible with the admission's **Service Identifier**. The following matrix shows which legal statuses are allowed with each service category.

### Service Categories

| Category | Service Identifier Codes | Services |
| - | - | - |
| Withdrawal Management (WM) | `01`, `02`, `12` | Ambulatory Medical WM, Residential WM, Medically Managed Inpatient WM |
| SUD Services | `03`, `04`, `05`, `06`, `07`, `08`, `09`, `10`, `11` | TC, IRT, TRT, OTP, Outpatient, STIRT, IOP, Day Treatment, Medically Managed Inpatient |
| Mental Health Services | `17`, `18`, `19`, `20`, `21`, `22` | MH Outpatient, MH Residential, MH Inpatient, Crisis Stabilization, Crisis Respite, Psychiatric Hospitalization |

### Legal Status Restrictions

| Legal Status | Code | Allowed Service Categories |
| - | - | - |
| Voluntary | `01` | All (no restriction) |
| Court-directed voluntary | `02` | Mental Health only (`17`-`22`) |
| Forensic | `03` | Mental Health only (`17`-`22`) |
| 72-hour evaluation and treatment | `04` | Mental Health only (`17`-`22`) |
| Short-term certification | `05` | Mental Health only (`17`-`22`) |
| Long-term certification | `06` | Mental Health only (`17`-`22`) |
| Children's Code C.R.S. 19-1-101 | `07` | Mental Health only (`17`-`22`) |
| Involuntary Alcohol/Drug Commitment | `08` | SUD only (`03`-`11`) |
| Conditional Release | `09` | Mental Health only (`17`-`22`) |
| DYS Commitment | `10` | Mental Health only (`17`-`22`) |
| DYS Detention | `11` | Mental Health only (`17`-`22`) |
| DOC/Community Parole | `12` | Mental Health only (`17`-`22`) |
| Emergency Commitment | `13` | Withdrawal Management only (`01`, `02`, `12`) |

> [!WARNING]
>
> Submitting a discharge with a Legal Status that does not match the admission's Service Identifier category will produce a cross-field validation error (`XFD-004`).

## Cardinality Rules

| Parent | Child | Cardinality | Notes |
| - | - | - | - |
| CLIENT | ADMISSION | 1:M | Multiple treatment episodes allowed |
| ADMISSION | DISCHARGE | 1:0..1 | One discharge per admission (none while active) |
| ADMISSION | DIAGNOSIS (DXA) | 1:1 | One diagnosis record per admission (supports up to 3 MH + 1 SUD ICD codes within the record) |
| DISCHARGE | DIAGNOSIS (DXD) | 1:1 | One diagnosis record per discharge (supports up to 3 MH + 1 SUD ICD codes within the record) |
| ADMISSION | SUBSTANCE USE (SIA) | 1:0..1 | Required for SUD admissions; omitted for MH-only |
| DISCHARGE | SUBSTANCE USE (SID) | 1:0..1 | Required for SUD discharges; omitted for MH-only |
| ADMISSION | ACT | 1:0..M | Monthly records; multiple if episode > 30 days |
| ADMISSION | ASCENT (ASA) | 1:0..1 | One Ascent admission per treatment episode (only if enrolled) |
| ASA | ASCENT (ASQ) | 1:0..M | Quarterly assessments; multiple if episode > 90 days |
| ASA | ASCENT (ASD) | 1:0..1 | One Ascent discharge |
| ADMISSION | SC BABY | 1:0..M | Multiple babies (twins, etc.) |
| ADMISSION | SC PREGNANCY RISK | 1:0..1 | One pregnancy risk screening per admission |


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