Build modified streamline images

The official image from streamline does not currently work for the arm64
platform. As a temporary measure, the source code and docker build scripts
have been lifted from the official images and are used to build locally.

Some additional modifications are made to reduce overall image size, these
are documented in docker/README.md
This commit is contained in:
2024-03-10 16:17:50 -07:00
parent 2ffc3c408a
commit a424394109
13506 changed files with 1860172 additions and 6 deletions
@@ -0,0 +1,421 @@
@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"><strong>{{ __('allergies.category') }} :</strong>
{{ isset($categories[$patient->category_id]) ? $categories[$patient->category_id] : "N/A" }}
</span>
<div class="row">
<div class="col-sm-10">
<table class="table-bordered table-condensed table-striped">
<tbody>
<tr>
<th style="color: black">{{ __('allergies.patient_number') }}</th>
<th style="color: black">{{ __('allergies.full_names') }}</th>
<th style="color: black">{{ __('allergies.gender') }}</th>
<th class="hidden-phone" style="color: black">{{ __('allergies.age') }}</th>
<th style="color: black">{{ __('allergies.national_id') }}</th>
</tr>
</tbody>
<tbody>
<tr>
<td>{{ $patient->number }}</td>
<td>
{!! 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
</td>
<td>{{ $patient->gender == 1 ? __('allergies.male') : __('allergies.female') }}</td>
<td>{{ get_patients_age($patient->date_of_birth) }}</td>
<td>{!! ($patient->national_id == null || $patient->national_id == "") ? "<span class='label label-info'>National ID Missing</span>" : strtoupper($patient->national_id) !!}</td>
</tr>
</tbody>
</table>
</div>
<div class="col-sm-2">
<div class="button-box">
<a class="img" href="#modal-photo" data-toggle="modal" style="color: whitesmoke">
@if(!is_null($patient->photo) && $patient->photo != "")
<img src='{{ asset($patient->photo) }}' class="img-rounded center" style='height: 59px; width: 100%' />
@else
<img src="/uploads/streamline_images/person-place-holder.jpg" class="img-rounded center" style='height: 100%; width: 100%' />
@endif
</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">
<img src='{{ asset($patient->photo) }}' 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" data-toggle="modal" data-target="#modal-allergies" style="line-height: 10px; font-size: 11px;">{{ __('allergies.allergies') }} <i class="fa fa-plus-circle"></i></a></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">
<form>
<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; ?>">
<!-- <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>
<table class="table-bordered table-condensed table-striped" id="allergies_drugs_table">
<tbody>
<td style="font-weight: normal;">
<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>
</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" data-toggle="modal" data-target="#modal-alerts" style="line-height: 10px; font-size: 11px;">{{ __('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">
<tbody>
<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>
</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" style="line-height: 10px; font-size: 11px;">Post Discharge Risk of Mortality</a>
</div>
<table class="table-bordered table-condensed table-striped">
<tbody>
<tr>
<td>
@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);
}
});
});
</script>
@endpush