mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-12 03:01:32 +00:00
updated streamline-setup v2
This commit is contained in:
+387
@@ -0,0 +1,387 @@
|
||||
@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
|
||||
|
||||
@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.add_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.create') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('clinical_data::procedures.menu')
|
||||
</div>
|
||||
</div>
|
||||
@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
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<!--Flash messages at the top -->
|
||||
@include('flash::message')
|
||||
<div class="white-box">
|
||||
@if (session()->has('streamline_setup'))
|
||||
<h3><font color="blue">Stre@mline {{ __('procedures.setup') }} ({{ __('procedures.step') }} 9 {{ __('procedures.of') }} 12)</font></h3>
|
||||
{{ Form::open(['route' => 'procedures.store']) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group">
|
||||
{{ Form::label('name', __('procedures.procedure_name')) }}
|
||||
{{ Form::text('name', '', ['class' => 'form-control']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('non_insured_price', __('procedures.non_insured_price')) }}
|
||||
{{ Form::number('non_insured_price', '', ['class' => 'form-control']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('category', __('procedures.category')) }}
|
||||
{{ Form::select('category', $procedure_categories, null, ['class' => 'form-control']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('available', __('procedures.is_diagnosis_available'), ["class"=>'col-md-12']) }}
|
||||
{{ __('procedures.yes') }} {{ Form::radio('available', 1, false, [ 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
|
||||
{{ __('procedures.no') }} {{ Form::radio('available', 0, false, [ 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('hmis_number', 'HMIS No.') }}
|
||||
{{ Form::number('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,'',['class' => 'form-control']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-2"></div>
|
||||
<div class="col-sm-4" style="background: #eceeef;">
|
||||
<h4>{{ __('procedures.select_any_from_list') }}</h4>
|
||||
<input id="select_all" type="checkbox"> <b>Select All</b><br><br>
|
||||
@foreach ($procedures as $defaultProcedure)
|
||||
<div class="form-group">
|
||||
{{ Form::checkbox('selected_procedures[]', $defaultProcedure['Procedure_Name'], false, ['class' => 'item_checkbox']) }} {{ $defaultProcedure['Procedure_Name'] }}
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::button(__('procedures.next'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10 next']) }}
|
||||
{{ Form::button(__('procedures.skip'),['type'=>'submit','name' => 'skip','value'=>'Skip','class'=>'btn btn-default waves-effect waves-light m-r-10']) }}
|
||||
@else
|
||||
|
||||
{{ Form::open(['route' => 'procedures.store', 'data-toggle' => 'validator']) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('name', __('procedures.procedure_name')) }}
|
||||
{{ Form::text('name', '', ['class' => 'form-control compulsory']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('code', 'Item Code') }}
|
||||
{{ Form::text('code', '', ['class' => 'form-control']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('non_insured_price', __('procedures.non_insured_price')) }}
|
||||
{{ Form::number('non_insured_price', '', ['class' => 'form-control compulsory', 'id' => 'non_insured_price']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$price_list_categories = \Streamline\Models\PriceListCategories::select('patient_category_id', 'id')->get();
|
||||
@endphp
|
||||
|
||||
@foreach($price_list_categories as $record)
|
||||
<div class="form-group">
|
||||
{{ Form::label('non_insured_price', get_name($record->patient_category_id, 'id', 'name', 'patient_categories').' Price') }}
|
||||
{{ Form::hidden('price_list_category_id[]', $record->id) }}
|
||||
{{ Form::number('price_list_price[]', '', ['class'=>'form-control price_list_price']) }}
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('category', __('procedures.category')) }}
|
||||
{{ Form::select('category', $procedure_categories, null, ['class' => 'form-control compulsory', 'id' =>'category']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('available', __('procedures.is_procedure_available'), ["class"=>'col-md-12']) }}
|
||||
{{ __('procedures.yes') }} {{ Form::radio('available', 1, false, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
|
||||
{{ __('procedures.no') }} {{ Form::radio('available', 0, false, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<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 class="col-sm-12 refrence_input_fields_wrap"></div>
|
||||
<div class="col-sm-12"><a class="add_field_button" style="color: blue;">{{ __('symptoms.add_more') }}</a></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('hmis_number', 'HMIS No.') }}
|
||||
{{ Form::number('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,'',['class' => 'form-control compulsory', 'id' =>'account_id', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="wrapper">
|
||||
<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-6">
|
||||
{{ 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>
|
||||
<!-- {{ Form::label('hmis_no_outpatient', 'HMIS-out-patient No.') }}
|
||||
{{ Form::text('hmis_no_outpatient', '', ['class'=>'form-control']) }} -->
|
||||
</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">
|
||||
<option value="" selected disabled>Select Procedure type</option>
|
||||
<option value="0">Non-Surgical</option>
|
||||
<option value="1">Surgical</option>
|
||||
</select>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="row" id="input_fields_wrap2">
|
||||
{{-- <div class="form-group col-sm-6">
|
||||
{{ Form::label('hmis_no_inpatient', 'HMIS-in-patient No.') }}
|
||||
{{ Form::text('hmis_no_inpatient', '', ['class'=>'form-control']) }}
|
||||
</div> --}}
|
||||
<div class="form-group col-sm-4">
|
||||
{{ Form::label('hmis_category_inpatient', __('diagnoses.hmis_inpatient_category')) }}
|
||||
<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>
|
||||
{{ Form::button(__('procedures.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10 submit-btn']) }}
|
||||
{{ Form::button(__('procedures.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
|
||||
@endif
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/icheck/icheck.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/icheck/icheck.init.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$(".next,.submit-btn").click(function (e) { // make sure that all compulsory fields have been filled out
|
||||
var empty_compulsory_fields = [];
|
||||
$(".compulsory").each(function () {
|
||||
if ($(this).val() == "") {
|
||||
var textname = $(this).attr('name');
|
||||
$(this).focus();
|
||||
empty_compulsory_fields.push(textname);
|
||||
$(this).css('border','1px solid #F08080');
|
||||
}
|
||||
});
|
||||
/* check if the array containing empty compulsory fields is not empty then return false */
|
||||
if (empty_compulsory_fields.length != 0) {
|
||||
alert("<?php echo __('procedures.compulsory_fields_warning') ?>");
|
||||
console.log(empty_compulsory_fields);
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
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--;
|
||||
});
|
||||
|
||||
$('#select_all').change(function() {
|
||||
if (this.checked === true) {
|
||||
$(".item_checkbox").each(function() {
|
||||
this.checked = true;
|
||||
});
|
||||
} else {
|
||||
$(".item_checkbox").each(function() {
|
||||
this.checked = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#non_insured_price').change(function(e) {
|
||||
var non_insured_price = $(this).val();
|
||||
if (non_insured_price > 0) {
|
||||
$(".price_list_price").each(function () {
|
||||
$(this).val(non_insured_price);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
var max_fields = 4; //maximum input boxes allowed
|
||||
var wrapper = $(".refrence_input_fields_wrap"); //Fields wrapper
|
||||
|
||||
var x = 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="col-sm-7"><input type="url" placeholder="eg http://www.google.com" class="form-control compulsory" name="reference_link[]" required/></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--;
|
||||
})
|
||||
});
|
||||
|
||||
$('#input_fields_wrap2').hide();
|
||||
$('#hysterectomy_type').hide();
|
||||
$('#account_id, #category, #hmis_category_outpatient').select2();
|
||||
$('#category, #account_id, #procedure_type').prop('required',true);
|
||||
$('#procedure_type').change(function(e) {
|
||||
if(this.value == '1') {
|
||||
$('#input_fields_wrap2').show();
|
||||
$('#hmis_category_inpatient').select2();
|
||||
$('#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').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(); console.log(category);
|
||||
$.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);
|
||||
if(category != '46') $('#hysterectomy_type').hide();
|
||||
$('#hmis_category_inpatient_options').prop('required',true);
|
||||
$('#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
|
||||
+408
@@ -0,0 +1,408 @@
|
||||
@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
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
@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">{{ __('procedures.activate_procedures') }}</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.activate') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('clinical_data::procedures.menu')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="white-box">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('procedures.procedure_name') }}</th>
|
||||
<th>{{ __('procedures.non_insured_price') }}</th>
|
||||
<th>{{ __('procedures.chart_of_account_name') }}</th>
|
||||
<th>{{ __('procedures.category') }}</th>
|
||||
<th>HMIS No.</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($procedures as $procedure)
|
||||
<tr>
|
||||
<td>{{ $procedure->name }}</td>
|
||||
<td>{{ ugandan_shillings($procedure->non_insured_price) }}</td>
|
||||
<td>{{ $chart_of_accounts[$procedure->account_id] ?? '' }}</td>
|
||||
<td>{{ $categories[$procedure->category_id] ?? '' }}</td>
|
||||
<td>{{ $procedure->hmis_number }}</td>
|
||||
<td>
|
||||
{{ Form::model($procedure->id ,['method' => 'POST', 'route' => ['procedures.activate', $procedure->id]]) }}
|
||||
<button type="submit" class="btn btn-warning" onclick="return confirm('<?php echo __('procedures.are_you_sure') ?>')"><i class="fa fa-check"></i> {{ __('procedures.activate') }}</button>
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</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',
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print'
|
||||
]
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
@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">{{ __('procedures.procedures') }}</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.view') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('clinical_data::procedures.menu')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="white-box">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('procedures.procedure_name') }}</th>
|
||||
<th>{{ __('procedures.non_insured_price') }}</th>
|
||||
<th>{{ __('procedures.chart_of_account_name') }}</th>
|
||||
<th>{{ __('procedures.category') }}</th>
|
||||
<th>HMIS No.</th>
|
||||
<th>HMIS No (Out-patient)</th>
|
||||
<th>HMIS category (Out Patient)</th>
|
||||
<th>HMIS No (In-patient)</th>
|
||||
<th>HMIS category (In Patient)</th>
|
||||
<th>References</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($procedures as $procedure)
|
||||
<tr>
|
||||
<td>{{ $procedure->name }}</td>
|
||||
<td>{{ ugandan_shillings($procedure->non_insured_price) }}</td>
|
||||
<td>{{ $chart_of_accounts[$procedure->account_id] ?? '' }}</td>
|
||||
<td>{{ $categories[$procedure->category_id] ?? '' }}</td>
|
||||
<td>{{ $procedure->hmis_number }}</td>
|
||||
@php
|
||||
$hmis_no_outpatient_array = explode(",", $procedure->hmis_no_outpatient);
|
||||
$hmis_outpatient_category_array = explode(",", $procedure->hmis_category);
|
||||
$reference_name = !empty($procedure->reference_text)? explode(",", $procedure->reference_text):[];
|
||||
$reference_array = !empty($procedure->reference_link)? explode(",", $procedure->reference_link): [];
|
||||
|
||||
if($procedure->hmis_no_inpatient == 'SP05a') $hmis_no_inpatient = $procedure->hmis_no_inpatient;
|
||||
elseif ($procedure->hmis_no_inpatient == 'SP05b') $hmis_no_inpatient = $procedure->hmis_no_inpatient;
|
||||
elseif(!empty($procedure->hmis_no_inpatient)) $hmis_no_inpatient = get_name($procedure->hmis_no_inpatient, "id", "number", "hmis_category_options");
|
||||
else $hmis_no_inpatient = '';
|
||||
@endphp
|
||||
|
||||
<td>{{ $procedure->hmis_no_outpatient }}</td>
|
||||
<td>
|
||||
@if(count($hmis_no_outpatient_array) > 0 && !empty($hmis_no_outpatient_array[0]))
|
||||
<ul>
|
||||
@for($i=0; $i < count($hmis_outpatient_category_array); $i++)
|
||||
<li>{{ isset($hmis_categories[$hmis_outpatient_category_array[$i]]) ? $hmis_categories[$hmis_outpatient_category_array[$i]] : "" }}</li>
|
||||
@endfor
|
||||
</ul>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $hmis_no_inpatient }}</td>
|
||||
<td>{{ isset($hmis_categories[$procedure->hmis_category_inpatient]) ? $hmis_categories[$procedure->hmis_category_inpatient] : "" }}</td>
|
||||
<td>
|
||||
@if (!empty($reference_array) && !empty($reference_name))
|
||||
@for ($i=0; $i<count($reference_array); $i++)
|
||||
<li><a style="font-weight:normal;" href="{{ $reference_array[$i] ?? '' }}" target="blank">{{ $reference_name[$i] ?? '' }}</a></li>
|
||||
@endfor
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<a href="/procedures/{{ $procedure->id }}/edit/" class="btn btn-info"><i class="fa fa-pencil"></i> {{ __('procedures.edit') }}</a>
|
||||
</td>
|
||||
<td>
|
||||
@if (!in_array($procedure->id, $ordered_procedures_ids))
|
||||
{{ Form::model($procedure->id ,['method' => 'DELETE', 'route' => ['procedures.destroy', $procedure->id]]) }}
|
||||
<button type="submit" class="btn btn-danger" onclick="return confirm('<?php echo __('procedures.are_you_sure') ?>')"><i class="fa fa-trash"></i> {{ __('procedures.delete') }}</button>
|
||||
{{ Form::close() }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</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',
|
||||
pageLength: 20,
|
||||
ordering:false,
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print'
|
||||
]
|
||||
});
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<a href="{{ route('procedures.create') }}" class="nav-item btn btn-default ti-plus"> {{ __('procedures.add_procedure') }}</a>
|
||||
<a href="{{ route('procedures.index') }}" class="nav-item btn btn-default ti-pencil"> {{ __('procedures.view_procedures') }}</a>
|
||||
<a href="{{ route('procedures.inactive') }}" class="nav-item btn btn-default ti-pencil"> {{ __('procedures.activate_procedures') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
Executable
+654
@@ -0,0 +1,654 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/bower_components/switchery/dist/switchery.min.css') }}" rel="stylesheet"/>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-6 col-md-7 col-sm-7 col-xs-12">
|
||||
<h4 class="page-title">{{ __('procedures.order_procedures') }} {{ $patient->last_name }} {{ __('procedures.episode_started_on') }}:<a>{{ streamline_date(get_name($episode_id, 'id', 'created_at', 'patient_episodes')) }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-6 col-sm-5 col-md-5 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('procedures.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('patient_episodes.index') }}">{{ __('procedures.patient_home') }}</a></li>
|
||||
<li class="active">{{ __('procedures.ordering_procedures') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('patients::allergies.header')
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
<!--Flash messages at the top -->
|
||||
@include('flash::message')
|
||||
|
||||
@foreach ($errors->all() as $error)
|
||||
<div>{{ $error }}</div>
|
||||
@endforeach
|
||||
|
||||
{{ Form::open(['route' => 'procedures.ordered']) }}
|
||||
|
||||
@php $patient_insurance_status = patient_insurance_status($patient_id); @endphp
|
||||
|
||||
{{ Form::hidden('patient_id', $patient_id, ['id' => 'patient_id'])}}
|
||||
{{ Form::hidden('patient_insurance_status', $patient_insurance_status, ['id' => 'patient_insurance_status'])}}
|
||||
|
||||
<div id='payments_items'>
|
||||
<table class='table color-bordered-table success-bordered-table'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<div class='row'>
|
||||
<div class='col-4'>{{ __('procedures.procedures') }}</div>
|
||||
<div class='col-3' @if(view_procedure_price_on_order()==0) style='display: none' @endif>{{ __('procedures.cost') }}</div>
|
||||
<div class='col-4'>{{ __('procedures.performed') }}</div>
|
||||
<div class='col-1'></div>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@php
|
||||
$option_procedures = "<option value=''>-select-</option>";
|
||||
foreach ($procedures as $key => $value){
|
||||
$option_procedures .= "<option value='$key'>$value</option>";
|
||||
}
|
||||
|
||||
$option_employees = "<option value=''>-select-</option>";
|
||||
foreach ($employees as $employee){
|
||||
$option_employees .= "<option value='$employee->id'>$employee->first_name $employee->last_name</option>";
|
||||
}
|
||||
|
||||
$counter = 0;
|
||||
@endphp
|
||||
|
||||
<tbody class='input_fields_wrap'>
|
||||
@if($ordered_procedures)
|
||||
<tr>
|
||||
<td style='background-color: #FFE6E6; font-weight: bolder;'>
|
||||
<u>{{ __('procedures.pending_procedures') }}</u>
|
||||
@if(Auth::user()->can('cancel-ordered-procedures') )
|
||||
<b><a class="pull-right text-blue" onclick="cancelOrderedItems({{ $ordered_procedures->id }})">Cancel all ordered procedures</a></b>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{{ Form::hidden('order_id', $ordered_procedures->id) }}
|
||||
@php
|
||||
$procedure_ids = explode(",", $ordered_procedures->procedure_id);
|
||||
$procedure_amount = explode(",", $ordered_procedures->procedure_amount);
|
||||
$procedure_performed = explode(",", $ordered_procedures->performed);
|
||||
$procedure_performed_id = explode(",", $ordered_procedures->performed_id);
|
||||
$eye_array = explode(",", $ordered_procedures->eye);
|
||||
@endphp
|
||||
|
||||
@for($i = 0; $i < count($procedure_ids); $i++)
|
||||
<tr>
|
||||
<td>
|
||||
<div class='row'>
|
||||
<div class='col-4'>
|
||||
<div class='form-group'>
|
||||
<div class='controls'>
|
||||
@if($procedure_performed[$i] == 1)
|
||||
{{ $procedures[$procedure_ids[$i]] }}
|
||||
{{ Form::hidden('procedure_id[]', $procedure_ids[$i]) }}
|
||||
@else
|
||||
{{ Form::select('procedure_id[]', $procedures, $procedure_ids[$i], ['class' => 'form-control compulsory required procedure_id_class', 'id' => 'procedure_id_' . $counter]) }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div id='chi_coverage_div_{{ $counter }}'>
|
||||
@if (is_chi_enabled() && is_patient_item_covered($patient_id, $procedure_ids[$i], 2))
|
||||
<br><span style="color: darkgreen"><b>Covered by CHI</b></span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div @if(!is_eye_module_enabled() || !is_patient_in_eye_clinic($episode_id)) style='display: none' @endif>
|
||||
<hr>
|
||||
<label><b>Eye</b></label>
|
||||
{{ Form::select('eye[]', [2 => 'Both', 0 => 'Left', 1 => 'Right'], $eye_array[$i] ?? 2, ['class' => 'form-control compulsory', 'required', 'onchange' => 'eye_select(this.value, ' . $counter . ')']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@php
|
||||
if(!is_null($procedure_amount[$i])){
|
||||
if ($patient_insurance_status == 1){
|
||||
$price = get_item_insurance_co_payment($patient_id, $procedure_ids[$i], 2, false, 0);
|
||||
} else {
|
||||
$price_list_id = is_patient_category_attached_to_price_list($patient_id);
|
||||
if ($price_list_id){
|
||||
$price = get_price_list_category_price($price_list_id, 4, $procedure_ids[$i]);
|
||||
} else {
|
||||
$price = get_name($procedure_ids[$i], 'id', 'non_insured_price', 'procedures');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$price = $procedure_amount[$i];
|
||||
}
|
||||
@endphp
|
||||
|
||||
<div class='col-3' @if(view_procedure_price_on_order()==0) style='display: none' @endif>
|
||||
<div class='form-group'>
|
||||
<div class='controls'>
|
||||
@if($procedure_performed[$i] == 1)
|
||||
{{ ugandan_shillings($price) }}
|
||||
{{ Form::hidden('item_cost[]', $price) }}
|
||||
@else
|
||||
<input type='number' name='item_cost[]' id='item_cost_{{ $counter }}' value='{{ $price }}' class='form-control item_cost compulsory' required/>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='col-4'>
|
||||
@if($procedure_performed[$i] == 1)
|
||||
@php
|
||||
$performed_record = \Streamline\Models\StaffPerformedService::where('id', $procedure_performed_id[$i])->first();
|
||||
@endphp
|
||||
|
||||
@if($performed_record)
|
||||
|
||||
<b>Performed By: </b><div id="performed_by_field_{{ $performed_record->id }}">{{ get_full_name($performed_record->performed_by, "id", "first_name", "last_name", "users") }}</div>
|
||||
|
||||
@if(Auth::user()->can('edit-performed-by'))
|
||||
<br><br>
|
||||
<a class="pull-right" style="color:#0099CC;" onclick="edit_performed_by({{ $performed_record->id }})">Edit</a>
|
||||
<a class="pull-left" style="color:red;" onclick="delete_performed_by({{ $ordered_procedures->id }}, {{ $i }}, {{ $performed_record->id }})">Remove</a>
|
||||
@endif
|
||||
{{ Form::hidden('performed_procedures[]', 1) }}
|
||||
{{ Form::hidden('procedure_performed_by[]', $performed_record->performed_by) }}
|
||||
{{ Form::hidden('procedure_performed_by_amount[]', $performed_record->performance_fee) }}
|
||||
{{ Form::hidden('procedure_performed_date[]', $performed_record->date_performed) }}
|
||||
@else
|
||||
{{ Form::hidden('performed_procedures[]', 0) }}
|
||||
@endif
|
||||
@else
|
||||
<input type='checkbox' id='procedure_performed_{{ $counter }}' value='0' class='procedure_performed js-switch' data-color='green' data-size='small'>
|
||||
<input type='hidden' value='0' name='performed_procedures[]' id='procedure_performed_tracker_{{ $counter }}' />
|
||||
|
||||
<div id='procedure_performed_by_div_{{ $counter }}' style='width: 100%; display: none'>
|
||||
<br><label for='performed_by'>Performed By:</label>
|
||||
<br><select name='procedure_performed_by[]' class='form-control procedure_performed_by' id='procedure_performed_by_{{ $counter }}'><?php echo $option_employees; ?></select>
|
||||
<br><label for='procedure_performed_by_amount'>Staff Fee</label>
|
||||
<br><input type='number' name='procedure_performed_by_amount[]' class='form-control' id='procedure_performed_by_amount{{ $counter }}'>
|
||||
<br><label for='procedure_performed_date'>Date Performed</label>
|
||||
<br><input type='text' name='procedure_performed_date[]' class='form-control compulsory procedure_performed_date' readonly/>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class='col-1'>
|
||||
<div class='form-group' style='margin-top: 10px;'>
|
||||
@if($procedure_performed[$i] == 0)
|
||||
@if($counter == 0)
|
||||
<button class='btn btn-sm btn-rounded btn-success add_item' style='color: white; margin-left: 25px;'><i class='fa fa-plus'></i></button>
|
||||
@else
|
||||
<button class='remove_field btn btn-sm btn-rounded btn-danger add_item' style='color: white; margin-left: 25px;'><i class='fa fa-trash'></i></button>
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endfor
|
||||
@else
|
||||
<tr>
|
||||
<td>
|
||||
<div class='row'>
|
||||
<div class='col-4'>
|
||||
<div class='form-group'>
|
||||
<div class='controls'>
|
||||
<select name='procedure_id[]' id='procedure_id_{{ $counter }}' class='form-control compulsory required procedure_id_class'>@php echo $option_procedures; @endphp</select>
|
||||
|
||||
<div id='chi_coverage_div_{{ $counter }}'></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div @if(!is_eye_module_enabled() || !is_patient_in_eye_clinic($episode_id)) style='display: none' @endif>
|
||||
<hr>
|
||||
<label><b>Eye</b></label>
|
||||
<select name='eye[]' class='form-control compulsory' onchange="eye_select(this.value, {{ $counter }})">
|
||||
<option selected value='0'>Left</option>
|
||||
<option value='1'>Right</option>
|
||||
<option value='2'>Both</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='col-3' @if(view_procedure_price_on_order()==0) style='display: none' @endif>
|
||||
<div class='form-group'>
|
||||
<div class='controls'>
|
||||
<input type='number' name='item_cost[]' id='item_cost_{{ $counter }}' class='form-control item_cost compulsory' required/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='col-4'>
|
||||
<input type='checkbox' id='procedure_performed_{{ $counter }}' value='0' class='procedure_performed js-switch' data-color='green' data-size='small'>
|
||||
<input type='hidden' value='0' name='performed_procedures[]' id='procedure_performed_tracker_{{ $counter }}' />
|
||||
|
||||
<div id='procedure_performed_by_div_{{ $counter }}' style='width: 100%; display: none'>
|
||||
<br><label for='performed_by'>Performed By:</label>
|
||||
<br><select name='procedure_performed_by[]' class='form-control procedure_performed_by' id='procedure_performed_by_{{ $counter }}'><?php echo $option_employees; ?></select>
|
||||
<br><label for='procedure_performed_by_amount'>Staff Fee</label>
|
||||
<br><input type='number' name='procedure_performed_by_amount[]' class='form-control' id='procedure_performed_by_amount{{ $counter }}'>
|
||||
<br><label for='procedure_performed_date'>Date Performed</label>
|
||||
<br><input type='text' name='procedure_performed_date[]' class='form-control compulsory procedure_performed_date' readonly/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='col-1'>
|
||||
<div class='form-group' style='margin-top: 10px;'>
|
||||
<button class='btn btn-sm btn-rounded btn-success add_item' style='color: white; margin-left: 25px;'><i class='fa fa-plus'></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
@if( Auth::user()->can('add-row-on-prescription'))
|
||||
<tr>
|
||||
<td>
|
||||
<div class='row'>
|
||||
<div class='col-6'>
|
||||
</div>
|
||||
<div class='col-1 prompts_div' id='prompts_div_{{ $counter }}'></div>
|
||||
<div class='col-1'>
|
||||
</div>
|
||||
<div class='col-1'>
|
||||
</div>
|
||||
<div class='col-1 first_dose_quantity_div' style="display: none">
|
||||
</div>
|
||||
<div class='col-1' @if(view_prescription_price_on_order()==0) style='display: none' @endif>
|
||||
</div>
|
||||
<div class='col-1'>
|
||||
</div>
|
||||
<div class='col-1'>
|
||||
<div class='form-group' style='margin-top: 10px;'>
|
||||
<button class='btn btn-sm btn-rounded btn-success add_item' style='color: white; margin-left: 25px;'><span>Add row</span></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class='row' @if(view_procedure_price_on_order()==0) style='display: none' @endif>
|
||||
<div style="float: right;">
|
||||
<h3>Total: <span id="itemGrandTotal"></span></h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class='col-md-9'>
|
||||
</div>
|
||||
<div class='col-md-3'>
|
||||
<button class='btn btn-rounded btn-info pull-right' id='submit_button'>Save Procedures</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="edit_performed_modal" tabindex="-1" role="dialog" aria-labelledby="edit_performed_modal_label">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="edit_performed_modal_label">Edit Performed By</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{ Form::hidden('edit_performed_by_id', 0, ['id' => 'edit_performed_by_id']) }}
|
||||
{{ Form::label('edit_perfomed_by', 'Perfomed By:')}}
|
||||
<br>{{ Form::select('edit_performed_by', $users_array, '', ['class' => 'form-control', 'id' => 'edit_performed_by']) }}
|
||||
<br>{{ Form::label('edit_performed_by_amount', 'Staff Fee')}}
|
||||
<br>{{ Form::number('edit_performed_by_amount', '', ['class' => 'form-control', 'id' => 'edit_performed_by_amount']) }}
|
||||
<br>{{ Form::label('edit_performed_date', 'Date Performed')}}
|
||||
<br>{{ Form::text('edit_performed_date', '', ['class' => 'form-control compulsory procedure_performed_date', 'readonly'])}}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a class="btn btn-success btn-sm" id="edit_performed_by_button">Save Changes</a>
|
||||
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/switchery/dist/switchery.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/js/validator.js') }}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var max_rows = 20;
|
||||
var wrapper = $(".input_fields_wrap"); //Fields wrapper
|
||||
var add_button = $(".add_item");
|
||||
|
||||
var show_price_setting = <?php echo view_procedure_price_on_order(); ?>;
|
||||
var is_eye_module_enabled = <?php echo (!is_eye_module_enabled() || !is_patient_in_eye_clinic($episode_id)) ? 1 : 0; ?>;
|
||||
|
||||
var x = <?php echo $counter + 1; ?> // initial row count
|
||||
|
||||
add_button.click(function (e) { // on add input button click
|
||||
e.preventDefault();
|
||||
if (x < max_rows) {
|
||||
$(wrapper).append("\
|
||||
<tr>\
|
||||
<td>\
|
||||
<div class='row'>\
|
||||
<div class='col-4'>\
|
||||
<div class='form-group'>\
|
||||
<div class='controls'>\
|
||||
<select name='procedure_id[]' id='procedure_id_" + x + "' class='form-control compulsory required procedure_id_class' required>@php echo $option_procedures; @endphp</select>\
|
||||
</div>\
|
||||
<div id='chi_coverage_div_" + x + "'></div>\
|
||||
</div>\
|
||||
<div "+(is_eye_module_enabled==1?'style="display:none"':'')+">\
|
||||
<hr><label><b>Eye</b></label>\
|
||||
<select name='eye[]' class='form-control compulsory' onchange='eye_select(this.value, " + x + ")'>\
|
||||
<option selected value='0'>Left</option>\
|
||||
<option value='1'>Right</option>\
|
||||
<option value='2'>Both</option>\
|
||||
</select></div>\
|
||||
</div>\
|
||||
<div class='col-3'"+(show_price_setting==0?'style="display:none"':'')+">\
|
||||
<div class='form-group'>\
|
||||
<div class='controls'>\
|
||||
<input type='number' name='item_cost[]' id='item_cost_" + x + "' class='form-control item_cost compulsory' required/>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class='col-4'>\
|
||||
<input type='checkbox' id='procedure_performed_" + x + "' value='" + x + "' class='procedure_performed js-switch' data-color='green' data-size='small'>\
|
||||
<input type='hidden' value='0' name='performed_procedures[]' id='procedure_performed_tracker_" + x + "' />\
|
||||
<div id='procedure_performed_by_div_" + x + "' style='width: 100%; display: none'>\
|
||||
<br><label for='performed_by'>Performed By:</label>\
|
||||
<br><select name='procedure_performed_by[]' class='form-control procedure_performed_by' id='procedure_performed_by_" + x + "'><?php echo $option_employees; ?></select>\
|
||||
<br><label for='procedure_performed_by_amount'>Staff Fee</label>\
|
||||
<br><input type='number' name='procedure_performed_by_amount[]' class='form-control' id='procedure_performed_by_amount" + x + "'>\
|
||||
<br><label for='procedure_performed_date'>Date Performed</label>\
|
||||
<br><input type='text' name='procedure_performed_date[]' class='form-control compulsory procedure_performed_date' readonly/>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class='col-1'>\
|
||||
<div class='form-group' style='margin-top: 10px;'>\
|
||||
<button class='remove_field btn btn-sm btn-rounded btn-danger' style='color: white; margin-left: 25px;'><i class='fa fa-trash'></i></button>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
</td>\
|
||||
</tr>");
|
||||
|
||||
generalSelect2Set('procedure_performed_by_'+x);
|
||||
generalSelect2Set('procedure_id_'+x);
|
||||
|
||||
new Switchery($('#procedure_performed_'+x)[0], $('#procedure_performed_'+x).data());
|
||||
|
||||
$("select.item_select").change(function(){
|
||||
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
|
||||
var name_selected = $(this).children("option:selected").val();
|
||||
$("#name_" + id).val(parseInt(name_selected));
|
||||
});
|
||||
|
||||
x++;
|
||||
|
||||
$('.procedure_performed_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function eye_select(value, id) {
|
||||
// for eye both
|
||||
if(value == 2) {
|
||||
let item = $("#procedure_id_" + id).val();
|
||||
|
||||
$.ajax({
|
||||
url: '/get_item_price',
|
||||
data: {'category':1, 'item':item},
|
||||
success: function(response){
|
||||
$("#item_cost_"+id).val(response * 2);
|
||||
|
||||
calculateTotal();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function calculateTotal() {
|
||||
//loop through the prices
|
||||
let auto_price_grand_total = 0;
|
||||
$(".item_cost").each(function(){
|
||||
auto_price_grand_total += parseInt($(this).val());
|
||||
});
|
||||
|
||||
// recalculate the grand total
|
||||
$("#itemGrandTotal").html(numberWithCommas(auto_price_grand_total) + " Ugx");
|
||||
}
|
||||
|
||||
$(wrapper).on("click", ".remove_field", function (e) {
|
||||
e.preventDefault();
|
||||
$(this).parent('div').parent('div').parent('div').parent('td').parent('tr').remove();
|
||||
});
|
||||
|
||||
$(".input_fields_wrap").on('change', ".procedure_id_class", function () {
|
||||
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
|
||||
var item = $("#procedure_id_" + id).val();
|
||||
let patient_id = $('#patient_id').val();
|
||||
let patient_insurance_status = $('#patient_insurance_status').val();
|
||||
|
||||
$.ajax({
|
||||
url: '/get_procedure_details',
|
||||
data: {'procedure_id':item, 'patient_id':patient_id, 'patient_insurance_status': patient_insurance_status, 'is_inpatient': 0, 'ward_id': 0},
|
||||
success: function(response){
|
||||
let arr = JSON.parse(response);
|
||||
|
||||
$("#item_cost_"+id).val(arr["selling_price"]);
|
||||
|
||||
if (arr["covered_by_chi"] !== "") {
|
||||
$("#chi_coverage_div_" + id).html(arr["covered_by_chi"]).show();
|
||||
} else {
|
||||
$("#chi_coverage_div_" + id).hide();
|
||||
}
|
||||
|
||||
$("#item_cost_"+id).val(arr["selling_price"]);
|
||||
|
||||
if (arr["covered_by_chi"] !== "") {
|
||||
$("#chi_coverage_div_" + id).html(arr["covered_by_chi"]).show();
|
||||
} else {
|
||||
$("#chi_coverage_div_" + id).hide();
|
||||
}
|
||||
|
||||
calculateTotal();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(".procedure_id_class,.procedure_performed_by").select2({
|
||||
width: "100%"
|
||||
});
|
||||
|
||||
$(".input_fields_wrap").on('change', ".item_cost", function () {
|
||||
var auto_price_grand_total = 0;
|
||||
$(".item_cost").each(function(){
|
||||
var auto_price = $(this).val();
|
||||
auto_price_grand_total += parseInt(auto_price);
|
||||
});
|
||||
|
||||
//recalculate the grand total
|
||||
$("#itemGrandTotal").html(numberWithCommas(auto_price_grand_total) + " Ugx");
|
||||
});
|
||||
|
||||
function generalSelect2Set(id) {
|
||||
$('#'+id).select2({
|
||||
width: "100%"
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('.procedures').select2({
|
||||
placeholder: "<?php echo __('procedures.select_procedure') ?>"
|
||||
});
|
||||
|
||||
// Switchery
|
||||
$('.js-switch').each(function () {
|
||||
new Switchery($(this)[0], $(this).data());
|
||||
});
|
||||
|
||||
$('#submit_button').click(function () {
|
||||
|
||||
$(".procedure_performed").each(function () {
|
||||
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
|
||||
if($('#procedure_performed_'+id).is(':checked') && $('#procedure_performed_by_'+id).val() === "") {
|
||||
alert('Please make sure you select the staff that has performed the procedure');
|
||||
return false
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
$(".input_fields_wrap").on('change', ".procedure_performed", function () {
|
||||
let id = /\d+(?=\D*$)/.exec($(this).attr('id'));
|
||||
|
||||
if(!$(this).is(':checked')) {
|
||||
$("#procedure_performed_by_div_"+id).hide();
|
||||
$("#procedure_performed_tracker_"+id).val(0);
|
||||
} else {
|
||||
$("#procedure_performed_by_div_"+id).show();
|
||||
$("#procedure_performed_tracker_"+id).val(1);
|
||||
}
|
||||
});
|
||||
|
||||
$('.procedure_performed_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd'
|
||||
});
|
||||
|
||||
$(".input_fields_wrap").on('change', ".procedure_performed_by", function () {
|
||||
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
|
||||
let performed_by = $('#procedure_performed_by_'+id).val();
|
||||
let patient_id = $("#patient_id").val();
|
||||
let procedure_id = $('#procedure_id_'+id).val();
|
||||
|
||||
if (procedure_id == "") {
|
||||
return false;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/procedures/fetch_procedure_performance_fee",
|
||||
data: {
|
||||
patient_id: patient_id,
|
||||
performed_by: performed_by,
|
||||
item_id: procedure_id
|
||||
},
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
$('#procedure_performed_by_amount' + id).val(response);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#edit_performed_by_button').click(function () {
|
||||
let id = $('#edit_performed_by_id').val();
|
||||
let edit_performed_date = $('#edit_performed_date').val();
|
||||
let edit_performed_by_amount = $('#edit_performed_by_amount').val();
|
||||
let edit_performed_by = $('#edit_performed_by').val();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/staff_payment_configuration/edit_performed_by_info",
|
||||
data: {
|
||||
edit_performed_date: edit_performed_date,
|
||||
edit_performed_by_amount: edit_performed_by_amount,
|
||||
edit_performed_by: edit_performed_by,
|
||||
id: id
|
||||
},
|
||||
success: function (response) {
|
||||
alert("Procedure performed by has been updated...");
|
||||
$("#edit_performed_modal").modal("hide");
|
||||
$('#performed_by_field_'+id).text(response);
|
||||
},
|
||||
error: function (response) {
|
||||
alert("Something went wrong!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function numberWithCommas(x) {
|
||||
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
|
||||
function edit_performed_by(id) {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/staff_payment_configuration/fetch_performed_by_info/" + id,
|
||||
success: function (response) {
|
||||
let arr = response.split(",");
|
||||
$('#edit_performed_by_id').val(id);
|
||||
$('#edit_performed_date').val(arr[2]);
|
||||
$('#edit_performed_by_amount').val(arr[1]);
|
||||
$('#edit_performed_by').val(arr[0]);
|
||||
$("#edit_performed_modal").modal("show");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function delete_performed_by(order_id, position, id) {
|
||||
if(confirm("Are you sure you want to remove the person who performed this procedure?")) {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/staff_payment_configuration/delete_performed_by/" + id + "/" + position + "/" + order_id + "/1",
|
||||
success: function (response) {
|
||||
if (response == 1) {
|
||||
alert("Success");
|
||||
window.location.reload();
|
||||
} else {
|
||||
alert("An error occured while processing the request");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function cancelOrderedItems(order_id) {
|
||||
if (confirm("Are you sure you want to continue? This will cancel all unpaid orders")) {
|
||||
$.ajax({
|
||||
url: '/cancel_ordered_procedures/' + order_id,
|
||||
success: function(response){
|
||||
if (response == 1) {
|
||||
alert("Procedures have been cancelled");
|
||||
window.location.reload();
|
||||
} else {
|
||||
alert("Cancellation of procedures failed");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
Reference in New Issue
Block a user