313 lines
12 KiB
PHP
313 lines
12 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',
|
|
])
|
|
@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 () {
|
|
$('body').on('click', '.showStudy', function () {
|
|
var study_id = $(this).data('id');
|
|
$.get("{{ route('staff.studies.show') }}", {hashid: study_id}, function (data) {
|
|
$('#study-details').html(data);
|
|
$('#study-modal').modal('show');
|
|
});
|
|
});
|
|
|
|
$('body').on('click', '.show-attach', function () {
|
|
var study_id = $(this).data('id');
|
|
$.get("{{ route('staff.studies.attach') }}", {hashid: study_id}, function (data) {
|
|
$('#study-details').html(data);
|
|
$('#study-modal').modal('show');
|
|
});
|
|
});
|
|
|
|
|
|
$('body').on('click', '.show-assign', function () {
|
|
var study_id = $(this).data('id');
|
|
$.get("{{ route('staff.assign.show') }}", {hashid: study_id}, function (data) {
|
|
$('#assign-details').html(data);
|
|
$('#assign-modal').modal('show');
|
|
});
|
|
});
|
|
|
|
|
|
$('body').on('click', '.show-reports', function () {
|
|
var study_id = $(this).data('id');
|
|
$.get("{{ route('staff.report.popup') }}", {hashid: study_id}, function (data) {
|
|
$('#report-details').html(data);
|
|
$('#report-modal').modal('show');
|
|
});
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
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;
|
|
}
|
|
|
|
function generateUrl() {
|
|
const url = new URL("{{ route('staff.worklist.index') }}");
|
|
if (_status) url.searchParams.set('status', _status);
|
|
if (_study_from) url.searchParams.set('study_from', _study_from);
|
|
if (_study_to) url.searchParams.set('study_to', _study_to);
|
|
if (_receive_from) url.searchParams.set('receive_from', _receive_from);
|
|
if (_receive_to) url.searchParams.set('receive_to', _receive_to);
|
|
if (_assign_from) url.searchParams.set('assign_from', _assign_from);
|
|
if (_assign_to) url.searchParams.set('assign_to', _assign_to);
|
|
if (_read_from) url.searchParams.set('read_from', _read_from);
|
|
if (_read_to) url.searchParams.set('read_to', _read_to);
|
|
if (_modality) url.searchParams.set('modality', _modality);
|
|
if (_read_by) url.searchParams.set('read_by', _read_by);
|
|
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>
|
|
|
|
<div class="modal fade" id="study-modal" tabindex="-1" aria-labelledby="studyModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-xl">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="studyModalLabel">Study Information</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div id="study-details"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="modal fade" id="attach-modal" tabindex="-1" aria-labelledby="label-attach" aria-hidden="true">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="label-attach">Attached Docs</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div id="attach-details"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal fade" id="assign-modal" tabindex="-1" aria-labelledby="label-assign" aria-hidden="true">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="label-assign">Assign Radiologist</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div id="assign-details"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="modal fade" id="report-modal" tabindex="-1" aria-labelledby="label-report" aria-hidden="true">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="label-report">Reports</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div id="report-details"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@endsection
|