claim form now will show 10 rows of service lines
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -37,3 +37,6 @@ dist/
|
|||||||
|
|
||||||
# env
|
# env
|
||||||
*.env
|
*.env
|
||||||
|
|
||||||
|
#temp
|
||||||
|
1.html
|
||||||
@@ -90,7 +90,7 @@ interface ClaimFormData {
|
|||||||
remarks: string;
|
remarks: string;
|
||||||
serviceDate: string; // YYYY-MM-DD
|
serviceDate: string; // YYYY-MM-DD
|
||||||
insuranceProvider: string;
|
insuranceProvider: string;
|
||||||
insuranceSiteKey?:string;
|
insuranceSiteKey?: string;
|
||||||
status: string; // default "pending"
|
status: string; // default "pending"
|
||||||
serviceLines: ServiceLine[];
|
serviceLines: ServiceLine[];
|
||||||
}
|
}
|
||||||
@@ -220,19 +220,16 @@ export function ClaimForm({
|
|||||||
remarks: "",
|
remarks: "",
|
||||||
serviceDate: serviceDate,
|
serviceDate: serviceDate,
|
||||||
insuranceProvider: "",
|
insuranceProvider: "",
|
||||||
insuranceSiteKey:"",
|
insuranceSiteKey: "",
|
||||||
status: "pending",
|
status: "pending",
|
||||||
serviceLines: [
|
serviceLines: Array.from({ length: 10 }, () => ({
|
||||||
{
|
procedureCode: "",
|
||||||
procedureCode: "",
|
procedureDate: serviceDate,
|
||||||
procedureDate: serviceDate,
|
oralCavityArea: "",
|
||||||
oralCavityArea: "",
|
toothNumber: "",
|
||||||
toothNumber: "",
|
toothSurface: "",
|
||||||
toothSurface: "",
|
billedAmount: 0,
|
||||||
billedAmount: 0,
|
})),
|
||||||
},
|
|
||||||
],
|
|
||||||
|
|
||||||
uploadedFiles: [],
|
uploadedFiles: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -279,7 +276,7 @@ export function ClaimForm({
|
|||||||
|
|
||||||
if (updatedLines[index]) {
|
if (updatedLines[index]) {
|
||||||
if (field === "billedAmount") {
|
if (field === "billedAmount") {
|
||||||
const num = typeof value === "string" ? parseFloat(value) : value;
|
const num = typeof value === "string" ? parseFloat(value) : value;
|
||||||
const rounded = Math.round((isNaN(num) ? 0 : num) * 100) / 100;
|
const rounded = Math.round((isNaN(num) ? 0 : num) * 100) / 100;
|
||||||
updatedLines[index][field] = rounded;
|
updatedLines[index][field] = rounded;
|
||||||
} else {
|
} else {
|
||||||
@@ -362,13 +359,15 @@ export function ClaimForm({
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 3. Create Claim(if not)
|
// 3. Create Claim(if not)
|
||||||
const {
|
// Filter out empty service lines (empty procedureCode)
|
||||||
uploadedFiles,
|
const filteredServiceLines = form.serviceLines.filter(
|
||||||
insuranceSiteKey,
|
(line) => line.procedureCode.trim() !== ""
|
||||||
...formToCreateClaim
|
);
|
||||||
} = form;
|
|
||||||
|
const { uploadedFiles, insuranceSiteKey, ...formToCreateClaim } = form;
|
||||||
onSubmit({
|
onSubmit({
|
||||||
...formToCreateClaim,
|
...formToCreateClaim,
|
||||||
|
serviceLines: filteredServiceLines,
|
||||||
staffId: Number(staff?.id),
|
staffId: Number(staff?.id),
|
||||||
patientId: patientId,
|
patientId: patientId,
|
||||||
insuranceProvider: "MassHealth",
|
insuranceProvider: "MassHealth",
|
||||||
@@ -378,11 +377,12 @@ export function ClaimForm({
|
|||||||
// 4. sending form data to selenium service
|
// 4. sending form data to selenium service
|
||||||
onHandleForSelenium({
|
onHandleForSelenium({
|
||||||
...form,
|
...form,
|
||||||
|
serviceLines: filteredServiceLines,
|
||||||
staffId: Number(staff?.id),
|
staffId: Number(staff?.id),
|
||||||
patientId: patientId,
|
patientId: patientId,
|
||||||
insuranceProvider: "Mass Health",
|
insuranceProvider: "Mass Health",
|
||||||
appointmentId: appointmentId!,
|
appointmentId: appointmentId!,
|
||||||
insuranceSiteKey:"MH",
|
insuranceSiteKey: "MH",
|
||||||
});
|
});
|
||||||
// 4. Close form
|
// 4. Close form
|
||||||
onClose();
|
onClose();
|
||||||
|
|||||||
Reference in New Issue
Block a user