healthcare: two-tier (standard paper / expedited surrogate) filing model

- Verified Standard(no-login)/Expedited(surrogate) matrix from official CMS-855
  PDFs (docs/healthcare-filing-tiers-verified.md): reactivation+revalidation are
  855I paper-to-MAC reasons, original-signature, routed by state; sig may not be
  delegated; 855B needs PECOS app fee.
- Add scripts/workers/mac_routing.py: state->MAC routing (all 56 jurisdictions,
  12 destinations) for envelope addressing + daily batch grouping. Addresses
  marked VERIFY before live mail.
- npi_provider.py: fix access strings to two-tier framing; NPPES update/reactivation
  no longer 'online-only'; note 855B fee.
- checkout.ts + service pages: strip client-facing mechanics & the paper-vs-tier
  choice; surrogate is the only optional, positively-framed ask (faster, never
  required, never share password).
This commit is contained in:
justin 2026-06-07 00:24:56 -05:00
parent 74c1259c9a
commit 258d23bdc6
7 changed files with 417 additions and 289 deletions

View file

@ -0,0 +1,118 @@
"""State -> Medicare Administrative Contractor (MAC) routing for CMS-855 mailing.
CMS-855 paper applications are mailed to the provider's *designated MAC*, which is
determined by the provider's STATE/jurisdiction (per the official 855I/855B/855O
instructions: "The MAC that services your State is responsible for processing your
enrollment application").
This module maps each US state/territory -> its A/B MAC name + provider-enrollment
mailing address. It is used to:
1. Address the outgoing envelope for the Standard (paper) filing path.
2. Group the daily batched mailing by destination agency (one Priority Mail
envelope per MAC address).
IMPORTANT verify before first live mail run: MAC jurisdiction assignments and
(especially) the provider-enrollment PO Box addresses change when CMS re-competes
a jurisdiction. Confirm each MAC's current enrollment mailing address against the
MAC's website / CMS.gov/Medicare/Provider-Enrollment-and-Certification right
before the first batch, then keep this table the single source of truth.
Jurisdiction assignments below reflect the long-standing A/B MAC map. Addresses
are marked TODO where they must be filled from the MAC's current enrollment page.
"""
from __future__ import annotations
from dataclasses import dataclass
@dataclass(frozen=True)
class MAC:
key: str # short stable id (used for batch grouping)
name: str # MAC contractor + jurisdiction
# Provider-enrollment mailing address lines. VERIFY before live use.
address_lines: tuple[str, ...]
# A/B MAC jurisdictions (long-standing assignments). Addresses TODO-verify.
NORIDIAN_JE = MAC("noridian_je", "Noridian Healthcare Solutions — Jurisdiction E",
("Noridian Healthcare Solutions", "Provider Enrollment (JE)",
"P.O. Box — VERIFY", "Fargo, ND — VERIFY"))
NORIDIAN_JF = MAC("noridian_jf", "Noridian Healthcare Solutions — Jurisdiction F",
("Noridian Healthcare Solutions", "Provider Enrollment (JF)",
"P.O. Box — VERIFY", "Fargo, ND — VERIFY"))
NOVITAS_JH = MAC("novitas_jh", "Novitas Solutions — Jurisdiction H",
("Novitas Solutions", "Provider Enrollment (JH)",
"P.O. Box — VERIFY", "Mechanicsburg, PA — VERIFY"))
NOVITAS_JL = MAC("novitas_jl", "Novitas Solutions — Jurisdiction L",
("Novitas Solutions", "Provider Enrollment (JL)",
"P.O. Box — VERIFY", "Mechanicsburg, PA — VERIFY"))
FCSO_JN = MAC("fcso_jn", "First Coast Service Options — Jurisdiction N",
("First Coast Service Options", "Provider Enrollment (JN)",
"P.O. Box — VERIFY", "Jacksonville, FL — VERIFY"))
PALMETTO_JJ = MAC("palmetto_jj", "Palmetto GBA — Jurisdiction J",
("Palmetto GBA", "Provider Enrollment (JJ)",
"P.O. Box — VERIFY", "Columbia, SC — VERIFY"))
PALMETTO_JM = MAC("palmetto_jm", "Palmetto GBA — Jurisdiction M",
("Palmetto GBA", "Provider Enrollment (JM)",
"P.O. Box — VERIFY", "Columbia, SC — VERIFY"))
CGS_J15 = MAC("cgs_j15", "CGS Administrators — Jurisdiction 15",
("CGS Administrators", "Provider Enrollment (J15)",
"P.O. Box — VERIFY", "Nashville, TN — VERIFY"))
WPS_J5 = MAC("wps_j5", "WPS Government Health Administrators — Jurisdiction 5",
("WPS GHA", "Provider Enrollment (J5)",
"P.O. Box — VERIFY", "Madison, WI — VERIFY"))
WPS_J8 = MAC("wps_j8", "WPS Government Health Administrators — Jurisdiction 8",
("WPS GHA", "Provider Enrollment (J8)",
"P.O. Box — VERIFY", "Madison, WI — VERIFY"))
NGS_J6 = MAC("ngs_j6", "National Government Services — Jurisdiction 6",
("National Government Services", "Provider Enrollment (J6)",
"P.O. Box — VERIFY", "VERIFY"))
NGS_JK = MAC("ngs_jk", "National Government Services — Jurisdiction K",
("National Government Services", "Provider Enrollment (JK)",
"P.O. Box — VERIFY", "VERIFY"))
# State (USPS) -> MAC. Based on the established A/B MAC jurisdiction map.
STATE_TO_MAC: dict[str, MAC] = {
# Noridian JE
"CA": NORIDIAN_JE, "HI": NORIDIAN_JE, "NV": NORIDIAN_JE,
"AS": NORIDIAN_JE, "GU": NORIDIAN_JE, "MP": NORIDIAN_JE,
# Noridian JF
"AK": NORIDIAN_JF, "AZ": NORIDIAN_JF, "ID": NORIDIAN_JF, "MT": NORIDIAN_JF,
"ND": NORIDIAN_JF, "OR": NORIDIAN_JF, "SD": NORIDIAN_JF, "UT": NORIDIAN_JF,
"WA": NORIDIAN_JF, "WY": NORIDIAN_JF,
# Novitas JH
"AR": NOVITAS_JH, "CO": NOVITAS_JH, "LA": NOVITAS_JH, "MS": NOVITAS_JH,
"NM": NOVITAS_JH, "OK": NOVITAS_JH, "TX": NOVITAS_JH,
# Novitas JL
"DE": NOVITAS_JL, "DC": NOVITAS_JL, "MD": NOVITAS_JL, "NJ": NOVITAS_JL,
"PA": NOVITAS_JL,
# First Coast JN
"FL": FCSO_JN, "PR": FCSO_JN, "VI": FCSO_JN,
# Palmetto JJ
"AL": PALMETTO_JJ, "GA": PALMETTO_JJ, "TN": PALMETTO_JJ,
# Palmetto JM
"NC": PALMETTO_JM, "SC": PALMETTO_JM, "VA": PALMETTO_JM, "WV": PALMETTO_JM,
# CGS J15
"KY": CGS_J15, "OH": CGS_J15,
# WPS J5
"IA": WPS_J5, "KS": WPS_J5, "MO": WPS_J5, "NE": WPS_J5,
# WPS J8
"IN": WPS_J8, "MI": WPS_J8,
# NGS J6
"IL": NGS_J6, "MN": NGS_J6, "WI": NGS_J6,
# NGS JK
"CT": NGS_JK, "ME": NGS_JK, "MA": NGS_JK, "NH": NGS_JK,
"NY": NGS_JK, "RI": NGS_JK, "VT": NGS_JK,
}
# NPI Enumerator paper address (NPPES / CMS-10114 paper path) — not a MAC, but a
# destination the daily batch groups by, same as a MAC.
NPI_ENUMERATOR = MAC(
"npi_enumerator", "NPI Enumerator (NPPES / CMS-10114 paper)",
("NPI Enumerator", "P.O. Box 6059", "Fargo, ND 58108-6059"),
)
def mac_for_state(state: str) -> MAC | None:
"""Return the designated MAC for a USPS state code, or None if unknown."""
return STATE_TO_MAC.get((state or "").strip().upper())