FIX_ISSUES_1
This commit is contained in:
parent
fdcc4d68e5
commit
b9df99c032
@ -3611,194 +3611,6 @@ class ClientController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
// public function enrollmentGMCDisplayValueTransform()
|
||||
// {
|
||||
// $data = [];
|
||||
|
||||
// if ($this->request->getPost("waiverofpreexistingdiseases_display")) {
|
||||
// $data['Waiver of Pre-existing Diseases'] = $this->request->getPost("waiverofpreexistingdiseases");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("waiverof1234thyearexclusions_display")) {
|
||||
// $data['Waiver of 1, 2, 3 & 4th year Exclusions'] = $this->request->getPost("waiverof1,2,3&4thyearexclusions");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("waiverof30dayswaitingperiod_display")) {
|
||||
// $data['Waiver of 30 days waiting period'] = $this->request->getPost("waiverof30dayswaitingperiod");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("suminsuredenhancement_display")) {
|
||||
// $data['Sum Insured Enhancement'] = $this->request->getPost("suminsuredenhancement");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("waiver_of_90_days_waiting_period_display")) {
|
||||
// $data['Waiver of 90 Days Waiting Period'] = $this->request->getPost("waiver_of_90_days_waiting_period");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("waiver_of_other_waiting_periods_display")) {
|
||||
// $data['Waiver of Other Waiting Periods'] = $this->request->getPost("waiver_of_other_waiting_periods");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("maternity_benefit_display")) {
|
||||
// $data['Maternity Benefit'] = $this->request->getPost("maternity_benefit");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("9monthwaitingperiodwaived_display")) {
|
||||
// $data['9-month waiting Period - waived'] = $this->request->getPost("9monthwaitingperiodwaived");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("maternitycoverage_display")) {
|
||||
// $data['Maternity Coverage'] = $this->request->getPost("maternitycoverage");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("twindelivery_display")) {
|
||||
// $data['Twin Delivery'] = $this->request->getPost("twindelivery");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("well_baby_well_mother_expenses_display")) {
|
||||
// $data['Well baby / Well Mother Expenses'] = $this->request->getPost("well_baby_well_mother_expenses");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("preandpostnatal_display")) {
|
||||
// $data['Pre and Post natal'] = $this->request->getPost("preandpostnatal");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("infertility_treatment_coverage_display")) {
|
||||
// $data['Infertility Treatment Coverage'] = $this->request->getPost("infertility_treatment_coverage");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("babyday1cover_display")) {
|
||||
// $data['Baby Day 1 Cover'] = $this->request->getPost("babyday1cover");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("coverfromthedateofjoining_display")) {
|
||||
// $data['Cover from the date of Joining'] = $this->request->getPost("coverfromthedateofjoining");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("mid_term_addition_of_new_born_newly_wedded_spouse_display")) {
|
||||
// $data['Mid Term Addition of New Born / Newly Wedded Spouse'] = $this->request->getPost("mid_term_addition_of_new_born_newly_wedded_spouse");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("prehospitalizationcover_display")) {
|
||||
// $data['Pre Hospitalization Cover'] = $this->request->getPost("prehospitalizationcover");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("posthospitalizationcover_display")) {
|
||||
// $data['Post Hospitalization Cover'] = $this->request->getPost("posthospitalizationcover");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("congenitaldiseasesinternal_display")) {
|
||||
// $data['Congenital Diseases - Internal'] = $this->request->getPost("congenitaldiseasesinternal");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("congenitaldiseasesexternal_display")) {
|
||||
// $data['Congenital Diseases - External'] = $this->request->getPost("congenitaldiseasesexternal");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("copayzonewisecopay_display")) {
|
||||
// $data['Co-Pay/Zone wise Co Pay'] = $this->request->getPost("copayzonewisecopay");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("roomrentlimit_display")) {
|
||||
// $data['Room Rent Limit'] = $this->request->getPost("roomrentlimit");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("icu_limit_display")) {
|
||||
// $data['ICU Limit'] = $this->request->getPost("icu_limit");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("proportionatedeductionclause_display")) {
|
||||
// $data['Proportionate Deduction Clause'] = $this->request->getPost("proportionatedeductionclause");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("ailmentcapping_display")) {
|
||||
// $data['Ailment capping'] = $this->request->getPost("ailmentcapping");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("ailment_capping_details_display")) {
|
||||
// $data['Ailment capping Details'] = $this->request->getPost("ailment_capping_details");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("corporatebuffer_display")) {
|
||||
// $data['Corporate Buffer'] = $this->request->getPost("corporatebuffer");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("non_admissible_contingency_corporate_buffer_display")) {
|
||||
// $data['Non-Admissible / Contingency Corporate Buffer'] = $this->request->getPost("non_admissible_contingency_corporate_buffer");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("ambulancecharges_display")) {
|
||||
// $data['Ambulance Charges'] = $this->request->getPost("ambulancecharges");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("airambulance_display")) {
|
||||
// $data['Air Ambulance'] = $this->request->getPost("airambulance");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("reasonableandcustomarycharges_display")) {
|
||||
// $data['Reasonable and Customary Charges'] = $this->request->getPost("reasonableandcustomarycharges");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("daycaretreatment_display")) {
|
||||
// $data['Day Care Treatment'] = $this->request->getPost("daycaretreatment");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("lasiksurgery_display")) {
|
||||
// $data['Lasik Surgery'] = $this->request->getPost("lasiksurgery");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("ayushtreatmentcover_display")) {
|
||||
// $data['AYUSH treatment cover'] = $this->request->getPost("ayudhtreatmentcover");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("moderntreatmentsasperirdai_display")) {
|
||||
// $data['Modern treatments as per IRDAI'] = $this->request->getPost("moderntreatmentsasperirdai");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("opd_treatment_display")) {
|
||||
// $data['OPD Treatment'] = $this->request->getPost("opd_treatment");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("days_of_discharge_display")) {
|
||||
// $data['Claim Intimation Clause'] = $this->request->getPost("days_of_discharge");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("days_from_dod_display")) {
|
||||
// $data['Claim Submission'] = $this->request->getPost("days_from_dod");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("terrorism_display")) {
|
||||
// $data['Terrorism'] = $this->request->getPost("terrorism");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("widower_cover_display")) {
|
||||
// $data['Widower Cover'] = $this->request->getPost("widower_cover");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("breavement_cover_display")) {
|
||||
// $data['Breavement Cover'] = $this->request->getPost("breavement_cover");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("special_condition_display_value")) {
|
||||
|
||||
// $specialConditionKeyValue = $this->request->getPost("special_condition_display_value") ?? [];
|
||||
// $specialConditionKeyValue = json_decode($specialConditionKeyValue, true);
|
||||
|
||||
// if (is_array($specialConditionKeyValue) && count($specialConditionKeyValue) > 0) {
|
||||
// $mergedArray = array_merge(...array_map(fn($item) => (array) $item, $specialConditionKeyValue));
|
||||
// $data = array_merge($data, $mergedArray);
|
||||
// }
|
||||
// }
|
||||
|
||||
// if(isset($data) && !empty($data)){
|
||||
// return $data;
|
||||
// }else{
|
||||
// $data = [];
|
||||
// return $data;
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
public function enrollmentGMCDisplayValueTransform()
|
||||
{
|
||||
$data = [];
|
||||
@ -3873,7 +3685,6 @@ class ClientController extends AdminController
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
public function getterms()
|
||||
{
|
||||
$client_policy_id = $this->request->getVar('client_policy_id');
|
||||
@ -4034,94 +3845,6 @@ class ClientController extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
// public function enrollmentGPADisplayValueTransform()
|
||||
// {
|
||||
// $data = [];
|
||||
|
||||
// if ($this->request->getPost("accidentalDeathBenefit_display")) {
|
||||
// $data['Accidental Death Benefit'] = $this->request->getPost("accidentalDeathBenefit");
|
||||
// }
|
||||
// if ($this->request->getPost("permanentTotalDisablement_display")) {
|
||||
// $data['Permanent Total Disablement'] = $this->request->getPost("permanentTotalDisablement");
|
||||
// }
|
||||
// if ($this->request->getPost("permanentPartialDisablement_display")) {
|
||||
// $data['Permanent Partial Disablement'] = $this->request->getPost("permanentPartialDisablement");
|
||||
// }
|
||||
// if ($this->request->getPost("temporaryTotalDisablementBenefit_display")) {
|
||||
// $data['Temporary Total Disablement Benefit'] = $this->request->getPost("temporaryTotalDisablementBenefit");
|
||||
// }
|
||||
// if ($this->request->getPost("medical_expenses_medical_extension_display")) {
|
||||
// $data['Medical Expenses / Medical Extension (IPD)'] = $this->request->getPost("medical_expenses_medical_extension");
|
||||
// }
|
||||
// if ($this->request->getPost("opd_treatment_cover_display")) {
|
||||
// $data['OPD Treatment Cover'] = $this->request->getPost("opd_treatment_cover");
|
||||
// }
|
||||
// if ($this->request->getPost("ambulanceCharges_display")) {
|
||||
// $data['Ambulance Charges'] = $this->request->getPost("ambulanceCharges");
|
||||
// }
|
||||
// if ($this->request->getPost("repatriation_of_mortal_remains_display")) {
|
||||
// $data['Repatriation of Mortal Remains'] = $this->request->getPost("repatriation_of_mortal_remains");
|
||||
// }
|
||||
// if ($this->request->getPost("childrenEducationWelfareFund_display")) {
|
||||
// $data['Children Education Welfare Fund'] = $this->request->getPost("childrenEducationWelfareFund");
|
||||
// }
|
||||
// if ($this->request->getPost("terrorism_display")) {
|
||||
// $data['Terrorism'] = $this->request->getPost("terrorism");
|
||||
// }
|
||||
// if ($this->request->getPost("worldwideCover_display")) {
|
||||
// $data['Worldwide Cover'] = $this->request->getPost("worldwideCover");
|
||||
// }
|
||||
// if ($this->request->getPost("family_transportation_benefits_display")) {
|
||||
// $data['Family Transportation Benefits'] = $this->request->getPost("family_transportation_benefits");
|
||||
// }
|
||||
// if ($this->request->getPost("fractures_dislocation_burns_display")) {
|
||||
// $data['Fractures / Dislocation / Burns'] = $this->request->getPost("fractures_dislocation_burns");
|
||||
// }
|
||||
// if ($this->request->getPost("coma_display")) {
|
||||
// $data['Coma'] = $this->request->getPost("coma");
|
||||
// }
|
||||
// if ($this->request->getPost("carriageofDeadBody_display")) {
|
||||
// $data['Carriage of Dead Body'] = $this->request->getPost("carriageOfDeadBody");
|
||||
// }
|
||||
// if ($this->request->getPost("compassionateVisitExpenses_display")) {
|
||||
// $data['Compassionate Visit Expenses'] = $this->request->getPost("compassionateVisitExpenses");
|
||||
// }
|
||||
// if ($this->request->getPost("travel_expenses_for_medical_treatment_display")) {
|
||||
// $data['Travel expenses for Medical Treatment'] = $this->request->getPost("travel_expenses_for_medical_treatment");
|
||||
// }
|
||||
// if ($this->request->getPost("daily_cash_allowance_display")) {
|
||||
// $data['Daily cash Allowance'] = $this->request->getPost("daily_cash_allowance");
|
||||
// }
|
||||
// if ($this->request->getPost("artifical_limb_and_prosthesis_display")) {
|
||||
// $data['Artifical Limb and Prosthesis'] = $this->request->getPost("artifical_limb_and_prosthesis");
|
||||
// }
|
||||
// if ($this->request->getPost("animalSnakeInsectBite_display")) {
|
||||
// $data['Animal/Snake/Insect Bite'] = $this->request->getPost("animalSnakeInsectBite");
|
||||
// }
|
||||
// if ($this->request->getPost("air_ambulance_display")) {
|
||||
// $data['Air Ambulance'] = $this->request->getPost("air_ambulance");
|
||||
// }
|
||||
|
||||
// if ($this->request->getPost("gpa_special_condition_display_value")) {
|
||||
|
||||
// $specialConditionKeyValue = $this->request->getPost("gpa_special_condition_display_value") ?? [];
|
||||
// $specialConditionKeyValue = json_decode($specialConditionKeyValue, true);
|
||||
|
||||
// if (is_array($specialConditionKeyValue) && count($specialConditionKeyValue) > 0) {
|
||||
// $mergedArray = array_merge(...array_map(fn($item) => (array) $item, $specialConditionKeyValue));
|
||||
// $data = array_merge($data, $mergedArray);
|
||||
// }
|
||||
// }
|
||||
// // print_r($data); die;
|
||||
|
||||
// if (isset($data) && !empty($data)) {
|
||||
// return $data;
|
||||
// } else {
|
||||
// $data = [];
|
||||
// return $data;
|
||||
// }
|
||||
// }
|
||||
|
||||
public function enrollmentGPADisplayValueTransform()
|
||||
{
|
||||
$data = [];
|
||||
@ -6646,8 +6369,8 @@ class ClientController extends AdminController
|
||||
// $response = $ticketServiceController->tpaClaimDumpImporter(["file_id" => 48]); //vidal
|
||||
// $response = $ticketServiceController->tpaClaimDumpImporter(["file_id" => 53]); //icici
|
||||
// $response = $ticketServiceController->tpaClaimDumpImporter(["file_id" => 54]); //mediassist
|
||||
// $response = $ticketServiceController->tpaClaimDumpToTicketMasterImporters(["file_id" => 48]);
|
||||
// $response = $ticketServiceController->tpaClaimDumpToTicketMasterImporters(["file_id" => 48]);
|
||||
// $response = $ticketServiceController->tpaClaimDumpToTicketMasterImporters(["file_id" => 48]); //vidal
|
||||
// $response = $ticketServiceController->tpaClaimDumpToTicketMasterImporters(["file_id" => 54]); //mediassist
|
||||
// dd($response);
|
||||
|
||||
// ---------- TICKET CONTROLLER --------------------------------------------------------------------------------
|
||||
|
||||
@ -9,6 +9,11 @@ use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
|
||||
use Kint\Kint;
|
||||
use App\Libraries\TpaClaimsImportFactory;
|
||||
use App\Libraries\TPAClaimsImportServices\FhplClaimImportService;
|
||||
use App\Libraries\TPAClaimsImportServices\MediAssistClaimImportService;
|
||||
use App\Libraries\TPAClaimsImportServices\AbhiClaimImportService;
|
||||
use App\Libraries\TPAClaimsImportServices\RcareClaimImportService;
|
||||
use App\Libraries\TPAClaimsImportServices\VidalClaimImportService;
|
||||
use App\Libraries\TPAClaimsImportServices\IciciClaimImportService;
|
||||
use App\Libraries\TPAClaimsImportServices\BaseTpaClaimImportService;
|
||||
|
||||
use App\Models\ClaimDumpFileModel;
|
||||
@ -1857,17 +1862,17 @@ class TicketServiceController extends BaseController
|
||||
}
|
||||
|
||||
public function tpaClaimDumpImporter($params)
|
||||
{
|
||||
{
|
||||
try {
|
||||
|
||||
$file_id = $params['file_id'] ?? null;
|
||||
$file_path = WRITEPATH . 'uploads/claim_dump_excel/';
|
||||
$file_path = WRITEPATH . 'uploads' . DIRECTORY_SEPARATOR . 'claim_dump_excel' . DIRECTORY_SEPARATOR;
|
||||
|
||||
if (!$file_id) {
|
||||
return ['status' => false, 'message' => 'File ID is missing'];
|
||||
}
|
||||
|
||||
$fileData = $this->claimDumpFileModel->where('id', $file_id)->first();
|
||||
$fileData = $this->claimDumpFileModel->find((int)$file_id);
|
||||
|
||||
if (!$fileData) {
|
||||
return ['status' => false, 'message' => 'Invalid file ID. No file data found'];
|
||||
@ -1882,46 +1887,27 @@ class TicketServiceController extends BaseController
|
||||
$handler = TpaClaimsImportFactory::make($fileData['tpa_id'] ?? 0);
|
||||
$result = $handler->runTpaClaimDumpInsert($file_full_path, $file_id);
|
||||
|
||||
// ---------- Prepare update data ----------
|
||||
$data = [];
|
||||
|
||||
if (!empty($result['status']) && $result['status'] === true) {
|
||||
$data['status'] = 'success';
|
||||
$data['reason'] = null;
|
||||
// mark file as processing and queue next job
|
||||
Jobs::addJob(['job_name' => 'tpaClaimDumpToTicketMasterImporters', 'payload' => ['file_id' => $file_id]]);
|
||||
} else {
|
||||
$data['status'] = 'failed';
|
||||
|
||||
$errorMessage = $result['message'] ?? 'Unknown import error';
|
||||
|
||||
$reason = [
|
||||
'error_summary' => array_count_values([5]),
|
||||
'error_summary' => [5 => 1],
|
||||
'error_data' => $errorMessage
|
||||
];
|
||||
|
||||
$data['reason'] = json_encode($reason, JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
|
||||
// dd($data);
|
||||
// ---------- Update DB ----------
|
||||
$sql = "UPDATE claim_dump_files SET status = ?, reason = ? WHERE id = ?";
|
||||
|
||||
$updated = db_connect()->query(
|
||||
$sql,
|
||||
[
|
||||
$data['status'] ?? null,
|
||||
$data['reason'] ?? null,
|
||||
$file_id
|
||||
]
|
||||
);
|
||||
|
||||
if (!$updated) {
|
||||
$this->myLogger->logme('error', 'Claim dump file update failed for file_id: ' . $file_id);
|
||||
}
|
||||
|
||||
dd(db_connect()->getLastQuery()->getQuery());
|
||||
|
||||
if(!empty($result['status']) && $result['status'] === true){
|
||||
$r = Jobs::addJob(['job_name' => 'tpaClaimDumpToTicketMasterImporters', 'payload' => ['file_id' => $file_id]]);
|
||||
$reasonJson = json_encode($reason, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
||||
// mark the file as failed using the model
|
||||
$updated = $this->claimDumpFileModel->update($file_id, [
|
||||
'status' => 'failed',
|
||||
'reason' => $reasonJson,
|
||||
'updated_by' => $fileData['created_by'] ?? null
|
||||
]);
|
||||
if ($updated === false) {
|
||||
$this->myLogger->logme('error', 'Claim dump file update to failed status failed for file_id: ' . $file_id);
|
||||
} else {
|
||||
$this->myLogger->logme('error', 'Claim dump file marked failed for file_id: ' . $file_id);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
@ -1934,6 +1920,12 @@ class TicketServiceController extends BaseController
|
||||
$th->getMessage() . ' | Line: ' . $th->getLine()
|
||||
);
|
||||
|
||||
// attempt to mark file as failed if file_id available
|
||||
if (!empty($file_id)) {
|
||||
$reason = json_encode(['error_summary' => [5 => 1], 'error_data' => 'TPA import crashed: ' . $th->getMessage()], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
||||
$this->claimDumpFileModel->update($file_id, ['status' => 'failed', 'reason' => $reason]);
|
||||
}
|
||||
|
||||
return [
|
||||
'status' => false,
|
||||
'message' => 'TPA Claim dump import failed',
|
||||
@ -1961,6 +1953,20 @@ class TicketServiceController extends BaseController
|
||||
$handler = TpaClaimsImportFactory::make($fileData['tpa_id'] ?? 0);
|
||||
$result = $handler->runTicketMasterInsert($params);
|
||||
|
||||
if (!empty($result['status']) && $result['status'] === true) {
|
||||
$updated = $this->claimDumpFileModel->where('id', $file_id)->set(['status' => 'success', 'reason' => null])->update();
|
||||
} else {
|
||||
|
||||
$errorMessage = $result['message'] ?? 'Unknown import error C';
|
||||
$reason = [
|
||||
'error_summary' => [5 => 1], // 🔒 always fixed
|
||||
'error_data' => $errorMessage
|
||||
];
|
||||
|
||||
$reason = json_encode($reason);
|
||||
$updated = $this->claimDumpFileModel->where('id', $file_id)->set(['status' => 'failed', 'reason' => $reason])->update();
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
} catch (\Throwable $th) {
|
||||
|
||||
@ -67,7 +67,8 @@ class DepositHelper
|
||||
'balance' => $newBalance, // Include the new balance in the data array
|
||||
'cd_ac_pk'=> isset($data['cd_ac_pk'])?$data['cd_ac_pk']:null,
|
||||
'record_date' => $data['record_date'] ?? null,
|
||||
'policy_transaction_id' => $data['pt_id'] ?? null
|
||||
'policy_transaction_id' => $data['pt_id'] ?? null,
|
||||
'file_id' => $data['file_id'],
|
||||
];
|
||||
|
||||
// Insert data and get the insert ID
|
||||
|
||||
@ -114,6 +114,8 @@ class AbhiClaimImportService extends BaseTpaClaimImportService
|
||||
// Misc
|
||||
'diagnosis' => 'claim_description',
|
||||
'healthcard_id' => 'tpa_no',
|
||||
'claim_type' => 'tpa_claim_type',
|
||||
|
||||
];
|
||||
|
||||
protected $statusMapping = [
|
||||
@ -174,9 +176,7 @@ class AbhiClaimImportService extends BaseTpaClaimImportService
|
||||
}
|
||||
|
||||
$ticketMasterModel = new TicketMasterModel();
|
||||
$ticketMasterModel->insertBatch($data);
|
||||
|
||||
return true;
|
||||
return $ticketMasterModel->insertBatch($data);
|
||||
}
|
||||
|
||||
|
||||
@ -187,9 +187,7 @@ class AbhiClaimImportService extends BaseTpaClaimImportService
|
||||
}
|
||||
|
||||
$builder = $this->db->table('claims_dump_abhi');
|
||||
$builder->insertBatch($data);
|
||||
|
||||
return true;
|
||||
return $builder->updateBatch($data, 'id');
|
||||
}
|
||||
|
||||
|
||||
@ -200,9 +198,7 @@ class AbhiClaimImportService extends BaseTpaClaimImportService
|
||||
}
|
||||
|
||||
$builder = $this->db->table('claims_dump_abhi');
|
||||
$builder->insertBatch($data);
|
||||
|
||||
return true;
|
||||
return $builder->updateBatch($data, 'id');
|
||||
}
|
||||
|
||||
|
||||
@ -307,7 +303,7 @@ class AbhiClaimImportService extends BaseTpaClaimImportService
|
||||
|
||||
if ($isduplicate) {
|
||||
$reason = "This claim already exists in our system.";
|
||||
$rejecetd_reason[$row['id']] = ["ticket_master_insert_reject_reason" => $reason];
|
||||
$rejecetd_reason[] = ["id" => $row['id'], "master_reject_reason" => $reason];
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -326,23 +322,15 @@ class AbhiClaimImportService extends BaseTpaClaimImportService
|
||||
if (!empty($employee_data)) {
|
||||
$item['emp_id'] = $employee_data['id'] ?? null;
|
||||
$item['emp_name'] = $employee_data['name'] ?? null;
|
||||
$item['emp_code'] = $employee_data['emp_code'] ?? null;
|
||||
$item['emp_mail'] = $employee_data['email_corporate'] ?? null;
|
||||
$item['emp_mobile'] = $employee_data['mobile'] ?? null;
|
||||
$item['insured_emp_id'] = $employee_data['insured_emp_id'] ?? null;
|
||||
$item['insured_name'] = $employee_data['insured_name'] ?? null;
|
||||
} else {
|
||||
|
||||
$reason = sprintf(
|
||||
'The policy number "%s" does not exist in our system. ' .
|
||||
'Details - Client ID: %s, Client Policy ID: %s, Employee Number: %s, Relationship: %s',
|
||||
$row['insurer_policy_number'],
|
||||
$file_data['client_id'],
|
||||
$file_data['client_policy_id'],
|
||||
$row['employee_number'],
|
||||
$item['relationship']
|
||||
);
|
||||
|
||||
$rejecetd_reason[$row['id']] = ["ticket_master_insert_reject_reason" => $reason];
|
||||
$reason = 'This employee not exist in our system.';
|
||||
$rejecetd_reason[] = ["id" => $row['id'], "master_reject_reason" => $reason];
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@ -50,35 +50,12 @@ abstract class BaseTpaClaimImportService
|
||||
// dd($tpaInsertData);
|
||||
|
||||
if (empty($tpaInsertData)) {
|
||||
return ['status' => false, 'message' => 'These records already exist in the system.'];
|
||||
return ['status' => false, 'message' => 'These records already exist in the system. Please check the file'];
|
||||
}
|
||||
|
||||
if (env('FHPL_PRIMARY_KEY_CONSTANT') == $fileData['tpa_id']) {
|
||||
$ClaimsDumpFhplModel = $this->db->table('claims_dump_fhpl');
|
||||
$return_res = $ClaimsDumpFhplModel->insertBatch($tpaInsertData);
|
||||
} else if (env('R_CARE_PRIMARY_KEY_CONSTANT') == $fileData['tpa_id']) {
|
||||
$ClaimsDumpIciciModel = $this->db->table('claims_dump_reliance');
|
||||
$return_res = $ClaimsDumpIciciModel->insertBatch($tpaInsertData);
|
||||
} else if (env('ICICI_PRIMARY_KEY_CONSTANT') == $fileData['tpa_id']) {
|
||||
$ClaimsDumpIciciModel = $this->db->table('claims_dump_icici');
|
||||
$return_res = $ClaimsDumpIciciModel->insertBatch($tpaInsertData);
|
||||
} else if (env('ABHI_PRIMARY_KEY_CONSTANT') == $fileData['tpa_id']) {
|
||||
// $ClaimsDumpAbhiModel = $this->db->table('claims_dump_abhi');
|
||||
// $return_res = $ClaimsDumpAbhiModel->insertBatch($tpaInsertData);
|
||||
$return_res = $this->bulkInsertTPATable($tpaInsertData);
|
||||
} else if (env('VIDAL_PRIMARY_KEY_CONSTANT') == $fileData['tpa_id']) {
|
||||
$ClaimsDumpVidalModel = $this->db->table('claims_dump_vidal');
|
||||
$return_res = $ClaimsDumpVidalModel->insertBatch($tpaInsertData);
|
||||
} else if (env('MEDI_ASSIST_PRIMARY_KEY_CONSTANT') == $fileData['tpa_id']) {
|
||||
$ClaimsDumpMediAssistModel = $this->db->table('claims_dump_medi_assist');
|
||||
$return_res = $ClaimsDumpMediAssistModel->insertBatch($tpaInsertData);
|
||||
} else{
|
||||
$return_res = $this->bulkInsertTPATable($tpaInsertData);
|
||||
|
||||
}
|
||||
|
||||
// $return_res = $this->bulkInsertTPATable($tpaInsertData);
|
||||
|
||||
if (!$return_res) {
|
||||
if ($return_res !== true) {
|
||||
return ['status' => false, 'message' => 'TPA Import bulk insert failed'];
|
||||
}
|
||||
|
||||
@ -87,7 +64,6 @@ abstract class BaseTpaClaimImportService
|
||||
if ($this->db->transStatus() === false) {
|
||||
|
||||
$error = $this->db->error();
|
||||
|
||||
$error_data = [
|
||||
'message' => $error['message'] ?: 'Unknown DB error',
|
||||
'code' => $error['code'] ?? null,
|
||||
@ -95,7 +71,7 @@ abstract class BaseTpaClaimImportService
|
||||
];
|
||||
|
||||
// dd($error_data);
|
||||
// unset($error_data['last_query']);
|
||||
unset($error_data['last_query']);
|
||||
return ['status' => false, 'message' => 'TPA Import transaction failed', 'error_data' => $error_data];
|
||||
}
|
||||
|
||||
@ -112,28 +88,39 @@ abstract class BaseTpaClaimImportService
|
||||
$file_id = $params['file_id'];
|
||||
|
||||
$ticketMasterData = $this->mapClaimMasterData($file_id);
|
||||
// dd($ticketMasterData);
|
||||
|
||||
if (!$ticketMasterData['status']) {
|
||||
return $ticketMasterData;
|
||||
}
|
||||
|
||||
$return_res = $this->importClaimMaster($ticketMasterData['mapped_array']);
|
||||
$message = '';
|
||||
$return_res = false;
|
||||
if(!empty($ticketMasterData['mapped_array'])){
|
||||
$return_res = $this->importClaimMaster($ticketMasterData['mapped_array']);
|
||||
$message .= 'Ticket Master Claim bulk insert success. ';
|
||||
}
|
||||
|
||||
if(!empty($ticketMasterData['rejected_reason_array'])){
|
||||
$return_res = $this->updateTicketMasterRejectedReasonInTPATable($ticketMasterData['rejected_reason_array']);
|
||||
if(empty($ticketMasterData['mapped_array'])){
|
||||
$message .= 'Those employees not in our system. ';
|
||||
}else{
|
||||
$message .= 'Ticket Master Claim rejected reason updated successfully. ';
|
||||
}
|
||||
}
|
||||
|
||||
if(!$return_res){
|
||||
return ['status' => false, 'message' => 'Ticket Master Claim bulk insert failed'];
|
||||
}
|
||||
|
||||
$this->updateTicketMasterRejectedReasonInTPATable($ticketMasterData['rejected_reason_array']);
|
||||
|
||||
$this->db->transComplete();
|
||||
|
||||
if ($this->db->transStatus() === false) {
|
||||
return ['status' => false, 'message' => 'Ticket Master Claim bulk insert failed'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
return ['status' => true, 'message' => 'Ticket Master Claim inserted successfully'];
|
||||
return ['status' => true, 'message' => $message];
|
||||
|
||||
}
|
||||
|
||||
@ -278,6 +265,7 @@ abstract class BaseTpaClaimImportService
|
||||
->where('is_active', 1)
|
||||
->where('file_id', $params['file_id'])
|
||||
->where('ticket_id IS NULL')
|
||||
->where('master_reject_reason IS NULL')
|
||||
->countAllResults();
|
||||
|
||||
$batch_size = 100;
|
||||
@ -291,6 +279,7 @@ abstract class BaseTpaClaimImportService
|
||||
->where('is_active', 1)
|
||||
->where('file_id', $params['file_id'])
|
||||
->where('ticket_id IS NULL')
|
||||
->where('master_reject_reason IS NULL')
|
||||
->get()
|
||||
->getResultArray();
|
||||
|
||||
@ -308,6 +297,7 @@ abstract class BaseTpaClaimImportService
|
||||
'employees.email_corporate AS emp_mail',
|
||||
'employees.mobile AS emp_mobile',
|
||||
'employees.name AS emp_name',
|
||||
'employees.emp_code AS emp_code',
|
||||
|
||||
// insured employee
|
||||
'insured.id AS insured_emp_id',
|
||||
|
||||
@ -177,10 +177,7 @@ class FhplClaimImportService extends BaseTpaClaimImportService
|
||||
// Payment
|
||||
'cheque_no' => 'utr_details',
|
||||
'uhid_no' => 'tpa_no',
|
||||
|
||||
'priority' => 1,
|
||||
'mode_of_intimation' => 5,
|
||||
'ticket_type_id' => 1,
|
||||
'claim_type' => 'tpa_claim_type',
|
||||
];
|
||||
|
||||
protected $statusMapping = [
|
||||
@ -239,9 +236,7 @@ class FhplClaimImportService extends BaseTpaClaimImportService
|
||||
}
|
||||
|
||||
$ticketMasterModel = new TicketMasterModel();
|
||||
$ticketMasterModel->insertBatch($data);
|
||||
|
||||
return true;
|
||||
return $ticketMasterModel->insertBatch($data);
|
||||
}
|
||||
|
||||
|
||||
@ -252,9 +247,7 @@ class FhplClaimImportService extends BaseTpaClaimImportService
|
||||
}
|
||||
|
||||
$builder = $this->db->table('claims_dump_fhpl');
|
||||
$builder->insertBatch($data);
|
||||
|
||||
return true;
|
||||
return $builder->updateBatch($data, 'id');
|
||||
}
|
||||
|
||||
|
||||
@ -265,9 +258,7 @@ class FhplClaimImportService extends BaseTpaClaimImportService
|
||||
}
|
||||
|
||||
$builder = $this->db->table('claims_dump_fhpl');
|
||||
$builder->insertBatch($data);
|
||||
|
||||
return true;
|
||||
return $builder->updateBatch($data, 'id');
|
||||
}
|
||||
|
||||
|
||||
@ -372,7 +363,7 @@ class FhplClaimImportService extends BaseTpaClaimImportService
|
||||
|
||||
if ($isduplicate) {
|
||||
$reason = "This claim already exists in our system.";
|
||||
$rejecetd_reason[$row['id']] = ["ticket_master_insert_reject_reason" => $reason];
|
||||
$rejecetd_reason[] = ["id" => $row['id'], "master_reject_reason" => $reason];
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -391,23 +382,15 @@ class FhplClaimImportService extends BaseTpaClaimImportService
|
||||
if (!empty($employee_data)) {
|
||||
$item['emp_id'] = $employee_data['id'] ?? null;
|
||||
$item['emp_name'] = $employee_data['name'] ?? null;
|
||||
$item['emp_code'] = $employee_data['emp_code'] ?? null;
|
||||
$item['emp_mail'] = $employee_data['email_corporate'] ?? null;
|
||||
$item['emp_mobile'] = $employee_data['mobile'] ?? null;
|
||||
$item['insured_emp_id'] = $employee_data['insured_emp_id'] ?? null;
|
||||
$item['insured_name'] = $employee_data['insured_name'] ?? null;
|
||||
} else {
|
||||
|
||||
$reason = sprintf(
|
||||
'The policy number "%s" does not exist in our system. ' .
|
||||
'Details - Client ID: %s, Client Policy ID: %s, Employee Number: %s, Relationship: %s',
|
||||
$row['insurer_policy_number'],
|
||||
$file_data['client_id'],
|
||||
$file_data['client_policy_id'],
|
||||
$row['employee_number'],
|
||||
$item['relationship']
|
||||
);
|
||||
|
||||
$rejecetd_reason[$row['id']] = ["ticket_master_insert_reject_reason" => $reason];
|
||||
$reason = 'This employee not exist in our system.';
|
||||
$rejecetd_reason[] = ["id" => $row['id'], "master_reject_reason" => $reason];
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@ -100,7 +100,8 @@ class IciciClaimImportService extends BaseTpaClaimImportService
|
||||
|
||||
'cheque_number' => 'utr_details',
|
||||
'uhid' => 'tpa_no',
|
||||
'rejected_query_desc' => 'claim_description',
|
||||
'rejected_query_desc' => 'claim_description',
|
||||
'type_of_claim' => 'tpa_claim_type',
|
||||
];
|
||||
|
||||
protected $statusMapping = [
|
||||
@ -168,9 +169,7 @@ class IciciClaimImportService extends BaseTpaClaimImportService
|
||||
}
|
||||
|
||||
$ticketMasterModel = new TicketMasterModel();
|
||||
$ticketMasterModel->insertBatch($data);
|
||||
|
||||
return true;
|
||||
return $ticketMasterModel->insertBatch($data);
|
||||
}
|
||||
|
||||
|
||||
@ -181,9 +180,7 @@ class IciciClaimImportService extends BaseTpaClaimImportService
|
||||
}
|
||||
|
||||
$builder = $this->db->table('claims_dump_icici');
|
||||
$builder->insertBatch($data);
|
||||
|
||||
return true;
|
||||
return $builder->upsertBatch($data, 'id');
|
||||
}
|
||||
|
||||
|
||||
@ -194,9 +191,7 @@ class IciciClaimImportService extends BaseTpaClaimImportService
|
||||
}
|
||||
|
||||
$builder = $this->db->table('claims_dump_icici');
|
||||
$builder->insertBatch($data);
|
||||
|
||||
return true;
|
||||
return $builder->updateBatch($data, 'id');
|
||||
}
|
||||
|
||||
|
||||
@ -301,7 +296,7 @@ class IciciClaimImportService extends BaseTpaClaimImportService
|
||||
|
||||
if ($isduplicate) {
|
||||
$reason = "This claim already exists in our system.";
|
||||
$rejecetd_reason[$row['id']] = ["ticket_master_insert_reject_reason" => $reason];
|
||||
$rejecetd_reason[] = ["id" => $row['id'], "master_reject_reason" => $reason];
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -320,23 +315,15 @@ class IciciClaimImportService extends BaseTpaClaimImportService
|
||||
if (!empty($employee_data)) {
|
||||
$item['emp_id'] = $employee_data['id'] ?? null;
|
||||
$item['emp_name'] = $employee_data['name'] ?? null;
|
||||
$item['emp_code'] = $employee_data['emp_code'] ?? null;
|
||||
$item['emp_mail'] = $employee_data['email_corporate'] ?? null;
|
||||
$item['emp_mobile'] = $employee_data['mobile'] ?? null;
|
||||
$item['insured_emp_id'] = $employee_data['insured_emp_id'] ?? null;
|
||||
$item['insured_name'] = $employee_data['insured_name'] ?? null;
|
||||
} else {
|
||||
|
||||
$reason = sprintf(
|
||||
'The policy number "%s" does not exist in our system. ' .
|
||||
'Details - Client ID: %s, Client Policy ID: %s, Employee Number: %s, Relationship: %s',
|
||||
$row['insurer_policy_number'],
|
||||
$file_data['client_id'],
|
||||
$file_data['client_policy_id'],
|
||||
$row['employee_number'],
|
||||
$item['relationship']
|
||||
);
|
||||
|
||||
$rejecetd_reason[$row['id']] = ["ticket_master_insert_reject_reason" => $reason];
|
||||
$reason = 'This employee not exist in our system.';
|
||||
$rejecetd_reason[] = ["id" => $row['id'], "master_reject_reason" => $reason];
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@ -189,9 +189,7 @@ class MediAssistClaimImportService extends BaseTpaClaimImportService
|
||||
}
|
||||
|
||||
$ticketMasterModel = new TicketMasterModel();
|
||||
$ticketMasterModel->insertBatch($data);
|
||||
|
||||
return true;
|
||||
return $ticketMasterModel->insertBatch($data);
|
||||
}
|
||||
|
||||
|
||||
@ -215,9 +213,7 @@ class MediAssistClaimImportService extends BaseTpaClaimImportService
|
||||
}
|
||||
|
||||
$builder = $this->db->table('claims_dump_medi_assist');
|
||||
$builder->insertBatch($data);
|
||||
|
||||
return true;
|
||||
return $builder->updateBatch($data, 'id');
|
||||
}
|
||||
|
||||
|
||||
@ -318,7 +314,7 @@ class MediAssistClaimImportService extends BaseTpaClaimImportService
|
||||
|
||||
if ($isduplicate) {
|
||||
$reason = "This claim already exists in our system.";
|
||||
$rejecetd_reason[$row['id']] = ["ticket_master_insert_reject_reason" => $reason];
|
||||
$rejecetd_reason[] = ["id" => $row['id'], "master_reject_reason" => $reason];
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -337,23 +333,15 @@ class MediAssistClaimImportService extends BaseTpaClaimImportService
|
||||
if (!empty($employee_data)) {
|
||||
$item['emp_id'] = $employee_data['id'] ?? null;
|
||||
$item['emp_name'] = $employee_data['name'] ?? null;
|
||||
$item['emp_code'] = $employee_data['emp_code'] ?? null;
|
||||
$item['emp_mail'] = $employee_data['email_corporate'] ?? null;
|
||||
$item['emp_mobile'] = $employee_data['mobile'] ?? null;
|
||||
$item['insured_emp_id'] = $employee_data['insured_emp_id'] ?? null;
|
||||
$item['insured_name'] = $employee_data['insured_name'] ?? null;
|
||||
} else {
|
||||
|
||||
$reason = sprintf(
|
||||
'The policy number "%s" does not exist in our system. ' .
|
||||
'Details - Client ID: %s, Client Policy ID: %s, Employee Number: %s, Relationship: %s',
|
||||
$row['insurer_policy_number'],
|
||||
$file_data['client_id'],
|
||||
$file_data['client_policy_id'],
|
||||
$row['employee_number'],
|
||||
$item['relationship']
|
||||
);
|
||||
|
||||
$rejecetd_reason[$row['id']] = ["ticket_master_insert_reject_reason" => $reason];
|
||||
$reason = 'This employee not exist in our system.';
|
||||
$rejecetd_reason[] = ["id" => $row['id'], "master_reject_reason" => $reason];
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@ -159,9 +159,7 @@ class RcareClaimImportService extends BaseTpaClaimImportService
|
||||
}
|
||||
|
||||
$ticketMasterModel = new TicketMasterModel();
|
||||
$ticketMasterModel->insertBatch($data);
|
||||
|
||||
return true;
|
||||
return $ticketMasterModel->insertBatch($data);
|
||||
}
|
||||
|
||||
|
||||
@ -172,9 +170,7 @@ class RcareClaimImportService extends BaseTpaClaimImportService
|
||||
}
|
||||
|
||||
$builder = $this->db->table('claims_dump_reliance');
|
||||
$builder->insertBatch($data);
|
||||
|
||||
return true;
|
||||
return $builder->updateBatch($data, 'id');
|
||||
}
|
||||
|
||||
|
||||
@ -185,9 +181,7 @@ class RcareClaimImportService extends BaseTpaClaimImportService
|
||||
}
|
||||
|
||||
$builder = $this->db->table('claims_dump_reliance');
|
||||
$builder->insertBatch($data);
|
||||
|
||||
return true;
|
||||
return $builder->updateBatch($data, 'id');
|
||||
}
|
||||
|
||||
|
||||
@ -291,7 +285,7 @@ class RcareClaimImportService extends BaseTpaClaimImportService
|
||||
|
||||
if ($isduplicate) {
|
||||
$reason = "This claim already exists in our system.";
|
||||
$rejecetd_reason[$row['id']] = ["ticket_master_insert_reject_reason" => $reason];
|
||||
$rejecetd_reason[] = ["id" => $row['id'], "master_reject_reason" => $reason];
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -310,23 +304,15 @@ class RcareClaimImportService extends BaseTpaClaimImportService
|
||||
if (!empty($employee_data)) {
|
||||
$item['emp_id'] = $employee_data['id'] ?? null;
|
||||
$item['emp_name'] = $employee_data['name'] ?? null;
|
||||
$item['emp_code'] = $employee_data['emp_code'] ?? null;
|
||||
$item['emp_mail'] = $employee_data['email_corporate'] ?? null;
|
||||
$item['emp_mobile'] = $employee_data['mobile'] ?? null;
|
||||
$item['insured_emp_id'] = $employee_data['insured_emp_id'] ?? null;
|
||||
$item['insured_name'] = $employee_data['insured_name'] ?? null;
|
||||
} else {
|
||||
|
||||
$reason = sprintf(
|
||||
'The policy number "%s" does not exist in our system. ' .
|
||||
'Details - Client ID: %s, Client Policy ID: %s, Employee Number: %s, Relationship: %s',
|
||||
$row['insurer_policy_number'],
|
||||
$file_data['client_id'],
|
||||
$file_data['client_policy_id'],
|
||||
$row['employee_number'],
|
||||
$item['relationship']
|
||||
);
|
||||
|
||||
$rejecetd_reason[$row['id']] = ["ticket_master_insert_reject_reason" => $reason];
|
||||
$reason = 'This employee not exist in our system.';
|
||||
$rejecetd_reason[] = ["id" => $row['id'], "master_reject_reason" => $reason];
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@ -163,7 +163,6 @@ class VidalClaimImportService extends BaseTpaClaimImportService
|
||||
["excel_column" => "Last Document Received date", "db_column" => "last_document_received_date"],
|
||||
];
|
||||
|
||||
|
||||
protected $mapping = [
|
||||
|
||||
["excel_column" => ["col_name" => "TPA Policy Number", "col_index" => 0], "db_column" => "tpa_policy_number"],
|
||||
@ -312,7 +311,6 @@ class VidalClaimImportService extends BaseTpaClaimImportService
|
||||
["excel_column" => ["col_name" => "Last Document Received date", "col_index" => 113], "db_column" => "last_document_received_date"],
|
||||
];
|
||||
|
||||
|
||||
protected $ticketMasterMapping = [
|
||||
|
||||
// Policy / Claim identifiers
|
||||
@ -346,9 +344,9 @@ class VidalClaimImportService extends BaseTpaClaimImportService
|
||||
|
||||
// Meta
|
||||
'file_id' => 'file_id',
|
||||
'type_of_claim' => 'tpa_claim_type',
|
||||
];
|
||||
|
||||
|
||||
protected $statusMapping = [
|
||||
'CL Paid with Settlement Letter' => 11,
|
||||
'CL Rejected' => 8,
|
||||
@ -380,9 +378,7 @@ class VidalClaimImportService extends BaseTpaClaimImportService
|
||||
}
|
||||
|
||||
$ticketMasterModel = new TicketMasterModel();
|
||||
$ticketMasterModel->insertBatch($data);
|
||||
|
||||
return true;
|
||||
return $ticketMasterModel->insertBatch($data);
|
||||
}
|
||||
|
||||
|
||||
@ -393,9 +389,7 @@ class VidalClaimImportService extends BaseTpaClaimImportService
|
||||
}
|
||||
|
||||
$builder = $this->db->table('claims_dump_vidal');
|
||||
$builder->insertBatch($data);
|
||||
|
||||
return true;
|
||||
return $builder->updateBatch($data, 'id');
|
||||
}
|
||||
|
||||
|
||||
@ -406,9 +400,7 @@ class VidalClaimImportService extends BaseTpaClaimImportService
|
||||
}
|
||||
|
||||
$builder = $this->db->table('claims_dump_vidal');
|
||||
$builder->insertBatch($data);
|
||||
|
||||
return true;
|
||||
return $builder->updateBatch($data, 'id');
|
||||
}
|
||||
|
||||
|
||||
@ -514,7 +506,7 @@ class VidalClaimImportService extends BaseTpaClaimImportService
|
||||
|
||||
if ($isduplicate) {
|
||||
$reason = "This claim already exists in our system.";
|
||||
$rejecetd_reason[$row['id']] = ["ticket_master_insert_reject_reason" => $reason];
|
||||
$rejecetd_reason[] = ["id" => $row['id'], "master_reject_reason" => $reason];
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -534,22 +526,14 @@ class VidalClaimImportService extends BaseTpaClaimImportService
|
||||
$item['emp_id'] = $employee_data['id'] ?? null;
|
||||
$item['emp_name'] = $employee_data['name'] ?? null;
|
||||
$item['emp_mail'] = $employee_data['email_corporate'] ?? null;
|
||||
$item['emp_code'] = $employee_data['emp_code'] ?? null;
|
||||
$item['emp_mobile'] = $employee_data['mobile'] ?? null;
|
||||
$item['insured_emp_id'] = $employee_data['insured_emp_id'] ?? null;
|
||||
$item['insured_name'] = $employee_data['insured_name'] ?? null;
|
||||
} else {
|
||||
|
||||
$reason = sprintf(
|
||||
'The policy number "%s" does not exist in our system. ' .
|
||||
'Details - Client ID: %s, Client Policy ID: %s, Employee Number: %s, Relationship: %s',
|
||||
$row['insurer_policy_number'],
|
||||
$file_data['client_id'],
|
||||
$file_data['client_policy_id'],
|
||||
$row['employee_number'],
|
||||
$item['relationship']
|
||||
);
|
||||
|
||||
$rejecetd_reason[$row['id']] = ["ticket_master_insert_reject_reason" => $reason];
|
||||
$reason = 'This employee not exist in our system.';
|
||||
$rejecetd_reason[] = ["id" => $row['id'], "master_reject_reason" => $reason];
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user