feat: Select Procedures flow, batch-column NPI provider fix, auto PDF save

- Add 'Select Procedures' right-click option on appointment page (separate from Claims/PreAuth)
- Select Procedures form saves CDT codes + NPI provider to AppointmentProcedure storage
- Remove Save button from insurance claim form; Claims/PreAuth opens for insurance submission only
- Claims/PreAuth auto-prefills from saved procedures including NPI provider
- Batch-column: procedures npiProviderId takes priority over stale claim npiProviderId
- Batch-column: auto-save PDF to patient Documents after successful submission (no socket needed)
- Add npiProviderId column to AppointmentProcedure table (prisma db push)
- Fix 'invalid db creation invocation': guard staffId, npiProviderId, procedureDate as Date object, totalBilled NaN guard
- Add full error logging to batch-column catch block

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Gitead
2026-04-27 00:25:24 -04:00
parent a279a3e7c1
commit 3e899376c3
838 changed files with 28488 additions and 773 deletions

File diff suppressed because one or more lines are too long

View File

@@ -189,6 +189,7 @@ exports.Prisma.AppointmentProcedureScalarFieldEnum = {
id: 'id',
appointmentId: 'appointmentId',
patientId: 'patientId',
npiProviderId: 'npiProviderId',
procedureCode: 'procedureCode',
procedureLabel: 'procedureLabel',
fee: 'fee',
@@ -218,7 +219,8 @@ exports.Prisma.ClaimScalarFieldEnum = {
createdAt: 'createdAt',
updatedAt: 'updatedAt',
status: 'status',
claimNumber: 'claimNumber'
claimNumber: 'claimNumber',
npiProviderId: 'npiProviderId'
};
exports.Prisma.ServiceLineScalarFieldEnum = {
@@ -242,7 +244,8 @@ exports.Prisma.ClaimFileScalarFieldEnum = {
id: 'id',
claimId: 'claimId',
filename: 'filename',
mimeType: 'mimeType'
mimeType: 'mimeType',
filePath: 'filePath'
};
exports.Prisma.InsuranceCredentialScalarFieldEnum = {
@@ -351,6 +354,7 @@ exports.Prisma.CloudFileScalarFieldEnum = {
folderId: 'folderId',
isComplete: 'isComplete',
totalChunks: 'totalChunks',
diskPath: 'diskPath',
createdAt: 'createdAt',
updatedAt: 'updatedAt'
};

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,5 @@
{
"name": "prisma-client-2bb3dab931ebdead5485dfde3b55c109d6af8a933a711e743a9478fd94284620",
"name": "prisma-client-03b178e8b877a1598bedb0c5599737211871b1d3d6ccc3ed144f5a7924b0deb0",
"main": "index.js",
"types": "index.d.ts",
"browser": "default.js",

View File

@@ -126,7 +126,9 @@ model NpiProvider {
providerName String
createdAt DateTime @default(now())
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
claims Claim[]
appointmentProcedures AppointmentProcedure[]
@@unique([userId, npiNumber])
@@index([userId])
@@ -138,9 +140,10 @@ enum ProcedureSource {
}
model AppointmentProcedure {
id Int @id @default(autoincrement())
id Int @id @default(autoincrement())
appointmentId Int
patientId Int
npiProviderId Int?
procedureCode String
procedureLabel String?
@@ -157,8 +160,9 @@ model AppointmentProcedure {
createdAt DateTime @default(now())
appointment Appointment @relation(fields: [appointmentId], references: [id], onDelete: Cascade)
patient Patient @relation(fields: [patientId], references: [id], onDelete: Cascade)
appointment Appointment @relation(fields: [appointmentId], references: [id], onDelete: Cascade)
patient Patient @relation(fields: [patientId], references: [id], onDelete: Cascade)
npiProvider NpiProvider? @relation(fields: [npiProviderId], references: [id])
@@index([appointmentId])
@@index([patientId])
@@ -182,11 +186,13 @@ model Claim {
updatedAt DateTime @updatedAt
status ClaimStatus @default(PENDING)
claimNumber String?
npiProviderId Int?
patient Patient @relation(fields: [patientId], references: [id], onDelete: Cascade)
appointment Appointment @relation(fields: [appointmentId], references: [id], onDelete: Cascade)
user User? @relation(fields: [userId], references: [id])
staff Staff? @relation("ClaimStaff", fields: [staffId], references: [id])
patient Patient @relation(fields: [patientId], references: [id], onDelete: Cascade)
appointment Appointment @relation(fields: [appointmentId], references: [id], onDelete: Cascade)
user User? @relation(fields: [userId], references: [id])
staff Staff? @relation("ClaimStaff", fields: [staffId], references: [id])
npiProvider NpiProvider? @relation(fields: [npiProviderId], references: [id])
serviceLines ServiceLine[]
claimFiles ClaimFile[]
@@ -240,10 +246,11 @@ enum ServiceLineStatus {
}
model ClaimFile {
id Int @id @default(autoincrement())
id Int @id @default(autoincrement())
claimId Int
filename String
mimeType String
filePath String?
claim Claim @relation(fields: [claimId], references: [id], onDelete: Cascade)
}
@@ -440,6 +447,7 @@ model CloudFile {
folderId Int? // optional: null => root
isComplete Boolean @default(false) // upload completed?
totalChunks Int? // optional: expected number of chunks
diskPath String? // relative path on disk under uploads/
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id])