Spaces:
Sleeping
Sleeping
| import random | |
| def simulate_journey(claim_type, complexity, adjuster_experience, satisfaction_target): | |
| """ | |
| Simulate claims journey with timeline, decision points, and projections | |
| Args: | |
| claim_type: Type of claim (Auto, Property, Liability, Workers Comp, Health) | |
| complexity: Complexity level (Simple, Moderate, Complex, Very Complex) | |
| adjuster_experience: Years of adjuster experience (0-20) | |
| satisfaction_target: Target customer satisfaction percentage (0-100) | |
| Returns: | |
| dict with timeline, decision_points, estimated_duration, cost_projection, risk_factors | |
| """ | |
| # Base timeline by claim type | |
| base_timelines = { | |
| "Auto": [ | |
| {"day": 0, "event": "FNOL received"}, | |
| {"day": 1, "event": "Adjuster assigned"}, | |
| {"day": 3, "event": "Vehicle inspection completed"}, | |
| {"day": 5, "event": "Estimate approved"}, | |
| {"day": 12, "event": "Repairs completed"}, | |
| {"day": 13, "event": "Final inspection"}, | |
| {"day": 14, "event": "Claim closed"} | |
| ], | |
| "Property": [ | |
| {"day": 0, "event": "FNOL received"}, | |
| {"day": 1, "event": "Adjuster assigned"}, | |
| {"day": 2, "event": "Property inspection scheduled"}, | |
| {"day": 5, "event": "Damage assessment completed"}, | |
| {"day": 7, "event": "Estimate approved"}, | |
| {"day": 21, "event": "Repairs completed"}, | |
| {"day": 22, "event": "Final walkthrough"}, | |
| {"day": 23, "event": "Claim closed"} | |
| ], | |
| "Liability": [ | |
| {"day": 0, "event": "FNOL received"}, | |
| {"day": 1, "event": "Adjuster assigned"}, | |
| {"day": 3, "event": "Investigation initiated"}, | |
| {"day": 7, "event": "Witness statements collected"}, | |
| {"day": 14, "event": "Liability determination"}, | |
| {"day": 21, "event": "Settlement negotiation"}, | |
| {"day": 28, "event": "Settlement agreement"}, | |
| {"day": 30, "event": "Claim closed"} | |
| ], | |
| "Workers Comp": [ | |
| {"day": 0, "event": "FNOL received"}, | |
| {"day": 1, "event": "Case manager assigned"}, | |
| {"day": 2, "event": "Medical treatment authorized"}, | |
| {"day": 7, "event": "Medical evaluation completed"}, | |
| {"day": 14, "event": "Return to work assessment"}, | |
| {"day": 30, "event": "Ongoing treatment review"}, | |
| {"day": 45, "event": "Claim closed or continued"} | |
| ], | |
| "Health": [ | |
| {"day": 0, "event": "Claim received"}, | |
| {"day": 1, "event": "Initial review"}, | |
| {"day": 3, "event": "Medical necessity verification"}, | |
| {"day": 5, "event": "Claim processed"}, | |
| {"day": 7, "event": "Payment issued"}, | |
| {"day": 10, "event": "Claim closed"} | |
| ] | |
| } | |
| timeline = base_timelines.get(claim_type, base_timelines["Auto"]).copy() | |
| # Adjust timeline based on complexity | |
| complexity_multipliers = { | |
| "Simple": 0.7, | |
| "Moderate": 1.0, | |
| "Complex": 1.5, | |
| "Very Complex": 2.0 | |
| } | |
| multiplier = complexity_multipliers.get(complexity, 1.0) | |
| # Adjust timeline days | |
| for event in timeline: | |
| event["day"] = int(event["day"] * multiplier) | |
| # Adjust for adjuster experience (more experience = faster) | |
| if adjuster_experience > 10: | |
| experience_factor = 0.9 | |
| elif adjuster_experience > 5: | |
| experience_factor = 1.0 | |
| else: | |
| experience_factor = 1.1 | |
| for event in timeline: | |
| event["day"] = int(event["day"] * experience_factor) | |
| # Adjust for satisfaction target (higher target = more time for communication) | |
| if satisfaction_target > 90: | |
| satisfaction_factor = 1.1 | |
| elif satisfaction_target > 80: | |
| satisfaction_factor = 1.05 | |
| else: | |
| satisfaction_factor = 1.0 | |
| for event in timeline: | |
| event["day"] = int(event["day"] * satisfaction_factor) | |
| # Calculate estimated duration | |
| estimated_duration = max([event["day"] for event in timeline]) | |
| # Generate decision points | |
| decision_points = [] | |
| if claim_type == "Auto": | |
| decision_points = [ | |
| "Coverage verification", | |
| "Liability determination", | |
| "Estimate approval", | |
| "Repair shop selection" | |
| ] | |
| elif claim_type == "Property": | |
| decision_points = [ | |
| "Coverage verification", | |
| "Damage scope determination", | |
| "Contractor selection", | |
| "Additional living expenses approval" | |
| ] | |
| elif claim_type == "Liability": | |
| decision_points = [ | |
| "Liability assessment", | |
| "Coverage limits review", | |
| "Settlement authority", | |
| "Legal counsel involvement" | |
| ] | |
| elif claim_type == "Workers Comp": | |
| decision_points = [ | |
| "Compensability determination", | |
| "Medical treatment authorization", | |
| "Disability rating", | |
| "Return to work planning" | |
| ] | |
| else: # Health | |
| decision_points = [ | |
| "Medical necessity review", | |
| "Coverage verification", | |
| "Payment calculation", | |
| "Appeal handling if needed" | |
| ] | |
| # Add complexity-based decision points | |
| if complexity in ["Complex", "Very Complex"]: | |
| decision_points.append("Senior adjuster review") | |
| decision_points.append("Special investigation unit referral") | |
| # Calculate cost projection | |
| base_costs = { | |
| "Auto": 8500, | |
| "Property": 15000, | |
| "Liability": 25000, | |
| "Workers Comp": 12000, | |
| "Health": 3500 | |
| } | |
| base_cost = base_costs.get(claim_type, 10000) | |
| cost_projection = base_cost * multiplier | |
| # Adjust for experience (more experience = better cost control) | |
| if adjuster_experience > 10: | |
| cost_projection *= 0.95 | |
| elif adjuster_experience < 3: | |
| cost_projection *= 1.1 | |
| # Generate risk factors | |
| risk_factors = [] | |
| if complexity in ["Complex", "Very Complex"]: | |
| risk_factors.append("High complexity may lead to delays") | |
| if adjuster_experience < 3: | |
| risk_factors.append("Junior adjuster may require supervision") | |
| if satisfaction_target > 90: | |
| risk_factors.append("High satisfaction target requires extra communication") | |
| if claim_type == "Liability": | |
| risk_factors.append("Potential for litigation") | |
| if estimated_duration > 30: | |
| risk_factors.append("Extended duration may impact customer satisfaction") | |
| if not risk_factors: | |
| risk_factors.append("No significant risk factors identified") | |
| return { | |
| "timeline": timeline, | |
| "decision_points": decision_points, | |
| "estimated_duration": estimated_duration, | |
| "cost_projection": cost_projection, | |
| "risk_factors": risk_factors | |
| } | |