updated streamline-setup v2

This commit is contained in:
2025-01-15 08:53:49 -08:00
committed by alec.turner
parent a2ce9248f0
commit 4b569f81b0
20228 changed files with 2932048 additions and 63204 deletions
@@ -0,0 +1,523 @@
@if (session()->has('patient_id') || session()->has('patients_id'))
@endif
@push('scripts')
<script src="{{ asset('js/allergies/scripts.js') }}"></script>
@endpush
@push('styles')
<style type="text/css">
/* Important part used by allergies */
.allergy-modal-dialog {
overflow-y: initial !important
}
.allergy-modal-body {
height: 250px;
overflow-y: auto;
}
@media (min-width: 768px) {
.allergy-modal-dialog {
width: 90%;
max-width: 1200px;
}
}
</style>
@endpush
<div class="row">
<div @if (is_smart_discharge_enabled()) class="col-sm-6" @else class="col-sm-8" @endif>
<div>
@php
$known_patient_allergies = \Streamline\Models\Allergy::where('patient_id', $patient->id)
->orderBy('created_at', 'desc')
->take(2)
->get();
$known_patient_alerts = \Streamline\Models\Alert::where('patient_id', $patient->id)
->orderBy('created_at', 'desc')
->take(2)
->get();
$categories = \Streamline\Models\PatientCategory::pluck('name', 'id');
$drug_categories_array = DB::table('drug_categories')->pluck('name', 'id');
$drug_categories = \Streamline\Models\DrugCategory::orderBy('name', 'asc')->get();
@endphp
<!-- <a href="#" class="btn-action fa fa-plus-square"><i></i></a> -->
<span class="count label label-inverse mx-4 px-4">
<strong>{{ __('allergies.category') }} :</strong>
{{ $categories[$patient->category_id] ?? 'N/A' }}
</span>
<div class="row consultation-pat-row">
<div class="col-sm-9 consultation-pat mb-2" style="overflow-x: auto; overflow-y: hidden;">
<div class="row consultation-pat-table h-100 align-items-stretch" style="flex-wrap: nowrap;">
<div class="col p-0">
<div class="card h-100 m-0">
<div class="card-header w-100">{{ __('allergies.patient_number') }}</div>
<div class="card-body">{{ $patient->number }}</div>
</div>
</div>
<div class="col p-0">
<div class="card h-100 m-0">
<div class="card-header w-100">{{ __('allergies.full_names') }}</div>
<div class="card-body">{!! insurance_flag($patient->id) !!}
@if (patient_insurance_status($patient->id) == 1)
<small style="color:#069">({{ __('patients.joined_chi_scheme') }}
{{ patient_duration_on_chi_sheme($patient->id) }})</small>
@endif
</div>
</div>
</div>
<div class="col p-0">
<div class="card h-100 m-0">
<div class="card-header w-100">{{ __('allergies.gender') }}</div>
<div class="card-body">
{{ $patient->gender == 1 ? __('allergies.male') : __('allergies.female') }}</div>
</div>
</div>
<div class="col p-0">
<div class="card h-100 m-0">
<div class="card-header w-100">{{ __('allergies.age') }}</div>
<div class="card-body">{{ get_patients_age($patient->date_of_birth) }}</div>
</div>
</div>
<div class="col p-0">
<div class="card h-100 m-0">
<div class="card-header w-100">{{ __('allergies.national_id') }}</div>
<div class="card-body">{!! $patient->national_id == null || $patient->national_id == ''
? "<span class='label label-info'>National ID Missing</span>"
: strtoupper($patient->national_id) !!}</div>
</div>
</div>
</div>
</div>
<div class="col-sm-3 mb-2">
<div class="button-box h-100">
<a class="img" href="#modal-photo" data-toggle="modal" style="color: whitesmoke">
<div class="center img-pat-profile"
style="height: 100%; width: 100%; background: url(@if (!is_null($patient->photo) && $patient->photo != '') {{ asset($patient->photo) }} @else {{ asset('/uploads/streamline_images/person-place-holder.jpg') }} @endif) center no-repeat; background-size: auto 100%; min-height: 110px; position: relative;">
<!-- img-rounded -->
<i class="fa fa-refresh"
style="display: none; position: absolute; right: -10px; top: -10px"></i>
</div>
</a>
</div>
<div class="modal fade" id="modal-photo" tabindex="-1" role="dialog"
aria-labelledby="modal-photoLabel1">
<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">&times;</span></button>
<h4 class="modal-title" id="modal-photoLabel1">
{{ __('allergies.insured_patient_photo') }}</h4>
</div>
<div class="modal-body">
<div class="col-sm-12 text-center">
<img src="@if (!is_null($patient->photo) && $patient->photo != '') {{ asset($patient->photo) }} @else {{ asset('/uploads/streamline_images/person-place-holder.jpg') }} @endif"
class="img-rounded center" style="margin: auto" />
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger btn-sm"
data-dismiss="modal">{{ __('allergies.close') }}</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-2">
<div class="row">
<div class="col-sm-12">
<div>
<div class="button-box">
<button type="button"
class="btn btn-danger btn-rounded btn-sm mb-1 d-flex justify-content-between align-items-center"
data-toggle="modal" data-target="#modal-allergies"
style="line-height: 10px; font-size: 11px; gap: 10px;">{{ __('allergies.allergies') }} <i
class="fa fa-plus-circle"></i></button>
</div>
<div class="modal fade" id="modal-allergies" tabindex="-1" role="dialog"
aria-labelledby="modal-allergiesLabel1">
<div class="modal-dialog modal-lg allergy-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">&times;</span></button>
<h4 class="modal-title" id="modal-allergiesLabel1">
{{ __('allergies.add_allergies_patient') }}</h4>
</div>
<div class="modal-body allergy-modal-body">
<div class="container-fluid">
<h4>{{ __('allergies.currently_known') }}</h4>
<div class="row">
@php $allergic_drugs_ids_array = []; @endphp
@if (count($known_patient_allergies) > 0)
@foreach ($known_patient_allergies as $allergy)
@php $allergic_drugs_ids_array = explode(',' , $allergy->names); @endphp
@endforeach
@php $chunked_allergy_array = array_chunk($allergic_drugs_ids_array, 1, true) @endphp
@foreach ($chunked_allergy_array as $items)
<div class="col-md-4">
@foreach ($items as $item)
@if (isset($drug_categories_array[$item]))
&#8226 {{ $drug_categories_array[$item] }} <br>
@endif
@endforeach
</div>
@endforeach
@endif
</div>
<br>
<div class="row">
<h4>{{ __('allergies.allergic_reactions') }}</h4>
@foreach ($drug_categories->chunk(9) as $chunk)
@foreach ($chunk as $drug_category)
<div class="col-md-4">
<!-- if it is a known allergy then check the checkbox -->
@if (in_array($drug_category->id, $allergic_drugs_ids_array))
<input class='patient_allergies' name='allergies[]'
type='checkbox' checked="true"
value='{{ $drug_category->id }}' />
{{ $drug_category->name }}
@else
<input class='patient_allergies' name='allergies[]'
type='checkbox'
value='{{ $drug_category->id }}' />
{{ $drug_category->name }}
@endif
<br />
</div>
@endforeach
@endforeach
<!-- <hr> -->
<input type="hidden" id="allergy_patient_id"
name="allergy_patient_id" value="<?php echo $patient->id; ?>" />
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" id="submit_allergies"
class="btn btn-success btn-sm">{{ __('allergies.submit_allergies') }}</button>
<button type="button" class="btn btn-danger btn-sm"
data-dismiss="modal">{{ __('allergies.close') }}</button>
</div>
</div>
</div>
</div>
<table class="table-bordered table-condensed table-striped w-100 mb-3 br-5"
id="allergies_drugs_table"
style="border-collapse: collapse; border-spacing: 0; border-spacing: 0;">
<tbody>
<tr style="border-spacing: 0;">
<td style="font-weight: normal; border-spacing: 0;">
<div id="patient_allergies_tab">
@if (count($allergic_drugs_ids_array) > 0)
@if (isset($allergic_drugs_ids_array[0]) && isset($drug_categories_array[$allergic_drugs_ids_array[0]]))
&#8226 <small
style="color: red;">{{ $drug_categories_array[$allergic_drugs_ids_array[0]] }}</small><br>
@endif
@if (isset($allergic_drugs_ids_array[1]) && isset($drug_categories_array[$allergic_drugs_ids_array[1]]))
&#8226 <small
style="color: red;">{{ $drug_categories_array[$allergic_drugs_ids_array[1]] }}</small><br>
@endif
@else
<small
style="color: blue;">{{ __('allergies.no_recorded_allergies') }}</small>
@endif
</div>
@if (count($allergic_drugs_ids_array) > 0)
<a href="/allergies">{{ __('allergies.view_all') }}</a>
@endif
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col-sm-2">
<div class="row">
<div class="col-sm-12">
<div>
<div class="button-box">
<button type="button"
class="btn btn-danger btn-rounded btn-sm mb-1 d-flex justify-content-between align-items-center"
data-toggle="modal" data-target="#modal-alerts"
style="line-height: 10px; font-size: 11px; gap: 10px;">{{ __('allergies.alerts') }} <i
class="fa fa-plus-circle"></i></button>
</div>
<div class="modal fade" id="modal-alerts" tabindex="-1" role="dialog"
aria-labelledby="modal-alertsLabel1">
<div class="modal-dialog modal-lg" 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">&times;</span></button>
<h4 class="modal-title" id="modal-alertsLabel1">
{{ __('allergies.alerts_for_patient') }}</h4>
</div>
<div class="modal-body">
<div class="container-fluid">
<form>
<input type="hidden" id="alert_patient_id" name="alert_patient_id"
value="{{ $patient->id }}">
<div class="control-group">
<label for="alerts">{{ __('allergies.enter_alert') }}</label>
<div class="controls">
<textarea name="alerts" id="alerts" maxlength="150" class="form-control col-md-12"></textarea>
</div>
</div><br>
<div class="separator bottom"></div>
</form>
</div>
</div>
<div class="modal-footer">
<input type="submit" id="submit_alerts" class = "btn btn-success btn-sm"
value="{{ __('allergies.submit_alert') }}" />
<button type="button" class="btn btn-danger btn-sm"
data-dismiss="modal">{{ __('allergies.close') }}</button>
</div>
</div>
</div>
</div>
<table class="table-bordered table-condensed table-striped w-100 mb-3 br-5"
style="border-collapse: collapse; border-spacing: 0;">
<tbody>
<tr style="border-spacing: 0;">
<td style="font-weight: normal">
<div id="patient_alerts_tab">
@if (isset($known_patient_alerts) && count($known_patient_alerts) > 0)
@if (isset($known_patient_alerts[0]))
&#8226 <small
style="color: red;">{{ $known_patient_alerts[0]->alerts }}</small><br>
@endif
@if (isset($known_patient_alerts[1]))
&#8226 <small
style="color: red;">{{ $known_patient_alerts[1]->alerts }}</small><br>
@endif
@else
<small
style="color: blue;">{{ __('allergies.no_recorded_alerts') }}</small>
@endif
</div>
@if (isset($known_patient_alerts) && count($known_patient_alerts) > 0)
<a href="/alerts/view_alerts">View All</a>
@endif
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
@php
$date_of_birth = get_name($patient->id, 'id', 'date_of_birth', 'patients');
$dob = new Carbon\Carbon($date_of_birth);
$age_diff_months = $dob->diffInMonths(Carbon\Carbon::now());
@endphp
@if ($age_diff_months < 61 && is_smart_discharge_enabled())
<div class="col-sm-2">
<div class="button-box">
<a class="btn btn-danger btn-rounded btn-sm mb-1 d-flex justify-content-between align-items-center gap-2"
style="line-height: 10px; font-size: 11px; gap: 10px;">
Post Discharge Risk of Mortality
</a>
</div>
<table class="table-bordered table-condensed table-striped w-100 br-5">
<tbody class="br-5">
<tr class="br-5">
<td class="br-5">
@if (is_patient_currently_admitted($patient->id))
{!! get_post_discharge_mortality_risk($patient->id) !!}
@else
@php
// just generate the row without displaying anything
$disregard_this = get_post_discharge_mortality_risk($patient->id);
@endphp
Patient is not admitted
@endif
</td>
</tr>
</tbody>
</table>
</div>
@endif
</div>
<div id="saved_allergies_alert" class="myadmin-alert alert-success myadmin-alert-top-right"><a href="#"
class="closed">&times;</a>
<h4>{{ __('allergies.allergies_updated') }}</h4>
</div>
<div id="saved_alerts_alert" class="myadmin-alert alert-success myadmin-alert-top-right"><a href="#"
class="closed">&times;</a>
<h4>{{ __('allergies.alerts_updated') }}</h4>
</div>
<div class="modal fade" id="all_allergies_modal" tabindex="-1" role="dialog"
aria-labelledby="modal-successLabel1">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<ul class="row">
@php
$allergy_count = count($allergic_drugs_ids_array);
@endphp
@for ($i = 0; $i < $allergy_count; $i++)
<li class="col-sm-3">
<small>{{ isset($drug_categories_array[$allergic_drugs_ids_array[$i]]) ? $drug_categories_array[$allergic_drugs_ids_array[$i]] : '' }}</small>
</li>
@endfor
</ul>
</div>
</div>
<div class="modal-footer">
<div class="control-group" style="vertical-align: center;">
<div class="controls">
<button type="button" class="btn btn-success"
data-dismiss="modal">{{ __('allergies.ok') }}</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
@push('scripts')
<script type="text/javascript">
$(".myadmin-alert .closed").click(function(event) {
$(this).parents(".myadmin-alert").fadeToggle(350);
return false;
});
$('#submit_allergies').click(function(e) {
e.preventDefault();
$('#modal-allergies').modal('hide');
var patient_allergies = new Array();
//loop thru the checked allergies and push them into an array
$('input[name="allergies[]"]:checked').each(function() {
patient_allergies.push(this.value);
});
var allergy_patient_id = $('#allergy_patient_id').val();
$.ajax({
type: 'POST',
url: '/store_patient_allergies',
data: {
patient_allergies: patient_allergies,
allergy_patient_id: allergy_patient_id
},
cache: false,
success: function(response) {
//display success notification modal
$("#saved_allergies_alert").fadeToggle(350);
// update the view
let drug_categories_array = {!! json_encode($drug_categories_array) !!};
let patientAllergiesTabHtml = "";
if (typeof patient_allergies[0] !== 'undefined') {
patientAllergiesTabHtml += "&#8226 <small style=\"color: red;\">" +
drug_categories_array[patient_allergies[0]] + "</small><br>";
}
if (typeof patient_allergies[1] !== 'undefined') {
patientAllergiesTabHtml += "&#8226 <small style=\"color: red;\">" +
drug_categories_array[patient_allergies[1]] + "</small><br>";
}
$("#patient_allergies_tab").html(patientAllergiesTabHtml);
$('input[name="allergies[]"]').each(function() {
// loop through allergies and recheck values
if (jQuery.inArray(this.value, patient_allergies) !== -1) {
$(this).prop('checked', true);
} else {
$(this).prop('checked', false);
}
});
}
});
});
/* submit alert */
$('#submit_alerts').click(function(e) {
e.preventDefault();
$('#modal-alerts').modal('hide');
var alert_patient_id = $('#alert_patient_id').val();
var patient_alerts = $('#alerts').val(); //
$.ajax({
type: 'POST',
url: '/store_patient_alerts',
data: {
patient_alerts: patient_alerts,
alert_patient_id: alert_patient_id
},
cache: false,
success: function(response) {
//display success notification modal
$("#saved_alerts_alert").fadeToggle(350);
}
});
});
$(window).on('load', function() {
let def_view = true;
$('.img-pat-profile').hover(
function() {
$('.img-pat-profile i').css('display', '');
},
function() {
$('.img-pat-profile i').css('display', 'none');
});
$('.img-pat-profile i').on('click tap', function(e) {
e.preventDefault();
if (def_view) {
$('.img-pat-profile').css('background-size', '100% auto');
} else {
$('.img-pat-profile').css('background-size', ' auto 100%');
}
def_view = !def_view;
})
});
</script>
@endpush
@@ -0,0 +1,395 @@
@if (session()->has('patient_id') || session()->has('patients_id'))
@endif
@push('scripts')
<script src="{{ asset('js/allergies/scripts.js') }}"></script>
@endpush
@push('styles')
<style type="text/css">
/* Important part used by allergies */
.allergy-modal-dialog{
overflow-y: initial !important
}
.allergy-modal-body{
height: 250px;
overflow-y: auto;
}
@media (min-width: 768px) {
.allergy-modal-dialog {
width: 90%;
max-width:1200px;
}
}
</style>
@endpush
@php
$known_patient_allergies = \Streamline\Models\Allergy::where('patient_id' , $patient->id)->orderBy('created_at','desc')->take(2)->get();
$known_patient_alerts = \Streamline\Models\Alert::where('patient_id' , $patient->id)->orderBy('created_at','desc')->take(2)->get();
$categories = \Streamline\Models\PatientCategory::pluck("name", "id");
$drug_categories_array = DB::table('drug_categories')->pluck('name', 'id');
$drug_categories = \Streamline\Models\DrugCategory::orderBy('name', 'asc')->get();
@endphp
<div class="row">
<div class="col-sm-4">
<div class="modal fade" id="modal-allergies" tabindex="-1" role="dialog" aria-labelledby="modal-allergiesLabel1">
<div class="modal-dialog modal-lg allergy-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">&times;</span></button>
<h4 class="modal-title" id="modal-allergiesLabel1">{{ __('allergies.add_allergies_patient') }}</h4>
</div>
<div class="modal-body allergy-modal-body">
<div class="container-fluid">
<div class="row">
<div class="col-md-4">
<h5>{{ __('allergies.currently_known') }}</h5>
<div id="known_allergies" style="background-color: #e4e7ea">
<ul class="row">
@php $allergic_drugs_ids_array = []; @endphp
@if(count($known_patient_allergies) > 0 )
@foreach($known_patient_allergies as $allergy)
@php
$allergic_drugs_ids_array = explode(',' , $allergy->names);
@endphp
@for($i=0 ; $i < count($allergic_drugs_ids_array) ; $i++)
{{-- @if($i == 0 || $i == 1 || $i == 2)--}}
<li>
{{ isset($drug_categories_array[$allergic_drugs_ids_array[$i]]) ? $drug_categories_array[$allergic_drugs_ids_array[$i]] : 'N/A' }}
</li>
{{-- @endif--}}
@endfor
@endforeach
@endif
</ul>
</div>
</div>
</div>
<div class="row">
<form>
<h5>{{ __('allergies.allergic_reactions') }}</h5>
@foreach($drug_categories->chunk(9) as $chunk)
@foreach($chunk as $drug_category)
<div class="col-md-4">
<!-- if it is a known allergy then check the checkbox -->
@if(in_array($drug_category->id,$allergic_drugs_ids_array))
<input class='patient_allergies' name='allergies[]' type='checkbox' checked="true" value='{{ $drug_category->id }}'/> {{ $drug_category->name }}
@else
<input class='patient_allergies' name='allergies[]' type='checkbox' value='{{ $drug_category->id }}'/> {{ $drug_category->name }}
@endif
<br/>
</div>
@endforeach
@endforeach
<!-- <hr> -->
<input type="hidden" id="allergy_patient_id" name="allergy_patient_id" value="<?php echo $patient->id; ?>">
<!-- <button type="button" id="submit_allergies" class="btn btn-success btn-sm">Submit Allergies</button>
<div class="separator bottom"></div>
<form> -->
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" id="submit_allergies" class="btn btn-success btn-sm">{{ __('allergies.submit_allergies') }}</button>
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">{{ __('allergies.close') }}</button>
</form>
</div>
</div>
</div>
</div>
<div class="panel" style="border-radius: 5px; height: 155px;">
<div class="panel-body">
<div class="row">
<div class="col-sm-6 text-left">
<span style="line-height: 10px; font-size: 14px; margin-top: -10px; margin-right: -10px;">
<strong>{{ __('allergies.allergies') }}</strong> <label class="label label-danger" style="color: white; background-color: red">({{ $allergic_drugs_ids_array?count($allergic_drugs_ids_array):"0"}})</label>
</span>
</div>
<div class="col-sm-6 text-right">
<div class="button-box">
<button type="button" class="btn btn-success btn-rounded btn-sm" data-toggle="modal"
data-target="#modal-allergies" style="line-height: 10px; font-size: 11px; margin-right: -10px;">
{{ __('allergies.add') }} <i class="fa fa-plus-circle"></i>
</button>
</div>
</div>
</div>
<br/>
<div class="row">
<div class="col-sm-12">
@if(count($allergic_drugs_ids_array) > 0)
@php $count = (count($allergic_drugs_ids_array) > 2) ? 2 : count($allergic_drugs_ids_array); @endphp
@for($i=0 ; $i < $count ; $i++)
<label class="label label-danger" style="margin: 5px;">
{{ isset($drug_categories_array[$allergic_drugs_ids_array[$i]]) ? $drug_categories_array[$allergic_drugs_ids_array[$i]] : "" }}
</label>
@endfor
<br/>
{!! count($allergic_drugs_ids_array) > 2 ? '<br/><a href="/allergies"><label class="label label-info pull-right"><i class="fa fa-eye"></i> view all</label></a>' : '' !!}
@else
<div class="label label-danger">{{ __('allergies.no_allergy_added') }}</div>
@endif
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="panel" style="border-radius: 5px; height: 155px;">
<div class="panel-body">
<div class="row">
<div class="col-sm-6 text-left">
<span style="line-height: 10px; font-size: 14px; margin-top: -10px; margin-right: -10px;">
<strong>{{ __('allergies.alerts') }}</strong> <label class="label label-info" style="color: white; background-color: red;">({{ $known_patient_alerts?count($known_patient_alerts):""}})</label>
</span>
</div>
<div class="col-sm-6 text-right">
<div class="button-box">
<button type="button" class="btn btn-success btn-rounded btn-sm" data-toggle="modal" data-target="#modal-alerts"
style="line-height: 10px; font-size: 11px; margin-right: -10px;">
{{ __('allergies.add') }} <i class="fa fa-plus-circle"></i>
</button>
</div>
</div>
</div>
<div class="modal fade" id="modal-alerts" tabindex="-1" role="dialog" aria-labelledby="modal-alertsLabel1">
<div class="modal-dialog modal-lg" 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">&times;</span></button>
<h4 class="modal-title" id="modal-alertsLabel1">{{ __('allergies.alerts_for_patient') }}</h4>
</div>
<div class="modal-body">
<form>
<input type="hidden" id="alert_patient_id" name="alert_patient_id" value="{{ $patient->id }}">
<div class="control-group">
<label for="alerts">{{ __('allergies.enter_alert') }}</label>
<div class="controls">
<textarea name="alerts" id="alerts" maxlength="150" class="form-control col-sm-12"></textarea>
</div>
</div><br>
<input type="submit" id="submit_alerts" class = "btn btn-success btn-sm" value="{{ __('allergies.submit_alert') }}" />
<div class="separator bottom"></div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">{{ __('allergies.close') }}</button>
</div>
</div>
</div>
</div>
<br/>
<div class="row">
<div class="col-sm-12">
@if(isset($known_patient_alerts) && count($known_patient_alerts) > 0)
@foreach($known_patient_alerts as $alert)
<label class="label label-danger" style="margin: 5px;">
{{ $alert->alerts }}
</label>
@endforeach
@else
<div class="label label-sm label-danger btn-rounded">{{ __('allergies.no_recorded_alerts') }}</div>
@endif
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="panel" style="border-radius: 5px; height: 155px;">
<div class="panel-body">
<div class="row">
<div class="col-sm-6 text-left">
<span style="line-height: 10px; font-size: 14px; margin-top: -10px; margin-right: -10px;">
<strong>{{ __('allergies.documents') }}</strong> <label class="label label-info" style="color: white; background-color: red;">({{ $documents?count($documents):""}})</label>
</span>
</div>
<div class="col-sm-6 text-right">
<div class="button-box">
<a type="button" class="btn btn-success btn-rounded btn-sm" href="{{ route('patient_documents.index') }}"
style="line-height: 10px; font-size: 11px; margin-top: -10px; margin-right: -10px;">
{{ __('allergies.add') }} <i class="fa fa-plus-circle"></i>
</a>
</div>
</div>
</div>
<br/>
<div class="row">
<div class="col-sm-12">
@if(count($documents) > 0)
<label class="label label-danger" style="margin: 5px;">{{ count($documents) }} {{ __('allergies.documents_attached') }}.</label>
<br/>
<br/>
<a href="#" onclick="go()" style="font: blue; cursor: pointer; font-weight: bold;">
<label class="label label-info pull-right"><i class="fa fa-eye"></i> {{ __('allergies.view_all') }}</label>
</a>
@else
<div class="label label-danger">{{ __('allergies.no_document_added') }}</div>
@endif
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="modal-success-save1" tabindex="-1" role="dialog" aria-labelledby="modal-successLabel1">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-body">
{{ __('allergies.allergies_for_patient') }}<br>
<div class="control-group" style="vertical-align: center;">
<div class="controls">
<button type="button" class="btn btn-success" data-dismiss="modal">{{ __('allergies.ok') }}</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="modal-success-save2" tabindex="-1" role="dialog" aria-labelledby="modal-successLabel1">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
<div class="modal-body">
{{ __('allergies.alerts_for_patient') }}<br>
<div class="control-group" style="vertical-align: center;">
<div class="controls">
<button type="button" class="btn btn-success" data-dismiss="modal">{{ __('allergies.ok') }}</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="all_allergies_modal" tabindex="-1" role="dialog" aria-labelledby="modal-successLabel1">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<ul class="row">
@php
$allergy_count = count($allergic_drugs_ids_array);
@endphp
@for($i=0 ; $i < $allergy_count ; $i++)
<li class="col-sm-3">
<small>{{ isset($drug_categories_array[$allergic_drugs_ids_array[$i]]) ? $drug_categories_array[$allergic_drugs_ids_array[$i]] : "" }}</small>
</li>
@endfor
</ul>
</div>
</div>
<div class="modal-footer">
<div class="control-group" style="vertical-align: center;">
<div class="controls">
<button type="button" class="btn btn-success" data-dismiss="modal">{{ __('allergies.ok') }}</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@push('scripts')
<script type="text/javascript">
$('#submit_allergies').click(function(e) {
e.preventDefault();
$('#modal-allergies').modal('hide');
var patient_allergies = new Array();
//loop thru the checked allergies and push them into an array
$('input[name="allergies[]"]:checked').each(function() {
patient_allergies.push(this.value);
});
var allergy_patient_id = $('#allergy_patient_id').val();
$.ajax({
type: 'POST',
url: '/store_patient_allergies',
data: {patient_allergies:patient_allergies, allergy_patient_id:allergy_patient_id},
cache: false,
success: function (response) {
//display success notification modal
$('#modal-success-save1').modal('show');
var allergic_drugs_ids_array = {!! json_encode($allergic_drugs_ids_array) !!};
var drug_categories_array = {!! json_encode($drug_categories_array) !!}
var listElements = "";
for(var i=0 ; i < patient_allergies.length ; i++){
listElements += "<li>"+drug_categories_array[patient_allergies[i]]+"</li>";
}
$('#allergies_drugs_list').html(listElements);//list theh checked items after selecting
$('#known_allergies').html(listElements);
$('input[name="allergies[]"]').each(function() {//loop through allergies and recheck values
if(jQuery.inArray(this.value, patient_allergies) !== -1){
$(this).prop('checked', true);
} else {
$(this).prop('checked', false);
}
});
}
});
});
/* submit alert */
$('#submit_alerts').click(function(e) {
e.preventDefault();
$('#modal-alerts').modal('hide');
var alertListElements = "";
var alert_patient_id = $('#alert_patient_id').val();
var patient_alerts = $('#alerts').val();
alertListElements += "<small><li>"+ patient_alerts +"</li></small>";
$.ajax({
type: 'POST',
url: '/store_patient_alerts',
data: {patient_alerts:patient_alerts, alert_patient_id:alert_patient_id},
cache: false,
success: function (response) {
//display success notification modal
$('#modal-success-save2').modal('show');
var known_patient_alerts = {!! json_encode($known_patient_alerts) !!};
for(var alert in known_patient_alerts){
var patient_alert_object = known_patient_alerts[alert];
for (var key in patient_alert_object) {
if (patient_alert_object.hasOwnProperty(key)) {
if (key === "alerts") {
alertListElements += "<small><li>"+ patient_alert_object[key] +"</li></small>";
}
}
}
}
console.log(alertListElements);
$('#known_alerts_list').html(alertListElements);
}
});
});
</script>
@endpush
@@ -0,0 +1,141 @@
@if (session()->has('patient_id'))
@php
$real_patients_id = session('patient_id'); @endphp
@php $patient = get_all_first(['id' => session('patient_id')], 'patients'); @endphp
@endif
<script src="pages/allergies/scripts.js"></script>
<div class="row-fluid">
<div class="col-sm-6">
<a href="#" class="btn-action glyphicons hospital"><i></i></a><span class="count label label-inverse">{{ $patient_categories[$patient->category_id] }}</span>
<div class="widget-stats small">
<div class="widget-body">
<table class="table table-condensed table-striped ">
<!-- Table heading -->
<thead>
<tr>
<th class="center"><font color="black">{{ __('allergies.patient_number') }}</th>
<th class="center"><font color="black">{{ __('allergies.full_names') }}</th>
<th class="center"><font color="black">{{ __('allergies.gender') }}</th>
<th class="center"><font color="black">{{ __('allergies.date_of_birth') }}</font></th>
</tr>
</thead>
<!-- // Table heading END -->
<!-- Table body -->
<tbody>
<?php
if (count($patient) > 0) {
//<!-- Table pricing row -->
echo '<tr class="pricing">';
?>
<td class="center">{{ $patient->number }}</td>
<td class="center">{!! insurance_flag($patient->id) !!}</td>
<td class="center">{{ $patient->gender == 1 ? __('allergies.male') : __('allergies.female') }}</td>
<td class="center">
<?php echo streamline_date_plain($patient->date_of_birth); ?>
</td>
<?php echo '</tr>';
?>
<?php
} else {
echo "<tr><td colspan='4' class='center'><blink><font color='maroon' size='3'>" . __('allergies.no_patient_selected') . "</font></blink></tr></tr>";
}
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-sm-3">
<!-- Allergies Widget -->
<span class="count label label-important">{{ __('allergies.allergies') }}</span><a href="#" data-toggle="modal" class="btn-action glyphicons glyphicons circle_plus btn-action"><i></i></a>
<div style="color: red;" class="widget-stats small">
<strong><?php genAllergiesOne($patient_number); ?></strong>
</div>
<!-- //Allergies Widget END -->
</div>
<div class="col-sm-3">
<!-- Alerts Widget -->
<span class="count label label-important">{{ __('allergies.alerts') }}</span><a href="#" class="btn-action glyphicons "><i></i></a>
<a href="" class="widget-stats small">
<span class="txt">{{ __('allergies.none') }}</span>
</a>
<!-- // Alerts Widget END -->
</div>
</div>
<?php
$drug_category_query = "SELECT * FROM drug_category";
$result_drugs = dbQuery($drug_category_query);
// dropdown options for symptoms
//while ($row = mysql_fetch_assoc($result_drugs)) {
// $drug_dropdown .= "\r\n<option value=" . $row['Category_Id'] . ">" . $row['Category_Name'] . "</option>";
//}
while ($row = mysql_fetch_assoc($result_drugs)) {
$drug_checkbox .= "<input id='allergies' name='allergies[]' type='checkbox' value=" . $row['Category_Id'] . " />" . " " . $row['Category_Name'] . "<br />";
}
?>
<!-- Modal -->
<div class="modal hide fade" id="modal-allergies">
<!-- Modal heading -->
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>{{ __('allergies.add_allergies_patient') }}</h3>
</div>
<!-- // Modal heading END -->
<!-- Modal body -->
<div class="modal-body">
<div class="row">
<div class="col-sm-4">
<form action="pages/allergies/submit_allergies.php" method="POST">
<h4>{{ __('allergies.allergic_reactions') }}</h4>
<!-- <div class="control-group">
<label>Allergic Reactions</label>
<div class="controls">
<select name = "allergies[]" id="select2_6_2" multiple>
<option selected value=''>None</option>
<?php // echo $drug_dropdown; ?>
</select>
</div>
</div>-->
<?php
echo $drug_checkbox;
?>
<hr />
<input type="hidden" id="allergy_patient_id" name="allergy_patient_id" value="<?php echo $row_patient['Patient_Id']; ?>">
<input type="submit" id="submit_allergies" class = "btn btn-primary btn-mini" value="{{ __('allergies.submit_allergies') }}" />
<div class="separator bottom"></div>
</form>
</div>
<div class="col-sm-2">
<h4>{{ __('allergies.currently_known') }}</h4>
<div id="known_allergies">
<?php genAllergiesTwo($patient_number); ?>
</div>
</div>
</div>
</div>
<!-- // Modal body END -->
<!-- Modal footer -->
<div class="modal-footer">
<a href="#" class="btn btn-danger" data-dismiss="modal">{{ __('allergies.close') }}</a>
</div>
<!-- // Modal footer END -->
</div>
<!-- // Modal END -->
@@ -0,0 +1,79 @@
@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-4 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('allergies.allergies_for') }} <font color="blue">{{ $patient->first_name }} {{ $patient->last_name }}</font></h4>
</div>
<div class="col-lg-8 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('allergies.dashboard') }}</a></li>
<li class="active">{{ __('allergies.view') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>{{ __('allergies.allergy') }}</th>
</tr>
</thead>
<tbody>
@php $allergic_drugs_ids_array = []; @endphp
@if(count($known_patient_allergies) > 0 )
@foreach($known_patient_allergies as $allergy)
@php
$allergic_drugs_ids_array = explode(',' , $allergy->names);
$count = 1;
@endphp
@for($i=0 ; $i < count($allergic_drugs_ids_array) ; $i++)
<tr>
<td>{{ $count }}.</td>
<td>{{ $drug_categories_array[$allergic_drugs_ids_array[$i]] }}</td>
</tr>
@php $count++; @endphp
@endfor
@endforeach
@endif
</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