FIX_VISIT_SSO&TPA_DELETION_1

This commit is contained in:
velz 2026-04-16 17:45:50 +05:30
parent cad9599fda
commit 24dfb6b289
8 changed files with 65 additions and 18 deletions

1
.gitignore vendored
View File

@ -34,4 +34,5 @@ composer.lock
.env
.phpunit*
phpqueue.sh
.claude

View File

@ -231,11 +231,23 @@ class ApiServiceController extends BaseController
// json_decode(file_get_contents(WRITEPATH.'/tmp/db.json'),true),
// json_decode(file_get_contents(WRITEPATH.'/tmp/medi.json'),true)
// );
// print_rr($report);
// print_rr('tata');
// die();
// $mediAssistController = new MediAssistApiController();
// $mediAssistController->MediAssistGetBenefDetails( [ 'policy_no' => '97000063250400000012', 'file_id' =>'5704','client_policy_id' => '1839' ] );
// $mediAssistController->MediAssistGetBenefDetails( [ 'policy_no' => '97000063250400000016', 'file_id' =>'5704','client_policy_id' => '2002' ] );
// die();
// $vidalApiController = new VidalApiController;
// $vidalApiController->VidalGetBenefDetails( [ 'policy_no' => '570000/48/2026/363', 'file_id' =>'5264','client_policy_id' => '9433'] );
// $fhplApiController = new FhplApiController;
// $fhplApiController->FhplGetBenefDetails( [ 'policy_no' => '570000/48/2026/453', 'file_id' =>'9999','client_policy_id' => '3557'] );
// $healthIndiaApiController = new HealthIndiaApiController;
// $healthIndiaApiController->HealthIndiaGetBenefDetails( [ 'policy_no' => '97000063250400000116', 'file_id' =>'9998','client_policy_id' => '6523'] );
// die();
//START OF THE PROGRAM
log_message('error', "getTPAID payloads :" . json_encode($this->request->getPost() ?? []));
$tpa_id = $this->request->getPost('tpa_id') ?? null;
@ -452,7 +464,7 @@ class ApiServiceController extends BaseController
$data = $db->table('employees e')
->select('pt.policy_type,
e.name, e.email_corporate as email, e.mobile as phone, e.emp_code as memberId, e.gender, e.dob, e.relationship as relation,
cp.policy_no as policyNumber, ep.employee_id as employeeId, cp.policy_start_date as policyStartDate, cp.policy_end_date as policyEndDate , cp.wellness_plan_id as planId , cp.wellness_vendor_id')
cp.policy_no as policyNumber, ep.employee_id as employeeId,ep.id, cp.policy_start_date as policyStartDate, cp.policy_end_date as policyEndDate , cp.wellness_plan_id as planId , cp.wellness_vendor_id')
->join('employee_polices ep', 'e.id = ep.employee_id')
->join('client_policy cp', 'ep.client_policy_id = cp.id')
->join('policy_type pt', 'cp.policy_type_id = pt.id')
@ -480,20 +492,40 @@ class ApiServiceController extends BaseController
}
else if ($row['planId'] != null && empty($row['wellness_vendor_id'])) // VISIT
{
$userParams['name'] = $row['name'];
$userParams['email'] = $row['email'];
$userParams['phone'] = $row['phone'];
$userParams['memberId'] = $row['employeeId']; // memberId is unique primary key.
$userParams['gender'] = $row['gender'];
$userParams['dob'] = $row['dob'];
$userParams['relation'] = $row['relation'];
$userParams['policyNumber'] = $row['policyNumber'];
$userParams['employeeId'] = $row['memberId'];
$userParams['policyStartDate']= $row['policyStartDate'];
$userParams['policyEndDate'] = $row['policyEndDate'];
$userParams['policyName'] = $row['policy_type'];
$userParams['planId'] = $row['planId'];
$userParams['moduleName'] = 'home';
//OLD PARAMS
// $userParams['name'] = $row['name'];
// $userParams['email'] = $row['email'];
// $userParams['phone'] = $row['phone'];
// $userParams['memberId'] = $row['employeeId']; // memberId is unique primary key.
// $userParams['gender'] = $row['gender'];
// $userParams['dob'] = $row['dob'];
// $userParams['relation'] = $row['relation'];
// $userParams['policyNumber'] = $row['policyNumber'];
// $userParams['employeeId'] = $row['memberId'];
// $userParams['policyStartDate']= $row['policyStartDate'];
// $userParams['policyEndDate'] = $row['policyEndDate'];
// $userParams['policyName'] = $row['policy_type'];
// $userParams['planId'] = $row['planId'];
// $userParams['moduleName'] = 'home';
//NEW PARAMS
$userParams['memberId'] = $row['id']; // employee policy primary key (which used while onboard)from DB
$userParams['phone'] = $row['phone'];
$userParams['email'] = $row['email'];
$userParams['relationship'] = $row['relation'];
$userParams['gender'] = $row['gender'];
$userParams['dob'] = $row['dob'];
$userParams['policyNumber'] = $row['policyNumber'];
$userParams['policyStartDate'] = $row['policyStartDate'];
$userParams['policyEndDate'] = $row['policyEndDate'];
$userParams['plan'] = $row['planId'];
$userParams['source'] = 'NAHANCE';
$userParams['employeeId'] = $row['memberId'];
$userParams['firstName'] = $row['name'];
$userParams['middleName'] = '';
$userParams['lastName'] = '';
break; // stop after first GMC match
}
}

