# H11.0-P7 — Specialty Net Revenue Dispatcher Alias Contract Correction

## Exact dispatcher identity

Two historical dispatcher keys call the same function:

- `special_net_rev` → `get_net_rev`
- `net_rev` → `get_net_rev`

This is an alias contract, not two different SQL implementations.

## Exact historical function body

The recovered `get_net_rev` function:

- selects from `KPI_DOCTOR_PERF_DETAIL_JOB`
- filters by `YEARID = selected year`
- calculates `SUM(DISTINCT NET_REV_AFTER_DRUG_MOH)`
- groups by:
  - `SPECIAL_SPEC_ID`
  - `SPECIAL_SPEC_EN_NAME`
- keeps only values greater than `50000`
- orders descending by the calculated metric

The historical function returns a ranked specialty dataset.

## Contract correction

The older Phase 10.15 reconstruction treated `net_rev` as an annual scalar total.
That scalar KPI may remain useful for dashboard summary purposes, but it is not
the exact historical `get_net_rev` contract and is therefore removed from
historical parity counting.

H11.0-P7 introduces:

- exact current ranked-specialty implementation
- independent exact historical SQL path
- exact identity/value comparison
- two-alias promotion only after live zero-difference proof

## Live acceptance

- READY branches: NJCH and MNH
- Deferred branch: JCKH
- Years: selected year + comparison year
- Dataset checks: 4
- Dispatcher aliases: 2
- Alias contract checks: 8
- Identity mismatches: 0
- Maximum difference: 0
- Oracle writes: NONE

## Legacy progress after full PASS

- Known: 31
- MATCHED: 23
- PARTIAL: 6
- MISSING: 2
- MATCHED percentage: 74.2%
