Add Spesialis & DPPJ
This commit is contained in:
@@ -120,6 +120,18 @@ class MemberController extends Controller
|
|||||||
$res_data['companies'] = $companies;
|
$res_data['companies'] = $companies;
|
||||||
|
|
||||||
|
|
||||||
|
// specialities
|
||||||
|
$specialities = DB::table('specialities')
|
||||||
|
->select(
|
||||||
|
'specialities.id',
|
||||||
|
'specialities.name'
|
||||||
|
)
|
||||||
|
->orderBy('specialities.name','asc')
|
||||||
|
->get();
|
||||||
|
|
||||||
|
$res_data['specialities'] = $specialities;
|
||||||
|
|
||||||
|
|
||||||
return ApiResponse::apiResponse("Success", $res_data, trans('Message.success'), 200);
|
return ApiResponse::apiResponse("Success", $res_data, trans('Message.success'), 200);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ class RequestLogController extends Controller
|
|||||||
'address_provider' => !empty($request->address_provider) ? $request->address_provider : null,
|
'address_provider' => !empty($request->address_provider) ? $request->address_provider : null,
|
||||||
'submission_date' => $request->submission_date,
|
'submission_date' => $request->submission_date,
|
||||||
'corporate_id_partner' => !empty($request->corporate_id_partner) ? $request->corporate_id_partner : [],
|
'corporate_id_partner' => !empty($request->corporate_id_partner) ? $request->corporate_id_partner : [],
|
||||||
|
'specialities_id' => $request->specialities_id,
|
||||||
|
'dppj' => $request->dppj
|
||||||
];
|
];
|
||||||
$validator = Validator::make($request->all(), [
|
$validator = Validator::make($request->all(), [
|
||||||
'member_id' => 'required',
|
'member_id' => 'required',
|
||||||
|
|||||||
@@ -149,7 +149,9 @@ class RequestLogController extends Controller
|
|||||||
// status: 'approved',
|
// status: 'approved',
|
||||||
status: 'requested', // di nonaktifkan dulu auto approved
|
status: 'requested', // di nonaktifkan dulu auto approved
|
||||||
organization_id: $request->organization_id,
|
organization_id: $request->organization_id,
|
||||||
source: $request->source
|
source: $request->source,
|
||||||
|
specialities_id: $request->specialities_id,
|
||||||
|
dppj: $request->dppj
|
||||||
);
|
);
|
||||||
|
|
||||||
DB::commit();
|
DB::commit();
|
||||||
@@ -171,7 +173,9 @@ class RequestLogController extends Controller
|
|||||||
submissionDate: $request->submission_date,
|
submissionDate: $request->submission_date,
|
||||||
status: 'requested',
|
status: 'requested',
|
||||||
organization_id: $request->organization_id,
|
organization_id: $request->organization_id,
|
||||||
source: $request->source
|
source: $request->source,
|
||||||
|
specialities_id: $request->specialities_id,
|
||||||
|
dppj: $request->dppj
|
||||||
);
|
);
|
||||||
|
|
||||||
DB::commit();
|
DB::commit();
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ use App\Models\Benefit;
|
|||||||
use App\Models\Exclusion;
|
use App\Models\Exclusion;
|
||||||
use App\Models\ClaimRequest;
|
use App\Models\ClaimRequest;
|
||||||
use App\Models\Icd;
|
use App\Models\Icd;
|
||||||
|
use App\Models\Speciality;
|
||||||
use App\Helpers\Helper;
|
use App\Helpers\Helper;
|
||||||
use App\Models\CorporatePolicy;
|
use App\Models\CorporatePolicy;
|
||||||
use Illuminate\Http\Resources\Json\JsonResource;
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
@@ -117,12 +118,20 @@ class RequestLogShowResource extends JsonResource
|
|||||||
}
|
}
|
||||||
$memberUsage = Helper::getUsageMember($corporateId, $requestLog['member']['id'], $benefitData);
|
$memberUsage = Helper::getUsageMember($corporateId, $requestLog['member']['id'], $benefitData);
|
||||||
|
|
||||||
// dd($memberLimitUsage);
|
if($requestLog['specialities_id'])
|
||||||
|
{
|
||||||
|
$spesialis = Speciality::query()
|
||||||
|
->where('id', $requestLog['specialities_id'])
|
||||||
|
->select('name')
|
||||||
|
->first();
|
||||||
|
}
|
||||||
$data = [
|
$data = [
|
||||||
'id' => $requestLog['id'],
|
'id' => $requestLog['id'],
|
||||||
'code' => $requestLog['code'],
|
'code' => $requestLog['code'],
|
||||||
'invoice_no' => $requestLog['invoice_no'],
|
'invoice_no' => $requestLog['invoice_no'],
|
||||||
'billing_no' => $requestLog['billing_no'],
|
'billing_no' => $requestLog['billing_no'],
|
||||||
|
'specialities_id' => $spesialis['name'],
|
||||||
|
'dppj' => $requestLog['dppj'],
|
||||||
'code' => $requestLog['code'],
|
'code' => $requestLog['code'],
|
||||||
'code_claim' => $claimCode,
|
'code_claim' => $claimCode,
|
||||||
'member_id' => $requestLog['member']['member_id'],
|
'member_id' => $requestLog['member']['member_id'],
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ class RequestLog extends Model
|
|||||||
'approved_final_log_at',
|
'approved_final_log_at',
|
||||||
'created_final_at',
|
'created_final_at',
|
||||||
'created_final_by',
|
'created_final_by',
|
||||||
|
'specialities_id',
|
||||||
|
'dppj',
|
||||||
'type_of_member'
|
'type_of_member'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,9 @@ class RequestLogService{
|
|||||||
$serviceCode,
|
$serviceCode,
|
||||||
$submissionDate,
|
$submissionDate,
|
||||||
$status, $organization_id = null,
|
$status, $organization_id = null,
|
||||||
$source
|
$source,
|
||||||
|
$specialities_id,
|
||||||
|
$dppj
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@@ -55,6 +57,8 @@ class RequestLogService{
|
|||||||
'policy_id' => $member->currentPolicy->id ?? null,
|
'policy_id' => $member->currentPolicy->id ?? null,
|
||||||
'organization_id' => $organization ? $organization->id : 0,
|
'organization_id' => $organization ? $organization->id : 0,
|
||||||
'source' => $source,
|
'source' => $source,
|
||||||
|
'specialities_id' => $specialities_id,
|
||||||
|
'dppj' => $dppj
|
||||||
];
|
];
|
||||||
|
|
||||||
$requestLog = RequestLog::create($requestLogData);
|
$requestLog = RequestLog::create($requestLogData);
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
if(!Schema::hasColumn('request_logs', 'specialities_id')) {
|
||||||
|
Schema::table('request_logs', function (Blueprint $table) {
|
||||||
|
$table->bigInteger('specialities_id')->after('created_final_by')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
if(!Schema::hasColumn('request_logs', 'specialities_id')) {
|
||||||
|
Schema::table('request_logs', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('specialities_id');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
if(!Schema::hasColumn('request_logs', 'dppj')) {
|
||||||
|
Schema::table('request_logs', function (Blueprint $table) {
|
||||||
|
$table->string('dppj', '255')->after('specialities_id')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
if(!Schema::hasColumn('request_logs', 'dppj')) {
|
||||||
|
Schema::table('request_logs', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('dppj');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -250,6 +250,14 @@ export default function Detail() {
|
|||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Penempatan Kamar</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Penempatan Kamar</Typography>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.penempatan_kamar ? requestLog?.penempatan_kamar : '-'}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.penempatan_kamar ? requestLog?.penempatan_kamar : '-'}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Spesialis</Typography>
|
||||||
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.specialities_id ? requestLog?.specialities_id : '-'}</Typography>
|
||||||
|
</Stack>
|
||||||
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
|
<Typography variant='subtitle2' sx={style1} gutterBottom>DPPJ</Typography>
|
||||||
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.dppj ? requestLog?.dppj : '-'}</Typography>
|
||||||
|
</Stack>
|
||||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Catatan</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Catatan</Typography>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.catatan ? requestLog?.catatan : '-'}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.catatan ? requestLog?.catatan : '-'}</Typography>
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ export type FinalLogType = {
|
|||||||
provider : string,
|
provider : string,
|
||||||
status : string,
|
status : string,
|
||||||
files_by_type : files_by_type,
|
files_by_type : files_by_type,
|
||||||
|
specialities_id : number,
|
||||||
|
dppj: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -157,6 +157,14 @@ export default function Detail() {
|
|||||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Penempatan Kamar</Typography>
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Penempatan Kamar</Typography>
|
||||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.penempatan_kamar ? requestLog?.penempatan_kamar : '-'}</Typography>
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.penempatan_kamar ? requestLog?.penempatan_kamar : '-'}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
|
<Typography variant='subtitle2' sx={style1} gutterBottom>Spesialis</Typography>
|
||||||
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.specialities_id ? requestLog?.specialities_id : '-'}</Typography>
|
||||||
|
</Stack>
|
||||||
|
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||||
|
<Typography variant='subtitle2' sx={style1} gutterBottom>DPPJ</Typography>
|
||||||
|
<Typography variant='subtitle2' sx={style2} gutterBottom>{requestLog?.dppj ? requestLog?.dppj : '-'}</Typography>
|
||||||
|
</Stack>
|
||||||
</Card>
|
</Card>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} md={12} marginTop={2}>
|
<Grid item xs={12} md={12} marginTop={2}>
|
||||||
|
|||||||
@@ -57,7 +57,9 @@ export type DetailRequestLogType = {
|
|||||||
benefit : Benefit[],
|
benefit : Benefit[],
|
||||||
reason : string,
|
reason : string,
|
||||||
type_of_member : string,
|
type_of_member : string,
|
||||||
corporate_id : number
|
corporate_id : number,
|
||||||
|
specialities_id : number,
|
||||||
|
dppj: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Benefit = {
|
export type Benefit = {
|
||||||
|
|||||||
@@ -138,7 +138,9 @@
|
|||||||
"txtButtonClose": "Close",
|
"txtButtonClose": "Close",
|
||||||
"txtLabelFailed": "Failed",
|
"txtLabelFailed": "Failed",
|
||||||
"txtAttention": "Attention",
|
"txtAttention": "Attention",
|
||||||
"txtAttentionInfo": "There are pending orders that require approval."
|
"txtAttentionInfo": "There are pending orders that require approval.",
|
||||||
|
"txtDPPJ": "DPPJ",
|
||||||
|
"txtSpecialist": "Specialist"
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,5 +138,7 @@
|
|||||||
"txtButtonClose": "Tutup",
|
"txtButtonClose": "Tutup",
|
||||||
"txtLabelFailed": "Gagal Pengiriman",
|
"txtLabelFailed": "Gagal Pengiriman",
|
||||||
"txtAttention": "Perhatian",
|
"txtAttention": "Perhatian",
|
||||||
"txtAttentionInfo": "Terdapat pesanan pending mohon untuk segera di approve."
|
"txtAttentionInfo": "Terdapat pesanan pending mohon untuk segera di approve.",
|
||||||
|
"txtDPPJ": "DPPJ",
|
||||||
|
"txtSpecialist": "Spesialis"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { Card } from '@mui/material';
|
|||||||
import { Stack, Typography } from '@mui/material';
|
import { Stack, Typography } from '@mui/material';
|
||||||
import axios from '@/utils/axios';
|
import axios from '@/utils/axios';
|
||||||
import { enqueueSnackbar } from 'notistack';
|
import { enqueueSnackbar } from 'notistack';
|
||||||
import { useRef, useState, useContext, useEffect } from 'react';
|
import React, { useRef, useState, useContext, useEffect } from 'react';
|
||||||
import { makeFormData } from '@/utils/jsonToFormData';
|
import { makeFormData } from '@/utils/jsonToFormData';
|
||||||
import { format } from 'date-fns';
|
import { format } from 'date-fns';
|
||||||
import { LanguageContext } from '@/contexts/LanguageContext';
|
import { LanguageContext } from '@/contexts/LanguageContext';
|
||||||
@@ -28,6 +28,7 @@ interface MemberType {
|
|||||||
services: any;
|
services: any;
|
||||||
providers:any;
|
providers:any;
|
||||||
companies:any;
|
companies:any;
|
||||||
|
specialities:any;
|
||||||
}
|
}
|
||||||
interface FormRequestClaimProps {
|
interface FormRequestClaimProps {
|
||||||
member: MemberType;
|
member: MemberType;
|
||||||
@@ -37,6 +38,8 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }: FormRe
|
|||||||
const { localeData }: any = useContext(LanguageContext);
|
const { localeData }: any = useContext(LanguageContext);
|
||||||
const [serviceCode, setServiceCode] = useState<string>('');
|
const [serviceCode, setServiceCode] = useState<string>('');
|
||||||
const [idProvider, setIdProvider] = useState<number>(0);
|
const [idProvider, setIdProvider] = useState<number>(0);
|
||||||
|
const [idSpecialities, setIdSpecialities] = useState<number>(0);
|
||||||
|
const [inputDppj, setInputDppj] = useState<string>('');
|
||||||
//Submission date
|
//Submission date
|
||||||
const [submissionDate, setSubmissionDate] = useState<string>(format(new Date(), "yyyy MMM d HH:mm:ss"));
|
const [submissionDate, setSubmissionDate] = useState<string>(format(new Date(), "yyyy MMM d HH:mm:ss"));
|
||||||
|
|
||||||
@@ -77,15 +80,17 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }: FormRe
|
|||||||
organization_name : name,
|
organization_name : name,
|
||||||
address_provider: alamat,
|
address_provider: alamat,
|
||||||
submission_date: fPostFormat(submissionDate, 'yyyy-MM-dd HH:mm:ss'),
|
submission_date: fPostFormat(submissionDate, 'yyyy-MM-dd HH:mm:ss'),
|
||||||
corporate_id_partner: selectedCorporatID
|
corporate_id_partner: selectedCorporatID,
|
||||||
|
specialities_id: idSpecialities,
|
||||||
|
dppj: inputDppj
|
||||||
};
|
};
|
||||||
axios
|
axios
|
||||||
.post('/request-log', formData)
|
.post('/request-log', formData)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (response && response.data && response.data.meta) {
|
if (response && response.data && response.data.meta) {
|
||||||
setTimeout(() => {
|
// setTimeout(() => {
|
||||||
window.location.reload();
|
// window.location.reload();
|
||||||
}, 1500);
|
// }, 1500);
|
||||||
enqueueSnackbar(response.data.meta.message, { variant: 'success' });
|
enqueueSnackbar(response.data.meta.message, { variant: 'success' });
|
||||||
handleSubmitSuccess();
|
handleSubmitSuccess();
|
||||||
|
|
||||||
@@ -111,6 +116,11 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }: FormRe
|
|||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface Specialities {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
const [showAddNewForm, setShowAddNewForm] = useState(false);
|
const [showAddNewForm, setShowAddNewForm] = useState(false);
|
||||||
const [name, setName] = useState('');
|
const [name, setName] = useState('');
|
||||||
const [alamat, setAlamat] = useState('');
|
const [alamat, setAlamat] = useState('');
|
||||||
@@ -215,6 +225,45 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }: FormRe
|
|||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
|
{/* Specialist */}
|
||||||
|
<Stack direction="row" spacing={2}>
|
||||||
|
<Stack spacing={2} sx={{ width: '100%' }}>
|
||||||
|
<Typography variant='subtitle1'>{localeData.txtSpecialist}</Typography>
|
||||||
|
<Autocomplete
|
||||||
|
id='specialities'
|
||||||
|
options={member?.specialities || []}
|
||||||
|
getOptionLabel={(option: Specialities) => option.name || ''}
|
||||||
|
value={member?.specialities.find((item: Specialities) => item.id === idSpecialities) || null}
|
||||||
|
onChange={(event: React.ChangeEvent<{}>, newValue : Specialities | null) => {
|
||||||
|
setIdSpecialities(newValue?.id || 0);
|
||||||
|
}}
|
||||||
|
renderInput={(params) => (
|
||||||
|
<TextField
|
||||||
|
{...params}
|
||||||
|
label={localeData.txtSpecialist}
|
||||||
|
fullWidth
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<FormHelperText style={{ color: 'red' }}></FormHelperText>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
|
<Stack direction="row" spacing={2}>
|
||||||
|
<Stack spacing={2} sx={{ width: '100%' }}>
|
||||||
|
<Typography variant='subtitle1'>{ localeData.txtDPPJ }</Typography>
|
||||||
|
<TextField
|
||||||
|
id='dppj'
|
||||||
|
variant='outlined'
|
||||||
|
placeholder={ localeData.txtDPPJ }
|
||||||
|
onChange={(event) => {
|
||||||
|
setInputDppj(event.target.value);
|
||||||
|
}}
|
||||||
|
fullWidth
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
<Stack direction="row" spacing={2}>
|
<Stack direction="row" spacing={2}>
|
||||||
<Stack spacing={2} sx={{ width: '100%' }}>
|
<Stack spacing={2} sx={{ width: '100%' }}>
|
||||||
<Typography variant='subtitle1'>{localeData.txtDialogMember5} *</Typography>
|
<Typography variant='subtitle1'>{localeData.txtDialogMember5} *</Typography>
|
||||||
@@ -226,7 +275,7 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }: FormRe
|
|||||||
setSubmissionDate( (newValue));
|
setSubmissionDate( (newValue));
|
||||||
}}
|
}}
|
||||||
inputFormat="dd-MM-yyyy HH:mm"
|
inputFormat="dd-MM-yyyy HH:mm"
|
||||||
renderInput={(params) => <TextField sx={{width:'40%'}} {...params} required/>}
|
renderInput={(params) => <TextField sx={{width:'45%'}} {...params} required/>}
|
||||||
/>
|
/>
|
||||||
</LocalizationProvider>
|
</LocalizationProvider>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
Reference in New Issue
Block a user