FIX_CLAIM_DUMP_ISSUES
This commit is contained in:
parent
e2cc55c25c
commit
b3c73e670e
@ -6446,12 +6446,12 @@ class ClientController extends AdminController
|
||||
// $response = $ticketServiceController->getClaimExcelErrorData(["file_id" => 41]);
|
||||
// $response = $ticketServiceController->claimDumpOnBoardProcess(["file_id" => 17]);
|
||||
// $response = $ticketServiceController->extractExcelData("claims_dump_form_client.xlsx");
|
||||
// $response = $ticketServiceController->tpaClaimDumpImporter(["file_id" => 52]); //reliance
|
||||
// $response = $ticketServiceController->tpaClaimDumpImporter(["file_id" => 50]); //fhpl
|
||||
// $response = $ticketServiceController->tpaClaimDumpImporter(["file_id" => 51]); //abhi
|
||||
// $response = $ticketServiceController->tpaClaimDumpImporter(["file_id" => 48]); //vidal
|
||||
// $response = $ticketServiceController->tpaClaimDumpImporter(["file_id" => 50]); //fhpl
|
||||
// $response = $ticketServiceController->tpaClaimDumpImporter(["file_id" => 53]); //icici
|
||||
// $response = $ticketServiceController->tpaClaimDumpImporter(["file_id" => 54]); //mediassist
|
||||
// $response = $ticketServiceController->tpaClaimDumpImporter(["file_id" => 52]); //reliance
|
||||
// $response = $ticketServiceController->tpaClaimDumpImporter(["file_id" => 48]); //vidal
|
||||
// $response = $ticketServiceController->tpaClaimDumpToTicketMasterImporters(["file_id" => 48]); //vidal
|
||||
// $response = $ticketServiceController->tpaClaimDumpToTicketMasterImporters(["file_id" => 54]); //mediassist
|
||||
|
||||
|
||||
@ -581,6 +581,8 @@ class EmployeeController extends AdminController
|
||||
$filePath = ROOTPATH . 'public/sample_excel/sample_multievent_file.xlsx';
|
||||
}else if ($actionType == 'bds_upload') {
|
||||
$filePath = ROOTPATH . 'public/sample_excel/sample_bds_bulk_upload_excel.xlsx';
|
||||
}else if ($actionType == 'claim_dump_upload') {
|
||||
$filePath = ROOTPATH . 'public/sample_excel/sample_claim_dump_upload_excel.xlsx';
|
||||
}
|
||||
|
||||
// Check if the file exists
|
||||
|
||||
@ -148,20 +148,7 @@ class AbhiClaimImportService extends BaseTpaClaimImportService
|
||||
}
|
||||
|
||||
$builder = $this->db->table('claims_dump_abhi');
|
||||
|
||||
foreach ($data as $value) {
|
||||
|
||||
if (!$builder->insert($value)) {
|
||||
|
||||
// 🔍 Debug purpose
|
||||
log_message('error', print_r($this->db->error(), true));
|
||||
log_message('error', $this->db->getLastQuery());
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return $builder->insertBatch($data);
|
||||
}
|
||||
|
||||
|
||||
@ -321,8 +308,14 @@ class AbhiClaimImportService extends BaseTpaClaimImportService
|
||||
$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;
|
||||
if (!empty($employee_data['insured_emp_id'])) {
|
||||
$item['insured_emp_id'] = $employee_data['insured_emp_id'] ?? null;
|
||||
$item['insured_name'] = $employee_data['insured_name'] ?? null;
|
||||
}else{
|
||||
$reason = 'This Dependent employee not exist in our system.';
|
||||
$rejecetd_reason[] = ["id" => $row['id'], "master_reject_reason" => $reason];
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
|
||||
$reason = 'This employee not exist in our system.';
|
||||
|
||||
@ -92,6 +92,7 @@ abstract class BaseTpaClaimImportService
|
||||
|
||||
$message = '';
|
||||
$hasExecutedTask = false;
|
||||
$status = true;
|
||||
|
||||
// Process Mapped Data
|
||||
if (!empty($ticketMasterData['mapped_array'])) {
|
||||
@ -102,6 +103,8 @@ abstract class BaseTpaClaimImportService
|
||||
}
|
||||
$message .= 'Ticket Master Claim bulk insert success. ';
|
||||
$hasExecutedTask = true;
|
||||
}else{
|
||||
$status = false;
|
||||
}
|
||||
|
||||
// Process Rejected Reasons
|
||||
@ -113,7 +116,7 @@ abstract class BaseTpaClaimImportService
|
||||
}
|
||||
|
||||
$message .= empty($ticketMasterData['mapped_array'])
|
||||
? 'Those employees not in our system. '
|
||||
? 'Those employee or dependent not in our system. '
|
||||
: 'Ticket Master Claim rejected reason updated successfully. ';
|
||||
$hasExecutedTask = true;
|
||||
}
|
||||
@ -126,7 +129,7 @@ abstract class BaseTpaClaimImportService
|
||||
|
||||
// 2. Commit the transaction
|
||||
$this->db->transCommit();
|
||||
return ['status' => true, 'message' => trim($message)];
|
||||
return ['status' => $status, 'message' => trim($message)];
|
||||
|
||||
} catch (\Throwable $th) {
|
||||
// 3. Rollback on crash
|
||||
|
||||
@ -217,12 +217,9 @@ class FhplClaimImportService extends BaseTpaClaimImportService
|
||||
return false;
|
||||
}
|
||||
|
||||
$ClaimsDumpFhplModel = new ClaimsDumpFhplModel();
|
||||
$result = $ClaimsDumpFhplModel->insertBatch($data);
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
$builder = $this->db->table('claims_dump_fhpl');
|
||||
return $builder->insertBatch($data);
|
||||
}
|
||||
|
||||
|
||||
public function importClaimMaster(array $data): bool
|
||||
@ -381,8 +378,14 @@ class FhplClaimImportService extends BaseTpaClaimImportService
|
||||
$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;
|
||||
if (!empty($employee_data['insured_emp_id'])) {
|
||||
$item['insured_emp_id'] = $employee_data['insured_emp_id'] ?? null;
|
||||
$item['insured_name'] = $employee_data['insured_name'] ?? null;
|
||||
}else{
|
||||
$reason = 'This Dependent employee not exist in our system.';
|
||||
$rejecetd_reason[] = ["id" => $row['id'], "master_reject_reason" => $reason];
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
|
||||
$reason = 'This employee not exist in our system.';
|
||||
|
||||
@ -135,29 +135,8 @@ class IciciClaimImportService extends BaseTpaClaimImportService
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
|
||||
$ClaimsDumpFhplModel = new ClaimsDumpFhplModel();
|
||||
$result = $ClaimsDumpFhplModel->insertBatch($data);
|
||||
|
||||
return true;
|
||||
|
||||
} catch (\Throwable $th) {
|
||||
|
||||
$errorData = [
|
||||
'message' => $th->getMessage(),
|
||||
'file' => $th->getFile(),
|
||||
'line' => $th->getLine(),
|
||||
'code' => $th->getCode(),
|
||||
'trace' => $th->getTraceAsString(),
|
||||
'trace_array' => $th->getTrace(), // full array version (optional)
|
||||
'function' => $th->getTrace()[0]['function'] ?? null,
|
||||
'class' => $th->getTrace()[0]['class'] ?? null,
|
||||
];
|
||||
return false;
|
||||
}
|
||||
|
||||
$builder = $this->db->table('claims_dump_icici');
|
||||
return $builder->insertBatch($data);
|
||||
}
|
||||
|
||||
|
||||
@ -317,8 +296,14 @@ class IciciClaimImportService extends BaseTpaClaimImportService
|
||||
$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;
|
||||
if (!empty($employee_data['insured_emp_id'])) {
|
||||
$item['insured_emp_id'] = $employee_data['insured_emp_id'] ?? null;
|
||||
$item['insured_name'] = $employee_data['insured_name'] ?? null;
|
||||
}else{
|
||||
$reason = 'This Dependent employee not exist in our system.';
|
||||
$rejecetd_reason[] = ["id" => $row['id'], "master_reject_reason" => $reason];
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
|
||||
$reason = 'This employee not exist in our system.';
|
||||
|
||||
@ -334,8 +334,14 @@ class MediAssistClaimImportService extends BaseTpaClaimImportService
|
||||
$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;
|
||||
if (!empty($employee_data['insured_emp_id'])) {
|
||||
$item['insured_emp_id'] = $employee_data['insured_emp_id'] ?? null;
|
||||
$item['insured_name'] = $employee_data['insured_name'] ?? null;
|
||||
}else{
|
||||
$reason = 'This Dependent employee not exist in our system.';
|
||||
$rejecetd_reason[] = ["id" => $row['id'], "master_reject_reason" => $reason];
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
|
||||
$reason = 'This employee not exist in our system.';
|
||||
|
||||
@ -124,28 +124,8 @@ class RcareClaimImportService extends BaseTpaClaimImportService
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
$builder = $this->db->table('claims_dump_reliance');
|
||||
$builder->insertBatch($data);
|
||||
|
||||
return true;
|
||||
|
||||
} catch (\Throwable $th) {
|
||||
|
||||
$errorData = [
|
||||
'message' => $th->getMessage(),
|
||||
'file' => $th->getFile(),
|
||||
'line' => $th->getLine(),
|
||||
'code' => $th->getCode(),
|
||||
'trace' => $th->getTraceAsString(),
|
||||
'trace_array' => $th->getTrace(), // full array version (optional)
|
||||
'function' => $th->getTrace()[0]['function'] ?? null,
|
||||
'class' => $th->getTrace()[0]['class'] ?? null,
|
||||
];
|
||||
dd($errorData);
|
||||
return false;
|
||||
}
|
||||
$builder = $this->db->table('claims_dump_reliance');
|
||||
return $builder->insertBatch($data);
|
||||
|
||||
}
|
||||
|
||||
@ -305,8 +285,14 @@ class RcareClaimImportService extends BaseTpaClaimImportService
|
||||
$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;
|
||||
if (!empty($employee_data['insured_emp_id'])) {
|
||||
$item['insured_emp_id'] = $employee_data['insured_emp_id'] ?? null;
|
||||
$item['insured_name'] = $employee_data['insured_name'] ?? null;
|
||||
}else{
|
||||
$reason = 'This Dependent employee not exist in our system.';
|
||||
$rejecetd_reason[] = ["id" => $row['id'], "master_reject_reason" => $reason];
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
|
||||
$reason = 'This employee not exist in our system.';
|
||||
|
||||
@ -364,9 +364,8 @@ class VidalClaimImportService extends BaseTpaClaimImportService
|
||||
}
|
||||
|
||||
$builder = $this->db->table('claims_dump_vidal');
|
||||
$builder->insertBatch($data);
|
||||
return $builder->insertBatch($data);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -541,7 +540,7 @@ class VidalClaimImportService extends BaseTpaClaimImportService
|
||||
}
|
||||
|
||||
// Meta fields
|
||||
$item['claim_status_id'] = $statusMapping[$row['status']] ?? 61;
|
||||
$item['claim_status_id'] = $statusMapping[$row['claim_status']] ?? 61;
|
||||
$item['file_id'] = $file_id;
|
||||
$item['claim_dump_ref_id'] = $row['id'];
|
||||
$item['created_by'] = $file_data['created_by'] ?? null;
|
||||
@ -620,8 +619,14 @@ class VidalClaimImportService extends BaseTpaClaimImportService
|
||||
$item['emp_name'] = $employee_data['id'] ?? null;
|
||||
$item['emp_mail'] = $employee_data['insurer_id'] ?? null;
|
||||
$item['emp_mobile'] = $employee_data['tpa_id'] ?? null;
|
||||
$item['insured_emp_id'] = $employee_data['insured_emp_id'] ?? null;
|
||||
$item['insured_name'] = $employee_data['insured_name'] ?? null;
|
||||
if (!empty($employee_data['insured_emp_id'])) {
|
||||
$item['insured_emp_id'] = $employee_data['insured_emp_id'] ?? null;
|
||||
$item['insured_name'] = $employee_data['insured_name'] ?? null;
|
||||
}else{
|
||||
$reason = 'This Dependent employee not exist in our system.';
|
||||
$rejecetd_reason[] = ["id" => $row['id'], "master_reject_reason" => $reason];
|
||||
continue;
|
||||
}
|
||||
}else{
|
||||
$reason = " This policy no ( " . $row['insurer_policy_number'] ." ) does not exist in our system";
|
||||
$rejecetd_reason[$row['id']] = ["ticket_master_insert_reject_reason" => $reason];
|
||||
|
||||
@ -185,7 +185,7 @@
|
||||
|
||||
<div class="form-group col-md-9">
|
||||
<label>Upload file</label>
|
||||
[ <a href="#" id="excel_download" data-toggle="tooltip" data-placement="top" title="Download Sample Excel">Sample Excel</a> ]
|
||||
[ <a href="<?= base_url("util/download-excel/claim_dump_upload"); ?>" id="download_sample_file" style="font-size: small; color:red !important;">Download sample file</a> ]
|
||||
<input type="file" name="claim_dump_list" id="claim_dump_list" accept=" application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,application/vnd.oasis.opendocument.spreadsheet" required>
|
||||
</div>
|
||||
<div class="form-group col-md-3" style="margin-top: 40px;">
|
||||
|
||||
@ -1863,9 +1863,9 @@
|
||||
<li>
|
||||
<a href="<?= base_url('/ticket/claim-upload') ?>">Claim Dump Upload</a>
|
||||
</li>
|
||||
<li>
|
||||
<!-- <li>
|
||||
<a href="<?= base_url('/claim_mis/list') ?>">Claim MIS Upload</a>
|
||||
</li>
|
||||
</li> -->
|
||||
<!-- <li>
|
||||
<a href="<?= base_url('/ticketList?return_type=web') ?>">Ticket List</a>
|
||||
</li> -->
|
||||
|
||||
BIN
public/sample_excel/sample_claim_dump_upload_excel.xlsx
Normal file
BIN
public/sample_excel/sample_claim_dump_upload_excel.xlsx
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user