filter dan flag file di inpatient monitoring

This commit is contained in:
2024-10-16 10:52:29 +07:00
parent a436f8550b
commit 0ab8ec85d3

View File

@@ -15,9 +15,12 @@ import {
Stack,
Menu,
ButtonGroup,
FormControl,
Select,
Link,
Chip,
TableHead,
InputLabel,
Grid,
} from '@mui/material';
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
@@ -61,6 +64,13 @@ export default function List() {
const navigate = useNavigate()
const fileOptions = {
kondisi: 'Dokumen Billing',
diagnosa: 'Dokumen Diagnosa',
result: 'Dokumen Penduk Medis',
none: 'Belum ada Dokumen'
};
function SearchInput(props: any) {
// SEARCH
const searchInput = useRef<HTMLInputElement>(null);
@@ -199,15 +209,48 @@ export default function List() {
/>
{!currentImportFileName && (
<Stack direction={'row'} spacing={2} sx={{ p: 2 }}>
<SearchInput onSearch={applyFilter} />
<Button
variant="outlined"
startIcon={<UploadIcon />}
sx={{ p: 1.8 }}
onClick={handleClick}
>
Import
</Button>
<Grid item md={9}>
<SearchInput onSearch={applyFilter} />
</Grid>
<Grid item md={2}>
<FormControl fullWidth>
<InputLabel>File</InputLabel>
<Select
value={searchParams.get('file') ?? 'semua'} // Pastikan menggunakan kunci 'file'
label="File"
onChange={(el) => {
const selectedValue = el.target.value;
const filter = Object.fromEntries(searchParams.entries());
if (selectedValue === 'semua') {
delete filter.file; // Menghapus filter 'file' jika memilih 'semua'
} else {
filter.file = selectedValue; // Menambahkan atau memperbarui filter 'file'
}
setSearchParams(filter); // Update state searchParams
loadDataTableData(filter); // Memuat data sesuai filter
}}
>
<MenuItem value={'semua'}>Semua</MenuItem>
{Object.entries(fileOptions).map((option, index) => (
<MenuItem value={option[0]} key={index}>
{option[1]}
</MenuItem>
))}
</Select>
</FormControl>
</Grid>
<Grid item md={1}>
<Button
variant="outlined"
startIcon={<UploadIcon />}
sx={{ p: 1.8 }}
onClick={handleClick}
>
Import
</Button>
</Grid>
<Menu
id="import-button"
anchorEl={anchorEl}
@@ -353,6 +396,31 @@ export default function List() {
<TableCell align="left"><Label>{fDateTimesecond(row.admission_date)}</Label></TableCell>
<TableCell align="left">{row.service_name}</TableCell>
<TableCell align="left">{row.payment_type_name}</TableCell>
<TableCell align="left">
{row.files_by_type?.final_log_diagnosis?.length > 0 && (
<>
<Label variant='ghost' color='primary'>
{row.files_by_type.final_log_diagnosis.length} File Diagnosa
</Label>
<br />
</>
)}
{row.files_by_type?.final_log_kondisi?.length > 0 && (
<>
<Label variant='ghost' color='success'>
{row.files_by_type.final_log_kondisi.length} File Billing
</Label>
<br />
</>
)}
{row.files_by_type?.final_log_result?.length > 0 && (
<Label variant='ghost' color='warning'>
{row.files_by_type.final_log_result.length} File Pendukung Medis
</Label>
)}
</TableCell>
<TableCell align="left">
{ row.status_final_log == "requested" ?
(<Label variant='ghost' color='primary'>{capitalizeFirstLetter(row.status_final_log)}</Label>) :
@@ -500,6 +568,9 @@ export default function List() {
<TableCell style={headStyle} align="left">
Claim Method
</TableCell>
<TableCell style={headStyle} align="left">
File Upload
</TableCell>
<TableCell style={headStyle} align="left">
Status
</TableCell>