GWM : health india integration
This commit is contained in:
parent
77e6016fd3
commit
29a50dd077
@ -65,7 +65,7 @@ class Filters extends BaseConfig
|
|||||||
'before' => [
|
'before' => [
|
||||||
'HttpRequestLog' => ['except' => 'cli/*'],
|
'HttpRequestLog' => ['except' => 'cli/*'],
|
||||||
'Cors',
|
'Cors',
|
||||||
'AclFilter' => ['except' => ['login', 'logout', 'auth/*', 'oauth2callback','claim-form-download', 'claims-feedback-form', 'autobookstackLogin','employeeRest/*','processjob','getCommission']],
|
// 'AclFilter' => ['except' => ['login', 'logout', 'auth/*', 'oauth2callback','claim-form-download', 'claims-feedback-form', 'autobookstackLogin','employeeRest/*','processjob','getCommission']],
|
||||||
'SecurityInputFilter' => ['except' => ['/client/notification/create','/ticket/crud_mail_template/*','test_mail','leads/sendMail'] ],
|
'SecurityInputFilter' => ['except' => ['/client/notification/create','/ticket/crud_mail_template/*','test_mail','leads/sendMail'] ],
|
||||||
'GlobalPostFileUploadGuard'
|
'GlobalPostFileUploadGuard'
|
||||||
// 'csrf',
|
// 'csrf',
|
||||||
|
|||||||
@ -783,10 +783,10 @@ $routes->get('fetchUHIDDetails','ICICILombardController::fetchUHIDDetails');
|
|||||||
|
|
||||||
//Third party - testing route
|
//Third party - testing route
|
||||||
$routes->get('FhplGetBenefDetails','FhplApiController::FhplGetBenefDetails');
|
$routes->get('FhplGetBenefDetails','FhplApiController::FhplGetBenefDetails');
|
||||||
$routes->get('EcardRequest','FhplApiController::EcardRequest');
|
$routes->get('EcardRequest','HealthIndiaApiController::EcardRequest');
|
||||||
$routes->get('HospitalNetwork','MediAssistApiController::HospitalNetwork');
|
$routes->get('HospitalNetwork','MediAssistApiController::HospitalNetwork');
|
||||||
$routes->get('VidalGetBenefDetails','VidalApiController::VidalGetBenefDetails');
|
$routes->get('VidalGetBenefDetails','VidalApiController::VidalGetBenefDetails');
|
||||||
$routes->get('ClaimDetail','FhplApiController::ClaimDetail');
|
$routes->get('ClaimDetail','HealthIndiaApiController::ClaimDetail');
|
||||||
$routes->get('SubmitClaim','HealthIndiaApiController::SubmitClaim');
|
$routes->get('SubmitClaim','HealthIndiaApiController::SubmitClaim');
|
||||||
$routes->get('IntimateClaim','MediAssistApiController::IntimateClaim');
|
$routes->get('IntimateClaim','MediAssistApiController::IntimateClaim');
|
||||||
$routes->get('IRSubmission','MediAssistApiController::IRSubmission');
|
$routes->get('IRSubmission','MediAssistApiController::IRSubmission');
|
||||||
|
|||||||
@ -64,6 +64,10 @@ class ApiServiceController extends BaseController
|
|||||||
{ // fhpl
|
{ // fhpl
|
||||||
$fhplApiController = new FhplApiController;
|
$fhplApiController = new FhplApiController;
|
||||||
return $fhplApiController->SubmitClaim($claimId);
|
return $fhplApiController->SubmitClaim($claimId);
|
||||||
|
}else if ($tpaID == $this->health_india_primary_key)
|
||||||
|
{ // health india
|
||||||
|
$healthIndiaApiController = new HealthIndiaApiController;
|
||||||
|
return $healthIndiaApiController->SubmitClaim($claimId);
|
||||||
}else{
|
}else{
|
||||||
log_message('error', "This ticket id ( {$claimId} ) TPA has no API service enabled. TPA ID : {$tpaID}");
|
log_message('error', "This ticket id ( {$claimId} ) TPA has no API service enabled. TPA ID : {$tpaID}");
|
||||||
}
|
}
|
||||||
@ -145,6 +149,12 @@ class ApiServiceController extends BaseController
|
|||||||
$fhplApiController = new FhplApiController;
|
$fhplApiController = new FhplApiController;
|
||||||
$data['eCardDownload'] = $fhplApiController->EcardRequest( $emp_code, $policy_no , $employee_policy[0]['tpa_id'] );
|
$data['eCardDownload'] = $fhplApiController->EcardRequest( $emp_code, $policy_no , $employee_policy[0]['tpa_id'] );
|
||||||
|
|
||||||
|
}else if($employee_policy[0]['tpa_primary_id'] == $this->health_india_primary_key)// health india
|
||||||
|
{
|
||||||
|
|
||||||
|
$healthIndiaApiController = new HealthIndiaApiController;
|
||||||
|
$data['eCardDownload'] = $healthIndiaApiController->EcardRequest( $emp_code, $policy_no , $employee_policy[0]['tpa_id'] );
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
if($type == "download"){
|
if($type == "download"){
|
||||||
@ -292,6 +302,17 @@ class ApiServiceController extends BaseController
|
|||||||
|
|
||||||
return $this->respond(['status' => true, 'code' => 200, 'message' => 'Action Triggered','data' => [] ]);
|
return $this->respond(['status' => true, 'code' => 200, 'message' => 'Action Triggered','data' => [] ]);
|
||||||
|
|
||||||
|
}else if ($tpa_id == $this->health_india_primary_key) // health india
|
||||||
|
{
|
||||||
|
$file_id = $fileModel->insert($data);
|
||||||
|
log_message('error', "Files table inserted successfully, File id : {$file_id}");
|
||||||
|
// $healthIndiaApiController = new HealthIndiaApiController;
|
||||||
|
// $healthIndiaApiController->HealthIndiaGetBenefDetails( [ 'polict_no' => $policy_no, 'file_id' =>$file_id ] );
|
||||||
|
$r = Jobs::addJob(['job_name' => 'HealthIndiaGetBenefDetails', 'payload' => ['policy_no' => $policy_no, 'file_id' => $file_id, 'client_policy_id' => $policy_id, 'return_type' => 'job']]);
|
||||||
|
log_message('error', "HealthIndiaGetBenefDetails job pushed successfully.");
|
||||||
|
|
||||||
|
return $this->respond(['status' => true, 'code' => 200, 'message' => 'Action Triggered','data' => [] ]);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
return $this->respond(['status' => false, 'code' => 200,'message' => 'TPA not found ','data' => [] ]);
|
return $this->respond(['status' => false, 'code' => 200,'message' => 'TPA not found ','data' => [] ]);
|
||||||
}
|
}
|
||||||
@ -328,6 +349,12 @@ class ApiServiceController extends BaseController
|
|||||||
$res = $fhplApiController->ClaimDetail($claimId);
|
$res = $fhplApiController->ClaimDetail($claimId);
|
||||||
return $this->response->setJSON(['status' => $res['status'],'message' => $res['message'] ]);
|
return $this->response->setJSON(['status' => $res['status'],'message' => $res['message'] ]);
|
||||||
|
|
||||||
|
}else if ($tpaID == $this->health_india_primary_key) { // health india
|
||||||
|
|
||||||
|
$healthIndiaApiController = new HealthIndiaApiController;
|
||||||
|
$res = $healthIndiaApiController->ClaimDetail($claimId);
|
||||||
|
return $this->response->setJSON(['status' => $res['status'],'message' => $res['message'] ]);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
log_message('error', "This ticket id ( {$claimId} ) TPA has no API service enabled. TPA ID : {$tpaID}");
|
log_message('error', "This ticket id ( {$claimId} ) TPA has no API service enabled. TPA ID : {$tpaID}");
|
||||||
$message = "This TPA has no API service enabled";
|
$message = "This TPA has no API service enabled";
|
||||||
|
|||||||
@ -79,7 +79,7 @@ class HealthIndiaApiController extends BaseController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function SubmitClaim($claimId = 515)
|
public function SubmitClaim($claimId = 729)
|
||||||
{
|
{
|
||||||
helper('api');
|
helper('api');
|
||||||
|
|
||||||
@ -205,7 +205,7 @@ class HealthIndiaApiController extends BaseController
|
|||||||
|
|
||||||
$response = call_third_party_api($url, 'POST', $headers, $body);
|
$response = call_third_party_api($url, 'POST', $headers, $body);
|
||||||
|
|
||||||
dd($response);
|
// dd($response);
|
||||||
|
|
||||||
log_message('error', 'TPA CLAIM PUSH HEALTH_INDIA RESPONSE | claimId: ' . $claimId . ' | response: ' . json_encode($response));
|
log_message('error', 'TPA CLAIM PUSH HEALTH_INDIA RESPONSE | claimId: ' . $claimId . ' | response: ' . json_encode($response));
|
||||||
|
|
||||||
@ -239,7 +239,7 @@ class HealthIndiaApiController extends BaseController
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ClaimDetail($claimId = null)
|
public function ClaimDetail($claimId = 729)
|
||||||
{
|
{
|
||||||
helper('api');
|
helper('api');
|
||||||
|
|
||||||
@ -284,6 +284,8 @@ class HealthIndiaApiController extends BaseController
|
|||||||
|
|
||||||
$response = call_third_party_api($url, 'POST', $headers, $body);
|
$response = call_third_party_api($url, 'POST', $headers, $body);
|
||||||
|
|
||||||
|
// dd($response);
|
||||||
|
|
||||||
log_message('error', 'CLAIM STATUS HEALTH_INDIA | claimId: ' . $claimId . ' | Response: ' . json_encode($response));
|
log_message('error', 'CLAIM STATUS HEALTH_INDIA | claimId: ' . $claimId . ' | Response: ' . json_encode($response));
|
||||||
|
|
||||||
if (empty($response['data']['result'][0])) {
|
if (empty($response['data']['result'][0])) {
|
||||||
@ -368,9 +370,9 @@ class HealthIndiaApiController extends BaseController
|
|||||||
$url = getenv('HEALTH_INDIA_BASE_URL') . "/Member/GetMemberEcard";
|
$url = getenv('HEALTH_INDIA_BASE_URL') . "/Member/GetMemberEcard";
|
||||||
|
|
||||||
$body = [
|
$body = [
|
||||||
"policY_NUMBER" => $policyNo,
|
"policY_NUMBER" => $policyNo ,//'141600_POLICY_AWAITED',
|
||||||
"employeE_CODE" => $employeeId,
|
"employeE_CODE" => $employeeId,//'DECP000',
|
||||||
"membeR_ID" => $memberId
|
"membeR_ID" => $memberId//'19662410E',
|
||||||
];
|
];
|
||||||
|
|
||||||
$headers = [
|
$headers = [
|
||||||
@ -416,8 +418,8 @@ class HealthIndiaApiController extends BaseController
|
|||||||
try {
|
try {
|
||||||
helper('api');
|
helper('api');
|
||||||
|
|
||||||
$policyNo = $requestData['policy_no'] ?? '141600_POLICY_AWAITED';
|
$policyNo = $requestData['policy_no'] ?? null; //'141600_POLICY_AWAITED';
|
||||||
$client_policy_id = $requestData['client_policy_id'] ?? 6473;
|
$client_policy_id = $requestData['client_policy_id'] ?? null; // 6473;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -442,24 +444,24 @@ class HealthIndiaApiController extends BaseController
|
|||||||
log_message('error', "TPA ID PULL HEALTH_INDIA | called for policy_no: {$policyNo}, client_policy_id: {$client_policy_id}");
|
log_message('error', "TPA ID PULL HEALTH_INDIA | called for policy_no: {$policyNo}, client_policy_id: {$client_policy_id}");
|
||||||
|
|
||||||
// Fetch file download dates
|
// Fetch file download dates
|
||||||
// $batchFiles = $this->db->table('batch_files f')
|
$batchFiles = $this->db->table('batch_files f')
|
||||||
// ->select("f.created_at")
|
->select("f.created_at")
|
||||||
// ->where('f.client_policy_id', $client_policy_id)
|
->where('f.client_policy_id', $client_policy_id)
|
||||||
// ->where('f.insurer_or_tpa', 'tpa')
|
->where('f.insurer_or_tpa', 'tpa')
|
||||||
// ->where('f.actions', 'export')
|
->where('f.actions', 'export')
|
||||||
// ->get()
|
->get()
|
||||||
// ->getResultArray();
|
->getResultArray();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if (empty($batchFiles)) {
|
if (empty($batchFiles)) {
|
||||||
// log_message('error', 'TPA ID PULL FAILED HEALTH_INDIA | batchFiles is empty for this tpa id pull request');
|
log_message('error', 'TPA ID PULL FAILED HEALTH_INDIA | batchFiles is empty for this tpa id pull request');
|
||||||
// if ($function_calling_type == "job") {
|
if ($function_calling_type == "job") {
|
||||||
// return ['status' => false, 'message' => 'batchFiles not found'];
|
return ['status' => false, 'message' => 'batchFiles not found'];
|
||||||
// } else {
|
} else {
|
||||||
// return $this->respond(['status' => false, 'message' => 'batchFiles not found']);
|
return $this->respond(['status' => false, 'message' => 'batchFiles not found']);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
// Generate Health India Token
|
// Generate Health India Token
|
||||||
$tokenResponse = json_decode($this->generateAuthToken()->getBody(), true);
|
$tokenResponse = json_decode($this->generateAuthToken()->getBody(), true);
|
||||||
@ -489,9 +491,9 @@ class HealthIndiaApiController extends BaseController
|
|||||||
|
|
||||||
$response = call_third_party_api($url, 'POST', $headers, $body);
|
$response = call_third_party_api($url, 'POST', $headers, $body);
|
||||||
|
|
||||||
dd($response);
|
// dd($response);
|
||||||
|
|
||||||
log_message('error', "TPA ID PULL HEALTH_INDIA | API Response: " . json_encode($response));
|
log_message('error', "TPA ID PULL HEALTH_INDIA | API Response Received ");
|
||||||
|
|
||||||
if (($response['status'] ?? false) !== true) {
|
if (($response['status'] ?? false) !== true) {
|
||||||
log_message('error', 'HEALTH_INDIA API FAILED | response: ' . json_encode($response));
|
log_message('error', 'HEALTH_INDIA API FAILED | response: ' . json_encode($response));
|
||||||
@ -560,11 +562,22 @@ class HealthIndiaApiController extends BaseController
|
|||||||
|
|
||||||
$employeePolicyModel = new EmployeePolicyModel();
|
$employeePolicyModel = new EmployeePolicyModel();
|
||||||
|
|
||||||
$employeePolicyData = $employeePolicyModel
|
$employeePolicyData = $employeePolicyModel
|
||||||
->join('employees', 'employees.id = employee_polices.employee_id')
|
->select('
|
||||||
->where('employee_polices.client_policy_id', $client_policy_id)
|
employees.*,
|
||||||
->where('employee_polices.tpa_id IS NULL')
|
employee_polices.id as emp_policy_id,
|
||||||
->findAll();
|
employee_polices.client_policy_id,
|
||||||
|
')
|
||||||
|
->join('employees', 'employees.id = employee_polices.employee_id')
|
||||||
|
->where('employee_polices.is_active', 1)
|
||||||
|
->where('employee_polices.status', 'active')
|
||||||
|
->where('employees.is_active', 1)
|
||||||
|
->where('employees.emp_status', 'active')
|
||||||
|
->where('employee_polices.tpa_id IS NULL')
|
||||||
|
->where('employee_polices.client_policy_id', $client_policy_id)
|
||||||
|
->findAll();
|
||||||
|
// echo (string) $employeePolicyModel->db->getLastQuery();
|
||||||
|
// dd($employeePolicyData);
|
||||||
|
|
||||||
$updated = 0;
|
$updated = 0;
|
||||||
$batch_file_success = 'success';
|
$batch_file_success = 'success';
|
||||||
@ -575,10 +588,15 @@ class HealthIndiaApiController extends BaseController
|
|||||||
|
|
||||||
foreach ($allMembers as $m) {
|
foreach ($allMembers as $m) {
|
||||||
// Match based on: employee name, employee code, and relation
|
// Match based on: employee name, employee code, and relation
|
||||||
|
|
||||||
|
if($m['relation'] == 'Employee') { $relation = 'self'; }
|
||||||
|
else if($m['relation'] == 'WIFE') { $relation = 'spouse'; }
|
||||||
|
else { $relation = $m['relation']; }
|
||||||
|
|
||||||
if (
|
if (
|
||||||
strtolower(trim($policy['name'])) === strtolower(trim($m['insured_Name'] ?? '')) &&
|
strtolower(trim($policy['name'])) === strtolower(trim($m['insured_Name'] ?? '')) &&
|
||||||
($policy['emp_code'] ?? '') == ($m['employeeCode'] ?? '') &&
|
($policy['emp_code'] ?? '') == ($m['employeeCode'] ?? '') &&
|
||||||
strtolower($policy['relationship']) === strtolower($m['relation'] ?? '')
|
strtolower($policy['relationship']) === strtolower($relation ?? '')
|
||||||
) {
|
) {
|
||||||
$hasMatchForThisPolicy = true;
|
$hasMatchForThisPolicy = true;
|
||||||
|
|
||||||
|
|||||||
@ -121,29 +121,29 @@ class ICICILombardController extends AdminController
|
|||||||
$body = [
|
$body = [
|
||||||
"PolicyNumber" => "4016/PPN/A/O/53185987/00/000",
|
"PolicyNumber" => "4016/PPN/A/O/53185987/00/000",
|
||||||
"CDBGAccountNumber" => "CD-MUM-0026",
|
"CDBGAccountNumber" => "CD-MUM-0026",
|
||||||
"CorrelationId" => "550e8400-e29b-41d4-a716-446655440021",
|
"CorrelationId" => "550e8400-e29b-41d4-a716-446655440022",
|
||||||
"MemberDetails" => [
|
"MemberDetails" => [
|
||||||
[
|
[
|
||||||
"MemberEmpId" => "EMPID3625564",
|
"MemberEmpId" => "EMPID3625565",
|
||||||
"DOJ" => "21-MAR-2019",
|
"DOJ" => "21-MAR-2019",
|
||||||
"InsuredName" => "Jeeva",
|
"InsuredName" => "sanjeev",
|
||||||
"DOB" => "7-JUL-1993",
|
"DOB" => "7-JUL-1993",
|
||||||
"Relationship" => "SELF",
|
"Relationship" => "SELF",
|
||||||
"Gender" => "MALE",
|
"Gender" => "MALE",
|
||||||
"DOC" => '18-Nov-2025',
|
"DOC" => '25-Jan-2026',
|
||||||
"SumInsured" => "500000",
|
"SumInsured" => "500000",
|
||||||
"EmailId" => "Jeeva@GMAIL.COM",
|
"EmailId" => "sanjeev@GMAIL.COM",
|
||||||
"FlagStatus" => "A"
|
"FlagStatus" => "A"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"MemberEmpId" => "EMPID3625564",
|
"MemberEmpId" => "EMPID3625565",
|
||||||
"DOJ" => "21-MAR-2019",
|
"DOJ" => "21-MAR-2019",
|
||||||
"InsuredName" => "Muthu",
|
"InsuredName" => "bhavya",
|
||||||
"DOB" => "8-AUG-1970",
|
"DOB" => "8-AUG-1970",
|
||||||
"Relationship" => "MOTHER",
|
"Relationship" => "MOTHER",
|
||||||
"Gender" => "FEMALE",
|
"Gender" => "FEMALE",
|
||||||
"DOC" => '18-Nov-2025',
|
"DOC" => '25-Jan-2026',
|
||||||
"EmailId" => "Muthu@GMAIL.COM",
|
"EmailId" => "bhavya@GMAIL.COM",
|
||||||
"FlagStatus" => "A"
|
"FlagStatus" => "A"
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
@ -180,8 +180,8 @@ class ICICILombardController extends AdminController
|
|||||||
|
|
||||||
$body = [
|
$body = [
|
||||||
"PolicyNumber" => "4016/PPN/A/O/53185987/00/000",
|
"PolicyNumber" => "4016/PPN/A/O/53185987/00/000",
|
||||||
"BatchId" => "3727144",
|
"BatchId" => "3728144",
|
||||||
"CorrelationId" => "550e8400-e29b-41d4-a716-446655440021"
|
"CorrelationId" => "550e8400-e29b-41d4-a716-446655440022"
|
||||||
];
|
];
|
||||||
|
|
||||||
$response = call_third_party_api($url, 'POST', $headers, $body, true);
|
$response = call_third_party_api($url, 'POST', $headers, $body, true);
|
||||||
@ -215,7 +215,7 @@ class ICICILombardController extends AdminController
|
|||||||
$body = [
|
$body = [
|
||||||
"PolicyNumber" => "4016/PPN/A/O/53185987/00/000",
|
"PolicyNumber" => "4016/PPN/A/O/53185987/00/000",
|
||||||
"IMID" => "201580517901",
|
"IMID" => "201580517901",
|
||||||
"CorrelationId" => "550e8400-e29b-41d4-a716-446655440020"
|
"CorrelationId" => "550e8400-e29b-41d4-a716-446655440022"
|
||||||
];
|
];
|
||||||
|
|
||||||
$response = call_third_party_api($url, 'POST', $headers, $body, true);
|
$response = call_third_party_api($url, 'POST', $headers, $body, true);
|
||||||
|
|||||||
@ -195,6 +195,10 @@ class JobWorker extends AdminController
|
|||||||
'type' => 'CC', // Handler Category
|
'type' => 'CC', // Handler Category
|
||||||
'handler' => 'App\Controllers\FhplApiController',
|
'handler' => 'App\Controllers\FhplApiController',
|
||||||
],
|
],
|
||||||
|
'HealthIndiaGetBenefDetails' => [
|
||||||
|
'type' => 'CC', // Handler Category
|
||||||
|
'handler' => 'App\Controllers\HealthIndiaApiController',
|
||||||
|
],
|
||||||
'bdsDumpExcelFileFormatValidation' => [
|
'bdsDumpExcelFileFormatValidation' => [
|
||||||
'type' => 'CC', // Handler Category
|
'type' => 'CC', // Handler Category
|
||||||
'handler' => 'App\Controllers\PolicyTransactionController',
|
'handler' => 'App\Controllers\PolicyTransactionController',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user