From 9de11b64d68dadacff09f02db8250f69b4bcba7e Mon Sep 17 00:00:00 2001 From: bitbucket Date: Fri, 24 May 2024 09:04:41 +0530 Subject: [PATCH 1/2] CHANGE_ in active policy api eCardDownload key added : GWM --- app/Controllers/EmployeeRestController.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index f9c09741..84989af0 100644 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -2115,6 +2115,14 @@ function getEmployeeActiveOrInactivePolicy() if(isset($value['premium'])){ $si_premium_value = $si_premium_value + $value['premium'];} if(isset($value['gst'])){ $si_gst_value = $si_gst_value + $value['gst'];} } + + + if($employee_policy[0]->tpa_id != null) + $data['eCardDownload'] = base_url('download-e-card/') . $employee_policy[0]->rand_string; + else + $data['eCardDownload'] = null; + + $data['si_value'] = $si_value; $data['si_premium_value'] = ($ClientPolicyValue['policy_type_id'] == 1 || $ClientPolicyValue['policy_type_id'] == 2) ? 0 : $si_premium_value; From a173d50c8fd6114e571dc07581fa2b029717cafd Mon Sep 17 00:00:00 2001 From: bitbucket Date: Fri, 24 May 2024 09:47:17 +0530 Subject: [PATCH 2/2] CHANGE_ in active policy api eCardDownload key added : GWM --- app/Controllers/EmployeeRestController.php | 103 ++++++++++++++++++++- 1 file changed, 98 insertions(+), 5 deletions(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 84989af0..daf246d7 100644 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -2050,13 +2050,13 @@ function getEmployeeOldPolicy() function getEmployeeActiveOrInactivePolicy() { - if($this->request->getGet('type') == 'Active'){ $value = 1; }else{ $value = 0; } + if($this->request->getGet('type') == 'Active'){ $policy_status = 1; }else{ $policy_status = 0; } $ClientPolicyData = $this->clientPolicyModel->select('client_policy.* , policies.name as policy_name , policy_type.policy_type as policy_type') ->join('policies', 'client_policy.policy_id = policies.id', 'left') ->join('policy_type', 'client_policy.policy_type_id = policy_type.id', 'left') ->where('client_policy.client_id', $this->request->getGet('client_id') ) ->where('client_policy.is_active', 1 ) - ->where('client_policy.policy_status', $value) + ->where('client_policy.policy_status', $policy_status) ->orderby('client_policy.id' , 'ASC') ->findAll(); @@ -2076,7 +2076,13 @@ function getEmployeeActiveOrInactivePolicy() $result = []; foreach ($ClientPolicyData as $key => $ClientPolicyValue) { + + $terms = json_decode($ClientPolicyValue['policy_terms']); + + if($ClientPolicyValue['policy_type_id'] == 1){ $data['policy_terms'] = $this->policyTermsFiter($terms,'gpa'); } + else{ $data['policy_terms'] = $this->policyTermsFiter($terms,'gmc'); } + $data['client_id'] = $ClientPolicyValue['client_id']; $data['client_policy_id'] = $ClientPolicyValue['id']; $data['policy_name'] = $ClientPolicyValue['policy_name']; @@ -2085,7 +2091,7 @@ function getEmployeeActiveOrInactivePolicy() $data['policy_no'] = $ClientPolicyValue['policy_no']; $data['policy_start_date'] = $this->convertDateFormatDisplay($ClientPolicyValue['policy_start_date']); $data['policy_end_date'] = $this->convertDateFormatDisplay($ClientPolicyValue['policy_end_date']); - $data['policy_terms'] = $terms; + // $data['policy_terms'] = $terms; if($ClientPolicyValue['policy_type_id'] == 1){ $data['heading'] = 'Group Personal Accident Coverage'; }else if($ClientPolicyValue['policy_type_id'] == 2){ $data['heading'] = 'Group Medical Coverage'; }else @@ -2117,8 +2123,8 @@ function getEmployeeActiveOrInactivePolicy() } - if($employee_policy[0]->tpa_id != null) - $data['eCardDownload'] = base_url('download-e-card/') . $employee_policy[0]->rand_string; + if($employee_policy[0]['tpa_id'] != null) + $data['eCardDownload'] = base_url('download-e-card/') . $employee_policy[0]['rand_string']; else $data['eCardDownload'] = null; @@ -2143,6 +2149,93 @@ function getEmployeeActiveOrInactivePolicy() } +function policyTermsFiter($terms , $type) +{ + + $gpa = [ + "sumInsured2" => "Sum Insured", + "totalSumInsured" => "Total Sum Assured", + "self" => "Self", + "self_min_age" => "Min Age", + "self_max_age" => "Max Age", + "accidentalDeathBenefit" => "Accidental Death Benefit", + "permanentTotalDisablement" => "Permanent Total Disablement", + "permanentPartialDisablement" => "Permanent Partial Disablement", + "temporaryTotalDisablementBenefit" => "Temporary Total Disablement benefit", + "accidentalHospitalizationExpenses" => "Accidental Hospitalization Expenses", + "childrenEducationWelfareFund" => "Children Education Welfare Fund", + "compassionateVisitExpenses" => "Compassionate Visit Expenses", + "compassionateVisitExpensesData" => "Compassionate Visit Expenses Data", + "brokenBoneExpenses" => "Broken Bone Expenses", + "brokenBoneExpensesData" => "Broken Bone Expenses Data", + "ambulanceCharges" => "Ambulance charges", + "ambulanceChargesData" => "Ambulance charges Data", + "burnExpenses" => "Burn Expenses", + "burnExpensesData" => "Burn Expenses Data", + "carriageOfDeadBody" => "Carriage of Dead Body", + "carriageOfDeadBodyData" => "Carriage of Dead Body Data", + "animalSnakeInsectBite" => "Animal/Snake/Insect bite", + "terrorism" => "Terrorism", + "worldwideCover" => "Worldwide Cover" + ]; + + $gmc = [ + "sum_insured" => "Sum Insured", + "member_count" => "Elders Count:", + "other_member_min_age" => "Min Age:", + "other_member_max_age" => "Min Age:", + "waiverofpreexistingdiseases" => "Waiver of Pre-existing Diseases", + "9monthwaitingperiodwaived" => "9-month waiting Period –waived", + "coverfromthedateofjoining" => "Cover from the date of Joining", + "waiverof1,2,3&4thyearexclusions" => "Waiver of 1, 2, 3 & 4th year Exclusions", + "waiverof30dayswaitingperiod" => "Waiver of 30 days waiting period", + "prehospitalizationcover" => "Pre Hospitalization Cover", + "congenitaldiseasesinternal" => "Congenital Diseases - Internal", + "copayzonewisecopay" => "Co-Pay/Zone wise Co Pay", + "bioabsorbablestenttoriclensmultifocallens" => "Bio absorbable stent / Toric lens/ Multi Focal lens", + "roomrentlimit" => "Room Rent Limit", + "proportionatedeductionclause" => "Proportionate Deduction Clause", + "nursingallowance" => "Nursing Allowance", + "ailmentcapping" => "Ailment capping", + "ambulancecharges" => "Ambulance Charges", + "airambulance" => "Air Ambulance", + "familytransportationbenefit" => "Family Transportation Benefit", + "reasonableandcustomarycharges" => "Reasonable and Customary Charges", + "daycaretreatment" => "Day Care Treatment", + "ayudhtreatmentcover" => "AYUSH treatment cover", + "armdcovered" => "ARMD Covered", + "suminsuredenhancement" => "Sum Insured enhancement", + "automaticsuminsuredreinstatement" => "Automatic Sum Insured reinstatement", + "additionalsicknessbenefit" => "Additional Sickness Benefit", + "lasiksurgery" => "Lasik Surgery", + "midterminclusion" => "Mid Term inclusion", + "capd" => "CAPD", + "organdonorexpenses" => "Organ donor expenses", + "moderntreatmentsasperirdai" => "Modern treatments as per IRDAI", + "days_of_discharge" => "Claim Intimation Clause", + "days_from_dod" => "Claim Submission", + "cataract" => "Cataract" + ]; + + $finalarray = []; + if($type == 'gpa'){ + foreach ($gpa as $key => $value) { + if(isset($terms->$key)) + $finalarray[$value] = $terms->$key; + } + }else{ + foreach ($gmc as $key => $value) { + if(isset($terms->$key)) + $finalarray[$value] = $terms->$key; + } + } + + + return $finalarray; + +} + + private function convertDateFormatDisplay($dateString) { // Attempt to create a DateTime object from the provided date string