Portal Delete run (Super Admin), lab codes #3/#4, Z23 pointer #45, T1017 #46, payer note, login security-image wait
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a8af44e673
commit
fafa5285eb
21 files changed
+1509
-63
No files matched your search
@@ -91,6 +91,10 @@ COMMENTS = {
|
||||
"CHP+ Dental - Claim Status to Patient"),
|
||||
"medicaid_uncheck_cpts": (
|
||||
"CPT not billable to Medicaid (15851/15852/73521 - unchecked, fee 0)"),
|
||||
# Fallback only: the condition words its own comment (codes, payer rule).
|
||||
"lab_codes": "Lab code the payer does not take - unchecked, fee 0",
|
||||
# Fallback only: the condition words its own comment (which payer).
|
||||
"t1017_non_billable": "T1017 not billable (Medicare / Medicaid) - unchecked, fee 0",
|
||||
"medicare_billing_screening": (
|
||||
"Screening codes not billed to Medicare (G8510/G8431)"),
|
||||
# Fallback only: the condition words its own comment (which codes).
|
||||
@@ -104,6 +108,8 @@ COMMENTS = {
|
||||
"medicaid_pregnancy_th": (
|
||||
"TH modifier added (pregnancy visit on Medicaid)"),
|
||||
"vaccine_admin_codes": "CPT Code Missing ( vaccine admin code added )",
|
||||
# Fallback only: the condition words its own comment (which codes).
|
||||
"vaccine_z23_pointer": "Z23 pointer added to the vaccine line",
|
||||
# Fallback only: the condition words its own comment (96372 added or not).
|
||||
"injection_admin_code": "CPT Code Missing (injection admin code 96372)",
|
||||
# Fallback only: the condition words its own comment by the path it
|
||||
@@ -256,6 +262,24 @@ def review_reasons(data: dict) -> list:
|
||||
return reasons
|
||||
|
||||
|
||||
def _ecw_payer(data: dict) -> str:
|
||||
"""The payer every condition goes by: the claim form's first insurance
|
||||
row (`conditions.lines.primary_payer`, not imported — it brings the
|
||||
page code with it)."""
|
||||
rows = (data or {}).get("insurance") or []
|
||||
return str(rows[0].get("Name") or "").strip() if rows else ""
|
||||
|
||||
|
||||
def payer_note(sheet: str, ecw: str) -> str:
|
||||
"""A note when the report's PAYER and eCW's differ (operator,
|
||||
2026-10-28): the rules went by eCW's, and the reader should know. Not
|
||||
when either is blank, nor for case or spacing alone."""
|
||||
norm = lambda s: " ".join(str(s or "").split()).lower()
|
||||
if not norm(sheet) or not norm(ecw) or norm(sheet) == norm(ecw):
|
||||
return ""
|
||||
return f"Payer: sheet says {sheet.strip()}, eCW says {ecw.strip()} - eCW used"
|
||||
|
||||
|
||||
def claim_outcome(found: bool, data: dict) -> dict:
|
||||
"""
|
||||
Columns V-X for one claim, from what `_read_claim_form` returned.
|
||||
@@ -318,15 +342,20 @@ def claim_outcome(found: bool, data: dict) -> dict:
|
||||
# A save that happened is never hidden behind "Needs manual review"
|
||||
# (final review, 2026-10-05): it leads the Comments.
|
||||
lead = [SAVED_NOTE] if saved else []
|
||||
return {"Comments": "; ".join(lead + comments + reasons),
|
||||
"Current Status": "Needs manual review", "Category": "Review"}
|
||||
if not failed:
|
||||
return {"Comments": "; ".join([CLEAN] + comments),
|
||||
"Current Status": "Ready to Submit", "Category": "Pass"}
|
||||
return {"Comments": "; ".join(comments),
|
||||
"Current Status": ("Ready to Submit" if saved
|
||||
else "Corrections pending (not saved)"),
|
||||
"Category": "Fail"}
|
||||
out = {"Comments": "; ".join(lead + comments + reasons),
|
||||
"Current Status": "Needs manual review", "Category": "Review"}
|
||||
elif not failed:
|
||||
out = {"Comments": "; ".join([CLEAN] + comments),
|
||||
"Current Status": "Ready to Submit", "Category": "Pass"}
|
||||
else:
|
||||
out = {"Comments": "; ".join(comments),
|
||||
"Current Status": ("Ready to Submit" if saved
|
||||
else "Corrections pending (not saved)"),
|
||||
"Category": "Fail"}
|
||||
# Not a column: build_rows compares it with the report's PAYER.
|
||||
if _ecw_payer(data):
|
||||
out["_ecw_payer"] = _ecw_payer(data)
|
||||
return out
|
||||
|
||||
|
||||
def _money(text):
|
||||
@@ -371,6 +400,10 @@ def build_rows(report_rows: list, header_row: int, claim_col: int,
|
||||
done = outcomes.get(claim) or {}
|
||||
if done:
|
||||
vals.update(done)
|
||||
note = payer_note(vals["PAYER"], done.get("_ecw_payer"))
|
||||
if note:
|
||||
vals["Comments"] = "; ".join(
|
||||
c for c in (vals.get("Comments"), note) if c)
|
||||
vals["Recevied date"] = run_date
|
||||
vals["Completed On"] = run_date
|
||||
vals["Assigned To "] = assigned_to
|
||||
|
||||
Reference in new issue
Block a user