FIX_LIVE_ISSUE
This commit is contained in:
parent
2a98550d9e
commit
0039fe72a1
@ -54,19 +54,16 @@ class FhplApiController extends BaseController
|
||||
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
|
||||
if (curl_errno($ch)) {
|
||||
return $this->response->setJSON([
|
||||
'status' => false,
|
||||
'error' => curl_error($ch),
|
||||
]);
|
||||
return ['status' => false,'error' => curl_error($ch),];
|
||||
}
|
||||
|
||||
curl_close($ch);
|
||||
|
||||
return $this->response->setJSON([
|
||||
return [
|
||||
'status' => $httpCode === 200,
|
||||
'http_code' => $httpCode,
|
||||
'data' => json_decode($response, true),
|
||||
]);
|
||||
];
|
||||
}
|
||||
|
||||
public function SubmitClaim($claimId = null) // 515
|
||||
@ -193,7 +190,7 @@ class FhplApiController extends BaseController
|
||||
}
|
||||
|
||||
return ['status' => false, 'message' => 'Claim Push API SUCCESS BUT claimsInfo EMPTY'];
|
||||
// return $this->response->setJSON($response);
|
||||
|
||||
}
|
||||
|
||||
public function ClaimDetail($claimId = null) //515
|
||||
@ -240,57 +237,42 @@ class FhplApiController extends BaseController
|
||||
}
|
||||
|
||||
// Extract claim status
|
||||
// $claimData = $response['data'][0];
|
||||
$allClaimData = $response['data'];
|
||||
$claimData = $response['data'][0];
|
||||
$tpa_claim_no = $claimData['CLAIM_ID'] ?? '';
|
||||
$currentStatus = $claimData['CLAIM_STATUS'] ?? '';
|
||||
$tpa_claim_type = $claimData['CLAIM_TYPE'] ?? '';
|
||||
$tpa_ailments = $claimData['AILMENT'] ?? '';
|
||||
|
||||
$currentStatus = "";
|
||||
foreach ($allClaimData as $claimData) {
|
||||
$validStatuses = [
|
||||
"In-Progress" => 5,
|
||||
"Under Process" => 5,
|
||||
"Query" => 4,
|
||||
"Paid" => 11,
|
||||
"Rejected" => 8,
|
||||
"Approved" => 8,
|
||||
"Required Information" => 4,
|
||||
];
|
||||
|
||||
$tpa_claim_no = $claimData['CLAIM_ID'] ?? '';
|
||||
$currentStatus = $claimData['CLAIM_STATUS'] ?? '';
|
||||
$tpa_claim_type = $claimData['CLAIM_TYPE'] ?? '';
|
||||
$tpa_ailments = $claimData['AILMENT'] ?? '';
|
||||
$doa = !empty($claimData['DATE_OF_ADMISSION'] ?? null) ? date('Y-m-d', strtotime(str_replace('/', '-', $claimData['DATE_OF_ADMISSION']))) : null;
|
||||
|
||||
|
||||
$validStatuses = [
|
||||
"In-Progress" => 5,
|
||||
"Under Process" => 5,
|
||||
"Query" => 4,
|
||||
"Paid" => 11,
|
||||
"Rejected" => 8,
|
||||
"Approved" => 8,
|
||||
"Required Information" => 4,
|
||||
];
|
||||
|
||||
$updateArray = [
|
||||
'tpa_claim_status' => $currentStatus,
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
'last_updated_by' => 'API',
|
||||
];
|
||||
if (isset($validStatuses[$currentStatus])) {
|
||||
$updateArray['claim_status_id'] = $validStatuses[$currentStatus];
|
||||
}
|
||||
if (!empty($tpa_claim_type)) {
|
||||
$updateArray['tpa_claim_type'] = $tpa_claim_type;
|
||||
}
|
||||
if (!empty($tpa_ailments)) {
|
||||
$updateArray['tpa_ailments'] = $tpa_ailments;
|
||||
}
|
||||
if (empty($ticket['tpa_claim_id']) || $ticket['tpa_claim_id'] === null) {
|
||||
$updateArray['tpa_claim_id'] = $tpa_claim_no;
|
||||
}
|
||||
if (empty($ticket['claim_number']) || $ticket['claim_number'] === null) {
|
||||
$updateArray['claim_number'] = $tpa_claim_no;
|
||||
}
|
||||
|
||||
if($ticket['doa'] == $doa || $ticket['claim_number'] == $tpa_claim_no){
|
||||
$this->db->table('ticket_master')->where('id',$claimId)->update($updateArray);
|
||||
log_message('error', "FHPL - Claim status SUCCESS | Updated ticket ID $claimId with claim status: $currentStatus");
|
||||
}else{
|
||||
log_message('error', "FHPL - Claim status NOT UPDATED | TicketID={$claimId} | TicketDOA={$ticket['doa']} | ClaimDOA={$doa} | Status={$currentStatus}");
|
||||
}
|
||||
$updateArray = [
|
||||
'tpa_claim_status' => $currentStatus,
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
];
|
||||
if (isset($validStatuses[$currentStatus])) {
|
||||
$updateArray['claim_status_id'] = $validStatuses[$currentStatus];
|
||||
}
|
||||
if (!empty($tpa_claim_type)) {
|
||||
$updateArray['tpa_claim_type'] = $tpa_claim_type;
|
||||
}
|
||||
if (!empty($tpa_ailments)) {
|
||||
$updateArray['tpa_ailments'] = $tpa_ailments;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$this->db->table('ticket_master')->where('id',$claimId)->update($updateArray);
|
||||
log_message('error', "FHPL - Claim status SUCCESS | Updated ticket ID $claimId with claim status: $currentStatus");
|
||||
|
||||
|
||||
|
||||
return ['status' => true,'message' => 'Claim status updated.','updated_status' => $currentStatus,'api_response' => $response];
|
||||
|
||||
@ -740,7 +722,7 @@ class FhplApiController extends BaseController
|
||||
$tokenResponse = json_decode($this->generateAuthToken()->getBody(), true);
|
||||
|
||||
if (empty($tokenResponse['data']['access_token'])) {
|
||||
return $this->response->setJSON(['status' => false,'message' => 'FHPL Token generation failed']);
|
||||
return ['status' => false,'message' => 'FHPL Token generation failed'];
|
||||
}
|
||||
|
||||
$token = $tokenResponse['data']['access_token'];
|
||||
@ -818,7 +800,7 @@ class FhplApiController extends BaseController
|
||||
$tokenResponse = json_decode($this->generateAuthToken()->getBody(), true);
|
||||
|
||||
if (empty($tokenResponse['data']['access_token'])) {
|
||||
return $this->response->setJSON(['status' => false,'message' => 'FHPL Token generation failed']);
|
||||
return ['status' => false,'message' => 'FHPL Token generation failed'];
|
||||
}
|
||||
|
||||
$token = $tokenResponse['data']['access_token'];
|
||||
@ -1037,10 +1019,6 @@ class FhplApiController extends BaseController
|
||||
'tpa_id' => trim($row['TPA_TPADETAIL_ID'] ?? null),
|
||||
'age' => is_numeric($row['AGE'] ?? null) ? (int) $row['AGE'] : null,
|
||||
|
||||
'si' => $row['BASE_SUMINSURED'] ?? null,
|
||||
'doj' => !empty($row['DATE_OF_JOINING'] ?? null) ? date('Y-m-d', strtotime(str_replace('/', '-', $row['DATE_OF_JOINING']))) : null,
|
||||
|
||||
|
||||
'is_active' => 1,
|
||||
'created_by' => $file_info[0]['created_by'] ?? null,
|
||||
];
|
||||
|
||||
@ -61,10 +61,7 @@ class HealthIndiaApiController extends BaseController
|
||||
if (curl_errno($ch)) {
|
||||
log_message('error', 'HEALTH_INDIA TOKEN GENERATION FAILED | Error: ' . curl_error($ch));
|
||||
curl_close($ch);
|
||||
return $this->response->setJSON([
|
||||
'status' => false,
|
||||
'error' => curl_error($ch),
|
||||
]);
|
||||
return ['status' => false, 'error' => curl_error($ch)];
|
||||
}
|
||||
|
||||
curl_close($ch);
|
||||
@ -77,11 +74,11 @@ class HealthIndiaApiController extends BaseController
|
||||
log_message('error', 'HEALTH_INDIA TOKEN GENERATION FAILED | Response: ' . $response);
|
||||
}
|
||||
|
||||
return $this->response->setJSON([
|
||||
return [
|
||||
'status' => $httpCode === 200,
|
||||
'http_code' => $httpCode,
|
||||
'data' => $responseData,
|
||||
]);
|
||||
];
|
||||
}
|
||||
|
||||
public function SubmitClaim($claimId = null)
|
||||
@ -300,59 +297,45 @@ class HealthIndiaApiController extends BaseController
|
||||
}
|
||||
|
||||
// Extract claim status
|
||||
// $claimData = $response['data']['result'][0];
|
||||
$allClaimData = $response['data']['result'];
|
||||
$claimData = $response['data']['result'][0];
|
||||
$tpa_claim_no = $claimData['tpA_CLAIM_NO'] ?? '';
|
||||
$currentStatus = $claimData['claiM_STATUS'] ?? '';
|
||||
$tpa_claim_type = $claimData['typE_OF_CLAIM'] ?? '';
|
||||
$tpa_ailments = $claimData['ailment'] ?? '';
|
||||
|
||||
$currentStatus = "";
|
||||
foreach ($allClaimData as $claimData) {
|
||||
$validStatuses = [
|
||||
"In-Progress" => 5,
|
||||
"Under Process" => 5,
|
||||
"Query" => 4,
|
||||
"Paid" => 11,
|
||||
"Rejected" => 8,
|
||||
"Approved" => 8,
|
||||
"Required Information" => 4,
|
||||
"Intimated and File NOT received" => 4,
|
||||
];
|
||||
|
||||
$tpa_claim_no = $claimData['tpA_CLAIM_NO'] ?? '';
|
||||
$currentStatus = $claimData['claiM_STATUS'] ?? '';
|
||||
$tpa_claim_type = $claimData['typE_OF_CLAIM'] ?? '';
|
||||
$tpa_ailments = $claimData['ailment'] ?? '';
|
||||
$doa = !empty($claimData['datE_OF_ADMISSION'] ?? null) ? date('Y-m-d', strtotime(str_replace('/', '-', $claimData['datE_OF_ADMISSION']))) : null;
|
||||
|
||||
$validStatuses = [
|
||||
"In-Progress" => 5,
|
||||
"Under Process" => 5,
|
||||
"Query" => 4,
|
||||
"Paid" => 11,
|
||||
"Rejected" => 8,
|
||||
"Approved" => 8,
|
||||
"Required Information" => 4,
|
||||
"Intimated and File NOT received" => 4,
|
||||
];
|
||||
|
||||
$updateArray = [
|
||||
'tpa_claim_status' => $currentStatus,
|
||||
// 'tpa_claim_id' => $tpa_claim_no,
|
||||
// 'claim_number' => $tpa_claim_no,
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
'last_updated_by' => 'API',
|
||||
];
|
||||
if (isset($validStatuses[$currentStatus])) {
|
||||
$updateArray['claim_status_id'] = $validStatuses[$currentStatus];
|
||||
}
|
||||
if (!empty($tpa_claim_type)) {
|
||||
$updateArray['tpa_claim_type'] = $tpa_claim_type;
|
||||
}
|
||||
if (!empty($tpa_ailments)) {
|
||||
$updateArray['tpa_ailments'] = $tpa_ailments;
|
||||
}
|
||||
if (empty($ticket['tpa_claim_id']) || $ticket['tpa_claim_id'] === null) {
|
||||
$updateArray['tpa_claim_id'] = $tpa_claim_no;
|
||||
}
|
||||
if (empty($ticket['claim_number']) || $ticket['claim_number'] === null) {
|
||||
$updateArray['claim_number'] = $tpa_claim_no;
|
||||
}
|
||||
|
||||
if($ticket['doa'] == $doa || $ticket['claim_number'] == $tpa_claim_no){
|
||||
$this->db->table('ticket_master')->where('id',$claimId)->update($updateArray);
|
||||
log_message('error', "HEALTH_INDIA - Claim Status SUCCESS | Updated ticket ID $claimId with claim status: $currentStatus");
|
||||
}else{
|
||||
log_message('error', "HEALTH_INDIA - Claim status NOT UPDATED | TicketID={$claimId} | TicketDOA={$ticket['doa']} | ClaimDOA={$doa} | Status={$currentStatus}");
|
||||
}
|
||||
$updateArray = [
|
||||
'tpa_claim_status' => $currentStatus,
|
||||
'tpa_claim_id' => $tpa_claim_no,
|
||||
'claim_number' => $tpa_claim_no,
|
||||
'updated_at' => date('Y-m-d H:i:s'),
|
||||
];
|
||||
if (isset($validStatuses[$currentStatus])) {
|
||||
$updateArray['claim_status_id'] = $validStatuses[$currentStatus];
|
||||
}
|
||||
if (!empty($tpa_claim_type)) {
|
||||
$updateArray['tpa_claim_type'] = $tpa_claim_type;
|
||||
}
|
||||
if (!empty($tpa_ailments)) {
|
||||
$updateArray['tpa_ailments'] = $tpa_ailments;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$this->db->table('ticket_master')->where('id',$claimId)->update($updateArray);
|
||||
|
||||
log_message('error', "HEALTH_INDIA - Claim Status SUCCESS | Updated ticket ID $claimId with claim status: $currentStatus");
|
||||
|
||||
return [
|
||||
'status' => true,
|
||||
'message' => 'Claim status updated.',
|
||||
@ -1081,9 +1064,6 @@ class HealthIndiaApiController extends BaseController
|
||||
'tpa_id' => trim($row['memberId'] ?? null),
|
||||
'age' => is_numeric($row['age'] ?? null) ? (int) $row['age'] : null,
|
||||
|
||||
'si' => $row['baseSumInsured'] ?? null,
|
||||
'doj' => !empty($row['dateofPolicyJoining'] ?? null) ? date('Y-m-d', strtotime(str_replace('/', '-', $row['dateofPolicyJoining']))) : null,
|
||||
|
||||
'is_active' => 1,
|
||||
'created_by' => $file_info[0]['created_by'] ?? null,
|
||||
];
|
||||
|
||||
@ -226,7 +226,7 @@ table.dataTable thead th {
|
||||
|
||||
<div class="form-group col-md-12 hide_filter_input">
|
||||
<label>Action<span class="text-danger"></span></label> <br />
|
||||
<select name="action_type" class="form-control" id="action_type">
|
||||
<select name="action_type" class="form-control" id="action_type_for_filter">
|
||||
<option value="">Select</option>
|
||||
<?php
|
||||
if (isset($import_or_export) && count($import_or_export)) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user