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:
@@ -321,11 +321,27 @@ export default function ClaimsPage() {
|
||||
}
|
||||
};
|
||||
|
||||
// 3. create claim.
|
||||
const handleClaimSubmit = (claimData: any): Promise<Claim> => {
|
||||
return createClaimMutation.mutateAsync(claimData).then((data) => {
|
||||
// 3. create or update claim (update when claimId is present)
|
||||
const handleClaimSubmit = async (claimData: any): Promise<Claim> => {
|
||||
const { isDraft, claimId, uploadedFiles: _uf, ...cleanData } = claimData;
|
||||
|
||||
if (claimId) {
|
||||
// Update existing saved claim (PUT never creates a Payment)
|
||||
const res = await apiRequest("PUT", `/api/claims/${claimId}`, cleanData);
|
||||
const data = await res.json();
|
||||
if (!res.ok) throw new Error(data?.message || "Failed to update claim");
|
||||
queryClient.invalidateQueries({ queryKey: QK_CLAIMS_BASE });
|
||||
if (!isDraft) toast({ title: "Claim updated successfully", variant: "default" });
|
||||
return data;
|
||||
});
|
||||
}
|
||||
|
||||
// New claim: draft saves skip Payment creation
|
||||
const url = isDraft ? "/api/claims/?draft=true" : "/api/claims/";
|
||||
const res = await apiRequest("POST", url, cleanData);
|
||||
const data = await res.json();
|
||||
if (!res.ok) throw new Error(data?.message || "Failed to save claim");
|
||||
queryClient.invalidateQueries({ queryKey: QK_CLAIMS_BASE });
|
||||
return data;
|
||||
};
|
||||
|
||||
// 4. handle selenium sybmiting Mass Health claim
|
||||
@@ -579,6 +595,7 @@ export default function ClaimsPage() {
|
||||
patientId={selectedPatientId}
|
||||
appointmentId={selectedAppointmentId ?? undefined}
|
||||
autoSubmit={mode === "direct"}
|
||||
proceduresOnly={mode === "procedures"}
|
||||
onClose={closeClaim}
|
||||
onSubmit={handleClaimSubmit}
|
||||
onHandleAppointmentSubmit={handleAppointmentSubmit}
|
||||
|
||||
Reference in New Issue
Block a user