feat: editable insurance type selector on eligibility confirm card
Lets a user override the default MassHealth check on the chatbot's eligibility-id-ready confirm card (e.g. switch to United SCO, CMSP, DDMA, Delta Dental, Tufts SCO, or CCA) before running the check. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,13 @@ import {
|
|||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { Label } from "@/components/ui/label";
|
import { Label } from "@/components/ui/label";
|
||||||
|
import {
|
||||||
|
Select,
|
||||||
|
SelectContent,
|
||||||
|
SelectItem,
|
||||||
|
SelectTrigger,
|
||||||
|
SelectValue,
|
||||||
|
} from "@/components/ui/select";
|
||||||
import { useLocation } from "wouter";
|
import { useLocation } from "wouter";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
import { apiRequest } from "@/lib/queryClient";
|
import { apiRequest } from "@/lib/queryClient";
|
||||||
@@ -92,6 +99,16 @@ function mdyToISO(mdy: string): string {
|
|||||||
return `${m[3]}-${m[1]!.padStart(2, "0")}-${m[2]!.padStart(2, "0")}`;
|
return `${m[3]}-${m[1]!.padStart(2, "0")}-${m[2]!.padStart(2, "0")}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const INSURANCE_TYPE_OPTIONS: { value: string; label: string }[] = [
|
||||||
|
{ value: "mh", label: "MassHealth" },
|
||||||
|
{ value: "cmsp", label: "CMSP" },
|
||||||
|
{ value: "ddma", label: "DDMA" },
|
||||||
|
{ value: "delta-ins", label: "Delta Dental" },
|
||||||
|
{ value: "united-sco", label: "United SCO" },
|
||||||
|
{ value: "tufts-sco", label: "Tufts SCO" },
|
||||||
|
{ value: "cca", label: "CCA" },
|
||||||
|
];
|
||||||
|
|
||||||
function getAutoCheck(dobISO: string): "mh" | "cmsp" {
|
function getAutoCheck(dobISO: string): "mh" | "cmsp" {
|
||||||
const [y, m, d] = dobISO.split("-").map(Number);
|
const [y, m, d] = dobISO.split("-").map(Number);
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
@@ -981,6 +998,26 @@ export function ChatbotButton() {
|
|||||||
className="h-7 text-xs bg-white"
|
className="h-7 text-xs bg-white"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="space-y-1">
|
||||||
|
<Label className="text-[10px] text-gray-500">Insurance Type</Label>
|
||||||
|
<Select
|
||||||
|
value={eligibilityIdData.autoCheck}
|
||||||
|
onValueChange={(value) =>
|
||||||
|
setEligibilityIdData((prev) => (prev ? { ...prev, autoCheck: value } : prev))
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<SelectTrigger className="h-7 text-xs bg-white">
|
||||||
|
<SelectValue />
|
||||||
|
</SelectTrigger>
|
||||||
|
<SelectContent>
|
||||||
|
{INSURANCE_TYPE_OPTIONS.map((opt) => (
|
||||||
|
<SelectItem key={opt.value} value={opt.value} className="text-xs">
|
||||||
|
{opt.label}
|
||||||
|
</SelectItem>
|
||||||
|
))}
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
</div>
|
||||||
{eligibilityIdData.patient?.insuranceProvider && (
|
{eligibilityIdData.patient?.insuranceProvider && (
|
||||||
<p className="text-xs text-gray-500">{eligibilityIdData.patient.insuranceProvider}</p>
|
<p className="text-xs text-gray-500">{eligibilityIdData.patient.insuranceProvider}</p>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user