diff --git a/frontend/dashboard/src/layouts/dashboard/navbar/NavConfig.tsx b/frontend/dashboard/src/layouts/dashboard/navbar/NavConfig.tsx index af7799b5..b6ea734b 100644 --- a/frontend/dashboard/src/layouts/dashboard/navbar/NavConfig.tsx +++ b/frontend/dashboard/src/layouts/dashboard/navbar/NavConfig.tsx @@ -76,6 +76,7 @@ const navConfig = [ title: 'CASE MANAGEMENT', children: [ { title: 'Daily Monitoring', path: '/case_management/daily_monitoring' }, + { title: 'Laboratorium Result', path: '/case_management/laboratorium_result' }, ], }, { diff --git a/frontend/dashboard/src/pages/CaseManagement/DailyMonitoring/Components/ClaimList.tsx b/frontend/dashboard/src/pages/CaseManagement/DailyMonitoring/Components/ClaimList.tsx index cc9d7c5f..b9363926 100644 --- a/frontend/dashboard/src/pages/CaseManagement/DailyMonitoring/Components/ClaimList.tsx +++ b/frontend/dashboard/src/pages/CaseManagement/DailyMonitoring/Components/ClaimList.tsx @@ -2,7 +2,6 @@ * Core * ============================================ */ -import { useEffect, useState } from "react"; import { Box, Paper, TableContainer, Table, TableHead, TableRow, TableCell, TableBody } from "@mui/material"; /** diff --git a/frontend/dashboard/src/pages/CaseManagement/DailyMonitoring/index.tsx b/frontend/dashboard/src/pages/CaseManagement/DailyMonitoring/index.tsx index d0ed4b43..fb989405 100644 --- a/frontend/dashboard/src/pages/CaseManagement/DailyMonitoring/index.tsx +++ b/frontend/dashboard/src/pages/CaseManagement/DailyMonitoring/index.tsx @@ -31,7 +31,7 @@ export default function DailyMonitoring() { href: '/dashboard', }, { - name: 'Daily Monitoring', + name: pageTitle, href: '/case_management/daily_monitoring', }, ]} diff --git a/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Claim.tsx b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Claim.tsx new file mode 100644 index 00000000..0388bc25 --- /dev/null +++ b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Claim.tsx @@ -0,0 +1,73 @@ +/** + * Core + * ============================================ + */ +import { useEffect, useState } from 'react'; +import { useNavigate, useParams } from 'react-router-dom'; +import { Box, Grid, IconButton, Typography } from '@mui/material'; +import { ArrowBackIosNew } from '@mui/icons-material'; + +/** + * Components + * ============================================ +*/ +// - Global - +import Page from '../../../components/Page'; +// - Local - + +/** + * Utils, Types, Functions + * ============================================ + */ +import { getClaimList } from './Model/Functions'; +import { ClaimListType, MemberDetailType } from './Model/Types'; +import ClaimList from './Components/ClaimList'; + +export default function Claim() { + const navigate = useNavigate() + const { member_id } = useParams(); + + // State + // -------------------- + const [memberDetail, setMemberDetail] = useState(); + const [claimList, setClaimList] = useState(); + + // Use Effect + // -------------------- + useEffect(() => { + loadDataTableData(); + }, []) + + // Load Data + // ------------------- + const loadDataTableData = async () => { + const response = await getClaimList(member_id??''); + + setMemberDetail(response.member_detail); + setClaimList(response.claim_list); + } + + return ( + + + {/* back button */} + + + navigate(`/case_management/laboratorium_result`)} > + + + + + {memberDetail?.name??'_ _ _'} + + + + + {/* tabel claims */} + + + + + + ); +} diff --git a/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Components/ClaimList.tsx b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Components/ClaimList.tsx new file mode 100644 index 00000000..b9363926 --- /dev/null +++ b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Components/ClaimList.tsx @@ -0,0 +1,79 @@ +/** + * Core + * ============================================ + */ +import { Box, Paper, TableContainer, Table, TableHead, TableRow, TableCell, TableBody } from "@mui/material"; + +/** + * Component + * ============================================ + */ +import ClaimListRow from "./ClaimListRow"; + +/** + * Types & Functions + * ============================================ + */ +import { ClaimListType } from "../Model/Types"; + +type Props = { + claim_list: ClaimListType[] | null, +} + +export default function ClaimList({ ...props }: Props) { + // Tabel Style + // -------------------- + const TableHeadStyle = { + fontWeight: 'bold', + }; + + return ( + + + + {/* Head Table */} + + + + Admission Date + Discharge Date + Code + Service Type + Status + + + + + {/* Body Table */} + {props.claim_list == null ? + ( + + + Loading + + + ) + : + ( + props.claim_list.length == 0 ? + ( + + + No Data + + + ) + : + ( + + {props.claim_list.map((row: ClaimListType, index) => ( + + ))} + + ) + )} +
+
+
+ ) +} diff --git a/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Components/ClaimListRow.tsx b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Components/ClaimListRow.tsx new file mode 100644 index 00000000..60b633ff --- /dev/null +++ b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Components/ClaimListRow.tsx @@ -0,0 +1,88 @@ +/** + * Core + * ============================================ + */ +import React, { useState } from "react"; +import { useNavigate } from "react-router"; +import { Box, Collapse, MenuItem, TableCell, TableRow, Stack } from "@mui/material"; +import Visibility from '@mui/icons-material/Visibility'; +import AddIcon from '@mui/icons-material/Add'; + +/** + * Component + * ============================================ + */ +// - Global - +import Label from "@/components/Label"; +import TableMoreMenu from '@/components/table/TableMoreMenu'; + +/** + * Utils, Types, Functions + * ============================================ + */ +import { fDate } from "@/utils/formatTime"; +import { ClaimListType } from "../Model/Types"; + +type Props = { + row: ClaimListType, + number: number +} + +export default function ClaimListRow ({ ...props }: Props) { + const navigate = useNavigate() + + return ( + + + td': { borderBottom: '1' } }}> + + + {props.row.admission_dates == "0000-00-00 00:00:00" ? + ('-') + : + ( + + )} + + + {props.row.discharge_dates == "0000-00-00 00:00:00" ? + ('-') + : + ( + + )} + + {props.row.claim_code} + {props.row.service_type} + {props.row.claim_status} + e.stopPropagation()}> + + + navigate(`/case_management/laboratorium_result/${props.row.member_id}/claims/${props.row.claim_code}/list_lab_result`)}> + + View + + navigate(`/case_management/laboratorium_result/${props.row.member_id}/claims/${props.row.claim_code}/add_lab_result`)}> + + Daily Monitoring + + + } /> + + + + + + ); +} diff --git a/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Components/LaboratoriumResultList.tsx b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Components/LaboratoriumResultList.tsx new file mode 100644 index 00000000..accfc853 --- /dev/null +++ b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Components/LaboratoriumResultList.tsx @@ -0,0 +1,93 @@ +/** + * Core + * ============================================ + */ +import { useEffect, useState } from "react"; +import { Box, Paper, TableContainer, Table, TableHead, TableRow, TableCell, TableBody } from "@mui/material"; + +/** + * Types & Functions + * ============================================ + */ +import { getDailyMonitoringList } from "../Model/Functions"; +import { LaboratoriumResultListType } from "../Model/Types"; +import LaboratoriumListRow from "./LaboratoriumResultListRow"; + +export default function LaboratoriumResultList() { + // State + // -------------------- + const [dataTableIsLoading, setDataTableLoading] = useState(true); + const [dataTableData, setDataTableData] = useState([]); + + // Tabel Style + // -------------------- + const TableHeadStyle = { + fontWeight: 'bold', + }; + + // Use Effect + // -------------------- + useEffect(() => { + loadDataTableData(); + }, []) + + // Load Data + // ------------------- + const loadDataTableData = async () => { + setDataTableLoading(true); + + const response = await getDailyMonitoringList(); + + setDataTableLoading(false); + setDataTableData(response); + } + + return ( + + + + {/* Head Table */} + + + + Member ID + Name + Start Date + End Date + + + + + {/* Body Table */} + {dataTableIsLoading ? + ( + + + Loading + + + ) + : + ( + dataTableData.length == 0 ? + ( + + + No Data + + + ) + : + ( + + {dataTableData.map((row: LaboratoriumResultListType, index) => ( + + ))} + + ) + )} +
+
+
+ ) +} diff --git a/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Components/LaboratoriumResultListRow.tsx b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Components/LaboratoriumResultListRow.tsx new file mode 100644 index 00000000..00c482de --- /dev/null +++ b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Components/LaboratoriumResultListRow.tsx @@ -0,0 +1,72 @@ +/** + * Core + * ============================================ + */ +import React, { useState } from "react"; +import { useNavigate } from "react-router"; +import { Box, Collapse, MenuItem, TableCell, TableRow, Stack } from "@mui/material"; +import Visibility from '@mui/icons-material/Visibility'; + +/** + * Component + * ============================================ + */ +// - Global - +import Label from "@/components/Label"; +import TableMoreMenu from '@/components/table/TableMoreMenu'; + +/** + * Utils, Types, Functions + * ============================================ + */ +import { fDate } from "@/utils/formatTime"; +import { LaboratoriumResultListType } from "../Model/Types"; + +type Props = { + row: LaboratoriumResultListType, + number: number +} + +export default function LaboratoriumResultListRow ({ ...props }: Props) { + const navigate = useNavigate() + + return ( + + + td': { borderBottom: '1' } }}> + + {props.row.member_id} + {props.row.name} + + + + + + + e.stopPropagation()}> + + + navigate(`/case_management/laboratorium_result/${props.row.member_id}/claims`)}> + + View + + + } /> + + + + + + ); +} diff --git a/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Model/Functions.ts b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Model/Functions.ts new file mode 100644 index 00000000..cb4c94cb --- /dev/null +++ b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Model/Functions.ts @@ -0,0 +1,41 @@ +import axios from '@/utils/axios'; +import { enqueueSnackbar } from 'notistack'; +import { LaboratoriumResultListType, ResponseListingClaimType } from "./Types"; + +/** + * Listing Daily Monitoring + */ +export const getDailyMonitoringList = async ( ): Promise => { + const response = await axios.get('/case_management/daily_monitoring/memberlist') + .then((res) =>{ + return res.data.data.member_list; + }) + .catch((res) => { + enqueueSnackbar("server error !", { + variant: 'error', + }); + + return []; + }); + + return response; +}; + +/** + * Listing Claim + */ +export const getClaimList = async ( member_id: string ): Promise => { + const response = await axios.get(`/case_management/daily_monitoring/claimlist/${member_id}`) + .then((res) =>{ + return res.data.data; + }) + .catch((res) => { + enqueueSnackbar("server error !", { + variant: 'error', + }); + + return null; + }); + + return response; +}; diff --git a/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Model/Types.ts b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Model/Types.ts new file mode 100644 index 00000000..701231a7 --- /dev/null +++ b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/Model/Types.ts @@ -0,0 +1,39 @@ +/** + * List Laboratorium + */ +export type LaboratoriumResultListType = { + member_id : string, + name : string, + startdate : string, + enddate : string, +} + +/** + * Response Listing Claim + */ +export type ResponseListingClaimType = { + member_detail : MemberDetailType, + claim_list : ClaimListType[], +} + +/** + * Member Detail + */ +export type MemberDetailType = { + id : string, + member_id : string, + name : string, +} + +/** + * List Claim + */ +export type ClaimListType = { + claim_id : number, + admission_dates : string, + discharge_dates : string, + claim_code : string, + claim_status : string, + service_type : string, + member_id : string +} diff --git a/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/index.tsx b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/index.tsx new file mode 100644 index 00000000..f5e676bd --- /dev/null +++ b/frontend/dashboard/src/pages/CaseManagement/LaboratoriumResult/index.tsx @@ -0,0 +1,48 @@ +/** + * Core + * ============================================ + */ +import { Box, Grid } from '@mui/material'; + +/** + * Components + * ============================================ +*/ +// - Global - +import Page from '../../../components/Page'; +import HeaderBreadcrumbs from "../../../components/HeaderBreadcrumbs"; +// - Local - +import LaboratoriumResultList from './Components/LaboratoriumResultList'; + +export default function LaboratoriumResult() { + const pageTitle = "Laboratorium Result"; + + return ( + + + {/* page header */} + + + + + {/* tabel daily monitoring */} + + + + + + ); +} diff --git a/frontend/dashboard/src/routes/index.tsx b/frontend/dashboard/src/routes/index.tsx index a6680391..71a087a2 100644 --- a/frontend/dashboard/src/routes/index.tsx +++ b/frontend/dashboard/src/routes/index.tsx @@ -221,7 +221,7 @@ export default function Router() { element: '', children: [ { - path: 'daily_monitoring', + path: 'daily_monitoring', // Daily Monitoring element: }, { @@ -236,6 +236,14 @@ export default function Router() { path: 'daily_monitoring/:member_id/claims/:claim_code/list_monitoring', element: }, + { + path: 'laboratorium_result', // Laboratorium Result + element: + }, + { + path: 'laboratorium_result/:member_id/claims', + element: + }, ] }, { @@ -561,6 +569,9 @@ const DailyMonitoring = Loadable(lazy(() => import('../pages/CaseManagemen const DailyMonitoringClaims = Loadable(lazy(() => import('../pages/CaseManagement/DailyMonitoring/Claim'))) const DetailMonitoringForm = Loadable(lazy(() => import('../pages/CaseManagement/DailyMonitoring/Components/DetailMonitoringForm'))) const DetailMonitoringList = Loadable(lazy(() => import('../pages/CaseManagement/DailyMonitoring/Components/DetailMonitoringList'))) +// Laboratorium Result +const LaboratoriumResult = Loadable(lazy(() => import('../pages/CaseManagement/LaboratoriumResult/index'))) +const LaboratoriumResultClaims = Loadable(lazy(() => import('../pages/CaseManagement/LaboratoriumResult/Claim'))) const MasterDiagnosisTemplate = Loadable(lazy(() => import('../pages/Master/Diagnosis/Master/Index'))); const MasterDiagnosisTemplateCreate = Loadable(lazy(() => import('../pages/Master/Diagnosis/Master/CreateUpdate')));