mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-11 18:51:31 +00:00
409 lines
23 KiB
PHP
Executable File
409 lines
23 KiB
PHP
Executable File
@extends('layouts.main')
|
|
|
|
@push('styles')
|
|
<link href="{{ asset('elite/bower_components/icheck/skins/all.css') }}" rel="stylesheet">
|
|
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
|
@endpush
|
|
@php
|
|
$section_number = '3';
|
|
$inpatient =array_filter($hmis_categories, function ($item) use ($section_number) {
|
|
return $item['section_number'] == $section_number;
|
|
});
|
|
$type = '0';
|
|
$outpatient =array_filter($hmis_categories, function ($item) use ($type) {
|
|
return $item['type'] == $type;
|
|
});
|
|
@endphp
|
|
@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">{{ __('procedures.edit_procedure') }}</h4>
|
|
</div>
|
|
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
|
<ol class="breadcrumb">
|
|
<li><a href="{{ route('home') }}">{{ __('procedures.dashboard') }}</a></li>
|
|
<li><a href="/procedures/index">{{ __('procedures.procedures') }}</a></li>
|
|
<li class="active">{{ __('procedures.edit') }}</li>
|
|
</ol>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
@include('clinical_data::procedures.menu')
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<!--Flash messages at the top -->
|
|
@include('flash::message')
|
|
<div class="white-box">
|
|
{{ Form::model($procedure, ['method' => 'PUT', 'route' => ['procedures.update',$procedure], 'data-toggle' => 'validator']) }}
|
|
|
|
<div class="form-group">
|
|
{{ Form::label('name', __('procedures.procedure_name')) }}
|
|
{{ Form::text('name', $procedure->name, ['class' => 'form-control compulsory', 'required']) }}
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
{{ Form::label('code', 'Item Code') }}
|
|
{{ Form::text('code', $procedure->code, ['class' => 'form-control']) }}
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
{{ Form::label('non_insured_price', __('procedures.non_insured_price')) }}
|
|
{{ Form::text('non_insured_price', $procedure->non_insured_price, ['class' => 'form-control compulsory', 'required']) }}
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
|
|
@if($procedure->price_list_category && $procedure->price_list_category != '')
|
|
@php
|
|
$price_list_categories = explode(",", $procedure->price_list_category);
|
|
$price_list_prices = explode(",", $procedure->price_list_price);
|
|
@endphp
|
|
|
|
@for($i = 0; $i < count($price_list_categories); $i++)
|
|
<div class="form-group">
|
|
{{ Form::label('non_insured_price', get_name($price_list_categories[$i], 'id', 'name', 'patient_categories').' Price') }}
|
|
{{ Form::hidden('price_list_category_id[]', $price_list_categories[$i]) }}
|
|
{{ Form::number('price_list_price[]', $price_list_prices[$i], ['class'=>'form-control price_list_price']) }}
|
|
</div>
|
|
@endfor
|
|
@endif
|
|
|
|
<div class="form-group">
|
|
{{ Form::label('category', __('procedures.category')) }}
|
|
{{ Form::select('category', $procedure_categories, $procedure->category_id, ['class' => 'form-control compulsory', 'required','id' =>'category']) }}
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
{{ Form::label('available', __('procedures.is_procedure_available')) }} 
|
|
{{ Form::radio('available', 1, $procedure->available == 1, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }} {{ __('procedures.yes') }}
|
|
{{ Form::radio('available', 0, $procedure->available == 0, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }} {{ __('procedures.no') }}
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
|
|
@php
|
|
$reference_name = !empty($procedure->reference_text)? explode(",", $procedure->reference_text):[];
|
|
$reference_array = !empty($procedure->reference_link)? explode(",", $procedure->reference_link): [];
|
|
@endphp
|
|
@if (!empty($reference_array) && !empty($reference_name))
|
|
{{ Form::label('reference_text', __('symptoms.reference_area')) }}
|
|
@for($i = 0; $i < count($reference_array); $i++)
|
|
<div class="row form-group">
|
|
<div class="col-sm-4">
|
|
{{ Form::text('reference_text[]', $reference_name[$i] ?? '', ['class'=>'form-control', 'placeholder' => 'Reference Name']) }}
|
|
</div>
|
|
<div class="col-sm-8">
|
|
{{ Form::url('reference_link[]', $reference_array[$i] ?? '', ['class'=>'form-control', 'placeholder' => 'eg http://www.google.com']) }}
|
|
</div>
|
|
</div>
|
|
@endfor
|
|
@if (count($reference_array) < 4)
|
|
<div class="row form-group">
|
|
<div class="col-sm-12 reference_input_fields_wrap"></div>
|
|
<div class="col-sm-12"><a class="add_field_button" style="color: blue;">{{ __('symptoms.add_more') }}</a></div>
|
|
</div>
|
|
@endif
|
|
@else
|
|
<div class="form-group">
|
|
{{ Form::label('reference_text', __('symptoms.reference_area')) }}
|
|
<div class="row">
|
|
<div class="col-sm-4">
|
|
{{ Form::text('reference_text[]', '', ['class'=>'form-control', 'placeholder' => 'Reference Name']) }}
|
|
</div>
|
|
<div class="col-sm-8">
|
|
{{ Form::url('reference_link[]', '', ['class'=>'form-control', 'placeholder' => 'eg http://www.google.com']) }}
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-12 reference_input_fields_wrap"></div>
|
|
<div class="col-sm-12"><a class="add_field_button" style="color: blue;">{{ __('symptoms.add_more') }}</a></div>
|
|
</div>
|
|
@endif
|
|
|
|
<div class="form-group">
|
|
{{ Form::label('hmis_number', 'HMIS No.') }}
|
|
{{ Form::text('hmis_number', $procedure->hmis_number, ['class'=>'form-control']) }}
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
{{ Form::label('account_id',__('procedures.chart_of_account_name')) }}
|
|
{{ Form::select('account_id',$chart_of_accounts, $procedure->account_id,['class' => 'form-control compulsory', 'required', 'id' =>'account_id']) }}
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
|
|
<div class="form-group" id="wrapper">
|
|
<?php
|
|
$hmis_no_outpatient_array = array_filter(explode(",", $procedure->hmis_no_outpatient));
|
|
$hmis_category_array = array_filter(explode(",", $procedure->hmis_category));
|
|
?>
|
|
@if(count($hmis_no_outpatient_array) > 0 && count($hmis_category_array) > 0)
|
|
@for ($x = 0; $x < count($hmis_no_outpatient_array); $x++)
|
|
<div class="row input_fields_wrap1 copy1">
|
|
<div class="col-sm-5">
|
|
{{ Form::label('hmis_no_outpatient', 'HMIS-out-patient No.') }}
|
|
{{ Form::text('hmis_no_outpatient[]', $hmis_no_outpatient_array[$x], ['class'=>'form-control']) }}
|
|
</div>
|
|
<div class="col-sm-5">
|
|
{{ Form::label('hmis_category', 'HMIS category (Out Patient)') }}
|
|
{{ Form::select('hmis_category[]', $hmis_categories, $hmis_category_array[$x], ['class' => 'form-control']) }}
|
|
</div>
|
|
</div>
|
|
@endfor
|
|
@else
|
|
<div class="row input_fields_wrap1 copy1">
|
|
<div class="col-sm-5">
|
|
{{ Form::label('hmis_no_outpatient', 'HMIS-out-patient No.') }}
|
|
{{ Form::text('hmis_no_outpatient[]', '', ['class'=>'form-control']) }}
|
|
</div>
|
|
<div class="col-sm-5">
|
|
{{ Form::label('hmis_category', 'HMIS category (Out Patient)') }}
|
|
<select class="form-control" id="hmis_category_outpatient" name="hmis_category_outpatient">
|
|
<option value="" selected disabled>- Select HMIS Out Patient Category -</option>
|
|
@foreach ($outpatient as $outpatient_item)
|
|
<option value="{{ $outpatient_item['id'] }}">{{ $outpatient_item['title'] }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
<a class="add_field_hmis" style="color: blue;">{{ __('procedures.add_more') }}</a><br><br>
|
|
<hr>
|
|
<p> HMIS Inpatient Report (108) </p>
|
|
<div class="form-group">
|
|
<select class="form-control required compulsory" id="procedure_type" name="procedure_type">
|
|
@if ($procedure->hmis_inpatient_type == '0')
|
|
<option value="0" selected>Non-Surgical</option>
|
|
<option value="1">Surgical</option>
|
|
@elseif ($procedure->hmis_inpatient_type == '1')
|
|
<option value="0">Non-Surgical</option>
|
|
<option value="1" selected>Surgical</option>
|
|
@else
|
|
<option value="" selected disabled>Select Procedure type</option>
|
|
<option value="0">Non-Surgical</option>
|
|
<option value="1">Surgical</option>
|
|
@endif
|
|
|
|
</select>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
@if (is_null($procedure->hmis_inpatient_type) || $procedure->hmis_inpatient_type == '0')
|
|
<div class="row" id="input_fields_wrap2">
|
|
<div class="form-group col-sm-4">
|
|
{{ Form::label('hmis_category_inpatient', 'HMIS category (In Patient)') }}
|
|
<select class="form-control" id="hmis_category_inpatient" name="hmis_category_inpatient">
|
|
<option value="" selected disabled>- Select HMIS category -</option>
|
|
@foreach ($inpatient as $inpatient_item)
|
|
<option value="{{ $inpatient_item['id'] }}">{{ $inpatient_item['title'] }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div class="form-group col-sm-4">
|
|
{{ Form::label('hmis_category_inpatient_options', __('diagnoses.hmis_inpatient_category')) }}
|
|
<select class="form-control" id="hmis_category_inpatient_options" name="hmis_category_inpatient_options">
|
|
<option value="" selected disabled>- Select HMIS category first -</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group col-sm-4" id="hysterectomy_type">
|
|
{{ Form::label('hysterectomy_type', 'Hysterectomy type') }}
|
|
<select class="form-control" id="hysterectomy_type_option" name="hysterectomy_type">
|
|
<option value="" selected disabled>- Select Hysterectomy type -</option>
|
|
<option value="SP05a">Total Hysterectomy</option>
|
|
<option value="SP05b">Sub-total Hysterectomy</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
@else
|
|
@php
|
|
$inpatient_option =$procedure->hmis_category_inpatient;
|
|
$inpatient_other = array_filter($inpatient, function ($item) use ($inpatient_option) {
|
|
return $item['id'] !== $inpatient_option;
|
|
});
|
|
$inpatient_selected = array_filter($inpatient, function ($item) use ($inpatient_option) {
|
|
return $item['id'] == $inpatient_option;
|
|
});
|
|
$categories_option = $procedure->hmis_no_inpatient;
|
|
$selected_hmis_categories_option=array_filter($hmis_categories_options, function ($item) use ($categories_option) {
|
|
return $item['id'] == $categories_option;
|
|
});
|
|
$other_hmis_categories_options= array_filter($hmis_categories_options, function ($item) use ($categories_option) {
|
|
return $item['id'] != $categories_option;
|
|
});
|
|
@endphp
|
|
<div class="row" id="selected_options">
|
|
<div class="form-group col-sm-4">
|
|
{{ Form::label('hmis_category_inpatient', 'HMIS category (In Patient)') }}
|
|
<select class="form-control" id="hmis_category_inpatient" name="hmis_category_inpatient">
|
|
<option value="" <?php echo empty($inpatient_selected)? 'selected ':''; ?>disabled>- Select HMIS category -</option>
|
|
@foreach ($inpatient_selected as $option)
|
|
<option value="{{ $option['id'] }}" selected>{{ $option['title'] }}</option>
|
|
@endforeach
|
|
@foreach ($inpatient_other as $inpatient_item)
|
|
<option value="{{ $inpatient_item['id'] }}">{{ $inpatient_item['title'] }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div class="form-group col-sm-4">
|
|
{{ Form::label('hmis_category_inpatient_options', 'HMIS Category Options') }}
|
|
<select class="form-control" id="hmis_category_inpatient_options" name="hmis_category_inpatient_options">
|
|
@if ($procedure->hmis_no_inpatient == 'SP05a' || $procedure->hmis_no_inpatient == 'SP05b')
|
|
<option value="5" selected>Hysterectomy</option>
|
|
@elseif (empty($selected_hmis_categories_option))
|
|
<option value="" selected disabled>- Select HMIS category <?php echo empty($inpatient_selected)? 'first ':'Option'; ?> -</option>
|
|
@else
|
|
@foreach ($selected_hmis_categories_option as $selected_option )
|
|
<option value="{{ $selected_option['id'] }}" selected>{{ $selected_option['name'] }}</option>
|
|
@endforeach
|
|
@endif
|
|
@foreach ($other_hmis_categories_options as $option )
|
|
<option value="{{ $option['id'] }}">{{ $option['name'] }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div class="form-group col-sm-4" id="hysterectomy_type">
|
|
{{ Form::label('hysterectomy_type', 'Hysterectomy type') }}
|
|
<select class="form-control" id="hysterectomy_type_option" name="hysterectomy_type">
|
|
@if ($procedure->hmis_no_inpatient == 'SP05a')
|
|
<option value="SP05a" selected>Total Hysterectomy</option>
|
|
@elseif ($procedure->hmis_no_inpatient == 'SP05b')
|
|
<option value="SP05b" selected>Sub-total Hysterectomy</option>
|
|
@else
|
|
<option value="" selected disabled>- Select Hysterectomy type -</option>
|
|
<option value="SP05a">Total Hysterectomy</option>
|
|
<option value="SP05b">Sub-total Hysterectomy</option>
|
|
@endif
|
|
</select>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
|
|
{{ Form::button(__('procedures.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
|
|
{{ Form::button(__('procedures.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
|
|
|
|
{{ Form::close() }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|
|
@push('scripts')
|
|
<script src="{{ asset('elite/js/validator.js') }}"></script>
|
|
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
|
|
|
<!-- icheck -->
|
|
<script src="{{ asset('elite/bower_components/icheck/icheck.min.js') }}"></script>
|
|
<script src="{{ asset('elite/bower_components/icheck/icheck.init.js') }}"></script>
|
|
<script type="text/javascript">
|
|
var max_fields1 = 4; //maximum reference area/name divs allowed
|
|
var x1 = 1; //initial reference area/name div count
|
|
|
|
$(".add_field_hmis").on("click", function (e) {
|
|
//alert('clicked here');
|
|
e.preventDefault();
|
|
if (x1 < max_fields1) {
|
|
x1++;
|
|
var copy1 = $('.copy1').clone();
|
|
copy1.attr("class", 'row input_fields_wrap1');
|
|
copy1.attr("id", 'copy1' + x1);
|
|
copy1.append('<a href="#" class="remove_field1" style="color: maroon"><sup>X</sup></a>');
|
|
copy1.insertAfter('.copy1');
|
|
}
|
|
});
|
|
|
|
$("#wrapper").on("click", ".remove_field1", function (e) {
|
|
e.preventDefault();
|
|
$(this).parent('div').remove();
|
|
x1--;
|
|
});
|
|
$(document).ready(function () {
|
|
var max_fields = 4; //maximum input boxes allowed
|
|
var wrapper = $(".reference_input_fields_wrap"); //Fields wrapper
|
|
let number = {{ count($reference_array) }};
|
|
var x = number? number: 1; //initlal text box count
|
|
$(".add_field_button").click(function (e) { //on add input button click
|
|
e.preventDefault();
|
|
if (x < max_fields) { //max input box allowed
|
|
x++; //text box increment
|
|
$(wrapper).append('<br><div class="row"><div class="col-sm-4"><input type="text" class="form-control compulsory" placeholder="Reference name" name="reference_text[]" required/></div><div class="help-block with-errors"></div>' +
|
|
'<div class="col-sm-7"><input type="url" placeholder="eg http://www.google.com" class="form-control compulsory" name="reference_link[]" required/></div><div class="help-block with-errors"></div>'
|
|
+ '<a href="#" class="remove_field" style="color: maroon"><sup>X</sup></a></div>'); //add input box
|
|
}else {
|
|
$(".add_field_button").hide();
|
|
alert('Only four references can be added.');
|
|
}
|
|
});
|
|
|
|
$(wrapper).on("click", ".remove_field", function (e) { //user click on remove text
|
|
e.preventDefault();
|
|
$(this).parent('div').remove();
|
|
x--;
|
|
})
|
|
});
|
|
|
|
let hys = `<?php echo ($procedure->hmis_no_inpatient == 'SP05a' || $procedure->hmis_no_inpatient == 'SP05b') ? 'Yes' : 'No';?>`;
|
|
if(hys =='Yes') $('#hysterectomy_type').show();
|
|
else $('#hysterectomy_type').hide();
|
|
$('#account_id, #category, #hmis_category_outpatient, #hmis_category_inpatient_options, #hmis_category_inpatient').select2();
|
|
$('#account_id, #procedure_type').prop('required',true);
|
|
$('#procedure_type').change(function(e) {
|
|
if(this.value == '1') {
|
|
$('#input_fields_wrap2, #selected_options').show();
|
|
if(!$('#hmis_category_inpatient').hasClass('select2-hidden-accessible')) $('#hmis_category_inpatient').select2();
|
|
if(!$('#hmis_category_inpatient_options').hasClass('select2-hidden-accessible')) $('#hmis_category_inpatient_options').select2();
|
|
$('#hmis_category_inpatient').prop('required',true);
|
|
}
|
|
else {
|
|
let option = '<option value="" selected disabled>- Select HMIS category first -</option>';
|
|
$('#input_fields_wrap2, #hysterectomy_type, #selected_options').hide();
|
|
$('#hmis_category_inpatient_options').html(option);
|
|
$('#hmis_category_inpatient, #hysterectomy_type_option').prop('selectedIndex',0);
|
|
$('#hmis_category_inpatient, #hysterectomy_type_option').prop('required',false);
|
|
}
|
|
});
|
|
|
|
$('#hmis_category_inpatient').change(function(e) {
|
|
category_options();
|
|
});
|
|
|
|
function category_options(){
|
|
let category = $('#hmis_category_inpatient').val();
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "/get_hmis_categories_options",
|
|
data: {hmis_category: category},
|
|
cache: false,
|
|
success: function (response) {
|
|
if(response == 'false'){
|
|
alert("<?php echo __('procedures.failed_options'); ?>");
|
|
} else {
|
|
$('#hmis_category_inpatient_options').html(response);
|
|
$('#hmis_category_inpatient_options').prop('required',true);
|
|
if(category != '46') {
|
|
$('#hysterectomy_type').hide();
|
|
$('#hysterectomy_type_option').prop('selectedIndex',0);
|
|
$('#hysterectomy_type_option').prop('required',false);
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
$('#hmis_category_inpatient_options').change(function(e) {
|
|
if(this.value == '5') {
|
|
$('#hysterectomy_type').show();
|
|
$('#hysterectomy_type_option').prop('required',true);
|
|
}
|
|
else {
|
|
$('#hysterectomy_type').hide();
|
|
$('#hysterectomy_type_option').prop('required',false);
|
|
$('#hysterectomy_type_option').prop('selectedIndex',0);
|
|
}
|
|
});
|
|
</script>
|
|
@endpush
|