fix: allow letters in insurance ID; add patient state (default MA)
- Backend insurance ID check now accepts letters + digits (BCBS IDs have a letter prefix), matching the frontend schema; create route validates the normalized body - Patient.state column (default "MA") with State select on the patient form; ADA claim form uses the patient's state instead of the office's - Rebuild stale packages/db compiled .js so the runtime schemas include new fields (state, office billing NPI fields, Telnyx settings) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,7 @@ export function normalizeInsuranceId(raw: unknown): string | undefined {
|
||||
s = raw;
|
||||
} else {
|
||||
// Not acceptable type
|
||||
throw new Error("Insurance ID must be a numeric string.");
|
||||
throw new Error("Insurance ID must be a string.");
|
||||
}
|
||||
|
||||
// Remove all whitespace
|
||||
@@ -18,9 +18,9 @@ export function normalizeInsuranceId(raw: unknown): string | undefined {
|
||||
// If empty after cleaning, treat as undefined
|
||||
if (cleaned === "") return undefined;
|
||||
|
||||
// Only digits allowed (since you said it's numeric)
|
||||
if (!/^\d+$/.test(cleaned)) {
|
||||
throw new Error("Insurance ID must contain only digits.");
|
||||
// Letters and digits allowed (e.g. BCBS IDs carry a letter prefix)
|
||||
if (!/^[A-Za-z0-9]+$/.test(cleaned)) {
|
||||
throw new Error("Insurance ID must contain only letters and digits.");
|
||||
}
|
||||
|
||||
return cleaned;
|
||||
|
||||
Reference in New Issue
Block a user