diff --git a/src/services/estimation_service_v2.py b/src/services/estimation_service_v2.py index 22829e6..7616a5c 100644 --- a/src/services/estimation_service_v2.py +++ b/src/services/estimation_service_v2.py @@ -55,7 +55,7 @@ BASE_TIERS = { } HEIGHT_WEIGHT_TABLE = { - (4, 2): (54, 60, 125, 151), + (4, 2): (54, 60, 125, 150), (4, 3): (56, 63, 130, 156), (4, 4): (59, 65, 136, 162), (4, 5): (60, 68, 141, 169), @@ -286,6 +286,13 @@ UNINSURABLE_MEDICATIONS = [ "zoledronic acid" ] +UNINSURABLE_ISSUES = [ + "alcohol", "alzheimer_disease", "chronic_pulmonary_disorder", "copd", "hepatitis", "liver_disorder", + "myasthenia_gravis", "organ_transplant", "other_cognitive", "nebulizer", "aids", "als", "amputation", + "cancer", "cirrhosis", "emphysema", "multiple_sclerosis", "nervous_disorder", "osteoarthritis", + "parkinson_disease", "senile_dementia", "systemic_lupus", +] + class EstimationService: def __init__(self): self.base_url = settings.TALESTORM_API_BASE_URL @@ -333,6 +340,8 @@ class EstimationService: return True, "Applicant is pregnant" for issue in phq.issues: + if issue.key in UNINSURABLE_ISSUES: + return True, f"Uninsurable issue: {issue.key}" if issue.key == "surgery": for detail in issue.details: if detail.key == "not_performed": @@ -342,7 +351,8 @@ class EstimationService: if condition.key in uninsurable_conditions: return True, f"Applicant have uninsurable condition: {condition.key}" - # issues would be checked by AI + + # issues would be partially checked by AI return False, "" def calculate_age(self, born): @@ -459,7 +469,8 @@ class EstimationService: plan_coverage = self.get_plan_coverage(plans[0]) rx_spend = 0 - for applicant_id, applicant in enumerate(applicants): + for applicant in applicants: + applicant_id = applicant.applicant applicant_review_reasons = [] applicant_dtq_reasons = [] applicant_accept_reasons = []