feat: secondary insurance; SCO primary + MassHealth secondary rule; United SCO service history
- Patient: new secondaryInsuranceProvider / secondaryInsuranceId (form section, Patient Details, merge fill) - MassHealth check on an SCO patient (Tufts SCO / United SCO primary), matched by MassHealth ID on file as secondary or by the single SCO patient with the same DOB (name must share a word when the portal returns one): MassHealth saved as secondary, primary plan/ID/status unchanged, MassHealth history not imported, PDF still saved to Eligibility documents. Prevents the name+DOB fallback from overwriting the SCO ID - United SCO check: a MassHealth patient moved to United SCO keeps the old MassHealth ID as secondary; reads Dental Hub Service History and saves it - Service history saves drop duplicate identical lines - Chatbot: bare 100… member ID + DOB with no patient/insurance defaults to MassHealth Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -59,44 +59,46 @@ model User {
|
||||
}
|
||||
|
||||
model Patient {
|
||||
id Int @id @default(autoincrement())
|
||||
firstName String
|
||||
lastName String
|
||||
dateOfBirth DateTime? @db.Date
|
||||
gender String
|
||||
phone String
|
||||
email String?
|
||||
address String?
|
||||
city String?
|
||||
state String? @default("MA")
|
||||
zipCode String?
|
||||
insuranceProvider String?
|
||||
insuranceId String?
|
||||
groupNumber String?
|
||||
policyHolder String?
|
||||
policyHolderPatientId Int? // patient record of the policy holder, when picked from the DB
|
||||
policyHolderRelationship String? // ADA box 18: SELF | SPOUSE | DEPENDENT | OTHER
|
||||
allergies String?
|
||||
medicalConditions String?
|
||||
preferredLanguage String? @default("English")
|
||||
status PatientStatus @default(UNKNOWN)
|
||||
remainingBenefit String?
|
||||
thirdPartyInsurance String?
|
||||
userId Int
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
appointments Appointment[]
|
||||
procedures AppointmentProcedure[]
|
||||
claims Claim[]
|
||||
groups PdfGroup[]
|
||||
payment Payment[]
|
||||
communications Communication[]
|
||||
documents PatientDocument[]
|
||||
conversation PatientConversation?
|
||||
cloudFolders CloudFolder[] @relation("PatientCloudFolder")
|
||||
serviceHistory PatientServiceHistory[]
|
||||
preauthHistory PatientPreauthHistory[]
|
||||
id Int @id @default(autoincrement())
|
||||
firstName String
|
||||
lastName String
|
||||
dateOfBirth DateTime? @db.Date
|
||||
gender String
|
||||
phone String
|
||||
email String?
|
||||
address String?
|
||||
city String?
|
||||
state String? @default("MA")
|
||||
zipCode String?
|
||||
insuranceProvider String?
|
||||
insuranceId String?
|
||||
groupNumber String?
|
||||
policyHolder String?
|
||||
policyHolderPatientId Int? // patient record of the policy holder, when picked from the DB
|
||||
policyHolderRelationship String? // ADA box 18: SELF | SPOUSE | DEPENDENT | OTHER
|
||||
secondaryInsuranceProvider String? // second plan, e.g. MassHealth for a United SCO member
|
||||
secondaryInsuranceId String?
|
||||
allergies String?
|
||||
medicalConditions String?
|
||||
preferredLanguage String? @default("English")
|
||||
status PatientStatus @default(UNKNOWN)
|
||||
remainingBenefit String?
|
||||
thirdPartyInsurance String?
|
||||
userId Int
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
appointments Appointment[]
|
||||
procedures AppointmentProcedure[]
|
||||
claims Claim[]
|
||||
groups PdfGroup[]
|
||||
payment Payment[]
|
||||
communications Communication[]
|
||||
documents PatientDocument[]
|
||||
conversation PatientConversation?
|
||||
cloudFolders CloudFolder[] @relation("PatientCloudFolder")
|
||||
serviceHistory PatientServiceHistory[]
|
||||
preauthHistory PatientPreauthHistory[]
|
||||
|
||||
@@index([insuranceId])
|
||||
@@index([createdAt])
|
||||
|
||||
Reference in New Issue
Block a user