Adds the second pricer to the reconciliation engine (rec was open/closed
with only PfsPricer). OppsPricer validates that our OPPS conversion
factor reproduces CMS's published Addendum B national unadjusted rate:
ground truth = opps.addendum_b.payment_rate (published, rate > 0)
calculated = relative_weight × RULES[year].conversion_factor
(APC-priced rows, weight > 0)
Rows with a weight but no published rate (packaged, SI N) surface as
calculated_only; a published rate with no weight (non-APC method) as
ground_truth_only — mirroring how PfsPricer treats carrier-priced codes.
Wage-index adjustment is intentionally out of scope: Addendum B is the
national unadjusted rate, so the check is weight × CF only.
Also:
- stack rec opps CLI subcommand (mirrors rec pfs).
- Pricer-aware "no years available" hint (was hardcoded to PFS tables).
100% coverage on the new module, CLI paths, and registry.
Note: running this against loaded Addendum B data surfaces a systematic
CF drift in opps.rules for CY2021-CY2026 (stored CFs differ from the
empirical payment_rate/weight, which matches the real published CMS
values). Tracked for a follow-up fix — the pricer is doing its job.
24 lines
552 B
Python
24 lines
552 B
Python
"""Exercise cli/rec.py."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typer.testing import CliRunner
|
|
|
|
from cli.rec import app
|
|
|
|
runner = CliRunner()
|
|
|
|
|
|
class TestAllHelp:
|
|
def test_help(self):
|
|
assert runner.invoke(app, ["--help"]).exit_code == 0
|
|
|
|
def test_list_help(self):
|
|
assert runner.invoke(app, ["list", "--help"]).exit_code == 0
|
|
|
|
def test_pfs_help(self):
|
|
assert runner.invoke(app, ["pfs", "--help"]).exit_code == 0
|
|
|
|
def test_opps_help(self):
|
|
assert runner.invoke(app, ["opps", "--help"]).exit_code == 0
|