fixed fetchingMatchingPatient
This commit is contained in:
@@ -174,7 +174,7 @@ router.get("/by-insurance-id", async (req: Request, res: Response): Promise<any>
|
||||
if (patient) {
|
||||
return res.status(200).json(patient);
|
||||
} else {
|
||||
return res.status(404).json(null);
|
||||
return res.status(200).json(null);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("Failed to lookup patient:", err);
|
||||
|
||||
@@ -155,8 +155,14 @@ export default function ClaimsPage() {
|
||||
"GET",
|
||||
`/api/patients/by-insurance-id?insuranceId=${encodeURIComponent(insuranceId)}`
|
||||
);
|
||||
if (!res.ok) throw new Error("Failed to fetch patient by insuranceId");
|
||||
return res.json(); // returns patient object or null
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error(
|
||||
`Failed to fetch patient by insuranceId (status ${res.status})`
|
||||
);
|
||||
}
|
||||
|
||||
return res.json();
|
||||
};
|
||||
|
||||
// workflow starts from there - this params are set by pdf extraction/patient page. then used in claim page here.
|
||||
|
||||
Reference in New Issue
Block a user