Plan Facts Parsing Analysis · v1
Single-class parse covering covered injuries (fractures, dislocations, burns, coma, concussion, dental, eye), wellness benefit, ambulance, prosthesis, physical therapy, hospital benefits, AD&D, and four-tier composite rates.
Two field-naming questions and a missing Type field.
The parser is structurally clean. Three small items: Surgery Benefit gets stored in a knee-cartilage-named field (likely a misnomer), Emergency Room Benefit's name suggests broader scope than it captures, and Emergency Room benefit has no Type field while every other injury benefit does.
Single-class. $class = $data['Accident']['Classes'][0] at line 1372. No multi-class iteration.
| Plan Facts field | Quote field | Notes |
|---|---|---|
| Plan Name | name | Direct |
| Coverage Type.[Class].Coverage Type | accidentCoverageType | "24 Hour" / "Off Job" |
| Participation.[Class].Minimum Participation % | accidentParticipationRequired | Strip % |
| Participation.[Class].Minimum Enrolled Lives | accidentMinimumLives | Numeric |
| Wellness Benefit.[Class].Employee | accidentWellnessBenefit | Direct |
| Accidental Death Benefit.[Class].Employee/Spouse/Child | accidentADDCoverage + accidentEmployeeADDCoverage + accidentSpouseADDCoverage + accidentChildrenADDCoverage | Sets accidentADDCoverage="Included" if any filled |
| Ambulance Benefit.[Class].Ground / Air Benefit Amount | accidentAmbulanceGround, accidentAmbulanceAir | Currency stripped |
| Hospital Benefit.[Class].Admission / Daily / Max | accidentHospitalConfinementDailyInitial, accidentHospitalConfinementDailyPerDay, accidentHospitalPerDayLimitDays | + accidentHospitalConfinement = "Included" |
| Emergency Room Admission Benefit.[Class].Benefit Amount | accidentEmergencyMedicalExpense | ⚠ Field name suggests broader scope; no Type field (line 1513) |
| Prosthesis Benefit.[Class].Benefit Amount | accidentProsthesisCurrency + Type + Select | Currency, $, "Benefit" |
| Physical Therapy Benefit.[Class].Per Visit / Max | accidentPhysicalTherapyPerVisit, accidentPhysicalTherapyMaxVisits | Currency stripped |
| Rehabilitation Unit Benefit.[Class].Daily / Max | accidentRehabUnitPerDay, accidentRehabUnitMaxDays | Currency stripped |
| Dislocations / Fractures / Burns Benefit.[Class].Benefit Maximum | accidentDislocationCurrency, accidentFractureCurrency, accidentBurnCurrency (+ Type + Select each) | Currency, $, "Up to" |
| Surgery Benefit.[Class].Benefit Maximum | accidentKneeCartilageWithSurgicalRepairCurrency (+ Type + Select) | ⚠ Surgery → knee cartilage field (line 1598) |
| Coma / Concussion / Dental Injury / Eye Injury Benefit.[Class].Benefit Amount | accidentComaCurrency, accidentConcussionCurrency, accidentDentalInjuryCurrency, accidentEyeInjuryWithSurgicalRepairCurrency (+ Type + Select each) | Currency, $, "Benefit" |
| Organized Sports Benefit.[Class].Benefit Amount | accidentOrganizedSportBenefit | Direct |
| Portability.[Class].Portability | accidentPortability | Included / Not Included |
| Rates.[Class].Employee Only / + Spouse / + Children / Family | accidentEE, accidentES, accidentEC, accidentEF | Currency stripped (line 1679) |
The "Surgery Benefit" Plan Facts field is assigned to accidentKneeCartilageWithSurgicalRepairCurrency. Either (a) "Surgery Benefit" in this carrier's Plan Facts schema actually corresponds to knee cartilage repair specifically, or (b) the Quote field name is a misnomer and should be a more general surgery benefit field. Worth a verify with a broker.
In app/Services/PlanfactService.php around lines 1598–1605, inside parseQuoteAccident(), the Plan Facts field "Surgery Benefit.[Class].Benefit Maximum" is being assigned to: - accidentKneeCartilageWithSurgicalRepairCurrency - accidentKneeCartilageWithSurgicalRepairCurrencyType - accidentKneeCartilageWithSurgicalRepairSelect The field names suggest knee cartilage specifically, but the source is a generic "Surgery Benefit". Either the source is more specific than its name suggests, or the Quote field should be more general. Please: 1. Show me the current assignment. 2. Find the form template that displays accidentKneeCartilageWithSurgicalRepair*. Confirm whether the form treats it as knee-cartilage-specific or general surgery. 3. Recommend: rename the Quote field to accidentSurgeryCurrency (and Type / Select), or rename the source path to a more specific Plan Facts key if one exists. 4. Don't change anything yet — show the proposed end-to-end change.
Every other injury / benefit field has a paired …Type field that records whether the value is $ or %. Emergency Room benefit doesn't. If the form expects accidentEmergencyMedicalExpenseType, it'll be unset.
In app/Services/PlanfactService.php at lines 1513–1518, inside parseQuoteAccident(), the Emergency Room Admission Benefit value is assigned to accidentEmergencyMedicalExpense, but no Type field (e.g., accidentEmergencyMedicalExpenseType) is set. Other injury benefits in this same parser do set a Type field (typically '$' or '%'). Please: 1. Show me the current assignment for Emergency Room. 2. Look at the form template — does it expect accidentEmergencyMedicalExpenseType? 3. If yes, add the Type assignment by inferring '$' or '%' from the value (consistent with how other benefits in this parser handle it). 4. If no, add a code comment explaining why ER doesn't need Type while other benefits do.
The Plan Facts source is "Emergency Room Admission Benefit" but the Quote field is named accidentEmergencyMedicalExpense. The Quote field name suggests a broader scope. Worth confirming the field intent.
In app/Services/PlanfactService.php at lines 1513–1518, inside parseQuoteAccident(), the source field "Emergency Room Admission Benefit" is assigned to a Quote field named accidentEmergencyMedicalExpense. The names don't quite match — "Emergency Medical Expense" sounds broader than "Emergency Room Admission". Please: 1. Confirm whether the Quote field accidentEmergencyMedicalExpense is intended to capture Emergency Room admission specifically, or a broader emergency medical expense. 2. Show me the form template's label for this field. 3. Recommend either renaming the Quote field to accidentEmergencyRoomAdmission, or confirming the broader intent and (if needed) finding additional Plan Facts sources to populate it.
Rename the Quote field to a general Surgery field, or confirm the carrier's Surgery Benefit really is knee-specific.
Match the pattern of other injury benefits, or document why it's intentionally absent.
Rate Basis is read but not stored. Add a comment confirming it's intentional.
| File | Lines | Purpose |
|---|---|---|
| app/Services/PlanfactService.php | 233 | Accident endpoint config |
| app/Services/PlanfactService.php | 459 | Dispatch to parseQuoteAccident |
| app/Services/PlanfactService.php | 1365–1701 | Full parser |
| app/Services/PlanfactService.php | 1372 | Single-class selection |
| app/Services/PlanfactService.php | 1513–1518 | Emergency Room benefit (concerns) |
| app/Services/PlanfactService.php | 1598–1605 | Surgery → KneeCartilage field |
| app/Services/PlanfactService.php | 1679–1698 | Rates extraction |