feat: add Remaining/Third Party columns, toggle PDF viewer, retire CMSP as separate insurance type

- Add remainingBenefit and thirdPartyInsurance columns to Patient; extract both
  from the MassHealth accumulator/member-detail pages during the eligibility
  check and surface them in the eligibility table
- Add an updated-date display and a toggle to suppress the post-check PDF
  viewer popup (default off) on the insurance eligibility page
- Rename CMSP-prefixed PDF filenames and UI copy to MH, since CMSP and MH now
  share the same worker
- Fold CMSP into MassHealth/MH across patient/claim insurance-type dropdowns
  and the chatbot's eligibility routing, since they're the same insurance
- Remove auto-download of saved eligibility PDFs; downloading is now manual

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-02 22:32:43 -04:00
co-authored by Claude Sonnet 5
parent f8235787db
commit 52ddfd9f57
96 changed files with 561 additions and 160 deletions
@@ -18,6 +18,8 @@ export const PatientAggregateResultSchema = z.object({ _count: z.object({
medicalConditions: z.number(),
preferredLanguage: z.number(),
status: z.number(),
remainingBenefit: z.number(),
thirdPartyInsurance: z.number(),
userId: z.number(),
createdAt: z.number(),
updatedAt: z.number(),
@@ -58,6 +60,8 @@ export const PatientAggregateResultSchema = z.object({ _count: z.object({
allergies: z.string().nullable(),
medicalConditions: z.string().nullable(),
preferredLanguage: z.string().nullable(),
remainingBenefit: z.string().nullable(),
thirdPartyInsurance: z.string().nullable(),
userId: z.number().int().nullable(),
createdAt: z.date().nullable(),
updatedAt: z.date().nullable()
@@ -80,6 +84,8 @@ export const PatientAggregateResultSchema = z.object({ _count: z.object({
allergies: z.string().nullable(),
medicalConditions: z.string().nullable(),
preferredLanguage: z.string().nullable(),
remainingBenefit: z.string().nullable(),
thirdPartyInsurance: z.string().nullable(),
userId: z.number().int().nullable(),
createdAt: z.date().nullable(),
updatedAt: z.date().nullable()
@@ -18,6 +18,8 @@ export const PatientCreateResultSchema = z.object({
medicalConditions: z.string().optional(),
preferredLanguage: z.string().optional(),
status: z.unknown(),
remainingBenefit: z.string().optional(),
thirdPartyInsurance: z.string().optional(),
userId: z.number().int(),
createdAt: z.date(),
updatedAt: z.date(),
@@ -18,6 +18,8 @@ export const PatientDeleteResultSchema = z.nullable(z.object({
medicalConditions: z.string().optional(),
preferredLanguage: z.string().optional(),
status: z.unknown(),
remainingBenefit: z.string().optional(),
thirdPartyInsurance: z.string().optional(),
userId: z.number().int(),
createdAt: z.date(),
updatedAt: z.date(),
@@ -18,6 +18,8 @@ export const PatientFindFirstResultSchema = z.nullable(z.object({
medicalConditions: z.string().optional(),
preferredLanguage: z.string().optional(),
status: z.unknown(),
remainingBenefit: z.string().optional(),
thirdPartyInsurance: z.string().optional(),
userId: z.number().int(),
createdAt: z.date(),
updatedAt: z.date(),
@@ -19,6 +19,8 @@ export const PatientFindManyResultSchema = z.object({
medicalConditions: z.string().optional(),
preferredLanguage: z.string().optional(),
status: z.unknown(),
remainingBenefit: z.string().optional(),
thirdPartyInsurance: z.string().optional(),
userId: z.number().int(),
createdAt: z.date(),
updatedAt: z.date(),
@@ -18,6 +18,8 @@ export const PatientFindUniqueResultSchema = z.nullable(z.object({
medicalConditions: z.string().optional(),
preferredLanguage: z.string().optional(),
status: z.unknown(),
remainingBenefit: z.string().optional(),
thirdPartyInsurance: z.string().optional(),
userId: z.number().int(),
createdAt: z.date(),
updatedAt: z.date(),
@@ -17,6 +17,8 @@ export const PatientGroupByResultSchema = z.array(z.object({
allergies: z.string(),
medicalConditions: z.string(),
preferredLanguage: z.string(),
remainingBenefit: z.string(),
thirdPartyInsurance: z.string(),
userId: z.number().int(),
createdAt: z.date(),
updatedAt: z.date(),
@@ -39,6 +41,8 @@ export const PatientGroupByResultSchema = z.array(z.object({
medicalConditions: z.number(),
preferredLanguage: z.number(),
status: z.number(),
remainingBenefit: z.number(),
thirdPartyInsurance: z.number(),
userId: z.number(),
createdAt: z.number(),
updatedAt: z.number(),
@@ -79,6 +83,8 @@ export const PatientGroupByResultSchema = z.array(z.object({
allergies: z.string().nullable(),
medicalConditions: z.string().nullable(),
preferredLanguage: z.string().nullable(),
remainingBenefit: z.string().nullable(),
thirdPartyInsurance: z.string().nullable(),
userId: z.number().int().nullable(),
createdAt: z.date().nullable(),
updatedAt: z.date().nullable()
@@ -101,6 +107,8 @@ export const PatientGroupByResultSchema = z.array(z.object({
allergies: z.string().nullable(),
medicalConditions: z.string().nullable(),
preferredLanguage: z.string().nullable(),
remainingBenefit: z.string().nullable(),
thirdPartyInsurance: z.string().nullable(),
userId: z.number().int().nullable(),
createdAt: z.date().nullable(),
updatedAt: z.date().nullable()
@@ -18,6 +18,8 @@ export const PatientUpdateResultSchema = z.nullable(z.object({
medicalConditions: z.string().optional(),
preferredLanguage: z.string().optional(),
status: z.unknown(),
remainingBenefit: z.string().optional(),
thirdPartyInsurance: z.string().optional(),
userId: z.number().int(),
createdAt: z.date(),
updatedAt: z.date(),
@@ -18,6 +18,8 @@ export const PatientUpsertResultSchema = z.object({
medicalConditions: z.string().optional(),
preferredLanguage: z.string().optional(),
status: z.unknown(),
remainingBenefit: z.string().optional(),
thirdPartyInsurance: z.string().optional(),
userId: z.number().int(),
createdAt: z.date(),
updatedAt: z.date(),