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:
2026-07-16 21:47:20 -04:00
parent c95d08c951
commit 6004bcb73d

View File

@@ -16,6 +16,13 @@ import {
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { useLocation } from "wouter";
import { cn } from "@/lib/utils";
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")}`;
}
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" {
const [y, m, d] = dobISO.split("-").map(Number);
const today = new Date();
@@ -981,6 +998,26 @@ export function ChatbotButton() {
className="h-7 text-xs bg-white"
/>
</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 && (
<p className="text-xs text-gray-500">{eligibilityIdData.patient.insuranceProvider}</p>
)}