Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
6f291dc70a
@ -797,7 +797,7 @@ $routes->get('EcardRequest','HealthIndiaApiController::EcardRequest');
|
||||
$routes->get('HospitalNetwork','MediAssistApiController::HospitalNetwork');
|
||||
$routes->get('VidalGetBenefDetails','VidalApiController::VidalGetBenefDetails');
|
||||
$routes->get('ClaimDetail','VidalApiController::ClaimDetail');
|
||||
$routes->get('SubmitClaim','HealthIndiaApiController::SubmitClaim');
|
||||
$routes->get('SubmitClaim','VidalApiController::SubmitClaim');
|
||||
$routes->get('IntimateClaim','MediAssistApiController::IntimateClaim');
|
||||
$routes->get('IRSubmission','MediAssistApiController::IRSubmission');
|
||||
$routes->get('ClaimStatusUpdate','MediAssistApiController::ClaimStatusUpdate');
|
||||
|
||||
@ -753,7 +753,7 @@ class FhplApiController extends BaseController
|
||||
$response = call_third_party_api($url,'POST',$headers,$body);
|
||||
|
||||
if(!empty($response['data'])){
|
||||
log_message('error', 'FHPL - Sync TPA Claims | Exception thrown while calling GetTPA_ClaimsDetails API: ' . json_encode($response ?? []));
|
||||
log_message('error', 'FHPL - Sync TPA Claims | Exception thrown while calling GetTPA_ClaimsDetails API: ' . json_encode($response));
|
||||
$finalResult = array_merge($finalResult,$response['data']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Controllers\TicketController;
|
||||
use App\Models\BatchFileModel;
|
||||
use App\Models\EmployeePolicyModel;
|
||||
use App\Models\TpaApiDataModel;
|
||||
@ -18,11 +19,15 @@ class HealthIndiaApiController extends BaseController
|
||||
use ResponseTrait;
|
||||
protected $db;
|
||||
protected $healthIndiaTpaId;
|
||||
protected $claim_type_array;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->db = \Config\Database::connect();
|
||||
$this->healthIndiaTpaId = getenv('HEALTH_INDIA_PRIMARY_KEY_CONSTANT');
|
||||
|
||||
$this->ticketController = new TicketController();
|
||||
$this->claim_type_array = $this->ticketController->claimType;
|
||||
}
|
||||
|
||||
public function generateAuthToken()
|
||||
@ -147,25 +152,25 @@ class HealthIndiaApiController extends BaseController
|
||||
$token = $tokenResponse['data']['result'][0]['access_token'];
|
||||
|
||||
// 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 = [
|
||||
'ipd' => 'IPD',
|
||||
'opd' => 'OPD',
|
||||
'Main Hospitalization' => 'IPD',
|
||||
'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)
|
||||
$body = [
|
||||
"policY_NUMBER" => $data['policyNumber'],
|
||||
"employeE_CODE" => $data['employeeCode'],
|
||||
"membeR_ID" => $data['memberId'],
|
||||
"claiM_TYPE" => $mappedClaimType,
|
||||
"claiM_TYPE" => 'Reimbursement',
|
||||
"benefiT_TYPE" => $mappedBenefitType,
|
||||
"claimeD_AMOUNT" => (string) $data['claimedAmount'],
|
||||
"datE_OF_ADMISSION" => date('Y-m-d', strtotime($data['admissionDate'])),
|
||||
|
||||
@ -7,6 +7,7 @@ use App\Models\EmployeePolicyModel;
|
||||
use App\Models\TpaApiDataModel;
|
||||
|
||||
use App\Controllers\BaseController;
|
||||
use App\Controllers\TicketController;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use CodeIgniter\API\ResponseTrait;
|
||||
|
||||
@ -15,13 +16,19 @@ class VidalApiController extends BaseController
|
||||
use ResponseTrait;
|
||||
protected $db;
|
||||
protected $vidal_primary_key;
|
||||
protected $claim_type_array;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->db = \Config\Database::connect();
|
||||
$this->vidal_primary_key = getenv('VIDAL_PRIMARY_KEY_CONSTANT');
|
||||
|
||||
$this->ticketController = new TicketController();
|
||||
$this->claim_type_array = $this->ticketController->claimType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function uploadFileToVidal($filePath,$filename)
|
||||
{
|
||||
@ -132,6 +139,7 @@ class VidalApiController extends BaseController
|
||||
tm.hospital_pin_code as hospitalPinCode,
|
||||
tm.hospital_phone_no as hospitalPhoneNo,
|
||||
tm.claim_amount as requestedAmount,
|
||||
tm.claim_type,
|
||||
tm.tpa_no as dependentUniqueId,
|
||||
cp.policy_no as policyNo,
|
||||
e.emp_code as memberId,
|
||||
@ -185,11 +193,25 @@ class VidalApiController extends BaseController
|
||||
'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 = [
|
||||
'policyNo' => $data['policyNo'],
|
||||
'dependentUniqueId' => $data['dependentUniqueId'],
|
||||
'typeOfClaim' => "Main hospitalization claim",
|
||||
'claimSubType' => "OPD",
|
||||
'typeOfClaim' => $typeOfClaim,
|
||||
'claimSubType' => $claimSubType,
|
||||
'requestedAmount' => $data['requestedAmount'],
|
||||
'ailmentType' => "Non covid",
|
||||
'admissionDate' => change_date_format($data['admissionDate'], 'Y-m-d', 'd-m-Y'),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user