claim type mapped to all TPA claim push : GWM
This commit is contained in:
parent
44efa7467a
commit
0d636aff70
@ -753,7 +753,7 @@ class FhplApiController extends BaseController
|
|||||||
$response = call_third_party_api($url,'POST',$headers,$body);
|
$response = call_third_party_api($url,'POST',$headers,$body);
|
||||||
|
|
||||||
if(!empty($response['data'])){
|
if(!empty($response['data'])){
|
||||||
log_message('error', 'FHPL - Sync TPA Claims | Exception thrown while calling GetTPA_ClaimsDetails API: ' . json_encode($errorData));
|
log_message('error', 'FHPL - Sync TPA Claims | Exception thrown while calling GetTPA_ClaimsDetails API: ' . json_encode($response));
|
||||||
$finalResult = array_merge($finalResult,$response['data']);
|
$finalResult = array_merge($finalResult,$response['data']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
namespace App\Controllers;
|
namespace App\Controllers;
|
||||||
|
|
||||||
use App\Controllers\BaseController;
|
use App\Controllers\BaseController;
|
||||||
|
use App\Controllers\TicketController;
|
||||||
use App\Models\BatchFileModel;
|
use App\Models\BatchFileModel;
|
||||||
use App\Models\EmployeePolicyModel;
|
use App\Models\EmployeePolicyModel;
|
||||||
use App\Models\TpaApiDataModel;
|
use App\Models\TpaApiDataModel;
|
||||||
@ -18,11 +19,15 @@ class HealthIndiaApiController extends BaseController
|
|||||||
use ResponseTrait;
|
use ResponseTrait;
|
||||||
protected $db;
|
protected $db;
|
||||||
protected $healthIndiaTpaId;
|
protected $healthIndiaTpaId;
|
||||||
|
protected $claim_type_array;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->db = \Config\Database::connect();
|
$this->db = \Config\Database::connect();
|
||||||
$this->healthIndiaTpaId = getenv('HEALTH_INDIA_PRIMARY_KEY_CONSTANT');
|
$this->healthIndiaTpaId = getenv('HEALTH_INDIA_PRIMARY_KEY_CONSTANT');
|
||||||
|
|
||||||
|
$this->ticketController = new TicketController();
|
||||||
|
$this->claim_type_array = $this->ticketController->claimType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generateAuthToken()
|
public function generateAuthToken()
|
||||||
@ -147,25 +152,25 @@ class HealthIndiaApiController extends BaseController
|
|||||||
$token = $tokenResponse['data']['result'][0]['access_token'];
|
$token = $tokenResponse['data']['result'][0]['access_token'];
|
||||||
|
|
||||||
// Map claim type: Reimbursement or Cashless
|
// Map claim type: Reimbursement or Cashless
|
||||||
$claimTypeMap = [
|
|
||||||
'reimbursement' => 'Reimbursement',
|
|
||||||
'cashless' => 'Cashless',
|
|
||||||
];
|
|
||||||
$mappedClaimType = $claimTypeMap[strtolower($data['claimType'] ?? 'reimbursement')] ?? 'Reimbursement';
|
|
||||||
|
|
||||||
// Map benefit type: IPD or OPD
|
// Map claim_type to benefit type (IPD / OPD)
|
||||||
|
$claimTypeValue = $this->claim_type_array[1][$data['claim_type'] ?? null] ?? null;
|
||||||
|
|
||||||
$benefitTypeMap = [
|
$benefitTypeMap = [
|
||||||
'ipd' => 'IPD',
|
'Main Hospitalization' => 'IPD',
|
||||||
'opd' => 'OPD',
|
'Pre / Post' => 'IPD',
|
||||||
|
'ReOpen' => 'IPD',
|
||||||
|
'OPD' => 'OPD',
|
||||||
];
|
];
|
||||||
$mappedBenefitType = $benefitTypeMap[strtolower($data['benefitType'] ?? 'ipd')] ?? 'IPD';
|
|
||||||
|
$mappedBenefitType = $benefitTypeMap[$claimTypeValue] ?? 'IPD';
|
||||||
|
|
||||||
// Build Health India Claim Submission Request (API Section 5)
|
// Build Health India Claim Submission Request (API Section 5)
|
||||||
$body = [
|
$body = [
|
||||||
"policY_NUMBER" => $data['policyNumber'],
|
"policY_NUMBER" => $data['policyNumber'],
|
||||||
"employeE_CODE" => $data['employeeCode'],
|
"employeE_CODE" => $data['employeeCode'],
|
||||||
"membeR_ID" => $data['memberId'],
|
"membeR_ID" => $data['memberId'],
|
||||||
"claiM_TYPE" => $mappedClaimType,
|
"claiM_TYPE" => 'Reimbursement',
|
||||||
"benefiT_TYPE" => $mappedBenefitType,
|
"benefiT_TYPE" => $mappedBenefitType,
|
||||||
"claimeD_AMOUNT" => (string) $data['claimedAmount'],
|
"claimeD_AMOUNT" => (string) $data['claimedAmount'],
|
||||||
"datE_OF_ADMISSION" => date('Y-m-d', strtotime($data['admissionDate'])),
|
"datE_OF_ADMISSION" => date('Y-m-d', strtotime($data['admissionDate'])),
|
||||||
|
|||||||
@ -23,7 +23,8 @@ class VidalApiController extends BaseController
|
|||||||
$this->db = \Config\Database::connect();
|
$this->db = \Config\Database::connect();
|
||||||
$this->vidal_primary_key = getenv('VIDAL_PRIMARY_KEY_CONSTANT');
|
$this->vidal_primary_key = getenv('VIDAL_PRIMARY_KEY_CONSTANT');
|
||||||
|
|
||||||
$this->claim_type_array = new TicketController();
|
$this->ticketController = new TicketController();
|
||||||
|
$this->claim_type_array = $this->ticketController->claimType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -121,8 +122,6 @@ class VidalApiController extends BaseController
|
|||||||
|
|
||||||
public function SubmitClaim ($claimId = null) //515
|
public function SubmitClaim ($claimId = null) //515
|
||||||
{
|
{
|
||||||
|
|
||||||
// dd($claim_type_array = $this->ticketController->claimType);
|
|
||||||
helper('api');
|
helper('api');
|
||||||
|
|
||||||
// Fetch the data from DB
|
// Fetch the data from DB
|
||||||
@ -194,11 +193,25 @@ class VidalApiController extends BaseController
|
|||||||
'Ocp-Apim-Subscription-Key:' .getenv('VIDAL_API_SUBSCRIPTION_KEY').'',
|
'Ocp-Apim-Subscription-Key:' .getenv('VIDAL_API_SUBSCRIPTION_KEY').'',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$typeOfClaim = "Main hospitalization claim";
|
||||||
|
$allowedSubTypes = [
|
||||||
|
'Hospitalization',
|
||||||
|
'OPD',
|
||||||
|
'Health check-up',
|
||||||
|
'Dental benefit',
|
||||||
|
'Day care',
|
||||||
|
'Domiciliary'
|
||||||
|
];
|
||||||
|
$mappedSubType = $this->claim_type_array[1][$data['claim_type'] ?? null] ?? null;
|
||||||
|
$claimSubType = in_array($mappedSubType, $allowedSubTypes, true)
|
||||||
|
? $mappedSubType
|
||||||
|
: 'Hospitalization'; // safe default
|
||||||
|
|
||||||
$body = [
|
$body = [
|
||||||
'policyNo' => $data['policyNo'],
|
'policyNo' => $data['policyNo'],
|
||||||
'dependentUniqueId' => $data['dependentUniqueId'],
|
'dependentUniqueId' => $data['dependentUniqueId'],
|
||||||
'typeOfClaim' => "Main hospitalization claim",
|
'typeOfClaim' => $typeOfClaim,
|
||||||
'claimSubType' => null, // "OPD",
|
'claimSubType' => $claimSubType,
|
||||||
'requestedAmount' => $data['requestedAmount'],
|
'requestedAmount' => $data['requestedAmount'],
|
||||||
'ailmentType' => "Non covid",
|
'ailmentType' => "Non covid",
|
||||||
'admissionDate' => change_date_format($data['admissionDate'], 'Y-m-d', 'd-m-Y'),
|
'admissionDate' => change_date_format($data['admissionDate'], 'Y-m-d', 'd-m-Y'),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user