new-site/scripts/workers/mac_routing.py
justin e6a630ada1 healthcare: verify CMS-10114 update path, correct NPI Enumerator address, build CMS-10114 filler
Verified firsthand against the live CMS-10114 (Rev. 02/25, OMB 0938-0931):
- Section 1A confirms paper is valid for Change of Information (#2) AND
  Reactivation (#4), not just initial enumeration. Resolves the UNCERTAIN flag.
- Current mailing address is CMS NPI Enumerator Services, Mail Stop DO-01-51,
  7500 Security Blvd, Baltimore MD 21244. The old Fargo PO Box 6059 is retired;
  corrected in mac_routing.NPI_ENUMERATOR + all docs.
- No electronic no-login equivalent exists for CMS (NPI Registry API is
  read-only; PECOS/NPPES-IA require login), unlike FMCSA's ask.fmcsa ticket form.
  So tiers stay: Standard=paper CMS-10114 (no login), Expedited=NPPES surrogate.

New: cms10114_pdf_filler.py fills the flat official form via text overlay
(reason checkbox + NPI + Section 2A identity + Section 4A cert name + signature
anchor); wired into npi_provider._generate_10114_for_signing for nppes-update.
Signed forms route to the NPI Enumerator via the existing daily batch.

Tests: test_cms10114.py 27/27, test_paper_batch.py 15/15, Astro build 58 pages.
2026-06-07 02:04:41 -05:00

122 lines
6.1 KiB
Python

"""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.
# VERIFIED 2025 against CMS-10114 (Rev. 02/25), OMB 0938-0931, page 5 "Or send the
# completed signed application to:". The earlier Fargo, ND PO Box 6059 address is
# RETIRED; the current address printed on the form is the Baltimore one below.
NPI_ENUMERATOR = MAC(
"npi_enumerator", "NPI Enumerator (NPPES / CMS-10114 paper)",
("CMS NPI Enumerator Services", "Mail Stop DO-01-51",
"7500 Security Blvd.", "Baltimore, MD 21244"),
)
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())