update bugs fix hospital
This commit is contained in:
@@ -36,7 +36,7 @@ class ClaimRequestService{
|
||||
'code' => $row['provider_code']
|
||||
]), 403, null, $row);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
@@ -51,8 +51,42 @@ class ClaimRequestService{
|
||||
$submissionByClaimManagement = null;
|
||||
$statusClaim = null;
|
||||
}
|
||||
if (count($row)>0){
|
||||
if($row['total_billing']) {
|
||||
$data = [
|
||||
'code' => $code,
|
||||
'request_log_id' => $requestLogID ?? 0,
|
||||
'member_id' => $member->id,
|
||||
'submission_date' => $submissionDate ?? now(),
|
||||
'status' => $status,
|
||||
'claim_management' => $claimManagement,
|
||||
'status_claim_management' => $statusClaim,
|
||||
'submission_date_claim_management' => $submissionDateClaimManagement,
|
||||
'submission_by_claim_management' => $submissionByClaimManagement,
|
||||
'payment_type' => $paymentType,
|
||||
'service_code' => $serviceCode,
|
||||
'policy_id' => $member->currentPolicy->id ?? null,
|
||||
'organization_id' => $organization ? $organization->id : 0,
|
||||
];
|
||||
} else {
|
||||
$data = [];
|
||||
}
|
||||
$claimRequest = ClaimRequest::updateOrCreate(['request_log_id' => $requestLogID],$data);
|
||||
|
||||
if($row['total_billing']) {
|
||||
$benefitData = Benefit::where('code', $row['benefit_code'])->first();
|
||||
$requestLogData = RequestLogBenefit::updateOrCreate(
|
||||
[
|
||||
'request_log_id' => $requestLogID,
|
||||
'benefit_id' => $benefitData->id,
|
||||
],[
|
||||
'request_log_id' => $requestLogID,
|
||||
'benefit_id' => $benefitData->id,
|
||||
'amount_incurred' => $row['amount_incurred'],
|
||||
'amount_approved' => $row['amount_apporve'],
|
||||
'amount_not_approved' => $row['amount_not_apporve'],
|
||||
'excess_paid' => $row['excess_paid'],
|
||||
]);
|
||||
} else { // input from hospital portal
|
||||
$data = [
|
||||
'code' => $code,
|
||||
'request_log_id' => $requestLogID ?? 0,
|
||||
@@ -68,25 +102,7 @@ class ClaimRequestService{
|
||||
'policy_id' => $member->currentPolicy->id ?? null,
|
||||
'organization_id' => $organization ? $organization->id : 0,
|
||||
];
|
||||
} else {
|
||||
$data = [];
|
||||
}
|
||||
$claimRequest = ClaimRequest::updateOrCreate(['request_log_id' => $requestLogID],$data);
|
||||
|
||||
if (count($row)>0){
|
||||
$benefitData = Benefit::where('code', $row['benefit_code'])->first();
|
||||
$requestLogData = RequestLogBenefit::updateOrCreate(
|
||||
[
|
||||
'request_log_id' => $requestLogID,
|
||||
'benefit_id' => $benefitData->id,
|
||||
],[
|
||||
'request_log_id' => $requestLogID,
|
||||
'benefit_id' => $benefitData->id,
|
||||
'amount_incurred' => $row['amount_incurred'],
|
||||
'amount_approved' => $row['amount_apporve'],
|
||||
'amount_not_approved' => $row['amount_not_apporve'],
|
||||
'excess_paid' => $row['excess_paid'],
|
||||
]);
|
||||
$claimRequest = ClaimRequest::updateOrCreate(['request_log_id' => $requestLogID],$data);
|
||||
}
|
||||
DB::commit();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user