Files

166 lines
8.3 KiB
PHP
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@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" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@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.investigation_requests') }}</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 class="active">{{ __('investigations.investigation_requests') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div style="float: right;">
<button class="btn btn-primary print-all-categories">{{ __('investigations.print_all_requests') }}</button><br>
</div>
</div>
</div><br>
<div class="row">
<div class="col-sm-12">
<div class="white-box" id="divToPrint">
<style type="text/css" media="print" >
/*class for the element we dont want to print*/
.no-print{
display:none;
}
</style>
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
<h2 style="text-align: center">{{ __('investigations.investigation_requests') }}</h2>
<p style="font-size: 1em">
{{--<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace"><b>{{ $hospital_information->name }}</b></span>
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace">{{ $hospital_information->address }}</span>
<span><b>Tel:</b> {{ $hospital_information->phone_number }}</span><br>
<span><b>Email:</b> {{ $hospital_information->email }}</span><br>--}}
</p>
@for ($x = 0; $x < count($category_ids_array); $x++)
<p style="font-size: 1em">
<span class="{{ $x }} no-print print-all"><b>{{ __('investigations.patient_name') }}:</b> {{ get_name($patient->id, 'id', 'first_name', 'patients') }} {{ get_name($patient->id, 'id', 'last_name', 'patients') }}</span><br>
<span class="{{ $x }} no-print print-all"><b>{{ __('investigations.patient_number') }}</b> : {{ get_name($patient->id, 'id', 'number', 'patients') }}</span><br>
<span class="{{ $x }} no-print print-all"><b>{{ __('investigations.age') }}</b> : {{ get_patients_age($patient->date_of_birth) }}</span><br>
<span class="{{ $x }} no-print print-all"><b>{{ __('investigations.gender') }}</b> : @if(get_name($patient->id, 'id', 'gender', 'patients') == 1) {{ __('investigations.male') }} @elseif(get_name($patient->id, 'id', 'gender', 'patients') == 2) {{ __('investigations.female') }} @else {{ __('investigations.other') }} @endif</span><br>
<span class="{{ $x }} no-print print-all"><b>{{ __('investigations.ward') }}</b> : @if($ordered_investigation->inpatient == 0) OPD @else {{ get_ward_name($ordered_investigation->patient_id, $ordered_investigation->episode_id) }} @endif</span><br>
<span class="{{ $x }} no-print print-all"><b>{{ __('investigations.authorised_by') }}</b> : {{ get_full_name($ordered_investigation->created_by, 'id', 'first_name', 'last_name', 'users') }}</span><br>
<span class="{{ $x }} no-print print-all"><b>{{ __('investigations.date') }}</b> : {{ streamline_date($ordered_investigation->created_at) }}</span><br>
</p>
<div class="table-bordered" style="padding: 10px; margin-bottom: 10px">
<h4 class="{{ $x }} no-print print-all text-center">{{ get_name($category_ids_array[$x], "id", "name", "investigation_categories") }}</h4>
<ol class="{{ $x }} no-print print-all">
@foreach($category_array[$category_ids_array[$x]] as $record)
@php $investigation_id = $record['id']; @endphp
<li>
@if(in_array($investigation_id,$urgent_ids_array)) <span style='font-size:16px;'>&#9650;&nbsp;</span> @endif
{{ get_name($investigation_id, "id", "name", "investigations") }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{{ get_name($investigation_id, "id", "minimum", "investigations") }}&nbsp;&nbsp;&nbsp;
{{ get_name($investigation_id, "id", "sample_container", "investigations") }}
@if($record['comment'] != '')
<br><br>
<p><b>{{ __('investigations.order_comments') }}:</b> {{ $record['comment'] }}</p>
@endif
<hr>
</li>
@endforeach
</ol>
<div class="text-center">
<button class="btn btn-primary no-print glyphicon glyphicon-print print-btn" id="{{ $x }}"> {{ __('investigations.print') }}</button>
</div>
</div>
<p class="{{ $x }} no-print print-all">=========================================</p>
@endfor
<i style="font-size: 0.8em;">&copy; Stre@mline</i>
</div>
<div class="col-md-3"></div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script type="text/javascript">
// prepare for printing all categories
$(document).ready(function () {
$(".print-all-categories").click(function () {
// remove no-print attribute from all
$(".print-all").each(function () {
$(this).removeClass("no-print");
});
// print the whole document
print_investigations();
// add no-print attribute to all
$(".print-all").each(function () {
$(this).addClass("no-print");
});
});
});
// prepare for printing single category
$(document).ready(function () {
$(".print-btn").click(function () {
let id = $(this).attr("id");
// remove no-print attribute from all
$("." + id).each(function () {
$(this).removeClass("no-print");
});
// print the whole document
print_investigations();
// add no-print attribute to all
$("." + id).each(function () {
$(this).addClass("no-print");
});
});
});
function print_investigations() {
let myDiv = document.getElementById('divToPrint');
let newWindow = window.open('', 'SecondWindow', 'toolbar=0,stat=0');
newWindow.document.write("<html><body " +
"class='' " +
" onload='window.print()'>" +
myDiv.innerHTML +
"</body></html>");
newWindow.document.close();
return false;
}
</script>
@endpush