Commit Graph

75 Commits

Author SHA1 Message Date
Gitead
6f33e416c1 feat: make MH Paid column inline-editable
Add PATCH /api/payments/:id/mh-paid-amount for direct value updates.
Clicking the MH Paid cell opens an input; Enter/blur saves and refreshes,
Escape cancels. Dash placeholder is also clickable to enter a value.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 17:50:52 -04:00
Gitead
1196e2afee feat: add Check MH Payment automation and MH Paid column
- Add selenium_MHPaymentCheckWorker.py: logs into MassHealth portal, navigates to Search Claims, enters claim number, extracts totalPaidAmount from results table
- Register /mh-payment-check endpoint in Selenium agent
- Add mhPaidAmount field to Payment model with migration
- Add PATCH /api/payments/:id/mh-payment-check backend route: fetches MH credentials, calls selenium, stores result
- Add Claim No. column (MassHealth claim number) as first data column in payments table
- Move Payment ID and Claim ID columns to end of table
- Add MH Paid column showing mhPaidAmount in green
- Wire Check MH Payment button to call API for each selected payment and refresh table

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 15:12:56 -04:00
Gitead
4989201c62 feat: add AI settings routes, storage, UI card, and migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 08:58:58 -04:00
Gitead
8c162d7040 feat: add Check Payments Online section and multi-select checkboxes on payments page
- Added Check Payments Online card above Payment's Records with From/To date pickers and Check All MH Payment button (logic TBD)
- Added multi-select checkboxes to each payment record row with select-all header checkbox
- When records are checked, a Check MH Payment action bar appears with count and clear option (logic TBD)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 07:54:24 -04:00
Gitead
ceb95f1915 feat: add Procedure Duration/Time Slot settings and custom appointment type
- Add Settings > Advanced > Procedure Duration/Time Slot page with three sections:
  1. Procedure Duration: CDT codes with durations (editable table, save per section)
  2. Doctor Time Slot: drag-to-block visual grid (A/B/C columns, 8 AM–9 PM, edit/delete slots)
  3. Hygienist Time Slot: procedure descriptions with durations
- Backend: ProcedureTimeslot Prisma model, storage, and GET/PUT /api/procedure-timeslot route
- DB migration: procedure_timeslot table
- Appointment form: when type is "Other", show a free-text input for custom description; saved as other:<description> and decoded for display on the schedule card

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 23:08:34 -04:00
Gitead
fea0dd4d59 feat: extend schedule to 9 PM and make appointments span multiple rows by duration
- Time slots now run 8:00 AM – 9:00 PM (was 8:00 AM – 6:00 PM)
- Appointments visually span the correct number of 15-min rows based on startTime/endTime using HTML rowSpan
- Covered rows are skipped so the grid layout stays consistent

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 22:17:00 -04:00
Gitead
800008792a feat: add Office Contact settings page and reorder Advanced sidebar
- Add OfficeContact Prisma model with receptionist name, dentist name, phone, email, fax fields
- Create GET/PUT /api/office-contact backend route and storage
- Add OfficeContactCard frontend component under Settings > Advanced
- Reorder Advanced sidebar: Office Hours → Office Contact → Twilio Settings → Google AI Settings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 21:19:30 -04:00
Gitead
2312ad66ca feat: add schedule column labels, office hours enforcement, and appointment move fix
- Schedule columns default to labels A–F (localStorage, per-browser, click to rename)
- Settings → Advanced → Office Hours: configure Doctors (A-C) and Hygienists (D-F) AM/PM hours per weekday
- Gray out schedule slots outside office hours; override dialog for manual exceptions
- Override Office Hours toggle: select specific dates where all slots are open
- Fix appointment move: send only real DB fields to avoid Zod strict-mode rejection of computed fields (hasProcedures, hasClaimWithNumber)
- Fix backend PUT /appointments: safe error logging to prevent Prisma error crashing Node inspect
- Add OfficeHours Prisma model and GET/PUT /api/office-hours route

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-05 09:15:18 -04:00
Gitead
70ffd8398b fix: reduce USB backup retention from 30 to 15 files
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 21:36:43 -04:00
Gitead
79e20b693d feat: improve backup management, settings UI, and Twilio webhooks
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 00:52:42 -04:00
Gitead
5689269690 feat: add Twilio SMS/call integration with settings, templates, and conversation history 2026-05-02 20:18:58 -04:00
Gitead
b73b8c97c6 docs: add nginx deploy instructions and fix Authorization header config
- Add proxy_set_header Authorization to /api/ location (required or token is stripped)
- Add Step 11 to README explaining how to install the nginx config

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 13:17:19 -04:00
Gitead
3d409d4a84 fix: add patient form validation and auth proxy
- Fix dateOfBirth default from empty string to null (caused Invalid date error)
- Add noValidate to form to prevent browser native email validation blocking submit
- Reset form when switching from edit to add mode
- Export API_BASE_URL from queryClient; switch patient table to raw fetch (prevents token wipe on 401)
- Add Authorization header forwarding in Vite proxy (was stripped by nginx Connection:upgrade)
- Make only firstName, lastName, dateOfBirth, phone required; gender optional
- Add +1 prefix to phone number input (stores as 1XXXXXXXXXX)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 13:15:00 -04:00
Gitead
e26ebf7fd5 feat: fix DDMA eligibility — patient list, name extraction, PDF page, OTP session
- Filter patient list by userId so each user sees only their own patients
- Sort patients by updatedAt DESC so recently checked patients appear first
- Add updatedAt field to Patient model (DB migration via raw SQL + db:generate)
- Fix DDMA name extraction: read from detail page "Name:" label, not search
  results row text which included appended dates