View File

@ -497,6 +497,8 @@ class EmployeeController extends AdminController
batch_files.amount,
batch_files.status,
batch_files.client_branch_id,
insurers.short_name as insurer_short_name,
tpa.short_name as tpa_short_name,
DATE_FORMAT(batch_files.policy_issue_date, '%d/%m/%Y') AS policy_issue_date,
CASE
@ -512,6 +514,8 @@ class EmployeeController extends AdminController
")
->join('client_policy', 'client_policy.id = batch_files.client_policy_id')
->join('insurers', 'client_policy.insurer_id = insurers.id')
->join('tpa', 'client_policy.tpa_id = tpa.id')
->join('client_branch', 'client_branch.id = batch_files.client_branch_id')
->join('policy_type', 'policy_type.id = client_policy.policy_type_id')
->join('clients', 'clients.id = client_policy.client_id')

View File

@ -1037,6 +1037,7 @@ class FhplApiController extends BaseController
'is_active' => 1,
'created_by' => $file_info[0]['created_by'] ?? null,
'action_flag_status' => $row['IsActive'] == 1 ? 'A' : 'D'
];
}

View File

@ -1066,6 +1066,7 @@ class HealthIndiaApiController extends BaseController
'is_active' => 1,
'created_by' => $file_info[0]['created_by'] ?? null,
'action_flag_status' => $row['insuredStatus'] == 'Active' ? 'A' : 'D'
];
}
// log_message('error','HEALTH_INDIA - COUNT' . count($mappedRows));

View File

@ -807,7 +807,7 @@ class MediAssistApiController extends BaseController
'gender' => strtoupper($row['benefSex'] ?? null),
'self' => strtolower($row['relName'] ?? '') === 'self' ? 1 : 0,
'si' => $row['sum_insured'] ?? null,
'si' => $row['sum_Insured'] ?? null,
'doj' => $this->mediDate($row['benefWEF'] ?? null),

View File

@ -1617,6 +1617,7 @@ class VidalApiController extends BaseController
'doj' => $doj,
'is_active' => 1,
'created_by' => $file_info[0]['created_by'] ?? null,
'action_flag_status' => $row['isDeleted'] == 0 ? 'D' : 'A'
];
}

View File

@ -141,7 +141,14 @@
<!-- <td><?php echo isset($file['policy_name']) ? $file['policy_name'] : '' ?> - <?php echo isset($file['policy_no']) ? $file['policy_no'] : '' ?> - <?php echo isset($file['policy_type']) ? $file['policy_type'] : '' ?></td> -->
<td><?php echo isset($file['policy_type']) ? $file['policy_type'] : '' ?> - <?php echo isset($file['policy_no']) ? $file['policy_no'] : '' ?></td>
<td><?php echo $file['event_type'] ?></td>
<td><?php echo $insurer_or_tpa[$file['insurer_or_tpa']] ?></td>
<td><?php echo $insurer_or_tpa[$file['insurer_or_tpa']] ?>
<?php $insurer_or_tpa_display = $insurer_or_tpa[$file['insurer_or_tpa']] == 'TPA' ? $file['tpa_short_name'] : $file['insurer_short_name'] ?>
<a href=""
class="fe-alert-circle" style="color: #000;" aria-hidden="true"
data-toggle="tooltip" data-placement="top" title="<?php echo $insurer_or_tpa_display ?>"></a>
</td>
<td><?php echo $import_or_export[$file['actions']] ?? ucfirst($file['actions']) ?></td>
<td><?php echo $file['count'] == null ? '-' : $file['count'] ?></td>