Merge remote-tracking branch 'origin/staging' into origin/production
This commit is contained in:
@@ -215,6 +215,7 @@ class CorporateMemberController extends Controller
|
||||
'requestLogMedicalPlans:request_log_daily_monitoring_id,plan,type'
|
||||
],
|
||||
'service:code,name',
|
||||
'files',
|
||||
])
|
||||
->find($request_log_id, ['id', 'submission_date', 'discharge_date', 'member_id', 'service_code', 'organization_id']);
|
||||
|
||||
|
||||
@@ -15,6 +15,33 @@ class DataServiceMonitoring extends JsonResource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
$files = [];
|
||||
$filesFinalLogResult = [];
|
||||
$filesFinalLogDiagnosis = [];
|
||||
$filesFinalLogKondisi = [];
|
||||
if (count($this->files)>0){
|
||||
foreach ($this->files as $key => $value) {
|
||||
if($value->type == 'final-log-result'){
|
||||
array_push($filesFinalLogResult, $value);
|
||||
};
|
||||
|
||||
if($value->type == 'final-log-diagnosis'){
|
||||
array_push($filesFinalLogDiagnosis, $value);
|
||||
}
|
||||
|
||||
if($value->type == 'final-log-kondisi'){
|
||||
array_push($filesFinalLogKondisi, $value);
|
||||
}
|
||||
}
|
||||
|
||||
$files = [
|
||||
'result' => $filesFinalLogResult,
|
||||
'diagnosis' => $filesFinalLogDiagnosis,
|
||||
'kondisi' => $filesFinalLogKondisi,
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
return [
|
||||
'companyName' => $this->member->currentCorporate->name ?? null,
|
||||
'serviceCode' => $this->service_code ?? null,
|
||||
@@ -24,6 +51,7 @@ class DataServiceMonitoring extends JsonResource
|
||||
'phoneNumber' => $this->person->phone ?? null,
|
||||
'email' => $this->member->email ?? ($this->member->person->email ?? null),
|
||||
'serviceName' => $this->service->name ?? ($this->service_code ?? null),
|
||||
'files' => $files,
|
||||
'benefits' => collect($this->requestLogBenefits)->map(function ($requestLogBenefit) {
|
||||
return [
|
||||
'amountIncurred' => $requestLogBenefit->amount_incurred,
|
||||
|
||||
@@ -324,10 +324,16 @@ class RequestLogController extends Controller
|
||||
];
|
||||
$validator = Validator::make($request->all(), [
|
||||
'request_logs_id' => 'required',
|
||||
'discharge_date' => 'required'
|
||||
'discharge_date' => 'required',
|
||||
'result_files.*' => 'max:10000',
|
||||
'diagnosa_files.*' => 'max:10000',
|
||||
'kondisi_files.*' => 'max:10000',
|
||||
], [
|
||||
'request_logs_id.required' => trans('Validation.required',['attribute' => 'Request Logs ID']),
|
||||
'discharge_date.required' => trans('Validation.required',['attribute' => 'Discharge Date'])
|
||||
'discharge_date.required' => trans('Validation.required',['attribute' => 'Discharge Date']),
|
||||
'result_files.*.max' => trans('Validation.max.file', ['attribute' => 'Result Files', 'max' => '10 MB' ]),
|
||||
'diagnosa_files.*.max' => trans('Validation.max.file', ['attribute' => 'Diagnosis Files', 'max' => '10 MB' ]),
|
||||
'kondisi_files.*.max' => trans('Validation.max.file', ['attribute' => 'Condition Files', 'max' => '10 MB' ]),
|
||||
]);
|
||||
if ($validator->fails())
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@ class RequestLogResource extends JsonResource
|
||||
'id' => $this->id,
|
||||
'code' => $this->code,
|
||||
'submission_date' => $this->submission_date,
|
||||
'submission_date_fgl' => $this->approved_final_log_at,
|
||||
'member_name' => $this->member->name,
|
||||
'status' => $this->status ?? 'unknown',
|
||||
'provider' => $provider ? $provider->name : '-',
|
||||
|
||||
@@ -107,6 +107,7 @@ class RequestLogShowResource extends JsonResource
|
||||
'principal_name' => $requestLog['member']['principal_id'] ? Helper::principalName($requestLog['member']['principal_id']) : '-',
|
||||
'relation_with_principal' => Helper::relationWithPrincipal($requestLog['member']['relation_with_principal']),
|
||||
'submission_date' => $requestLog['submission_date'],
|
||||
'approved_final_log_at' => $requestLog['approved_final_log_at'], // submission final log
|
||||
'discharge_date' => $requestLog['discharge_date'],
|
||||
'service_type' => Helper::serviceName($requestLog['service_code']),
|
||||
'claim_method' => $requestLog['payment_type'],
|
||||
|
||||
@@ -200,7 +200,7 @@ class Member extends Model
|
||||
|
||||
public function requestLogs()
|
||||
{
|
||||
return $this->hasMany(RequestLog::class);
|
||||
return $this->hasMany(RequestLog::class, 'member_id', 'id');
|
||||
}
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
@@ -129,6 +129,23 @@ type ServiceMonitoringProps = {
|
||||
mainDiagnose: string;
|
||||
comparativeDiagnosis: string;
|
||||
serviceName: string;
|
||||
files: {
|
||||
result: {
|
||||
type: string;
|
||||
original_name: string;
|
||||
url: string;
|
||||
}[];
|
||||
diagnosis: {
|
||||
type: string;
|
||||
original_name: string;
|
||||
url: string;
|
||||
}[];
|
||||
kondisi: {
|
||||
type: string;
|
||||
original_name: string;
|
||||
url: string;
|
||||
}[];
|
||||
};
|
||||
benefits: {
|
||||
amountIncurred: number;
|
||||
amountApproved: number;
|
||||
@@ -439,6 +456,122 @@ export default function ServiceMonitoring() {
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item container xs={12} spacing={1.5}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="subtitle2" color={'grey.600'}>
|
||||
{loading ? (
|
||||
<Skeleton animation={'wave'} width={200} />
|
||||
) : (
|
||||
'Files Result'
|
||||
)}
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
{loading ? (
|
||||
<Skeleton animation="wave" width={300} />
|
||||
) : data && data.files && data.files.result.length > 0 ?
|
||||
(
|
||||
data.files.result.map((file, index) =>
|
||||
(
|
||||
(
|
||||
<Stack direction="column" spacing={2} key={index}>
|
||||
<Stack direction="row" spacing={1} sx={{color: '#19BBBB'}}>
|
||||
<a
|
||||
href={file.url}
|
||||
download={file.original_name ? file.original_name : 'test'}
|
||||
style={{ cursor: 'pointer', textDecoration: 'none', color: '#19BBBB' }}
|
||||
target="_blank"
|
||||
>
|
||||
<Typography variant="body2" gutterBottom>{file.original_name ? file.original_name : '-'}</Typography>
|
||||
</a>
|
||||
</Stack>
|
||||
</Stack>
|
||||
)
|
||||
)
|
||||
)
|
||||
) : (
|
||||
<Typography variant="subtitle1" color={'grey.800'}>
|
||||
-
|
||||
</Typography>
|
||||
)}
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="subtitle2" color={'grey.600'}>
|
||||
{loading ? (
|
||||
<Skeleton animation={'wave'} width={200} />
|
||||
) : (
|
||||
'Files Diagnosis'
|
||||
)}
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
{loading ? (
|
||||
<Skeleton animation="wave" width={300} />
|
||||
) : data && data.files && data.files.diagnosis.length > 0 ?
|
||||
(
|
||||
data.files.diagnosis.map((file, index) =>
|
||||
(
|
||||
(
|
||||
<Stack direction="column" spacing={2} key={index}>
|
||||
<Stack direction="row" spacing={1} sx={{color: '#19BBBB'}}>
|
||||
<a
|
||||
href={file.url}
|
||||
download={file.original_name ? file.original_name : 'test'}
|
||||
style={{ cursor: 'pointer', textDecoration: 'none', color: '#19BBBB' }}
|
||||
target="_blank"
|
||||
>
|
||||
<Typography variant="body2" gutterBottom>{file.original_name ? file.original_name : '-'}</Typography>
|
||||
</a>
|
||||
</Stack>
|
||||
</Stack>
|
||||
)
|
||||
)
|
||||
)
|
||||
) : (
|
||||
<Typography variant="subtitle1" color={'grey.800'}>
|
||||
-
|
||||
</Typography>
|
||||
)}
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="subtitle2" color={'grey.600'}>
|
||||
{loading ? (
|
||||
<Skeleton animation={'wave'} width={200} />
|
||||
) : (
|
||||
'Files Kondisi'
|
||||
)}
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
{loading ? (
|
||||
<Skeleton animation="wave" width={300} />
|
||||
) : data && data.files && data.files.kondisi.length > 0 ?
|
||||
(
|
||||
data.files.kondisi.map((file, index) =>
|
||||
(
|
||||
(
|
||||
<Stack direction="column" spacing={2} key={index}>
|
||||
<Stack direction="row" spacing={1} sx={{color: '#19BBBB'}}>
|
||||
<a
|
||||
href={file.url}
|
||||
style={{ cursor: 'pointer', textDecoration: 'none', color: '#19BBBB' }}
|
||||
target="_blank"
|
||||
>
|
||||
<Typography variant="body2" gutterBottom>{file.original_name ? file.original_name : '-'}</Typography>
|
||||
</a>
|
||||
</Stack>
|
||||
</Stack>
|
||||
)
|
||||
)
|
||||
)
|
||||
) : (
|
||||
<Typography variant="subtitle1" color={'grey.800'}>
|
||||
-
|
||||
</Typography>
|
||||
)}
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Card>
|
||||
|
||||
@@ -192,7 +192,7 @@ export default function Detail() {
|
||||
</Stack>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Submission Date</Typography>
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.submission_date ? fDateTimesecond(requestLog?.submission_date) : '-'}</Typography>
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.approved_final_log_at ? fDateTimesecond(requestLog?.approved_final_log_at) : '-'}</Typography>
|
||||
</Stack>
|
||||
|
||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||
|
||||
@@ -350,7 +350,7 @@ export default function List() {
|
||||
<TableCell align="left">{row.code}</TableCell>
|
||||
<TableCell align="left">{row.provider}</TableCell>
|
||||
<TableCell align="left">{row.member_name}</TableCell>
|
||||
<TableCell align="left"><Label>{fDateTimesecond(row.submission_date)}</Label></TableCell>
|
||||
<TableCell align="left"><Label>{fDateTimesecond(row.submission_date_fgl)}</Label></TableCell>
|
||||
<TableCell align="left">{row.service_name}</TableCell>
|
||||
<TableCell align="left">{row.payment_type_name}</TableCell>
|
||||
<TableCell align="left">
|
||||
|
||||
@@ -15,7 +15,7 @@ export type FinalLogType = {
|
||||
code : string,
|
||||
member : Member,
|
||||
member_name : string,
|
||||
submission_date : string,
|
||||
submission_date_fgl : string,
|
||||
service_name : string,
|
||||
payment_type_name : string,
|
||||
status_final_log : string,
|
||||
@@ -36,6 +36,7 @@ export type DetailFinalLogType = {
|
||||
gender : string,
|
||||
marital_status : string,
|
||||
submission_date : string,
|
||||
approved_final_log_at : string,
|
||||
service_type : string,
|
||||
claim_method : string,
|
||||
status : string,
|
||||
|
||||
@@ -333,7 +333,7 @@ export default function TableListFinalLog() {
|
||||
|
||||
const response = await axios.get(`/get-final-log`, {
|
||||
params: { ...parameters, search:searchText, order: order,
|
||||
orderBy: orderBy, type: 'final-log' },
|
||||
orderBy: orderBy, status:statusValue, type: 'final-log' },
|
||||
});
|
||||
setData(
|
||||
response.data.data.map((obj: any) => ({
|
||||
|
||||
@@ -326,7 +326,7 @@ export default function TableList() {
|
||||
|
||||
const response = await axios.get(`/get-request-log`, {
|
||||
params: { ...parameters, search:searchText, order: order,
|
||||
orderBy: orderBy, type: 'request-log' },
|
||||
orderBy: orderBy, status:statusValue, type: 'request-log' },
|
||||
});
|
||||
setData(
|
||||
response.data.data.map((obj: any) => ({
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
return [
|
||||
'success' => 'Request has been successfully processed.',
|
||||
'server_error' => 'Internal server error.',
|
||||
'not_found' => 'Data not found',
|
||||
'not_found' => 'Data not found.',
|
||||
'password' => 'Password wrong. Please try again.',
|
||||
'read_notification' => 'Notification has been read.',
|
||||
'already_exists' => 'Data already exists.',
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
return [
|
||||
'required' => 'The :attribute field is required.',
|
||||
'invalid' => 'The :attribute field is invalid.',
|
||||
'max' => ':attribute cannot exceed :length characters.',
|
||||
'max' => [
|
||||
'file' => ':attribute max size is :max.',
|
||||
],
|
||||
'email' => 'Invalid email format.'
|
||||
];
|
||||
@@ -3,6 +3,8 @@
|
||||
return [
|
||||
'required' => 'Kolom :attribute harus diisi.',
|
||||
'invalid' => 'Kolom :attribute tidak valid.',
|
||||
'max' => ':attribute tidak boleh melebihi :length karakter.',
|
||||
'max' => [
|
||||
'file' => ':attribute tidak boleh melebihi :max.',
|
||||
],
|
||||
'email' => 'Format email salah.'
|
||||
];
|
||||
Reference in New Issue
Block a user