- Fix PDF capture: use driver.get() instead of click() to avoid race condition
  that was saving the search results page instead of the patient detail page
- Strip trailing bare dates from extracted names (e.g. "Rodriguez 04/27/2026")
- Handle "Last, First" comma format and single-word last names in splitName
- Normalize insuranceId consistently in createOrUpdatePatientByInsuranceId
- Fix OTP persistent session: stop clearing LocalStorage/IndexedDB on startup
  (these hold the DDMA device trust token that skips OTP on subsequent logins)
- Increase post-navigation wait time for full page render before PDF generation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 21:40:04 -04:00
Gitead
24bbaed6ab fix: invalidate appointments query after claim submitted via claims/preauth page
When a claim was submitted through the claims/preauth page, the schedule
page appointment color did not update because the appointments query cache
was never invalidated after the selenium job completed. Added invalidation
of QK_APPOINTMENTS_BASE in handleMHSeleniumPdfDownload so the schedule
page refetches and reflects the new claim color.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-30 22:15:23 -04:00
Gitead
763a322e79 fix: wait for table rows before extracting eligibility data; add batch claim PDF download 2026-04-30 15:38:29 -04:00
Gitead
d8f852741a fix: fix remote browser socket connection and related updates 2026-04-30 11:52:58 -04:00
Gitead
441cfcc8e3 feat: add password visibility toggle in Admin Settings and Add New Users 2026-04-29 22:54:51 -04:00
Gitead
371dea54f7 feat: add Chart section, colorize sidebar icons, rename nav items, patient action buttons, program bridge 2026-04-28 21:38:35 -04:00
Gitead
5d0d92d524 chore: remove SeleniumServiceold folder 2026-04-28 10:40:59 -04:00
Gitead
efe73410e7 feat: appointment card colors by status, MassHealth badge, date nav controls
- Default card color: light (bg-slate-100 / dark text)
- Blue card when procedures selected, gray when claim has a number
- Status badge: green/red from appointment or patient-level MassHealth status
- Solid dot badge (removed ring), overflow-visible to prevent corner clipping
- Date nav: << < [today circle] > >> for week/day jumps

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 10:09:08 -04:00
Gitead
dfa04981c5 feat: open select procedures inline on appointments page instead of navigating to claims 2026-04-27 22:53:40 -04:00
Gitead
637982bc3e feat: rename Eligibility/Claim Status to Eligibility, block appointment redirect when insurance inactive 2026-04-27 21:07:01 -04:00
Gitead
2a49695125 feat: rename MH Status to MH Eligibility&Appointment, add MH Eligibility&Claims/PreAuth button 2026-04-27 19:44:18 -04:00
Gitead
da7038e051 feat: cloud storage updates, claims storage, appointment and insurance routes 2026-04-27 00:29:11 -04:00
Gitead
3e899376c3 feat: Select Procedures flow, batch-column NPI provider fix, auto PDF save
- Add 'Select Procedures' right-click option on appointment page (separate from Claims/PreAuth)
- Select Procedures form saves CDT codes + NPI provider to AppointmentProcedure storage
- Remove Save button from insurance claim form; Claims/PreAuth opens for insurance submission only
- Claims/PreAuth auto-prefills from saved procedures including NPI provider
- Batch-column: procedures npiProviderId takes priority over stale claim npiProviderId
- Batch-column: auto-save PDF to patient Documents after successful submission (no socket needed)
- Add npiProviderId column to AppointmentProcedure table (prisma db push)
- Fix 'invalid db creation invocation': guard staffId, npiProviderId, procedureDate as Date object, totalBilled NaN guard
- Add full error logging to batch-column catch block

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 00:25:24 -04:00
Gitead
a279a3e7c1 fix: resolve appointment form validation and socket connection issues
- Fix status enum in browser.ts (uppercase → lowercase values)
- Fix date validation (z.string → z.coerce.date) so form accepts Date objects
- Add missing type/userId/title fields to browser.ts appointment schema
- Replace nested PatientSearch Select with simple inline Input to fix patient selection
- Fix mutationFn to throw on non-ok responses so backend errors surface correctly
- Connect socket.io directly to backend (port 5000) instead of Vite proxy to fix AggregateError on startup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 23:30:08 -04:00
Gitead
4f8a211bf1 fix: pass socketId from frontend, update claim status to REVIEW, save confirmation as PDF not screenshot 2026-04-23 23:29:12 -04:00
Gitead
ca7797841f fix: use rendering provider from claim form for MassHealth dentist search, default to Mary Scannell, select first office option 2026-04-23 00:25:11 -04:00
Gitead
1414ec11fd fix: MH eligibility - auto-select first provider, fix PDF double-quit bug 2026-04-22 14:35:57 -04:00
Gitead
5e7f0ceb07 fix: use relative API URLs and allow any LAN IP for CORS 2026-04-21 23:18:33 -04:00
Gitead
d8180ca0ed fix: update PatientDataExtractorService requirements to use fastapi instead of flask
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 23:06:24 -04:00
Gitead
84f635b770 fix: correct MassHealth date format and update procedure combo labels
- Fix Selenium using today's date instead of selected service date; convert YYYY-MM-DD from frontend to MM/DD/YYYY for MassHealth input
- Rename "New Patient (Limited exam+Pano)" → "Patient (Limited exam+Pano)"
- Rename "New Adult Patient (Limited exam+1PA)" → "Patient (Limited exam+1PA)"
- Add "Patient (D9110+1PA)" combo with codes D9110, D0220

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 22:37:45 -04:00
Gitead
25809d8802 feat: add New Adult Patient (Limited exam+1PA) combo with D0140, D0220 2026-04-18 22:17:29 -04:00
Gitead
51d1fe0109 feat: add New Patient (Limited exam+Pano) combo with D0140, D0330 2026-04-18 21:57:52 -04:00
Gitead
f126fb7364 docs: use venv python for SeleniumService run command 2026-04-18 21:48:01 -04:00
Gitead
1a9b0ee928 docs: update Step 8 — Python deps now installed automatically via npm install 2026-04-18 20:55:13 -04:00
Gitead
38f56decb1 fix: use venv for Python services to support Debian 13 managed environment 2026-04-18 20:50:47 -04:00
Gitead
74f930b69a docs: update Step 5 PostgreSQL setup for Debian (md5 auth, dentalapp db) 2026-04-18 19:57:17 -04:00
Gitead
14c534d57d feat: show attachment filenames in claims and payments tables 2026-04-18 11:46:14 -04:00
Gitead
37a0568b5e fix: MH claim submit — wait for socket job:update before fetching PDF and claim number 2026-04-18 09:53:41 -04:00
Gitead
5d1275d628 fix: UnitedSCO status always inactive and missing patient name 2026-04-18 09:25:02 -04:00
Gitead
c8cb649e25 fix: CCA login — proper portal detection, robust field entry, input diagnostics 2026-04-18 09:15:13 -04:00
Gitead
4505d5db85 feat: DentaQuest eligibility — PLAN_NOT_ACCEPTED status, DOB save, no retries
- Add PLAN_NOT_ACCEPTED to PatientStatus enum (prisma schema + db push)
- Selenium: return "plan not accepted" eligibility text instead of collapsing to inactive
- Backend processor: map "plan not accepted" → PLAN_NOT_ACCEPTED, fix insuranceProvider label
- _shared.ts: save DOB for existing patients when field is currently empty
- Frontend: show amber "Plan Not Accepted" badge in patient table and detail panel
- patient-form.tsx: display "Plan Not Accepted" label in status dropdown
- BullMQ: set attempts=1 (no retry on selenium failure)
- DDMA: remove first/last name from search (member ID + DOB only)
- patient-types.ts: allow alphanumeric insurance IDs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 23:47:50 -04:00
Gitead
f5ec4a1480 feat: wire Tufts SCO to DentaQuest portal and fix insurance credential dropdown
- Add /dentaquest-eligibility endpoint in Python agent (Tufts SCO uses providers.dentaquest.com)
- Add backend route, processor, and service client for Tufts SCO (separate from UnitedSCO/DentalHub)
- Fix Tufts SCO button to post to new tuftssco route instead of unitedsco
- Fix credential field names: dentaquestUsername/Password (was tuftsscoUsername/Password)
- Fix socket event: listen for selenium:dentaquest_session_started (was unitedsco)
- Fix error visibility: keep session alive 30s on error so backend reads real message
- Replace free-text Site Key field with dropdown to prevent key mismatches

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 00:59:24 -04:00
Gitead
b6700eceee fix: revert Deltains button label 2026-04-17 00:14:46 -04:00
Gitead
a222e22014 feat: reorganize eligibility buttons and update labels 2026-04-16 23:48:02 -04:00
Gitead
a801728972 fix: restore credentials section and add missing User migration
- Use useAuth() in CredentialTable instead of a separate /api/users/ fetch
  that was failing silently and hiding the entire credentials section
- Add migration for autoBackupEnabled/usbBackupEnabled columns on User
  that were in the Prisma schema but missing from the database, causing
  a 500 error on login

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 16:50:43 -04:00
Gitead
f6adb75f4f fix: add bullmq, fix login error logging, regenerate zod schemas 2026-04-16 15:50:34 -04:00
ff
7fa7f405e2 feat: integrate DeltaIns, Tufts SCO, United SCO, and CCA eligibility checks 2026-04-16 15:02:50 -04:00