Files

227 lines
12 KiB
PHP

@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" />
@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">Cancer Protocols</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('insurance_groups.dashboard') }}</a></li>
<li class="active">Cancer Protocols</li>
</ol>
</div>
</div>
@include('cancer::cancer_protocol.menu')
<div class="white-box">
<a href="/cancer_protocol/print_all_protocols" target="_blank" class="btn btn-success">Print Protocols</a>
@include('flash::message')
<div class="table-responsive">
<table id="table" class="table table-striped color-bordered-table success-bordered-table table-hover table-bordered">
<thead>
<tr>
<th>Protocol</th>
<th>Section</th>
<th>Section Comment</th>
<th>Drugs</th>
<th>Route</th>
<th>Factor</th>
<th>Dose</th>
<th>Duration</th>
<th>Instructions</th>
</tr>
</thead>
<tbody>
@foreach($cancer_protocols as $cancer_protocol)
@php
$pre_chemo_drugs = json_decode($cancer_protocol->pre_chemo_drugs, true);
$chemo_drugs = json_decode($cancer_protocol->chemo_drugs, true);
$post_chemo_drugs = json_decode($cancer_protocol->post_chemo_drugs, true);
$pre_chemo_drugs_count = count($pre_chemo_drugs);
$chemo_drugs_count = count($chemo_drugs);
$post_chemo_drugs_count = count($post_chemo_drugs);
$pre_chemo_doses_count = array_sum(array_map(function ($value) {return count($value['dose']);}, $pre_chemo_drugs));
$chemo_doses_count = array_sum(array_map(function ($value) {return count($value['dose']);}, $chemo_drugs));
$post_chemo_doses_count = array_sum(array_map(function ($value) {return count($value['dose']);}, $post_chemo_drugs));
@endphp
<tr>
<td rowspan="{{ $pre_chemo_drugs_count + $pre_chemo_doses_count + $chemo_drugs_count + $chemo_doses_count + $post_chemo_drugs_count + $post_chemo_doses_count + 4 }}">
<h3>{{ $cancer_protocol->name }}</h3>
<br>
@if($cancer_protocol->protocol_billing_type == 0)
Total Cost of {{ ugandan_shillings($cancer_protocol->protocol_cost) }}
@else
Billing Per Drug
@endif
<hr>
<a href="/cancer_protocol/{{ $cancer_protocol->id }}/edit/" class="btn btn-warning btn-rounded">Edit</a>
<br><br>
{{ Form::model($cancer_protocol->id ,['method' => 'DELETE', 'route' => ['cancer_protocol.destroy', $cancer_protocol->id]]) }}
<button type="submit" class="btn btn-danger btn-rounded" onclick="return confirm('<?php echo __('wards.are_you_sure');?>')"><i class="fa fa-trash"></i> {{ __('wards.delete') }}</button>
{{ Form::close() }}
</td>
</tr>
<tr>
<td rowspan="{{ $pre_chemo_drugs_count + $pre_chemo_doses_count + 1 }}">Pre-Chemo</td>
<td rowspan="{{ $pre_chemo_drugs_count + $pre_chemo_doses_count + 1 }}">{{ $cancer_protocol->pre_chemo_comments }}</td>
</tr>
@for($x = 0; $x < $pre_chemo_drugs_count; $x++)
<tr>
<td rowspan="{{ count($pre_chemo_drugs[$x]['dose']) + 1 }}">{{ $drugs[$pre_chemo_drugs[$x]['drug_id']] ?? '' }}</td>
<td rowspan="{{ count($pre_chemo_drugs[$x]['dose']) + 1 }}">{{ $drug_routes[$pre_chemo_drugs[$x]['drug_route']] ?? '' }}</td>
<td rowspan="{{ count($pre_chemo_drugs[$x]['dose']) + 1 }}">{{ $factors[$pre_chemo_drugs[$x]['drug_factor']] ?? '' }}</td>
</tr>
@php
$drug_dosage = $drug_units[$drug_with_units[$pre_chemo_drugs[$x]['drug_id']]];
if ($pre_chemo_drugs[$x]['drug_factor'] == 1) {
$drug_dosage .= '/m<sup>2</sup>';
} else if ($pre_chemo_drugs[$x]['drug_factor'] == 2) {
$drug_dosage .= '/Kg';
}
@endphp
@for($i = 0; $i < count($pre_chemo_drugs[$x]['dose']); $i++)
<tr>
<td>
{{ $pre_chemo_drugs[$x]['dose'][$i]['dose'] }} {!! $drug_dosage !!}
@if(!empty($pre_chemo_drugs[$x]['dose'][$i]['weight_range']))
<br><br>
<span style="color: #0a776c">({{ $pre_chemo_drugs[$x]['dose'][$i]['weight_range'] }})</span>
@endif
</td>
<td>{{ $pre_chemo_drugs[$x]['dose'][$i]['duration'] }}</td>
<td>{{ $pre_chemo_drugs[$x]['dose'][$i]['instructions'] }}</td>
</tr>
@endfor
@endfor
<tr>
<td rowspan="{{ $chemo_drugs_count + $chemo_doses_count + 1 }}">Chemo</td>
<td rowspan="{{ $chemo_drugs_count + $chemo_doses_count + 1 }}">{{ $cancer_protocol->chemo_comments }}</td>
</tr>
@for($x = 0; $x < $chemo_drugs_count; $x++)
<tr>
<td rowspan="{{ count($chemo_drugs[$x]['dose']) + 1 }}">{{ $drugs[$chemo_drugs[$x]['drug_id']] ?? '' }}</td>
<td rowspan="{{ count($chemo_drugs[$x]['dose']) + 1 }}">{{ $drug_routes[$chemo_drugs[$x]['drug_route']] ?? '' }}</td>
<td rowspan="{{ count($chemo_drugs[$x]['dose']) + 1 }}">{{ $factors[$chemo_drugs[$x]['drug_factor']] ?? '' }}</td>
</tr>
@php
$drug_dosage = $drug_units[$drug_with_units[$chemo_drugs[$x]['drug_id']]];
if ($chemo_drugs[$x]['drug_factor'] == 1) {
$drug_dosage .= '/m<sup>2</sup>';
} else if ($chemo_drugs[$x]['drug_factor'] == 2) {
$drug_dosage .= '/Kg';
}
@endphp
@for($i = 0; $i < count($chemo_drugs[$x]['dose']); $i++)
<tr>
<td>
{{ $chemo_drugs[$x]['dose'][$i]['dose'] }} {!! $drug_dosage !!}
@if(!empty($chemo_drugs[$x]['dose'][$i]['weight_range']))
<br><br>
<span style="color: #0a776c">({{ $chemo_drugs[$x]['dose'][$i]['weight_range'] }})</span>
@endif
</td>
<td>{{ $chemo_drugs[$x]['dose'][$i]['duration'] }}</td>
<td>{{ $chemo_drugs[$x]['dose'][$i]['instructions'] }}</td>
</tr>
@endfor
@endfor
<tr>
<td rowspan="{{ $post_chemo_drugs_count + $post_chemo_doses_count + 1 }}">Post-Chemo</td>
<td rowspan="{{ $post_chemo_drugs_count + $post_chemo_doses_count + 1 }}">{{ $cancer_protocol->post_chemo_comments }}</td>
</tr>
@for($x = 0; $x < $post_chemo_drugs_count; $x++)
<tr>
<td rowspan="{{ count($post_chemo_drugs[$x]['dose']) + 1 }}">{{ $drugs[$post_chemo_drugs[$x]['drug_id']] ?? '' }}</td>
<td rowspan="{{ count($post_chemo_drugs[$x]['dose']) + 1 }}">{{ $drug_routes[$post_chemo_drugs[$x]['drug_route']] ?? '' }}</td>
<td rowspan="{{ count($post_chemo_drugs[$x]['dose']) + 1 }}">{{ $factors[$post_chemo_drugs[$x]['drug_factor']] ?? '' }}</td>
</tr>
@php
$drug_dosage = $drug_units[$drug_with_units[$post_chemo_drugs[$x]['drug_id']]];
if ($post_chemo_drugs[$x]['drug_factor'] == 1) {
$drug_dosage .= '/m<sup>2</sup>';
} else if ($post_chemo_drugs[$x]['drug_factor'] == 2) {
$drug_dosage .= '/Kg';
}
@endphp
@for($i = 0; $i < count($post_chemo_drugs[$x]['dose']); $i++)
<tr>
<td>
{{ $post_chemo_drugs[$x]['dose'][$i]['dose'] }} {!! $drug_dosage !!}
@if(!empty($post_chemo_drugs[$x]['dose'][$i]['weight_range']))
<br><br>
<span style="color: #0a776c">({{ $post_chemo_drugs[$x]['dose'][$i]['weight_range'] }})</span>
@endif
</td>
<td>{{ $post_chemo_drugs[$x]['dose'][$i]['duration'] }}</td>
<td>{{ $post_chemo_drugs[$x]['dose'][$i]['instructions'] }}</td>
</tr>
@endfor
@endfor
@endforeach
</tbody>
</table>
</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>
$('#table').DataTable({
dom: 'Bfrtip',
bInfo: false,
bPaginate: false,
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
</script>
@endpush