date issue fixed3
This commit is contained in:
@@ -4,7 +4,7 @@ import { format, addDays, startOfToday, addMinutes } from "date-fns";
|
||||
import {
|
||||
parseLocalDateString,
|
||||
formatLocalDate,
|
||||
normalizeToISOString
|
||||
normalizeToISOString,
|
||||
} from "@/utils/dateUtils";
|
||||
import { TopAppBar } from "@/components/layout/top-app-bar";
|
||||
import { Sidebar } from "@/components/layout/sidebar";
|
||||
@@ -474,7 +474,10 @@ export default function AppointmentsPage() {
|
||||
patientName,
|
||||
staffId,
|
||||
status: apt.status ?? null, // Default to null if status is undefined
|
||||
date: apt.date instanceof Date ? apt.date.toISOString() : apt.date, // Ensure d
|
||||
date:
|
||||
apt.date instanceof Date
|
||||
? formatLocalDate(apt.date)
|
||||
: formatLocalDate(new Date(apt.date)),
|
||||
};
|
||||
|
||||
return processed;
|
||||
@@ -889,8 +892,9 @@ export default function AppointmentsPage() {
|
||||
{
|
||||
processedAppointments.filter(
|
||||
(apt) =>
|
||||
staffMembers.find((s) => Number(s.id) === apt.staffId)
|
||||
?.role === "doctor"
|
||||
staffMembers.find(
|
||||
(s) => Number(s.id) === apt.staffId
|
||||
)?.role === "doctor"
|
||||
).length
|
||||
}
|
||||
</span>
|
||||
@@ -903,8 +907,9 @@ export default function AppointmentsPage() {
|
||||
{
|
||||
processedAppointments.filter(
|
||||
(apt) =>
|
||||
staffMembers.find((s) => Number(s.id) === apt.staffId)
|
||||
?.role === "hygienist"
|
||||
staffMembers.find(
|
||||
(s) => Number(s.id) === apt.staffId
|
||||
)?.role === "hygienist"
|
||||
).length
|
||||
}
|
||||
</span>
|
||||
|
||||
@@ -33,7 +33,7 @@ import {
|
||||
clearTaskStatus,
|
||||
} from "@/redux/slices/seleniumEligibilityCheckTaskSlice";
|
||||
import { SeleniumTaskBanner } from "@/components/claims/selenium-task-banner";
|
||||
import { formatLocalDate } from "@/utils/dateUtils";
|
||||
import { formatLocalDate, parseLocalDateString } from "@/utils/dateUtils";
|
||||
|
||||
const PatientSchema = (
|
||||
PatientUncheckedCreateInputObjectSchema as unknown as z.ZodObject<any>
|
||||
@@ -59,7 +59,6 @@ export default function InsuranceEligibilityPage() {
|
||||
(state) => state.seleniumEligibilityCheckTask
|
||||
);
|
||||
|
||||
|
||||
const [selectedPatient, setSelectedPatient] = useState<Patient | null>(null);
|
||||
|
||||
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
|
||||
@@ -80,7 +79,10 @@ export default function InsuranceEligibilityPage() {
|
||||
setFirstName(selectedPatient.firstName ?? "");
|
||||
setLastName(selectedPatient.lastName ?? "");
|
||||
|
||||
const dob = selectedPatient.dateOfBirth
|
||||
const dob =
|
||||
typeof selectedPatient.dateOfBirth === "string"
|
||||
? parseLocalDateString(selectedPatient.dateOfBirth)
|
||||
: selectedPatient.dateOfBirth;
|
||||
setDateOfBirth(dob);
|
||||
} else {
|
||||
setMemberId("");
|
||||
@@ -167,10 +169,13 @@ export default function InsuranceEligibilityPage() {
|
||||
|
||||
// handle selenium
|
||||
const handleSelenium = async () => {
|
||||
|
||||
const formattedDob = dateOfBirth ? formatLocalDate(dateOfBirth) : "";
|
||||
|
||||
const data = {memberId, dateOfBirth: formattedDob, insuranceSiteKey: "MH", };
|
||||
const data = {
|
||||
memberId,
|
||||
dateOfBirth: formattedDob,
|
||||
insuranceSiteKey: "MH",
|
||||
};
|
||||
try {
|
||||
dispatch(
|
||||
setTaskStatus({
|
||||
@@ -214,7 +219,6 @@ export default function InsuranceEligibilityPage() {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const handleAddPatient = () => {
|
||||
const newPatient: InsertPatient = {
|
||||
firstName,
|
||||
@@ -227,7 +231,7 @@ export default function InsuranceEligibilityPage() {
|
||||
insuranceId: memberId,
|
||||
};
|
||||
addPatientMutation.mutate(newPatient);
|
||||
}
|
||||
};
|
||||
|
||||
// Handle insurance provider button clicks
|
||||
const handleMHButton = () => {
|
||||
@@ -246,8 +250,6 @@ export default function InsuranceEligibilityPage() {
|
||||
handleAddPatient();
|
||||
|
||||
handleSelenium();
|
||||
|
||||
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user