update
This commit is contained in:
@@ -146,29 +146,34 @@ class DailyMonitoringController extends Controller
|
||||
{
|
||||
|
||||
$detail = RequestDailyMonitoring::where('id', $id)
|
||||
->orderBy("created_at", "desc")
|
||||
->first();
|
||||
->orderBy("created_at", "desc")
|
||||
->first();
|
||||
|
||||
if ($detail) {
|
||||
// Ubah menjadi array agar bisa dimodifikasi
|
||||
$detailArray = $detail->toArray();
|
||||
|
||||
// Ubah nama key dari request_log_id menjadi log_id
|
||||
$detailArray['log_code'] = $detailArray['request_log_id'];
|
||||
unset($detailArray['request_log_id']);
|
||||
} else {
|
||||
$detailArray = null;
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'error' => false,
|
||||
'message' => "success",
|
||||
'data' => $detail,
|
||||
],200);
|
||||
'data' => $detailArray,
|
||||
], 200);
|
||||
|
||||
}
|
||||
|
||||
public function UpdateDetailMonitoringbyID(Request $request)
|
||||
{
|
||||
// validation rule
|
||||
$validator = Validator::make($request->all(),[
|
||||
'subject' => 'required',
|
||||
'submission_date' => 'required',
|
||||
'body_temperature' => 'required',
|
||||
'sistole' => 'required',
|
||||
'diastole' => 'required',
|
||||
'respiration_rate' => 'required',
|
||||
'analysis' => 'required',
|
||||
'medical_plan' => 'required',
|
||||
'log_code' => 'required',
|
||||
'reason' => 'required',
|
||||
'non_medikamentosa_plan' => 'required',
|
||||
],$this->messages());
|
||||
|
||||
// validation error
|
||||
@@ -182,6 +187,7 @@ class DailyMonitoringController extends Controller
|
||||
// insert claim daily monitoring
|
||||
$db_response = RequestDailyMonitoring::where('id', $request->id)
|
||||
->update([
|
||||
'request_log_id' => $request->log_code,
|
||||
'submission_date' => $request->submission_date,
|
||||
'subject' => $request->subject,
|
||||
'object' => $request->objective,
|
||||
@@ -193,6 +199,13 @@ class DailyMonitoringController extends Controller
|
||||
'lab_date' => $request->lab_date,
|
||||
'provider' => $request->provider,
|
||||
'examination' => $request->examination,
|
||||
'doctor_1' => $request->doctor_1,
|
||||
'doctor_2' => $request->doctor_2,
|
||||
'temp_diagnosis' => $request->temp_diagnosis,
|
||||
'final_diagnosis' => $request->final_diagnosis,
|
||||
'approval_pendamping' => $request->approval_pendamping,
|
||||
'description' => $request->keterangan,
|
||||
'note' => $request->catatan,
|
||||
'reason' => $request->reason,
|
||||
'created_by' => auth()->user()->id,
|
||||
]);
|
||||
|
||||
@@ -24,6 +24,7 @@ class DailyMonitoringResource extends JsonResource
|
||||
'start_date' => $this->startdate,
|
||||
'end_date' => $this->enddate,
|
||||
'addmision_date' => $this->addmision_date,
|
||||
'submission_date' => $this->submission_date,
|
||||
'provider' => $this->provider,
|
||||
'organization_id' => $this->organization_id,
|
||||
'doctor_1' => $this->doctor_1,
|
||||
|
||||
@@ -409,19 +409,12 @@ export default function DailyMonitoringList() {
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell style={TableHeadStyle} align="left" width={50} />
|
||||
<TableCell style={TableHeadStyle} align="left" width={160}>Code</TableCell>
|
||||
<TableCell style={TableHeadStyle} align="left" width={160}>Admission Date</TableCell>
|
||||
<TableCell style={TableHeadStyle} align="left" width={150}>Member ID</TableCell>
|
||||
<TableCell style={TableHeadStyle} align="left" width={'*'}>Name</TableCell>
|
||||
<TableCell style={TableHeadStyle} align="left" width={160}>Tanggal Lahir</TableCell>
|
||||
<TableCell style={TableHeadStyle} align="left" width={160}>Member Type</TableCell>
|
||||
<TableCell style={TableHeadStyle} align="left" width={160}>Dokter 1</TableCell>
|
||||
<TableCell style={TableHeadStyle} align="left" width={160}>Dokter 2</TableCell>
|
||||
<TableCell style={TableHeadStyle} align="left" width={160}>Temp Diagnosa</TableCell>
|
||||
<TableCell style={TableHeadStyle} align="left" width={160}>Diagnosa Akhir</TableCell>
|
||||
<TableCell style={TableHeadStyle} align="left" width={160}>Approval Pendamping</TableCell>
|
||||
<TableCell style={TableHeadStyle} align="left" width={160}>Keterangan</TableCell>
|
||||
<TableCell style={TableHeadStyle} align="left" width={160}>Penjaminan</TableCell>
|
||||
<TableCell style={TableHeadStyle} align="left" width={160}>Catatan</TableCell>
|
||||
<TableCell align="left" width={"10"} />
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
|
||||
@@ -36,6 +36,7 @@ export default function DailyMonitoringListRow ({ ...props }: Props) {
|
||||
|
||||
<TableRow hover sx={{ '& > td': { borderBottom: '1' } }}>
|
||||
<TableCell align="left" />
|
||||
<TableCell align="left">{props.row.code}</TableCell>
|
||||
<TableCell align="left">
|
||||
<Label
|
||||
variant="ghost"
|
||||
@@ -57,26 +58,7 @@ export default function DailyMonitoringListRow ({ ...props }: Props) {
|
||||
<TableCell align="left">
|
||||
{props.row.member_type}
|
||||
</TableCell>
|
||||
<TableCell align="left">{props.row.doctor_1}</TableCell>
|
||||
<TableCell align="left">{props.row.doctor_2}</TableCell>
|
||||
<TableCell align="left">{props.row.temp_diagnosis}</TableCell>
|
||||
<TableCell align="left">{props.row.final_diagnosis}</TableCell>
|
||||
<TableCell align="left">{props.row.approval_pendamping}</TableCell>
|
||||
<TableCell align="left">
|
||||
{props.row.description
|
||||
? props.row.description.length > 130
|
||||
? props.row.description.substring(0, 130) + "..."
|
||||
: props.row.description
|
||||
: "-"}
|
||||
</TableCell>
|
||||
<TableCell align="left">{props.row.provider || "-"}</TableCell>
|
||||
<TableCell align="left">
|
||||
{props.row.note
|
||||
? props.row.note.length > 130
|
||||
? props.row.note.substring(0, 130) + "..."
|
||||
: props.row.note
|
||||
: "-"}
|
||||
</TableCell>
|
||||
|
||||
<TableCell align="right" onClick={(e) => e.stopPropagation()}>
|
||||
<Stack direction="row" justifyContent="flex-end" spacing={1}>
|
||||
<TableMoreMenu actions={
|
||||
@@ -85,7 +67,7 @@ export default function DailyMonitoringListRow ({ ...props }: Props) {
|
||||
<Visibility />
|
||||
View
|
||||
</MenuItem>
|
||||
<MenuItem onClick={() => navigate(`/case_management/daily_monitoring/${props.row.member_id}/claims/${props.row.code}/${props.row.id}`)}>
|
||||
<MenuItem onClick={() => navigate(`/case_management/daily_monitoring/${props.row.id}/edit`)}>
|
||||
<Edit />
|
||||
Edit
|
||||
</MenuItem>
|
||||
|
||||
@@ -57,7 +57,7 @@ export default function DetailMonitoringList() {
|
||||
// setOrganizationId(organization_id);
|
||||
// }
|
||||
const loadDetailDailyMonitoring = async () => {
|
||||
const monitoring = await getMonitoringDetailById('')
|
||||
const monitoring = await getMonitoringDetailById(id)
|
||||
setData(monitoring)
|
||||
}
|
||||
|
||||
@@ -74,41 +74,41 @@ export default function DetailMonitoringList() {
|
||||
// ====================================
|
||||
const defaultValues = useMemo(
|
||||
() => ({
|
||||
id : data?.id ??'',
|
||||
// claim_code : data?.claim_code ?? '',
|
||||
log_code : data?.log_code ?? '',
|
||||
doctor_1 : data?.doctor_1 ?? '',
|
||||
doctor_2 : data?.doctor_2 ?? '',
|
||||
temp_diagnosis : data?.temp_diagnosis ?? '',
|
||||
final_diagnosis : data?.final_diagnosis ?? '',
|
||||
approval_pendamping : data?.approval_pendamping ?? '',
|
||||
keterangan : data?.keterangan ?? '',
|
||||
catatan : data?.catatan ?? '',
|
||||
claim_id : data?.claim_id ?? '',
|
||||
subject : data?.subject ?? '',
|
||||
objective : data?.object ?? '',
|
||||
submission_date : data?.submission_date ?? '',
|
||||
body_temperature: data?.body_temperature ?? '',
|
||||
sistole : data?.sistole ?? '',
|
||||
diastole : data?.diastole ??'',
|
||||
respiration_rate: data?.respiration_rate ??'',
|
||||
complaints : data?.complaints ?? '',
|
||||
analysis : data?.analysis ?? '',
|
||||
medical_plan : data?.medical_plan ?? [{
|
||||
medical_plan_str: ''
|
||||
}],
|
||||
non_medikamentosa_plan : data?.non_medikamentosa_plan ?? [{
|
||||
non_medikamentosa_plan_str: ''
|
||||
}],
|
||||
confirmation_medical_leter : [],
|
||||
medical_action_letter : [],
|
||||
// result : data?.laboratorium_result ?? [],
|
||||
result : [],
|
||||
created_at : data?.created_at ?? '',
|
||||
lab_date : data?.lab_date ?? '',
|
||||
provider : data?.provider ?? '',
|
||||
examination : data?.examination ?? '',
|
||||
reason : '',
|
||||
id : data?.id ??'',
|
||||
// claim_code : data?.claim_code ?? '',
|
||||
log_code : data?.log_code ?? '',
|
||||
doctor_1 : data?.doctor_1 ?? '',
|
||||
doctor_2 : data?.doctor_2 ?? '',
|
||||
temp_diagnosis : data?.temp_diagnosis ?? '',
|
||||
final_diagnosis : data?.final_diagnosis ?? '',
|
||||
approval_pendamping : data?.approval_pendamping ?? '',
|
||||
keterangan : data?.keterangan ?? '',
|
||||
catatan : data?.catatan ?? '',
|
||||
claim_id : data?.claim_id ?? '',
|
||||
subject : data?.subject ?? '',
|
||||
objective : data?.object ?? '',
|
||||
submission_date : data?.submission_date ?? '',
|
||||
body_temperature: data?.body_temperature ?? '',
|
||||
sistole : data?.sistole ?? '',
|
||||
diastole : data?.diastole ??'',
|
||||
respiration_rate: data?.respiration_rate ??'',
|
||||
complaints : data?.complaints ?? '',
|
||||
analysis : data?.analysis ?? '',
|
||||
medical_plan : data?.medical_plan ?? [{
|
||||
medical_plan_str: ''
|
||||
}],
|
||||
non_medikamentosa_plan : data?.non_medikamentosa_plan ?? [{
|
||||
non_medikamentosa_plan_str: ''
|
||||
}],
|
||||
confirmation_medical_leter : [],
|
||||
medical_action_letter : [],
|
||||
// result : data?.laboratorium_result ?? [],
|
||||
result : [],
|
||||
created_at : data?.created_at ?? '',
|
||||
lab_date : data?.lab_date ?? '',
|
||||
provider : data?.provider ?? '',
|
||||
examination : data?.examination ?? '',
|
||||
reason : '',
|
||||
}),
|
||||
[data]
|
||||
);
|
||||
@@ -262,19 +262,26 @@ export default function DetailMonitoringList() {
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
// Ambil data dari API dan atur opsi ICD
|
||||
axios.get('codeLog')
|
||||
.then((response) => {
|
||||
setCodes(response.data.data);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error fetching Code LOG options:', error);
|
||||
});
|
||||
|
||||
}, []); // useEffect dijalankan hanya sekali saat komponen dimount
|
||||
axios.get('codeLog')
|
||||
.then((response) => {
|
||||
const fetchedCodes = response.data.data;
|
||||
setCodes(fetchedCodes);
|
||||
// Set nilai default jika data tersedia
|
||||
console.log(defaultValues, 'test')
|
||||
if (defaultValues?.log_code) {
|
||||
const defaultValueLOG = fetchedCodes.find((item) => item.value === defaultValues?.log_code);
|
||||
setSelectedCode(defaultValueLOG || null);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error fetching Code LOG options:', error);
|
||||
});
|
||||
}, [isEdit, defaultValues]); // Tambahkan dependency agar dijalankan ulang jika log_code berubah
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const fetchCodes = async () => {
|
||||
if (searchTerm.length > 2) { // Hanya fetch jika input lebih dari 2 karakter
|
||||
if (searchTerm.length > 3) { // Hanya fetch jika input lebih dari 2 karakter
|
||||
try {
|
||||
const response = await axios.get(`codeLog?search=${searchTerm}`);
|
||||
setCodes(response.data.data);
|
||||
@@ -300,7 +307,7 @@ export default function DetailMonitoringList() {
|
||||
</IconButton>
|
||||
|
||||
<Typography variant="h5" sx={{ marginLeft: '24px' }}>
|
||||
Tambah Daily Monitoring
|
||||
{isEdit ? "Update " : "Tambah "} Daily Monitoring
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
@@ -317,36 +324,36 @@ export default function DetailMonitoringList() {
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} sx={{ display: 'flex', gap: 1 }}>
|
||||
<Autocomplete
|
||||
options={codes}
|
||||
getOptionLabel={(option) => option.label}
|
||||
fullWidth
|
||||
value={selectedCode}
|
||||
onChange={(event, newValue) => {
|
||||
setSelectedCode(newValue);
|
||||
setValue('log_code',newValue?.value)
|
||||
// Validasi jika newValue adalah null
|
||||
if (!newValue) {
|
||||
setError('Please select a code');
|
||||
} else {
|
||||
setError('');
|
||||
}
|
||||
}}
|
||||
onInputChange={(event, newInputValue) => {
|
||||
setSearchTerm(newInputValue); // Set nilai pencarian untuk fetch data
|
||||
}}
|
||||
renderInput={(params) => (
|
||||
<RHFTextField
|
||||
{...params}
|
||||
label="Code LOG"
|
||||
variant="outlined"
|
||||
id="log_code"
|
||||
name='log_code'
|
||||
error={false} // Menampilkan error jika ada
|
||||
helperText={error} // Menampilkan pesan kesalahan
|
||||
/>
|
||||
)}
|
||||
<Autocomplete
|
||||
options={codes}
|
||||
getOptionLabel={(option) => option.label}
|
||||
fullWidth
|
||||
value={selectedCode}
|
||||
onChange={(event, newValue) => {
|
||||
setSelectedCode(newValue);
|
||||
setValue('log_code', newValue?.value);
|
||||
if (!newValue) {
|
||||
setError('Please select a code');
|
||||
} else {
|
||||
setError('');
|
||||
}
|
||||
}}
|
||||
onInputChange={(event, newInputValue) => {
|
||||
setSearchTerm(newInputValue); // Set nilai pencarian untuk fetch data
|
||||
}}
|
||||
renderInput={(params) => (
|
||||
<RHFTextField
|
||||
{...params}
|
||||
label="Code LOG"
|
||||
variant="outlined"
|
||||
id="log_code"
|
||||
name="log_code"
|
||||
error={false} // Menampilkan error jika ada
|
||||
helperText={error} // Menampilkan pesan kesalahan
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" component="div">
|
||||
@@ -365,7 +372,7 @@ export default function DetailMonitoringList() {
|
||||
</Grid>
|
||||
|
||||
{/* Doctor 1 */}
|
||||
<Grid item xs={12}>
|
||||
{/* <Grid item xs={12}>
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" component="div">
|
||||
@@ -428,10 +435,10 @@ export default function DetailMonitoringList() {
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid> */}
|
||||
|
||||
{/* Subject */}
|
||||
<Grid item xs={12}>
|
||||
{/* Subject */}
|
||||
<Grid item xs={12}>
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" component="div">
|
||||
@@ -707,8 +714,8 @@ export default function DetailMonitoringList() {
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
{/* Keterangan dan Catatan */}
|
||||
<Grid item xs={12}>
|
||||
{/* Keterangan dan Catatan */}
|
||||
<Grid item xs={12}>
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" component="div">
|
||||
@@ -728,9 +735,9 @@ export default function DetailMonitoringList() {
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
{/* Confirmation Medical Letter */}
|
||||
<Grid item xs={12}>
|
||||
|
||||
{/* Confirmation Medical Letter */}
|
||||
<Grid item xs={12}>
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" component="div">
|
||||
|
||||
@@ -56,7 +56,7 @@ export default function DetailMonitoringList() {
|
||||
// Use Effect
|
||||
// --------------------
|
||||
useEffect(() => {
|
||||
// loadDataTableData();
|
||||
loadDataTableData();
|
||||
}, [])
|
||||
|
||||
// Dialog
|
||||
@@ -165,19 +165,18 @@ export default function DetailMonitoringList() {
|
||||
|
||||
// Load Data
|
||||
// -------------------
|
||||
// const loadDataTableData = async () => {
|
||||
// const response = await getMonitoringDetailList(claim_code??'');
|
||||
// const organization_id = await getOrganizationId(claim_code??'');
|
||||
const loadDataTableData = async () => {
|
||||
const response = await getMonitoringDetailList(claim_code??'');
|
||||
const organization_id = await getOrganizationId(claim_code??'');
|
||||
|
||||
// setDetailMonitoringList(response);
|
||||
// setOrganizationId(organization_id);
|
||||
// }
|
||||
setDetailMonitoringList(response);
|
||||
setOrganizationId(organization_id);
|
||||
}
|
||||
|
||||
const renderHTML = (data:string) => {
|
||||
function renderHTML(data: string) {
|
||||
return (
|
||||
<div style={{marginLeft: 20}}
|
||||
dangerouslySetInnerHTML={{__html: data}}
|
||||
/>
|
||||
<div style={{ marginLeft: 20 }}
|
||||
dangerouslySetInnerHTML={{ __html: data }} />
|
||||
);
|
||||
}
|
||||
|
||||
@@ -187,7 +186,7 @@ export default function DetailMonitoringList() {
|
||||
{/* back button */}
|
||||
<Grid item xs={12}>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center' }}>
|
||||
<IconButton size='large' color='inherit' onClick={() => navigate(`/case_management/daily_monitoring/${member_id}/${organizationId}/claims`)} >
|
||||
<IconButton size='large' color='inherit' onClick={() => navigate(`/case_management/daily_monitoring`)} >
|
||||
<ArrowBackIosNew/>
|
||||
</IconButton>
|
||||
|
||||
@@ -241,10 +240,10 @@ export default function DetailMonitoringList() {
|
||||
<Box sx={{ marginLeft: 'auto' }}> {/* Menempatkan TableMoreMenu di sebelah kanan */}
|
||||
<TableMoreMenu actions={
|
||||
<>
|
||||
<MenuItem onClick={() => {handleEdit(row.id);}}>
|
||||
{/* <MenuItem onClick={() => {handleEdit(row.id);}}>
|
||||
<Edit />
|
||||
Edit
|
||||
</MenuItem>
|
||||
</MenuItem> */}
|
||||
<MenuItem onClick={() => {setOpenDialog(true); setId(row.id); setIdFile(null)}}>
|
||||
<Delete color='error' />
|
||||
Delete
|
||||
|
||||
@@ -60,6 +60,7 @@ export type DetailMonitoringListType = {
|
||||
id : number|null,
|
||||
claim_id : string|null,
|
||||
log_code : string|null,
|
||||
request_log_id : string|null,
|
||||
claim_code : string|undefined,
|
||||
doctor_1 : string|undefined,
|
||||
doctor_2 : string|undefined,
|
||||
@@ -68,6 +69,8 @@ export type DetailMonitoringListType = {
|
||||
approval_pendamping : string|undefined,
|
||||
keterangan : string|undefined,
|
||||
catatan : string|undefined,
|
||||
description : string|undefined,
|
||||
note : string|undefined,
|
||||
subject : string|undefined,
|
||||
object : string|undefined,
|
||||
objective : string|undefined,
|
||||
|
||||
@@ -194,9 +194,9 @@ export default function DialogEditFinalLOG({requestLog, setOpenDialog, openDialo
|
||||
|
||||
<Card sx={{padding:2, marginTop:2}} >
|
||||
<Stack direction='row' spacing={2} sx={marginBottom2}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Invoice Number</Typography>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Invoice Provider</Typography>
|
||||
<TextField
|
||||
label="Invoice Number"
|
||||
label="Invoice Provider"
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
value={formData.invoice_no}
|
||||
|
||||
@@ -241,6 +241,10 @@ export default function Router() {
|
||||
path: 'daily_monitoring/:member_id/claims/:claim_code/:id',
|
||||
element: <DetailMonitoringForm />
|
||||
},
|
||||
{
|
||||
path: 'daily_monitoring/:id/edit',
|
||||
element: <DetailMonitoringForm />
|
||||
},
|
||||
{
|
||||
path: 'daily_monitoring/:member_id/claims/:claim_code/list_monitoring',
|
||||
element: <DetailMonitoringList />
|
||||
|
||||
Reference in New Issue
Block a user