resolved conflicts

This commit is contained in:
2025-03-31 03:46:05 +03:00
6454 changed files with 1520539 additions and 9 deletions
@@ -0,0 +1,560 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@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_protocol.add_cancer_protocol') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('cancer_protocol.dashboard') }}</a></li>
<li><a href="{{ route('cancer_protocol.index') }}">{{ __('cancer_protocol.cancer_protocols') }}</a></li>
<li class="active">{{ __('cancer_protocol.create') }}</li>
</ol>
</div>
</div>
@include('cancer::cancer_protocol.menu')
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
{{ Form::open(['route' => 'cancer_protocol.store', 'data-toggle' => 'validator']) }}
<h3>Protocol Details</h3>
<div class="row">
<div class="col-md-5">
<div class="form-group">
{{ Form::label('name', "Protocol Name") }}
{{ Form::text('name', '', ['class' => 'form-control compulsory', 'required']) }}
</div>
</div>
<div class="col-md-2"></div>
<div class="col-md-5">
<div class="form-group">
{{ Form::label('name', "Protocol Billing Type") }}
<br>
{{ Form::radio('protocol_billing_type', 0, false, ["required", "onclick" => "show('protocol_cost_div');"]) }}&nbsp; Umbrella Cost &nbsp;&nbsp;
{{ Form::radio('protocol_billing_type', 1, false, ["required", "onclick" => "hide('protocol_cost_div');"]) }}&nbsp; Bill Per Drug
</div>
<br>
<div class="form-group" id="protocol_cost_div" style="display: none">
{{ Form::label('protocol_cost', "Protocol Cost") }}
{{ Form::number('protocol_cost', '', ['class' => 'form-control compulsory', 'min' => 0]) }}
</div>
</div>
</div>
<hr>
<h3><label class="label label-warning">PRE-CHEMOTHERAPY</label></h3>
<div class="row">
<div class="col-md-6">
{{ Form::label('pre_chemo_comments', 'Comments') }}
{{ Form::textarea('pre_chemo_comments', '', ['class' => 'form-control compulsory', 'required', 'rows' => '5']) }}
</div>
</div>
<br>
<table class='table color-bordered-table success-bordered-table'>
<thead>
<tr>
<th>
<div class="row">
<div class="col-3">Drug</div>
<div class="col-1">Route</div>
<div class="col-2">Factor</div>
<div class="col-1">Dose</div>
<div class="col-2">Duration(Separate with commas)</div>
<div class="col-2">Instructions</div>
<div class="col-1"></div>
</div>
</th>
</tr>
</thead>
<tbody id="pre_chemo_drugs_div">
<tr>
<td>
<div id="pre_chemo_row_0">
{{ Form::hidden('pre_chemo_row_counter[]', 0) }}
<div class="row">
<div class="col-3">
{{ Form::select('pre_chemo_drug_id[]', $drugs, '', ['class' => 'form-control compulsory drugs_id_class', 'id' => 'pre_chemo_drug_id_0', 'onchange' => 'drugs_details(0, this.value, \'pre_chemo\')', 'required']) }}
</div>
<div class="col-1">
{{ Form::select('pre_chemo_drug_route[]', $drug_routes, '', ['class' => 'form-control compulsory', 'required']) }}
</div>
<div class="col-2">
{{ Form::select('pre_chemo_drug_factor_id[]', $factors, '', ['class' => 'form-control compulsory', 'onchange' => 'check_factor(0, \'pre_chemo\')', 'required', 'id' => 'pre_chemo_drug_factor_id_0']) }}
<div id="pre_chemo_drug_weight_0" style="display: none">
<hr>
{{ Form::label('pre_chemo_drug_weight_range', 'Range (Kg)') }}
{{ Form::text('pre_chemo_drug_weight_range[]', '', ['class' => 'form-control']) }}
</div>
</div>
<div class="col-1">
{{ Form::number('pre_chemo_drug_dose[]', '', ['class' => 'form-control compulsory', 'min' => 0, 'required', 'step' => 0.0001]) }}
<span style='margin-bottom: 4px; font-size: smaller;' class='pre_chemo_drug_unit_0'></span>
<span style='margin-bottom: 4px; font-size: smaller;' class='pre_chemo_drug_factor_unit_0'></span>
</div>
<div class="col-2">
{{ Form::textarea('pre_chemo_drug_duration[]', '', ['class' => 'form-control compulsory', 'rows' => '3', 'required']) }}
</div>
<div class="col-2">
{{ Form::textarea('pre_chemo_drug_instructions[]', '', ['class' => 'form-control', 'rows' => '3']) }}
</div>
<div class="col-1">
<a href="#pre_chemo_row_0" class="btn btn-outline-success btn-rounded btn-sm" onclick="add_pre_chemo_dose(0)">Add Dose</a>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<a class="btn btn-success btn-rounded btn-sm" onclick="add_pre_chemo_drug()">Add Drug</a>
<hr>
<h3><label class="label label-warning">CHEMOTHERAPY</label></h3>
<div class="row">
<div class="col-md-6">
{{ Form::label('chemo_comments', 'Comments') }}
{{ Form::textarea('chemo_comments', '', ['class' => 'form-control compulsory', 'required', 'rows' => '5']) }}
</div>
</div>
<br>
<table class='table color-bordered-table success-bordered-table'>
<thead>
<tr>
<th>
<div class="row">
<div class="col-3">Drug</div>
<div class="col-1">Route</div>
<div class="col-2">Factor</div>
<div class="col-1">Dose</div>
<div class="col-2">Duration(Separate with commas)</div>
<div class="col-2">Instructions</div>
<div class="col-1"></div>
</div>
</th>
</tr>
</thead>
<tbody id="chemo_drugs_div">
<tr>
<td>
<div id="chemo_row_0">
{{ Form::hidden('chemo_row_counter[]', 0) }}
<div class="row">
<div class="col-3">
{{ Form::select('chemo_drug_id[]', $drugs, '', ['class' => 'form-control compulsory drugs_id_class', 'id' => 'chemo_drug_id_0', 'onchange' => 'drugs_details(0, this.value, \'chemo\')', 'required']) }}
</div>
<div class="col-1">
{{ Form::select('chemo_drug_route[]', $drug_routes, '', ['class' => 'form-control compulsory', 'required']) }}
</div>
<div class="col-2">
{{ Form::select('chemo_drug_factor_id[]', $factors, '', ['class' => 'form-control compulsory', 'onchange' => 'check_factor(0, \'chemo\')', 'required', 'id' => 'chemo_drug_factor_id_0']) }}
<div id="chemo_drug_weight_0" style="display: none">
<hr>
{{ Form::label('chemo_drug_weight_range', 'Range (Kg)') }}
{{ Form::text('chemo_drug_weight_range[]', '', ['class' => 'form-control']) }}
</div>
</div>
<div class="col-1">
{{ Form::number('chemo_drug_dose[]', '', ['class' => 'form-control compulsory', 'min' => 0, 'required', 'step' => 0.0001]) }}
<span style='margin-bottom: 4px; font-size: smaller;' class='chemo_drug_unit_0'></span>
<span style='margin-bottom: 4px; font-size: smaller;' class='chemo_drug_factor_unit_0'></span>
</div>
<div class="col-2">
{{ Form::textarea('chemo_drug_duration[]', '', ['class' => 'form-control compulsory', 'rows' => '3', 'required']) }}
</div>
<div class="col-2">
{{ Form::textarea('chemo_drug_instructions[]', '', ['class' => 'form-control', 'rows' => '3']) }}
</div>
<div class="col-1">
<a href="#chemo_row_0" class="btn btn-outline-success btn-rounded btn-sm" onclick="add_chemo_dose(0)">Add Dose</a>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<a class="btn btn-success btn-rounded btn-sm" onclick="add_chemo_drug()">Add Drug</a>
<hr>
<h3><label class="label label-warning">POST-CHEMOTHERAPY</label></h3>
<div class="row">
<div class="col-md-6">
{{ Form::label('post_chemo_comments', 'Comments') }}
{{ Form::textarea('post_chemo_comments', '', ['class' => 'form-control compulsory', 'required', 'rows' => '5']) }}
</div>
</div>
<br>
<table class='table color-bordered-table success-bordered-table'>
<thead>
<tr>
<th>
<div class="row">
<div class="col-3">Drug</div>
<div class="col-1">Route</div>
<div class="col-2">Factor</div>
<div class="col-1">Dose</div>
<div class="col-2">Duration(Separate with commas)</div>
<div class="col-2">Instructions</div>
<div class="col-1"></div>
</div>
</th>
</tr>
</thead>
<tbody id="post_chemo_drugs_div">
<tr>
<td>
<div id="post_chemo_row_0">
{{ Form::hidden('post_chemo_row_counter[]', 0) }}
<div class="row">
<div class="col-3">
{{ Form::select('post_chemo_drug_id[]', $drugs, '', ['class' => 'form-control compulsory drugs_id_class', 'id' => 'post_chemo_drug_id_0', 'onchange' => 'drugs_details(0, this.value, \'post_chemo\')', 'required']) }}
</div>
<div class="col-1">
{{ Form::select('post_chemo_drug_route[]', $drug_routes, '', ['class' => 'form-control compulsory', 'required']) }}
</div>
<div class="col-2">
{{ Form::select('post_chemo_drug_factor_id[]', $factors, '', ['class' => 'form-control compulsory', 'onchange' => 'check_factor(0, \'post_chemo\')', 'required', 'id' => 'post_chemo_drug_factor_id_0']) }}
<div id="post_chemo_drug_weight_0" style="display: none">
<hr>
{{ Form::label('post_chemo_drug_weight_range', 'Range (Kg)') }}
{{ Form::text('post_chemo_drug_weight_range[]', '', ['class' => 'form-control']) }}
</div>
</div>
<div class="col-1">
{{ Form::number('post_chemo_drug_dose[]', '', ['class' => 'form-control compulsory', 'min' => 0, 'required', 'step' => 0.0001]) }}
<span style='margin-bottom: 4px; font-size: smaller;' class='post_chemo_drug_unit_0'></span>
<span style='margin-bottom: 4px; font-size: smaller;' class='post_chemo_drug_factor_unit_0'></span>
</div>
<div class="col-2">
{{ Form::textarea('post_chemo_drug_duration[]', '', ['class' => 'form-control compulsory', 'rows' => '3', 'required']) }}
</div>
<div class="col-2">
{{ Form::textarea('post_chemo_drug_instructions[]', '', ['class' => 'form-control', 'rows' => '3']) }}
</div>
<div class="col-1">
<a href="#post_chemo_row_0" class="btn btn-outline-success btn-rounded btn-sm" onclick="add_post_chemo_dose(0)">Add Dose</a>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<a class="btn btn-success btn-rounded btn-sm" onclick="add_post_chemo_drug()">Add Drug</a>
<hr>
{{ Form::button(__('cancer_protocol.submit'),['type'=>'submit','class'=>'btn btn-success btn-rounded waves-effect waves-light m-r-10']) }}
{{ Form::button(__('cancer_protocol.cancel'),['type'=>'reset','class'=>'btn btn-default btn-rounded waves-effect waves-light']) }}
{{ Form::close() }}
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script>
let pre_chemo_counter = 1;
let chemo_counter = 1;
let post_chemo_counter = 1;
function remove_field(id) {
$('#' + id).remove();
}
function add_pre_chemo_drug() {
$('#pre_chemo_drugs_div').append("<tr id='pre_chemo_row_delete_" + pre_chemo_counter + "'>\
<td>\
<div id='pre_chemo_row_" + pre_chemo_counter + "'>\
<input type='hidden' name='pre_chemo_row_counter[]' value='" + pre_chemo_counter + "'>\
<div class='row'>\
<div class='col-3'>\
<select name='pre_chemo_drug_id[]' id='pre_chemo_drug_id_" + pre_chemo_counter + "' class='form-control compulsory required drugs_id_class' required onchange='drugs_details(" + pre_chemo_counter + ", this.value, \"pre_chemo\")'>@php echo $option_drugs; @endphp</select>\
</div>\
<div class='col-1'>\
<select name='pre_chemo_drug_route[]' class='form-control compulsory' required>@php echo $option_drug_routes; @endphp</select>\
</div>\
<div class='col-2'>\
<select name='pre_chemo_drug_factor_id[]' class='form-control compulsory' required onchange='check_factor(" + pre_chemo_counter + ", \"pre_chemo\")' id='pre_chemo_drug_factor_id_" + pre_chemo_counter + "'>@php echo $option_factors; @endphp</select>\
<div id='pre_chemo_drug_weight_" + pre_chemo_counter + "' style='display: none'>\
<hr>\
<label>Range (Kg)</label>\
<input type='text' name='pre_chemo_drug_weight_range[]' class='form-control'>\
</div>\
</div>\
<div class='col-1'>\
<input type='number' name='pre_chemo_drug_dose[]' class='form-control compulsory' required min='0' step=0.0001>\
<span style='margin-bottom: 4px; font-size: smaller;' class='pre_chemo_drug_unit_" + pre_chemo_counter + "'></span>\
<span style='margin-bottom: 4px; font-size: smaller;' class='pre_chemo_drug_factor_unit_" + pre_chemo_counter + "'></span>\
</div>\
<div class='col-2'>\
<textarea name='pre_chemo_drug_duration[]' class='form-control compulsory' required rows='3'></textarea>\
</div>\
<div class='col-2'>\
<textarea name='pre_chemo_drug_instructions[]' class='form-control' rows='3'></textarea>\
</div>\
<div class='col-1'>\
<a href='#pre_chemo_row_" + pre_chemo_counter + "' class='btn btn-outline-success btn-rounded btn-sm' onclick='add_pre_chemo_dose(" + pre_chemo_counter + ")'>Add Dose</a>\
<br><br>\
<button type='button' class='btn btn-sm btn-rounded btn-danger' style='color: white;' onclick='remove_field(\"pre_chemo_row_delete_" + pre_chemo_counter + "\")'><i class='fa fa-trash'></i></button>\
</div>\
</div>\
</div>\
</td>\
</tr>");
generalSelect2Set('pre_chemo_drug_id_'+pre_chemo_counter);
pre_chemo_counter++;
}
function add_chemo_drug() {
$('#chemo_drugs_div').append("<tr id='chemo_row_delete_" + chemo_counter + "'>\
<td>\
<div id='chemo_row_" + chemo_counter + "'>\
<input type='hidden' name='chemo_row_counter[]' value='" + chemo_counter + "'>\
<div class='row'>\
<div class='col-3'>\
<select name='chemo_drug_id[]' id='chemo_drug_id_" + chemo_counter + "' class='form-control compulsory required drugs_id_class' required onchange='drugs_details(" + chemo_counter + ", this.value, \"chemo\")'>@php echo $option_drugs; @endphp</select>\
</div>\
<div class='col-1'>\
<select name='chemo_drug_route[]' class='form-control compulsory' required>@php echo $option_drug_routes; @endphp</select>\
</div>\
<div class='col-2'>\
<select name='chemo_drug_factor_id[]' class='form-control compulsory' required onchange='check_factor(" + chemo_counter + ", \"chemo\")' id='chemo_drug_factor_id_" + chemo_counter + "'>@php echo $option_factors; @endphp</select>\
<div id='chemo_drug_weight_" + chemo_counter + "' style='display: none'>\
<hr>\
<label>Range (Kg)</label>\
<input type='text' name='chemo_drug_weight_range[]' class='form-control'>\
</div>\
</div>\
<div class='col-1'>\
<input type='number' name='chemo_drug_dose[]' class='form-control compulsory' required min='0' step=0.0001>\
<span style='margin-bottom: 4px; font-size: smaller;' class='chemo_drug_unit_" + chemo_counter + "'></span>\
<span style='margin-bottom: 4px; font-size: smaller;' class='chemo_drug_factor_unit_" + chemo_counter + "'></span>\
</div>\
<div class='col-2'>\
<textarea name='chemo_drug_duration[]' class='form-control compulsory' required rows='3'></textarea>\
</div>\
<div class='col-2'>\
<textarea name='chemo_drug_instructions[]' class='form-control' rows='3'></textarea>\
</div>\
<div class='col-1'>\
<a href='#chemo_row_" + chemo_counter + "' class='btn btn-outline-success btn-rounded btn-sm' onclick='add_chemo_dose(" + chemo_counter + ")'>Add Dose</a>\
<br><br>\
<button type='button' class='btn btn-sm btn-rounded btn-danger' style='color: white;' onclick='remove_field(\"chemo_row_delete_" + chemo_counter + "\")'><i class='fa fa-trash'></i></button>\
</div>\
</div>\
</div>\
</td>\
</tr>");
generalSelect2Set('chemo_drug_id_'+chemo_counter);
chemo_counter++;
}
function add_post_chemo_drug() {
$('#post_chemo_drugs_div').append("<tr id='post_chemo_row_delete_" + post_chemo_counter + "'>\
<td>\
<div id='post_chemo_row_" + post_chemo_counter + "'>\
<input type='hidden' name='post_chemo_row_counter[]' value='" + post_chemo_counter + "'>\
<div class='row'>\
<div class='col-3'>\
<select name='post_chemo_drug_id[]' id='post_chemo_drug_id_" + post_chemo_counter + "' class='form-control compulsory required drugs_id_class' required onchange='drugs_details(" + post_chemo_counter + ", this.value, \"post_chemo\")'>@php echo $option_drugs; @endphp</select>\
</div>\
<div class='col-1'>\
<select name='post_chemo_drug_route[]' class='form-control compulsory' required>@php echo $option_drug_routes; @endphp</select>\
</div>\
<div class='col-2'>\
<select name='post_chemo_drug_factor_id[]' class='form-control compulsory' required onchange='check_factor(" + post_chemo_counter + ", \"post_chemo\")' id='post_chemo_drug_factor_id_" + post_chemo_counter + "'>@php echo $option_factors; @endphp</select>\
<div id='post_chemo_drug_weight_" + post_chemo_counter + "' style='display: none'>\
<hr>\
<label>Range (Kg)</label>\
<input type='text' name='post_chemo_drug_weight_range[]' class='form-control'>\
</div>\
</div>\
<div class='col-1'>\
<input type='number' name='post_chemo_drug_dose[]' class='form-control compulsory' required min='0' step=0.0001>\
<span style='margin-bottom: 4px; font-size: smaller;' class='post_chemo_drug_unit_" + post_chemo_counter + "'></span>\
<span style='margin-bottom: 4px; font-size: smaller;' class='post_chemo_drug_factor_unit_" + post_chemo_counter + "'></span>\
</div>\
<div class='col-2'>\
<textarea name='post_chemo_drug_duration[]' class='form-control compulsory' required rows='3'></textarea>\
</div>\
<div class='col-2'>\
<textarea name='post_chemo_drug_instructions[]' class='form-control' rows='3'></textarea>\
</div>\
<div class='col-1'>\
<a href='#post_chemo_row_" + post_chemo_counter + "' class='btn btn-outline-success btn-rounded btn-sm' onclick='add_post_chemo_dose(" + post_chemo_counter + ")'>Add Dose</a>\
<br><br>\
<button type='button' class='btn btn-sm btn-rounded btn-danger' style='color: white;' onclick='remove_field(\"post_chemo_row_delete_" + post_chemo_counter + "\")'><i class='fa fa-trash'></i></button>\
</div>\
</div>\
</div>\
</td>\
</tr>");
generalSelect2Set('post_chemo_drug_id_'+post_chemo_counter);
post_chemo_counter++;
}
function generalSelect2Set(id) {
$('#'+id).select2({
width: "100%"
});
}
function add_pre_chemo_dose(row_id) {
let current_count = $('.pre_chemo_child_delete_' + row_id).length + 1;
$('#pre_chemo_row_' + row_id).append('<div class="row pre_chemo_child_delete_' + row_id + '" style="margin-top: 10px" id="pre_chemo_child_delete_' + row_id + '_' + current_count + '">\
<div class="col-5"><input type="hidden" name="pre_chemo_child_row_id[]" value="' + row_id + '"></div>\
<div class="col-2">\
<div class="pre_chemo_child_drug_weight_' + row_id + '" style="display: none">\
<label>Range (Kg)</label>\
<input type="text" name="pre_chemo_child_drug_weight_range[]" class="form-control">\
</div>\
</div>\
<div class="col-1">\
<input type="number" class="form-control compulsory" required name="pre_chemo_child_drug_dose[]" min="0" step=0.0001>\
<span style="margin-bottom: 4px; font-size: smaller;" class="pre_chemo_drug_unit_' + row_id + '"></span>\
<span style="margin-bottom: 4px; font-size: smaller;" class="pre_chemo_drug_factor_unit_' + row_id + '"></span>\
</div>\
<div class="col-2">\
<textarea name="pre_chemo_child_drug_duration[]" class="form-control compulsory" required rows="3"></textarea>\
</div>\
<div class="col-1">\
<textarea name="pre_chemo_child_drug_instructions[]" class="form-control" rows="3"></textarea>\
</div>\
<div class="col-1"><button type="button" class="btn btn-sm btn-rounded btn-danger" style="color: white;" onclick="remove_field(\'pre_chemo_child_delete_' + row_id + '_' + current_count + '\')"><i class="fa fa-trash"></i></button></div></div>');
check_factor(row_id, "pre_chemo");
}
function add_chemo_dose(row_id) {
let current_count = $('.chemo_child_delete_' + row_id).length + 1;
$('#chemo_row_' + row_id).append('<div class="row chemo_child_delete_' + row_id + '" style="margin-top: 10px" id="chemo_child_delete_' + row_id + '_' + current_count + '">\
<div class="col-5"><input type="hidden" name="chemo_child_row_id[]" value="' + row_id + '"></div>\
<div class="col-2">\
<div class="chemo_child_drug_weight_' + row_id + '" style="display: none">\
<label>Range (Kg)</label>\
<input type="text" name="chemo_child_drug_weight_range[]" class="form-control">\
</div>\
</div>\
<div class="col-1">\
<input type="number" class="form-control compulsory" required name="chemo_child_drug_dose[]" min="0" step=0.0001>\
<span style="margin-bottom: 4px; font-size: smaller;" class="chemo_drug_unit_' + row_id + '"></span>\
<span style="margin-bottom: 4px; font-size: smaller;" class="chemo_drug_factor_unit_' + row_id + '"></span>\
</div>\
<div class="col-2">\
<textarea name="chemo_child_drug_duration[]" class="form-control compulsory" required rows="3"></textarea>\
</div>\
<div class="col-1">\
<textarea name="chemo_child_drug_instructions[]" class="form-control" rows="3"></textarea>\
</div>\
<div class="col-1"><button type="button" class="btn btn-sm btn-rounded btn-danger" style="color: white;" onclick="remove_field(\'chemo_child_delete_' + row_id + '_' + current_count + '\')"><i class="fa fa-trash"></i></button></div></div>');
check_factor(row_id, "chemo");
}
function add_post_chemo_dose(row_id) {
let current_count = $('.post_chemo_child_delete_' + row_id).length + 1;
$('#post_chemo_row_' + row_id).append('<div class="row post_chemo_child_delete_' + row_id + '" style="margin-top: 10px" id="post_chemo_child_delete_' + row_id + '_' + current_count + '">\
<div class="col-5"><input type="hidden" name="post_chemo_child_row_id[]" value="' + row_id + '"></div>\
<div class="col-2">\
<div class="post_chemo_child_drug_weight_' + row_id + '" style="display: none">\
<label>Range (Kg)</label>\
<input type="text" name="post_chemo_child_drug_weight_range[]" class="form-control">\
</div>\
</div>\
<div class="col-1">\
<input type="number" class="form-control compulsory" required name="post_chemo_child_drug_dose[]" min="0" step=0.0001>\
<span style="margin-bottom: 4px; font-size: smaller;" class="post_chemo_drug_unit_' + row_id + '"></span>\
<span style="margin-bottom: 4px; font-size: smaller;" class="post_chemo_drug_factor_unit_' + row_id + '"></span>\
</div>\
<div class="col-2">\
<textarea name="post_chemo_child_drug_duration[]" class="form-control compulsory" required rows="3"></textarea>\
</div>\
<div class="col-1">\
<textarea name="post_chemo_child_drug_instructions[]" class="form-control" rows="3"></textarea>\
</div>\
<div class="col-1"><button type="button" class="btn btn-sm btn-rounded btn-danger" style="color: white;" onclick="remove_field(\'post_chemo_child_delete_' + row_id + '_' + current_count + '\')"><i class="fa fa-trash"></i></button></div></div>');
check_factor(row_id, "post_chemo");
}
function drugs_details (id, drug_id, prefix) {
$.ajax({
url: '/prescriptions/get_drug_details/',
data: {'drug_id':drug_id, 'patient_id':0, 'patient_insurance_status': 0},
success: function(response){
let arr = JSON.parse(response);
$('.' + prefix + '_drug_unit_' + id).text(arr["drug_unit"]);
}
});
}
function check_factor(id, prefix) {
let factor_value = $('#' + prefix + '_drug_factor_id_' + id).val();
if (factor_value == 1) {
$('.' + prefix + '_drug_factor_unit_' + id).html('/m<sup>2</sup>');
$('#' + prefix + '_drug_weight_' + id).hide();
$('.' + prefix + '_child_drug_weight_' + id).hide();
} else if (factor_value == 2) {
$('.' + prefix + '_drug_factor_unit_' + id).text('/Kg');
$('#' + prefix + '_drug_weight_' + id).show();
$('.' + prefix + '_child_drug_weight_' + id).show();
} else {
$('.' + prefix + '_drug_factor_unit_' + id).text('');
$('#' + prefix + '_drug_weight_' + id).hide();
$('.' + prefix + '_child_drug_weight_' + id).hide();
}
}
$('.drugs_id_class').select2({
placeholder: "Select drug"
});
function show(id) {
if (document.getElementById(id).style.display == 'none') {
document.getElementById(id).style.display = '';
}
}
function hide(id) {
document.getElementById(id).style.display = 'none';
}
</script>
@endpush
@@ -0,0 +1,665 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@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">Edit Cancer Protocol</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('cancer_protocol.dashboard') }}</a></li>
<li><a href="{{ route('cancer_protocol.index') }}">{{ __('cancer_protocol.cancer_protocols') }}</a></li>
<li class="active">Edit</li>
</ol>
</div>
</div>
@include('cancer::cancer_protocol.menu')
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
{{ Form::model($cancer_protocol, ['method' => 'PUT', 'route' => ['cancer_protocol.update',$cancer_protocol] , 'data-toggle' => 'validator']) }}
<h3>Protocol Details</h3>
<div class="row">
<div class="col-md-5">
<div class="form-group">
{{ Form::label('name', "Protocol Name") }}
{{ Form::text('name', $cancer_protocol->name, ['class' => 'form-control compulsory', 'required']) }}
</div>
</div>
<div class="col-md-2"></div>
<div class="col-md-5">
<div class="form-group">
{{ Form::label('name', "Protocol Billing Type") }}
<br>
{{ Form::radio('protocol_billing_type', 0, $cancer_protocol->protocol_billing_type == 0, ["required", "onclick" => "show('protocol_cost_div');"]) }}&nbsp; Umbrella Cost &nbsp;&nbsp;
{{ Form::radio('protocol_billing_type', 1, $cancer_protocol->protocol_billing_type == 1, ["required", "onclick" => "hide('protocol_cost_div');"]) }}&nbsp; Bill Per Drug
</div>
<br>
<div class="form-group" id="protocol_cost_div" @if($cancer_protocol->protocol_billing_type == 1) style="display: none" @endif>
{{ Form::label('protocol_cost', "Protocol Cost") }}
{{ Form::number('protocol_cost', $cancer_protocol->protocol_cost, ['class' => 'form-control compulsory', 'min' => 0]) }}
</div>
</div>
</div>
@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_counter = 0;
$chemo_counter = 0;
$post_chemo_counter = 0;
@endphp
<hr>
<h3><label class="label label-warning">PRE-CHEMOTHERAPY</label></h3>
<div class="row">
<div class="col-md-6">
{{ Form::label('pre_chemo_comments', 'Comments') }}
{{ Form::textarea('pre_chemo_comments', $cancer_protocol->pre_chemo_comments, ['class' => 'form-control compulsory', 'required', 'rows' => '5']) }}
</div>
</div>
<br>
<table class='table color-bordered-table success-bordered-table'>
<thead>
<tr>
<th>
<div class="row">
<div class="col-3">Drug</div>
<div class="col-1">Route</div>
<div class="col-2">Factor</div>
<div class="col-1">Dose</div>
<div class="col-2">Duration(Separate with commas)</div>
<div class="col-2">Instructions</div>
<div class="col-1"></div>
</div>
</th>
</tr>
</thead>
<tbody id="pre_chemo_drugs_div">
@foreach($pre_chemo_drugs as $pre_chemo_drug)
<tr id='pre_chemo_row_delete_{{ $pre_chemo_counter }}'>
<td>
<div id="pre_chemo_row_{{ $pre_chemo_counter }}">
{{ Form::hidden('pre_chemo_row_counter[]', $pre_chemo_counter) }}
<div class="row">
<div class="col-3">
{{ Form::select('pre_chemo_drug_id[]', $drugs, $pre_chemo_drug["drug_id"], ['class' => 'form-control compulsory drugs_id_class', 'id' => 'pre_chemo_drug_id_' . $pre_chemo_counter, 'onchange' => 'drugs_details(' . $pre_chemo_counter . ', this.value, \'pre_chemo\')', 'required']) }}
</div>
<div class="col-1">
{{ Form::select('pre_chemo_drug_route[]', $drug_routes, $pre_chemo_drug["drug_route"], ['class' => 'form-control compulsory', 'required']) }}
</div>
<div class="col-2">
{{ Form::select('pre_chemo_drug_factor_id[]', $factors, $pre_chemo_drug["drug_factor"], ['class' => 'form-control compulsory', 'onchange' => 'check_factor(' . $pre_chemo_counter . ', \'pre_chemo\')', 'required', 'id' => 'pre_chemo_drug_factor_id_' . $pre_chemo_counter]) }}
<div id="pre_chemo_drug_weight_{{ $pre_chemo_counter }}" @if($pre_chemo_drug["drug_factor"] != 2) style="display: none" @endif>
<hr>
{{ Form::label('pre_chemo_drug_weight_range', 'Range (Kg)') }}
{{ Form::text('pre_chemo_drug_weight_range[]', $pre_chemo_drug["dose"][0]["weight_range"], ['class' => 'form-control']) }}
</div>
</div>
<div class="col-1">
{{ Form::number('pre_chemo_drug_dose[]', $pre_chemo_drug["dose"][0]["dose"], ['class' => 'form-control compulsory', 'min' => 0, 'required', 'step' => 0.0001]) }}
<span style='margin-bottom: 4px; font-size: smaller;' class='pre_chemo_drug_unit_{{ $pre_chemo_counter }}'></span>
<span style='margin-bottom: 4px; font-size: smaller;' class='pre_chemo_drug_factor_unit_{{ $pre_chemo_counter }}'></span>
</div>
<div class="col-2">
{{ Form::textarea('pre_chemo_drug_duration[]', $pre_chemo_drug["dose"][0]["duration"], ['class' => 'form-control compulsory', 'rows' => '3', 'required']) }}
</div>
<div class="col-2">
{{ Form::textarea('pre_chemo_drug_instructions[]', $pre_chemo_drug["dose"][0]["instructions"], ['class' => 'form-control', 'rows' => '3']) }}
</div>
<div class="col-1">
<a href="#pre_chemo_row_{{ $pre_chemo_counter }}" class="btn btn-outline-success btn-rounded btn-sm" onclick="add_pre_chemo_dose({{ $pre_chemo_counter }})">Add Dose</a>
@if($pre_chemo_counter != 0)
<br><br>
<button type='button' class='btn btn-sm btn-rounded btn-danger' style='color: white;' onclick='remove_field("pre_chemo_row_delete_{{ $pre_chemo_counter }}")'><i class='fa fa-trash'></i></button>
@endif
</div>
</div>
@for($x=1; $x < count($pre_chemo_drug["dose"]); $x++)
<div class="row pre_chemo_child_delete_{{ $pre_chemo_counter }}" style="margin-top: 10px" id="pre_chemo_child_delete_{{ $pre_chemo_counter }}_{{ $x }}">
<div class="col-5"><input type="hidden" name="pre_chemo_child_row_id[]" value="{{ $pre_chemo_counter }}"></div>
<div class="col-2">
<div class="pre_chemo_child_drug_weight_{{ $pre_chemo_counter }}" @if($pre_chemo_drug["drug_factor"] != 2) style="display: none" @endif>
<label>Range (Kg)</label>
<input type="text" name="pre_chemo_child_drug_weight_range[]" class="form-control" value="{{ $pre_chemo_drug["dose"][$x]["weight_range"] }}">
</div>
</div>
<div class="col-1">
<input type="number" class="form-control compulsory" required name="pre_chemo_child_drug_dose[]" min="0" value="{{ $pre_chemo_drug["dose"][$x]["dose"] }}" step='0.0001'>
<span style="margin-bottom: 4px; font-size: smaller;" class="pre_chemo_drug_unit_{{ $pre_chemo_counter }}"></span>
<span style="margin-bottom: 4px; font-size: smaller;" class="pre_chemo_drug_factor_unit_{{ $pre_chemo_counter }}"></span>
</div>
<div class="col-2">
<textarea name="pre_chemo_child_drug_duration[]" class="form-control compulsory" required rows="3">{{ $pre_chemo_drug["dose"][$x]["duration"] }}</textarea>
</div>
<div class="col-1">
<textarea name="pre_chemo_child_drug_instructions[]" class="form-control" rows="3">{{ $pre_chemo_drug["dose"][$x]["instructions"] }}</textarea>
</div>
<div class="col-1"><button type="button" class="btn btn-sm btn-rounded btn-danger" style="color: white;" onclick="remove_field('pre_chemo_child_delete_{{ $pre_chemo_counter }}_{{ $x }}')"><i class="fa fa-trash"></i></button></div></div>
@endfor
</div>
</td>
</tr>
@php $pre_chemo_counter++; @endphp
@endforeach
</tbody>
</table>
<a class="btn btn-success btn-rounded btn-sm" onclick="add_pre_chemo_drug()">Add Drug</a>
<hr>
<h3><label class="label label-warning">CHEMOTHERAPY</label></h3>
<div class="row">
<div class="col-md-6">
{{ Form::label('chemo_comments', 'Comments') }}
{{ Form::textarea('chemo_comments', $cancer_protocol->chemo_comments, ['class' => 'form-control compulsory', 'required', 'rows' => '5']) }}
</div>
</div>
<br>
<table class='table color-bordered-table success-bordered-table'>
<thead>
<tr>
<th>
<div class="row">
<div class="col-3">Drug</div>
<div class="col-1">Route</div>
<div class="col-2">Factor</div>
<div class="col-1">Dose</div>
<div class="col-2">Duration(Separate with commas)</div>
<div class="col-2">Instructions</div>
<div class="col-1"></div>
</div>
</th>
</tr>
</thead>
<tbody id="chemo_drugs_div">
@foreach($chemo_drugs as $chemo_drug)
<tr id='chemo_row_delete_{{ $chemo_counter }}'>
<td>
<div id="chemo_row_{{ $chemo_counter }}">
{{ Form::hidden('chemo_row_counter[]', $chemo_counter) }}
<div class="row">
<div class="col-3">
{{ Form::select('chemo_drug_id[]', $drugs, $chemo_drug["drug_id"], ['class' => 'form-control compulsory drugs_id_class', 'id' => 'chemo_drug_id_' . $chemo_counter, 'onchange' => 'drugs_details(' . $chemo_counter . ', this.value, \'chemo\')', 'required']) }}
</div>
<div class="col-1">
{{ Form::select('chemo_drug_route[]', $drug_routes, $chemo_drug["drug_route"], ['class' => 'form-control compulsory', 'required']) }}
</div>
<div class="col-2">
{{ Form::select('chemo_drug_factor_id[]', $factors, $chemo_drug["drug_factor"], ['class' => 'form-control compulsory', 'onchange' => 'check_factor(' . $chemo_counter . ', \'chemo\')', 'required', 'id' => 'chemo_drug_factor_id_' . $chemo_counter]) }}
<div id="chemo_drug_weight_{{ $chemo_counter }}" @if($chemo_drug["drug_factor"] != 2) style="display: none" @endif>
<hr>
{{ Form::label('chemo_drug_weight_range', 'Range (Kg)') }}
{{ Form::text('chemo_drug_weight_range[]', $chemo_drug["dose"][0]["weight_range"], ['class' => 'form-control']) }}
</div>
</div>
<div class="col-1">
{{ Form::number('chemo_drug_dose[]', $chemo_drug["dose"][0]["dose"], ['class' => 'form-control compulsory', 'min' => 0, 'required', 'step' => 0.0001]) }}
<span style='margin-bottom: 4px; font-size: smaller;' class='chemo_drug_unit_{{ $chemo_counter }}'></span>
<span style='margin-bottom: 4px; font-size: smaller;' class='chemo_drug_factor_unit_{{ $chemo_counter }}'></span>
</div>
<div class="col-2">
{{ Form::textarea('chemo_drug_duration[]', $chemo_drug["dose"][0]["duration"], ['class' => 'form-control compulsory', 'rows' => '3', 'required']) }}
</div>
<div class="col-2">
{{ Form::textarea('chemo_drug_instructions[]', $chemo_drug["dose"][0]["instructions"], ['class' => 'form-control', 'rows' => '3']) }}
</div>
<div class="col-1">
<a href="#chemo_row_{{ $chemo_counter }}" class="btn btn-outline-success btn-rounded btn-sm" onclick="add_chemo_dose({{ $chemo_counter }})">Add Dose</a>
@if($chemo_counter != 0)
<br><br>
<button type='button' class='btn btn-sm btn-rounded btn-danger' style='color: white;' onclick='remove_field("chemo_row_delete_{{ $chemo_counter }}")'><i class='fa fa-trash'></i></button>
@endif
</div>
</div>
@for($x=1; $x < count($chemo_drug["dose"]); $x++)
<div class="row chemo_child_delete_{{ $chemo_counter }}" style="margin-top: 10px" id="chemo_child_delete_{{ $chemo_counter }}_{{ $x }}">
<div class="col-5"><input type="hidden" name="chemo_child_row_id[]" value="{{ $chemo_counter }}"></div>
<div class="col-2">
<div class="chemo_child_drug_weight_{{ $chemo_counter }}" @if($chemo_drug["drug_factor"] != 2) style="display: none" @endif>
<label>Range (Kg)</label>
<input type="text" name="chemo_child_drug_weight_range[]" class="form-control" value="{{ $chemo_drug["dose"][$x]["weight_range"] }}">
</div>
</div>
<div class="col-1">
<input type="number" class="form-control compulsory" required name="chemo_child_drug_dose[]" min="0" value="{{ $chemo_drug["dose"][$x]["dose"] }}" step='0.0001'>
<span style="margin-bottom: 4px; font-size: smaller;" class="chemo_drug_unit_{{ $chemo_counter }}"></span>
<span style="margin-bottom: 4px; font-size: smaller;" class="chemo_drug_factor_unit_{{ $chemo_counter }}"></span>
</div>
<div class="col-2">
<textarea name="chemo_child_drug_duration[]" class="form-control compulsory" required rows="3">{{ $chemo_drug["dose"][$x]["duration"] }}</textarea>
</div>
<div class="col-1">
<textarea name="chemo_child_drug_instructions[]" class="form-control" rows="3">{{ $chemo_drug["dose"][$x]["instructions"] }}</textarea>
</div>
<div class="col-1"><button type="button" class="btn btn-sm btn-rounded btn-danger" style="color: white;" onclick="remove_field('chemo_child_delete_{{ $chemo_counter }}_{{ $x }}')"><i class="fa fa-trash"></i></button></div></div>
@endfor
</div>
</td>
</tr>
@php $chemo_counter++; @endphp
@endforeach
</tbody>
</table>
<a class="btn btn-success btn-rounded btn-sm" onclick="add_chemo_drug()">Add Drug</a>
<hr>
<h3><label class="label label-warning">POST-CHEMOTHERAPY</label></h3>
<div class="row">
<div class="col-md-6">
{{ Form::label('post_chemo_comments', 'Comments') }}
{{ Form::textarea('post_chemo_comments', $cancer_protocol->post_chemo_comments, ['class' => 'form-control compulsory', 'required', 'rows' => '5']) }}
</div>
</div>
<br>
<table class='table color-bordered-table success-bordered-table'>
<thead>
<tr>
<th>
<div class="row">
<div class="col-3">Drug</div>
<div class="col-1">Route</div>
<div class="col-2">Factor</div>
<div class="col-1">Dose</div>
<div class="col-2">Duration(Separate with commas)</div>
<div class="col-2">Instructions</div>
<div class="col-1"></div>
</div>
</th>
</tr>
</thead>
<tbody id="post_chemo_drugs_div">
@foreach($post_chemo_drugs as $post_chemo_drug)
<tr id='post_chemo_row_delete_{{ $post_chemo_counter }}'>
<td>
<div id="post_chemo_row_{{ $post_chemo_counter }}">
{{ Form::hidden('post_chemo_row_counter[]', $post_chemo_counter) }}
<div class="row">
<div class="col-3">
{{ Form::select('post_chemo_drug_id[]', $drugs, $post_chemo_drug["drug_id"], ['class' => 'form-control compulsory drugs_id_class', 'id' => 'post_chemo_drug_id_' . $post_chemo_counter, 'onchange' => 'drugs_details(' . $post_chemo_counter . ', this.value, \'post_chemo\')', 'required']) }}
</div>
<div class="col-1">
{{ Form::select('post_chemo_drug_route[]', $drug_routes, $post_chemo_drug["drug_route"], ['class' => 'form-control compulsory', 'required']) }}
</div>
<div class="col-2">
{{ Form::select('post_chemo_drug_factor_id[]', $factors, $post_chemo_drug["drug_factor"], ['class' => 'form-control compulsory', 'onchange' => 'check_factor(' . $post_chemo_counter . ', \'post_chemo\')', 'required', 'id' => 'post_chemo_drug_factor_id_' . $post_chemo_counter]) }}
<div id="post_chemo_drug_weight_{{ $post_chemo_counter }}" @if($post_chemo_drug["drug_factor"] != 2) style="display: none" @endif>
<hr>
{{ Form::label('post_chemo_drug_weight_range', 'Range (Kg)') }}
{{ Form::text('post_chemo_drug_weight_range[]', $post_chemo_drug["dose"][0]["weight_range"], ['class' => 'form-control']) }}
</div>
</div>
<div class="col-1">
{{ Form::number('post_chemo_drug_dose[]', $post_chemo_drug["dose"][0]["dose"], ['class' => 'form-control compulsory', 'min' => 0, 'required', 'step' => 0.0001]) }}
<span style='margin-bottom: 4px; font-size: smaller;' class='post_chemo_drug_unit_{{ $post_chemo_counter }}'></span>
<span style='margin-bottom: 4px; font-size: smaller;' class='post_chemo_drug_factor_unit_{{ $post_chemo_counter }}'></span>
</div>
<div class="col-2">
{{ Form::textarea('post_chemo_drug_duration[]', $post_chemo_drug["dose"][0]["duration"], ['class' => 'form-control compulsory', 'rows' => '3', 'required']) }}
</div>
<div class="col-2">
{{ Form::textarea('post_chemo_drug_instructions[]', $post_chemo_drug["dose"][0]["instructions"], ['class' => 'form-control', 'rows' => '3']) }}
</div>
<div class="col-1">
<a href="#post_chemo_row_{{ $post_chemo_counter }}" class="btn btn-outline-success btn-rounded btn-sm" onclick="add_post_chemo_dose({{ $post_chemo_counter }})">Add Dose</a>
@if($post_chemo_counter != 0)
<br><br>
<button type='button' class='btn btn-sm btn-rounded btn-danger' style='color: white;' onclick='remove_field("post_chemo_row_delete_{{ $post_chemo_counter }}")'><i class='fa fa-trash'></i></button>
@endif
</div>
</div>
@for($x=1; $x < count($post_chemo_drug["dose"]); $x++)
<div class="row post_chemo_child_delete_{{ $post_chemo_counter }}" style="margin-top: 10px" id="post_chemo_child_delete_{{ $post_chemo_counter }}_{{ $x }}">
<div class="col-5"><input type="hidden" name="post_chemo_child_row_id[]" value="{{ $post_chemo_counter }}"></div>
<div class="col-2">
<div class="post_chemo_child_drug_weight_{{ $post_chemo_counter }}" @if($pre_chemo_drug["drug_factor"] != 2) style="display: none" @endif>
<label>Range (Kg)</label>
<input type="text" name="post_chemo_child_drug_weight_range[]" class="form-control" value="{{ $post_chemo_drug["dose"][$x]["weight_range"] }}">
</div>
</div>
<div class="col-1">
<input type="number" class="form-control compulsory" required name="post_chemo_child_drug_dose[]" min="0" value="{{ $post_chemo_drug["dose"][$x]["dose"] }}" step='0.0001'>
<span style="margin-bottom: 4px; font-size: smaller;" class="post_chemo_drug_unit_{{ $post_chemo_counter }}"></span>
<span style="margin-bottom: 4px; font-size: smaller;" class="post_chemo_drug_factor_unit_{{ $post_chemo_counter }}"></span>
</div>
<div class="col-2">
<textarea name="post_chemo_child_drug_duration[]" class="form-control compulsory" required rows="3">{{ $post_chemo_drug["dose"][$x]["duration"] }}</textarea>
</div>
<div class="col-1">
<textarea name="post_chemo_child_drug_instructions[]" class="form-control" rows="3">{{ $post_chemo_drug["dose"][$x]["instructions"] }}</textarea>
</div>
<div class="col-1"><button type="button" class="btn btn-sm btn-rounded btn-danger" style="color: white;" onclick="remove_field('post_chemo_child_delete_{{ $post_chemo_counter }}_{{ $x }}')"><i class="fa fa-trash"></i></button></div></div>
@endfor
</div>
</td>
</tr>
@php $post_chemo_counter++; @endphp
@endforeach
</tbody>
</table>
<a class="btn btn-success btn-rounded btn-sm" onclick="add_post_chemo_drug()">Add Drug</a>
<hr>
{{ Form::button(__('cancer_protocol.submit'),['type'=>'submit','class'=>'btn btn-success btn-rounded waves-effect waves-light m-r-10']) }}
{{ Form::button(__('cancer_protocol.cancel'),['type'=>'reset','class'=>'btn btn-default btn-rounded waves-effect waves-light']) }}
{{ Form::close() }}
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script>
let pre_chemo_counter = {{ $pre_chemo_counter }};
let chemo_counter = {{ $chemo_counter }};
let post_chemo_counter = {{ $post_chemo_counter }};
function remove_field(id) {
$('#' + id).remove();
}
function add_pre_chemo_drug() {
$('#pre_chemo_drugs_div').append("<tr id='pre_chemo_row_delete_" + pre_chemo_counter + "'>\
<td>\
<div id='pre_chemo_row_" + pre_chemo_counter + "'>\
<input type='hidden' name='pre_chemo_row_counter[]' value='" + pre_chemo_counter + "'>\
<div class='row'>\
<div class='col-3'>\
<select name='pre_chemo_drug_id[]' id='pre_chemo_drug_id_" + pre_chemo_counter + "' class='form-control compulsory required drugs_id_class' required onchange='drugs_details(" + pre_chemo_counter + ", this.value, \"pre_chemo\")'>@php echo $option_drugs; @endphp</select>\
</div>\
<div class='col-1'>\
<select name='pre_chemo_drug_route[]' class='form-control compulsory' required>@php echo $option_drug_routes; @endphp</select>\
</div>\
<div class='col-2'>\
<select name='pre_chemo_drug_factor_id[]' class='form-control compulsory' required onchange='check_factor(" + pre_chemo_counter + ", \"pre_chemo\")' id='pre_chemo_drug_factor_id_" + pre_chemo_counter + "'>@php echo $option_factors; @endphp</select>\
<div id='pre_chemo_drug_weight_" + pre_chemo_counter + "' style='display: none'>\
<hr>\
<label>Range (Kg)</label>\
<input type='text' name='pre_chemo_drug_weight_range[]' class='form-control'>\
</div>\
</div>\
<div class='col-1'>\
<input type='number' name='pre_chemo_drug_dose[]' class='form-control compulsory' required min='0' step=0.0001>\
<span style='margin-bottom: 4px; font-size: smaller;' class='pre_chemo_drug_unit_" + pre_chemo_counter + "'></span>\
<span style='margin-bottom: 4px; font-size: smaller;' class='pre_chemo_drug_factor_unit_" + pre_chemo_counter + "'></span>\
</div>\
<div class='col-2'>\
<textarea name='pre_chemo_drug_duration[]' class='form-control compulsory' required rows='3'></textarea>\
</div>\
<div class='col-2'>\
<textarea name='pre_chemo_drug_instructions[]' class='form-control' rows='3'></textarea>\
</div>\
<div class='col-1'>\
<a href='#pre_chemo_row_" + pre_chemo_counter + "' class='btn btn-outline-success btn-rounded btn-sm' onclick='add_pre_chemo_dose(" + pre_chemo_counter + ")'>Add Dose</a>\
<br><br>\
<button type='button' class='btn btn-sm btn-rounded btn-danger' style='color: white;' onclick='remove_field(\"pre_chemo_row_delete_" + pre_chemo_counter + "\")'><i class='fa fa-trash'></i></button>\
</div>\
</div>\
</div>\
</td>\
</tr>");
generalSelect2Set('pre_chemo_drug_id_'+pre_chemo_counter);
pre_chemo_counter++;
}
function add_chemo_drug() {
$('#chemo_drugs_div').append("<tr id='chemo_row_delete_" + chemo_counter + "'>\
<td>\
<div id='chemo_row_" + chemo_counter + "'>\
<input type='hidden' name='chemo_row_counter[]' value='" + chemo_counter + "'>\
<div class='row'>\
<div class='col-3'>\
<select name='chemo_drug_id[]' id='chemo_drug_id_" + chemo_counter + "' class='form-control compulsory required drugs_id_class' required onchange='drugs_details(" + chemo_counter + ", this.value, \"chemo\")'>@php echo $option_drugs; @endphp</select>\
</div>\
<div class='col-1'>\
<select name='chemo_drug_route[]' class='form-control compulsory' required>@php echo $option_drug_routes; @endphp</select>\
</div>\
<div class='col-2'>\
<select name='chemo_drug_factor_id[]' class='form-control compulsory' required onchange='check_factor(" + chemo_counter + ", \"chemo\")' id='chemo_drug_factor_id_" + chemo_counter + "'>@php echo $option_factors; @endphp</select>\
<div id='chemo_drug_weight_" + chemo_counter + "' style='display: none'>\
<hr>\
<label>Range (Kg)</label>\
<input type='text' name='chemo_drug_weight_range[]' class='form-control'>\
</div>\
</div>\
<div class='col-1'>\
<input type='number' name='chemo_drug_dose[]' class='form-control compulsory' required min='0' step=0.0001>\
<span style='margin-bottom: 4px; font-size: smaller;' class='chemo_drug_unit_" + chemo_counter + "'></span>\
<span style='margin-bottom: 4px; font-size: smaller;' class='chemo_drug_factor_unit_" + chemo_counter + "'></span>\
</div>\
<div class='col-2'>\
<textarea name='chemo_drug_duration[]' class='form-control compulsory' required rows='3'></textarea>\
</div>\
<div class='col-2'>\
<textarea name='chemo_drug_instructions[]' class='form-control' rows='3'></textarea>\
</div>\
<div class='col-1'>\
<a href='#chemo_row_" + chemo_counter + "' class='btn btn-outline-success btn-rounded btn-sm' onclick='add_chemo_dose(" + chemo_counter + ")'>Add Dose</a>\
<br><br>\
<button type='button' class='btn btn-sm btn-rounded btn-danger' style='color: white;' onclick='remove_field(\"chemo_row_delete_" + chemo_counter + "\")'><i class='fa fa-trash'></i></button>\
</div>\
</div>\
</div>\
</td>\
</tr>");
generalSelect2Set('chemo_drug_id_'+chemo_counter);
chemo_counter++;
}
function add_post_chemo_drug() {
$('#post_chemo_drugs_div').append("<tr id='post_chemo_row_delete_" + post_chemo_counter + "'>\
<td>\
<div id='post_chemo_row_" + post_chemo_counter + "'>\
<input type='hidden' name='post_chemo_row_counter[]' value='" + post_chemo_counter + "'>\
<div class='row'>\
<div class='col-3'>\
<select name='post_chemo_drug_id[]' id='post_chemo_drug_id_" + post_chemo_counter + "' class='form-control compulsory required drugs_id_class' required onchange='drugs_details(" + post_chemo_counter + ", this.value, \"post_chemo\")'>@php echo $option_drugs; @endphp</select>\
</div>\
<div class='col-1'>\
<select name='post_chemo_drug_route[]' class='form-control compulsory' required>@php echo $option_drug_routes; @endphp</select>\
</div>\
<div class='col-2'>\
<select name='post_chemo_drug_factor_id[]' class='form-control compulsory' required onchange='check_factor(" + post_chemo_counter + ", \"post_chemo\")' id='post_chemo_drug_factor_id_" + post_chemo_counter + "'>@php echo $option_factors; @endphp</select>\
<div id='post_chemo_drug_weight_" + post_chemo_counter + "' style='display: none'>\
<hr>\
<label>Range (Kg)</label>\
<input type='text' name='post_chemo_drug_weight_range[]' class='form-control'>\
</div>\
</div>\
<div class='col-1'>\
<input type='number' name='post_chemo_drug_dose[]' class='form-control compulsory' required min='0' step=0.0001>\
<span style='margin-bottom: 4px; font-size: smaller;' class='post_chemo_drug_unit_" + post_chemo_counter + "'></span>\
<span style='margin-bottom: 4px; font-size: smaller;' class='post_chemo_drug_factor_unit_" + post_chemo_counter + "'></span>\
</div>\
<div class='col-2'>\
<textarea name='post_chemo_drug_duration[]' class='form-control compulsory' required rows='3'></textarea>\
</div>\
<div class='col-2'>\
<textarea name='post_chemo_drug_instructions[]' class='form-control' rows='3'></textarea>\
</div>\
<div class='col-1'>\
<a href='#post_chemo_row_" + post_chemo_counter + "' class='btn btn-outline-success btn-rounded btn-sm' onclick='add_post_chemo_dose(" + post_chemo_counter + ")'>Add Dose</a>\
<br><br>\
<button type='button' class='btn btn-sm btn-rounded btn-danger' style='color: white;' onclick='remove_field(\"post_chemo_row_delete_" + post_chemo_counter + "\")'><i class='fa fa-trash'></i></button>\
</div>\
</div>\
</div>\
</td>\
</tr>");
generalSelect2Set('post_chemo_drug_id_'+post_chemo_counter);
post_chemo_counter++;
}
function generalSelect2Set(id) {
$('#'+id).select2({
width: "100%"
});
}
function add_pre_chemo_dose(row_id) {
let current_count = $('.pre_chemo_child_delete_' + row_id).length + 1;
$('#pre_chemo_row_' + row_id).append('<div class="row pre_chemo_child_delete_' + row_id + '" style="margin-top: 10px" id="pre_chemo_child_delete_' + row_id + '_' + current_count + '">\
<div class="col-5"><input type="hidden" name="pre_chemo_child_row_id[]" value="' + row_id + '"></div>\
<div class="col-2">\
<div class="pre_chemo_child_drug_weight_' + row_id + '" style="display: none">\
<label>Range (Kg)</label>\
<input type="text" name="pre_chemo_child_drug_weight_range[]" class="form-control">\
</div>\
</div>\
<div class="col-1">\
<input type="number" class="form-control compulsory" required name="pre_chemo_child_drug_dose[]" min="0" step=0.0001>\
<span style="margin-bottom: 4px; font-size: smaller;" class="pre_chemo_drug_unit_' + row_id + '"></span>\
<span style="margin-bottom: 4px; font-size: smaller;" class="pre_chemo_drug_factor_unit_' + row_id + '"></span>\
</div>\
<div class="col-2">\
<textarea name="pre_chemo_child_drug_duration[]" class="form-control compulsory" required rows="3"></textarea>\
</div>\
<div class="col-1">\
<textarea name="pre_chemo_child_drug_instructions[]" class="form-control" rows="3"></textarea>\
</div>\
<div class="col-1"><button type="button" class="btn btn-sm btn-rounded btn-danger" style="color: white;" onclick="remove_field(\'pre_chemo_child_delete_' + row_id + '_' + current_count + '\')"><i class="fa fa-trash"></i></button></div></div>');
check_factor(row_id, "pre_chemo");
}
function add_chemo_dose(row_id) {
let current_count = $('.chemo_child_delete_' + row_id).length + 1;
$('#chemo_row_' + row_id).append('<div class="row chemo_child_delete_' + row_id + '" style="margin-top: 10px" id="chemo_child_delete_' + row_id + '_' + current_count + '">\
<div class="col-5"><input type="hidden" name="chemo_child_row_id[]" value="' + row_id + '"></div>\
<div class="col-2">\
<div class="chemo_child_drug_weight_' + row_id + '" style="display: none">\
<label>Range (Kg)</label>\
<input type="text" name="chemo_child_drug_weight_range[]" class="form-control">\
</div>\
</div>\
<div class="col-1">\
<input type="number" class="form-control compulsory" required name="chemo_child_drug_dose[]" min="0" step=0.0001>\
<span style="margin-bottom: 4px; font-size: smaller;" class="chemo_drug_unit_' + row_id + '"></span>\
<span style="margin-bottom: 4px; font-size: smaller;" class="chemo_drug_factor_unit_' + row_id + '"></span>\
</div>\
<div class="col-2">\
<textarea name="chemo_child_drug_duration[]" class="form-control compulsory" required rows="3"></textarea>\
</div>\
<div class="col-1">\
<textarea name="chemo_child_drug_instructions[]" class="form-control" rows="3"></textarea>\
</div>\
<div class="col-1"><button type="button" class="btn btn-sm btn-rounded btn-danger" style="color: white;" onclick="remove_field(\'chemo_child_delete_' + row_id + '_' + current_count + '\')"><i class="fa fa-trash"></i></button></div></div>');
check_factor(row_id, "chemo");
}
function add_post_chemo_dose(row_id) {
let current_count = $('.post_chemo_child_delete_' + row_id).length + 1;
$('#post_chemo_row_' + row_id).append('<div class="row post_chemo_child_delete_' + row_id + '" style="margin-top: 10px" id="post_chemo_child_delete_' + row_id + '_' + current_count + '">\
<div class="col-5"><input type="hidden" name="post_chemo_child_row_id[]" value="' + row_id + '"></div>\
<div class="col-2">\
<div class="post_chemo_child_drug_weight_' + row_id + '" style="display: none">\
<label>Range (Kg)</label>\
<input type="text" name="post_chemo_child_drug_weight_range[]" class="form-control">\
</div>\
</div>\
<div class="col-1">\
<input type="number" class="form-control compulsory" required name="post_chemo_child_drug_dose[]" min="0" step=0.0001>\
<span style="margin-bottom: 4px; font-size: smaller;" class="post_chemo_drug_unit_' + row_id + '"></span>\
<span style="margin-bottom: 4px; font-size: smaller;" class="post_chemo_drug_factor_unit_' + row_id + '"></span>\
</div>\
<div class="col-2">\
<textarea name="post_chemo_child_drug_duration[]" class="form-control compulsory" required rows="3"></textarea>\
</div>\
<div class="col-1">\
<textarea name="post_chemo_child_drug_instructions[]" class="form-control" rows="3"></textarea>\
</div>\
<div class="col-1"><button type="button" class="btn btn-sm btn-rounded btn-danger" style="color: white;" onclick="remove_field(\'post_chemo_child_delete_' + row_id + '_' + current_count + '\')"><i class="fa fa-trash"></i></button></div></div>');
check_factor(row_id, "post_chemo");
}
function drugs_details (id, drug_id, prefix) {
$.ajax({
url: '/prescriptions/get_drug_details/',
data: {'drug_id':drug_id, 'patient_id':0, 'patient_insurance_status': 0},
success: function(response){
let arr = JSON.parse(response);
$('.' + prefix + '_drug_unit_' + id).text(arr["drug_unit"]);
}
});
}
function check_factor(id, prefix) {
let factor_value = $('#' + prefix + '_drug_factor_id_' + id).val();
if (factor_value == 1) {
$('.' + prefix + '_drug_factor_unit_' + id).html('/m<sup>2</sup>');
$('#' + prefix + '_drug_weight_' + id).hide();
$('.' + prefix + '_child_drug_weight_' + id).hide();
} else if (factor_value == 2) {
$('.' + prefix + '_drug_factor_unit_' + id).text('/Kg');
$('#' + prefix + '_drug_weight_' + id).show();
$('.' + prefix + '_child_drug_weight_' + id).show();
} else {
$('.' + prefix + '_drug_factor_unit_' + id).text('');
$('#' + prefix + '_drug_weight_' + id).hide();
$('.' + prefix + '_child_drug_weight_' + id).hide();
}
}
$('.drugs_id_class').select2({
placeholder: "Select drug"
});
function show(id) {
if (document.getElementById(id).style.display == 'none') {
document.getElementById(id).style.display = '';
}
}
function hide(id) {
document.getElementById(id).style.display = 'none';
}
</script>
@endpush
@@ -0,0 +1,84 @@
@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">Inactive 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">Inactive Protocols</li>
</ol>
</div>
</div>
@include('cancer::cancer_protocol.menu')
<div class="white-box">
@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>Billing Type</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($cancer_protocols as $cancer_protocol)
<tr>
<td>{{ $cancer_protocol->name }}</td>
<td>
@if($cancer_protocol->protocol_billing_type == 0)
Total Cost of {{ ugandan_shillings($cancer_protocol->protocol_cost) }}
@else
Billing Per Drug
@endif
</td>
<td>
{{ Form::model($cancer_protocol->id ,['method' => 'POST', 'route' => ['cancer_protocol.activate', $cancer_protocol->id]]) }}
<button type="submit" class="btn btn-warning" onclick="return confirm('<?php echo __('age_groups.are_you_sure'); ?>')"><i class="fa fa-check"></i> {{ __('age_groups.activate') }}</button>
{{ Form::close() }}
</td>
</tr>
@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
@@ -0,0 +1,227 @@
@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
@@ -0,0 +1,5 @@
<div class="white-box">
@if(Auth::user()->can('cancer-protocol-create'))<a href="/cancer_protocol/create" class="nav-item btn btn-success" style="border-radius: 5px;"><i class="fa fa-plus"></i> <span style="margin-left: 10px">{{ __('cancer_protocol.add_cancer_protocol') }}</span></a>@endif
@if(Auth::user()->can('cancer-protocol-list'))<a href="/cancer_protocol/" class="nav-item btn btn-info" style="border-radius: 5px;"><i class="fa fa-eye"></i> <span style="margin-left: 10px">{{ __('cancer_protocol.view_cancer_protocols') }}</span></a>@endif
@if(Auth::user()->can('cancer-protocol-delete'))<a href="/cancer_protocol/inactive" class="nav-item btn btn-danger" style="border-radius: 5px;"><i class="fa fa-trash"></i> <span style="margin-left: 10px">{{ __('cancer_protocol.inactive_cancer_protocols') }}</span></a>@endif
</div>
@@ -0,0 +1,272 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@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">Prescribe Protocol</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">Prescribe Protocol</li>
</ol>
</div>
</div>
@include('patients::allergies.header')
<div class="white-box">
@include('flash::message')
{{ Form::open(['route' => 'cancer_protocol.order_protocol' , 'data-toggle' => 'validator']) }}
{{ Form::label('cancer_protocols', 'Choose cancer protocols') }}
<div class="form-group">
{{ Form::select('cancer_protocols[]', $cancer_protocols, '',['id'=>'cancer_protocols', 'multiple', 'class' => 'form-control', 'required']) }}
</div>
{{ Form::button(__('cancer_protocol.submit'),['type'=>'submit','class'=>'btn btn-success btn-rounded waves-effect waves-light m-r-10']) }}
{{ Form::close() }}
<hr>
@php $count = 1; @endphp
@if(count($selected_protocols) > 0)
{{ Form::open(['route' => 'cancer_protocol.save_protocol_order' , 'data-toggle' => 'validator']) }}
{{ Form::hidden('patient_id', $patient_id) }}
{{ Form::hidden('episode_id', $episode_id) }}
{{ Form::hidden('inpatient_info_id', $inpatient_info_id) }}
<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 width="8%">Adjusted Dose</th>
<th>Duration</th>
<th>Instructions</th>
</tr>
</thead>
<tbody>
@foreach($selected_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 class="protocol_row_{{ $count }}">
<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>
{{ Form::hidden('protocol_id[]', $cancer_protocol->id) }}
<br>
@if($cancer_protocol->protocol_billing_type == 0)
Total Cost of {{ ugandan_shillings($cancer_protocol->protocol_cost) }}
@else
Billing Per Drug
@endif
<hr>
<a class="btn btn-danger btn-rounded" onclick="remove_protocol({{ $count }})">Remove</a>
</td>
</tr>
<tr class="protocol_row_{{ $count }}">
<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 class="protocol_row_{{ $count }}">
<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 class="protocol_row_{{ $count }}">
<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>
{{ Form::number('adjusted_dose[]', '', ['class' => 'form-control', 'step' => '0.0001']) }}
<br><br>
{{ Form::label('adjusted_dose_reason', 'Reason') }}
{{ Form::textarea('adjusted_dose_reason[]', '', ['class' => 'form-control', 'rows' => 2]) }}
</td>
<td>{{ $pre_chemo_drugs[$x]['dose'][$i]['duration'] }}</td>
<td>{{ $pre_chemo_drugs[$x]['dose'][$i]['instructions'] }}</td>
</tr>
@endfor
@endfor
<tr class="protocol_row_{{ $count }}">
<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 class="protocol_row_{{ $count }}">
<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 class="protocol_row_{{ $count }}">
<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>
{{ Form::number('adjusted_dose[]', '', ['class' => 'form-control', 'step' => '0.0001']) }}
<br><br>
{{ Form::label('adjusted_dose_reason', 'Reason') }}
{{ Form::textarea('adjusted_dose_reason[]', '', ['class' => 'form-control', 'rows' => 2]) }}
</td>
<td>{{ $chemo_drugs[$x]['dose'][$i]['duration'] }}</td>
<td>{{ $chemo_drugs[$x]['dose'][$i]['instructions'] }}</td>
</tr>
@endfor
@endfor
<tr class="protocol_row_{{ $count }}">
<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 class="protocol_row_{{ $count }}">
<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 class="protocol_row_{{ $count }}">
<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>
{{ Form::number('adjusted_dose[]', '', ['class' => 'form-control', 'step' => '0.0001']) }}
<br><br>
{{ Form::label('adjusted_dose_reason', 'Reason') }}
{{ Form::textarea('adjusted_dose_reason[]', '', ['class' => 'form-control', 'rows' => 2]) }}
</td>
<td>{{ $post_chemo_drugs[$x]['dose'][$i]['duration'] }}</td>
<td>{{ $post_chemo_drugs[$x]['dose'][$i]['instructions'] }}</td>
</tr>
@endfor
@endfor
@php $count++ @endphp
@endforeach
</tbody>
</table>
{{ Form::button(__('cancer_protocol.submit'),['type'=>'submit','class'=>'btn btn-success btn-rounded waves-effect waves-light m-r-10']) }}
{{ Form::close() }}
@else
<code class="text-center">Please select a protocol above to continue</code>
@endif
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script>
$('#cancer_protocols').select2({
placeholder: "Select",
width: "100%"
});
function remove_protocol(count) {
if (confirm("Are you sure you want to remove this protocol?")) {
$('.protocol_row_' + count).remove();
}
}
</script>
@endpush
@@ -0,0 +1,202 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
<title>{{ config('app.name', 'Inpatient Bill - Stre@mline') }}</title>
<!-- Bootstrap Core CSS -->
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<style>
body{
font-size: 0.8em;
}
/*thead, tfoot { display: table-row-group }*/
thead {
display: table-header-group;
}
tfoot {
display: table-row-group;
}
tr {
page-break-before: always;
page-break-after: always;
page-break-inside: avoid !important;
}
</style>
</head>
<body>
<div class="container-fluid">
@include('layouts.header_pdf_print')
<table id="table" class="table table-striped 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
</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>
</body>
</html>