diff --git a/src/api/v1/router.py b/src/api/v1/router.py index 25e6731..b6eb394 100644 --- a/src/api/v1/router.py +++ b/src/api/v1/router.py @@ -46,6 +46,7 @@ async def estimate(request: models.EstimationRequest): raise e except Exception as e: print("Exception in estimate: ", e) + raise e raise HTTPException( status_code=500, detail=f"Server error: {str(e)}" diff --git a/src/services/estimation_service_v2.py b/src/services/estimation_service_v2.py index d0d38cf..1fafd34 100644 --- a/src/services/estimation_service_v2.py +++ b/src/services/estimation_service_v2.py @@ -232,13 +232,14 @@ class EstimationService: applicant_tier = tier break - weight_min, weight_max = HEIGHT_WEIGHT_TABLE[(applicant.heightFt, applicant.heightIn)] - if applicant.weight < weight_min: - is_dtq = True - reason = "Declined due to low BMI of one or more applicants" - elif applicant.weight > weight_max: - is_dtq = True - reason = "Declined due to high BMI of one or more applicants" + if (applicant.heightFt, applicant.heightIn) in HEIGHT_WEIGHT_TABLE: + weight_min, weight_max = HEIGHT_WEIGHT_TABLE[(applicant.heightFt, applicant.heightIn)] + if applicant.weight < weight_min: + is_dtq = True + reason = "Declined due to low BMI of one or more applicants" + elif applicant.weight > weight_max: + is_dtq = True + reason = "Declined due to high BMI of one or more applicants" rx_spend_applicant = self.calculate_rx_spend(phq, applicant_id) rx_spend += rx_spend_applicant