All benefits

Plan Facts Parsing Analysis · v1

Accident

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.

Endpoint
POST /accident
Parse method
parseQuoteAccident()
Source range
PlanfactService.php:1365–1701
Source pull
plansight - Bit Bucket Pull 4.26

Bottom line

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.

Per-class handling

Single-class. $class = $data['Accident']['Classes'][0] at line 1372. No multi-class iteration.

What's mapped

Plan Facts fieldQuote fieldNotes
Plan NamenameDirect
Coverage Type.[Class].Coverage TypeaccidentCoverageType"24 Hour" / "Off Job"
Participation.[Class].Minimum Participation %accidentParticipationRequiredStrip %
Participation.[Class].Minimum Enrolled LivesaccidentMinimumLivesNumeric
Wellness Benefit.[Class].EmployeeaccidentWellnessBenefitDirect
Accidental Death Benefit.[Class].Employee/Spouse/ChildaccidentADDCoverage + accidentEmployeeADDCoverage + accidentSpouseADDCoverage + accidentChildrenADDCoverageSets accidentADDCoverage="Included" if any filled
Ambulance Benefit.[Class].Ground / Air Benefit AmountaccidentAmbulanceGround, accidentAmbulanceAirCurrency stripped
Hospital Benefit.[Class].Admission / Daily / MaxaccidentHospitalConfinementDailyInitial, accidentHospitalConfinementDailyPerDay, accidentHospitalPerDayLimitDays+ accidentHospitalConfinement = "Included"
Emergency Room Admission Benefit.[Class].Benefit AmountaccidentEmergencyMedicalExpenseField name suggests broader scope; no Type field (line 1513)
Prosthesis Benefit.[Class].Benefit AmountaccidentProsthesisCurrency + Type + SelectCurrency, $, "Benefit"
Physical Therapy Benefit.[Class].Per Visit / MaxaccidentPhysicalTherapyPerVisit, accidentPhysicalTherapyMaxVisitsCurrency stripped
Rehabilitation Unit Benefit.[Class].Daily / MaxaccidentRehabUnitPerDay, accidentRehabUnitMaxDaysCurrency stripped
Dislocations / Fractures / Burns Benefit.[Class].Benefit MaximumaccidentDislocationCurrency, accidentFractureCurrency, accidentBurnCurrency (+ Type + Select each)Currency, $, "Up to"
Surgery Benefit.[Class].Benefit MaximumaccidentKneeCartilageWithSurgicalRepairCurrency (+ Type + Select)Surgery → knee cartilage field (line 1598)
Coma / Concussion / Dental Injury / Eye Injury Benefit.[Class].Benefit AmountaccidentComaCurrency, accidentConcussionCurrency, accidentDentalInjuryCurrency, accidentEyeInjuryWithSurgicalRepairCurrency (+ Type + Select each)Currency, $, "Benefit"
Organized Sports Benefit.[Class].Benefit AmountaccidentOrganizedSportBenefitDirect
Portability.[Class].PortabilityaccidentPortabilityIncluded / Not Included
Rates.[Class].Employee Only / + Spouse / + Children / FamilyaccidentEE, accidentES, accidentEC, accidentEFCurrency stripped (line 1679)

Plan-level / not mapped

Potentially mapped incorrectly

Surgery Benefit maps to a knee-cartilage-named field PlanfactService.php:1598–1605

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.

Cursor prompt
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.
Emergency Room benefit lacks a Type field PlanfactService.php:1513–1518

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.

Cursor prompt
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.
Field-name scope mismatch on Emergency Room PlanfactService.php:1513–1518

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.

Cursor prompt
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.

Manual-entry-only fields

Recommendations

  1. Resolve the Surgery → KneeCartilage field naming Hour

    Rename the Quote field to a general Surgery field, or confirm the carrier's Surgery Benefit really is knee-specific.

  2. Add Type field to Emergency Room benefit 15 minutes

    Match the pattern of other injury benefits, or document why it's intentionally absent.

  3. Document Rate Basis handling 5 minutes

    Rate Basis is read but not stored. Add a comment confirming it's intentional.

Code references

FileLinesPurpose
app/Services/PlanfactService.php233Accident endpoint config
app/Services/PlanfactService.php459Dispatch to parseQuoteAccident
app/Services/PlanfactService.php1365–1701Full parser
app/Services/PlanfactService.php1372Single-class selection
app/Services/PlanfactService.php1513–1518Emergency Room benefit (concerns)
app/Services/PlanfactService.php1598–1605Surgery → KneeCartilage field
app/Services/PlanfactService.php1679–1698Rates extraction