# H11.0-P3 — ACTY Legacy Source Contract

## Legacy dispatcher key
`acty`

## Legacy function
`get_admission_category_type`

## Source status
`FULL_HISTORICAL_FUNCTION_BODY_RECOVERED`

The complete body has been recovered from the user's previously supplied legacy
dispatcher source.

## Exact business contract
The function counts inpatient admissions by payer category:

- `CAT_TYPE = 1` → Cash
- `CAT_TYPE = 2` → Credit
- `CAT_TYPE = 3` → Insurance

Oracle sources:

- `RCP_VISIT`
- `REG_COMP_CATEGORY`
- `STP_PATCAT_TYPE`

Join contract:

- `RCP_VISIT.HOSP_ID = REG_COMP_CATEGORY.HOSP_ID`
- `RCP_VISIT.FINANCLASSID = REG_COMP_CATEGORY.FINANCLASSID`
- `RCP_VISIT.PATCATID = REG_COMP_CATEGORY.PATCATID`
- `RCP_VISIT.MAIN_PATCATID = REG_COMP_CATEGORY.MAIN_PATCATID`
- `REG_COMP_CATEGORY.PAT_CAT_TYPE = STP_PATCAT_TYPE.CAT_TYPE_ID (+)`

Admission contract:

- `RCP_VISIT.HOSP_ID IN (1)`
- `RCP_VISIT.CLASSCODE = 1`

Period modes:

- Year: `EXTRACT(YEAR FROM RCP_VISIT.VISIT_START_DATE)`
- Date range: inclusive selected calendar-day range

## Implementation policy
The current implementation uses bind parameters and ANSI joins. The independent
legacy path preserves the recovered old-style Oracle join shape. The two paths
must return zero difference in both year and date-range modes.

## Oracle writes
`NONE`
