Files

241 lines
12 KiB
PHP
Executable File

@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<style>
table td{
border-left: 1px solid #dddddd;
}
th{
white-space: nowrap;
}
</style>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigations.investigations') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="{{ route('investigations.index') }}">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.investigations') }}</li>
</ol>
</div>
</div>
@include('investigations::investigations.menu')
<div class="row">
<div class="col-sm-12">
<!-- Flash messages at the top -->
@include('flash::message')
<div class="white-box">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>{{ __('investigations.investigation_name') }}</th>
<th>{{ __('investigations.normal_ranges') }}</th>
<th>{{ __('investigations.minimum') }}</th>
<th>{{ __('investigations.sample_container') }}</th>
<th>{{ __('investigations.non_insured_price') }}</th>
<th>{{ __('investigations.comments') }}</th>
<th>{{ __('investigations.lab_time') }}</th>
<th>{{ __('investigations.category') }}</th>
<th>{{ __('investigations.hmis_category_out_patient_number') }}</th>
<th>{{ __('investigations.hmis_category_out_patient') }}</th>
<th>{{ __('investigations.hmis_category_in_patient_number') }}</th>
<th>{{ __('investigations.hmis_category_in_patient') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($investigations as $investigation)
<tr>
<td>
{{ $investigation->name }}
@if(!$investigation->available) ({{ __('investigations.not_available') }}) @endif
</td>
<td>
@if($investigation->range_type == 1)
<a href="#" onclick="view_normal_ranges(<?php echo $investigation->id ?>)">View Reference Ranges</a>
@else
{{ $investigation->normal_ranges }}
@endif
</td>
<td>{{ $investigation->minimum }}</td>
<td>{{ $investigation->sample_container }}</td>
<td>{{ $investigation->non_insured_price }}</td>
<td>{{ $investigation->comments }}</td>
<td>{{ $investigation->lab_time }}</td>
<td>{{ $investigation_categories[$investigation->category] ?? "Not Set" }}</td>
@php
$hmis_no_outpatient_array = explode(",", $investigation->hmis_no_outpatient);
$hmis_outpatient_category_array = explode(",", $investigation->hmis_category);
@endphp
<td>{{ $investigation->hmis_no_outpatient }}</td>
<td>
@if(count($hmis_no_outpatient_array) > 0)
<ul>
@for($i=0; $i < count($hmis_outpatient_category_array); $i++)
<li>{{ $hmis_categories[$hmis_outpatient_category_array[$i]] ?? "" }}</li>
@endfor
</ul>
@endif
</td>
<td>{{ $investigation->hmis_no_inpatient }}</td>
<td>{{ $investigation_categories[$investigation->hmis_category_inpatient] ?? "" }}</td>
<td>
<a href="/investigations/{{ $investigation->id }}/edit/" class="btn btn-info"><i class="fa fa-pencil"></i> {{ __('investigations.edit') }}</a>
</td>
<td>
@if (!in_array($investigation->id, $ordered_investigations_ids))
{{ Form::model($investigation->id ,['method' => 'DELETE', 'route' => ['investigations.destroy', $investigation->id]]) }}
<button type="submit" class="btn btn-danger" onclick="return confirm('Are you sure?')"><i class="fa fa-trash"></i> {{ __('investigations.delete') }}</button>
{{ Form::close() }}
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
{{ $investigations->links() }}
</div>
</div>
</div>
<div class="modal" id="modal_categorized_ranges" tabindex="-1" role="dialog" aria-labelledby="debt_plan_modal_label" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"><b id="categorized_ranges_title"></b></h4>
</div>
<div class="modal-body">
<div class="row">
@php $age_groups = \Streamline\Models\AgeGroup::get(); @endphp
<div class="col-md-6">
<h3>Male</h3>
<br>
@foreach($age_groups as $age)
{{ Form::label('dynamic_range', $age->name) }}
{{ Form::text('dynamic_range', '', ['class' => 'form-control', 'readonly', 'id' => 'dynamic_range_male_' . $age->id]) }}
<br>
@endforeach
</div>
<div class="col-md-6">
<h3>Female</h3>
<br>
@foreach($age_groups as $age)
{{ Form::label('dynamic_range', $age->name) }}
{{ Form::text('dynamic_range', '', ['class' => 'form-control', 'readonly', 'id' => 'dynamic_range_female_' . $age->id]) }}
<br>
@endforeach
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.colVis.min.js') }}"></script>
<script type="text/javascript">
function view_normal_ranges(id) {
$.ajax({
method: 'GET',
url: '/investigations/view_investigation_normal_ranges/' + id,
success: function(response){
let responseArray = JSON.parse(response);
$('#categorized_ranges_title').text("Investigation Reference Ranges For " + responseArray["name"]);
let male_result = responseArray["male"];
let female_result = responseArray["female"];
for (var key in male_result) {
if (male_result.hasOwnProperty(key)) {
$("#dynamic_range_male_" + key).val(male_result[key]);
}
}
for (var key1 in female_result) {
if (female_result.hasOwnProperty(key1)) {
$("#dynamic_range_female_" + key1).val(female_result[key1]);
}
}
$('#modal_categorized_ranges').modal('show');
}
});
}
$('.table').DataTable({
dom: 'Bfrtip',
bInfo: false,
bPaginate: false,
buttons: [
'copy',
{extend: 'csv',
message: "<?php echo __('investigations.list_of_investigations') ?>"
},
{extend: 'excel',
message: "<?php echo __('investigations.list_of_investigations') ?>",
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6]
},
sheetName: "<?php echo __('investigations.list_of_investigations') ?>"
},
{extend: 'pdf',
message: "<?php echo __('investigations.list_of_investigations') ?>",
orientation: 'portrait',
pageSize: 'LETTER',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6]
},
customize: function (doc) {
doc.defaultStyle.fontSize = 10;
// doc.styles.tableHeader.alignment = 'left';
}
},
{extend: 'print',
message: "<?php echo __('investigations.list_of_investigations') ?>",
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6]
},
customize: function (win) {
$(win.document.body)
.css('font-size', '10pt')
.css('background', '#fff')
.prepend(
'<img src="<?php echo asset('uploads/logo/logo-sm.png'); ?>" style="position:absolute; top:0; right:0;" />'
);
$(win.document.body).find('table')
.addClass('compact')
.css('font-size', 'inherit');
}
}
]
});
</script>
@endpush