fix(eligibility page) - UI fixed, txReport pdf added
This commit is contained in:
@@ -17,8 +17,8 @@ const PatientsPage = lazy(() => import("./pages/patients-page"));
|
|||||||
const SettingsPage = lazy(() => import("./pages/settings-page"));
|
const SettingsPage = lazy(() => import("./pages/settings-page"));
|
||||||
const ClaimsPage = lazy(() => import("./pages/claims-page"));
|
const ClaimsPage = lazy(() => import("./pages/claims-page"));
|
||||||
const PaymentsPage = lazy(() => import("./pages/payments-page"));
|
const PaymentsPage = lazy(() => import("./pages/payments-page"));
|
||||||
const InsuranceEligibilityPage = lazy(
|
const EligibilityClaimStatusPage = lazy(
|
||||||
() => import("./pages/insurance-eligibility-page")
|
() => import("./pages/eligibility-claim-status-page")
|
||||||
);
|
);
|
||||||
const DocumentPage = lazy(() => import("./pages/documents-page"));
|
const DocumentPage = lazy(() => import("./pages/documents-page"));
|
||||||
const DatabaseManagementPage = lazy(
|
const DatabaseManagementPage = lazy(
|
||||||
@@ -41,8 +41,8 @@ function Router() {
|
|||||||
<ProtectedRoute path="/settings" component={() => <SettingsPage />} />
|
<ProtectedRoute path="/settings" component={() => <SettingsPage />} />
|
||||||
<ProtectedRoute path="/claims" component={() => <ClaimsPage />} />
|
<ProtectedRoute path="/claims" component={() => <ClaimsPage />} />
|
||||||
<ProtectedRoute
|
<ProtectedRoute
|
||||||
path="/insurance-eligibility"
|
path="/eligibility-claim-status"
|
||||||
component={() => <InsuranceEligibilityPage />}
|
component={() => <EligibilityClaimStatusPage />}
|
||||||
/>
|
/>
|
||||||
<ProtectedRoute path="/payments" component={() => <PaymentsPage />} />
|
<ProtectedRoute path="/payments" component={() => <PaymentsPage />} />
|
||||||
<ProtectedRoute path="/documents" component={() => <DocumentPage />} />
|
<ProtectedRoute path="/documents" component={() => <DocumentPage />} />
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ export function Sidebar() {
|
|||||||
icon: <Users className="h-5 w-5" />,
|
icon: <Users className="h-5 w-5" />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Insurance Eligibility",
|
name: "Eligibility/Claim Status",
|
||||||
path: "/insurance-eligibility",
|
path: "/eligibility-claim-status",
|
||||||
icon: <Shield className="h-5 w-5" />,
|
icon: <Shield className="h-5 w-5" />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { format } from "date-fns";
|
import { format } from "date-fns";
|
||||||
import { Calendar } from "@/components/ui/calendar";
|
import { Calendar } from "@/components/ui/calendar";
|
||||||
import {
|
import {
|
||||||
@@ -21,7 +21,6 @@ interface DateInputProps {
|
|||||||
|
|
||||||
// THIS COMPONENT IS MADE FOR GENERAL FIELD IN PAGE.
|
// THIS COMPONENT IS MADE FOR GENERAL FIELD IN PAGE.
|
||||||
// Here, User can input/paste date in certain format, and also select via calendar
|
// Here, User can input/paste date in certain format, and also select via calendar
|
||||||
|
|
||||||
export function DateInput({
|
export function DateInput({
|
||||||
label,
|
label,
|
||||||
value,
|
value,
|
||||||
@@ -32,6 +31,19 @@ export function DateInput({
|
|||||||
const [inputValue, setInputValue] = useState(
|
const [inputValue, setInputValue] = useState(
|
||||||
value ? format(value, "MM/dd/yyyy") : ""
|
value ? format(value, "MM/dd/yyyy") : ""
|
||||||
);
|
);
|
||||||
|
const [open, setOpen] = useState(false);
|
||||||
|
|
||||||
|
// Keep inputValue in sync when parent 'value' changes.
|
||||||
|
// Only overwrite if different to avoid stomping an in-progress user edit.
|
||||||
|
useEffect(() => {
|
||||||
|
if (value) {
|
||||||
|
const formatted = format(value, "MM/dd/yyyy");
|
||||||
|
setInputValue((prev) => (prev !== formatted ? formatted : prev));
|
||||||
|
} else {
|
||||||
|
// parent cleared the value
|
||||||
|
setInputValue("");
|
||||||
|
}
|
||||||
|
}, [value]);
|
||||||
|
|
||||||
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
let val = e.target.value.replace(/\D/g, "");
|
let val = e.target.value.replace(/\D/g, "");
|
||||||
@@ -62,7 +74,7 @@ export function DateInput({
|
|||||||
value={inputValue}
|
value={inputValue}
|
||||||
onChange={handleInputChange}
|
onChange={handleInputChange}
|
||||||
/>
|
/>
|
||||||
<Popover>
|
<Popover open={open} onOpenChange={setOpen}>
|
||||||
<PopoverTrigger asChild>
|
<PopoverTrigger asChild>
|
||||||
<Button type="button" variant="outline" className={cn("px-3")}>
|
<Button type="button" variant="outline" className={cn("px-3")}>
|
||||||
<CalendarIcon className="h-4 w-4 opacity-70" />
|
<CalendarIcon className="h-4 w-4 opacity-70" />
|
||||||
@@ -77,6 +89,7 @@ export function DateInput({
|
|||||||
if (date) {
|
if (date) {
|
||||||
setInputValue(format(date, "MM/dd/yyyy"));
|
setInputValue(format(date, "MM/dd/yyyy"));
|
||||||
onChange(date);
|
onChange(date);
|
||||||
|
setOpen(false);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
disabled={
|
disabled={
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import { InsertPatient, Patient } from "@repo/db/types";
|
|||||||
import { DateInput } from "@/components/ui/dateInput";
|
import { DateInput } from "@/components/ui/dateInput";
|
||||||
import { QK_PATIENTS_BASE } from "@/components/patients/patient-table";
|
import { QK_PATIENTS_BASE } from "@/components/patients/patient-table";
|
||||||
|
|
||||||
export default function InsuranceEligibilityPage() {
|
export default function EligibilityClaimStatusPage() {
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
@@ -34,15 +34,6 @@ export default function InsuranceEligibilityPage() {
|
|||||||
(state) => state.seleniumEligibilityCheckTask
|
(state) => state.seleniumEligibilityCheckTask
|
||||||
);
|
);
|
||||||
const [selectedPatient, setSelectedPatient] = useState<Patient | null>(null);
|
const [selectedPatient, setSelectedPatient] = useState<Patient | null>(null);
|
||||||
const [currentTablePage, setCurrentTablePage] = useState<number | null>(null);
|
|
||||||
const [currentTableSearchTerm, setCurrentTableSearchTerm] = useState<
|
|
||||||
string | null
|
|
||||||
>(null);
|
|
||||||
|
|
||||||
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
|
|
||||||
const toggleMobileMenu = () => {
|
|
||||||
setIsMobileMenuOpen(!isMobileMenuOpen);
|
|
||||||
};
|
|
||||||
|
|
||||||
// Insurance eligibility check form fields
|
// Insurance eligibility check form fields
|
||||||
const [memberId, setMemberId] = useState("");
|
const [memberId, setMemberId] = useState("");
|
||||||
@@ -213,10 +204,10 @@ export default function InsuranceEligibilityPage() {
|
|||||||
<div className="flex justify-between items-center">
|
<div className="flex justify-between items-center">
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-3xl font-bold tracking-tight">
|
<h1 className="text-3xl font-bold tracking-tight">
|
||||||
Insurance Eligibility
|
Insurance Eligibility and Claim Status
|
||||||
</h1>
|
</h1>
|
||||||
<p className="text-muted-foreground">
|
<p className="text-muted-foreground">
|
||||||
Check insurance eligibility and view patient information
|
Check insurance eligibility and Claim status.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -224,7 +215,7 @@ export default function InsuranceEligibilityPage() {
|
|||||||
{/* Insurance Eligibility Check Form */}
|
{/* Insurance Eligibility Check Form */}
|
||||||
<Card className="mb-6">
|
<Card className="mb-6">
|
||||||
<CardHeader>
|
<CardHeader>
|
||||||
<CardTitle>Check Insurance Eligibility</CardTitle>
|
<CardTitle>Check Insurance Eligibility and Claim Status</CardTitle>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<div className="grid grid-cols-4 md:grid-cols-4 gap-4 mb-4">
|
<div className="grid grid-cols-4 md:grid-cols-4 gap-4 mb-4">
|
||||||
@@ -281,7 +272,7 @@ export default function InsuranceEligibilityPage() {
|
|||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<CheckCircle className="h-4 w-4 mr-2" />
|
<CheckCircle className="h-4 w-4 mr-2" />
|
||||||
MH
|
MH Eligibility
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
@@ -304,8 +295,6 @@ export default function InsuranceEligibilityPage() {
|
|||||||
allowCheckbox={true}
|
allowCheckbox={true}
|
||||||
allowEdit={true}
|
allowEdit={true}
|
||||||
onSelectPatient={setSelectedPatient}
|
onSelectPatient={setSelectedPatient}
|
||||||
onPageChange={setCurrentTablePage}
|
|
||||||
onSearchChange={setCurrentTableSearchTerm}
|
|
||||||
/>
|
/>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
@@ -121,7 +121,6 @@ class AutomationMassHealthEligibilityCheck:
|
|||||||
|
|
||||||
def step2(self):
|
def step2(self):
|
||||||
wait = WebDriverWait(self.driver, 90)
|
wait = WebDriverWait(self.driver, 90)
|
||||||
|
|
||||||
def wait_for_pdf_download(timeout=60):
|
def wait_for_pdf_download(timeout=60):
|
||||||
for _ in range(timeout):
|
for _ in range(timeout):
|
||||||
files = [f for f in os.listdir(self.download_dir) if f.endswith(".pdf")]
|
files = [f for f in os.listdir(self.download_dir) if f.endswith(".pdf")]
|
||||||
@@ -135,8 +134,11 @@ class AutomationMassHealthEligibilityCheck:
|
|||||||
f"//table[@id='Table3']//tr[td[contains(text(), '{self.memberId}')]]/td[3]")))
|
f"//table[@id='Table3']//tr[td[contains(text(), '{self.memberId}')]]/td[3]")))
|
||||||
eligibilityText = eligibilityElement.text
|
eligibilityText = eligibilityElement.text
|
||||||
|
|
||||||
report_link = wait.until(EC.element_to_be_clickable((By.XPATH, "//a[contains(text(), 'Click here')]")))
|
txReportElement = wait.until(EC.element_to_be_clickable((By.XPATH,
|
||||||
report_link.click()
|
f"//table[@id='Table3']//tr[td[contains(text(), '{self.memberId}')]]//input[@value='Tx Report']"
|
||||||
|
)))
|
||||||
|
|
||||||
|
txReportElement.click()
|
||||||
|
|
||||||
pdf_path = wait_for_pdf_download()
|
pdf_path = wait_for_pdf_download()
|
||||||
print("PDF downloaded at:", pdf_path)
|
print("PDF downloaded at:", pdf_path)
|
||||||
|
|||||||
Reference in New Issue
Block a user