236 lines
9.1 KiB
PHP
236 lines
9.1 KiB
PHP
@php
|
|
$configData = App\Services\ThemeHelper::appClasses();
|
|
$container = 'container-fluid';
|
|
$containerNav = 'container-fluid';
|
|
/*
|
|
$isNavbar = false;
|
|
$navbarType = 'layout-navbar-hidden';
|
|
$isMenu = false;
|
|
$navbarHideToggle = false;
|
|
*/
|
|
@endphp
|
|
|
|
@extends('layouts.layoutMaster')
|
|
|
|
@section('title', 'Worklist')
|
|
|
|
@section('vendor-style')
|
|
@vite([
|
|
'resources/fontawesome/scss/fontawesome.scss',
|
|
//'resources/fontawesome/scss/solid.scss',
|
|
'resources/fontawesome/scss/light.scss',
|
|
'resources/assets/vendor/libs/datatables-bs5/datatables.bootstrap5.scss',
|
|
'resources/assets/vendor/libs/datatables-responsive-bs5/responsive.bootstrap5.scss',
|
|
//'resources/assets/vendor/libs/datatables-checkboxes-jquery/datatables.checkboxes.scss',
|
|
//'resources/assets/vendor/libs/datatables-buttons-bs5/buttons.bootstrap5.scss'
|
|
'resources/assets/vendor/libs/flatpickr/flatpickr.scss',
|
|
'resources/assets/vendor/libs/bootstrap-datepicker/bootstrap-datepicker.scss',
|
|
'resources/assets/vendor/libs/bootstrap-daterangepicker/bootstrap-daterangepicker.scss',
|
|
])
|
|
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/7.2.3/css/flag-icons.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
|
@endsection
|
|
|
|
@section('vendor-script')
|
|
<script src="https://code.jquery.com/jquery-3.7.1.min.js" crossorigin="anonymous"></script>
|
|
|
|
@vite([
|
|
'resources/assets/vendor/libs/datatables-bs5/datatables-bootstrap5.js',
|
|
'resources/assets/vendor/libs/flatpickr/flatpickr.js',
|
|
'resources/assets/vendor/libs/bootstrap-datepicker/bootstrap-datepicker.js',
|
|
'resources/assets/vendor/libs/bootstrap-daterangepicker/bootstrap-daterangepicker.js',
|
|
])
|
|
@endsection
|
|
|
|
@section('page-style')
|
|
<style>
|
|
.msg-icon {
|
|
width: 18px !important;
|
|
height: 18px !important;
|
|
}
|
|
|
|
.nav-tabs .nav-link.active, .nav-tabs .nav-link.active:hover, .nav-tabs .nav-link.active:focus {
|
|
color: #efefef !important;
|
|
font-weight: bolder !important;
|
|
}
|
|
|
|
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link {
|
|
background-color: #515a97 !important;
|
|
border-color: #cd0909 !important;
|
|
}
|
|
</style>
|
|
@endsection
|
|
|
|
@section('page-script')
|
|
@vite([
|
|
'resources/assets/js/cards-actions.js',
|
|
'resources/assets/js/ui-popover.js'
|
|
])
|
|
|
|
{{ $dataTable->scripts() }}
|
|
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
@include('staff.worklist.partials._modal-js', ['selector' => '.show-study', 'url' => route('staff.studies.show'), 'type' => 'study'])
|
|
@include('staff.worklist.partials._modal-js', ['selector' => '.show-attach', 'url' => route('staff.studies.attach'), 'type' => 'attach'])
|
|
@include('staff.worklist.partials._modal-js', ['selector' => '.show-assign', 'url' => route('staff.assign.show'), 'type' => 'assign'])
|
|
@include('staff.worklist.partials._modal-js', ['selector' => '.show-reports', 'url' => route('staff.report.popup'), 'type' => 'report'])
|
|
@include('staff.worklist.partials._modal-js', ['selector' => '.show-audit', 'url' => route('staff.audit.popup'), 'type' => 'audit'])
|
|
|
|
let _status, _study_from, _study_to, _receive_from, _receive_to, _assign_from, _assign_to, _read_from,
|
|
_read_to, _modality, _read_by = null;
|
|
|
|
function resetParams() {
|
|
_status, _study_from, _study_to, _receive_from, _receive_to, _assign_from, _assign_to, _read_from, _read_to, _modality, _read_by = null;
|
|
}
|
|
|
|
const strip_dash = str => str.replace(/^_/, '');
|
|
|
|
function generateUrl() {
|
|
const url = new URL("{{ route('staff.worklist.index') }}");
|
|
const params = {
|
|
_status,
|
|
_study_from,
|
|
_study_to,
|
|
_receive_from,
|
|
_receive_to,
|
|
_assign_from,
|
|
_assign_to,
|
|
_read_from,
|
|
_read_to,
|
|
_modality,
|
|
_read_by
|
|
};
|
|
Object.keys(params).forEach(key => {
|
|
if (params[key]) url.searchParams.set(strip_dash(key), params[key]);
|
|
});
|
|
return url.toString();
|
|
}
|
|
|
|
const date_range_config = {
|
|
mode: 'range',
|
|
dateFormat: 'Y-m-d',
|
|
altInput: true,
|
|
altFormat: "j M (D)",
|
|
disable: [
|
|
givenDate => {
|
|
const maxDate = new Date();
|
|
maxDate.setDate(maxDate.getDate() + 1);
|
|
return givenDate > maxDate;
|
|
}
|
|
]
|
|
};
|
|
|
|
const fp_study = $('#study_date_range').flatpickr(date_range_config);
|
|
const fp_receive = $('#receive_date_range').flatpickr(date_range_config);
|
|
const fp_assign = $('#assign_date_range').flatpickr(date_range_config);
|
|
const fp_read = $('#read_date_range').flatpickr(date_range_config);
|
|
|
|
$('#search_button').on('click', function () {
|
|
resetParams();
|
|
|
|
const ranges = [
|
|
{picker: fp_study, type: 'study'},
|
|
{picker: fp_receive, type: 'receive'},
|
|
{picker: fp_assign, type: 'assign'},
|
|
{picker: fp_read, type: 'read'}
|
|
];
|
|
|
|
ranges.forEach(range => {
|
|
const selectedDates = range.picker.selectedDates;
|
|
if (selectedDates.length === 2) {
|
|
const fromDate = formatDate(selectedDates[0]);
|
|
const toDate = formatDate(selectedDates[1]);
|
|
|
|
switch (range.type) {
|
|
case 'study':
|
|
_study_from = fromDate;
|
|
_study_to = toDate;
|
|
break;
|
|
case 'receive':
|
|
_receive_from = fromDate;
|
|
_receive_to = toDate;
|
|
break;
|
|
case 'assign':
|
|
_assign_from = fromDate;
|
|
_assign_to = toDate;
|
|
break;
|
|
case 'read':
|
|
_read_from = fromDate;
|
|
_read_to = toDate;
|
|
break;
|
|
}
|
|
|
|
}
|
|
});
|
|
|
|
const modalityArray = [];
|
|
@foreach ($modalities as $modality)
|
|
if ($('#chk_{{ $modality }}').is(':checked')) {
|
|
modalityArray.push('{{ $modality }}');
|
|
}
|
|
@endforeach
|
|
|
|
_modality = modalityArray.join(',');
|
|
_read_by = $('#read_by').val();
|
|
|
|
filterTable();
|
|
});
|
|
|
|
const worklist_table = $('#worklist-table').DataTable({
|
|
retrieve: true
|
|
});
|
|
|
|
function filterTableStatus(status) {
|
|
_status = status;
|
|
worklist_table.ajax.url(generateUrl()).load();
|
|
}
|
|
|
|
function filterTable() {
|
|
worklist_table.ajax.url(generateUrl()).load();
|
|
}
|
|
|
|
function formatDate(date) {
|
|
return new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).toISOString().slice(0, 10);
|
|
}
|
|
|
|
$('a[data-bs-toggle="tab"]').on('click', function (e) {
|
|
let target = $(e.target);
|
|
//if (e.target.tagName === 'i')
|
|
if (!target.is('a')) target = target.closest('a');
|
|
let _id = target.attr('id');
|
|
if (_id) {
|
|
_status = _id.replace('nav__', '');
|
|
filterTable();
|
|
}
|
|
});
|
|
|
|
filterTableStatus('unread');
|
|
});
|
|
</script>
|
|
|
|
@endsection
|
|
|
|
@section('content')
|
|
{{-- @include('staff.worklist.partials._stats') --}}
|
|
@include('staff.worklist.partials._filter-panel', compact('modalities'))
|
|
|
|
<div class="card">
|
|
<div class="card-header p-0 bg-light">
|
|
@include('staff.worklist.partials._nav-top')
|
|
</div>
|
|
<div class="card-body pt-2">
|
|
<div class="table-responsive text-nowrap">
|
|
{{ $dataTable->table(['class' => 'table table-sm'], true) }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@include('staff.worklist.partials._modal', ['type' => 'study', 'title' => 'Study Information'])
|
|
@include('staff.worklist.partials._modal', ['type' => 'attach', 'title' => 'Attached Docs'])
|
|
@include('staff.worklist.partials._modal', ['type' => 'assign', 'title' => 'Assign Radiologist'])
|
|
@include('staff.worklist.partials._modal', ['type' => 'report', 'title' => 'Reports'])
|
|
@include('staff.worklist.partials._modal', ['type' => 'audit', 'title' => 'Audit Log'])
|
|
|
|
@endsection
|