update request log service
This commit is contained in:
@@ -140,47 +140,25 @@ class RequestLogService{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleClaimRequestRow($row)
|
public function handleRequestLogRow($row)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$member = Member::where('member_id', $row['member_id'])->with(['currentPlan'])->first();
|
$requestLog = RequestLog::where('id', $row['id'])->first();
|
||||||
if(!$member){
|
if(!$requestLog){
|
||||||
throw new ImportRowException(__('Member Tidak ditemukan'), 0, null, $row);
|
throw new ImportRowException(__('Request LOG Tidak ditemukan'), 0, null, $row);
|
||||||
};
|
};
|
||||||
$code = $row['client_claim_id'];
|
$status = RequestLog::$status;
|
||||||
$organization_id = $row['provider_code'];
|
|
||||||
$submissionDate = Helper::formatDateDB($row['admission_date']);
|
|
||||||
$paymentType = $row['claim_type'];
|
|
||||||
$status = $row['status'];
|
|
||||||
$serviceCode = $row['coverage_type'];
|
|
||||||
|
|
||||||
$newClaimRequest = $this->storeClaimRequest(
|
if (!array_key_exists($row['status'], $status)){
|
||||||
row: $row,
|
throw new ImportRowException(__('Status Request LOG Tidak ditemukan'), 0, null, $row);
|
||||||
code: $code,
|
}
|
||||||
member: $member,
|
|
||||||
paymentType: $paymentType,
|
|
||||||
serviceCode: $serviceCode,
|
|
||||||
submissionDate: $submissionDate,
|
|
||||||
status: $status,
|
|
||||||
organization_code: $organization_id
|
|
||||||
);
|
|
||||||
|
|
||||||
$newlyCreatedID = $newClaimRequest->id;
|
// Update Request LOG Status & Link with Claim
|
||||||
|
$requestLog->update([
|
||||||
$newClaimManangement = $this->storeClaimManagement($row, $member, $newlyCreatedID);
|
'status' => $row['status']
|
||||||
ClaimRequested::dispatch($newClaimRequest);
|
|
||||||
// Log History
|
|
||||||
$newClaimRequest->histories()->create([
|
|
||||||
'title' => 'New Claim Requested',
|
|
||||||
'description' => "Claim Requested for Member : {$member->member_id} - ({$member->full_name})",
|
|
||||||
'type' => 'info',
|
|
||||||
'system_origin' => 'import-internal-aso'
|
|
||||||
]);
|
]);
|
||||||
|
$requestLog->save();
|
||||||
$claim_request_data = $row;
|
return $requestLog;
|
||||||
$this->validatePlanRow($claim_request_data);
|
|
||||||
|
|
||||||
return $newClaimRequest;
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user