diff --git a/Modules/HospitalPortal/Http/Controllers/Api/RequestLogController.php b/Modules/HospitalPortal/Http/Controllers/Api/RequestLogController.php
index a5a2a6e8..760103ed 100644
--- a/Modules/HospitalPortal/Http/Controllers/Api/RequestLogController.php
+++ b/Modules/HospitalPortal/Http/Controllers/Api/RequestLogController.php
@@ -240,8 +240,8 @@ class RequestLogController extends Controller
$query->orWhere('request_logs.code', 'like', "%" . $search . "%")
->orWhere('members.name', 'like', "%" . $search . "%")
->orWhere('request_logs.submission_date', 'like', "%" . $search . "%")
- ->orWhere('request_logs.service_code', 'like', "%" . ($search == 'outpatient' || $search == 'Outpatient' ? 'OP' : $search) . "%")
- ->orWhere('request_logs.service_code', 'like', "%" . ($search == 'inpatient' || $search == 'Inpatient' ? 'IP' : $search) . "%");
+ ->orWhere('request_logs.discharge_date', 'like', "%" . $search . "%")
+ ->orWhereRaw('(SELECT services.name FROM services WHERE services.code = request_logs.service_code LIMIT 1) LIKE ?', ["%" . $search . "%"]);
});
})
->when($request->has('orderBy'), function ($query) use ($request) {
@@ -296,12 +296,9 @@ class RequestLogController extends Controller
END AS status
'),
'request_logs.submission_date',
+ 'request_logs.discharge_date',
DB::raw('
- CASE
- WHEN service_code = "OP" THEN "Outpatient"
- WHEN service_code = "IP" THEN "Inpatient"
- ELSE ""
- END AS service_type
+ (SELECT services.name FROM services WHERE services.code = request_logs.service_code LIMIT 1) AS service_type
'),
DB::raw('
(SELECT organizations.name FROM organizations WHERE organizations.id = request_logs.organization_id LIMIT 1) AS provider
diff --git a/frontend/hospital-portal/src/sections/dashboard/DialogFinalLog.tsx b/frontend/hospital-portal/src/sections/dashboard/DialogFinalLog.tsx
index 7bebba3f..703a6f71 100644
--- a/frontend/hospital-portal/src/sections/dashboard/DialogFinalLog.tsx
+++ b/frontend/hospital-portal/src/sections/dashboard/DialogFinalLog.tsx
@@ -334,7 +334,7 @@ export default function DialogFinalLog({ member, getData, onClose, handleSubmitS
onChange={(newValue:any) => {
setDischargeDate( (newValue));
}}
- inputFormat="dd-MM-yyyy"
+ inputFormat="dd-MM-yyyy HH:mm"
renderInput={(params) => }
/>
diff --git a/frontend/hospital-portal/src/sections/dashboard/FormRequestLog.tsx b/frontend/hospital-portal/src/sections/dashboard/FormRequestLog.tsx
index 3bb40829..19d5d8c2 100644
--- a/frontend/hospital-portal/src/sections/dashboard/FormRequestLog.tsx
+++ b/frontend/hospital-portal/src/sections/dashboard/FormRequestLog.tsx
@@ -198,7 +198,7 @@ export default function FormRequestClaim({ member, handleSubmitSuccess }: FormRe
onChange={(newValue:any) => {
setSubmissionDate( (newValue));
}}
- inputFormat="dd-MM-yyyy"
+ inputFormat="dd-MM-yyyy HH:mm"
renderInput={(params) => }
/>
diff --git a/frontend/hospital-portal/src/sections/dashboard/TableListFinalLog.tsx b/frontend/hospital-portal/src/sections/dashboard/TableListFinalLog.tsx
index 87264886..c79ff891 100644
--- a/frontend/hospital-portal/src/sections/dashboard/TableListFinalLog.tsx
+++ b/frontend/hospital-portal/src/sections/dashboard/TableListFinalLog.tsx
@@ -15,7 +15,7 @@ import palette from '../../theme/palette';
//import { UserCurrentCorporateContext } from '../../contexts/UserCurrentCorporate';
import { HeadCell, Order, PaginationTableProps } from '../../@types/table';
import { useSearchParams, useNavigate } from 'react-router-dom';
-import { fDate, fDateSuffix } from '../../utils/formatTime';
+import { fDate, fDateSuffix, fDateTime } from '../../utils/formatTime';
import Typography from '@mui/material/Typography';
import { format } from 'date-fns';
import TableMoreMenu from '../../components/table/TableMoreMenu';
@@ -264,6 +264,12 @@ export default function TableListFinalLog() {
label: localeData.txtServiceType,
isSort: true,
},
+ {
+ id: 'discharge_date',
+ align: 'center',
+ label: localeData.txtDischargeDate,
+ isSort: true,
+ },
{
id: 'status',
align: 'center',
@@ -358,9 +364,16 @@ export default function TableListFinalLog() {
),
submission_date:
,
+ discharge_date:
+ obj.discharge_date ? (
+
+ ) : ''
+ ,
action:
diff --git a/frontend/hospital-portal/src/sections/dashboard/TableListReqLog.tsx b/frontend/hospital-portal/src/sections/dashboard/TableListReqLog.tsx
index f3d949cf..248ac202 100644
--- a/frontend/hospital-portal/src/sections/dashboard/TableListReqLog.tsx
+++ b/frontend/hospital-portal/src/sections/dashboard/TableListReqLog.tsx
@@ -15,7 +15,7 @@ import palette from '../../theme/palette';
//import { UserCurrentCorporateContext } from '../../contexts/UserCurrentCorporate';
import { HeadCell, Order, PaginationTableProps } from '../../@types/table';
import { useSearchParams, useNavigate } from 'react-router-dom';
-import { fDate, fDateSuffix } from '../../utils/formatTime';
+import { fDate, fDateSuffix, fDateTime } from '../../utils/formatTime';
import Typography from '@mui/material/Typography';
import { format } from 'date-fns';
import TableMoreMenu from '../../components/table/TableMoreMenu';
@@ -356,7 +356,7 @@ export default function TableList() {
),
submission_date:
,
action:
diff --git a/frontend/hospital-portal/src/utils/formatTime.ts b/frontend/hospital-portal/src/utils/formatTime.ts
index ed88dcae..a9fc9250 100644
--- a/frontend/hospital-portal/src/utils/formatTime.ts
+++ b/frontend/hospital-portal/src/utils/formatTime.ts
@@ -8,7 +8,7 @@ export function fDate(date: Date | string | number) {
}
export function fDateTime(date: Date | string | number) {
- return format(new Date(date), 'dd MMM yyyy hh:mm');
+ return format(new Date(date), 'dd MMM yyyy HH:mm');
}
export function fTimestamp(date: Date | string | number) {