fix: default tooth # for 2PA and skip PDF popup for AI chat claims

- 2PA with no explicit tooth numbers now defaults to D0220 #8 / D0230 #24
- Claims submitted via the AI chat column no longer auto-open the PDF preview modal

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-05 15:52:31 -04:00
co-authored by Claude Sonnet 5
parent d35efe7366
commit fd2d1e6aba
2 changed files with 10 additions and 4 deletions
+6 -1
View File
@@ -317,10 +317,15 @@ function parseMultiPaCode(input: string): CdtMatch[] | null {
// Extract all tooth numbers from the full input string
const toothMatches = [...input.matchAll(/#\s*(\d{1,2})\b/g)];
const teeth: string[] = toothMatches
let teeth: string[] = toothMatches
.map((tm) => tm[1]!)
.filter((t) => { const n = parseInt(t, 10); return n >= 1 && n <= 32; });
// "2PA" with no tooth numbers given defaults to #8 (D0220) and #24 (D0230)
if (count === 2 && teeth.length === 0) {
teeth = ["8", "24"];
}
const d0220 = ALL_CODES.find((r) => r["Procedure Code"] === "D0220");
const d0230 = ALL_CODES.find((r) => r["Procedure Code"] === "D0230");