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