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:
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user