feat: MassHealth service history extraction, shown in Patient Details
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -128,6 +128,17 @@ export async function runCmspEligibilityHistoryRemainingProcessor(
|
||||
if (Object.keys(updates).length > 0) {
|
||||
await storage.updatePatient(patient.id, updates);
|
||||
}
|
||||
|
||||
// Only replace when rows came back — an empty read may just mean the portal
|
||||
// was slow, and shouldn't wipe history saved by an earlier check.
|
||||
if (Array.isArray(seleniumResult.service_history) && seleniumResult.service_history.length > 0) {
|
||||
try {
|
||||
await storage.replacePatientServiceHistory(patient.id, seleniumResult.service_history);
|
||||
} catch (e: any) {
|
||||
console.error("[cmspProcessor] saving service history failed:", e.message);
|
||||
}
|
||||
}
|
||||
|
||||
outputResult.patientUpdateStatus = newStatus
|
||||
? `Patient status updated to ${newStatus}`
|
||||
: "Eligibility unknown — status not changed";
|
||||
|
||||
Reference in New Issue
Block a user