view, search dan tambah daily monitoring
This commit is contained in:
@@ -13,6 +13,7 @@ use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Support\Facades\File as Files;
|
||||
use Modules\Internal\Transformers\DailyMonitoringResource;
|
||||
use App\Models\File;
|
||||
use Carbon\Carbon;
|
||||
|
||||
|
||||
/**
|
||||
@@ -38,11 +39,27 @@ class DailyMonitoringController extends Controller
|
||||
|
||||
public function GetMemberList(Request $request)
|
||||
{
|
||||
$memberList = DB::table('request_logs')
|
||||
$startDate = $request->start_date ? Carbon::parse($request->start_date) : Carbon::today();
|
||||
$endDate = $request->end_date ? Carbon::parse($request->end_date)->addDay() : Carbon::today()->addDay();
|
||||
|
||||
$memberList = DB::table('request_log_daily_monitorings')
|
||||
->leftJoin('request_logs', 'request_log_daily_monitorings.request_log_id', '=', 'request_logs.id')
|
||||
->leftJoin('members', 'request_logs.member_id', '=', 'members.id')
|
||||
->leftJoin('organizations', 'organizations.id', '=', 'request_logs.organization_id')
|
||||
->select('members.member_id','members.name','members.members_effective_date AS startdate','members.members_expire_date AS enddate', 'request_logs.submission_date as addmision_date', 'organizations.name as provider', 'request_logs.organization_id' )
|
||||
->where('request_logs.service_code', 'IP')
|
||||
->select(
|
||||
'members.member_id',
|
||||
'members.name',
|
||||
'members.birth_date',
|
||||
'members.record_type as member_type',
|
||||
'members.members_effective_date AS startdate',
|
||||
'members.members_expire_date AS enddate',
|
||||
'request_logs.submission_date as addmision_date',
|
||||
'organizations.name as provider',
|
||||
'request_logs.organization_id',
|
||||
'request_logs.code',
|
||||
'request_log_daily_monitorings.*'
|
||||
)
|
||||
// ->where('request_logs.service_code', 'IP')
|
||||
->where('request_logs.deleted_at', null)
|
||||
->when($request->search, function ($q, $search) {
|
||||
$q->where(function ($subQ) use ($search) {
|
||||
@@ -50,13 +67,17 @@ class DailyMonitoringController extends Controller
|
||||
$subQ->orWhere('members.name','LIKE',"%".$search."%");
|
||||
});
|
||||
})
|
||||
->when($startDate, function ($q) use ($startDate) {
|
||||
$q->where('request_log_daily_monitorings.submission_date', '>=', $startDate);
|
||||
})
|
||||
->when($endDate, function ($q) use ($endDate) {
|
||||
$q->where('request_log_daily_monitorings.submission_date', '<=', Carbon::parse($endDate)->addDay());
|
||||
})
|
||||
// ->where('request_logs.status_final_log', 'approved')
|
||||
->groupBy('request_logs.member_id', 'request_logs.organization_id')
|
||||
// ->groupBy('request_logs.member_id', 'request_logs.organization_id')
|
||||
->orderBy('request_logs.created_at', 'desc')
|
||||
// ->get()
|
||||
->paginate();
|
||||
|
||||
|
||||
return Helper::paginateResources(DailyMonitoringResource::collection($memberList));
|
||||
}
|
||||
|
||||
@@ -620,6 +641,181 @@ class DailyMonitoringController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function AddListRequestLog(Request $request)
|
||||
{
|
||||
// validation rule
|
||||
$validator = Validator::make($request->all(),[
|
||||
'log_code' => 'required|exists:request_logs,id',
|
||||
'subject' => 'required',
|
||||
'submission_date' => 'required',
|
||||
'body_temperature' => 'required',
|
||||
'sistole' => 'required',
|
||||
'diastole' => 'required',
|
||||
'respiration_rate' => 'required',
|
||||
'analysis' => 'required',
|
||||
'medical_plan' => 'required',
|
||||
'non_medikamentosa_plan' => 'required',
|
||||
],$this->messages());
|
||||
|
||||
// validation error
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => true,
|
||||
'message' => $validator->getMessageBag()
|
||||
],400);
|
||||
}
|
||||
|
||||
// get claim request
|
||||
$request_log = DB::table('request_logs')
|
||||
->select('id')
|
||||
->where('id', $request->log_code)
|
||||
->first();
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
// insert claim daily monitoring
|
||||
$db_response = RequestDailyMonitoring::create([
|
||||
'request_log_id' => $request->log_code,
|
||||
'submission_date' => $request->submission_date,
|
||||
'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,
|
||||
'subject' => $request->subject,
|
||||
'object' => $request->objective,
|
||||
'sistole' => $request->sistole,
|
||||
'diastole' => $request->diastole,
|
||||
'body_temperature' => $request->body_temperature,
|
||||
'respiration_rate' => $request->respiration_rate,
|
||||
'analysis' => $request->analysis,
|
||||
'lab_date' => $request->lab_date,
|
||||
'provider' => $request->provider,
|
||||
'examination' => $request->examination,
|
||||
'created_by' => auth()->user()->id,
|
||||
]);
|
||||
|
||||
|
||||
// cek medical plan
|
||||
$num_medical_plan = 0;
|
||||
foreach ($request->medical_plan as $row) {
|
||||
if ($row['medical_plan_str']) {
|
||||
$num_medical_plan++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($num_medical_plan == 0) {
|
||||
DB::rollBack();
|
||||
return response()->json([
|
||||
'error' => true,
|
||||
'message' => [
|
||||
'medical_plan' => ['medical plan harus diisi']
|
||||
],
|
||||
'data' => []
|
||||
],400);
|
||||
}
|
||||
|
||||
// insert medical plan
|
||||
foreach ($request->medical_plan as $row) {
|
||||
DB::table('request_log_medical_plan')->insert([
|
||||
'request_log_daily_monitoring_id' => $db_response->id,
|
||||
'plan' => $row['medical_plan_str'],
|
||||
'type' => 1,
|
||||
'created_at' => date('Y-m-d'),
|
||||
]);
|
||||
}
|
||||
|
||||
// insert non medical plan
|
||||
foreach ($request->non_medikamentosa_plan as $row) {
|
||||
DB::table('request_log_medical_plan')->insert([
|
||||
'request_log_daily_monitoring_id' => $db_response->id,
|
||||
'plan' => $row['non_medikamentosa_plan_str'],
|
||||
'type' => 2,
|
||||
'created_at' => date('Y-m-d'),
|
||||
]);
|
||||
}
|
||||
|
||||
// insert file result
|
||||
if ($request->confirmation_medical_leter){
|
||||
foreach ($request->confirmation_medical_leter as $file) {
|
||||
$name = 'labresult-' . uniqid();
|
||||
$extension= $file->getClientOriginalExtension();
|
||||
$fileName = $name . '.' . $extension;
|
||||
$orignalName = $file->getClientOriginalName();
|
||||
$path = $file->storeAs($this->path_for_store, $fileName);
|
||||
File::create([
|
||||
'fileable_type' => 'App\Models\LaboratoriumResult',
|
||||
'fileable_id' => $db_response->id,
|
||||
'type' => 'confirmation-medical-letter',
|
||||
'name' => $name,
|
||||
'original_name' => $orignalName,
|
||||
'extension' => $extension,
|
||||
'path' => $path,
|
||||
]);
|
||||
|
||||
}
|
||||
}
|
||||
if ($request->medical_action_letter){
|
||||
foreach ($request->medical_action_letter as $file) {
|
||||
$name = 'labresult-' . uniqid();
|
||||
$extension= $file->getClientOriginalExtension();
|
||||
$fileName = $name . '.' . $extension;
|
||||
$orignalName = $file->getClientOriginalName();
|
||||
$path = $file->storeAs($this->path_for_store, $fileName);
|
||||
File::create([
|
||||
'fileable_type' => 'App\Models\LaboratoriumResult',
|
||||
'fileable_id' => $db_response->id,
|
||||
'type' => 'medical-action-letter',
|
||||
'name' => $name,
|
||||
'original_name' => $orignalName,
|
||||
'extension' => $extension,
|
||||
'path' => $path,
|
||||
]);
|
||||
|
||||
// $file->storeAs($this->path_for_store, $fileName);
|
||||
}
|
||||
}
|
||||
if ($request->result){
|
||||
foreach ($request->result as $file) {
|
||||
$name = 'labresult-' . uniqid();
|
||||
$extension= $file->getClientOriginalExtension();
|
||||
$orignalName = $file->getClientOriginalName();
|
||||
$fileName = $name . '.' . $extension;
|
||||
$path = $file->storeAs($this->path_for_store, $fileName);
|
||||
File::create([
|
||||
'fileable_type' => 'App\Models\LaboratoriumResult',
|
||||
'fileable_id' => $db_response->id,
|
||||
'type' => 'laboratorium-result',
|
||||
'name' => $name,
|
||||
'original_name' => $orignalName,
|
||||
'extension' => $extension,
|
||||
'path' => $path,
|
||||
]);
|
||||
|
||||
// $file->storeAs($this->path_for_store, $fileName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DB::commit();
|
||||
|
||||
return response()->json([
|
||||
'error' => false,
|
||||
'message' => "success",
|
||||
'data' => []
|
||||
],200);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
return response()->json([
|
||||
'error' => true,
|
||||
'message' => $e->getMessage(),
|
||||
'data' => []
|
||||
],500);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Listing Daily Monitoring
|
||||
*/
|
||||
|
||||
@@ -236,6 +236,25 @@ class RequestLogController extends Controller
|
||||
return Helper::responseJson(data: $manipulatedIcds);
|
||||
}
|
||||
|
||||
public function codeLog(Request $request){
|
||||
$codeLogs = RequestLog::with(['member'])->when($request->search, function ($q, $search) {
|
||||
$q->where('code', 'LIKE', "%".$search."%");
|
||||
$q->orWhereHas('member', function ($subQuery) use ($search) {
|
||||
$subQuery->where('name', 'LIKE', "%".$search."%");
|
||||
});
|
||||
})
|
||||
->paginate();
|
||||
|
||||
$manipulatedIcds = $codeLogs->map(function ($codeLog) {
|
||||
// Contoh manipulasi, tambahkan atau ubah properti sesuai kebutuhan
|
||||
return [
|
||||
'value' => $codeLog->id, // Ganti dengan properti yang sesuai dari model Icd
|
||||
'label' => $codeLog->code . ' - ' .$codeLog->member->name, // Ganti dengan properti yang sesuai dari model Icd
|
||||
];
|
||||
});
|
||||
return Helper::responseJson(data: $manipulatedIcds);
|
||||
}
|
||||
|
||||
public function hospitals(){
|
||||
$organizations = Organization::query()
|
||||
->where([
|
||||
|
||||
@@ -82,6 +82,7 @@ Route::prefix('internal')->group(function () {
|
||||
|
||||
|
||||
Route::get('diagnosis', [RequestLogController::class, 'diagnosis']);
|
||||
Route::get('codeLog', [RequestLogController::class, 'codeLog']);
|
||||
Route::get('drugs', [AutocompleteController::class, 'drugList']);
|
||||
Route::get('units', [AutocompleteController::class, 'unitList']);
|
||||
|
||||
@@ -207,6 +208,7 @@ Route::prefix('internal')->group(function () {
|
||||
Route::post('detail/update-request', [DailyMonitoringController::class, 'UpdateDetailMonitoringbyID']);
|
||||
Route::post('detail/{claim_code}/add', [DailyMonitoringController::class, 'AddDetailMonitoringList']);
|
||||
Route::post('detail/{claim_code}/add-request', [DailyMonitoringController::class, 'AddDetailMonitoringListRequestLog']);
|
||||
Route::post('add-request', [DailyMonitoringController::class, 'AddListRequestLog']);
|
||||
Route::post('detail/{claim_code}/update-status', [DailyMonitoringController::class, 'UpdateListRequestLog']);
|
||||
Route::get('detail/{id}/delete', [DailyMonitoringController::class, 'deleteDetailMonitoringListRequestLog']);
|
||||
Route::get('detail/{id}/delete-file', [DailyMonitoringController::class, 'deleteFileDetailMonitoringListRequestLog']);
|
||||
|
||||
@@ -14,15 +14,26 @@ class DailyMonitoringResource extends JsonResource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
|
||||
$data = [
|
||||
'code' => $this->code,
|
||||
'id' => $this->id,
|
||||
'member_id' => $this->member_id,
|
||||
'member_type' => $this->member_type,
|
||||
'birth_date' => $this->birth_date,
|
||||
'name' => $this->name,
|
||||
'start_date' => $this->startdate,
|
||||
'end_date' => $this->enddate,
|
||||
'addmision_date' => $this->addmision_date,
|
||||
'provider' => $this->provider,
|
||||
'organization_id' => $this->organization_id,
|
||||
'doctor_1' => $this->doctor_1,
|
||||
'doctor_2' => $this->doctor_2,
|
||||
'temp_diagnosis' => $this->temp_diagnosis,
|
||||
'final_diagnosis' => $this->final_diagnosis,
|
||||
'approval_pendamping' => $this->approval_pendamping,
|
||||
'status' => $this->status,
|
||||
'description' => strip_tags($this->description),
|
||||
'note' => strip_tags($this->note),
|
||||
];
|
||||
|
||||
return $data;
|
||||
|
||||
@@ -16,6 +16,13 @@ class RequestDailyMonitoring extends Model
|
||||
|
||||
protected $fillable = [
|
||||
'request_log_id',
|
||||
'doctor_1',
|
||||
'doctor_2',
|
||||
'temp_diagnosis',
|
||||
'final_diagnosis',
|
||||
'approval_pendamping',
|
||||
'description',
|
||||
'note',
|
||||
'subject',
|
||||
'object',
|
||||
'submission_date',
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?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()
|
||||
{
|
||||
Schema::table('request_log_daily_monitorings', function (Blueprint $table) {
|
||||
$table->string('doctor_1')->after('examination')->nullable();
|
||||
$table->string('doctor_2')->after('doctor_1')->nullable();
|
||||
$table->string('approval_pendamping')->after('doctor_2')->nullable();
|
||||
$table->text('description')->after('approval_pendamping')->nullable();
|
||||
$table->text('note')->after('description')->nullable();
|
||||
$table->string('temp_diagnosis')->after('note')->nullable();
|
||||
$table->string('final_diagnosis')->after('temp_diagnosis')->nullable();
|
||||
$table->string('status')->after('final_diagnosis')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('request_log_daily_monitorings', function (Blueprint $table) {
|
||||
$table->dropColumn('doctor_1');
|
||||
$table->dropColumn('doctor_2');
|
||||
$table->dropColumn('description');
|
||||
$table->dropColumn('note');
|
||||
$table->dropColumn('temp_diagnosis');
|
||||
$table->dropColumn('final_diagnosis');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -3,7 +3,7 @@
|
||||
* ============================================
|
||||
*/
|
||||
import React, { ChangeEvent, useEffect, useRef, useState } from "react";
|
||||
import { Box, Paper, TableContainer, Table, TableHead, TableRow, TableCell, TableBody, Stack, TextField, Button, Menu, } from "@mui/material";
|
||||
import { Box, Paper, TableContainer, Table, TableHead, TableRow, TableCell, TableBody, Stack, TextField, Button, Menu, Typography, ButtonGroup, } from "@mui/material";
|
||||
|
||||
/**
|
||||
* Types & Functions
|
||||
@@ -15,9 +15,18 @@ import DailyMonitoringListRow from "./DailyMonitoringListRow";
|
||||
import { LaravelPaginatedData, LaravelPaginatedDataDefault } from "@/@types/paginated-data";
|
||||
import { Grid } from "@mui/material";
|
||||
import DataTable from '../../../../components/LaravelTable';
|
||||
import DownloadIcon from '@mui/icons-material/Download';
|
||||
import CancelIcon from '@mui/icons-material/Cancel';
|
||||
import UploadIcon from '@mui/icons-material/Upload';
|
||||
import { MenuItem } from "@mui/material";
|
||||
import { useSearchParams } from "react-router-dom";
|
||||
import { useNavigate, useSearchParams } from "react-router-dom";
|
||||
import axios from "@/utils/axios";
|
||||
import { DesktopDatePicker, LocalizationProvider } from "@mui/x-date-pickers";
|
||||
import { AdapterDateFns } from "@mui/x-date-pickers/AdapterDateFns";
|
||||
import { fDateOnly } from "@/utils/formatTime";
|
||||
import { LoadingButton } from "@mui/lab";
|
||||
import { Import } from "@/@types/claims";
|
||||
import { HeadCell, Order } from '@/@types/table';
|
||||
|
||||
export default function DailyMonitoringList() {
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
@@ -34,8 +43,7 @@ export default function DailyMonitoringList() {
|
||||
fontWeight: 'bold',
|
||||
};
|
||||
|
||||
|
||||
|
||||
const [importResult, setImportResult] = useState<Import>(null);
|
||||
// Load Data
|
||||
// -------------------
|
||||
const loadDataTableData = async (appliedFilter: any | null = null) => {
|
||||
@@ -57,46 +65,156 @@ export default function DailyMonitoringList() {
|
||||
loadDataTableData(filter);
|
||||
setSearchParams(filter);
|
||||
};
|
||||
|
||||
|
||||
/* ------------------------------ handle params ----------------------------- */
|
||||
const [appliedParams, setAppliedParams] = useState({});
|
||||
|
||||
const params = {
|
||||
searchParams: searchParams,
|
||||
setSearchParams: setSearchParams,
|
||||
appliedParams: appliedParams,
|
||||
setAppliedParams: setAppliedParams,
|
||||
};
|
||||
|
||||
/* ------------------------------ handle order ------------------------------ */
|
||||
const [order, setOrder] = useState<Order>('desc');
|
||||
const [orderBy, setOrderBy] = useState('submission_date');
|
||||
|
||||
const orders = {
|
||||
order: order,
|
||||
setOrder: setOrder,
|
||||
orderBy: orderBy,
|
||||
setOrderBy: setOrderBy,
|
||||
};
|
||||
|
||||
/* ------------------------------- handle sort ------------------------------ */
|
||||
const handleRequestSort = async (event: React.MouseEvent<unknown>, property: string) => {
|
||||
const isAsc = orders?.orderBy === property && orders?.order === 'asc';
|
||||
|
||||
orders?.setOrder(isAsc ? 'desc' : 'asc');
|
||||
orders?.setOrderBy(property);
|
||||
const parameters = Object.fromEntries([
|
||||
...(params?.searchParams.entries() as IterableIterator<[string, string]>),
|
||||
['order', isAsc ? 'desc' : 'asc'],
|
||||
['orderBy', property],
|
||||
]);
|
||||
params?.setAppliedParams(parameters);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
loadDataTableData();
|
||||
}, [])
|
||||
}, [appliedParams, searchParams, order, orderBy, setSearchParams])
|
||||
|
||||
function SearchInput(props: any) {
|
||||
// SEARCH
|
||||
const searchInput = useRef<HTMLInputElement>(null);
|
||||
const [searchText, setSearchText] = useState('');
|
||||
|
||||
// Start Date
|
||||
// con
|
||||
|
||||
const handleSearchChange = (event: any) => {
|
||||
const newSearchText = event.target.value ?? '';
|
||||
setSearchText(newSearchText);
|
||||
};
|
||||
|
||||
const handleSearchSubmit = (event: any) => {
|
||||
event.preventDefault();
|
||||
props.onSearch({ search: searchText }); // Trigger to Parent
|
||||
};
|
||||
|
||||
|
||||
|
||||
const today = new Date(); // Default ke hari ini
|
||||
|
||||
const [startDate, setStartDate] = useState<Date | null>(today);
|
||||
const [endDate, setEndDate] = useState<Date | null>(today);
|
||||
|
||||
useEffect(() => {
|
||||
// Set nilai default saat pertama kali load jika searchParams kosong
|
||||
const paramStartDate = searchParams.get('start_date');
|
||||
const paramEndDate = searchParams.get('end_date');
|
||||
|
||||
if (paramStartDate) {
|
||||
setStartDate(new Date(paramStartDate));
|
||||
}
|
||||
if (paramEndDate) {
|
||||
setEndDate(new Date(paramEndDate));
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
// Trigger First Search
|
||||
setSearchText(searchParams.get('search') ?? '');
|
||||
}, []);
|
||||
|
||||
|
||||
return (
|
||||
<form onSubmit={handleSearchSubmit} style={{ width: '100%' }}>
|
||||
<TextField
|
||||
id="search-input"
|
||||
ref={searchInput}
|
||||
label="Search"
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
onChange={handleSearchChange}
|
||||
value={searchText}
|
||||
placeholder='Search Member Code or Member Name...'
|
||||
/>
|
||||
<form style={{ width: '100%' }}>
|
||||
<Grid container spacing={2} >
|
||||
<Grid item md={8}>
|
||||
<TextField
|
||||
id="search-input"
|
||||
ref={searchInput}
|
||||
label="Search"
|
||||
variant="outlined"
|
||||
fullWidth
|
||||
onChange={handleSearchChange}
|
||||
onKeyDown={(event) => {
|
||||
if (event.key === 'Enter') {
|
||||
// handleSearchSubmit(event);
|
||||
|
||||
const filter = Object.fromEntries([
|
||||
...searchParams.entries(),
|
||||
['search', searchText],
|
||||
]);
|
||||
setSearchParams(filter);
|
||||
loadDataTableData(filter);
|
||||
}
|
||||
}}
|
||||
value={searchText}
|
||||
placeholder='Search Code or Name...'
|
||||
/>
|
||||
</Grid>
|
||||
{/* Start Date */}
|
||||
<Grid item md={2}>
|
||||
<LocalizationProvider dateAdapter={AdapterDateFns}>
|
||||
<DesktopDatePicker
|
||||
label="Start Date"
|
||||
inputFormat="dd/MM/yyyy"
|
||||
value={startDate}
|
||||
onChange={(value) => {
|
||||
if (value) {
|
||||
setStartDate(value);
|
||||
const dateStr = fDateOnly(value);
|
||||
const filter = Object.fromEntries([...searchParams.entries(), ['start_date', dateStr]]);
|
||||
setSearchParams(filter);
|
||||
loadDataTableData(filter);
|
||||
}
|
||||
}}
|
||||
renderInput={(params) => <TextField {...params} variant="outlined" />}
|
||||
/>
|
||||
</LocalizationProvider>
|
||||
</Grid>
|
||||
|
||||
{/* End Date */}
|
||||
<Grid item md={2}>
|
||||
<LocalizationProvider dateAdapter={AdapterDateFns}>
|
||||
<DesktopDatePicker
|
||||
label="End Date"
|
||||
inputFormat="dd/MM/yyyy"
|
||||
value={endDate}
|
||||
onChange={(value) => {
|
||||
if (value) {
|
||||
setEndDate(value);
|
||||
const dateStr = fDateOnly(value);
|
||||
const filter = Object.fromEntries([...searchParams.entries(), ['end_date', dateStr]]);
|
||||
setSearchParams(filter);
|
||||
loadDataTableData(filter);
|
||||
}
|
||||
}}
|
||||
renderInput={(params) => <TextField {...params} variant="outlined" />}
|
||||
/>
|
||||
</LocalizationProvider>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</form>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function ImportForm(props: any) {
|
||||
// IMPORT
|
||||
@@ -110,6 +228,7 @@ export default function DailyMonitoringList() {
|
||||
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
||||
setAnchorEl(event.currentTarget);
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
setAnchorEl(null);
|
||||
};
|
||||
@@ -124,7 +243,8 @@ export default function DailyMonitoringList() {
|
||||
};
|
||||
|
||||
const handleCancelImportButton = () => {
|
||||
|
||||
importForm.current.value = '';
|
||||
importForm.current.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
};
|
||||
|
||||
const handleImportChange = (event: any) => {
|
||||
@@ -136,32 +256,146 @@ export default function DailyMonitoringList() {
|
||||
};
|
||||
|
||||
const handleUpload = () => {
|
||||
|
||||
if (importForm.current?.files.length) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', importForm.current?.files[0]);
|
||||
|
||||
setImportLoading(true);
|
||||
axios
|
||||
.post(`customer-service/request/import`, formData)
|
||||
.then((response) => {
|
||||
handleCancelImportButton();
|
||||
loadDataTableData();
|
||||
setImportResult(response.data);
|
||||
// alert('Succesfully read '+ response.data.total_successed_row + ' with ' + response.data.total_failed_row + ' failed rows');
|
||||
setImportLoading(false);
|
||||
})
|
||||
.catch((response) => {
|
||||
enqueueSnackbar(
|
||||
'Looks like something went wrong. Please check your data and try again. ' +
|
||||
response.message,
|
||||
{ variant: 'error' }
|
||||
);
|
||||
setImportLoading(false);
|
||||
});
|
||||
} else {
|
||||
enqueueSnackbar('No File Selected', { variant: 'warning' });
|
||||
}
|
||||
};
|
||||
|
||||
const handleGetTemplate = (type :string) => {
|
||||
|
||||
axios.get('corporates/import-document-example/' + type)
|
||||
.then((response) => {
|
||||
const link = document.createElement('a');
|
||||
link.href = response.data.data.file_url;
|
||||
link.setAttribute('download', response.data.data.file_name);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
handleClose();
|
||||
})
|
||||
}
|
||||
|
||||
const handleGetData = (type :string) => {
|
||||
|
||||
}
|
||||
|
||||
const navigate = useNavigate()
|
||||
|
||||
return (
|
||||
<div>
|
||||
<input
|
||||
type="file"
|
||||
id="file"
|
||||
ref={importForm}
|
||||
style={{ display: 'none' }}
|
||||
onChange={handleImportChange}
|
||||
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel, text/plain"
|
||||
/>
|
||||
{!currentImportFileName && (
|
||||
<Stack direction={'row'} spacing={2} sx={{ p: 2 }}>
|
||||
<SearchInput onSearch={applyFilter} />
|
||||
{/* <Button
|
||||
variant="contained"
|
||||
startIcon={<AddIcon />}
|
||||
sx={{ p: 1.8 }}
|
||||
onClick={() => {
|
||||
navigate('/claim-requests/create');
|
||||
}}
|
||||
<Button
|
||||
id="import-button"
|
||||
startIcon={<DownloadIcon />}
|
||||
sx={{ p: 1.8, color: '#FFFFFF', backgroundColor: '#19BBBB', width: '125px', height: '48px' }}
|
||||
aria-controls={createMenu ? 'basic-menu' : undefined}
|
||||
aria-haspopup="true"
|
||||
aria-expanded={createMenu ? 'true' : undefined}
|
||||
onClick={handleClick}
|
||||
>
|
||||
Create
|
||||
</Button> */}
|
||||
</Button>
|
||||
<Menu
|
||||
id="import-button"
|
||||
anchorEl={anchorEl}
|
||||
open={createMenu}
|
||||
onClose={handleClose}
|
||||
MenuListProps={{
|
||||
'aria-labelledby': 'basic-button',
|
||||
}}
|
||||
>
|
||||
<MenuItem onClick={handleImportButton}>
|
||||
<Typography variant='body2'>Import</Typography>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
handleGetTemplate('member');
|
||||
}}
|
||||
>
|
||||
<Typography variant='body2'> Download Template</Typography>
|
||||
</MenuItem>
|
||||
<MenuItem onClick={() => navigate(`/case_management/daily_monitoring/add_monitoring`)}>
|
||||
<Typography variant='body2'>Tambah</Typography>
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</Stack>
|
||||
)}
|
||||
|
||||
{currentImportFileName && (
|
||||
<Stack direction={'row'} spacing={2} sx={{ p: 2 }}>
|
||||
<ButtonGroup variant="outlined" aria-label="outlined button group" fullWidth>
|
||||
<Button onClick={handleImportButton} fullWidth>
|
||||
{currentImportFileName ?? 'No File Selected'}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={handleCancelImportButton}
|
||||
size="small"
|
||||
fullWidth={false}
|
||||
sx={{ p: 1.8 }}
|
||||
>
|
||||
<CancelIcon color="error" />
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
|
||||
<LoadingButton
|
||||
id="upload-button"
|
||||
variant="outlined"
|
||||
startIcon={<UploadIcon />}
|
||||
sx={{ p: 1.8 }}
|
||||
onClick={handleUpload}
|
||||
loading={importLoading}
|
||||
>
|
||||
Upload
|
||||
</LoadingButton>
|
||||
</Stack>
|
||||
)}
|
||||
|
||||
{importResult && (
|
||||
<Stack direction={'row'} sx={{ px: 2, pb: 2 }}>
|
||||
<Box sx={{ color: 'text.secondary' }}>
|
||||
Last Import Result :{' '}
|
||||
<Box sx={{ color: 'success.main', display: 'inline' }}>
|
||||
{importResult.total_success_row ?? 0}
|
||||
</Box>{' '}
|
||||
Row Processed,{' '}
|
||||
<Box sx={{ color: 'error.main', display: 'inline' }}>
|
||||
{importResult.total_failed_row}
|
||||
</Box>{' '}
|
||||
Failed, Report :{' '}
|
||||
<a href={importResult.result_file?.url ?? '#'}>
|
||||
{importResult.result_file?.name ?? '-'}
|
||||
</a>
|
||||
</Box>
|
||||
</Stack>
|
||||
)}
|
||||
</div>
|
||||
@@ -175,12 +409,19 @@ export default function DailyMonitoringList() {
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell style={TableHeadStyle} align="left" width={50} />
|
||||
<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}>Start Date</TableCell>
|
||||
<TableCell style={TableHeadStyle} align="left" width={160}>End Date</TableCell>
|
||||
<TableCell style={TableHeadStyle} align="left" width={160}>Admission Date</TableCell>
|
||||
<TableCell style={TableHeadStyle} align="left" width={160}>Provider</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>
|
||||
|
||||
@@ -21,6 +21,7 @@ import TableMoreMenu from '@/components/table/TableMoreMenu';
|
||||
*/
|
||||
import { fDate } from "@/utils/formatTime";
|
||||
import { DailyMonitoringListType } from "../Model/Types";
|
||||
import { Edit } from "@mui/icons-material";
|
||||
|
||||
type Props = {
|
||||
row: DailyMonitoringListType,
|
||||
@@ -29,12 +30,20 @@ type Props = {
|
||||
|
||||
export default function DailyMonitoringListRow ({ ...props }: Props) {
|
||||
const navigate = useNavigate()
|
||||
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
|
||||
<TableRow hover sx={{ '& > td': { borderBottom: '1' } }}>
|
||||
<TableCell align="left" />
|
||||
<TableCell align="left">
|
||||
<Label
|
||||
variant="ghost"
|
||||
color="default"
|
||||
>
|
||||
{props.row.addmision_date ? fDate(props.row.addmision_date) : '-'}
|
||||
</Label>
|
||||
</TableCell>
|
||||
<TableCell align="left">{props.row.member_id}</TableCell>
|
||||
<TableCell align="left">{props.row.name}</TableCell>
|
||||
<TableCell align="left">
|
||||
@@ -42,34 +51,44 @@ export default function DailyMonitoringListRow ({ ...props }: Props) {
|
||||
variant="ghost"
|
||||
color="default"
|
||||
>
|
||||
{fDate(props.row.start_date)}
|
||||
{props.row.birth_date ? fDate(props.row.birth_date) : '-'}
|
||||
</Label>
|
||||
</TableCell>
|
||||
<TableCell align="left">
|
||||
<Label
|
||||
variant="ghost"
|
||||
color="default"
|
||||
>
|
||||
{fDate(props.row.end_date)}
|
||||
</Label>
|
||||
{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">
|
||||
<Label
|
||||
variant="ghost"
|
||||
color="default"
|
||||
>
|
||||
{fDate(props.row.addmision_date)}
|
||||
</Label>
|
||||
{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="left">{props.row.provider}</TableCell>
|
||||
<TableCell align="right" onClick={(e) => e.stopPropagation()}>
|
||||
<Stack direction="row" justifyContent="flex-end" spacing={1}>
|
||||
<TableMoreMenu actions={
|
||||
<>
|
||||
<MenuItem onClick={() => navigate(`/case_management/daily_monitoring/${props.row.member_id}/${props.row.organization_id}/claims`)}>
|
||||
<MenuItem onClick={() => navigate(`/case_management/daily_monitoring/${props.row.member_id}/claims/${props.row.code}/list_monitoring`)}>
|
||||
<Visibility />
|
||||
View
|
||||
</MenuItem>
|
||||
<MenuItem onClick={() => navigate(`/case_management/daily_monitoring/${props.row.member_id}/claims/${props.row.code}/${props.row.id}`)}>
|
||||
<Edit />
|
||||
Edit
|
||||
</MenuItem>
|
||||
</>
|
||||
} />
|
||||
</Stack>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { useFieldArray, useForm } from 'react-hook-form';
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
import { Box, IconButton, Typography, Grid, Card, Button, ButtonBase, Stack, Autocomplete } from '@mui/material';
|
||||
import { Box, IconButton, Typography, Grid, Card, Button, ButtonBase, Stack, Autocomplete, CircularProgress } from '@mui/material';
|
||||
import { LoadingButton } from "@mui/lab";
|
||||
|
||||
/**
|
||||
@@ -28,41 +28,41 @@ import InsertDriveFileIcon from '@mui/icons-material/InsertDriveFile';
|
||||
* Utils, Types, Functions
|
||||
* ============================================
|
||||
*/
|
||||
import { AddMonitoringDetail, UpdateMonitoringDetail, getMonitoringDetailById, getMonitoringDetailList, getMonitorungDetailById, getOrganizationId } from '../Model/Functions';
|
||||
import { AddMonitoringDetail, UpdateMonitoringDetail, getMonitoringDetailById, getOrganizationId } from '../Model/Functions';
|
||||
import { DetailMonitoringListType} from '../Model/Types';
|
||||
import FormCreateFilesUpload from '@/pages/CustomerService/FinalLog/Components/FormCreateFilesUpload';
|
||||
import MultiFilePreview from '@/components/upload/MultiFilePreview';
|
||||
import Iconify from '@/components/Iconify';
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { TextField } from '@mui/material';
|
||||
import axios from "@/utils/axios";
|
||||
|
||||
type Detail = {
|
||||
row : DetailMonitoringListType|undefined
|
||||
}
|
||||
|
||||
export default function DetailMonitoringList() {
|
||||
const { member_id, claim_code, id} = useParams();
|
||||
const { member_id, id} = useParams();
|
||||
const [organizationId, setOrganizationId] = useState<number|undefined>();
|
||||
const [isEdit, setIsEdit] = useState<boolean|undefined>(false);
|
||||
const [data, setData] = useState<DetailMonitoringListType>();
|
||||
|
||||
const navigate = useNavigate()
|
||||
const pageTitle = claim_code??'_ _ _ _';
|
||||
const fileInput1 = useRef<HTMLInputElement>(null);
|
||||
const fileInput2 = useRef<HTMLInputElement>(null);
|
||||
const fileInput3 = useRef<HTMLInputElement>(null);
|
||||
|
||||
const loadOrganizationID = async () => {
|
||||
const organization_id = await getOrganizationId(claim_code??'');
|
||||
setOrganizationId(organization_id);
|
||||
}
|
||||
// const loadOrganizationID = async () => {
|
||||
// const organization_id = await getOrganizationId('');
|
||||
// setOrganizationId(organization_id);
|
||||
// }
|
||||
const loadDetailDailyMonitoring = async () => {
|
||||
const monitoring = await getMonitoringDetailById(id??'')
|
||||
const monitoring = await getMonitoringDetailById('')
|
||||
setData(monitoring)
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
loadOrganizationID();
|
||||
// loadOrganizationID();
|
||||
if (id){
|
||||
loadDetailDailyMonitoring();
|
||||
setIsEdit(true)
|
||||
@@ -75,7 +75,15 @@ export default function DetailMonitoringList() {
|
||||
const defaultValues = useMemo(
|
||||
() => ({
|
||||
id : data?.id ??'',
|
||||
claim_code : data?.claim_code ?? '',
|
||||
// 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 ?? '',
|
||||
@@ -188,7 +196,6 @@ export default function DetailMonitoringList() {
|
||||
arr_result.push(event.target.files[0]);
|
||||
|
||||
setValue('result', arr_result)
|
||||
console.log('test3')
|
||||
}
|
||||
else {
|
||||
console.log('NO FILE');
|
||||
@@ -230,35 +237,70 @@ export default function DetailMonitoringList() {
|
||||
// =====================================
|
||||
const submitHandler = async (data: DetailMonitoringListType) => {
|
||||
|
||||
const response = isEdit ? await UpdateMonitoringDetail(data) : await AddMonitoringDetail(claim_code??'', data);
|
||||
const response = isEdit ? await UpdateMonitoringDetail(data) : await AddMonitoringDetail('', data);
|
||||
|
||||
if (response == true) {
|
||||
reset();
|
||||
if (isEdit) {
|
||||
navigate('/case_management/daily_monitoring/'+member_id+'/claims/'+claim_code+'/list_monitoring', { replace: true });
|
||||
navigate('/case_management/daily_monitoring', { replace: true });
|
||||
} else {
|
||||
navigate('/case_management/daily_monitoring/'+member_id+'/'+organizationId+'/claims', { replace: true });
|
||||
navigate('/case_management/daily_monitoring', { replace: true });
|
||||
}
|
||||
// window.location.reload()
|
||||
}
|
||||
}
|
||||
|
||||
const [selectedReason, setSelectedReason] = useState({value:'-', label:''});
|
||||
const [selectedCode, setSelectedCode] = useState({value:'-', label:''});
|
||||
const reasons = [
|
||||
{ value: 'Wrong Setting', label: 'Wrong Setting' },
|
||||
{ value: 'Hospital Request', label: 'Hospital Request' }
|
||||
];
|
||||
|
||||
const [codes, setCodes] = useState([{ value: '-', label: '-' }]); // Data hasil pencarian
|
||||
const [searchTerm, setSearchTerm] = useState(''); // Nilai input pencarian
|
||||
|
||||
|
||||
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
|
||||
useEffect(() => {
|
||||
const fetchCodes = async () => {
|
||||
if (searchTerm.length > 2) { // Hanya fetch jika input lebih dari 2 karakter
|
||||
try {
|
||||
const response = await axios.get(`codeLog?search=${searchTerm}`);
|
||||
setCodes(response.data.data);
|
||||
} catch (error) {
|
||||
console.error('Error fetching codes:', error);
|
||||
setCodes([]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const debounceFetch = setTimeout(fetchCodes, 500); // Debounce 500ms
|
||||
return () => clearTimeout(debounceFetch);
|
||||
}, [searchTerm]);
|
||||
const [searchCode, setSearchCode] = useState('');
|
||||
|
||||
const [error, setError] = useState(true);
|
||||
|
||||
return (
|
||||
<Page title={pageTitle}>
|
||||
<Page title=''>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', pl: '22px', mb: '40px' }}>
|
||||
<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>
|
||||
|
||||
<Typography variant="h5" sx={{ marginLeft: '24px' }}>
|
||||
{pageTitle}
|
||||
Tambah Daily Monitoring
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
@@ -269,6 +311,43 @@ export default function DetailMonitoringList() {
|
||||
{/* Date */}
|
||||
<Grid item xs={12}>
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" component="div">
|
||||
Code Letter of Guarantee* :
|
||||
</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
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" component="div">
|
||||
Date* :
|
||||
@@ -285,6 +364,72 @@ export default function DetailMonitoringList() {
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
{/* Doctor 1 */}
|
||||
<Grid item xs={12}>
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" component="div">
|
||||
Dokter 1
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<RHFTextField
|
||||
id="doctor_1"
|
||||
name='doctor_1'
|
||||
placeholder='Dokter 1'
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" component="div">
|
||||
Dokter 2
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<RHFTextField
|
||||
id="doctor_2"
|
||||
name='doctor_2'
|
||||
placeholder='Dokter 2'
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" component="div">
|
||||
Temp Diagnosis
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<RHFTextField
|
||||
id="temp_diagnosis"
|
||||
name='temp_diagnosis'
|
||||
placeholder='Temp Diagnosis'
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" component="div">
|
||||
Final Diagnosis
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<RHFTextField
|
||||
id="final_diagnosis"
|
||||
name='final_diagnosis'
|
||||
placeholder='Final Diagnosis'
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" component="div">
|
||||
Approval Pendamping
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<RHFTextField
|
||||
id="approval_pendamping"
|
||||
name='approval_pendamping'
|
||||
placeholder='Approval Pendamping'
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
{/* Subject */}
|
||||
<Grid item xs={12}>
|
||||
<Grid container spacing={3}>
|
||||
@@ -562,6 +707,28 @@ export default function DetailMonitoringList() {
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
{/* Keterangan dan Catatan */}
|
||||
<Grid item xs={12}>
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" component="div">
|
||||
Keterangan
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<RHFEditor id="keterangan" name="keterangan" placeholder="Keterangan"/>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body1" component="div">
|
||||
Catatan
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<RHFEditor id="catatan" name="catatan" placeholder="Catatan"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
{/* Confirmation Medical Letter */}
|
||||
<Grid item xs={12}>
|
||||
<Grid container spacing={3}>
|
||||
@@ -673,7 +840,7 @@ export default function DetailMonitoringList() {
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
|
||||
{/* Laboratorium */}
|
||||
<Grid item xs={12}>
|
||||
<Grid container spacing={3}>
|
||||
@@ -823,7 +990,7 @@ export default function DetailMonitoringList() {
|
||||
<Grid item xs={12} md={12}>
|
||||
<Box display="flex" justifyContent={'flex-end'}>
|
||||
<Box display="flex" gap={1}>
|
||||
<Button variant="outlined" color="inherit" onClick={() => isEdit ? navigate(`/case_management/daily_monitoring/${member_id}/claims/${claim_code}/list_monitoring`) : navigate(`/case_management/daily_monitoring/${member_id}/${organizationId}/claims`)}>
|
||||
<Button variant="outlined" color="inherit" onClick={() => navigate(`/case_management/daily_monitoring`)}>
|
||||
Cancel
|
||||
</Button>
|
||||
<LoadingButton disabled={ isEdit ? error : !isDirty} type="submit" variant="contained" loading={isSubmitting}>
|
||||
|
||||
@@ -56,7 +56,7 @@ export default function DetailMonitoringList() {
|
||||
// Use Effect
|
||||
// --------------------
|
||||
useEffect(() => {
|
||||
loadDataTableData();
|
||||
// loadDataTableData();
|
||||
}, [])
|
||||
|
||||
// Dialog
|
||||
@@ -165,13 +165,13 @@ 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) => {
|
||||
return (
|
||||
|
||||
@@ -51,7 +51,7 @@ export const AddMonitoringDetail = async ( claim_code: string,data: DetailMonito
|
||||
|
||||
const formData = makeFormData({...data});
|
||||
|
||||
const response = await axios.post(`/case_management/daily_monitoring/detail/${claim_code}/add-request`, formData)
|
||||
const response = await axios.post(`/case_management/daily_monitoring/add-request`, formData)
|
||||
.then((res) =>{
|
||||
enqueueSnackbar(res.data.message, {
|
||||
variant: 'success',
|
||||
|
||||
@@ -3,12 +3,21 @@
|
||||
*/
|
||||
export type DailyMonitoringListType = {
|
||||
member_id : string,
|
||||
member_type : string,
|
||||
birth_date : string,
|
||||
name : string,
|
||||
start_date : string,
|
||||
end_date : string,
|
||||
addmision_date : string,
|
||||
provider : string,
|
||||
organization_id : number,
|
||||
start_date : string,
|
||||
end_date : string,
|
||||
description : string,
|
||||
doctor_1 : string,
|
||||
doctor_2 : string,
|
||||
temp_diagnosis : string,
|
||||
final_diagnosis : string,
|
||||
approval_pendamping : string,
|
||||
note : string,
|
||||
addmision_date : string,
|
||||
provider : string,
|
||||
organization_id : number,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -50,7 +59,15 @@ export type ClaimListType = {
|
||||
export type DetailMonitoringListType = {
|
||||
id : number|null,
|
||||
claim_id : string|null,
|
||||
log_code : string|null,
|
||||
claim_code : string|undefined,
|
||||
doctor_1 : string|undefined,
|
||||
doctor_2 : string|undefined,
|
||||
temp_diagnosis : string|undefined,
|
||||
final_diagnosis : string|undefined,
|
||||
approval_pendamping : string|undefined,
|
||||
keterangan : string|undefined,
|
||||
catatan : string|undefined,
|
||||
subject : string|undefined,
|
||||
object : string|undefined,
|
||||
objective : string|undefined,
|
||||
|
||||
@@ -233,6 +233,10 @@ export default function Router() {
|
||||
path: 'daily_monitoring/:member_id/claims/:claim_code/add_monitoring',
|
||||
element: <DetailMonitoringForm />
|
||||
},
|
||||
{
|
||||
path: 'daily_monitoring/add_monitoring',
|
||||
element: <DetailMonitoringForm />
|
||||
},
|
||||
{
|
||||
path: 'daily_monitoring/:member_id/claims/:claim_code/:id',
|
||||
element: <DetailMonitoringForm />
|
||||
|
||||
Reference in New Issue
Block a user