resolved conflicts

This commit is contained in:
2025-03-31 03:46:05 +03:00
6454 changed files with 1520539 additions and 9 deletions
@@ -0,0 +1,634 @@
@extends('layouts.main')
@push('styles')
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('investigations.alter') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.alter') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
</div>
</div>
@php
$episode_id = 0; //initialise the episode_id
@endphp
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
<div class="table-responsive">
{{ Form::open(['route' => 'investigations.save_altered_results', 'files' => true, 'enctype'=>'multipart/form-data']) }}
{{ Form::hidden('order_id',$id) }}
{{ Form::hidden('patient_id',$patient->id) }}
<table class="table table-striped color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.investigation_name') }}</th>
<th @if($result_type != "Lab") style="display: none;" @endif>{{ __('investigations.normal_ranges') }}</th>
<th>{{ __('investigations.units') }}</th>
<th>{{ __('investigations.results') }}</th>
<th>{{ __('investigations.comments') }}</th>
</tr>
</thead>
<tbody>
@foreach($invs as $result)
<!-- investigation_specialised_results id to update the table if valid -->
{{ Form::hidden('investigation_specialised_results_id[]', $result['result']) }}
@if(in_array($result['id'], $investigations_with_specialised_variables))
{{ Form::hidden('id[]',$result['id']) }}
<!-- placeholder values -->
{{ Form::hidden('value[]',"") }}
{{ Form::hidden('comment[]',"") }}
<tr>
<td colspan="5">
{{ $result['name'] }}
</td>
</tr>
@php
$specialised_variables = \Illuminate\Support\Facades\DB::table('investigation_specialised_variables')->whereNull('deleted_at')->where('investigation_id', $result['id'])->get();
@endphp
@foreach($specialised_variables as $specialized_variable)
<tr>
<td>
{{ Form::hidden('specialized_id[]', $specialized_variable->id) }}
{{ $specialized_variable->name }}
</td>
<td>
{{ $specialized_variable->normal_ranges }}
</td>
<td>
@if(get_name($specialized_variable->units, 'id', 'name', 'drug_units') != "N/A")
{{ get_name($specialized_variable->units, 'id', 'name', 'drug_units') }}
@endif
</td>
<td>
{{ Form::textArea('specialized_value[]', isset($result['value'][$specialized_variable->id]) ? $result['value'][$specialized_variable->id] : '', ['class' => 'form-control compulsory', 'rows'=>'12', 'id' => 'invx_' . $specialized_variable->id]) }}
@if(does_investigation_have_template($specialized_variable->id, 1))
<br>
<button class="btn btn-rounded btn-primary btn-sm" id="select_specialised_results_template{{ $specialized_variable->id }}">{{ __('investigations.add_result_from_template') }}</button>
@endif
</td>
<td>
{{ Form::textArea('specialized_comment[]', isset($result['comment'][$specialized_variable->id]) ? $result['comment'][$specialized_variable->id] : '', ['class' => 'form-control','rows'=>'12']) }}
</td>
</tr>
@endforeach
<tr><td colspan="5"></td></tr>
@else
<tr>
<td>
{{ $result['name'] }}
{{ Form::hidden('id[]',$result['id']) }}
</td>
<td @if($result_type != "Lab") style="display: none;" @endif>
{{ $result['range'] }}
</td>
<td>
@if(get_name($result['units'], 'id', 'name', 'drug_units') != "N/A")
{{ get_name($result['units'], 'id', 'name', 'drug_units') }}
@endif
</td>
<td>
@if($result['slug'] == "echo")
<div class="row">
<div class="col-md-7">
<button class="fcbtn btn btn-sm btn-info btn-outline btn-1d" data-toggle="modal" data-target=".bs-example-modal-lg" type="button">
<span class="btn-label"><i class="fa fa-plus"></i></span>{{ __('investigations.add_results') }}
</button>
</div>
<div class="col-md-4">
@php
$cardioEcho = \Streamline\Models\CardioEchoResult::where('episode_id', $result['episode_id'])->first();
$episode_id = $result['episode_id'];
@endphp
<span id="cardio_print_div" @if(!isset($cardioEcho)) style="display: none;" @endif>
<a target="_blank" class="fcbtn btn btn-sm btn-default btn-outline btn-1d" href='{{ url("/investigations/print-cardio-echo/{$patient->id}/{$result['episode_id']}") }}'> <i class="fa fa-print"></i> <span>{{ __('investigations.print') }}</span></a>
</span>
</div>
</div>
{{ Form::hidden('value[]', '', ['class' => 'form-control', 'rows'=>'6']) }}
@else
{{ Form::textArea('value[]', $result['result'], ['class' => 'form-control compulsory', 'rows'=>'6', 'id'=>'inv_'.$result['id']]) }}
@if(does_investigation_have_template($result['id'], 0))
<br>
<button class="btn btn-rounded btn-primary btn-sm" id="select_results_template{{ $result['id'] }}">{{ __('investigations.add_result_from_template') }}</button>
@endif
<br>
{{ Form::label('lab_result_document', __('investigations.lab_result_document')) }}
{{-- {{ Form::file('lab_result_document[]', null) }} --}}
{{-- <input type="file" id="lab_result_doc_{{ $result['id'] }}" name="lab_result_document[]" /> --}}
@if (!empty($result['document']))
<br><a class="btn btn-sm label label-info" href="/patient_documents/{{ $result['document'] }}" target="_blank"> {{ $result['title'] }}</a> &nbsp;
@endif
@endif
</td>
<td>
{{ Form::textArea('comment[]', $result['comment'], ['class' => 'form-control','rows'=>'6']) }}
{{ Form::hidden('episode_ids[]', $result['episode_id']) }}
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
{{ Form::button('Submit',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button('Reset',['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
@php
$order_id = get_name($id, 'id', 'order_id', 'investigation_results');
$lab_machine_result = \Streamline\Models\LabMachineResult::where('sample_id', $order_id)->first();
@endphp
@if($lab_machine_result)
<a class="btn btn-primary btn-rounded btn-sm" href="/lab_machines/import_results/{{ $order_id }}">{{ __('investigations.import_results_from_machine') }}</a>
@endif
{{ Form::close() }}
</div>
</div>
</div>
<div id="result_template_modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="resultTemplateModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h2 class="modal-title" style="margin: auto;" id="resultTemplateModalLabel">{{ __('investigations.select_a_template') }}</h2>
</div>
<input type="hidden" id="selected_investigation">
<div class="modal-body" id="template_view"></div>
<div class="modal-footer">
<button class="btn btn-danger waves-effect text-left" data-dismiss="modal">{{ __('investigations.close') }}</button>
</div>
</div>
</div>
</div>
<!-- MODAL - Content for adding Cardiology ECHO Result -->
<div id="cardio-echo-modal" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h2 class="modal-title" style="margin: auto;" id="myLargeModalLabel">ECHO 2-D &amp; DOPPLER STUDY</h2>
</div>
<form id="cardio-echo-form" method="post" action="javascript:void(0)">
@csrf
{{ Form::hidden('patient_id',$patient->id, ['id' => 'patient_id']) }}
{{ Form::hidden('episode_id',$episode_id, ['id' => 'episode_id']) }}
{{ Form::hidden('cardio_template_selected',isset($cardioEcho) ? $cardioEcho->template_used : 0, ['id' => 'cardio_template_selected']) }}
<?php
// Get the previously saved mode measurements for cardio echo
if (isset($cardioEcho)):
$modeMeasurements = unserialize($cardioEcho->mode_measurements);
$dopplerStudy = unserialize($cardioEcho->doppler_study);
$cardioDescriptions = unserialize($cardioEcho->descriptions);
$template = \Streamline\Models\CardioEchoTemplate::find($cardioEcho->template_used);
$range = !empty($template->range)? unserialize($template->range):[];
else:
$modeMeasurements = $dopplerStudy = $cardioDescriptions = $range = [];
endif;
?>
<div class="modal-body">
<h4>2-D/M-MODE MEASUREMENTS (Centimeters)</h4>
<table class="table table-sm color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th width="16.6%" scope="col">&nbsp;</th>
<th width="16.6%" scope="col">{{ __('investigations.result') }} cm</th>
<th width="16.6%" scope="col">&nbsp;</th>
<th width="16.6%" scope="col">Result cm</th>
<th width="16.6%" scope="col">&nbsp;</th>
<th width="16.6%" scope="col">Result cm</th>
</tr>
</thead>
<tbody>
<tr>
<td>IVS</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="ivs_result" name="ivs_result" class="form-control" value="{{ $modeMeasurements['IVS'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ivs_range" id="ivs_range" class="form-control" value="{{ $range['IVS'] ?? '' }}" placeholder="(0.6 - 1.1)" readonly></span>
</td>
<td style="text-align: center;">AO</td>
<td style="padding: 0px; margin: 0px; padding-bottom: 10px;">
<input type="number" min="0" step="0.001" id="ao_result" name="ao_result"class="form-control" value="{{ $modeMeasurements['AO'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ao_range" id="ao_range" class="form-control" value="{{ $range['AO'] ?? '' }}" placeholder="(2.0 - 4)" readonly></span>
</td>
<td style="text-align: center;">EF (%)</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="ef_result" name="ef_result" class="form-control" value="{{ $modeMeasurements['EF (%)'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ef_range" id="ef_range" class="form-control" value="{{ $range['EF (%)'] ?? '' }}" placeholder="( 55 - 80 )" readonly></span>
</td>
</tr>
<tr>
<td>LVIDd</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="lvidd_result" name="lvidd_result" class="form-control" value="{{ $modeMeasurements['LVIDd'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="lvidd_range" id="lvidd_range" class="form-control" value="{{ $range['LVIDd'] ?? '' }}" placeholder="(3.5 - 5.7)" readonly></span>
</td>
<td style="text-align: center;">LA</td>
<td style="padding: 0px; margin: 0px; padding-bottom: 10px;">
<input type="number" min="0" step="0.001" id="la_result" name="la_result" class="form-control" value="{{ $modeMeasurements['LA'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="la_range" id="la_range" class="form-control" value="{{ $range['LA'] ?? '' }}" placeholder="( 2.0 - 4.0 )" readonly></span>
</td>
<td style="text-align: center;">FS (%)</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="fs_result" name="fs_result" class="form-control" value="{{ $modeMeasurements['FS (%)'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="fs_range" id="fs_range" class="form-control" value="{{ $range['FS (%)'] ?? '' }}" placeholder="( 26 - 55 )" readonly></span>
</td>
</tr>
<tr>
<td>LVIDs</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="lvids_result" name="lvids_result" class="form-control" value="{{ $modeMeasurements['LVIDs'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="lvids_range" id="lvids_range" class="form-control" value="{{ $range['LVIDs'] ?? '' }}" placeholder="(2.5 - 4.0)" readonly></span>
</td>
<td style="text-align: center;">RV</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="rv_result" name="rv_result" class="form-control" value="{{ $modeMeasurements['RV'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="rv_range" id="rv_range" class="form-control" value="{{ $range['RV'] ?? '' }}" placeholder="(2.0 - 4.1)" readonly></span>
</td>
<td style="text-align: center;">TAPSE:</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="tapse_result" name="tapse_result" class="form-control" value="{{ $modeMeasurements['TAPSE'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="tapse_range" id="tapse_range" class="form-control" value="{{ $range['TAPSE'] ?? '' }}" placeholder="(1.6)" readonly></span>
</td>
</tr>
<tr>
<td>LVPW</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="lvpwd_result" name="lvpwd_result" class="form-control" value="{{ $modeMeasurements['LVPWd'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="lvpwd_range" id="lvpwd_range" class="form-control" value="{{ $range['LVPWd'] ?? '' }}" placeholder="( 0.6 - 1.2 )" readonly></span>
</td>
<td style="text-align: center;">RA:</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="ra_result" name="ra_result" class="form-control" value="{{ $modeMeasurements['RA'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ra_range" id="ra_range" class="form-control" value="{{ $range['RA'] ?? '' }}" placeholder="(16 cm2)" readonly></span>
</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<h4>DOPPLER FINDINGS</h4>
<div class="row">
<div class="col-sm-12">
<table class="table table-sm color-bordered-table success-bordered-table table-bordered">
<thead>
</thead>
<tbody>
<tr>
<td>Mitral E/A ratio</td>
<td>
<input type="number" min="0" step="0.01" id="mitral_ea_ratio" name="mitral_ea_ratio" value="{{ $dopplerStudy['Mitral EA ratio'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
<td>TR Max. PG (mmHg)</td>
<td>
<input type="number" min="0" step="0.01" id="tr_pg" name ="tr_pg" value="{{ $dopplerStudy['TR PG'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="tr_pg_range" id="tr_pg_range" class="form-control" value="{{ $range['TR PG'] ?? '' }}" placeholder="( 15 - 25 )" readonly></span>
</td>
<td>AV mean PG (mmHg)</td>
<td>
<input type="number" min="0" step="0.01" id="av_mean" name ="av_vmean" value="{{ $dopplerStudy['AV Vmean'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
</tr>
<tr>
<td>AV Vel. max (m/s)</td>
<td>
<input type="number" min="0" step="0.01" id="av_vmax" name ="av_vmax" value="{{ $dopplerStudy['AV Vmax'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
<td>RAP (mmHg)</td>
<td>
<input type="number" min="0" step="0.01" id="rap" name="rap" value="{{ $dopplerStudy['RAP'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<h4>{{ __('investigations.description') }}</h4>
<div class="row">
<div class="col-sm-12">
<table class="table table-sm color-bordered-table success-bordered-table table-bordered">
<thead>
</thead>
<tbody>
<tr>
<td>Left Ventricle</td>
<td>
<textarea name="left_ventricle_description" id="left_ventricle_description" class="form-control" style="border-color: #A9A9A9">
{{ $cardioDescriptions['left_ventricle_description'] ?? '' }}
</textarea>
</td>
</tr>
<tr>
<td>Right Ventricle</td>
<td>
<textarea name="right_ventricle_description" id="right_ventricle_description" class="form-control" style="border-color: #A9A9A9">
{{ $cardioDescriptions['right_ventricle_description'] ?? '' }}
</textarea>
</td>
</tr>
<tr>
<td>Left Atrium</td>
<td>
<textarea name="left_atrium_description" id="left_atrium_description" class="form-control" style="border-color: #A9A9A9">
{{ $cardioDescriptions['left_atrium_description'] ?? '' }}
</textarea>
</td>
</tr>
<tr>
<td>Right Atrium</td>
<td>
<textarea name="right_atrium_description" id="right_atrium_description" class="form-control" style="border-color: #A9A9A9">
{{ $cardioDescriptions['right_atrium_description'] ?? '' }}
</textarea>
</td>
</tr>
<tr>
<td>Aortic Valve</td>
<td>
<textarea name="aortic_valve_description" id="aortic_valve_description" class="form-control" style="border-color: #A9A9A9">
{{ $cardioDescriptions['aortic_valve_description'] ?? '' }}
</textarea>
</td>
</tr>
<tr>
<td>Mitral Valve</td>
<td>
<textarea name="mitral_valve_description" id="mitral_valve_description" class="form-control" style="border-color: #A9A9A9">
{{ $cardioDescriptions['mitral_valve_description'] ?? '' }}
</textarea>
</td>
</tr>
<tr>
<td>Pulmonary Valve</td>
<td>
<textarea name="pulmonary_valve_description" id="pulmonary_valve_description" class="form-control" style="border-color: #A9A9A9">
{{ $cardioDescriptions['pulmonary_valve_description'] ?? '' }}
</textarea>
</td>
</tr>
<tr>
<td>Tricuspid Valve</td>
<td>
<textarea name="tricuspid_valve_description" id="tricuspid_valve_description" class="form-control" style="border-color: #A9A9A9">
{{ $cardioDescriptions['tricuspid_valve_description'] ?? '' }}
</textarea>
</td>
</tr>
<tr>
<td>Aortic root and arch</td>
<td>
<textarea name="aortic_root_and_arch_description" id="aortic_root_and_arch_description" class="form-control" style="border-color: #A9A9A9">
{{ $cardioDescriptions['aortic_root_and_arch_description'] ?? '' }}
</textarea>
</td>
</tr>
<tr>
<td>Pericardium</td>
<td>
<textarea name="pericardium_description" id="pericardium_description" class="form-control" style="border-color: #A9A9A9">
{{ $cardioDescriptions['pericardium_description'] ?? '' }}
</textarea>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row">
<!-- <div class="col-md-6">
<label class="control-label">Additional Comments</label>
<textarea id="cardio_echo_comments" name="cardio_echo_comments" rows="5" class="form-control">{{ $cardioEcho->comments ?? '' }}</textarea>
</div> -->
<div class="col-md-12">
<label class="control-label">{{ __('investigations.conclusion') }}</label>
<textarea id="cardio_echo_conclusion" name="cardio_echo_conclusion" rows="5" class="form-control">{{ $cardioEcho->conclusion ?? '' }}</textarea>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-danger waves-effect text-left" data-dismiss="modal">{{ __('investigations.close') }}</button>
<button type="submit" id="submit-echo-results" class="btn btn-success waves-effect text-left">{{ __('investigations.submit_results') }}</button>
</div>
</form>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- modal to flash successful submission of cardio-echo results -->
<div class="modal fade" id="flashEchoSubmissionSuccess" tabindex="-1" role="dialog">
<div class="modal-dialog vertical-align-center modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="row">
<div class="col-sm-12">
{{ __('investigations.successful_submission_of_echo_results') }}
</div>
</div>
<div class="row">
<div class="col-sm-4"></div>
<div class="col-sm-4">
<button class="btn btn-success waves-effect text-left" data-dismiss="modal">{{ __('investigations.ok') }}</button>
</div>
<div class="col-sm-4"></div>
</div>
</div>
</div>
</div>
</div>
<!-- end of modal for flash successful submission of echo results -->
@endsection
@push('scripts')
<script type="text/javascript">
$("[id^='select_results_template']").click(function (e) {
e.preventDefault();
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
add_templates(id, 0);
$('#result_template_modal').modal('show');
$('#selected_investigation').val(id);
});
$("[id^='select_specialised_results_template']").click(function (e) {
e.preventDefault();
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
add_templates(id, 1);
$('#result_template_modal').modal('show');
$('#selected_investigation').val(0 + "-" + id);
});
function add_templates(id, is_variable) {
$.ajax({
method: 'GET',
url: '/result_templates/get_templates_for_investigation/' + id + '/' + is_variable,
success: function(response){
$('#template_view').html(response);
}
});
}
function confirm_selection(id){
let input_field_id = $('#selected_investigation').val();
if(input_field_id[0] == 0) {
let split_text = input_field_id.split("-");
$('#invx_'+split_text[1]).val($('#template_'+id).text());
} else {
$('#inv_'+input_field_id).val($('#template_'+id).text());
}
$('#result_template_modal').modal('hide');
}
$('#submit-echo-results').click(function () {
var patient_id = $('#patient_id').val();
var episode_id = $('#episode_id').val();
var cardio_template_selected = $('#cardio_template_selected').val();
var lad_result = $('#lad_result').val();
var ivs_result = $('#ivs_result').val();
var fs_result = $('#fs_result').val();
var ao_result= $('ao_result').val();
var lvidd_result = $('#lvidd_result').val();
var ef_result = $('#ef_result').val();
var lad_ao_result = $('#lad_ao_result').val();
var lvpwd_result = $('#lvpwd_result').val();
var ea_result = $('#ea_result').val();
var rvidd_result = $('#rvidd_result').val();
var sv_result = $('#sv_result').val();
var tapse_result = $('#tapse_result').val();
var lvids_result = $('#lvids_result').val();
var ra_result = $('#ra_result').val();
var rv_result = $('#rv_result').val();
var av_vmax = $('#av_vmax').val();
var av_mean = $('#av_mean').val();
var mitral_ea_ratio = $('#mitral_ea_ratio').val();
var tr_pg = $('#tr_pg').val();
var rap = $('#rap').val();
var mitral_valve_insufficiency = $('#mitral_valve_insufficiency').val();
var mitral_valve_stenosis = $('#mitral_valve_stenosis').val();
var aortic_valve_insufficiency = $('#aortic_valve_insufficiency').val();
var aortic_valve_stenosis = $('#aortic_valve_stenosis').val();
var pulmonary_valve_insufficiency = $('#pulmonary_valve_insufficiency').val();
var pulmonary_valve_stenosis = $('#pulmonary_valve_stenosis').val();
var tricuspid_valve_insufficiency = $('#tricuspid_valve_insufficiency').val();
var tricuspid_valve_stenosis = $('#tricuspid_valve_stenosis').val();
var cardio_echo_comments = $('#cardio_echo_comments').val();
var cardio_echo_conclusion = $('#cardio_echo_conclusion').val();
var left_ventricle_description = $('#left_ventricle_description').val();
var right_ventricle_description = $('#right_ventricle_description').val();
var right_atrium_description = $('#right_atrium_description').val();
var left_atrium_description = $('#left_atrium_description').val();
var aortic_valve_description = $('#aortic_valve_description').val();
var mitral_valve_description = $('#mitral_valve_description').val();
var pulmonary_valve_description = $('#pulmonary_valve_description').val();
var tricuspid_valve_description = $('#tricuspid_valve_description').val();
var aortic_root_and_arch_description = $('#aortic_root_and_arch_description').val();
var pericardium_description = $('#pericardium_description').val();
let data = {
'patient_id' : patient_id,
'episode_id' : episode_id,
'cardio_template_selected' : cardio_template_selected,
'lad_result' : lad_result,
'ivs_result' : ivs_result,
'fs_result' : fs_result,
'ao_result': ao_result,
'lvidd_result' : lvidd_result,
'ef_result' : ef_result,
'lad_ao_result' : lad_ao_result,
'lvpwd_result' : lvpwd_result,
'ea_result' : ea_result,
'rvidd_result': rvidd_result,
'sv_result': sv_result,
'tapse_result': tapse_result,
'lvids_result': lvids_result,
'ra_result': ra_result,
'rv_result': rv_result,
'av_vmax': av_vmax,
'av_mean': av_mean,
'mitral_ea_ratio': mitral_ea_ratio,
'tr_pg': tr_pg,
'rap': rap,
'mitral_valve_insufficiency': mitral_valve_insufficiency,
'mitral_valve_stenosis': mitral_valve_stenosis,
'aortic_valve_insufficiency': aortic_valve_insufficiency,
'aortic_valve_stenosis': aortic_valve_stenosis,
'pulmonary_valve_insufficiency': pulmonary_valve_insufficiency,
'pulmonary_valve_stenosis': pulmonary_valve_stenosis,
'tricuspid_valve_insufficiency': tricuspid_valve_insufficiency,
'tricuspid_valve_stenosis': tricuspid_valve_stenosis,
'left_ventricle_description': left_ventricle_description,
'right_ventricle_description': right_ventricle_description,
'right_atrium_description': right_atrium_description,
'left_atrium_description': left_atrium_description,
'aortic_valve_description': aortic_valve_description,
'mitral_valve_description': mitral_valve_description,
'pulmonary_valve_description': pulmonary_valve_description,
'tricuspid_valve_description': tricuspid_valve_description,
'aortic_root_and_arch_description': aortic_root_and_arch_description,
'pericardium_description': pericardium_description,
'cardio_echo_comments': cardio_echo_comments,
'cardio_echo_conclusion': cardio_echo_conclusion,
};
console.log(JSON.stringify(data));
$.ajax({
type: "post",
url: '/investigations/store-cardio-echo',
data: data,
cache: false,
success: function (result) {
console.log(JSON.stringify(result));
$("#cardio-echo-modal").modal("hide");
$("#flashEchoSubmissionSuccess").modal("show");
$("#cardio_print_div").show();
}
});
});
</script>
@endpush
@@ -0,0 +1,542 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-7">
<h4 class="page-title">{{ __('investigations.alter_obstetric_ultrasound') }}</h4>
</div>
<div class="col-md-5">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.alter') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
</div>
</div>
<div class="white-box">
@include('flash::message')
{{ Form::open(['route' => 'investigations.submit_ultrasound_obstetric_report']) }}
{{ Form::hidden('order_id',$order_id) }}
{{ Form::hidden('patient_id',$patient_id) }}
{{ Form::hidden('episode_id',$episode_id) }}
{{ Form::hidden('alter_obstetric', $obstetric_ultrasound_report_id) }}
<div class="row">
<div class="col-md-4">
<div class="form-group">
{{ Form::label('scan_date', __('investigations.date_of_scan')) }}
<div class="input-group">
{{ Form::text('scan_date', \Carbon\Carbon::createFromFormat('Y-m-d', $report->scan_date)->format('d-m-Y'), ['class'=>'form-control compulsory', 'id'=>'scan_date', 'readonly']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
{{ Form::label('sonographer_name', __('investigations.sonographer')) }}
{{ Form::text('sonographer_name', get_full_name($report->sonographer, 'id', 'first_name', 'last_name', 'users'), ['class' => 'form-control compulsory', 'readonly']) }}
{{ Form::hidden('sonographer', $report->sonographer) }}
</div>
</div>
<div class="col-md-4">
<div class="form-group">
{{ Form::label('no_of_foetus', __('investigations.number_of_foetus')) }}
<input type="number" id="numberInput" name="no_of_foetus" class="form-control compulsory" min="1" max="3" value="{{ $report->no_of_foetus ?? '1' }}" onchange="showFoetusColumns()">
</div>
</div>
</div>
<h4>{{ __('investigations.obstetric_ultrasound_order_details') }}</h4>
<div class="table-responsive">
<table class="table table-primary table-striped table-thead-simple table-hover table-bordered">
<tr>
<th>{{ __('investigations.order_date') }}</th>
<td colspan="5">{{ streamline_date(get_name($order_id, 'id', 'created_at', 'ordered_investigations')) }}</td>
</tr>
<tr>
<th>{{ __('investigations.gravida') }}</th>
<td>{{ get_name($episode_id, 'episode_id', 'gravida', 'ante_natal_clinic_registrations') }}</td>
<th>{{ __('investigations.para') }}</th>
<td>{{ get_name($episode_id, 'episode_id', 'para', 'ante_natal_clinic_registrations') }}</td>
<th>{{ __('investigations.abortions') }}</th>
<td>{{ get_name($episode_id, 'episode_id', 'abortion', 'ante_natal_clinic_registrations') }}</td>
</tr>
<tr>
<th>{{ __('investigations.lmp') }}</th>
<td>
@if(get_name($episode_id, 'episode_id', 'lmp', 'ante_natal_clinic_registrations') == 'N/A')
N/A
@else
{{ streamline_date(get_name($episode_id, 'episode_id', 'lmp', 'ante_natal_clinic_registrations')) }}
@endif
</td>
<th>{{ __('investigations.accuracy') }}</th>
<td>
@if(get_name($episode_id, 'episode_id', 'accuracy', 'ante_natal_clinic_registrations') == 'N/A')
N/A
@else
{{ get_name(get_name($episode_id, 'episode_id', 'accuracy', 'ante_natal_clinic_registrations'), 'id', 'name', 'ante_natal_clinic_accuracies') }}
@endif
</td>
<th>{{ __('investigations.edd') }}</th>
<td>
@if(get_name($episode_id, 'episode_id', 'edd', 'ante_natal_clinic_registrations') == 'N/A')
N/A
@else
{{ streamline_date(get_name($episode_id, 'episode_id', 'edd', 'ante_natal_clinic_registrations')) }}
@endif
</td>
</tr>
<tr>
<th>{{ __('investigations.clinic') }}</th>
<td>{{ get_name(get_name($episode_id, 'id', 'clinic_id', 'patient_episodes'), 'id', 'name', 'clinics') }}</td>
<th>{{ __('investigations.requested_by') }}</th>
<td>
@php
$requester_id = get_name($order_id, 'id', 'created_by', 'ordered_investigations');
if($requester_id == 'N/A'){
$requested_by = Auth::user()->id;
} else {
$requested_by = $requester_id;
}
@endphp
{{ get_full_name($requested_by, 'id', 'first_name', 'last_name', 'users') }}
</td>
<th>{{ __('investigations.phone') }}</th>
<td>{{ get_name($requested_by, 'id', 'phone', 'users') }}</td>
</tr>
<tr>
<th>{{ __('investigations.comment') }}</th>
<td colspan="5">{{ get_name($order_id, 'id', 'comment', 'ordered_investigations') }}</td>
</tr>
</table>
</div>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.item') }}</th>
<th><div class="foetus1header hiddenx">1</div></th>
<th><div class="foetus2header hidden">2</div></th>
<th><div class="foetus3header hidden">3</div></th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ __('investigations.crown_rump_length') }} (cm)</td>
<td>
<div class="form-group">
<input type="number" value="{{ split_string_null_check($report->crown_rump, 0) ?? '' }}" class="form-control" name="crown_rump1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r1 hidden">
<input type="number" value="{{ split_string_null_check($report->crown_rump, 1) ?? '' }}" class="form-control" name="crown_rump2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r1 hidden">
<input type="number" value="{{ split_string_null_check($report->crown_rump, 2) ?? '' }}" class="form-control" name="crown_rump3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.bi_parietal_diameter') }} (cm)</td>
<td>
<div class="form-group ">
<input type="number" value="{{ split_string_null_check($report->bi_parietal_diameter, 0) ?? '' }}" class="form-control" name="bi_parietal_diameter1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r2 hidden">
<input type="number" value="{{ split_string_null_check($report->bi_parietal_diameter, 1) ?? '' }}" class="form-control" name="bi_parietal_diameter2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r2 hidden">
<input type="number" value="{{ split_string_null_check($report->bi_parietal_diameter, 2) ?? '' }}" class="form-control" name="bi_parietal_diameter3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.head_circumference') }} (cm)</td>
<td>
<div class="form-group">
<input type="number" value="{{ split_string_null_check($report->head_circumference, 0) ?? '' }}" class="form-control" name="head_circumference1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r3 hidden">
<input type="number" value="{{ split_string_null_check($report->head_circumference, 1) ?? '' }}" class="form-control" name="head_circumference2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r3 hidden">
<input type="number" value="{{ split_string_null_check($report->head_circumference, 2) ?? '' }}" class="form-control" name="head_circumference3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.abdominal_circumference') }} (cm)</td>
<td>
<div class="form-group ">
<input type="number" value="{{ split_string_null_check($report->abdominal_circumference, 0) ?? '' }}" class="form-control" name="abdominal_circumference1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r4 hidden">
<input type="number" value="{{ split_string_null_check($report->abdominal_circumference, 1) ?? '' }}" class="form-control" name="abdominal_circumference2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r4 hidden">
<input type="number" value="{{ split_string_null_check($report->abdominal_circumference, 2) ?? '' }}" class="form-control" name="abdominal_circumference3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.femur_length') }} (cm)</td>
<td>
<div class="form-group ">
<input type="number" value="{{ split_string_null_check($report->femur_length, 0) ?? '' }}" class="form-control" name="femur_length1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r5 hidden">
<input type="number" value="{{ split_string_null_check($report->femur_length, 1) ?? '' }}" class="form-control" name="femur_length2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r5 hidden">
<input type="number" value="{{ split_string_null_check($report->femur_length, 2) ?? '' }}" class="form-control" name="femur_length3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.estimated_foetal_weight') }} (kg)</td>
<td>
<div class="form-group">
<input type="number" value="{{ split_string_null_check($report->estimated_foetal_weight, 0) ?? '' }}" class="form-control" name="estimated_foetal_weight1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r6 hidden">
<input type="number" value="{{ split_string_null_check($report->estimated_foetal_weight, 1) ?? '' }}" class="form-control" name="estimated_foetal_weight2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r6 hidden">
<input type="number" value="{{ split_string_null_check($report->estimated_foetal_weight, 2) ?? '' }}" class="form-control" name="estimated_foetal_weight3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.average_gestation_age') }} ({{ __('investigations.weeks') }})</td>
<td>
<div class="form-group">
<input type="number" class="form-control" name="average_gestational_age1" value="{{ split_string_null_check($report->average_gestational_age, 0) ?? '' }}" placeholder=" ">
</div>
</td>
<td>
<div class="form-group foetus2r7 hidden">
<input type="number" class="form-control" name="average_gestational_age2" value="{{ split_string_null_check($report->average_gestational_age, 1) ?? '' }}" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r7 hidden">
<input type="number" class="form-control" name="average_gestational_age3" value="{{ split_string_null_check($report->average_gestational_age, 2) ?? '' }}" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.edd') }}</td>
<td>
<div class="input-group">
{{ Form::text('expected_delivery_date1', split_string_null_check($report->expected_delivery_date, 0), ['class'=>'form-control', 'id'=>'expected_delivery_date1', 'readonly']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</td>
<td>
<div class="input-group foetus2r8 hidden">
{{ Form::text('expected_delivery_date2', split_string_null_check($report->expected_delivery_date, 1), ['class'=>'form-control', 'id'=>'expected_delivery_date2', 'readonly']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</td>
<td>
<div class="input-group foetus3r8 hidden">
{{ Form::text('expected_delivery_date3', split_string_null_check($report->expected_delivery_date, 2), ['class'=>'form-control', 'id'=>'expected_delivery_date3', 'readonly']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.presentation') }}</td>
<td>
<select name="presentation1" class="form-control">
<option>{{ split_string_null_check($report->presentation, 0) }}</option>
<option>{{ __('investigations.cephalic') }}</option>
<option>{{ __('investigations.breech') }}</option>
<option>{{ __('investigations.transverse') }}</option>
</select>
</td>
<td>
<select name="presentation2" class="form-control foetus2r9 hidden">
<option>{{ split_string_null_check($report->presentation, 1) }}</option>
<option>{{ __('investigations.cephalic') }}</option>
<option>{{ __('investigations.breech') }}</option>
<option>{{ __('investigations.transverse') }}</option>
</select>
</td>
<td>
<select name="presentation3" class="form-control foetus3r9 hidden">
<option>{{ split_string_null_check($report->presentation, 2) }}</option>
<option>{{ __('investigations.cephalic') }}</option>
<option>{{ __('investigations.breech') }}</option>
<option>{{ __('investigations.transverse') }}</option>
</select>
</td>
</tr>
<tr>
<td>{{ __('investigations.placental_site') }}</td>
<td>
<select name="placental_site1" class="form-control ">
<option>{{ split_string_null_check($report->placental_site, 0) }}</option>
<option>{{ __('investigations.anterior') }}</option>
<option>{{ __('investigations.posterior') }}</option>
<option>{{ __('investigations.fundal_anterior') }}</option>
<option>{{ __('investigations.fundal_posterior') }}</option>
<option>{{ __('investigations.low_lying_grade1') }}</option>
<option>{{ __('investigations.low_lying_grade2') }}</option>
<option>{{ __('investigations.low_lying_grade3') }}</option>
</select>
</td>
<td>
<select name="placental_site2" class="form-control foetus2r10 hidden">
<option>{{ split_string_null_check($report->placental_site, 1) }}</option>
<option>{{ __('investigations.anterior') }}</option>
<option>{{ __('investigations.posterior') }}</option>
<option>{{ __('investigations.fundal_anterior') }}</option>
<option>{{ __('investigations.fundal_posterior') }}</option>
<option>{{ __('investigations.low_lying_grade1') }}</option>
<option>{{ __('investigations.low_lying_grade2') }}</option>
<option>{{ __('investigations.low_lying_grade3') }}</option>
</select>
</td>
<td>
<select name="placental_site3" class="form-control foetus3r10 hidden">
<option>{{ split_string_null_check($report->placental_site, 2) }}</option>
<option>{{ __('investigations.anterior') }}</option>
<option>{{ __('investigations.posterior') }}</option>
<option>{{ __('investigations.fundal_anterior') }}</option>
<option>{{ __('investigations.fundal_posterior') }}</option>
<option>{{ __('investigations.low_lying_grade1') }}</option>
<option>{{ __('investigations.low_lying_grade2') }}</option>
<option>{{ __('investigations.low_lying_grade3') }}</option>
</select>
</td>
</tr>
<tr>
<td>{{ __('investigations.liquor_volume') }} (mls)</td>
<td>
<div class="form-group">
{{ Form::number('liquor_volume1', split_string_null_check($report->liquor_volume, 0), ['class' => 'form-control']) }}
</div>
</td>
<td>
<div class="form-group foetus2r11 hidden">
{{ Form::number('liquor_volume2', split_string_null_check($report->liquor_volume, 1), ['class' => 'form-control']) }}
</div>
</td>
<td>
<div class="form-group foetus3r11 hidden">
{{ Form::number('liquor_volume3', split_string_null_check($report->liquor_volume, 2), ['class' => 'form-control']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.cord_artery_doppler') }}</td>
<td>
<div class="form-group">
{{ Form::text('cord_artery_doppler1', split_string_null_check($report->cord_artery_doppler, 0), ['class' => 'form-control']) }}
</div>
</td>
<td>
<div class="form-group foetus2r12 hidden">
{{ Form::text('cord_artery_doppler2', split_string_null_check($report->cord_artery_doppler, 1), ['class' => 'form-control']) }}
</div>
</td>
<td>
<div class="form-group foetus3r12 hidden">
{{ Form::text('cord_artery_doppler3', split_string_null_check($report->cord_artery_doppler, 2), ['class' => 'form-control']) }}
</div>
</td>
</tr>
@php
//explode comments with separator ,,,
$comments = !empty($report->comments) ? explode(",,,",$report->comments) : '';
@endphp
<tr>
<td>{{ __('investigations.comments_additional_info') }}</td>
<td>
<div class="form-group">
<textarea class="form-control " name="comments1" rows="7" > {{ $comments[0] ?? ''}} </textarea>
</div>
</td>
<td>
<div class="form-group foetus2r13 hidden">
<textarea class="form-control " name="comments2" rows="7" > {{ $comments[1] ?? ''}} </textarea>
</div>
</td>
<td>
<div class="form-group foetus3r13 hidden">
<textarea class="form-control " name="comments3" rows="7" > {{ $comments[2] ?? ''}} </textarea>
</div>
</td>
</tr>
</tbody>
</table>
</div>
{{ Form::button('Submit',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'submit_button']) }}
{{ Form::close() }}
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
{{-- show foetus data columns on change of foetus number input --}}
<script>
//function to load the colummns
function showFoetusColumns() {
var inputVal = parseInt(document.getElementById("numberInput").value);
// div classes with their respective visibility requirements
var divClasses = {
//foetus one sections
'foetus1header': 1,'foetus1r1': 1,'foetus1r2': 1, 'foetus1r3': 1,'foetus1r4': 1,'foetus1r5': 1,'foetus1r6': 1,'foetus1r7': 1,'foetus1r8': 1,'foetus1r9': 1, 'foetus1r10': 1,'foetus1r11': 1,'foetus1r12': 1,'foetus1r13': 1,
//foetus two sections
'foetus2header': 2,'foetus2r1': 2,'foetus2r2': 2,'foetus2r3': 2,'foetus2r4': 2,'foetus2r5': 2,'foetus2r6': 2,'foetus2r7': 2,'foetus2r8': 2,'foetus2r9': 2, 'foetus2r10': 2,'foetus2r11': 2,'foetus2r12': 2,'foetus2r13': 2,
//foetus three sections
'foetus3header': 3,'foetus3r1': 3,'foetus3r2': 3,'foetus3r3': 3,'foetus3r4': 3,'foetus3r5': 3,'foetus3r6': 3,'foetus3r7': 3,'foetus3r8': 3,'foetus3r9': 3, 'foetus3r10': 3,'foetus3r11': 3,'foetus3r12': 3,'foetus3r13': 3,
};
// Loop through the divClasses object
for (var className in divClasses) {
if (divClasses.hasOwnProperty(className)) {
var divs = document.querySelectorAll('.' + className);
divs.forEach(function(div) {
if (inputVal >= divClasses[className]) {
// Show the div
div.classList.remove('hidden');
} else {
// Hide the div and clear its input fields
div.classList.add('hidden');
var inputs = div.querySelectorAll('input, textarea');
inputs.forEach(function(input) {
input.value = ''; // Clear the value of the input field
});
// Reset select elements
var selects = div.querySelectorAll('select');
selects.forEach(function(select) {
select.selectedIndex = 0; // Reset to the first option
//select.value = '';
});
}
});
}
}
}
</script>
<script type="text/javascript">
//load all columns depending on number in input , on page load
window.onload = function() {
showFoetusColumns();
};
</script>
<script type="text/javascript">
$('#scan_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#expected_delivery_date1').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#expected_delivery_date2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#expected_delivery_date3').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
@endpush
@@ -0,0 +1,211 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css"/>
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet"/>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('layout.alter_investigations_results') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.alter') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['method'=>'post','route' => 'investigations.alter_results']) }}
{{ Form::hidden('patient_id', 0, ['id' => 'patient_id']) }}
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label>{{ __('pharmacy.select_date') }}:</label>
<select class="form-control compulsory required" name="search_date_by" id="search_date_by" required>
<option value="today">{{ __('pharmacy.today') }}</option>
<option value="yesterday">{{ __('pharmacy.yesterday') }}</option>
<option value="custom_date">{{ __('pharmacy.custom_date') }}</option>
<option value="custom_date_range">{{ __('pharmacy.date_range') }}</option>
</select>
</div>
</div>
<div class="col-md-2" id="start_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('pharmacy.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-2" id="end_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('pharmacy.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-3">
{{ Form::label('search_patient', 'Search By Patient') }}
<div class="input-group">
<select class="form-control" name="patient_number" id="patient_number"></select>
</div>
</div>
<div class="col-md-2">
<div class="form-group" style="margin-top: 25px;">
{{ Form::submit(__('investigations.search'), ['class'=>'btn btn-success pull-right']) }}
</div>
</div>
</div>
{{ Form::close() }}
</div>
<div class="row">
<div class="col-sm-12">
<div class="white-box">
@include('flash::message')
@if($search_text != "")
<h4><label class="label label-info">{{ $search_text }}</label></h4>
<br>
@endif
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.patient_number') }}</th>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.ordered_investigations') }}</th>
<th>{{ __('investigations.gender') }}</th>
<th>{{ __('investigations.date_of_birth') }}</th>
<th>{{ __('investigations.submission_date') }}</th>
<th>{{ __('investigations.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($results as $result)
<tr>
<td>
{{ get_name($result->patient_id, 'id', 'number', 'patients') }}
</td>
<td>
{!! insurance_flag($result->patient_id) !!}
</td>
<td>
<?php $investigation_ids = explode(",", $result->investigation_id) ?>
<ol>
@foreach($investigation_ids as $investigation_id)
<li>{{ get_name($investigation_id, 'id', 'name', 'investigations') }}</li>
@endforeach
</ol>
</td>
<td>
<?php $gender = get_name($result->patient_id, 'id', 'gender', 'patients') ?>
@if($gender == 1)
{{ __('investigations.male') }}
@elseif($gender == 2)
{{ __('investigations.female') }}
@elseif($gender == 3)
{{ __('investigations.other') }}
@endif
</td>
<td>
{{ streamline_date_plain(get_name($result->patient_id, 'id', 'date_of_birth', 'patients')) }}
</td>
<td>
{{ removeSeconds($result->created_at) }}
</td>
<td class="text-center">
{{ Form::open(['route' => 'investigations.alter_ordered_results']) }}
{{ Form::hidden('patient_id',$result->patient_id) }}
{{ Form::hidden('id',$result->id) }}
<button type="submit" class="btn btn-rounded btn-warning btn-sm">{{ __('investigations.alter') }}</button>
{{ Form::close() }}
</td>
</tr>
@endforeach
@if(count($results) <= 0)
<tr>
<td colspan="6" class='text-center' style='color: maroon; font-weight: bold;'>{{ __('investigations.no_investigations_found') }}</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
$('#patient_number').change(function () {
let id = $('#patient_number').val();
$('#patient_id').val(id);
});
$('#patient_number').select2({
placeholder: 'Search by patient details (names and number)',
ajax: {
url: '/patients/search_patient_by_name_number',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.first_name + " " + item.last_name + " (" + item.number + ")",
id: item.id
}
})
};
},
cache: true
}
});
$('#search_date_by').change(function() {
if($(this).val() === "custom_date"){
$("#end_date_div").hide();
$("#start_date_div").show();
} else if($(this).val() === "custom_date_range") {
$("#start_date_div").show();
$("#end_date_div").show();
} else {
$("#end_date_div").hide();
$("#start_date_div").hide();
}
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
@endpush
@@ -0,0 +1,252 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css"/>
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet"/>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('investigations.alter_radiology_ultrasound_results') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.alter') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['method'=>'post','route' => 'investigations.alter_results_others']) }}
{{ Form::hidden('patient_id', 0, ['id' => 'patient_id']) }}
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label>{{ __('pharmacy.select_date') }}:</label>
<select class="form-control compulsory required" name="search_date_by" id="search_date_by" required>
<option value="today">{{ __('pharmacy.today') }}</option>
<option value="yesterday">{{ __('pharmacy.yesterday') }}</option>
<option value="custom_date">{{ __('pharmacy.custom_date') }}</option>
<option value="custom_date_range">{{ __('pharmacy.date_range') }}</option>
</select>
</div>
</div>
<div class="col-md-2" id="start_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('pharmacy.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-2" id="end_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('pharmacy.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-3">
{{ Form::label('search_patient', __('investigations.search_by_patient')) }}
<div class="input-group">
<select class="form-control" name="patient_number" id="patient_number"></select>
</div>
</div>
<div class="col-md-2">
<div class="form-group" style="margin-top: 25px;">
{{ Form::submit(__('investigations.search'), ['class'=>'btn btn-success pull-right']) }}
</div>
</div>
</div>
{{ Form::close() }}
</div>
<div class="white-box">
@include('flash::message')
@if($search_text != "")
<h4><label class="label label-info">{{ $search_text }}</label></h4>
<br>
@endif
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.requested') }}</th>
<th>{{ __('investigations.performed_at') }}</th>
<th>{{ __('investigations.source') }}</th>
<th>{{ __('investigations.payment') }}</th>
<th>{{ __('investigations.request') }}</th>
<th>{{ __('investigations.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($results as $result)
<tr>
<td>
{!! insurance_flag($result->patient_id) !!}
({{ $result->patient_number }}) - ({{ $patient_categories[$result->patients_category_id] }})
</td>
<td>
{{ streamline_date_time_short($result->requested_at) }}
</td>
<td>{{ streamline_date_time_short($result->created_at) }}</td>
<td>
@if($result->inpatient == 1)
{{ get_ward_name($result->patient_id, $result->episode_id) }}
@else
OPD
@endif
</td>
<td>
@if($result->payment_status == 0)
<label class="label label-danger">{{ __('investigations.not_paid') }}</label>
@else
<label class="label label-success">{{ __('investigations.paid') }}</label>
@endif
</td>
<td onclick="showQuickView({{ $result->order_id }}, 1)"><i class="fa fa-search"></i> {{ count(explode(",", $result->investigation_id)) }} {{ __('investigations.tests') }}</td>
<td class="text-center">
@if($result->result_type == 'Ultrasound_Obstetric')
{{ Form::open(['route' => 'investigations.alter_ordered_results_obstetric']) }}
{{ Form::hidden('patient_id',$result->patient_id) }}
{{ Form::hidden('episode_id',$result->episode_id) }}
{{ Form::hidden('obstetric_ultrasound_report_id',$result->value) }}
{{ Form::hidden('order_id',$result->order_id) }}
<button type="submit" class="btn btn-success btn-sm">{{ __('investigations.alter') }}</button>
{{ Form::close() }}
@else
{{ Form::open(['route' => 'investigations.alter_ordered_results']) }}
{{ Form::hidden('patient_id',$result->patient_id) }}
{{ Form::hidden('id',$result->id) }}
<button type="submit" class="btn btn-success btn-sm">{{ __('investigations.alter') }}</button>
{{ Form::close() }}
@endif
</td>
</tr>
@endforeach
@if(count($results) <= 0)
<tr>
<td colspan="6" class='text-center' style='color: maroon; font-weight: bold;'>{{ __('investigations.no_investigations_found') }}</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
<div class="modal" id="modal_receive_request" tabindex="-1" role="dialog" aria-labelledby="debt_plan_modal_label" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"><b id="modal_heading"></b></h4>
</div>
<div class="modal-body">
<div class="table-responsive" id="modal_table"></div>
<div id="modal_specimen_edit"></div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
$('#patient_number').change(function () {
let id = $('#patient_number').val();
$('#patient_id').val(id);
});
$('#patient_number').select2({
placeholder: 'Search by patient details (names and number)',
ajax: {
url: '/patients/search_patient_by_name_number',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.first_name + " " + item.last_name + " (" + item.number + ")",
id: item.id
}
})
};
},
cache: true
}
});
$('#search_date_by').change(function() {
if($(this).val() === "custom_date"){
$("#end_date_div").hide();
$("#start_date_div").show();
} else if($(this).val() === "custom_date_range") {
$("#start_date_div").show();
$("#end_date_div").show();
} else {
$("#end_date_div").hide();
$("#start_date_div").hide();
}
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
function showQuickView(id, type) {
$.ajax({
method: 'POST',
url: '/investigations/view_lab_results_quick_view',
data: {'id': id, 'type': type},
success: function(response){
let responseArray = JSON.parse(response);
$("#modal_table").html(responseArray["html"]);
$("#modal_heading").html("Investigations for " + responseArray["patient_name"] + "(" + responseArray["patient_number"] + ")");
if (type == 2) {
$("#modal_specimen_edit").html('<a class="btn btn-link btn-block" href="/investigations/edit_investigation_specimen/' + id +'">Edit Specimen</a>');
} else {
$("#modal_specimen_edit").html("");
}
$('#modal_receive_request').modal('show');
}
});
}
</script>
@endpush
@@ -0,0 +1,413 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css"/>
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet"/>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('investigations.authenticate_lab_investigations') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.authenticate') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['method'=>'post','route' => 'investigations.authenticate_labs']) }}
{{ Form::hidden('patient_id', 0, ['id' => 'patient_id']) }}
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label>{{ __('pharmacy.select_date') }}:</label>
<select class="form-control compulsory required" name="search_date_by" id="search_date_by" required>
<option value="today">{{ __('pharmacy.today') }}</option>
<option value="yesterday">{{ __('pharmacy.yesterday') }}</option>
<option value="custom_date">{{ __('pharmacy.custom_date') }}</option>
<option value="custom_date_range">{{ __('pharmacy.date_range') }}</option>
</select>
</div>
</div>
<div class="col-md-2" id="start_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('pharmacy.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-2" id="end_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('pharmacy.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-3">
{{ Form::label('search_patient', __('investigations.search_by_patient')) }}
<div class="input-group">
<select class="form-control" name="patient_number" id="patient_number"></select>
</div>
</div>
<div class="col-md-2">
<div class="form-group" style="margin-top: 25px;">
{{ Form::submit(__('investigations.search'), ['class'=>'btn btn-success pull-right']) }}
</div>
</div>
</div>
{{ Form::close() }}
</div>
{{ Form::open(['route' => 'investigations.authenticate_investigations']) }}
<div class="white-box">
@include('flash::message')
@php
$indicator = '';
$normal_orders =array_filter($orders, function ($item) use ($indicator) {
return $item['urgent_ids'] == $indicator;
});
$urgent_orders= array_filter($orders, function ($item) use ($indicator) {
return $item['urgent_ids'] !== $indicator;
});
@endphp
@if($search_text != "")
<h4>
<label class="label label-info">{{ $search_text }}</label>
@if (count($urgent_orders) > 0)
&nbsp;&nbsp;<label class="label label-danger">{{ __('investigations.auth_incoming_lab_results_warning') }}</label>
@endif
</h4>
@endif
<div class="row">
<div class="col-md-9">
<div class="card">
<div class="card-header">
<ul class="nav nav-tabs" role="tablist">
@if (count($urgent_orders)>0)
<li role="presentation" class="nav-item"> <a href="#orders_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.authenticate_lab_investigations') }} ({{ count($normal_orders) }})</a> </li>
<li role="presentation" class="nav-item active"> <a href="#urgent_orders" class="nav-link text-danger" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.auth_incoming_lab_investigations') }} ({{ count($urgent_orders) }})</a> </li>
@else
<li role="presentation" class="nav-item active"> <a href="#orders_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.authenticate_lab_investigations') }} ({{ count($normal_orders) }})</a> </li>
@endif
</ul>
</div>
<div class="card-block tab-content">
<div class="table-responsive tab-pane <?php if(count($urgent_orders) < 1) echo 'active'; ?>" id="orders_nav_pill">
<table class="table table-striped table-bordered color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.date') }}</th>
<th>{{ __('investigations.patient_number') }}</th>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.investigations') }}</th>
<th>{{ __('investigations.results') }}</th>
<th>{{ __('investigations.select') }}</th>
</tr>
</thead>
<tbody>
@foreach($normal_orders as $order)
{{ Form::hidden('order_id[]',$order['order_id']) }}
<tr>
<td>
{{ $order['date'] }}
</td>
<td>
{{ $order['number'] }}
</td>
<td>
{!! insurance_flag($order['id']) !!}
</td>
<td colspan="3">
<table class="table table-bordered table-striped table-borderless">
<tbody>
<?php $count = 0; ?>
@foreach($order['values'] as $value)
@if(get_name($value['investigation_id'], 'id', 'type', 'investigations') == 1)
<tr>
<td colspan="2">
{{ $value['name'] }}
</td>
<td>
@if(empty($value['per_investigation']) || $value['per_investigation'] == 0)
<input type="checkbox" name="investigation_id[]" class="investigation_id" value="{{ $order['order_id'] }}/{{ $count }}">
@else
<input type="checkbox" name="investigation_id[]" class="investigation_id" value="{{ $order['order_id'] }}/{{ $count }}" checked>
@endif
</td>
</tr>
@php
// get the specialised results and check if it is valid
$specialised_results = \Illuminate\Support\Facades\DB::table('investigation_specialised_results')->find($value['value']);
$specialised_ids = [];
$specialised_values = [];
if(!is_null($specialised_results)){
$specialised_ids = explode(",", $specialised_results->specialised_variable_id);
$specialised_values = explode(",", $specialised_results->value);
}
@endphp
@if(count($specialised_ids) > 0)
@for($i = 0; $i < count($specialised_ids); $i++)
<tr>
<td>
{{ get_name($specialised_ids[$i], 'id', 'name', 'investigation_specialised_variables') }}
</td>
<td colspan="2">{{ $specialised_values[$i] }}</td>
</tr>
@endfor
@else
<tr><td></td><td colspan="2"></td></tr>
@endif
<tr><td colspan="3"></td></tr>
@else
<tr>
<td>
{{ $value['name'] }}
</td>
<td>
{{ $value['value'] }}
@if (!empty($value['document']))
<br><br><a class="label label-info" href="/patient_documents/{{ $value['document'] }}" target="_blank"> {{ $value['title'] }}</a>
@endif
</td>
<td>
@if(empty($value['per_investigation']) || $value['per_investigation'] == 0)
<input type="checkbox" name="investigation_id[]" class="investigation_id" value="{{ $order['order_id'] }}/{{ $count }}">
@else
<input type="checkbox" name="investigation_id[]" class="investigation_id" value="{{ $order['order_id'] }}/{{ $count }}" checked>
@endif
</td>
</tr>
@endif
<?php $count++; ?>
@endforeach
{{ Form::hidden('count[]',$count) }}
</tbody>
</table>
</td>
</tr>
@endforeach
@if(count($orders) <= 0)
<tr>
<td colspan="6" class='text-center' style='color: maroon; font-weight: bold;'>{{ __('investigations.all_results_authenticated') }}</td>
</tr>
@endif
</tbody>
</table>
</div>
@if (count($urgent_orders) > 0)
<div class="table-responsive tab-pane active" id="urgent_orders">
<table class="table table-striped table-bordered color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.date') }}</th>
<th>{{ __('investigations.patient_number') }}</th>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.investigations') }}</th>
<th>{{ __('investigations.results') }}</th>
<th>{{ __('investigations.select') }}</th>
</tr>
</thead>
<tbody>
@foreach($urgent_orders as $urgent_order)
{{ Form::hidden('order_id[]',$urgent_order['order_id']) }}
<tr>
<td>
{{ $urgent_order['date'] }}
</td>
<td>
{{ $urgent_order['number'] }}
</td>
<td>
{!! insurance_flag($urgent_order['id']) !!}
</td>
<td colspan="3">
<table class="table table-bordered table-striped table-borderless">
<tbody>
<?php $count = 0; ?>
@foreach($urgent_order['values'] as $value)
@if(get_name($value['investigation_id'], 'id', 'type', 'investigations') == 1)
<tr>
<td colspan="2">
{{ $value['name'] }}
</td>
<td>
@if(empty($value['per_investigation']) || $value['per_investigation'] == 0)
<input type="checkbox" name="investigation_id[]" class="investigation_id" value="{{ $urgent_order['order_id'] }}/{{ $count }}">
@else
<input type="checkbox" name="investigation_id[]" class="investigation_id" value="{{ $urgent_order['order_id'] }}/{{ $count }}" checked>
@endif
</td>
</tr>
@php
// get the specialised results and check if it is valid
$specialised_results = \Illuminate\Support\Facades\DB::table('investigation_specialised_results')->find($value['value']);
$specialised_ids = [];
$specialised_values = [];
if(!is_null($specialised_results)){
$specialised_ids = explode(",", $specialised_results->specialised_variable_id);
$specialised_values = explode(",", $specialised_results->value);
}
@endphp
@if(count($specialised_ids) > 0)
@for($i = 0; $i < count($specialised_ids); $i++)
<tr>
<td>
{{ get_name($specialised_ids[$i], 'id', 'name', 'investigation_specialised_variables') }}
</td>
<td colspan="2">{{ $specialised_values[$i] }}</td>
</tr>
@endfor
@else
<tr><td></td><td colspan="2"></td></tr>
@endif
<tr><td colspan="3"></td></tr>
@else
<tr>
<td>
{{ $value['name'] }}
</td>
<td>
{{ $value['value'] }}
@if (!empty($value['document']))
<br><br><a class="label label-info" href="/patient_documents/{{ $value['document'] }}" target="_blank"> {{ $value['title'] }}</a>
@endif
</td>
<td>
@if(empty($value['per_investigation']) || $value['per_investigation'] == 0)
<input type="checkbox" name="investigation_id[]" class="investigation_id" value="{{ $urgent_order['order_id'] }}/{{ $count }}">
@else
<input type="checkbox" name="investigation_id[]" class="investigation_id" value="{{ $urgent_order['order_id'] }}/{{ $count }}" checked>
@endif
</td>
</tr>
@endif
<?php $count++; ?>
@endforeach
{{ Form::hidden('count[]',$count) }}
</tbody>
</table>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
</div>
</div>
</div>
<div class="col-md-3">
<h5 class="heading btn-link">{{ __('investigations.please_login_as_senior_lab') }}</h5>
<div class="form-group">
{{ Form::label('username', __('investigations.username')) }}
{{ Form::text('username', '', ['class' => 'form-control compulsory', 'required']) }}
</div>
<div class="form-group">
{{ Form::label('password', __('investigations.password')) }}
<input class="form-control compulsory" type="password" name="password" required>
</div>
{{ Form::button(__('investigations.authenticate_results'),['type'=>'submit','id'=>'authenticate_submit_button','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
</div>
</div>
</div>
{{ Form::close() }}
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
$('#patient_number').change(function () {
let id = $('#patient_number').val();
$('#patient_id').val(id);
});
$('#patient_number').select2({
placeholder: 'Search by patient details (names and number)',
ajax: {
url: '/patients/search_patient_by_name_number',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.first_name + " " + item.last_name + " (" + item.number + ")",
id: item.id
}
})
};
},
cache: true
}
});
$('#search_date_by').change(function() {
if($(this).val() === "custom_date"){
$("#end_date_div").hide();
$("#start_date_div").show();
} else if($(this).val() === "custom_date_range") {
$("#start_date_div").show();
$("#end_date_div").show();
} else {
$("#end_date_div").hide();
$("#start_date_div").hide();
}
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$("#authenticate_submit_button").click(function (e) { // loop thru for checked checkboxes and fill in array
var non_empty_investigations_ids_array = [];
$(".investigation_id").each(function () {
if ($(this).is(":checked")) {
var textname = $(this).attr('name');
$(this).focus();
non_empty_investigations_ids_array.push(textname);
}
});
/* check if the non_empty_investigations_ids_array array is empty and require atleast one id then return false */
if (non_empty_investigations_ids_array.length === 0) {
alert("Please check atleast one investigation to authenitcate<?php echo __('investigations.please_login_as_senior_lab') ?>");
console.log(non_empty_investigations_ids_array);
e.preventDefault();
return false;
}
});
</script>
@endpush
@@ -0,0 +1,307 @@
@extends('layouts.main')
@push('styles')
@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"> {{ __('investigations.cardio_echo_template') }}</h4>
</div>
<div class="col-lg-6 col-sm-5 col-md-5 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.template') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['route' => 'investigations.cardio_echo_template']) }}
<div class="row">
<div class="col-md-6">
{{ Form::select('template', $templates, '', ['class' => 'form-control', 'required']) }}
</div>
<div class="col-md-3">
{{ Form::button("Select",['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
</div>
<div class="col-md-3">
<a class="btn btn-info pull-right" id="add_new_template_button">{{ __('investigations.add_new_template') }}</a>
</div>
</div>
{{ Form::close() }}
</div>
<div class="white-box">
@include('flash::message')
@if($measurements == 0)
<h4 class="text-center"><code>{{ __('investigations.select_template_or_create') }}</code></h4>
@else
{{ Form::open(['route' => 'investigations.save_cardio_echo_template']) }}
{{ Form::hidden('id', $id) }}
<h4>2-D/M-MODE MEASUREMENTS (Centimeters)</h4>
<table class="table table-sm color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th width="16.6%" scope="col">&nbsp;</th>
<th width="16.6%" scope="col">{{ __('investigations.results') }} cm</th>
<th width="16.6%" scope="col">&nbsp;</th>
<th width="16.6%" scope="col">{{ __('investigations.results') }} cm</th>
<th width="16.6%" scope="col">&nbsp;</th>
<th width="16.6%" scope="col">{{ __('investigations.results') }} cm</th>
</tr>
</thead>
<tbody>
<tr>
<td>IVS</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="ivs_result" name="ivs_result" class="form-control" value="{{ $measurements['IVS'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ivs_range" class="form-control" value="{{ $range['IVS'] ?? '' }}" placeholder="Enter range"></span><br>
</td>
<td style="text-align: center;">AO</td>
<td style="padding: 0px; margin: 0px; padding-bottom: 10px;">
<input type="number" min="0" step="0.001" id="ao_result" name="ao_result"class="form-control" value="{{ $measurements['AO'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ao_range" class="form-control" value="{{ $range['AO'] ?? '' }}" placeholder="Enter range"></span>
</td>
<td style="text-align: center;">EF (%)</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="ef_result" name="ef_result" class="form-control" value="{{ $measurements['EF (%)'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ef_range" class="form-control" value="{{ $range['EF (%)'] ?? '' }}" placeholder="Enter range"></span>
</td>
</tr>
<tr>
<td>LVIDd</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="lvidd_result" name="lvidd_result" class="form-control" value="{{ $measurements['LVIDd'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="lvidd_range" class="form-control" value="{{ $range['LVIDd'] ?? '' }}" placeholder="Enter range"></span><br>
</td>
<td style="text-align: center;">LA</td>
<td style="padding: 0px; margin: 0px; padding-bottom: 10px;">
<input type="number" min="0" step="0.001" id="la_result" name="la_result" class="form-control" value="{{ $measurements['LA'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="la_range" class="form-control" value="{{ $range['LA'] ?? '' }}" placeholder="Enter range"></span><br>
</td>
<td style="text-align: center;">FS (%)</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="fs_result" name="fs_result" class="form-control" value="{{ $measurements['FS (%)'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="fs_range" class="form-control" value="{{ $range['FS (%)'] ?? '' }}" placeholder="Enter range"></span><br>
</td>
</tr>
<td>LVIDs</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="lvids_result" name="lvids_result" class="form-control" value="{{ $measurements['LVIDs'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="lvids_range" class="form-control" value="{{ $range['LVIDs'] ?? '' }}" placeholder="Enter range"></span><br>
</td>
<td style="text-align: center;">RV</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="rv_result" name="rv_result" class="form-control" value="{{ $measurements['RV'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="rv_range" class="form-control" value="{{ $range['RV'] ?? '' }}" placeholder="Enter range"></span><br>
</td>
<td style="text-align: center;">TAPSE:</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="tapse_result" name="tapse_result" class="form-control" value="{{ $measurements['TAPSE'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="tapse_range" class="form-control" value="{{ $range['TAPSE'] ?? '' }}" placeholder="Enter range"></span><br>
</td>
</tr>
<tr>
<td>LVPW</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="lvpwd_result" name="lvpwd_result" class="form-control" value="{{ $measurements['LVPWd'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="lvpwd_range" class="form-control" value="{{ $range['LVPWd'] ?? '' }}" placeholder="Enter range"></span><br>
</td>
<td style="text-align: center;">RA:</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="ra_result" name="ra_result" class="form-control" value="{{ $measurements['RA'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ra_range" class="form-control" value="{{ $range['RA'] ?? '' }}" placeholder="Enter range"></span><br>
</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<h4>DOPPLER FINDINGS</h4>
<div class="row">
<div class="col-sm-12">
<table class="table table-sm color-bordered-table success-bordered-table table-bordered">
<thead>
</thead>
<tbody>
<tr>
<td>Mitral E/A ratio</td>
<td>
<input type="number" min="0" step="0.01" id="mitral_ea_ratio" name="mitral_ea_ratio" value="{{ $doppler_study['Mitral EA ratio'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
<td>TR Max. PG (mmHg)</td>
<td>
<input type="number" min="0" step="0.01" id="tr_pg" name ="tr_pg" value="{{ $doppler_study['TR PG'] ?? '' }}" class="form-control" style="border-color: #A9A9A9"><br>
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="tr_pg_range" class="form-control" value="{{ $range['TR PG'] ?? '' }}" placeholder="Enter range"></span>
</td>
<td>AV mean PG (mmHg)</td>
<td>
<input type="number" min="0" step="0.01" id="av_mean" name ="av_vmean" value="{{ $doppler_study['AV Vmean'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
</tr>
<tr>
<td>AV Vel. max (m/s)</td>
<td>
<input type="number" min="0" step="0.01" id="av_vmax" name ="av_vmax" value="{{ $doppler_study['AV Vmax'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
<td>RAP (mmHg)</td>
<td>
<input type="number" min="0" step="0.01" id="rap" name="rap" value="{{ $doppler_study['RAP'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<h4>{{ __('investigations.description') }}</h4>
<div class="row">
<div class="col-sm-12">
<table class="table table-sm color-bordered-table success-bordered-table table-bordered">
<thead>
</thead>
<tbody>
<tr>
<td>Left Ventricle</td>
<td>
<textarea name="left_ventricle_description" id="left_ventricle_description" class="form-control" style="border-color: #A9A9A9">
{{ $descriptions['left_ventricle_description'] }}
</textarea>
</td>
</tr>
<tr>
<td>Right Ventricle</td>
<td>
<textarea name="right_ventricle_description" id="right_ventricle_description" class="form-control" style="border-color: #A9A9A9">
{{ $descriptions['right_ventricle_description'] }}
</textarea>
</td>
</tr>
<tr>
<td>Left Atrium</td>
<td>
<textarea name="left_atrium_description" id="left_atrium_description" class="form-control" style="border-color: #A9A9A9">
{{ $descriptions['left_atrium_description'] }}
</textarea>
</td>
</tr>
<tr>
<td>Right Atrium</td>
<td>
<textarea name="right_atrium_description" id="right_atrium_description" class="form-control" style="border-color: #A9A9A9">
{{ $descriptions['right_atrium_description'] }}
</textarea>
</td>
</tr>
<tr>
<td>Aortic Valve</td>
<td>
<textarea name="aortic_valve_description" id="aortic_valve_description" class="form-control" style="border-color: #A9A9A9">
{{ $descriptions['aortic_valve_description'] }}
</textarea>
</td>
</tr>
<tr>
<td>Mitral Valve</td>
<td>
<textarea name="mitral_valve_description" id="mitral_valve_description" class="form-control" style="border-color: #A9A9A9">
{{ $descriptions['mitral_valve_description'] }}
</textarea>
</td>
</tr>
<tr>
<td>Pulmonary Valve</td>
<td>
<textarea name="pulmonary_valve_description" id="pulmonary_valve_description" class="form-control" style="border-color: #A9A9A9">
{{ $descriptions['pulmonary_valve_description'] }}
</textarea>
</td>
</tr>
<tr>
<td>Tricuspid Valve</td>
<td>
<textarea name="tricuspid_valve_description" id="tricuspid_valve_description" class="form-control" style="border-color: #A9A9A9">
{{ $descriptions['tricuspid_valve_description'] }}
</textarea>
</td>
</tr>
<tr>
<td>Aortic root and arch</td>
<td>
<textarea name="aortic_root_and_arch_description" id="aortic_root_and_arch_description" class="form-control" style="border-color: #A9A9A9">
{{ $descriptions['aortic_root_and_arch_description'] }}
</textarea>
</td>
</tr>
<tr>
<td>Pericardium</td>
<td>
<textarea name="pericardium_description" id="pericardium_description" class="form-control" style="border-color: #A9A9A9">
{{ $descriptions['pericardium_description'] }}
</textarea>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<br>
<div class="row">
<div class="col-md-12">
<label class="control-label">{{ __('investigations.conclusion') }}</label>
<textarea id="cardio_echo_conclusion" name="cardio_echo_conclusion" rows="5" class="form-control">{{ $cardio_echo_conclusion }}</textarea>
</div>
</div>
<br><br>
{{ Form::button("Submit",['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button("Cancel",['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
{{ Form::close() }}
@endif
</div>
<div class="modal fade" id="template_name_modal" tabindex="-1" role="dialog" aria-labelledby="episodeWithDoctorLabel1">
<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="episodeWithDoctorLabel1">{{ __('investigations.new_template') }}</h4>
</div>
<div class="modal-body">
{{ Form::open(['route' => 'investigations.create_cardio_echo_template']) }}
{{ Form::label('name', 'Name') }}
{{ Form::text('name', '', ['class' => 'form-control', 'required' => 'true'])}}
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-sm" onclick="return confirm('Are you sure you want to create a new template');">{{ __('investigations.create') }}</button>
{{ Form::close() }}
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">{{ __('layout.close') }}</button>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script>
$('#add_new_template_button').click(function () {
$('#template_name_modal').modal('show');
});
</script>
@endpush
@@ -0,0 +1,448 @@
@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">{{ __('investigations.add_investigation') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="{{ route('investigations.index') }}">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.create') }}</li>
</ol>
</div>
</div>
@include('investigations::investigations.menu')
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div class="white-box">
@if (session()->has('streamline_setup'))
<h3><font color="blue">Stre@mline {{ __('investigations.setup') }} ({{ __('investigations.step') }} 7 {{ __('investigations.of') }} 12)</font></h3>
{{ Form::open(['route' => 'investigations.store', 'data-toggle' => 'validator']) }}
<div class="row">
<div class="col-md-4">
<div class="form-group">
{{ Form::label('name', __('investigations.investigation_name')) }}
{{ Form::text('name', '', ['class' => 'form-control']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('category', __('investigations.category')) }}
{{ Form::select('category',$investigation_categories,'',['class' => 'form-control']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('units', __('investigations.unit')) }}
{{ Form::select('units',$unit_of_measure,'',['class' => 'form-control']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('minimum', __('investigations.minimum')) }}
{{ Form::text('minimum', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('sample_container', __('investigations.sample_container')) }}
{{ Form::text('sample_container', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('comments', __('investigations.comments')) }}
{{ Form::textArea('comments', '', ['class'=>'form-control', 'rows' => 9]) }}
</div>
</div>
<div class="col-md-4">
<div class="form-group">
{{ Form::label('non_insured_price', __('investigations.non_insured_price')) }}
{{ Form::number('non_insured_price', '', ['class' => 'form-control', 'id' => 'non_insured_price']) }}
</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('normal_ranges', __('investigations.normal_ranges')) }}
{{ Form::text('normal_ranges', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('lab_time', __('investigations.lab_time')) }}
{{ Form::text('lab_time', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('available',__('investigations.is_investigation_available'), ["class"=>'col-md-12']) }}
&nbsp;{{ __('investigations.yes') }} {{ Form::radio('available', 1, false, ['class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
&nbsp;{{ __('investigations.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" id="echo_div">
{{ Form::label('echo',__('investigations.echo_investigation_template'), ["class"=>'col-md-12']) }}
&nbsp;{{ __('investigations.yes') }} {{ Form::radio('echo', 1, false, ['class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
&nbsp;{{ __('investigations.no') }} {{ Form::radio('echo', 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('account_id',__('investigations.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-md-4" style="background: #eceeef;">
<h4>{{ __('investigations.select_from_list') }}</h4>
@foreach ($investigations as $investigation)
<div class="form-group">
{{ Form::checkbox('selected_investigations[]', $investigation['name'], false) }} {{ $investigation['name'] }} &nbsp;&nbsp;
{{ Form::hidden('selected_category[]', $investigation['category']) }}
</div>
@endforeach
</div>
</div>
{{ Form::button(__('investigations.next'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10 next']) }}
{{ Form::button(__('investigations.skip'),['type'=>'submit','name' => 'skip', 'value' => 'skip','class'=>'btn btn-default waves-effect waves-light m-r-10']) }}
@else
{{-- {{ Form::open(['route' => 'investigations.store', 'data-toggle' => 'validator']) }} --}}
{{ Form::open(['route' => 'investigations.store']) }}
<div class="row">
<div class="col-md-4">
<div class="form-group">
{{ Form::label('name', __('investigations.investigation_name')) }}
{{ Form::text('name', '', ['class' => 'form-control compulsory','required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('category', __('investigations.category')) }}
{{ Form::select('category',$investigation_categories,'',['class' => 'form-control compulsory','required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('units', __('investigations.unit')) }}
{{ Form::select('units',$unit_of_measure,'',['class' => 'form-control compulsory','required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('minimum', __('investigations.minimum')) }}
{{ Form::text('minimum', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('sample_container', __('investigations.sample_container')) }}
{{ Form::text('sample_container', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('range_type', 'Is the Reference Range ?') }}
{{ Form::select('range_type', ['' => '--select--',1 => 'Dynamic', 2 => 'Constant'], '', ['class' => 'form-control']) }}
</div>
<div class="form-group" style="display: none;" id="constant_div">
{{ Form::label('normal_ranges', __('investigations.normal_ranges')) }}
{{ Form::text('normal_ranges', '', ['class' => 'form-control']) }}
</div>
<div style="display: none;" id="dynamic_div">
@php $age_groups = \Streamline\Models\AgeGroup::get(); @endphp
<div class="row">
<div class="col-md-6">
<h5>Male</h5>
<br>
@foreach($age_groups as $age)
{{ Form::label('dynamic_range', $age->name) }}
{{ Form::text('dynamic_range_male[]', '', ['class' => 'form-control']) }}
{{ Form::hidden('age_id[]', $age->id) }}
<br>
@endforeach
</div>
<div class="col-md-6">
<h5>Female</h5>
<br>
@foreach($age_groups as $age)
{{ Form::label('dynamic_range', $age->name) }}
{{ Form::text('dynamic_range_female[]', '', ['class' => 'form-control']) }}
<br>
@endforeach
</div>
</div>
<hr>
</div>
<div class="form-group">
{{ Form::label('lab_time', __('investigations.lab_time')) }}
{{ Form::text('lab_time', '', ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('available',__('investigations.is_investigation_available'), ["class"=>'col-md-12','required']) }}
&nbsp;{{ __('investigations.yes') }} {{ Form::radio('available', 1, false, ['class' => 'check form-control', 'data-radio'=>'iradio_flat-green','required' => 'required']) }}
&nbsp;{{ __('investigations.no') }} {{ Form::radio('available', 0, false, ['class' => 'check form-control', 'data-radio'=>'iradio_flat-green','required' => 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group" id="echo_div">
{{ Form::label('echo',__('investigations.echo_investigation_template'), ["class"=>'col-md-12']) }}
&nbsp;{{ __('investigations.yes') }} {{ Form::radio('echo', 1, false, ['class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
&nbsp;{{ __('investigations.no') }} {{ Form::radio('echo', 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('is_chronic',__('investigations.is_investigation_chronic'), ["class"=>'col-md-12']) }}
&nbsp;{{ __('investigations.yes') }} {{ Form::radio('is_chronic', 1, false, ['class' => 'check form-control', 'data-radio'=>'iradio_flat-green','required' => 'required']) }}
&nbsp;{{ __('investigations.no') }} {{ Form::radio('is_chronic', 0, false, ['class' => 'check form-control', 'data-radio'=>'iradio_flat-green','required' => 'required']) }}
<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('reference_areas', __('diagnoses.reference_areas')) }}
{{ Form::text('reference_text', '', ['class' => 'form-control', 'placeholder' => 'Reference text']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::text('reference_link', '', ['class' => 'form-control', 'placeholder' => 'Reference link e.g. http://google.com']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
{{ Form::label('non_insured_price', __('investigations.non_insured_price')) }}
{{ Form::number('non_insured_price', '', ['class' => 'form-control compulsory','required', 'id' => 'non_insured_price']) }}
</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>
<div class="col-md-4">
<div class="form-group">
{{ Form::label('comments', __('investigations.comments')) }}
{{ Form::textArea('comments', '', ['class'=>'form-control', 'rows' => 9]) }}
</div>
<div class="form-group">
{{ Form::label('account_id',__('investigations.chart_of_account_name')) }}
{{ Form::select('account_id',$chart_of_accounts,'',['class' => 'form-control compulsory','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', __('investigations.hmis_category_out_patient')) }}
{{ Form::select('hmis_category[]', $hmis_categories, '', ['class' => 'form-control']) }}
</div>
</div>
<!-- {{ Form::label('hmis_no_outpatient', __('investigations.hmis_category_out_patient_number')) }}
{{ Form::text('hmis_no_outpatient', '', ['class'=>'form-control']) }} -->
</div>
<a class="add_field_hmis" style="color: blue;">{{ __('investigations.add_more') }}</a><br><br>
<div class="form-group">
{{ Form::label('hmis_category_inpatient', __('investigations.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_hmis_categories as $inpatient_item)
<option value="{{ $inpatient_item['id'] }}">{{ $inpatient_item['title'] }}</option>
@endforeach
</select>
<div class="help-block with-errors"></div>
{{ Form::label('hmis_no_inpatient', __('investigations.hmis_category_in_patient_number')) }}
<select class="form-control" id="inpatient_hmis_category_options" name="hmis_no_inpatient">
<option value="" selected disabled>- Select HMIS category first -</option>
</select>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('hmis_002_slug', __('investigations.hmis_002_category')) }}
{{ Form::select('hmis_002_slug', ['' => '--select--',1 => 'TB', 2 => 'RDT', 3=>'B/S', 4=>'RBS'], '', ['class' => 'form-control', 'id'=>'hmis_002_slug']) }}
</div>
</div>
</div>
{{ Form::button(__('investigations.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10 submit-btn']) }}
{{ Form::button(__('investigations.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
@endif
{{ Form::close() }}
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.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 src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script type="text/javascript">
$(document).ready(function () {
$(".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("Please fill in all compulsory fields");
console.log(empty_compulsory_fields);
e.preventDefault();
return false;
}
});
$('#echo_div').hide();
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) {
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();
console.log("about to remove div");
$(this).parent('div').remove();
x1--;
});
$('#range_type').change(function (e) {
e.preventDefault();
if(this.value == 2){
$('#constant_div').show();
$('#dynamic_div').hide();
}else{
$('#constant_div').hide();
$('#dynamic_div').show();
}
});
$('#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);
});
}
});
$('#category').change(function() {
if($(this).val() == '17') $('#echo_div').show();
else {
$('#echo_div').hide();
$('#echo').val(0);
}
});
});
$('#hmis_category_inpatient,#inpatient_hmis_category_options').select2();
$('#hmis_category_inpatient,#inpatient_hmis_category_options').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 {
$('#inpatient_hmis_category_options').html(response);
$('#inpatient_hmis_category_options').prop('required',false);
}
}
});
}
$('#account_id, #category, #units').select2();
</script>
@endpush
@@ -0,0 +1,174 @@
@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/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<h4 class="page-title">{{ __('investigations.cancel_ordered_investigations') }}</h4>
</div>
<div class="col-lg-6 col-sm-6 col-md-6 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('investigations.dashboard') }}</a></li>
</ol>
</div>
</div>
{{ Form::open(['route' => 'investigations.investigations_to_cancel', 'method' => 'ANY']) }}
<div class="white-box">
<div class="row">
<div class="col-md-3">
<div class="form-group" id="searchby">
{{ Form::label('search_by', __('investigations.date')) }}
{{ Form::select('search_by', ['0'=>'Today','1'=>'Custom Date','2'=>'Custom Range'], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-3" style="display: none;" id="date_search">
<div class="form-group" id="reg_date" style="padding-top: 23px;">
<div class="input-group">
{{ Form::text('reg_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-autoclose']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-3" style="display: none;" id="date_range_search">
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('start_date', __('investigations.from')) }}
<div class="input-group">
{{ Form::text('start_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-1']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="reg_date">
{{ Form::label('end_date', __('investigations.to')) }}
<div class="input-group">
{{ Form::text('end_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-2']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group" style="padding-top: 5px;"><br>
{{ Form::button(__('investigations.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_patient']) }}
</div>
</div>
</div>
</div>
{{ Form::close() }}
<div class="white-box">
@include('flash::message')
<div class="table-responsive">
<table class="table table-hover color-bordered-table success-bordered-table table-striped">
<thead>
<tr>
<th>#</th>
<th>{{ __('investigations.date') }}</th>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.investigations') }}</th>
<th>{{ __('investigations.action') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@php $count=1; @endphp
@foreach($ordered_investigations as $ordered_inv)
@php
$urgent_ids = $ordered_inv->urgent_ids;
$ordered_ids = explode(",", $ordered_inv->investigation_id);
$ordered_investigation_comments_string = "";
$ordered_investigation_comments_string = $ordered_inv->order_comments;
@endphp
<tr>
<td>{{ $count }}.</td>
<td>{{ streamline_date_time($ordered_inv->created_at) }}</td>
<td>{!! insurance_flag($ordered_inv->patient_id) !!} ({{ get_name($ordered_inv->patient_id, 'id', 'number', 'patients') }})</td>
<td>
<ol>
@for($i=0; $i < count($ordered_ids); $i++)
<li>{{ get_name($ordered_ids[$i], 'id', 'name', 'investigations') }}</li>
@endfor
</ol>
</td>
<td>
{{ Form::model($ordered_inv->id ,['method' => 'DELETE', 'route' => ['ordered_investigation.destroy', $ordered_inv->id]]) }}
<button type="submit" class="btn btn-rounded btn-danger" onclick="return confirm('Are you sure?')"><i class="fa fa-trash"></i>
<span style="margin-left: 10px;">{{ __('investigations.cancel_order') }}</span>
</button>
{{ Form::close() }}
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $ordered_inv->patient_id }}" class="btn btn-info btn-rounded">{{ __('investigations.select_patient') }}</a>
</td>
</tr>
@php $count++; @endphp
@endforeach
</tbody>
</table>
</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>
<!-- Date Picker Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
//order: [ [0, 'desc'] ],
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
],
'pageLength' : 50,
});
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#search_by').change(function () {
if ($(this).val() == 1) {
$('#date_search').show();
$('#date_range_search').hide();
}
else if ($(this).val() == 2) {
$('#date_range_search').show();
$('#date_search').hide();
}
else {
$('#date_search,#date_range_search').hide();
}
});
</script>
@endpush
@@ -0,0 +1,360 @@
@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">{{ __('investigations.edit_investigation') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="{{ route('investigations.index') }}">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.edit') }}</li>
</ol>
</div>
</div>
@include('investigations::investigations.menu')
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div class="panel">
{{ Form::model($investigation, ['method' => 'PUT', 'route' => ['investigations.update',$investigation], 'data-toggle' => 'validator']) }}
<div class="panel-body">
<div clas="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('name', __('investigations.investigation_name')) }}
{{ Form::text('name', $investigation->name, ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('category', __('investigations.category')) }}
{{ Form::select('category',$investigation_categories,$investigation->category,['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('units', __('investigations.unit')) }}
{{ Form::select('units',$unit_of_measure,$investigation->units,['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('range_type', __('investigations.is_the_reference_range')) }}
{{ Form::select('range_type', [null => '--select--', 1 => 'Dynamic', 2 => 'Constant'], $investigation->range_type, ['class' => 'form-control']) }}
</div>
<div class="form-group" @if($investigation->range_type == 1) style="display: none;" @endif id="constant_div">
{{ Form::label('normal_ranges', __('investigations.normal_ranges')) }}
{{ Form::text('normal_ranges', $investigation->normal_ranges, ['class' => 'form-control']) }}
</div>
<div @if($investigation->range_type != 1) style="display: none;" @endif id="dynamic_div">
@php $age_groups = \Streamline\Models\AgeGroup::get(); @endphp
<div class="row">
<div class="col-md-6">
<h5>{{ __('investigations.male') }}</h5>
<br>
@foreach($age_groups as $age)
{{ Form::label('dynamic_range', $age->name) }}
{{ Form::text('dynamic_range_male[]', get_dynamic_normal_range($investigation->id, $age->id, 1), ['class' => 'form-control']) }}
{{ Form::hidden('age_id[]', $age->id) }}
<br>
@endforeach
</div>
<div class="col-md-6">
<h5>{{ __('investigations.female') }}</h5>
<br>
@foreach($age_groups as $age)
{{ Form::label('dynamic_range', $age->name) }}
{{ Form::text('dynamic_range_female[]', get_dynamic_normal_range($investigation->id, $age->id, 2), ['class' => 'form-control']) }}
<br>
@endforeach
</div>
</div>
<hr>
</div>
<div class="form-group">
{{ Form::label('minimum', __('investigations.minimum')) }}
{{ Form::text('minimum', $investigation->minimum, ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('sample_container', __('investigations.sample_container')) }}
{{ Form::text('sample_container', $investigation->sample_container, ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('non_insured_price', __('investigations.non_insured_price')) }}
{{ Form::number('non_insured_price', $investigation->non_insured_price, ['class' => 'form-control']) }}
</div>
@if($investigation->price_list_category && $investigation->price_list_category != '')
@php
$price_list_categories = explode(",", $investigation->price_list_category);
$price_list_prices = explode(",", $investigation->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('comments', __('investigations.comments')) }}
{{ Form::textArea('comments', $investigation->comments, ['class'=>'form-control', 'rows' => 2]) }}
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{{ Form::label('lab_time', __('investigations.lab_time')) }}
{{ Form::text('lab_time', $investigation->lab_time, ['class' => 'form-control']) }}
</div>
<div class="row">
<div class="col-6">
<div class="form-group">
{{ Form::label('', __('investigations.is_investigation_available'), ["class"=>'col-md-12']) }}
&nbsp;{{ __('investigations.yes') }} {{ Form::radio('available', 1, $investigation->available == 1, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
&nbsp;{{ __('investigations.no') }} {{ Form::radio('available', 0, $investigation->available == 0, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-6">
<div class="form-group">
{{ Form::label('', __('investigations.is_investigation_chronic'), ["class"=>'col-md-12']) }}
&nbsp;{{ __('investigations.yes') }} {{ Form::radio('is_chronic', 1, $investigation->is_chronic == 1, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
&nbsp;{{ __('investigations.no') }} {{ Form::radio('is_chronic', 0, $investigation->is_chronic == 0, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
<div class="help-block with-errors"></div>
</div>
</div>
</div>
<div class="form-group">
{{ Form::label('account_id',__('investigations.chart_of_account_name')) }}
{{ Form::select('account_id',$chart_of_accounts,$investigation->account_id,['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group" id="echo_div">
{{ Form::label('echo', __('investigations.echo_investigation_template'), ["class"=>'col-md-12']) }}
&nbsp;{{ __('investigations.yes') }} {{ Form::radio('echo', 1, $investigation->slug == 'echo', ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
&nbsp;{{ __('investigations.no') }} {{ Form::radio('echo', 0, $investigation->slug == null, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('code', 'Item Code') }}
{{ Form::text('code', $investigation->code, ['class' => 'form-control']) }}
</div>
<div class="form-group">
{{ Form::label('reference_areas', __('diagnoses.reference_areas')) }}
{{ Form::text('reference_text', $investigation->reference_text, ['class' => 'form-control', 'placeholder' => 'Reference text']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::text('reference_link', $investigation->reference_link, ['class' => 'form-control', 'placeholder' => 'Reference link e.g. http://google.com']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group" id="wrapper">
<?php
$hmis_no_outpatient_array = array_filter(explode(",", $investigation->hmis_no_outpatient));
$hmis_category_array = array_filter(explode(",", $investigation->hmis_category));
?>
@if(count($hmis_no_outpatient_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_opd[]', $hmis_categories_opd, isset($hmis_category_array[$x]) ? $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)') }}
{{ Form::select('hmis_category_opd[]', $hmis_categories_opd, '', ['class' => 'form-control']) }}
</div>
</div>
@endif
</div>
<a class="add_field_hmis" style="color: blue;">{{ __('investigations.add_more') }}</a><br><br>
<div class="form-group">
@php
$inpatient_option =$investigation->hmis_category_inpatient;
$inpatient_other = array_filter($inpatient_hmis_categories, function ($item) use ($inpatient_option) {
return $item['id'] !== $inpatient_option;
});
$inpatient_selected = array_filter($inpatient_hmis_categories, function ($item) use ($inpatient_option) {
return $item['id'] == $inpatient_option;
});
$categories_option = $investigation->hmis_no_inpatient;
$selected_hmis_categories_option=array_filter($inpatient_hmis_category_options, function ($item) use ($categories_option) {
return $item['id'] == $categories_option;
});
$other_hmis_categories_options= array_filter($inpatient_hmis_category_options, function ($item) use ($categories_option) {
return $item['id'] != $categories_option;
});
@endphp
{{ Form::label('hmis_category_inpatient', __('investigations.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 class="help-block with-errors"></div>
{{ Form::label('hmis_no_inpatient', __('investigations.hmis_category_in_patient_number')) }}
<select class="form-control" id="inpatient_hmis_category_options" name="hmis_no_inpatient">
@if (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 class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('hmis_002_slug', __('investigations.hmis_002_category')) }}
{{ Form::select('hmis_002_slug', ['' => '--select--',1 => 'TB', 2 => 'RDT', 3=>'B/S', 4=>'RBS'], $investigation->hmis_002_slug?? '', ['class' => 'form-control', 'id'=>'hmis_002_slug']) }}
</div>
{{ Form::button(__('investigations.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('investigations.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
@php $spec_vars = \DB::table('investigation_specialised_variables')->whereNull('deleted_at')->where('investigation_id', $investigation->id)->get(); @endphp
@if(count($spec_vars) > 0)
<br><br>
<a class="btn btn-warning" href="/investigations/edit_specialised_variables_ranking/{{ $investigation->id }}">{{ __('investigations.edit_specialised_variables_ranking') }}</a>
@endif
</div>
</div>
</div>
{{ Form::close() }}
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.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 src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script type="text/javascript">
$('#account_id, #category, #units').select2();
var echo_value = '{{ $investigation->slug }}';
var max_fields1 = 4; //maximum reference area/name divs allowed
var x1 = 1; //initial reference area/name div count
if(echo_value == 'echo') $('#echo_div').show();
else $('#echo_div').hide();
$('#category').change(function() {
if($(this).val() == '17') $('#echo_div').show();
else {
$('#echo_div').hide();
$('#echo').val(0)
}
});
$(".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--;
});
$('#range_type').change(function (e) {
e.preventDefault();
if(this.value == 2){
$('#constant_div').show();
$('#dynamic_div').hide();
}else{
$('#constant_div').hide();
$('#dynamic_div').show();
}
});
$('#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 {
$('#inpatient_hmis_category_options').html(response);
$('#inpatient_hmis_category_options').prop('required',true);
}
}
});
}
</script>
@endpush
@@ -0,0 +1,115 @@
@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" />
<style>
th{
white-space: nowrap;
}
</style>
@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">{{ __('investigations.edit_investigation') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.edit_investigation') }}</li>
</ol>
</div>
</div>
@include('investigations::investigations.menu')
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
{{ Form::model($investigations, ['method' => 'ANY', 'route' => ['investigations.update_all', 'data-toggle' => 'validator']]) }}
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th hidden></th>
<th>{{ __('investigations.investigation_name') }}</th>
<th>{{ __('investigations.category') }}</th>
<th>{{ __('investigations.normal_ranges') }}</th>
<th>{{ __('investigations.minimum') }}</th>
<th>{{ __('investigations.sample_container') }}</th>
<th>{{ __('investigations.non_insured_price') }}</th>
<th>{{ __('investigations.insured_price') }}</th>
<th>{{ __('investigations.comments') }}</th>
<th>{{ __('investigations.lab_time') }}</th>
<th>{{ __('investigations.insurance_coverage') }}</th>
<th>{{ __('investigations.is_investigation_available') }}</th>
<th>{{ __('investigations.chart_of_account_name') }}</th>
</tr>
</thead>
<tbody>
@foreach($investigations as $investigation)
<tr>
<td hidden>{{ Form::text('id[]', $investigation->id, ['class' => 'form-control']) }}</td>
<td>
<p style="display: none">{{ $investigation->name }}</p>
{{ Form::text('name[]', $investigation->name, ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</td>
<td>{{ Form::select('category[]',$investigation_categories,$investigation->category,['class' => 'form-control compulsory', 'required']) }}</td>
<td>{{ Form::text('normal_ranges[]', $investigation->normal_ranges, ['class' => 'form-control']) }}</td>
<td>{{ Form::text('minimum[]', $investigation->minimum, ['class' => 'form-control']) }}</td>
<td>{{ Form::text('sample_container[]', $investigation->sample_container, ['class' => 'form-control']) }}</td>
<td>{{ Form::number('non_insured_price[]', $investigation->non_insured_price, ['class' => 'form-control']) }}</td>
<td>{{ Form::number('insured_price[]', $investigation->insured_price, ['class' => 'form-control']) }}</td>
<td>{{ Form::textArea('comments[]', $investigation->comments, ['class'=>'form-control', 'rows' => 2]) }}</td>
<td>{{ Form::text('lab_time[]', $investigation->lab_time, ['class' => 'form-control']) }}</td>
<td>{{ Form::select('insurance_coverage[]', [1 => 'Yes', 0 => 'No'], $investigation->insurance_coverage, ['class' => 'form-control']) }}</td>
<td>{{ Form::select('available[]', [1 => 'Yes', 0 => 'No'], $investigation->available, ['class' => 'form-control']) }}</td>
<td>{{ Form::select('account_id[]',$chart_of_accounts,$investigation->account_id,['class' => 'form-control compulsory']) }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
{{ Form::button(__('investigations.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('investigations.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
{{ Form::close() }}
</div>
</div>
</div>
@include('investigations::investigations.menu')
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<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: 50,
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
</script>
@endpush
@@ -0,0 +1,197 @@
@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" />
<style>
th{
white-space: nowrap;
}
</style>
@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">{{ __('investigations.edit_investigation') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.edit') }}</li>
</ol>
</div>
</div>
@include('investigations::investigations.menu')
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
{{ Form::model($investigations, ['method' => 'POST', 'route' => ['investigations.update.hmis.options']]) }}
<div class="table-responsive">
<table id="table" class="table table-striped">
<thead>
<tr>
<th hidden>Id</th>
<th>{{ __('investigations.investigation_name') }}</th>
<th>{{ __('investigations.hmis_category_out_patient_number') }}</th>
<th>{{ __('investigations.hmis_category_out_patient') }}</th>
<th>{{ __('investigations.hmis_category_in_patient_number') }}</th>
<th>{{ __('investigations.hmis_category_in_patient') }}</th>
</tr>
</thead>
<tbody>
@php
$counter = 0;
@endphp
@foreach($investigations as $investigation)
<tr>
<td hidden>{{ Form::text('id[]', $investigation->id, ['class' => 'form-control']) }}</td>
<td>
<p style="display: none">{{ $investigation->name }}</p>
{{ Form::text('name[]', $investigation->name, ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</td>
@php
$hmis_no_outpatient_array = explode(",", $investigation->hmis_no_outpatient);
$hmis_outpatient_category_array = explode(",", $investigation->hmis_category);
@endphp
<td>{{ Form::text('hmis_no_outpatient[]', $investigation->hmis_no_outpatient, ['class' => 'form-control','placeholder' => '']) }}</td>
<td>
@if(count($hmis_no_outpatient_array) > 0)
<!-- only display one field for noe -->
@for($i=0; $i < 1; $i++)
{{ Form::select('hmis_category[]', $hmis_categories, isset($hmis_outpatient_category_array[$i]) ? $hmis_outpatient_category_array[$i] : "", ['class' => 'form-control']) }}
@endfor
@endif
</td>
<td>
@php
$inpatient_option =$investigation->hmis_category_inpatient;
$inpatient_other = array_filter($inpatient_hmis_categories, function ($item) use ($inpatient_option) {
return $item['id'] !== $inpatient_option;
});
$inpatient_selected = array_filter($inpatient_hmis_categories, function ($item) use ($inpatient_option) {
return $item['id'] == $inpatient_option;
});
$categories_option = $investigation->hmis_no_inpatient;
$selected_hmis_categories_option=array_filter($inpatient_hmis_category_options, function ($item) use ($categories_option) {
return $item['id'] == $categories_option;
});
$other_hmis_categories_options= array_filter($inpatient_hmis_category_options, function ($item) use ($categories_option) {
return $item['id'] != $categories_option;
});
@endphp
{{-- {{ Form::text('hmis_no_inpatient[]', $investigation->hmis_no_inpatient, ['class' => 'form-control']) }} --}}
<select class="form-control hmis_category_inpatient" id="{{ 'hmis_category_inpatient_'. $counter }}" name="hmis_category_inpatient[]">
<option value selected='<?php echo empty($inpatient_selected)? 'selected ':''; ?>'>- 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 class="help-block with-errors"></div>
</td>
<td>
{{-- {{ Form::select('hmis_category_inpatient[]', $hmis_categories_ip, $investigation->hmis_category_inpatient, ['class' => 'form-control']) }} --}}
<select class="form-control inpatient_hmis_category_options" id="{{ 'inpatient_hmis_category_options_'. $counter }}" name="hmis_no_inpatient[]">
@if (empty($selected_hmis_categories_option))
<option value selected='selected'>- 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
@if (!empty($inpatient_selected))
@foreach ($other_hmis_categories_options as $option )
<option value="{{ $option['id'] }}">{{ $option['name'] }}</option>
@endforeach
@endif
</select>
<div class="help-block with-errors"></div>
</td>
</tr>
@php
$counter++;
@endphp
@endforeach
</tbody>
</table>
</div>
{{ Form::button(__('investigations.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('investigations.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
{{ Form::close() }}
</div>
</div>
</div>
@include('investigations.menu')
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<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 src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script>
$(document).ready(function () {
$('#table').DataTable({
dom: 'Bfrtip',
pageLength: 30,
// bPaginate: false,
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
$('.hmis_category_inpatient,.inpatient_hmis_category_options').select2();
$('#table tbody').on('change','.hmis_category_inpatient', function(e) {
if(!$('.hmis_category_inpatient').hasClass('select2-hidden-accessible')) $('.hmis_category_inpatient,.inpatient_hmis_category_options').select2();
let counter = this.id.split("_");let id = this.id;
category_options(id,counter);
});
});
function category_options(id,counter){
let category = $('#'+id).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 {
$('#inpatient_hmis_category_options_'+counter[3]).html(response);
$('#inpatient_hmis_category_options_'+counter[3]).prop('required',true);
}
}
});
}
</script>
@endpush
@@ -0,0 +1,175 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('investigations.edit_lab_specimen') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/view_lab_results/">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.edit_lab_specimen') }}</li>
</ol>
</div>
</div>
<div class="white-box">
<div class="row">
<div class="col-md-5">
<table class='table table-bordered table-striped'>
<tr>
<th style='color: black'>{{ __('investigations.patient_names') }}</th>
<td>
{{ get_full_name($ordered_investigation->patient_id, 'id', 'first_name', 'last_name', 'patients') }}
</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.age') }}/{{ __('investigations.gender') }}</th>
<td>
{{ get_patients_age(get_name($ordered_investigation->patient_id, 'id', 'date_of_birth', 'patients')) }}
/
{{ get_name($ordered_investigation->patient_id, 'id', 'gender', 'patients') == 1 ? "Male" : "Female" }}
</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.patient_number') }}</th>
<td>{{ get_name($ordered_investigation->patient_id, 'id', 'number', 'patients') }}</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.lab_number') }}</th>
<td>{{ sprintf("%05u", $ordered_investigation->id) }}</td>
</tr>
</table>
</div>
<div class="col-md-5">
<table class='table table-bordered table-striped'>
<tr>
<th style='color: black'>{{ __('investigations.doctor') }}</th>
<td>{{ get_full_name($ordered_investigation->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.hospital_unit') }}</th>
<td>
@if($ordered_investigation->inpatient == 1)
{{ get_ward_name($ordered_investigation->patient_id, $ordered_investigation->episode_id) }}
@else
OPD
@endif
</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.requested') }}</th>
<td>{{ streamline_date_time($ordered_investigation->created_at) }}</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.received') }}</th>
<td>{{ streamline_date_time($ordered_investigation->request_received_date) }}</td>
</tr>
</table>
</div>
<div class="col-md-2">
<div class="pull-right">
{{ getDNS1DBarcodePNG($ordered_investigation->id) }}
<h4>{{ sprintf("%04u", $ordered_investigation->id) }}</h4>
</div>
</div>
</div>
<hr>
@php
$specimens_array = explode(",", $ordered_investigation->specimen);
$status_array = explode(",", $ordered_investigation->specimen_status);
$reason_array = explode(",", $ordered_investigation->specimen_reason);
$counter = 0;
@endphp
{{ Form::open(['route' => 'investigations.save_investigation_specimen']) }}
{{ Form::hidden('id', $ordered_investigation->id) }}
<div class="row">
<div class="col-md-4">
<h4><strong>{{ __('investigations.specimen') }}</strong></h4>
</div>
<div class="col-md-3">
<h4><strong>{{ __('investigations.status') }}</strong></h4>
</div>
<div class="col-md-3">
<h4><strong>{{ __('investigations.reason') }}</strong></h4>
</div>
<div class="col-md-2"></div>
</div>
@for($i = 0; $i < count($specimens_array); $i++)
<div class="row" id="section{{$counter}}">
<div class="col-md-4">
<div class="form-group">
{{ Form::select('specimen[]', $specimen, $specimens_array[$i], ['class' => 'form-control modal_specimen', 'id' => 'modal_specimen']) }}
</div>
</div>
<div class="col-md-3">
<div class="form-group">
{{ Form::select('status[]', [0 => '--select--', 1 => __('investigations.taken'), 2 => __('investigations.not_taken'), 3 => __('investigations.rejected')], $status_array[$i], ['class' => 'form-control modal_status', 'id' => 'modal_status']) }}
</div>
</div>
<div class="col-md-3">
<div class="form-group">
{{ Form::textarea('reason[]', $reason_array[$i], ['class' => 'form-control modal_reason', 'rows' => 2]) }}
</div>
</div>
<div class="col-md-2">
<a class="btn btn-outline-danger text-danger" onclick="remove_div({{$counter}})">{{ __('investigations.remove') }}</a>
</div>
</div>
@php $counter++; @endphp
@endfor
<div id="modal_more_specimen_section"></div>
<a class="btn btn-info btn-rounded" style="color: white" id="modal_add_specimen_button"><i class="fa fa-plus"></i><span style="margin-left: 10px;"> {{ __('investigations.specimen') }}</span></a>
<button type="submit" class="btn btn-rounded btn-success">{{ __('investigations.save') }}</button>
{{ Form::close() }}
</div>
<div style="display: none">
<div class="form-group" id="specimen_div">
{{ Form::select('specimen[]', $specimen, null, ['class' => 'form-control modal_specimen', 'id' => 'modal_specimen']) }}
</div>
<div class="form-group" id="status_div">
{{ Form::select('status[]', [0 => '--select--', 1 => 'Taken', 2 => 'Not Taken', 3 => 'Rejected'], null, ['class' => 'form-control modal_status', 'id' => 'modal_status']) }}
</div>
<div class="form-group" id="reason_div">
{{ Form::textarea('reason[]', '', ['class' => 'form-control modal_reason', 'rows' => 2]) }}
</div>
<div id="remove_div">
<a class="btn btn-outline-danger text-danger" onclick="remove_div({{$counter}})">{{ __('investigations.remove') }}</a>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script>
let counter = <?php echo $counter; ?>
function remove_div(id) {
$('#section' + id).html("");
$('#section' + id).hide();
}
$('#modal_add_specimen_button').click( function () {
counter++;
let html_code = "<div class='row' id='section" + counter + "'>" +
"<div class='col-md-4'>" + $('#specimen_div').html() + "</div>" +
"<div class='col-md-3'>" + $('#status_div').html() + "</div>" +
"<div class='col-md-3'>" + $('#reason_div').html() + "</div>" +
"<div class='col-md-2'>" + '<a class="btn btn-outline-danger text-danger" onclick="remove_div(' + counter + ')">Remove</a>' + "</div>" +
"</div> <br>";
$('#modal_more_specimen_section').append(html_code);
});
</script>
@endpush
@@ -0,0 +1,85 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/icheck/skins/all.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">{{ __('investigations.edit_investigation') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="{{ route('investigations.index') }}">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.edit') }}</li>
</ol>
</div>
</div>
@include('investigations::investigations.menu')
<div class="row">
<div class="col-sm-12">
<div class="panel"></div>
</div>
</div>
{{ Form::open(['route' => 'investigations.save_specialised_variables_ranking' , 'data-toggle' => 'validator']) }}
{{ Form::hidden('inv_id', $id)}}
<div class="white-box">
<div class="row">
<div class="col-md-12">
<h3>{{ __('investigations.specialised_variables_ranking') }} {{ get_name($id, 'id', 'name', 'investigations') }}</h3>
<hr>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th><h4>{{ __('investigations.variable_name') }}</h4></th>
<th><h4>{{ __('investigations.ranking_print_order') }}</h4></th>
</tr>
</thead>
<tbody>
@foreach($specialized_variables as $record)
<tr>
<td>{{ $record->name }}</td>
{{ Form::hidden('spec_id[]', $record->id)}}
<td>{{ Form::number('ranking[]', $record->ranking, ['class' => 'form-control ranking', 'onfocus' => 'this.oldvalue = this.value', 'id' => $record->id]) }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
{{ Form::button(__('investigations.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('investigations.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
</div>
</div>
</div>
{{ Form::close() }}
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<script type="text/javascript">
$('.ranking').on('focusout', function() {
let exclude_id = this.id;
let value = +this.value;
let oldvalue = +this.oldvalue;
$('.ranking').each(function () {
if (this.id !== exclude_id) {
if (oldvalue <= +this.value && value >= +this.value) {
this.value--;
} else if (oldvalue >= +this.value && value <= +this.value) {
this.value++;
}
}
});
});
</script>
@endpush
@@ -0,0 +1,131 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('investigations.historical_investigations') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="{{ route('patients.index') }}">{{ __('investigations.patients') }}</a></li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['method'=>'post','route' => 'investigations.historical_labs']) }}
{{ Form::hidden('patient_id', 0, ['id' => 'patient_id']) }}
<div class="row">
<div class="col-md-3">
{{ Form::label('search_patient', 'Search By Patient') }}
<div class="input-group">
<select class="form-control" name="patient_number" id="patient_number"></select>
</div>
</div>
<div class="col-md-2">
<div class="form-group" style="margin-top: 25px;">
{{ Form::submit(__('investigations.search'), ['class'=>'btn btn-success pull-right']) }}
</div>
</div>
</div>
{{ Form::close() }}
</div>
<div class="white-box">
@if($search_text != "")
<h4><label class="label label-info">{{ $search_text }}</label></h4>
<br>
@endif
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table table-striped table-bordered">
<thead>
<tr>
<th>{{ __('investigations.patient_number') }}</th>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.gender') }}</th>
<th>{{ __('investigations.phone') }}</th>
<th>{{ __('investigations.action') }}</th>
</tr>
</thead>
<tbody>
@foreach($patients as $patient)
<tr>
<td>
{{ $patient->number }}
</td>
<td>
{!! insurance_flag($patient->patient_id) !!}
</td>
<td>
@if($patient->gender == 1)
{{ __('investigations.male') }}
@elseif($patient->gender == 2)
{{ __('investigations.female') }}
@elseif($patient->gender == 3)
{{ __('investigations.other') }}
@endif
</td>
<td>
{{ $patient->phone }}
</td>
<td class="text-center">
<a href="/investigations/view_historical_results_labs/{{ $patient->patient_id }}" class="btn btn-rounded btn-primary btn-sm">{{ __('investigations.historical_results') }}</a>
</td>
</tr>
@endforeach
@if(count($patients) <= 0)
<tr>
<td colspan="5" class="text-center">
{{ __('investigations.no_historical_records') }}
</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
@endsection
@push('scripts')
<!-- Typehead Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script type="text/javascript">
$('#patient_number').change(function () {
let id = $('#patient_number').val();
$('#patient_id').val(id);
});
$('#patient_number').select2({
placeholder: 'Search by patient details (names and number)',
ajax: {
url: '/patients/search_patient_by_name_number',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.first_name + " " + item.last_name + " (" + item.number + ")",
id: item.id
}
})
};
},
cache: true
}
});
</script>
@endpush
@@ -0,0 +1,128 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4">
<h4 class="page-title">{{ __('investigations.imaging_historical_results') }}</h4>
</div>
<div class="col-md-8">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li class="active">{{ __('investigations.imaging_historical_results') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['method'=>'post','route' => 'investigations.imaging_historical_results']) }}
{{ Form::hidden('patient_id', 0, ['id' => 'patient_id']) }}
<div class="row">
<div class="col-md-3">
{{ Form::label('search_patient', 'Search By Patient') }}
<div class="input-group">
<select class="form-control" name="patient_number" id="patient_number"></select>
</div>
</div>
<div class="col-md-2">
<div class="form-group" style="margin-top: 25px;">
{{ Form::submit(__('investigations.search'), ['class'=>'btn btn-success pull-right']) }}
</div>
</div>
</div>
{{ Form::close() }}
</div>
<div class="white-box">
@if($search_text != "")
<h4><label class="label label-info">{{ $search_text }}</label></h4>
<br>
@endif
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table table-striped table-bordered">
<thead>
<tr>
<th>{{ __('investigations.patient_number') }}</th>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.gender') }}</th>
<th>{{ __('investigations.phone') }}</th>
<th>{{ __('investigations.action') }}</th>
</tr>
</thead>
<tbody>
@foreach($patients as $patient)
<tr>
<td>
{{ $patient->number }}
</td>
<td>
{!! insurance_flag($patient->patient_id) !!}
</td>
<td>
@if($patient->gender == 1)
{{ __('investigations.male') }}
@elseif($patient->gender == 2)
{{ __('investigations.female') }}
@elseif($patient->gender == 3)
{{ __('investigations.other') }}
@endif
</td>
<td>
{{ $patient->phone }}
</td>
<td class="text-center">
<a href="/investigations/view_historical_results_imaging/{{ $patient->patient_id }}" class="btn btn-rounded btn-primary btn-sm">{{ __('investigations.historical_results') }}</a>
</td>
</tr>
@endforeach
@if(count($patients) <= 0)
<tr>
<td colspan="5" class="text-center">
{{ __('investigations.no_historical_records') }}
</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script type="text/javascript">
$('#patient_number').change(function () {
let id = $('#patient_number').val();
$('#patient_id').val(id);
});
$('#patient_number').select2({
placeholder: 'Search by patient details (names and number)',
ajax: {
url: '/patients/search_patient_by_name_number',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.first_name + " " + item.last_name + " (" + item.number + ")",
id: item.id
}
})
};
},
cache: true
}
});
</script>
@endpush
@@ -0,0 +1,109 @@
@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" />
<style>
th{
white-space: nowrap;
}
</style>
@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">{{ __('investigations.activate_investigations') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="{{ route('investigations.index') }}">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.activate_investigations') }}</li>
</ol>
</div>
</div>
@include('investigations::investigations.menu')
<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>{{ __('investigations.investigation_name') }}</th>
<th>{{ __('investigations.normal_ranges') }}</th>
<th>{{ __('investigations.minimum') }}</th>
<th>{{ __('investigations.sample_container') }}</th>
<th>{{ __('investigations.non_insured_price') }}</th>
<th>{{ __('investigations.insured_price') }}</th>
<th>{{ __('investigations.comments') }}</th>
<th>{{ __('investigations.lab_time') }}</th>
<th>{{ __('investigations.category') }}</th>
<th>{{ __('investigations.is_investigation_available') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($investigations as $investigation)
<tr>
<td>{{ $investigation->name }}</td>
<td>{{ $investigation->normal_ranges }}</td>
<td>{{ $investigation->minimum }}</td>
<td>{{ $investigation->sample_container }}</td>
<td>{{ $investigation->non_insured_price }}</td>
<td>{{ $investigation->insured_price }}</td>
<td>{{ $investigation->comments }}</td>
<td>{{ $investigation->lab_time }}</td>
<td>{{ isset($investigation_categories[$investigation->category]) ? $investigation_categories[$investigation->category] : "Not Set" }}</td>
<td>
@if ($investigation->available)
{{ __('investigations.yes') }}
@else
{{ __('investigations.no') }}
@endif
</td>
<td>
{{ Form::model($investigation->id ,['method' => 'POST', 'route' => ['investigations.activate', $investigation->id]]) }}
<button type="submit" class="btn btn-warning" onclick="return confirm('Are you sure?')"><i class="fa fa-check"></i> {{ __('investigations.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
@@ -0,0 +1,450 @@
@extends('layouts.main')
@push('styles')
<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/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">
@if($imaging_type == 'Imaging')
{{ __('investigations.incoming_radiology_investigations') }}
@elseif($imaging_type == 'Cardio')
{{ __('investigations.incoming_cardiology_investigations') }}
@elseif($imaging_type == 'Ultrasound')
{{ __('investigations.incoming_ultrasound_investigations') }}
@elseif($imaging_type == 'Ultrasound_Obstetric')
{{ __('investigations.incoming_obstetric_ultrasound_investigations') }}
@endif
</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.incoming') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['url' => '/investigations/incoming_imaging/' . $imaging_type, 'data-toggle' => 'validator']) }}
{{ Form::hidden('patient_id', 0, ['id' => 'patient_id']) }}
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label>{{ __('pharmacy.select_date') }}:</label>
<select class="form-control compulsory required" name="search_date_by" id="search_date_by" required>
<option value="today">{{ __('pharmacy.today') }}</option>
<option value="yesterday">{{ __('pharmacy.yesterday') }}</option>
<option value="custom_date">{{ __('pharmacy.custom_date') }}</option>
<option value="custom_date_range">{{ __('pharmacy.date_range') }}</option>
</select>
</div>
</div>
<div class="col-md-2" id="start_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('pharmacy.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-2" id="end_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('pharmacy.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-3">
{{ Form::label('search_patient', 'Search By Patient') }}
<div class="input-group">
<select class="form-control" name="patient_number" id="patient_number"></select>
</div>
</div>
<div class="col-md-2">
<div class="form-group" style="margin-top: 25px;">
{{ Form::submit(__('investigations.search'), ['class'=>'btn btn-success pull-right']) }}
</div>
</div>
</div>
{{ Form::close() }}
</div>
<div class="white-box">
<!--Flash messages at the top -->
@include('flash::message')
@if($search_text != "")
<h4>
<label class="label label-info">{{ $search_text }}</label>&nbsp;&nbsp;
@if (count($urgent_incomings) > 0)
<label class="label label-danger"> There are Urgent
@if($imaging_type == 'Imaging')
{{ __('investigations.incoming_radiology_investigations') }}
@elseif($imaging_type == 'Cardio')
{{ __('investigations.incoming_cardiology_investigations') }}
@elseif($imaging_type == 'Ultrasound')
{{ __('investigations.incoming_ultrasound_investigations') }}
@elseif($imaging_type == 'Ultrasound_Obstetric')
{{ __('investigations.incoming_obstetric_ultrasound_investigations') }}
@endif
</label>
@endif
</h4>
<br>
@endif
<div class="card">
<div class="card-header">
<ul class="nav nav-tabs" role="tablist">
@if (count($urgent_incomings)>0)
<li role="presentation" class="nav-item"> <a href="#per_results_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.all_incomplete') }} ({{ count($incomings) }})</a> </li>
<li role="presentation" class="nav-item active"> <a href="#urgent_incoming_imaging" class="nav-link text-danger" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.urgent_incoming_imaging_investigations') }} ({{ count($urgent_incomings) }})</a> </li>
<li role="presentation" class="nav-item"> <a href="#all_complete_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.all_complete') }} ({{ count($results) }})</a> </li>
@else
<li role="presentation" class="active nav-item"> <a href="#per_results_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.all_incomplete') }} ({{ count($incomings) }})</a> </li>
<li role="presentation" class="nav-item"> <a href="#all_complete_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.all_complete') }} ({{ count($results) }})</a> </li>
@endif
</ul>
</div>
<div class="card-block">
<div class="tab-content">
<div id="per_results_nav_pill" class="tab-pane <?php if(count($urgent_incomings) < 1) echo 'active'; ?>">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.requested') }}</th>
<th>{{ __('investigations.source') }}</th>
<th>{{ __('investigations.payment') }}</th>
<th>{{ __('investigations.request') }}</th>
<th colspan="3" class="text-center">{{ __('investigations.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($incomings as $incoming)
<tr>
<td>
{!! insurance_flag($incoming->patient_id) !!}
({{ $incoming->patient_number }}) - ({{ $patient_categories[$incoming->patients_category_id] ?? '' }})
</td>
<td>{{ streamline_date_time_short($incoming->created_at) }}</td>
<td>
@if($incoming->inpatient == 1 || $incoming->inpatient_bill_generated == 1)
{{ get_ward_name($incoming->patient_id, $incoming->episode_id) }}
@else
OPD
@endif
</td>
<td>
@if($incoming->payment_status == 0)
@if($incoming->inpatient_bill_generated == 1)
<label class="label label-success">{{ __('investigations.inpatient_bill_generated') }}</label>
@else
<label class="label label-danger">{{ __('investigations.not_paid') }}</label>
@endif
@else
<label class="label label-success">{{ __('investigations.paid') }}</label>
@endif
</td>
<td onclick="showQuickView({{ $incoming->id }}, 1)"><i class="fa fa-search"></i> {{ count(explode(",", $incoming->investigation_id)) }} {{ __('investigations.tests') }}</td>
@if($incoming->inpatient == 0 && $incoming->inpatient_bill_generated == 0 && $incoming->payment_status == 0 && !can_investigations_be_performed($incoming->patients_category_id))
<td colspan="3" class="text-center">
<code>{{ __('investigations.patient_has_not_paid_for_ordered_investigations') }}</code>
</td>
@else
<td class="text-center">
@if($imaging_type == 'Ultrasound_Obstetric')
{{ Form::open(['route' => 'investigations.ultrasound_obstetric_report']) }}
@else
{{ Form::open(['route' => 'investigations.ordered_results']) }}
@endif
{{ Form::hidden('order_id',$incoming->id) }}
{{ Form::hidden('order_type', $imaging_type) }}
{{ Form::hidden('patient_id',$incoming->patient_id) }}
{{ Form::hidden('episode_id',$incoming->episode_id) }}
<button type="submit" class="btn btn-success btn-rounded btn-sm">{{ __('investigations.add_results') }}</button>
{{ Form::close() }}
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $incoming->patient_id }}" class="btn btn-info btn-rounded btn-sm">{{ __('investigations.select_patient') }}</a>
</td>
<td>
<a href="/investigations/print_request/{{ $incoming->id }}" class="btn btn-rounded btn-sm" style="background-color:#03C03C; color: white"><i class="fa fa-print"></i><span style="margin-left: 10px;">{{ __('investigations.print_request') }}</span></a>
</td>
@endif
</tr>
@endforeach
@if(count($incomings) <= 0)
<tr>
<td colspan="8" class='text-center' style='color: maroon; font-weight: bold;'>{{ __('investigations.no_requests_available') }}</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
<div id="all_complete_nav_pill" class="tab-pane">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.requested') }}</th>
<th>Performed At</th>
<th>{{ __('investigations.turn_around_time') }}</th>
<th>{{ __('investigations.source') }}</th>
<th>{{ __('investigations.payment') }}</th>
<th>{{ __('investigations.request') }}</th>
<th>{{ __('investigations.done_by') }}</th>
<th class="text-center">{{ __('investigations.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($results as $result)
<tr>
<td>
{!! insurance_flag($result->patient_id) !!}
({{ $result->patient_number }}) - ({{ $patient_categories[$result->patients_category_id] ?? '' }})
</td>
<td>
{{ streamline_date_time_short($result->created_at) }}
</td>
<td>{{ $result->results_created_at ? streamline_date_time_short($result->results_created_at) : "N/A" }}</td>
<td>{{ \Carbon\Carbon::parse($result->results_created_at)->diffForHumans(\Carbon\Carbon::parse($result->created_at)) }} request</td>
<td>
@if($result->inpatient == 1 || $result->inpatient_bill_generated == 1)
{{ get_ward_name($result->patient_id, $result->episode_id) }}
@else
OPD
@endif
</td>
<td>
@if($result->payment_status == 0)
@if($result->inpatient_bill_generated == 1)
<label class="label label-success">{{ __('investigations.inpatient_bill_generated') }}</label>
@else
<label class="label label-danger">{{ __('investigations.not_paid') }}</label>
@endif
@else
<label class="label label-success">{{ __('investigations.paid') }}</label>
@endif
</td>
<td onclick="showQuickView({{ $result->id }}, 1)"><i class="fa fa-search"></i> {{ count(explode(",", $result->investigation_id)) }} {{ __('investigations.tests') }}</td>
<td>
{{ get_full_name($result->created_by, "id", "first_name", "last_name", "users") }}
</td>
@if($result->inpatient == 0 && $result->inpatient_bill_generated == 0 && $result->payment_status == 0 && !can_investigations_be_performed($result->patients_category_id))
<td class="text-center">
<code>{{ __('investigations.patient_has_not_paid_for_ordered_investigations') }}</code>
</td>
@else
<td class="text-center">
@if($imaging_type == 'Ultrasound_Obstetric')
<a class="btn btn-success btn-sm" href="/investigations/view_patient_investigation_obstetric/{{ $result->results_value }}">{{ __('investigations.view_results') }}</a>
@else
<a class="btn btn-success btn-sm" href="/investigations/view_patient_investigation/{{ $result->results_id }}">{{ __('investigations.view_results') }}</a>
@endif
</td>
@endif
</tr>
@endforeach
@if(count($results) <= 0)
<tr>
<td colspan="6" class='text-center' style='color: maroon; font-weight: bold;'>{{ __('investigations.no_requests_available') }}</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
@if (count($urgent_incomings) > 0)
<div id="urgent_incoming_imaging" class="tab-pane active">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.requested') }}</th>
<th>{{ __('investigations.source') }}</th>
<th>{{ __('investigations.payment') }}</th>
<th>{{ __('investigations.request') }}</th>
<th colspan="3" class="text-center">{{ __('investigations.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach($urgent_incomings as $urgent_incoming)
<tr>
<td>
{!! insurance_flag($urgent_incoming->patient_id) !!}
({{ $urgent_incoming->patient_number }}) - ({{ $patient_categories[$urgent_incoming->patients_category_id] ?? '' }})
</td>
<td>{{ streamline_date_time_short($urgent_incoming->created_at) }}</td>
<td>
@if($urgent_incoming->inpatient == 1 || $urgent_incoming->inpatient_bill_generated == 1)
{{ get_ward_name($urgent_incoming->patient_id, $urgent_incoming->episode_id) }}
@else
OPD
@endif
</td>
<td>
@if($urgent_incoming->payment_status == 0)
@if($urgent_incoming->inpatient_bill_generated == 1)
<label class="label label-success">{{ __('investigations.inpatient_bill_generated') }}</label>
@else
<label class="label label-danger">{{ __('investigations.not_paid') }}</label>
@endif
@else
<label class="label label-success">{{ __('investigations.paid') }}</label>
@endif
</td>
<td onclick="showQuickView({{ $urgent_incoming->id }}, 1)"><i class="fa fa-search"></i> {{ count(explode(",", $urgent_incoming->investigation_id)) }} {{ __('investigations.tests') }}</td>
@if($urgent_incoming->inpatient == 0 && $urgent_incoming->inpatient_bill_generated == 0 && $urgent_incoming->payment_status == 0 && !can_investigations_be_performed($urgent_incoming->patients_category_id))
<td colspan="3" class="text-center">
<code>{{ __('investigations.patient_has_not_paid_for_ordered_investigations') }}</code>
</td>
@else
<td class="text-center">
@if($imaging_type == 'Ultrasound_Obstetric')
{{ Form::open(['route' => 'investigations.ultrasound_obstetric_report']) }}
@else
{{ Form::open(['route' => 'investigations.ordered_results']) }}
@endif
{{ Form::hidden('order_id',$urgent_incoming->id) }}
{{ Form::hidden('order_type', $imaging_type) }}
{{ Form::hidden('patient_id',$urgent_incoming->patient_id) }}
{{ Form::hidden('episode_id',$urgent_incoming->episode_id) }}
<button type="submit" class="btn btn-success btn-rounded btn-sm">{{ __('investigations.add_results') }}</button>
{{ Form::close() }}
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $urgent_incoming->patient_id }}" class="btn btn-info btn-rounded btn-sm">{{ __('investigations.select_patient') }}</a>
</td>
<td>
<a href="/investigations/print_request/{{ $urgent_incoming->id }}" class="btn btn-rounded btn-sm" style="background-color:#03C03C; color: white"><i class="fa fa-print"></i><span style="margin-left: 10px;">{{ __('investigations.print_request') }}</span></a>
</td>
@endif
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endif
</div>
</div>
</div>
</div>
<div class="modal" id="modal_receive_request" tabindex="-1" role="dialog" aria-labelledby="debt_plan_modal_label" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"><b id="modal_heading"></b></h4>
</div>
<div class="modal-body">
<div class="table-responsive" id="modal_table"></div>
<div id="modal_specimen_edit"></div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script>
$('#patient_number').change(function () {
let id = $('#patient_number').val();
$('#patient_id').val(id);
});
$('#patient_number').select2({
placeholder: 'Search by patient details (names and number)',
ajax: {
url: '/patients/search_patient_by_name_number',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.first_name + " " + item.last_name + " (" + item.number + ")",
id: item.id
}
})
};
},
cache: true
}
});
$('#search_date_by').change(function() {
if($(this).val() === "custom_date"){
$("#end_date_div").hide();
$("#start_date_div").show();
} else if($(this).val() === "custom_date_range") {
$("#start_date_div").show();
$("#end_date_div").show();
} else {
$("#end_date_div").hide();
$("#start_date_div").hide();
}
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
function showQuickView(id, type) {
$.ajax({
method: 'POST',
url: '/investigations/view_lab_results_quick_view',
data: {'id': id, 'type': type},
success: function(response){
let responseArray = JSON.parse(response);
$("#modal_table").html(responseArray["html"]);
$("#modal_heading").html("Investigations for " + responseArray["patient_name"] + "(" + responseArray["patient_number"] + ")");
if (type == 2) {
$("#modal_specimen_edit").html('<a class="btn btn-link btn-block" href="/investigations/edit_investigation_specimen/' + id +'">Edit Specimen</a>');
} else {
$("#modal_specimen_edit").html("");
}
$('#modal_receive_request').modal('show');
}
});
}
</script>
@endpush
@@ -0,0 +1,492 @@
@extends('layouts.main')
@push('styles')
<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/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('investigations.incoming_lab_investigations') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.incoming') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['method'=>'post','route' => 'investigations.incoming_labs']) }}
{{ Form::hidden('patient_id', 0, ['id' => 'patient_id']) }}
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label>{{ __('pharmacy.select_date') }}:</label>
<select class="form-control compulsory required" name="search_date_by" id="search_date_by" required>
<option value="today">{{ __('pharmacy.today') }}</option>
<option value="yesterday">{{ __('pharmacy.yesterday') }}</option>
<option value="custom_date">{{ __('pharmacy.custom_date') }}</option>
<option value="custom_date_range">{{ __('pharmacy.date_range') }}</option>
</select>
</div>
</div>
<div class="col-md-2" id="start_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('pharmacy.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-2" id="end_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('pharmacy.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-3">
{{ Form::label('search_patient', 'Search By Patient') }}
<div class="input-group">
<select class="form-control" name="patient_number" id="patient_number"></select>
</div>
</div>
<div class="col-md-2">
<div class="form-group" style="margin-top: 25px;">
{{ Form::submit(__('investigations.search'), ['class'=>'btn btn-success pull-right']) }}
</div>
</div>
</div>
{{ Form::close() }}
</div>
<div class="white-box">
@include('flash::message')
@if($search_text != "")
<h4>
<label class="label label-info">{{ $search_text }}</label>
@if (count($urgent_incomings) > 0)
&nbsp;&nbsp;<label class="label label-danger">{{ __('investigations.urgent_incoming_lab_investigations_warning') }}</label>
@endif
</h4>
<br>
@endif
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<ul class="nav nav-tabs" role="tablist">
@if (count($urgent_incomings)>0)
<li role="presentation" class="nav-item"> <a href="#results_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.incoming_lab_investigations') }} ({{ count($incomings) }})</a> </li>
<li role="presentation" class="nav-item active"> <a href="#urgent_incoming" class="nav-link text-danger" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.urgent_incoming_lab_investigations') }} ({{ count($urgent_incomings) }})</a> </li>
@else
<li role="presentation" class="nav-item active"> <a href="#results_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.incoming_lab_investigations') }} ({{ count($incomings) }})</a> </li>
@endif
</ul>
</div>
<div class="card-block">
<div class="tab-content">
<div id="results_nav_pill" class="tab-pane <?php if(count($urgent_incomings) < 1) echo 'active'; ?>">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>{{ __('investigations.time') }}</th>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.patient_category') }}</th>
<th>{{ __('investigations.source') }}</th>
<th class="text-center">{{ __('investigations.payment') }}</th>
<th class="text-center">{{ __('investigations.actions') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($incomings as $incoming)
<tr>
<td>
{{ streamline_date_time_short($incoming->created_at) }}
</td>
<td>{!! insurance_flag($incoming->patient_id) !!} ({{ get_name($incoming->patient_id, 'id', 'number', 'patients') }})</td>
<td>{{ patient_category($incoming->patient_id) }}</td>
<td>
@if($incoming->inpatient == 1 || $incoming->inpatient_bill_generated == 1)
{{ get_ward_name($incoming->patient_id, $incoming->episode_id) }}
@else
<span style='font-size: x-small'>OPD</span>
@endif
</td>
<td>
@if($incoming->payment_status == 0)
@if($incoming->inpatient_bill_generated == 1)
<font color='green'>{{ __('investigations.inpatient_bill_generated') }}</font>
@else
<font color='red'>{{ __('investigations.not_paid') }}</font>
@endif
@else
<font color='green'>{{ __('investigations.paid') }}</font>
@endif
</td>
@if($incoming->inpatient == 0 && $incoming->inpatient_bill_generated == 0 && $incoming->payment_status == 0 && !can_investigations_be_performed(get_name($incoming->patient_id, 'id', 'category_id', 'patients')))
<td colspan="3" class="text-center">
<code>{{ __('investigations.patient_has_not_paid_for_ordered_investigations') }}</code>
</td>
@else
<td class="text-center">
<a href="#" class="btn btn-success btn-rounded btn-sm" onclick="receive_request({{ $incoming->id }})" disabled>{{ __('investigations.receive_request') }}</a>
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $incoming->patient_id }}" class="btn btn-info btn-rounded btn-sm">{{ __('investigations.select_patient') }}</a>
</td>
<td>
<a href="/investigations/print_request/{{ $incoming->id }}" class="btn btn-rounded btn-sm" style="background-color:#03C03C; color: white"><i class="fa fa-print"></i><span style="margin-left: 10px;">{{ __('investigations.print_request') }}</span></a>
</td>
@endif
</tr>
@endforeach
@if(count($incomings) <= 0)
<tr>
<td colspan="8" class='text-center' style='color: maroon; font-weight: bold;'>{{ __('investigations.no_requests_available') }}</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
@if (count($urgent_incomings)>0)
<div id="urgent_incoming" class="tab-pane active">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>{{ __('investigations.time') }}</th>
<th>{{ __('investigations.patient_names') }}</th>
<th>{{ __('investigations.patient_category') }}</th>
<th>{{ __('investigations.source') }}</th>
<th class="text-center">{{ __('investigations.payment') }}</th>
<th class="text-center">{{ __('investigations.actions') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($urgent_incomings as $urgent_incoming)
<tr>
<td>
{{ streamline_date_time_short($urgent_incoming->created_at) }}
</td>
<td>{!! insurance_flag($urgent_incoming->patient_id) !!} ({{ get_name($urgent_incoming->patient_id, 'id', 'number', 'patients') }})</td>
<td>{{ patient_category($urgent_incoming->patient_id) }}</td>
<td>
@if($urgent_incoming->inpatient == 1 || $urgent_incoming->inpatient_bill_generated == 1)
{{ get_ward_name($urgent_incoming->patient_id, $urgent_incoming->episode_id) }}
@else
<span style='font-size: x-small'>OPD</span>
@endif
</td>
<td>
@if($urgent_incoming->payment_status == 0)
@if($urgent_incoming->inpatient_bill_generated == 1)
<font color='green'>{{ __('investigations.inpatient_bill_generated') }}</font>
@else
<font color='red'>{{ __('investigations.not_paid') }}</font>
@endif
@else
<font color='green'>{{ __('investigations.paid') }}</font>
@endif
</td>
@if($urgent_incoming->inpatient == 0 && $urgent_incoming->inpatient_bill_generated == 0 && $urgent_incoming->payment_status == 0 && !can_investigations_be_performed(get_name($urgent_incoming->patient_id, 'id', 'category_id', 'patients')))
<td colspan="3" class="text-center">
<code>{{ __('investigations.patient_has_not_paid_for_ordered_investigations') }}</code>
</td>
@else
<td class="text-center">
<a href="#" class="btn btn-success btn-rounded btn-sm" onclick="receive_request({{ $urgent_incoming->id }})" disabled>{{ __('investigations.receive_request') }}</a>
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $urgent_incoming->patient_id }}" class="btn btn-info btn-rounded btn-sm">{{ __('investigations.select_patient') }}</a>
</td>
<td>
<a href="/investigations/print_request/{{ $urgent_incoming->id }}" class="btn btn-rounded btn-sm" style="background-color:#03C03C; color: white"><i class="fa fa-print"></i><span style="margin-left: 10px;">{{ __('investigations.print_request') }}</span></a>
</td>
@endif
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endif
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="modal_receive_request" tabindex="-1" role="dialog" aria-labelledby="debt_plan_modal_label" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"><b id="modal_heading"></b></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('modal_patient_number', __('investigations.patient_number')) }}
{{ Form::text('modal_patient_number', '', ['class'=>'form-control', 'readonly', 'id' => 'modal_patient_number']) }}
</div>
<div class="form-group">
{{ Form::label('modal_hospital_unit', __('investigations.hospital_unit')) }}
{{ Form::text('modal_hospital_unit', '', ['class'=>'form-control', 'readonly', 'id' => 'modal_hospital_unit']) }}
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{{ Form::label('modal_patient_age', __('investigations.patient_age')) }}
{{ Form::text('modal_patient_age', '', ['class'=>'form-control', 'readonly', 'id' => 'modal_patient_age']) }}
</div>
<div class="form-group">
{{ Form::label('modal_patient_telephone', __('investigations.patient_telephone')) }}
{{ Form::text('modal_patient_telephone', '', ['class'=>'form-control', 'readonly', 'id' => 'modal_patient_telephone']) }}
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{{ Form::label('modal_received_date', __('investigations.date_received')) }}
{{ Form::text('modal_received_date', date('d/m/Y'), ['class'=>'form-control', 'readonly', 'id'=>'modal_received_date']) }}
</div>
<div class="form-group">
{{ Form::label('modal_lab_number', __('investigations.lab_number')) }}
@if(is_lab_number_editing_enabled())
{{ Form::text('modal_lab_number', '', ['class'=>'form-control', 'id' => 'modal_lab_number']) }}
@else
{{ Form::text('modal_lab_number', '', ['class'=>'form-control', 'id' => 'modal_lab_number', 'readonly']) }}
@endif
{{ Form::hidden('modal_order_id','', ['id' => 'modal_order_id']) }}
</div>
</div>
<div class="col-md-6">
<div class="form-group">
{{ Form::label('modal_patient_gender', __('investigations.patient_gender')) }}
{{ Form::text('modal_patient_gender', '', ['class'=>'form-control', 'readonly', 'id'=>'modal_patient_gender']) }}
</div>
<div class="form-group">
{{ Form::label('modal_requested_by', __('investigations.requested_by')) }}
{{ Form::text('modal_requested_by', '', ['class'=>'form-control', 'readonly', 'id'=>'modal_requested_by']) }}
</div>
</div>
</div>
<br>
<h5 class="text-center">{{ __('investigations.tests_to_take') }}</h5>
<div class="table-responsive" id="modal_tests_table"></div>
<hr>
<div class="row">
<div class="col-md-5">
<div class="form-group" id="modal_specimen_div">
{{ Form::label('modal_specimen', __('investigations.specimen')) }}
{{ Form::select('modal_specimen[]', $specimen, null, ['class' => 'form-control modal_specimen compulsory', 'id' => 'modal_specimen']) }}
</div>
</div>
<div class="col-md-5">
<div class="form-group" id="modal_status_div">
{{ Form::label('modal_status', __('investigations.status')) }}
{{ Form::select('modal_status[]', [0 => __('investigations.select'), 1 => __('investigations.taken'), 2 => __('investigations.not_taken'), 3 => __('investigations.rejected')], null, ['class' => 'form-control modal_status compulsory', 'id' => 'modal_status']) }}
</div>
</div>
<div class="col-md-2">
<br>
<button class="btn btn-info btn-rounded" style="color: white" id="modal_add_specimen_button"><i class="fa fa-plus"></i><span style="margin-left: 10px;"> {{ __('investigations.specimen') }}</span></button>
</div>
</div>
<div class="row">
<div class="col-md-10">
{{ Form::label('modal_reason', __('investigations.reason') . "/" . __('investigations.comment')) }}
{{ Form::textarea('modal_reason[]', '', ['class' => 'form-control modal_reason', 'rows' => 2]) }}
</div>
<div class="col-md-2"></div>
</div>
<hr>
<div id="modal_more_specimen_section"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success btn-rounded waves-effect text-left" onclick="save_receive_request()">{{ __('investigations.save') }}</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/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script>
$('#patient_number').change(function () {
let id = $('#patient_number').val();
$('#patient_id').val(id);
});
$('#patient_number').select2({
placeholder: 'Search by patient details (names and number)',
ajax: {
url: '/patients/search_patient_by_name_number',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.first_name + " " + item.last_name + " (" + item.number + ")",
id: item.id
}
})
};
},
cache: true
}
});
$('#search_date_by').change(function() {
if($(this).val() === "custom_date"){
$("#end_date_div").hide();
$("#start_date_div").show();
} else if($(this).val() === "custom_date_range") {
$("#start_date_div").show();
$("#end_date_div").show();
} else {
$("#end_date_div").hide();
$("#start_date_div").hide();
}
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
function receive_request(orderId) {
$.ajax({
method: 'POST',
url: '/investigations/get_receive_request_details',
data: {'id': orderId},
success: function(response){
let response_array = JSON.parse(response);
$("#modal_tests_table").html(response_array["html"]);
$("#modal_patient_number").val(response_array["patient_number"]);
$("#modal_heading").html("<?php echo __('investigations.receiving_lab_request_for') ?> " + response_array["patient_name"]);
$("#modal_hospital_unit").val(response_array["source"]);
$("#modal_lab_number").val(response_array["lab_number"]);
$("#modal_order_id").val(response_array["order_id"]);
$("#modal_patient_age").val(response_array["patient_age"]);
$("#modal_patient_telephone").val(response_array["telephone_number"]);
$("#modal_requested_by").val(response_array["requested_by"]);
$("#modal_patient_gender").val(response_array["patient_gender"]);
$('#modal_receive_request').modal('show');
}
});
}
$('#modal_add_specimen_button').click( function () {
let html_code = "<div class='row'>" +
"<div class='col-md-5'>" + $('#modal_specimen_div').html() + "</div>" +
"<div class='col-md-5'>" + $('#modal_status_div').html() + "</div>" +
"</div> <br> <div class='row'>" +
"<div class='col-md-10'><label for='modal_reason'>Reason/Comment</label>" +
"<textarea class='form-control modal_reason' rows='2' name='modal_reason[]'></textarea>" +
"</div><div class='col-md-2'></div>" +
"</div> <hr>";
$('#modal_more_specimen_section').append(html_code);
});
function save_receive_request() {
let selectedDate = $('#modal_received_date').val();
let orderID = $('#modal_order_id').val();
let labNumber = $('#modal_lab_number').val();
let specimenArray = [];
let statusArray = [];
let reasonArray = [];
// get the selected specimen
$('.modal_specimen').each(function () {
specimenArray.push(this.value);
});
if (specimenArray.length == 1 && specimenArray[0] == 0){
alert("<?php echo __('investigations.please_select_specimen') ?>");
return;
}
// get the selected status
$('.modal_status').each(function () {
statusArray.push(this.value);
});
// get the added reason
$('.modal_reason').each(function () {
reasonArray.push(this.value.replaceAll(',', ';'));
});
$.ajax({
method: 'POST',
url: '/investigations/save_receive_request_details',
data: {
'id': orderID,
'lab_number': labNumber,
'date': selectedDate,
'specimen': specimenArray,
'status': statusArray,
'reason': reasonArray
},
success: function(response){
if (response == 1) {
alert("Request has been received successfully");
location.reload();
//window.open('/investigations/print_request_barcode/' + orderID, '_blank');
} else {
// alert("Unable to receive the request. Please try again");
alert(response);
}
}
});
}
$('#modal_received_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy'
});
</script>
@endpush
@@ -0,0 +1,240 @@
@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" />
<style>
table td{
border-left: 1px solid #dddddd;
}
th{
white-space: nowrap;
}
</style>
@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">{{ __('investigations.investigations') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="{{ route('investigations.index') }}">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.investigations') }}</li>
</ol>
</div>
</div>
@include('investigations::investigations.menu')
<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>{{ __('investigations.investigation_name') }}</th>
<th>{{ __('investigations.normal_ranges') }}</th>
<th>{{ __('investigations.minimum') }}</th>
<th>{{ __('investigations.sample_container') }}</th>
<th>{{ __('investigations.non_insured_price') }}</th>
<th>{{ __('investigations.comments') }}</th>
<th>{{ __('investigations.lab_time') }}</th>
<th>{{ __('investigations.category') }}</th>
<th>{{ __('investigations.hmis_category_out_patient_number') }}</th>
<th>{{ __('investigations.hmis_category_out_patient') }}</th>
<th>{{ __('investigations.hmis_category_in_patient_number') }}</th>
<th>{{ __('investigations.hmis_category_in_patient') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($investigations as $investigation)
<tr>
<td>
{{ $investigation->name }}
@if(!$investigation->available) ({{ __('investigations.not_available') }}) @endif
</td>
<td>
@if($investigation->range_type == 1)
<a href="#" onclick="view_normal_ranges(<?php echo $investigation->id ?>)">View Reference Ranges</a>
@else
{{ $investigation->normal_ranges }}
@endif
</td>
<td>{{ $investigation->minimum }}</td>
<td>{{ $investigation->sample_container }}</td>
<td>{{ $investigation->non_insured_price }}</td>
<td>{{ $investigation->comments }}</td>
<td>{{ $investigation->lab_time }}</td>
<td>{{ $investigation_categories[$investigation->category] ?? "Not Set" }}</td>
@php
$hmis_no_outpatient_array = explode(",", $investigation->hmis_no_outpatient);
$hmis_outpatient_category_array = explode(",", $investigation->hmis_category);
@endphp
<td>{{ $investigation->hmis_no_outpatient }}</td>
<td>
@if(count($hmis_no_outpatient_array) > 0)
<ul>
@for($i=0; $i < count($hmis_outpatient_category_array); $i++)
<li>{{ $hmis_categories[$hmis_outpatient_category_array[$i]] ?? "" }}</li>
@endfor
</ul>
@endif
</td>
<td>{{ $investigation->hmis_no_inpatient }}</td>
<td>{{ $investigation_categories[$investigation->hmis_category_inpatient] ?? "" }}</td>
<td>
<a href="/investigations/{{ $investigation->id }}/edit/" class="btn btn-info"><i class="fa fa-pencil"></i> {{ __('investigations.edit') }}</a>
</td>
<td>
@if (!in_array($investigation->id, $ordered_investigations_ids))
{{ Form::model($investigation->id ,['method' => 'DELETE', 'route' => ['investigations.destroy', $investigation->id]]) }}
<button type="submit" class="btn btn-danger" onclick="return confirm('Are you sure?')"><i class="fa fa-trash"></i> {{ __('investigations.delete') }}</button>
{{ Form::close() }}
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
{{ $investigations->links() }}
</div>
</div>
</div>
<div class="modal" id="modal_categorized_ranges" tabindex="-1" role="dialog" aria-labelledby="debt_plan_modal_label" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"><b id="categorized_ranges_title"></b></h4>
</div>
<div class="modal-body">
<div class="row">
@php $age_groups = \Streamline\Models\AgeGroup::get(); @endphp
<div class="col-md-6">
<h3>Male</h3>
<br>
@foreach($age_groups as $age)
{{ Form::label('dynamic_range', $age->name) }}
{{ Form::text('dynamic_range', '', ['class' => 'form-control', 'readonly', 'id' => 'dynamic_range_male_' . $age->id]) }}
<br>
@endforeach
</div>
<div class="col-md-6">
<h3>Female</h3>
<br>
@foreach($age_groups as $age)
{{ Form::label('dynamic_range', $age->name) }}
{{ Form::text('dynamic_range', '', ['class' => 'form-control', 'readonly', 'id' => 'dynamic_range_female_' . $age->id]) }}
<br>
@endforeach
</div>
</div>
</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 src="{{ asset('elite/tables/js/buttons.colVis.min.js') }}"></script>
<script type="text/javascript">
function view_normal_ranges(id) {
$.ajax({
method: 'GET',
url: '/investigations/view_investigation_normal_ranges/' + id,
success: function(response){
let responseArray = JSON.parse(response);
$('#categorized_ranges_title').text("Investigation Reference Ranges For " + responseArray["name"]);
let male_result = responseArray["male"];
let female_result = responseArray["female"];
for (var key in male_result) {
if (male_result.hasOwnProperty(key)) {
$("#dynamic_range_male_" + key).val(male_result[key]);
}
}
for (var key1 in female_result) {
if (female_result.hasOwnProperty(key1)) {
$("#dynamic_range_female_" + key1).val(female_result[key1]);
}
}
$('#modal_categorized_ranges').modal('show');
}
});
}
$('.table').DataTable({
dom: 'Bfrtip',
bInfo: false,
bPaginate: false,
buttons: [
'copy',
{extend: 'csv',
message: "<?php echo __('investigations.list_of_investigations') ?>"
},
{extend: 'excel',
message: "<?php echo __('investigations.list_of_investigations') ?>",
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6]
},
sheetName: "<?php echo __('investigations.list_of_investigations') ?>"
},
{extend: 'pdf',
message: "<?php echo __('investigations.list_of_investigations') ?>",
orientation: 'portrait',
pageSize: 'LETTER',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6]
},
customize: function (doc) {
doc.defaultStyle.fontSize = 10;
// doc.styles.tableHeader.alignment = 'left';
}
},
{extend: 'print',
message: "<?php echo __('investigations.list_of_investigations') ?>",
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6]
},
customize: function (win) {
$(win.document.body)
.css('font-size', '10pt')
.css('background', '#fff')
.prepend(
'<img src="<?php echo asset('uploads/logo/logo-sm.png'); ?>" style="position:absolute; top:0; right:0;" />'
);
$(win.document.body).find('table')
.addClass('compact')
.css('font-size', 'inherit');
}
}
]
});
</script>
@endpush
@@ -0,0 +1,444 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet"/>
<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-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('investigations.order_investigations') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.order') }}</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
@if (count($chronic_array) > 0)
<table class='table color-bordered-table success-bordered-table'>
<thead><tr><th colspan="2">Patient's Chronic Investigations</th></tr></thead>
<tbody>
@foreach ($chronic_array as $chronic_inv)
@if(isset($investigations[$chronic_inv->investigation_id]))
<tr>
<td>{{ $investigations[$chronic_inv->investigation_id] }}</td>
<td><button type="button" class="btn btn-sm btn-rounded btn-outline-primary" onclick="add_inv_to_order({{ $chronic_inv->investigation_id }})">Add to current order</button></td>
</tr>
@endif
@endforeach
</tbody>
</table>
<hr>
@endif
{{ Form::open(['route' => 'investigations.submit_ordered_investigations']) }}
@php $patient_insurance_status = patient_insurance_status($patient_id); @endphp
{{ Form::hidden('patient_id', $patient_id, ['id' => 'patient_id']) }}
{{ Form::hidden('episode_id', $episode_id, ['id' => 'episode_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-3'>{{ __('investigations.investigation') }}</div>
<div class='col-2'>{{ __('investigations.lab_comments') }}</div>
<div class='col-3'>{{ __('investigations.order_comments') }}</div>
<div class='col-2' @if(view_investigation_price_on_order()==0) style='display: none' @endif>Cost</div>
<div class='col-1'>{{ __('investigations.urgent') }}</div>
<div class='col-1'></div>
</div>
</th>
</tr>
</thead>
@php
$counter = 0;
$total_selling_price = 0;
@endphp
<tbody class='input_fields_wrap'>
@if(count($ordered_investigations) > 0)
@foreach($ordered_investigations as $ordered_investigation)
{{ Form::hidden('order_id[]', $ordered_investigation->id) }}
@php
$investigations_ids = explode(",", $ordered_investigation->investigation_id);
$urgent_ids_array = explode(",", $ordered_investigation->urgent_ids);
$order_comments_array = explode(",", $ordered_investigation->order_comments);
$eye_array = explode(",", $ordered_investigation->eye);
@endphp
@for($i = 0; $i < count($investigations_ids); $i++)
<tr>
<td>
<div class='row'>
<div class='col-3'>
<div class='form-group'>
<div class='controls'>
{{ Form::select('investigations_id[]', $investigations_to_order, $investigations_ids[$i], ['class' => 'form-control compulsory required investigations_id_class', 'id' => 'investigations_id_' . $counter, 'required']) }}
</div>
<div id='chi_coverage_div_{{ $counter }}'>
@if (is_chi_enabled())
@if (is_patient_item_covered($patient_id, $investigations_ids[$i], 3))
&nbsp;&nbsp;<br><span style="color: darkgreen"><b>Covered by CHI</b></span>
@else
&nbsp;&nbsp;<br><span style="color: darkorange"><b>Not covered by CHI</b></span>
@endif
@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>
<div class='col-2'>
<div style='padding: 3px 3px 3px 4px; color: #C85F6A;' class='well margin-none span12' id='lab_comments_{{ $counter }}'>{{ get_name($investigations_ids[$i], 'id', 'comments', 'investigations') }}</div>
</div>
<div class='col-3'>
<div class='form-group'>
<div class='controls'>
<textarea class='form-control order_comments' name='order_comments[]' id='order_comments_{{ $counter }}' rows='3'>{{ $order_comments_array[$i] }}</textarea>
</div>
</div>
</div>
@php
if($patient_insurance_status == 1) {
$selling_price = get_item_insurance_co_payment($patient_id, $investigations_ids[$i], 3, false, 0);
} else {
// check if the patient category is attached to a price list
$price_list_id = is_patient_category_attached_to_price_list($patient_id);
if ($price_list_id) {
$selling_price = get_price_list_category_price($price_list_id, 2, $investigations_ids[$i]);
} else {
$selling_price = get_name($investigations_ids[$i], 'id', 'non_insured_price', 'investigations');
}
}
$selling_price = $selling_price * ((isset($eye_array[$i]) && $eye_array[$i] == 2) ? 2 : 1);
$total_selling_price += $selling_price;
@endphp
<div class='col-2' @if(view_investigation_price_on_order()==0) style='display: none' @endif>
<div class='form-group'>
<div class='controls'>
<input type='number' name='investigation_cost[]' id='investigation_cost_{{ $counter }}' class='form-control investigation_cost compulsory' readonly value='{{ $selling_price }}'/>
</div>
</div>
</div>
<div class='col-1'>
<input type='checkbox' name='urgent_id[]' id='urgent_id_{{ $counter }}' class='js-switch' data-color='#f96262' data-size='small' value="{{ $investigations_ids[$i] }}" @if(in_array($investigations_ids[$i], $urgent_ids_array)) checked @endif/>
</div>
<div class='col-1'>
<div class='form-group' style='margin-top: 10px;'>
@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' style='color: white; margin-left: 25px;'><i class='fa fa-trash'></i></button>
@endif
</div>
</div>
</div>
</td>
</tr>
@php $counter++; @endphp
@endfor
@endforeach
@else
<tr>
<td>
<div class='row'>
<div class='col-3'>
<div class='form-group'>
<div class='controls'>
<select name='investigations_id[]' id='investigations_id_{{ $counter }}' class='form-control compulsory required investigations_id_class'>@php echo $investigations_select_code; @endphp</select>
</div>
<div id='chi_coverage_div_{{ $counter }}'></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-2'>
<div style='padding: 3px 3px 3px 4px; color: #C85F6A;' class='well margin-none span12' id='lab_comments_{{ $counter }}' ></div>
</div>
<div class='col-3'>
<div class='form-group'>
<div class='controls'>
<textarea class='form-control order_comments' name='order_comments[]' id='order_comments_{{ $counter }}' rows='3'></textarea>
</div>
</div>
</div>
<div class='col-2' @if(view_investigation_price_on_order()==0) style='display: none' @endif>
<div class='form-group'>
<div class='controls'>
<input type='number' name='investigation_cost[]' id='investigation_cost_{{ $counter }}' class='form-control investigation_cost compulsory' readonly/>
</div>
</div>
</div>
<div class='col-1'>
<input type='checkbox' name='urgent_id[]' id='urgent_id_{{ $counter }}' class='js-switch' data-color='#f96262' data-size='small'/>
</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 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 pull-left' style='color: white; margin-left: 25px;'><span>Add row</span></button>
</div>
</div>
</div>
</td>
</tr>
@endif
</table>
</div>
<h3 @if(view_procedure_price_on_order()==0) style='display: none' @endif>Total: <span id="itemGrandTotal"> {{ ugandan_shillings($total_selling_price) }}</span></h3>
<div class="pull-right">
{{ Form::button(__('investigations.submit_requests'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'submit_button','name'=>'submit_button','value'=>'submit_button']) }}
{{ Form::button(__('investigations.print_requests'),['type'=>'submit','class'=>'btn btn-primary waves-effect waves-light m-r-10', 'id'=>'print_request','name'=>'submit_button','value'=>'print_request']) }}
</div>
<br
{{ Form::close() }}
</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 type="text/javascript">
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
$('.js-switch').each(function () {
new Switchery($(this)[0], $(this).data());
});
var max_rows = 500;
var wrapper = $(".input_fields_wrap");
var add_button = $(".add_item");
var show_price_setting = <?php echo view_investigation_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();
add_invs_row();
});
function add_invs_row() {
if (x < max_rows) {
$(wrapper).append("\
<tr>\
<td>\
<div class='row'>\
<div class='col-3'>\
<div class='form-group'>\
<div class='controls'>\
<select name='investigations_id[]' id='investigations_id_" + x + "' class='form-control compulsory required investigations_id_class' required>@php echo $investigations_select_code; @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-2'>\
<div style='padding: 3px 3px 3px 4px; color: #C85F6A;' class='well margin-none span12' id='lab_comments_" + x + "' ></div>\
</div>\
<div class='col-3'>\
<div class='form-group'>\
<div class='controls'>\
<textarea class='form-control order_comments' name='order_comments[]' id='order_comments_" + x + "' rows='3'></textarea>\
</div>\
</div>\
</div>\
<div class='col-2'"+(show_price_setting==0?'style="display:none"':'')+">\
<div class='form-group'>\
<div class='controls'>\
<input type='number' name='investigation_cost[]' id='investigation_cost_" + x + "' class='form-control investigation_cost compulsory' readonly/>\
</div>\
</div>\
</div>\
<div class='col-1'>\
<input type='checkbox' name='urgent_id[]' id='urgent_id_" + x + "' class='js-switch' data-color='#f96262' data-size='small'/>\
</div>\
<div class='col-1'>\
<div class='form-group' style='margin-top: 10px;'>\
<button class='btn btn-sm btn-rounded btn-danger remove_field' style='color: white; margin-left: 25px;'><i class='fa fa-trash'></i></button>\
</div>\
</div>\
</div>\
</td>\
</tr>");
generalSelect2Set('investigations_id_'+x);
new Switchery($('#urgent_id_'+x)[0], $('#urgent_id_'+x).data());
x++;
}
}
$(wrapper).on("click", ".remove_field", function (e) {
e.preventDefault();
$(this).parent('div').parent('div').parent('div').parent('td').parent('tr').remove();
});
$(".investigations_id_class").select2({
width: "100%"
});
function eye_select(value, id) {
// for eye both
if(value == 2) {
let item = $("#investigations_id_" + id).val();
let patient_id = $('#patient_id').val();
$.ajax({
url: '/investigations/get_investigation_details',
data: {'investigation_id':item, 'patient_id':patient_id},
success: function(response){
let arr = JSON.parse(response);
$('#investigation_cost_' + id).val(arr["selling_price"] * 2);
calculateTotal();
}
});
}
}
$(".input_fields_wrap").on('change', ".investigations_id_class", function () {
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
var item = $("#investigations_id_" + id).val();
var patient_id = $('#patient_id').val();
let patient_insurance_status = $('#patient_insurance_status').val();
$.ajax({
url: '/investigations/get_investigation_details',
data: {'investigation_id':item, 'patient_id':patient_id, 'patient_insurance_status': patient_insurance_status},
success: function(response){
let arr = JSON.parse(response);
$('#order_comments_' + id).text(arr["comments"]);
$('#investigation_cost_' + id).val(arr["selling_price"]);
$('#urgent_id_' + id).val(item);
if (arr["covered_by_chi"] !== "") {
$("#chi_coverage_div_" + id).html(arr["covered_by_chi"]).show();
} else {
$("#chi_coverage_div_" + id).hide();
}
calculateTotal();
}
});
});
function calculateTotal() {
//loop through the prices
let auto_price_grand_total = 0;
$(".investigation_cost").each(function(){
auto_price_grand_total += parseInt($(this).val());
});
// recalculate the grand total
$("#itemGrandTotal").html(numberWithCommas(auto_price_grand_total) + " Ugx");
}
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function generalSelect2Set(id) {
$('#'+id).select2({
width: "100%"
});
}
function add_inv_to_order(inv_id) {
add_invs_row();
$('#investigations_id_' + (x - 1)).select2().val(inv_id).trigger('change');
}
</script>
@endpush
@@ -0,0 +1,137 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet"/>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-5">
<h4 class="page-title">{{ __('investigations.obstetric_ultrasound_request_template') }}</h4>
</div>
<div class="col-md-7">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.obstetric_ultrasound') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
<br>
</div>
</div>
<div class="white-box">
<div class="row">
<div class="col-md-5">
{{ Form::open(['route' => 'investigations.submit_ordered_obstetric_investigations']) }}
<div class="form-group">
{{ Form::label('investigations_id', __('investigations.investigation')) }}
{{ Form::select('investigations_id', $investigations, '', ['class' => 'form-control compulsory investigations', 'required']) }}
</div>
<div class="form-group">
{{ Form::label('comment', __('investigations.order_comment')) }}
{{ Form::textArea('comment', '', ['class'=>'form-control', 'rows' => 5]) }}
</div>
{{ Form::button(__('investigations.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'submit_button']) }}
{{ Form::close() }}
</div>
<div class="col-md-7">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.item') }}</th>
<th>{{ __('investigations.value') }}</th>
</tr>
</thead>
<tbody>
@if($anc_details)
<tr>
<td>{{ __('investigations.gravida') }}</td>
<td>{{ $anc_details->gravida }}</td>
</tr>
<tr>
<td>{{ __('investigations.para') }}</td>
<td>{{ $anc_details->para }}</td>
</tr>
<tr>
<td>{{ __('investigations.abortions') }}</td>
<td>{{ $anc_details->abortion }}</td>
</tr>
<tr>
<td colspan="2" class="text-center"><h4><b>{{ __('investigations.this_pregnancy') }}</b></h4></td>
</tr>
<tr>
<td>{{ __('investigations.lmp') }}</td>
<td>
@if($anc_details->lmp == 'N/A')
N/A
@else
{{ streamline_date($anc_details->lmp) }}
@endif
</td>
</tr>
<tr>
<td>{{ __('investigations.accuracy') }}</td>
<td>
@if($anc_details->accuracy == 'N/A')
N/A
@else
{{ get_name($anc_details->accuracy, 'id', 'name', 'ante_natal_clinic_accuracies') }}
@endif
</td>
</tr>
<tr>
<td>{{ __('investigations.edd') }}</td>
<td>
@if($anc_details->edd == 'N/A')
N/A
@else
{{ streamline_date($anc_details->edd) }}
@endif
</td>
</tr>
<tr>
<td>{{ __('investigations.clinic') }}</td>
<td>{{ get_name(get_name($episode_id, 'id', 'clinic_id', 'patient_episodes'), 'id', 'name', 'clinics') }}</td>
</tr>
<tr>
<td>{{ __('investigations.requested_by') }}</td>
<td>{{ get_full_name(Auth::user()->id, 'id', 'first_name', 'last_name', 'users') }}</td>
</tr>
<tr>
<td>{{ __('investigations.phone') }}</td>
<td>{{ get_name(Auth::user()->id, 'id', 'phone', 'users') }}</td>
</tr>
@else
<tr>
<td colspan="2">{{ __('investigations.information_not_available') }}</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script type="text/javascript">
$(".investigations").select2({
width: "100%"
});
</script>
@endpush
@@ -0,0 +1,9 @@
<div class="panel panel-default">
<div class="panel-body">
<a href="/investigations/create" class="btn btn-default ti-plus"> {{ __('investigations.new_investigation') }}</a>
<a href="/investigations/" class="btn btn-default ti-pencil"> {{ __('investigations.active_investigations') }}</a>
<a href="/investigations/edit/all" class="btn btn-default ti-pencil"> {{ __('investigations.bulk_edit') }}</a>
<a href="/investigations/edit/hmis-options" class="btn btn-default ti-pencil"> {{ __('investigations.edit_hmis_options') }}</a>
<a href="/investigations/inactive" class="btn btn-default ti-pencil"> {{ __('investigations.inactive_investigations') }}</a>
</div>
</div>
@@ -0,0 +1,898 @@
@extends('layouts.main')
@push('styles')
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('investigations.ordered') }} {{ $order_type }} {{ __('investigations.investigations') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.incoming') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
</div>
</div>
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
{{ Form::open(['route' => 'investigations.save_ordered_results', 'files' => true, 'enctype'=>'multipart/form-data']) }}
{{-- {{ Form::open(['route' => 'investigations.ordered_results']) }} --}}
{{ Form::hidden('order_id',$order_id) }}
{{ Form::hidden('order_type', $order_type) }}
{{ Form::hidden('patient_id',$patient_id) }}
{{ Form::hidden('episode_id',$episode_id) }}
@php
$right_eye_diagnoses = explode(',',get_name($episode_id, 'episode_id', 'right_eye_diagnosis', 'eye_clinic_main_exam'));
$left_eye_diagnoses = explode(',',get_name($episode_id, 'episode_id', 'left_eye_diagnosis', 'eye_clinic_main_exam'));
$is_eye_module_enabled = is_eye_module_enabled() && is_patient_in_eye_clinic($episode_id);
@endphp
<div class="row">
<div class="col-md-6">
<table class="table table-striped table-bordered">
<thead>
<tr>
<td>
@if($is_eye_module_enabled)
{{ __('patient_episode.left_eye_diagnosis') }}
@else
{{ __('investigations.primary_diagnosis') }}
@endif
</td>
</tr>
</thead>
<tbody>
<tr>
<td>
@if($is_eye_module_enabled)
@if(count($left_eye_diagnoses) > 0)
<ol>
@for($x = 0; $x < count($left_eye_diagnoses); $x++)
<li>{{ isset($left_eye_diagnoses[$x]) ? get_name($left_eye_diagnoses[$x], 'id', 'name', 'diagnoses') : 'N/A' }}</li>
@endfor
</ol>
@else
No Diagnosis
@endif
@else
{{ $primary_diagnosis != 'N/A' ? $primary_diagnosis : '' }}
@endif
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-md-6">
<table class="table table-striped table-bordered">
<thead>
<tr>
<td>
@if($is_eye_module_enabled)
{{ __('patient_episode.right_eye_diagnosis') }}
@else
{{ __('investigations.other_diagnoses') }}
@endif
</td>
</tr>
</thead>
<tbody>
<tr>
<td>
@if($is_eye_module_enabled)
@if(count($right_eye_diagnoses) > 0)
<ol>
@for($x = 0; $x < count($right_eye_diagnoses); $x++)
<li>{{ isset($right_eye_diagnoses[$x]) ? get_name($right_eye_diagnoses[$x], 'id', 'name', 'diagnoses') : 'N/A' }}</li>
@endfor
</ol>
@else
No Diagnosis
@endif
@else
@foreach($other_diagnoses as $value)
<tr>
<td>
{{ $value['other'] != 'N/A' ? $value['other'] : '' }}
</td>
</tr>
@endforeach
@endif
</td>
</tr>
</tbody>
</table>
</div>
</div>
<table class="table color-bordered-table success-bordered-table table-striped table-bordered">
<thead>
<tr>
<th width="10%">{{ __('investigations.investigation') }}</th>
@if($order_type == 'Lab')
<th width="13%">{{ __('investigations.normal_ranges') }}</th>
<th width="10%">{{ __('investigations.units') }}</th>
@endif
<th width="12%">{{ __('investigations.order_comments') }}</th>
<th width="34%">{{ __('investigations.results') }}</th>
<th width="20%">{{ __('investigations.comments') }}</th>
</tr>
</thead>
<tbody>
@foreach($results as $result)
<!-- investigation_specialised_results id to update the table if valid -->
{{ Form::hidden('investigation_specialised_results_id[]', $result['investigation_specialised_results_id']) }}
@if(in_array($result['id'], $investigations_with_specialised_variables))
{{ Form::hidden('id[]',$result['id']) }}
<!-- placeholder values -->
{{ Form::hidden('value[]',"") }}
{{ Form::hidden('comment[]',"") }}
<tr>
<td colspan="6">
@if($result['insured'] == 1)
<span style='color: green;'>{{ $result['name'] }}</span>
@else
<span style='color: orange;'>{{ $result['name'] }}</span>
@endif
</td>
@if ($is_eye_module_enabled && isset($result['eye']))
<hr>
@if ($result['eye'] == '0')
<span class="label label-info">Left Eye</span>
@elseif ($result['eye'] == '1')
<span class="label label-info">Right Eye</span>
@elseif ($result['eye'] == '2')
<span class="label label-info">Both Eyes</span>
@endif
@endif
</tr>
@php
$specialised_variables = \Illuminate\Support\Facades\DB::table('investigation_specialised_variables')->whereNull('deleted_at')->where('investigation_id', $result['id'])->orderBy('ranking','asc')->get();
@endphp
@foreach($specialised_variables as $specialized_variable)
<tr>
<td>
{{ Form::hidden('specialized_id[]', $specialized_variable->id) }}
{{ $specialized_variable->name }}
</td>
@if($order_type == 'Lab')
<td>
@if($specialized_variable->range_type == 1)
{{ get_dynamic_normal_range_specialized($specialized_variable->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients')) }}
@else
{{ $specialized_variable->normal_ranges }}
@endif
</td>
<td>
@if(get_name($specialized_variable->units, 'id', 'name', 'unit_of_measure') != "N/A")
{{ get_name($specialized_variable->units, 'id', 'name', 'unit_of_measure') }}
@endif
</td>
@endif
<td></td>
<td>
{{ Form::textArea('specialized_value[]', (isset($result['value']) && isset($result['value'][$specialized_variable->id])) ? $result['value'][$specialized_variable->id] : '', ['class' => 'form-control compulsory', 'rows'=>'12', 'id' => 'invx_' . $specialized_variable->id]) }}
@if(does_investigation_have_template($specialized_variable->id, 1))
<br>
<button class="btn btn-rounded btn-primary btn-sm" id="select_specialised_results_template{{ $specialized_variable->id }}">{{ __('investigations.add_result_from_template') }}</button>
@endif
<br>
{{ Form::label('lab_result_document', __('investigations.lab_result_document')) }}
{{ Form::file('lab_result_document[]', null, ['id'=>'lab_result_doc_' . $specialized_variable->id]) }}
@if (!empty($result['document']))
<br><a class="label label-info" href="/patient_documents/{{ $result['document'] }}" target="_blank"> {{ $result['title'] }}</a>
@endif
</td>
<td>
{{ Form::textArea('specialized_comment[]', (isset($result['comment']) && isset($result['comment'][$specialized_variable->id])) ? $result['comment'][$specialized_variable->id] : '', ['class' => 'form-control','rows'=>'12']) }}
</td>
</tr>
@endforeach
<tr><td colspan="6"></td></tr>
@else
<tr>
<td>
@if($result['insured'] == 1)
<span style='color: green;'>
{{ $result['name'] }}
</span>
@else
<span style='color: orange;'>
{{ $result['name'] }}
</span>
@endif
@if ($is_eye_module_enabled && isset($result['eye']))
<hr>
@if ($result['eye'] == '0')
<span class="label label-info">Left Eye</span>
@elseif ($result['eye'] == '1')
<span class="label label-info">Right Eye</span>
@elseif ($result['eye'] == '2')
<span class="label label-info">Both Eyes</span>
@endif
@endif
{{ Form::hidden('id[]',$result['id']) }}
</td>
@if($order_type == 'Lab')
<td>
{{ $result['normal_range'] }}
</td>
<td>
@if(get_name($result['units'], 'id', 'name', 'unit_of_measure') != "N/A")
{{ get_name($result['units'], 'id', 'name', 'unit_of_measure') }}
@endif
</td>
@endif
<td>
{{ $result['order_comments'] }}
</td>
<td>
@if($result['slug'] == 'echo')
<div class="row">
<div class="col-md-7">
<button class="fcbtn btn btn-sm btn-info btn-outline btn-1d" data-toggle="modal" data-target="#cardio-echo-modal" type="button">
<span class="btn-label"><i class="fa fa-plus"></i></span>{{ __('investigations.add_results') }}
</button>
</div>
<div class="col-md-4">
<span id="cardio_print_div" @if(!isset($cardioEcho)) style="display: none;" @endif>
<a target="_blank" class="fcbtn btn btn-sm btn-default btn-outline btn-1d" href='{{ url("/investigations/print-cardio-echo/{$patient_id}/{$episode_id}") }}'> <i class="fa fa-print"></i> <span>{{ __('investigations.print') }}</span></a>
</span>
</div>
</div>
{{ Form::hidden('value[]', $result['value'], ['class' => 'form-control compulsory', 'rows'=>'12']) }}
@else
{{ Form::textArea('value[]', $result['value'], ['class' => 'form-control compulsory', 'rows'=>'12', 'id'=>'inv_'.$result['id']]) }}
@if(does_investigation_have_template($result['id'], 0))
<br>
<button class="btn btn-rounded btn-primary btn-sm" id="select_results_template{{ $result['id'] }}">{{ __('investigations.add_result_from_template') }}</button>
@endif
<br>
{{ Form::label('lab_result_document', __('investigations.lab_result_document')) }}
{{ Form::file('lab_result_document[]', null, ['class' => 'form-control', 'id'=>'lab_result_doc_'.$result['id']]) }}
@if (!empty($result['document']))
<br><a class="label label-info" href="/patient_documents/{{ $result['document'] }}" target="_blank"> {{ $result['title'] }}</a>
@endif
@endif
</td>
<td>
@if ($result['slug'] != 'echo')
{{ Form::textArea('comment[]', $result['comment'], ['class' => 'form-control','rows'=>'12']) }}
@else
{{ Form::hidden('comment[]', $result['comment'], ['class' => 'form-control compulsory', 'rows'=>'12']) }}
@endif
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
<hr>
<div class="row">
<div class="col-md-6">
<span style="font-weight: bold;">
{{ __('investigations.investigations_ordered_by') }}
</span>
<br>
<span style="color: green;">
{{ $doctor_name }} [ {{ $doctor_phone }} ]
</span>
</div>
<div class="col-md-6">
<button type="submit" name="submit_results" class="btn btn-info pull-right">{{ __('investigations.update_results') }}</button>
</div>
</div>
{{ Form::close() }}
</div>
</div>
</div>
<div id="result_template_modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="resultTemplateModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h2 class="modal-title" style="margin: auto;" id="resultTemplateModalLabel">{{ __('investigations.select_a_template') }}</h2>
</div>
<input type="hidden" id="selected_investigation">
<div class="modal-body" id="template_view"></div>
<div class="modal-footer">
<button class="btn btn-danger waves-effect text-left" data-dismiss="modal">{{ __('investigations.close') }}</button>
</div>
</div>
</div>
</div>
<!-- MODAL - Content for adding Cardiology ECHO Result -->
<div id="cardio-echo-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h2 class="modal-title" style="margin: auto;" id="myLargeModalLabel">ECHO 2-D &amp; DOPPLER STUDY</h2>
</div>
<form id="cardio-echo-form" method="post" action="javascript:void(0)">
@csrf
{{ Form::hidden('patient_id',$patient_id, ['id' => 'patient_id']) }}
{{ Form::hidden('episode_id',$episode_id, ['id' => 'episode_id']) }}
{{ Form::hidden('cardio_template_selected',0, ['id' => 'cardio_template_selected']) }}
<?php
// Get the previously saved mode measurements for cardio echo
if (isset($cardioEcho)):
$modeMeasurements = unserialize($cardioEcho->mode_measurements);
$dopplerStudy = unserialize($cardioEcho->doppler_study);
$cardioDescriptions = unserialize($cardioEcho->descriptions);
$cardioDescriptionOrder = unserialize($cardioEcho->descriptions_order);
$range = unserialize($cardioEcho->range);
else:
$modeMeasurements = [];
$dopplerStudy = [];
$cardioDescriptions = [];
$cardioDescriptionOrder = [];
$range = [];
endif;
?>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
{{ Form::select('template', $templates, '', ['class' => 'form-control', 'required', 'id' => 'template']) }}
</div>
<div class="col-md-3">
<a class="btn btn-info btn-sm" id="apply_echo_cardio">{{ __('investigations.apply_echo_cardiology_template') }}</a>
</div>
<div class="col-md-3"></div>
</div>
<hr>
<h4>2-D/M-MODE MEASUREMENTS (Centimeters)</h4>
<table class="table table-sm color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>&nbsp;</th>
<th>{{ __('investigations.results') }}</th>
<th>&nbsp;</th>
<th>{{ __('investigations.results') }}</th>
<th>&nbsp;</th>
<th>{{ __('investigations.results') }}</th>
</tr>
</thead>
<tbody>
<tr>
<td>IVS</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="ivs_result" name="ivs_result" class="form-control" value="{{ $modeMeasurements['IVS'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ivs_range" id="ivs_range" class="form-control" value="{{ $range['IVS'] ?? '' }}" placeholder="(0.6 - 1.1)" readonly></span>
</td>
<td style="text-align: center;">AO</td>
<td style="padding: 0px; margin: 0px; padding-bottom: 10px;">
<input type="number" min="0" step="0.001" id="ao_result" name="ao_result"class="form-control" value="{{ $modeMeasurements['AO'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ao_range" id="ao_range" class="form-control" value="{{ $range['AO'] ?? '' }}" placeholder="(2.0 - 4)" readonly></span>
</td>
<td style="text-align: center;">EF (%)</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="ef_result" name="ef_result" class="form-control" value="{{ $modeMeasurements['EF (%)'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ef_range" id="ef_range" class="form-control" value="{{ $range['EF (%)'] ?? '' }}" placeholder="( 55 - 80 )" readonly></span>
</td>
</tr>
<tr>
<td>LVIDd</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="lvidd_result" name="lvidd_result" class="form-control" value="{{ $modeMeasurements['LVIDd'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="lvidd_range" id="lvidd_range" class="form-control" value="{{ $range['LVIDd'] ?? '' }}" placeholder="(3.5 - 5.7)" readonly></span>
</td>
<td style="text-align: center;">LA</td>
<td style="padding: 0px; margin: 0px; padding-bottom: 10px;">
<input type="number" min="0" step="0.001" id="la_result" name="la_result" class="form-control" value="{{ $modeMeasurements['LA'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="la_range" id="la_range" class="form-control" value="{{ $range['LA'] ?? '' }}" placeholder="( 2.0 - 4.0 )" readonly></span>
</td>
<td style="text-align: center;">FS (%)</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="fs_result" name="fs_result" class="form-control" value="{{ $modeMeasurements['FS (%)'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="fs_range" id="fs_range" class="form-control" value="{{ $range['FS (%)'] ?? '' }}" placeholder="( 26 - 55 )" readonly></span>
</td>
</tr>
<tr>
<td>LVIDs</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="lvids_result" name="lvids_result" class="form-control" value="{{ $modeMeasurements['LVIDs'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="lvids_range" id="lvids_range" class="form-control" value="{{ $range['LVIDs'] ?? '' }}" placeholder="(2.5 - 4.0)" readonly></span>
</td>
<td style="text-align: center;">RV</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="rv_result" name="rv_result" class="form-control" value="{{ $modeMeasurements['RV'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="rv_range" id="rv_range" class="form-control" value="{{ $range['RV'] ?? '' }}" placeholder="(2.0 - 4.1)" readonly></span>
</td>
<td style="text-align: center;">TAPSE:</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="tapse_result" name="tapse_result" class="form-control" value="{{ $modeMeasurements['TAPSE'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="tapse_range" id="tapse_range" class="form-control" value="{{ $range['TAPSE'] ?? '' }}" placeholder="(1.6)" readonly></span>
</td>
</tr>
<tr>
<td>LVPW</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="lvpwd_result" name="lvpwd_result" class="form-control" value="{{ $modeMeasurements['LVPWd'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="lvpwd_range" id="lvpwd_range" class="form-control" value="{{ $range['LVPWd'] ?? '' }}" placeholder="( 0.6 - 1.2 )" readonly></span>
</td>
<td style="text-align: center;">RA:</td>
<td style="padding: 0px; margin: 0px;">
<input type="number" min="0" step="0.001" id="ra_result" name="ra_result" class="form-control" value="{{ $modeMeasurements['RA'] ?? '' }}" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="ra_range" id="ra_range" class="form-control" value="{{ $range['RA'] ?? '' }}" placeholder="(16 cm2)" readonly></span>
</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<h4>DOPPLER FINDINGS</h4>
<div class="table-responsive">
<table class="table table-sm color-bordered-table success-bordered-table table-bordered">
<thead>
</thead>
<tbody>
<tr>
<td>Mitral E/A ratio</td>
<td>
<input type="number" min="0" step="0.01" id="mitral_ea_ratio" name="mitral_ea_ratio" value="{{ $dopplerStudy['Mitral EA ratio'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
<td>TR Max. PG (mmHg)</td>
<td>
<input type="number" min="0" step="0.01" id="tr_pg" name ="tr_pg" value="{{ $dopplerStudy['TR PG'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
<span style="font-size: x-small; font-style: italic; font-weight: 600; color: #0070a3; margin: auto;"><input type="text" name="tr_pg_range" id="tr_pg_range" class="form-control" value="{{ $range['TR PG'] ?? '' }}" placeholder="( 15 - 25 )" readonly></span>
</td>
<td>AV mean PG (mmHg)</td>
<td>
<input type="number" min="0" step="0.01" id="av_mean" name ="av_vmean" value="{{ $dopplerStudy['AV Vmean'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
</tr>
<tr>
<td>AV Vel. max (m/s)</td>
<td>
<input type="number" min="0" step="0.01" id="av_vmax" name ="av_vmax" value="{{ $dopplerStudy['AV Vmax'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
<td>RAP (mmHg)</td>
<td>
<input type="number" min="0" step="0.01" id="rap" name="rap" value="{{ $dopplerStudy['RAP'] ?? '' }}" class="form-control" style="border-color: #A9A9A9">
</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<h4>{{ __('investigations.description') }}</h4>
<div class="table-responsive">
<table class="table table-sm color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>
<span data-toggle="tooltip" data-original-title="Organise how you want the items to be printed on a PDF in order from 1 to 10">{{ __('investigations.print_order') }} <i class="fa fa-question"></i></span>
</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 10%">{{ Form::number('left_ventricle_order', $cardioDescriptionOrder['left_ventricle_order'] ?? 1, ['class' => 'form-control description_order', 'id' => 'left_ventricle_order', 'min' => 1, 'max' => 10, 'onfocus' => 'this.oldvalue = this.value']) }}</td>
<td>Left Ventricle</td>
<td>
<textarea name="left_ventricle_description" id="left_ventricle_description" class="form-control" style="border-color: #A9A9A9">{{ $cardioDescriptions['left_ventricle_description'] ?? '' }}</textarea>
</td>
</tr>
<tr>
<td>{{ Form::number('right_ventricle_order', $cardioDescriptionOrder['right_ventricle_order'] ?? 2, ['class' => 'form-control description_order', 'id' => 'right_ventricle_order', 'min' => 1, 'max' => 10, 'onfocus' => 'this.oldvalue = this.value']) }}</td>
<td>Right Ventricle</td>
<td>
<textarea name="right_ventricle_description" id="right_ventricle_description" class="form-control" style="border-color: #A9A9A9">{{ $cardioDescriptions['right_ventricle_description'] ?? '' }}</textarea>
</td>
</tr>
<tr>
<td>{{ Form::number('left_atrium_order', $cardioDescriptionOrder['left_atrium_order'] ?? 3, ['class' => 'form-control description_order', 'id' => 'left_atrium_order', 'min' => 1, 'max' => 10, 'onfocus' => 'this.oldvalue = this.value']) }}</td>
<td>Left Atrium</td>
<td>
<textarea name="left_atrium_description" id="left_atrium_description" class="form-control" style="border-color: #A9A9A9">{{ $cardioDescriptions['left_atrium_description'] ?? '' }}</textarea>
</td>
</tr>
<tr>
<td>{{ Form::number('right_atrium_order', $cardioDescriptionOrder['right_atrium_order'] ?? 4, ['class' => 'form-control description_order', 'id' => 'right_atrium_order', 'min' => 1, 'max' => 10, 'onfocus' => 'this.oldvalue = this.value']) }}</td>
<td>Right Atrium</td>
<td>
<textarea name="right_atrium_description" id="right_atrium_description" class="form-control" style="border-color: #A9A9A9">{{ $cardioDescriptions['right_atrium_description'] ?? '' }}</textarea>
</td>
</tr>
<tr>
<td>{{ Form::number('aortic_valve_order', $cardioDescriptionOrder['aortic_valve_order'] ?? 5, ['class' => 'form-control description_order', 'id' => 'aortic_valve_order', 'min' => 1, 'max' => 10, 'onfocus' => 'this.oldvalue = this.value']) }}</td>
<td>Aortic Valve</td>
<td>
<textarea name="aortic_valve_description" id="aortic_valve_description" class="form-control" style="border-color: #A9A9A9">{{ $cardioDescriptions['aortic_valve_description'] ?? '' }}</textarea>
</td>
</tr>
<tr>
<td>{{ Form::number('mitral_valve_order', $cardioDescriptionOrder['mitral_valve_order'] ?? 6, ['class' => 'form-control description_order', 'id' => 'mitral_valve_order', 'min' => 1, 'max' => 10, 'onfocus' => 'this.oldvalue = this.value']) }}</td>
<td>Mitral Valve</td>
<td>
<textarea name="mitral_valve_description" id="mitral_valve_description" class="form-control" style="border-color: #A9A9A9">{{ $cardioDescriptions['mitral_valve_description'] ?? '' }}</textarea>
</td>
</tr>
<tr>
<td>{{ Form::number('pulmonary_valve_order', $cardioDescriptionOrder['pulmonary_valve_order'] ?? 7, ['class' => 'form-control description_order', 'id' => 'pulmonary_valve_order', 'min' => 1, 'max' => 10, 'onfocus' => 'this.oldvalue = this.value']) }}</td>
<td>Pulmonary Valve</td>
<td>
<textarea name="pulmonary_valve_description" id="pulmonary_valve_description" class="form-control" style="border-color: #A9A9A9">{{ $cardioDescriptions['pulmonary_valve_description'] ?? '' }}</textarea>
</td>
</tr>
<tr>
<td>{{ Form::number('tricuspid_valve_order', $cardioDescriptionOrder['tricuspid_valve_order'] ?? 8, ['class' => 'form-control description_order', 'id' => 'tricuspid_valve_order', 'min' => 1, 'max' => 10, 'onfocus' => 'this.oldvalue = this.value']) }}</td>
<td>Tricuspid Valve</td>
<td>
<textarea name="tricuspid_valve_description" id="tricuspid_valve_description" class="form-control" style="border-color: #A9A9A9">{{ $cardioDescriptions['tricuspid_valve_description'] ?? '' }}</textarea>
</td>
</tr>
<tr>
<td>{{ Form::number('aortic_root_and_arch_order', $cardioDescriptionOrder['aortic_root_and_arch_order'] ?? 9, ['class' => 'form-control description_order', 'id' => 'aortic_root_and_arch_order', 'min' => 1, 'max' => 10, 'onfocus' => 'this.oldvalue = this.value']) }}</td>
<td>Aortic root and arch</td>
<td>
<textarea name="aortic_root_and_arch_description" id="aortic_root_and_arch_description" class="form-control" style="border-color: #A9A9A9">{{ $cardioDescriptions['aortic_root_and_arch_description'] ?? '' }}</textarea>
</td>
</tr>
<tr>
<td>{{ Form::number('pericardium_order', $cardioDescriptionOrder['pericardium_order'] ?? 10, ['class' => 'form-control description_order', 'id' => 'pericardium_order', 'min' => 1, 'max' => 10, 'onfocus' => 'this.oldvalue = this.value']) }}</td>
<td>Pericardium</td>
<td>
<textarea name="pericardium_description" id="pericardium_description" class="form-control" style="border-color: #A9A9A9">{{ $cardioDescriptions['pericardium_description'] ?? '' }}</textarea>
</td>
</tr>
</tbody>
</table>
</div>
<hr>
<label class="control-label">{{ __('investigations.conclusion') }}</label>
<textarea id="cardio_echo_conclusion" name="cardio_echo_conclusion" rows="5" class="form-control">{{ $cardioEcho->conclusion ?? '' }}</textarea>
</div>
<div class="modal-footer">
<button class="btn btn-danger waves-effect text-left" data-dismiss="modal">{{ __('investigations.close') }}</button>
<button type="submit" id="submit-echo-results" class="btn btn-success waves-effect text-left">{{ __('investigations.submit_results') }}</button>
</div>
</form>
</div>
</div>
</div>
<!-- modal to flash successful submission of cardio-echo results -->
<div class="modal fade" id="flashEchoSubmissionSuccess" tabindex="-1" role="dialog">
<div class="modal-dialog vertical-align-center modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="row">
<div class="col-sm-12">
{{ __('investigations.successful_submission_of_echo_results') }}
</div>
</div>
<div class="row">
<div class="col-sm-4"></div>
<div class="col-sm-4">
<button class="btn btn-success waves-effect text-left" data-dismiss="modal">{{ __('investigations.ok') }}</button>
</div>
<div class="col-sm-4"></div>
</div>
</div>
</div>
</div>
</div>
<!-- end of modal for flash successful submission of echo results -->
@endsection
@push('scripts')
<script type="text/javascript">
$("[id^='select_results_template']").click(function (e) {
e.preventDefault();
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
add_templates(id, 0);
$('#result_template_modal').modal('show');
$('#selected_investigation').val(id);
});
$("[id^='select_specialised_results_template']").click(function (e) {
e.preventDefault();
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
add_templates(id, 1);
$('#result_template_modal').modal('show');
$('#selected_investigation').val(0 + "-" + id);
});
function add_templates(id, is_variable) {
$.ajax({
method: 'GET',
url: '/result_templates/get_templates_for_investigation/' + id + '/' + is_variable,
success: function(response){
$('#template_view').html(response);
}
});
}
function confirm_selection(id){
let input_field_id = $('#selected_investigation').val();
if(input_field_id[0] == 0) {
let split_text = input_field_id.split("-");
$('#invx_'+split_text[1]).val($('#template_'+id).text());
} else {
$('#inv_'+input_field_id).val($('#template_'+id).text());
}
$('#result_template_modal').modal('hide');
}
$('#apply_echo_cardio').click(function () {
var template_id = parseInt($('#template').val());
if (!isNaN(template_id) && template_id != 0) {
$.ajax({
type: "get",
url: '/fetch_cardio_echo_template/' + template_id,
cache: false,
success: function (result) {
var result_array = JSON.parse(result);
$('#cardio_template_selected').val(template_id);
$('#lad_result').val(result_array['LAD']);
$('#ivs_result').val(result_array['IVS']);
$('#fs_result').val(result_array['FS (%)']);
$('#ao_result').val(result_array['AO']);
$('#lvidd_result').val(result_array['LVIDd']);
$('#ef_result').val(result_array['EF (%)']);
$('#la_result').val(result_array['LA']);
$('#lvpwd_result').val(result_array['LVPWd']);
$('#ea_result').val(result_array['E:A']);
$('#rvidd_result').val(result_array['RVIDd']);
$('#sv_result').val(result_array['SV']);
$('#tapse_result').val(result_array['TAPSE']);
$('#lvids_result').val(result_array['LVIDs']);
$('#ra_result').val(result_array['RA']);
$('#rv_result').val(result_array['RV']);
$('#av_vmax').val(result_array['AV Vmax']);
$('#av_mean').val(result_array['AV Vmean']);
$('#mitral_ea_ratio').val(result_array['Mitral EA ratio']);
$('#tr_pg').val(result_array['TR PG']);
$('#rap').val(result_array['RAP']);
$('#mitral_valve_insufficiency').val(result_array['Mitral Valve I']);
$('#mitral_valve_stenosis').val(result_array['Mitral Valve S']);
$('#aortic_valve_insufficiency').val(result_array['Aortic Valve I']);
$('#aortic_valve_stenosis').val(result_array['Aortic Valve S']);
$('#pulmonary_valve_insufficiency').val(result_array['Pulmonary Valve I']);
$('#pulmonary_valve_stenosis').val(result_array['Pulmonary Valve S']);
$('#tricuspid_valve_insufficiency').val(result_array['Tricuspid Valve I']);
$('#tricuspid_valve_stenosis').val(result_array['Tricuspid Valve S']);
$('#left_ventricle_description').val(result_array['left_ventricle_description']);
$('#right_ventricle_description').val(result_array['right_ventricle_description']);
$('#right_atrium_description').val(result_array['right_atrium_description']);
$('#left_atrium_description').val(result_array['left_atrium_description']);
$('#aortic_valve_description').val(result_array['aortic_valve_description']);
$('#mitral_valve_description').val(result_array['mitral_valve_description']);
$('#pulmonary_valve_description').val(result_array['pulmonary_valve_description']);
$('#tricuspid_valve_description').val(result_array['tricuspid_valve_description']);
$('#aortic_root_and_arch_description').val(result_array['aortic_root_and_arch_description']);
$('#pericardium_description').val(result_array['pericardium_description']);
$('#cardio_echo_conclusion').val(result_array['conclusion']);
$('#lad_range').val(result_array['range_LAD']);
$('#ivs_range').val(result_array['range_IVS']);
$('#fs_range').val(result_array['range_FS (%)']);
$('#ao_range').val(result_array['range_AO']);
$('#lvidd_range').val(result_array['range_LVIDd']);
$('#ef_range').val(result_array['range_EF (%)']);
$('#la_range').val(result_array['range_LA']);
$('#lvpwd_range').val(result_array['range_LVPWd']);
$('#ea_range').val(result_array['range_E:A']);
$('#rvidd_range').val(result_array['range_RVIDd']);
$('#sv_range').val(result_array['range_SV']);
$('#tapse_range').val(result_array['range_TAPSE']);
$('#lvids_range').val(result_array['range_LVIDs']);
$('#ra_range').val(result_array['range_RA']);
$('#rv_range').val(result_array['range_RV']);
$('#tr_pg_range').val(result_array['range_TR PG']);
}
});
} else {
alert("Please select an echo cardiology template");
}
});
$('#submit-echo-results').click(function () {
var patient_id = $('#patient_id').val();
var episode_id = $('#episode_id').val();
var cardio_template_selected = $('#cardio_template_selected').val();
var lad_result = $('#lad_result').val();
var ivs_result = $('#ivs_result').val();
var fs_result = $('#fs_result').val();
var ao_result = $('#ao_result').val();
var lvidd_result = $('#lvidd_result').val();
var ef_result = $('#ef_result').val();
var la_result = $('#la_result').val();
var lvpwd_result = $('#lvpwd_result').val();
var ea_result = $('#ea_result').val();
var rvidd_result = $('#rvidd_result').val();
var sv_result = $('#sv_result').val();
var tapse_result = $('#tapse_result').val();
var lvids_result = $('#lvids_result').val();
var ra_result = $('#ra_result').val();
var rv_result = $('#rv_result').val();
var av_vmax = $('#av_vmax').val();
var av_mean = $('#av_mean').val();
var mitral_ea_ratio = $('#mitral_ea_ratio').val();
var tr_pg = $('#tr_pg').val();
var rap = $('#rap').val();
var mitral_valve_insufficiency = $('#mitral_valve_insufficiency').val();
var mitral_valve_stenosis = $('#mitral_valve_stenosis').val();
var aortic_valve_insufficiency = $('#aortic_valve_insufficiency').val();
var aortic_valve_stenosis = $('#aortic_valve_stenosis').val();
var pulmonary_valve_insufficiency = $('#pulmonary_valve_insufficiency').val();
var pulmonary_valve_stenosis = $('#pulmonary_valve_stenosis').val();
var tricuspid_valve_insufficiency = $('#tricuspid_valve_insufficiency').val();
var tricuspid_valve_stenosis = $('#tricuspid_valve_stenosis').val();
var cardio_echo_comments = $('#cardio_echo_comments').val();
var cardio_echo_conclusion = $('#cardio_echo_conclusion').val();
var left_ventricle_description = $('#left_ventricle_description').val();
var right_ventricle_description = $('#right_ventricle_description').val();
var right_atrium_description = $('#right_atrium_description').val();
var left_atrium_description = $('#left_atrium_description').val();
var aortic_valve_description = $('#aortic_valve_description').val();
var mitral_valve_description = $('#mitral_valve_description').val();
var pulmonary_valve_description = $('#pulmonary_valve_description').val();
var tricuspid_valve_description = $('#tricuspid_valve_description').val();
var aortic_root_and_arch_description = $('#aortic_root_and_arch_description').val();
var pericardium_description = $('#pericardium_description').val();
var left_ventricle_order = $('#left_ventricle_order').val();
var right_ventricle_order = $('#right_ventricle_order').val();
var right_atrium_order = $('#right_atrium_order').val();
var left_atrium_order = $('#left_atrium_order').val();
var aortic_valve_order = $('#aortic_valve_order').val();
var mitral_valve_order = $('#mitral_valve_order').val();
var pulmonary_valve_order = $('#pulmonary_valve_order').val();
var tricuspid_valve_order = $('#tricuspid_valve_order').val();
var aortic_root_and_arch_order = $('#aortic_root_and_arch_order').val();
var pericardium_order = $('#pericardium_order').val();
let data = {
'patient_id' : patient_id,
'episode_id' : episode_id,
'cardio_template_selected' : cardio_template_selected,
'lad_result' : lad_result,
'ivs_result' : ivs_result,
'fs_result' : fs_result,
'ao_result': ao_result,
'lvidd_result' : lvidd_result,
'ef_result' : ef_result,
'la_result' : la_result,
'lvpwd_result' : lvpwd_result,
'ea_result' : ea_result,
'rvidd_result': rvidd_result,
'sv_result': sv_result,
'tapse_result': tapse_result,
'lvids_result': lvids_result,
'ra_result': ra_result,
'rv_result': rv_result,
'av_vmax': av_vmax,
'av_mean': av_mean,
'mitral_ea_ratio': mitral_ea_ratio,
'tr_pg': tr_pg,
'rap': rap,
'mitral_valve_insufficiency': mitral_valve_insufficiency,
'mitral_valve_stenosis': mitral_valve_stenosis,
'aortic_valve_insufficiency': aortic_valve_insufficiency,
'aortic_valve_stenosis': aortic_valve_stenosis,
'pulmonary_valve_insufficiency': pulmonary_valve_insufficiency,
'pulmonary_valve_stenosis': pulmonary_valve_stenosis,
'tricuspid_valve_insufficiency': tricuspid_valve_insufficiency,
'tricuspid_valve_stenosis': tricuspid_valve_stenosis,
'left_ventricle_description': left_ventricle_description,
'right_ventricle_description': right_ventricle_description,
'right_atrium_description': right_atrium_description,
'left_atrium_description': left_atrium_description,
'aortic_valve_description': aortic_valve_description,
'mitral_valve_description': mitral_valve_description,
'pulmonary_valve_description': pulmonary_valve_description,
'tricuspid_valve_description': tricuspid_valve_description,
'aortic_root_and_arch_description': aortic_root_and_arch_description,
'pericardium_description': pericardium_description,
'left_ventricle_order': left_ventricle_order,
'right_ventricle_order': right_ventricle_order,
'right_atrium_order': right_atrium_order,
'left_atrium_order': left_atrium_order,
'aortic_valve_order': aortic_valve_order,
'mitral_valve_order': mitral_valve_order,
'pulmonary_valve_order': pulmonary_valve_order,
'tricuspid_valve_order': tricuspid_valve_order,
'aortic_root_and_arch_order': aortic_root_and_arch_order,
'pericardium_order': pericardium_order,
'cardio_echo_comments': cardio_echo_comments,
'cardio_echo_conclusion': cardio_echo_conclusion,
};
console.log(JSON.stringify(data));
$.ajax({
type: "post",
url: '/investigations/store-cardio-echo',
data: data,
cache: false,
success: function (result) {
console.log(JSON.stringify(result));
$("#cardio-echo-modal").modal("hide");
$("#flashEchoSubmissionSuccess").modal("show");
$("#cardio_print_div").show();
}
});
});
$('.description_order').on('focusout', function() {
let exclude_id = this.id;
let value = +this.value;
let oldvalue = +this.oldvalue;
$('.description_order').each(function () {
if (this.id !== exclude_id) {
if (oldvalue <= +this.value && value >= +this.value) {
this.value--;
} else if (oldvalue >= +this.value && value <= +this.value) {
this.value++;
}
}
});
});
</script>
@endpush
@@ -0,0 +1,110 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
<title>{{ config('app.name', 'Inpatient Bill - Stre@mline') }}</title>
<!-- Bootstrap Core CSS -->
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<style>
body{
/*font-size: 1.2em;*/
}
thead {
/*display: table-header-group;*/
}
tfoot {
/*display: table-row-group;*/
}
tr {
page-break-inside: avoid;
}
</style>
</head>
<body>
<div class="container-fluid">
@include('layouts.header_pdf_print')
<h5 class="heading" style="text-align: center;">{{ __('investigations.lab_result_details') }}</h5>
<div class="row">
<table class="table table-light table-sm table-borderless">
<tr>
<th>{{ __('investigations.patient_number') }}</th>
<td>{{ $patient->number}}</td>
<th>{{ __('investigations.patient_category') }}</th>
<td>{{ get_name($patient->category_id, 'id', 'name', 'patient_categories') }}</td>
</tr>
<tr>
<th scope="row">{{ __('investigations.patient_names') }}</th>
<td>{{ $patient->first_name}} {{ $patient->last_name}}</td>
<th>{{ __('investigations.residence') }}</th>
<td>{{ patient_residence($patient_id) }}</td>
</tr>
<tr>
<th scope="row">{{ __('investigations.age') }}</th>
<td>
<?php echo \Carbon\Carbon::parse($patient->date_of_birth)->age; ?> {{ __('investigations.years') }}
</td>
<th></th>
<td></td>
</tr>
<tr>
<th scope="row">{{ __('investigations.gender') }}</th>
<td>
@if($patient->gender == 1)
{{ __('investigations.male') }}
@else
{{ __('investigations.female') }}
@endif
</td>
<th>{{ __('investigations.printed_on') }}</th>
<td> <?php echo streamline_date(date('d-m-Y')); ?></td>
</tr>
</table>
</div>
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr>
<th>{{ __('investigations.investigation') }}</th>
@foreach($dates as $date)
<th>{{ $date }}</th>
@endforeach
</tr>
</thead>
<tbody>
@for($i = 0; $i < count($invs_array); $i++)
<tr>
<td>{{ get_name($invs_array[$i], 'id', 'name', 'investigations') }}</td>
@foreach($values[$i] as $value)
<td>
@if(get_name($invs_array[$i], 'id', 'type', 'investigations') == 1)
<i style="color: blue"> {{ __('investigations.refer_to_investigation_report') }} </i>
@else
@if(!is_array($value) && !is_numeric($value))
{{ $value }}
@endif
@endif
</td>
@endforeach
</tr>
@endfor
</tbody>
</table>
</div>
</body>
</html>
@@ -0,0 +1,291 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
<title>{{ config('app.name', 'Inpatient Bill - Stre@mline') }}</title>
<!-- Bootstrap Core CSS -->
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<style>
body{
font-size: 0.8em;
}
/*thead, tfoot { display: table-row-group }*/
thead {
display: table-header-group;
}
tfoot {
display: table-row-group;
}
tr {
page-break-before: always;
page-break-after: always;
page-break-inside: avoid !important;
}
</style>
</head>
<body>
<div class="container-fluid">
@include('layouts.header_pdf_print')
<h5 class="heading" style="text-align: center;">{{ __('investigations.lab_result_details') }}</h5>
<div class="row">
<table class="table table-light table-sm table-borderless">
<tr>
<th scope="row">{{ __('investigations.patient_number') }}</th>
<td>{{ $patient->number}}</td>
<th>{{ __('investigations.lab_number') }}</th>
<td>
{{ $ordered_investigation->lab_number ?? $ordered_investigation->id }}
</td>
</tr>
<tr>
<th scope="row">{{ __('investigations.patient_names') }}</th>
<td>{{ ucwords($patient->first_name) }} {{ ucwords($patient->last_name) }}</td>
<th>{{ __('investigations.hospital_unit') }}</th>
<td>
@if($ordered_investigation->inpatient == 1)
{{ get_ward_name($ordered_investigation->patient_id, $ordered_investigation->episode_id) }}
@else
OPD
@endif
</td>
</tr>
<tr>
<th scope="row">{{ __('investigations.age') }}</th>
<td>
@php $dob = get_name($ordered_investigation->patient_id, 'id', 'date_of_birth', 'patients'); @endphp
{{ get_patients_age($dob, $ordered_investigation->created_at) }}
</td>
<th>{{ __('investigations.requested') }}</th>
<td>{{ streamline_date_time($ordered_investigation->created_at) }}</td>
</tr>
<tr>
<th scope="row">{{ __('investigations.gender') }}</th>
<td>
{{ get_name($ordered_investigation->patient_id, 'id', 'gender', 'patients') == 1 ? "Male" : "Female" }}
</td>
<th>{{ __('investigations.received') }}</th>
<td>{{ streamline_date_time($ordered_investigation->request_received_date) }}</td>
</tr>
@php
$invs_results = DB::table('investigation_results')->where('investigation_id', $ordered_investigation->investigation_id)
->where('patient_id', $ordered_investigation->patient_id)
->where('episode_id', $ordered_investigation->episode_id)
->first();
$user_id = $invs_results ? $invs_results->created_by : $ordered_investigation->request_received_by;
$performed_at = $invs_results ? streamline_date_time($invs_results->created_at) : "N/A";
@endphp
<tr>
<th scope="row">{{ __('investigations.patient_category') }}</th>
<td>
{{ get_name($patient->category_id, 'id', 'name', 'patient_categories') }}
</td>
<th>{{ __('investigations.performed_at') }}</th>
<td>{{ $performed_at }}</td>
</tr>
<tr>
<th scope="row">{{ __('investigations.residence') }}</th>
<td>{{ patient_residence($patient->id) }}</td>
<th>{{ __('investigations.doctor') }}</th>
<td>
@php
$created_by = Streamline\Models\User::find($ordered_investigation->created_by);
if ($ordered_investigation->ordered_by) {
$ordered_by_name = $ordered_investigation->ordered_by;
} elseif ($created_by && $created_by->hasRole('Doctors')) {
$ordered_by_name = get_full_name($ordered_investigation->created_by, 'id', 'first_name', 'last_name', 'users');
} else {
$ordered_by_name = __('investigations.self_request');
}
@endphp
{{ $ordered_by_name }}
{{--{{ getDNS1DBarcodePNG($ordered_investigation->id) }}
&nbsp;<span>{{ sprintf("%04u", $ordered_investigation->id) }}</span>--}}
</td>
</tr>
</table>
</div>
<div class="row">
<div class="col-6">
<table class='table table-sm'>
<thead class="thead-light">
<tr>
<th>{{ __('investigations.tests') }}</th>
</tr>
</thead>
<tbody>
@foreach($investigation_ids as $record)
<tr>
<td>{{ get_name($record, 'id', 'name', 'investigations') }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="col-6">
<table class='table table-sm'>
<thead class="thead-light">
<tr>
<th>{{ __('investigations.specimens') }}</th>
<th></th>
</tr>
</thead>
@php
$records = explode(",", $ordered_investigation->specimen);
$status_array = explode(",", $ordered_investigation->specimen_status);
@endphp
@for($i = 0; $i < count($records); $i++)
<tr>
<td>{{ get_name($records[$i], 'id', 'name', 'laboratory_specimens') }}</td>
<td>
@if ($status_array[$i] == 1)
<font color='green'>{{ __('investigations.taken') }}</font>
@elseif ($status_array[$i] == 2)
<font color='orange'>{{ __('investigations.not_taken') }}</font>
@elseif ($status_array[$i] == 3)
<font color='#ff4500'>{{ __('investigations.rejected') }}</font>
@endif
</td>
</tr>
@endfor
</tbody>
</table>
</div>
</div>
<div class="row-fluid">
<div class="col-auto">
<hr>
</div>
</div>
<div class="row">
<div class="col">
<h6>{{ __('investigations.test_results') }}</h6>
<table class='table table-sm'>
<thead class="thead-light">
<tr>
<th>{{ __('investigations.investigation_name') }}</th>
<th>{{ __('investigations.results') }}</th>
<th>{{ __('investigations.normal_ranges') }}</th>
<th>{{ __('investigations.unit') }}</th>
<th>{{ __('investigations.comment') }}</th>
</tr>
</thead>
<tbody>
@foreach($results as $result)
@if($result['type'] == 0)
<tr>
<td><b>{{ $result['name'] }}</b></td>
<td>{!! nl2br(e($result['result'])) !!}</td>
<td>{{ $result['range'] }}</td>
<td>
@if(get_name($result['units'], 'id', 'name', 'unit_of_measure') != "N/A")
{{ get_name($result['units'], 'id', 'name', 'unit_of_measure') }}
@endif
</td>
<td>{!! nl2br(e($result['comment'])) !!}</td>
</tr>
@elseif($result['type'] == 1)
<tr>
<td colspan="6"></td>
</tr>
<tr>
<td colspan="5"><b>{{ $result['name'] }}</b></td>
</tr>
@php
$specialised_results = \Streamline\Models\InvestigationSpecialisedResult::where('id', $result['result'])->first();
if($specialised_results){
$variable_id_array = explode(',', $specialised_results->specialised_variable_id);
$variable_value_array = explode(',', $specialised_results->value);
$variable_comment_array = explode(',', $specialised_results->comment);
}
@endphp
@if($specialised_results)
@for($i = 0; $i < count($variable_id_array); $i++)
<tr>
<td>{{ get_name($variable_id_array[$i], 'id', 'name', 'investigation_specialised_variables') }}</td>
<td>{!! nl2br(e($variable_value_array[$i])) !!}</td>
<td>
@if(get_name($variable_id_array[$i], 'id', 'range_type', 'investigation_specialised_variables') == 1)
{{ get_dynamic_normal_range_specialized($variable_id_array[$i], get_patient_age_group($patient->id), get_name($patient->id, 'id', 'gender', 'patients')) }}
@else
{{ get_name($variable_id_array[$i], 'id', 'normal_ranges', 'investigation_specialised_variables') }}
@endif
</td>
<td>
@if(get_name(get_name($variable_id_array[$i], 'id', 'units', 'investigation_specialised_variables'), 'id', 'name', 'unit_of_measure') != "N/A")
{{ get_name(get_name($variable_id_array[$i], 'id', 'units', 'investigation_specialised_variables'), 'id', 'name', 'unit_of_measure') }}
@endif
</td>
<td>{!! nl2br(e($variable_comment_array[$i])) !!}</td>
</tr>
@endfor
@endif
@endif
@endforeach
@if(count($results) < 1)
<tr><td colspan="5" class="text-center"><p><code>{{ __('investigations.no_results_available') }}</code></p></td></tr>
@endif
</tbody>
</table>
<br>
@php
$counter=0; $auth='';
if(!empty($results)) {
foreach($results as $result) if ($result['authenticated'] == '1') $counter++;
if($counter == count($results)) $auth='1';
}
@endphp
@if (is_add_lab_stamp_feature_enabled() && !empty($hospitalInfo->lab_stamp) && $auth =='1')
<table class="table table-borderless">
<tbody>
<tr>
<td>
<h6>{{ __('investigations.performed_by') }} :
<span @if (Auth::user()->can('hide-performed-by-on-lab-results-print-out')) style="display: none;" @endif><b>{{ get_full_name($user_id, 'id', 'first_name', 'last_name', 'users') }}</b></span>
</h6>
</td>
<td>
<h6>{{ __('investigations.verified_by') }} : <span>............................................................</span></h6>
<img style="max-width: 300px; max-height: 140px;" src="{{ asset($hospitalInfo->lab_stamp) }}" class="img-fluid mx-auto d-block mx-3" alt="{{ $hospitalInfo->name}} stamp">
</td>
</tr>
</tbody>
</table>
@else
<div class="row">
<div class="col-6">
<h6>
{{ __('investigations.performed_by') }} :
<span @if (Auth::user()->can('hide-performed-by-on-lab-results-print-out')) style="display: none;" @endif><b>{{ get_full_name($user_id, 'id', 'first_name', 'last_name', 'users') }}</b></span>
</h6>
</div>
<div class="col-6">
<h6>{{ __('investigations.verified_by') }} : <span>............................................................</span></h6>
</div>
</div>
@endif
</div>
</div>
</div>
</body>
</html>
@@ -0,0 +1,122 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
<title>{{ config('app.name', 'Stre@mline') }}</title>
<!-- Bootstrap Core CSS -->
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<style>
thead {
display: table-header-group;
}
tfoot {
display: table-row-group;
}
tr {
page-break-before: always;
page-break-after: always;
page-break-inside: avoid !important;
}
</style>
</head>
<body>
<div class="container-fluid">
@include('layouts.header_pdf_print')
<h5 class="heading" style="text-align: center;">{{ __('investigations.investigation_results') }}</h5>
<table class="table table-light table-sm table-borderless">
<tr>
<th>{{ __('investigations.patient_number') }}</th>
<td>{{ $patient->number}}</td>
<th>{{ __('investigations.patient_category') }}</th>
<td>{{ get_name($patient->category_id, 'id', 'name', 'patient_categories') }}</td>
</tr>
<tr>
<th>{{ __('investigations.patient_names') }}</th>
<td>{{ $patient->first_name}} {{ $patient->last_name}}</td>
<th>{{ __('investigations.gender') }}</th>
<td>
@if($patient->gender == 1)
{{ __('investigations.male') }}
@else
{{ __('investigations.female') }}
@endif
({{ get_patients_age($patient->date_of_birth, $created_at) }})
</td>
</tr>
<tr>
<th>{{ __('investigations.requested') }}</th>
<td>{{ $requested_at }}</td>
<th>{{ __('investigations.performed_at') }}</th>
<td>{{ $performed_at }}</td>
</tr>
</table>
<br>
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr>
<th style="width: 20%">{{ __('investigations.investigation_name') }}</th>
<th style="width: 60%">{{ __('investigations.results') }}</th>
<th style="width: 20%">{{ __('investigations.comments') }}</th>
</tr>
</thead>
<tbody>
@foreach($inv['data'] as $value)
@if($value['type'] == 0)
<tr>
<td>{{ $value['name'] }}</td>
<td>{!! nl2br(e($value['result'])) !!}</td>
<td>{!! nl2br(e($value['comment'])) !!}</td>
</tr>
@else
<tr>
<td colspan="3">{{ $value['name'] }}</td>
</tr>
@php
$specialised_results = \Streamline\Models\InvestigationSpecialisedResult::where('id', $value['result'])->first();
if (!$specialised_results) {
continue;
}
$variable_id_array = explode(',', $specialised_results->specialised_variable_id);
$variable_value_array = explode(',', $specialised_results->value);
$variable_comment_array = explode(',', $specialised_results->comment);
@endphp
@for($i = 0; $i < count($variable_id_array); $i++)
<tr>
<td>{{ get_name($variable_id_array[$i], 'id', 'name', 'investigation_specialised_variables') }}</td>
<td>{{ $variable_value_array[$i] }}</td>
<td>{{ $variable_comment_array[$i] }}</td>
</tr>
@endfor
<tr><td colspan="3"></td></tr>
@endif
@endforeach
</tbody>
</table>
<br>
<div class="row">
<div class="col">
<strong>{{ __('investigations.performed_by') }}: </strong> {{ get_full_name($created_by, 'id', 'first_name', 'last_name', 'users') }}
</div>
<div class="col"><b>{{ __('investigations.sign') }}:</b> ............................................................</div>
</div>
</div>
</body>
</html>
@@ -0,0 +1,433 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
<title>{{ config('app.name', 'Inpatient Bill - Stre@mline') }}</title>
<!-- Bootstrap Core CSS -->
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<style style="text-css">
@page {
margin-left:20px;
margin-right:45px;
}
body{
font-size: 13px;
}
table, tr, td {
page-break-inside: avoid;
border-collapse: collapse;
table-layout: fixed;
width: 100%;
}
thead {
/*display: table-header-group;*/
}
tfoot {
/*display: table-row-group;*/
}
tr {
page-break-inside: avoid;
page-break-after: avoid;
page-break-before: avoid;
}
td {
word-wrap: break-word;
}
.center-align-image {
text-align:center;
}
footer {
position: fixed;
bottom: -60px;
left: 0px;
right: 0px;
height: 50px;
text-align: center;
line-height: 35px;
background-color:white;
}
</style>
</head>
<body>
@php
$hospital_info = \Streamline\Models\HospitalInformation::find(1);
@endphp
{{-- footer --}}
<footer>
<?php echo '<i>&copy; ' . date('Y') . ' Stre@mline</i>' ?>
</footer>
<div class="container-fluid ">
{{-- header --}}
@if(is_null($hospital_info->pdf_print_header))
<div class="center-align-image">
<img style="max-width: 300px; max-height: 140px;" src="{{ asset($hospital_info->logo) }}" class="mx-auto d-block mx-3" alt="Responsive image">
<br>
<p class="h6 text-center mt-0 font-weight-bold">
{{ $hospital_info->name . ' | ' . $hospital_info->phone_number . ' | ' . $hospital_info->email . ' | ' . $hospital_info->address . ' ' . $hospital_info->country }}
</p>
</div>
@else
<div class="center-align-image">
<img style="max-height: 150px;" src="{{ asset($hospital_info->pdf_print_header) }}" alt="Responsive image">
</div>
@endif
<hr>
<h5 class="heading" style="text-align: center;">{{ __('investigations.obstetric_ultrasound_order_details') }}</h5>
<div class="row">
<table class="table table-light table-sm table-borderless" >
<tr>
<th scope="row" width='18%'>{{ __('investigations.patient_number') }}</th>
<td width='30%'>{{ $patient->number}}</td>
<th width='16%'>{{ __('investigations.patient_category') }}</th>
<td>{{ get_name($patient->category_id, 'id', 'name', 'patient_categories') }}</td>
</tr>
<tr>
<th scope="row">{{ __('investigations.patient_names') }}</th>
<td>{{ $patient->first_name}} {{ $patient->last_name}}</td>
<th>{{ __('investigations.residence') }}</th>
<td rowspan="2">{{ patient_residence($patient->id) }}</td>
</tr>
<tr>
<th scope="row">{{ __('investigations.age') }}</th>
<td>
<?php echo \Carbon\Carbon::parse($patient->date_of_birth)->age; ?> {{ __('investigations.years') }}
</td>
<th>&nbsp;</th>
</tr>
<tr>
<th scope="row">{{ __('investigations.gender') }}</th>
<td>
@if($patient->gender == 1)
{{ __('investigations.male') }}
@else
{{ __('investigations.female') }}
@endif
</td>
<th>{{ __('investigations.printed_on') }}</th>
<td> <?php echo streamline_date(date('d-m-Y')); ?></td>
</tr>
<tr>
<th scope="row"></th>
<td>
</td>
<th>&nbsp;</tH>
<td>
</td>
</tr>
</table>
</div>
@php
$no_of_foetus = $report->no_of_foetus;
@endphp
<div class="row " >
<table class="table table-sm" style="width:100%;">
<thead class="thead-light">
<tr>
<th>{{ __('investigations.date_of_scan') }}</th>
<th>{{ __('investigations.sonographer') }}</th>
<th>{{ __('investigations.number_of_foetus') }}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ streamline_date($report->scan_date) }}</td>
<td>{{ get_full_name($report->sonographer, 'id', 'first_name', 'last_name', 'users') }}</td>
<td>{{ $report->no_of_foetus ?? '' }}</td>
</tr>
</tbody>
</table>
</div>
<div class="row " >
<table class="table table-sm" style="width:100%;">
<tr>
<th>{{ __('investigations.order_date') }}</th>
<td colspan="5">{{ streamline_date($invs_order->created_at) }}</td>
</tr>
@if($anc_details)
<tr>
<th>{{ __('investigations.gravida') }}</th>
<td>{{ $anc_details->gravida }}</td>
<th>{{ __('investigations.para') }}</th>
<td>{{ $anc_details->para }}</td>
<th>{{ __('investigations.abortions') }}</th>
<td>{{ $anc_details->abortion }}</td>
</tr>
<tr>
<th>{{ __('investigations.lmp') }}</th>
<td>{{ streamline_date($anc_details->lmp) }}</td>
<th>{{ __('investigations.accuracy') }}</th>
<td>{{ get_name($anc_details->accuracy, 'id', 'name', 'ante_natal_clinic_accuracies') }}</td>
<th>{{ __('investigations.edd') }}</th>
<td>{{ streamline_date($anc_details->edd) }}</td>
</tr>
@endif
<tr>
<th>{{ __('investigations.clinic') }}</th>
<td>{{ get_name(get_name($episode_id, 'id', 'clinic_id', 'patient_episodes'), 'id', 'name', 'clinics') }}</td>
<th>{{ __('investigations.requested_by') }}</th>
<td>
{{ get_full_name($invs_order->created_by, 'id', 'first_name', 'last_name', 'users') }}
</td>
<th>{{ __('investigations.phone') }}</th>
<td>{{ get_name($invs_order->created_by, 'id', 'phone', 'users') }}</td>
</tr>
<tr>
<th>{{ __('investigations.comment') }}</th>
<td colspan="5">{{ $invs_order->comment }}</td>
</tr>
</table>
</div>
<hr>
{{-- start foetus table --}}
<div class="row " >
<table class="table table-sm">
<thead class="thead-light">
<tr>
<th width="30%">{{ __('investigations.item') }}</th>
<th><div class="foetus1header hiddenx">1</div></th>
<th style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">2</th>
<th style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">3</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ __('investigations.crown_rump_length') }} (cm)</td>
<td>
{{ split_string_null_check($report->crown_rump, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->crown_rump, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->crown_rump, 2) }}
</td>
</tr>
<tr>
<td>{{ __('investigations.bi_parietal_diameter') }} (cm)</td>
<td>
{{ split_string_null_check($report->bi_parietal_diameter, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->bi_parietal_diameter, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->bi_parietal_diameter, 2) }}
</td>
</tr>
<tr>
<td>{{ __('investigations.head_circumference') }} (cm)</td>
<td>
{{ split_string_null_check($report->head_circumference, 0)}}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->head_circumference, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->head_circumference, 2) }}
</td>
</tr>
<tr>
<td>{{ __('investigations.abdominal_circumference') }} (cm)</td>
<td>
{{ split_string_null_check($report->abdominal_circumference, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->abdominal_circumference, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->abdominal_circumference, 2) }}
</td>
</tr>
<tr>
<td>{{ __('investigations.femur_length') }} (cm)</td>
<td>
{{ split_string_null_check($report->femur_length, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->femur_length, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->femur_length, 2) }}
</td>
</tr>
<tr>
<td>{{ __('investigations.estimated_foetal_weight') }} (kg)</td>
<td>
{{ split_string_null_check($report->estimated_foetal_weight, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->estimated_foetal_weight, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->estimated_foetal_weight, 2) }}
</td>
</tr>
<tr>
<td>{{ __('investigations.average_gestation_age') }} ({{ __('investigations.weeks') }})</td>
<td>
{{ split_string_null_check($report->average_gestational_age, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->average_gestational_age, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->average_gestational_age, 2) }}
</td>
</tr>
<tr>
<td>{{ __('investigations.edd') }}</td>
<td>
{{ split_string_null_check($report->expected_delivery_date, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->expected_delivery_date, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->expected_delivery_date, 2) }}
</td>
</tr>
<tr>
<td>{{ __('investigations.presentation') }}</td>
<td>
{{ split_string_null_check($report->presentation, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->presentation, 1)}}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->presentation, 2)}}
</td>
</tr>
<tr>
<td>{{ __('investigations.placental_site') }}</td>
<td>
{{ split_string_null_check($report->placental_site, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->placental_site, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->placental_site, 2) }}
</td>
</tr>
<tr>
<td>{{ __('investigations.liquor_volume') }} (mls)</td>
<td>
{{ split_string_null_check($report->liquor_volume, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->liquor_volume, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->liquor_volume, 2) }}
</td>
</tr>
<tr>
<td>{{ __('investigations.cord_artery_doppler') }}</td>
<td>
{{ split_string_null_check($report->cord_artery_doppler, 0) }}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->cord_artery_doppler, 1) }}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ split_string_null_check($report->cord_artery_doppler, 2) }}
</td>
</tr>
<?php
$comments = !is_null($report->comments) ? explode(",,,",$report->comments) : '';
?>
<tr >
<td>{{ __('investigations.comments_additional_info') }}</td>
<td>
{{ $comments[0] ?? ''}}
</td>
<td style="{{ $no_of_foetus >= 2 ? '' : 'display:none;' }}">
{{ $comments[1] ?? ''}}
</td>
<td style="{{ $no_of_foetus >= 3 ? '' : 'display:none;' }}">
{{ $comments[2] ?? ''}}
</td>
</tr>
</tbody>
</table>
</div>
{{-- End foetus table --}}
</div>
</body>
</html>
@@ -0,0 +1,270 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
<title>{{ config('app.name', 'Inpatient Bill - Stre@mline') }}</title>
<!-- Bootstrap Core CSS -->
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<style>
body{
/*font-size: 1.2em;*/
}
/*thead, tfoot { display: table-row-group }*/
thead {
display: table-header-group;
}
tfoot {
display: table-row-group;
}
tr {
page-break-inside: avoid;
}
</style>
</head>
<body>
<div class="container-fluid">
@include('layouts.header_pdf_print')
<h5 class="heading font-weight-bold" style="text-align: center;">{{ __('investigations.department_of_cardiology') }}</h5>
<h6 class="heading font-weight-bold" style="text-align: center;">ECHOCARDIOLOGY REPORT</h6>
<div style="font-size: 15px">
<table class="table table-bordered">
<tbody>
<tr>
<td width="15%" style="padding: 2px;">{{ __('investigations.date') }}</td>
<td width="45%" style="padding: 2px;">{{ $date }}</td>
<td width="15%" style="padding: 2px;">{{ __('investigations.weight') }}(Kg)</td>
<td width="25%" style="padding: 2px;"></td>
</tr>
<tr>
<td width="15%" style="padding: 2px;">{{ __('investigations.name') }}</td>
<td width="45%" style="padding: 2px;">
{{ $names }} ({{ $patient_number }})
</td>
<td width="15%" style="padding: 2px;">B.P(mmHg)</td>
<td width="25%" style="padding: 2px;"></td>
</tr>
<tr>
<td width="15%" style="padding: 2px;">{{ __('investigations.gender') }}</td>
<td width="45%" style="padding: 2px;">
{{ $sex }}
</td>
<td width="15%" style="padding: 2px;">{{ __('investigations.pulse') }}(mmHg)</td>
<td width="25%" style="padding: 2px;"></td>
</tr>
<tr>
<td width="15%" style="padding: 2px;">{{ __('investigations.age') }}</td>
<td width="45%" style="padding: 2px;">
{{ $age }}
</td>
<td width="15%" style="padding: 2px;">{{ __('investigations.height') }}(cm)</td>
<td width="25%" style="padding: 2px;"></td>
</tr>
</tbody>
</table>
<h6 class="heading font-weight-bold">M. MODE MEASUREMENTS</h6>
<table class="table table-sm color-bordered-table table-condensed table-bordered">
<thead>
<tr>
<th>&nbsp;</th>
<th>{{ __('investigations.results') }}</th>
<th>{{ __('investigations.normal_ranges') }}</th>
<th>&nbsp;</th>
<th>{{ __('investigations.results') }}</th>
<th>{{ __('investigations.normal_ranges') }}</th>
<th>&nbsp;</th>
<th>{{ __('investigations.results') }}</th>
<th>{{ __('investigations.normal_ranges') }}</th>
</tr>
</thead>
<tbody>
<tr>
<td style="padding: 2px;">IVS</td>
<td style="padding: 2px;">
{{ $ivs }}
</td>
<td style="padding: 2px;">
{{ $range_IVS }}
</td>
<td style="padding: 2px;">AO</td>
<td style="padding: 2px;">
{{ $aortic }}
</td>
<td style="padding: 2px;">
{{ $range_AO }}
</td>
<td style="padding: 2px;">EF (%)</td>
<td style="padding: 2px;">
{{ $ef }}
</td>
<td style="padding: 2px;">
{{ $range_EF }}
</td>
</tr>
<tr>
<td style="padding: 2px;">LVIDd</td>
<td style="padding: 2px;">
{{ $lvidd }}
</td>
<td style="padding: 2px;">
{{ $range_LVIDd }}
</td>
<td style="padding: 2px;">LA</td>
<td style="padding: 2px;">
{{ $la }}
</td>
<td style="padding: 2px;">
{{ $range_LA }}
</td>
<td style="padding: 2px;">FS (%)</td>
<td style="padding: 2px;">
{{ $fs }}
</td>
<td style="padding: 2px;">
{{ $range_FS }}
</td>
</tr>
<tr>
<td style="padding: 2px;">LVIDs</td>
<td style="padding: 2px;">
{{ $lvids }}
</td>
<td style="padding: 2px;">
{{ $range_LVIDs }}
</td>
<td style="padding: 2px;">RV</td>
<td style="padding: 2px;">
{{ $rv }}
</td>
<td style="padding: 2px;">
{{ $range_RV }}
</td>
<td style="padding: 2px;">TAPSE</td>
<td style="padding: 2px;">
{{ $tapse }}
</td>
<td style="padding: 2px;">
{{ $range_TAPSE }}
</td>
</tr>
<tr>
<td style="padding: 2px;">LVPWd</td>
<td style="padding: 2px;">
{{ $lvpwd }}
</td>
<td style="padding: 2px;">
{{ $range_LVPWd }}
</td>
<td style="padding: 2px;">RA</td>
<td style="padding: 2px;">
{{ $ra }}
</td>
<td style="padding: 2px;">
{{ $range_RA }}
</td>
<td style="padding: 2px;"></td>
<td style="padding: 2px;"></td>
<td style="padding: 2px;"></td>
</tr>
</tbody>
</table>
<h6 class="heading font-weight-bold">DOPPLER FINDINGS</h6>
<table class="table table-sm color-bordered-table table-condensed table-bordered">
<thead>
<th>&nbsp;</th>
<th>{{ __('investigations.results') }}</th>
<th>{{ __('investigations.normal_ranges') }}</th>
<th>&nbsp;</th>
<th>{{ __('investigations.results') }}</th>
<th>{{ __('investigations.normal_ranges') }}</th>
</thead>
<tbody>
<tr>
<td style="padding: 2px;">Mitral E/A ratio</td>
<td style="padding: 2px;">{{ $mitral_ea_ratio }}</td>
<td style="padding: 2px;">&nbsp;</td>
<td style="padding: 2px;">TR Max. PG</td>
<td style="padding: 2px;">{{ $tr_pg }}</td>
<td style="padding: 2px;">(15 - 25 mmHg)</td>
</tr>
<tr>
<td style="padding: 2px;">AV Vel. Max</td>
<td style="padding: 2px;">{{ $av_vmax }}</td>
<td style="padding: 2px;">(m/s)</td>
<td style="padding: 2px;">RAP</td>
<td style="padding: 2px;">{{ $rap }}</td>
<td style="padding: 2px;">(mmHg)</td>
</tr>
<tr>
<td style="padding: 2px;">AV Mean PG</td>
<td style="padding: 2px;">{{ $av_mean }}</td>
<td style="padding: 2px;">(mmHg)</td>
<td style="padding: 2px;"></td>
<td style="padding: 2px;"></td>
<td style="padding: 2px;">&nbsp;</td>
</tr>
</tbody>
</table>
<h6 class="heading font-weight-bold">{{ __('investigations.description') }}</h6>
<table class="table table-bordered">
<tbody>
@foreach ($descriptions_array as $description)
<tr>
<td style="padding: 5px; white-space: nowrap;" width="1">{{ $description["name"] }}</td>
<td style="padding: 5px;">{{ $description["value"] }}</td>
</tr>
@endforeach
</tbody>
</table>
<br>
<br>
<table class="table table-bordered">
<tbody>
@if($conclusion != "")
<tr>
<td style="padding: 5px;">
<span class="font-weight-bold">{{ __('investigations.conclusion') }}</span>
</td>
<td style="padding: 5px;">
{!! nl2br(e($conclusion)) !!}
</td>
</tr>
@endif
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td style="padding: 5px;">
<span class="font-weight-bold">{{ __('investigations.performed_by') }}</span>
</td>
<td style="padding: 5px;">
{{ get_full_name($created_by, "id", "first_name", "last_name", "users") }}
</td>
</tr>
<tr>
<td style="padding: 5px;">
<span class="font-weight-bold">{{ __('investigations.title') }}</span>
</td>
<td style="padding: 5px;">
{{ get_name(get_name($created_by, "id", "position_id", "users"), "id", "name", "staff_positions") }}<br>
{{ streamline_date($created_at) }}
</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>
@@ -0,0 +1,165 @@
@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/bootstrap-datepicker/bootstrap-datepicker.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">{{ __('investigations.investigation_requests') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li class="active">{{ __('investigations.investigation_requests') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div style="float: right;">
<button class="btn btn-primary print-all-categories">{{ __('investigations.print_all_requests') }}</button><br>
</div>
</div>
</div><br>
<div class="row">
<div class="col-sm-12">
<div class="white-box" id="divToPrint">
<style type="text/css" media="print" >
/*class for the element we dont want to print*/
.no-print{
display:none;
}
</style>
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
<h2 style="text-align: center">{{ __('investigations.investigation_requests') }}</h2>
<p style="font-size: 1em">
{{--<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace"><b>{{ $hospital_information->name }}</b></span>
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace">{{ $hospital_information->address }}</span>
<span><b>Tel:</b> {{ $hospital_information->phone_number }}</span><br>
<span><b>Email:</b> {{ $hospital_information->email }}</span><br>--}}
</p>
@for ($x = 0; $x < count($category_ids_array); $x++)
<p style="font-size: 1em">
<span class="{{ $x }} no-print print-all"><b>{{ __('investigations.patient_name') }}:</b> {{ get_name($patient->id, 'id', 'first_name', 'patients') }} {{ get_name($patient->id, 'id', 'last_name', 'patients') }}</span><br>
<span class="{{ $x }} no-print print-all"><b>{{ __('investigations.patient_number') }}</b> : {{ get_name($patient->id, 'id', 'number', 'patients') }}</span><br>
<span class="{{ $x }} no-print print-all"><b>{{ __('investigations.age') }}</b> : {{ get_patients_age($patient->date_of_birth) }}</span><br>
<span class="{{ $x }} no-print print-all"><b>{{ __('investigations.gender') }}</b> : @if(get_name($patient->id, 'id', 'gender', 'patients') == 1) {{ __('investigations.male') }} @elseif(get_name($patient->id, 'id', 'gender', 'patients') == 2) {{ __('investigations.female') }} @else {{ __('investigations.other') }} @endif</span><br>
<span class="{{ $x }} no-print print-all"><b>{{ __('investigations.ward') }}</b> : @if($ordered_investigation->inpatient == 0) OPD @else {{ get_ward_name($ordered_investigation->patient_id, $ordered_investigation->episode_id) }} @endif</span><br>
<span class="{{ $x }} no-print print-all"><b>{{ __('investigations.authorised_by') }}</b> : {{ get_full_name($ordered_investigation->created_by, 'id', 'first_name', 'last_name', 'users') }}</span><br>
<span class="{{ $x }} no-print print-all"><b>{{ __('investigations.date') }}</b> : {{ streamline_date($ordered_investigation->created_at) }}</span><br>
</p>
<div class="table-bordered" style="padding: 10px; margin-bottom: 10px">
<h4 class="{{ $x }} no-print print-all text-center">{{ get_name($category_ids_array[$x], "id", "name", "investigation_categories") }}</h4>
<ol class="{{ $x }} no-print print-all">
@foreach($category_array[$category_ids_array[$x]] as $record)
@php $investigation_id = $record['id']; @endphp
<li>
@if(in_array($investigation_id,$urgent_ids_array)) <span style='font-size:16px;'>&#9650;&nbsp;</span> @endif
{{ get_name($investigation_id, "id", "name", "investigations") }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{{ get_name($investigation_id, "id", "minimum", "investigations") }}&nbsp;&nbsp;&nbsp;
{{ get_name($investigation_id, "id", "sample_container", "investigations") }}
@if($record['comment'] != '')
<br><br>
<p><b>{{ __('investigations.order_comments') }}:</b> {{ $record['comment'] }}</p>
@endif
<hr>
</li>
@endforeach
</ol>
<div class="text-center">
<button class="btn btn-primary no-print glyphicon glyphicon-print print-btn" id="{{ $x }}"> {{ __('investigations.print') }}</button>
</div>
</div>
<p class="{{ $x }} no-print print-all">=========================================</p>
@endfor
<i style="font-size: 0.8em;">&copy; Stre@mline</i>
</div>
<div class="col-md-3"></div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script type="text/javascript">
// prepare for printing all categories
$(document).ready(function () {
$(".print-all-categories").click(function () {
// remove no-print attribute from all
$(".print-all").each(function () {
$(this).removeClass("no-print");
});
// print the whole document
print_investigations();
// add no-print attribute to all
$(".print-all").each(function () {
$(this).addClass("no-print");
});
});
});
// prepare for printing single category
$(document).ready(function () {
$(".print-btn").click(function () {
let id = $(this).attr("id");
// remove no-print attribute from all
$("." + id).each(function () {
$(this).removeClass("no-print");
});
// print the whole document
print_investigations();
// add no-print attribute to all
$("." + id).each(function () {
$(this).addClass("no-print");
});
});
});
function print_investigations() {
let myDiv = document.getElementById('divToPrint');
let newWindow = window.open('', 'SecondWindow', 'toolbar=0,stat=0');
newWindow.document.write("<html><body " +
"class='' " +
" onload='window.print()'>" +
myDiv.innerHTML +
"</body></html>");
newWindow.document.close();
return false;
}
</script>
@endpush
@@ -0,0 +1,46 @@
@extends('layouts.main')
@push('styles')
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('investigations.request_barcode') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li class="active">{{ __('investigations.request_barcode') }}</li>
</ol>
</div>
</div>
<a onclick="printBarcode()" class="btn btn-rounded btn-sm pull-right" style="background-color:#03C03C; color: white"><i class="fa fa-print"></i><span style="margin-left: 10px;">{{ __('investigations.print_barcode') }}</span></a>
<br><br>
<div class="white-box text-center" id="print_div">
<h4>{{ $patient_name }}</h4>
{{ getDNS1DBarcodePNG($id) }}
<h4>{{ sprintf("%04u", $id) }}</h4>
</div>
@endsection
@push('scripts')
<script>
function printBarcode() {
let myDiv = document.getElementById('print_div');
let newWindow = window.open('', 'SecondWindow', 'toolbar=0,stat=0');
newWindow.document.write("<html><body " +
"class='' " +
" onload='window.print()'>" +
myDiv.innerHTML +
"</body></html>");
newWindow.document.close();
return false;
}
</script>
@endpush
@@ -0,0 +1,504 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<style>
.hidden {
display: none;
}
</style>
<div class="row bg-title">
<div class="col-md-7">
<h4 class="page-title">{{ __('investigations.obstetric_ultrasound_request_template') }}</h4>
</div>
<div class="col-md-5">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.results') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
</div>
</div>
<div class="white-box">
@include('flash::message')
{{ Form::open(['route' => 'investigations.submit_ultrasound_obstetric_report']) }}
{{ Form::hidden('order_id',$order_id) }}
{{ Form::hidden('patient_id',$patient_id) }}
{{ Form::hidden('episode_id',$episode_id) }}
<div class="row">
<div class="col-md-4">
<div class="form-group">
{{ Form::label('scan_date', __('investigations.date_of_scan')) }}
<div class="input-group">
{{ Form::text('scan_date', date('d-m-Y'), ['class'=>'form-control compulsory', 'id'=>'scan_date', 'readonly']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
{{ Form::label('sonographer_name', __('investigations.sonographer')) }}
{{ Form::text('sonographer_name', get_full_name(Auth::user()->id, 'id', 'first_name', 'last_name', 'users'), ['class' => 'form-control compulsory', 'readonly']) }}
{{ Form::hidden('sonographer', Auth::user()->id) }}
</div>
</div>
<div class="col-md-4">
<div class="form-group">
{{ Form::label('no_of_foetus', __('investigations.number_of_foetus')) }}
<a href="javascript::void(0)" data-toggle="tooltip" rel="tooltip" data-placement="top" title="" data-original-title="Select the foetus number first, the number of foetus will trigger corresponding columns in the table"> <i class="fa fa-info-circle"></i></a>
<input type="number" id="numberInput" name="no_of_foetus" class="form-control compulsory" min="1" max="3" value="1" onchange="showFoetusColumns()">
</div>
</div>
</div>
<h4>{{ __('investigations.obstetric_ultrasound_order_details') }}</h4>
<div class="table-responsive">
<table class="table table-primary table-striped table-thead-simple table-hover table-bordered">
<tr>
<th>{{ __('investigations.order_date') }}</th>
<td colspan="5">{{ streamline_date(get_name($order_id, 'id', 'created_at', 'ordered_investigations')) }}</td>
</tr>
<tr>
<th>{{ __('investigations.gravida') }}</th>
<td>{{ get_name($episode_id, 'episode_id', 'gravida', 'ante_natal_clinic_registrations') }}</td>
<th>{{ __('investigations.para') }}</th>
<td>{{ get_name($episode_id, 'episode_id', 'para', 'ante_natal_clinic_registrations') }}</td>
<th>{{ __('investigations.abortions') }}</th>
<td>{{ get_name($episode_id, 'episode_id', 'abortion', 'ante_natal_clinic_registrations') }}</td>
</tr>
<tr>
<th>{{ __('investigations.lmp') }}</th>
<td>
@if(get_name($episode_id, 'episode_id', 'lmp', 'ante_natal_clinic_registrations') == 'N/A')
N/A
@else
{{ streamline_date(get_name($episode_id, 'episode_id', 'lmp', 'ante_natal_clinic_registrations')) }}
@endif
</td>
<th>{{ __('investigations.accuracy') }}</th>
<td>
@if(get_name($episode_id, 'episode_id', 'accuracy', 'ante_natal_clinic_registrations') == 'N/A')
N/A
@else
{{ get_name(get_name($episode_id, 'episode_id', 'accuracy', 'ante_natal_clinic_registrations'), 'id', 'name', 'ante_natal_clinic_accuracies') }}
@endif
</td>
<th>{{ __('investigations.edd') }}</th>
<td>
@if(get_name($episode_id, 'episode_id', 'edd', 'ante_natal_clinic_registrations') == 'N/A')
N/A
@else
{{ streamline_date(get_name($episode_id, 'episode_id', 'edd', 'ante_natal_clinic_registrations')) }}
@endif
</td>
</tr>
<tr>
<th>{{ __('investigations.clinic') }}</th>
<td>{{ get_name(get_name($episode_id, 'id', 'clinic_id', 'patient_episodes'), 'id', 'name', 'clinics') }}</td>
<th>{{ __('investigations.requested_by') }}</th>
<td>
@php
$requester_id = get_name($order_id, 'id', 'created_by', 'ordered_investigations');
if($requester_id == 'N/A'){
$requested_by = Auth::user()->id;
} else {
$requested_by = $requester_id;
}
@endphp
{{ get_full_name($requested_by, 'id', 'first_name', 'last_name', 'users') }}
</td>
<th>{{ __('investigations.phone') }}</th>
<td>{{ get_name($requested_by, 'id', 'phone', 'users') }}</td>
</tr>
<tr>
<th>{{ __('investigations.comment') }}</th>
<td colspan="5">{{ get_name($order_id, 'id', 'comment', 'ordered_investigations') }}</td>
</tr>
</table>
</div>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.item') }}</th>
<th><div class="foetus1header hiddenx">1</div></th>
<th><div class="foetus2header hidden">2</div></th>
<th><div class="foetus3header hidden">3</div></th>
</tr>
</thead>
<tbody>
<tr>
<td >{{ __('investigations.crown_rump_length') }} (cm)</td>
<td>
<div class="form-group foetus1r1 hiddenx" >
<input type="number" class="form-control" name="crown_rump1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r1 hidden" >
<input type="number" class="form-control" name="crown_rump2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r1 hidden">
<input type="number" class="form-control" name="crown_rump3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.bi_parietal_diameter') }} (cm)</td>
<td >
<div class="form-group foetus1r2 hiddenx" >
<input type="number" class="form-control" name="bi_parietal_diameter1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r2 hidden" >
<input type="number" class="form-control" name="bi_parietal_diameter2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r1 hidden" >
<input type="number" class="form-control" name="bi_parietal_diameter3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.head_circumference') }} (cm)</td>
<td>
<div class="form-group foetus1r3 hiddenx" >
<input type="number" class="form-control" name="head_circumference1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r3 hidden" >
<input type="number" class="form-control" name="head_circumference2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r3 hidden" >
<input type="number" class="form-control" name="head_circumference3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.abdominal_circumference') }} (cm)</td>
<td>
<div class="form-group foetus1r4 hiddenx" >
<input type="number" class="form-control" name="abdominal_circumference1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r4 hidden" >
<input type="number" class="form-control" name="abdominal_circumference2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r4 hidden" >
<input type="number" class="form-control" name="abdominal_circumference3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.femur_length') }} (cm)</td>
<td>
<div class="form-group foetus1r5 hiddenx">
<input type="number" class="form-control" name="femur_length1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r5 hidden">
<input type="number" class="form-control" name="femur_length2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r5 hidden">
<input type="number" class="form-control" name="femur_length3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.estimated_foetal_weight') }} (kg)</td>
<td>
<div class="form-group foetus1r6 hiddenx">
<input type="number" class="form-control" name="estimated_foetal_weight1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r6 hidden">
<input type="number" class="form-control" name="estimated_foetal_weight2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r6 hidden">
<input type="number" class="form-control" name="estimated_foetal_weight3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.average_gestation_age') }} ({{ __('investigations.weeks') }})</td>
<td>
<div class="form-group foetus1r7 hiddenx">
<input type="number" class="form-control" name="average_gestational_age1" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r7 hidden">
<input type="number" class="form-control" name="average_gestational_age2" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r7 hidden">
<input type="number" class="form-control" name="average_gestational_age3" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.edd') }}</td>
<td>
<div class="input-group foetus1r8 hiddenx">
{{ Form::text('expected_delivery_date1', '', ['class'=>'form-control', 'id'=>'expected_delivery_date1', 'readonly']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</td>
<td>
<div class="input-group foetus2r8 hidden">
{{ Form::text('expected_delivery_date2', '', ['class'=>'form-control', 'id'=>'expected_delivery_date2', 'readonly']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</td>
<td>
<div class="input-group foetus3r8 hidden">
{{ Form::text('expected_delivery_date3', '', ['class'=>'form-control', 'id'=>'expected_delivery_date3', 'readonly']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.presentation') }}</td>
<td>
<select name="presentation1" class="form-control foetus1r9 hiddenx">
<option></option>
<option>{{ __('investigations.cephalic') }}</option>
<option>{{ __('investigations.breech') }}</option>
<option>{{ __('investigations.transverse') }}</option>
</select>
</td>
<td>
<select name="presentation2" class="form-control foetus2r9 hidden">
<option></option>
<option>{{ __('investigations.cephalic') }}</option>
<option>{{ __('investigations.breech') }}</option>
<option>{{ __('investigations.transverse') }}</option>
</select>
</td>
<td>
<select name="presentation3" class="form-control foetus3r9 hidden">
<option></option>
<option>{{ __('investigations.cephalic') }}</option>
<option>{{ __('investigations.breech') }}</option>
<option>{{ __('investigations.transverse') }}</option>
</select>
</td>
</tr>
<tr>
<td>{{ __('investigations.placental_site') }}</td>
<td>
<select name="placental_site1" class="form-control foetus1r10 hiddenx">
<option></option>
<option>{{ __('investigations.anterior') }}</option>
<option>{{ __('investigations.posterior') }}</option>
<option>{{ __('investigations.fundal_anterior') }}</option>
<option>{{ __('investigations.fundal_posterior') }}</option>
<option>{{ __('investigations.low_lying_grade1') }}</option>
<option>{{ __('investigations.low_lying_grade2') }}</option>
<option>{{ __('investigations.low_lying_grade3') }}</option>
</select>
</td>
<td>
<select name="placental_site2" class="form-control foetus2r10 hidden">
<option></option>
<option>{{ __('investigations.anterior') }}</option>
<option>{{ __('investigations.posterior') }}</option>
<option>{{ __('investigations.fundal_anterior') }}</option>
<option>{{ __('investigations.fundal_posterior') }}</option>
<option>{{ __('investigations.low_lying_grade1') }}</option>
<option>{{ __('investigations.low_lying_grade2') }}</option>
<option>{{ __('investigations.low_lying_grade3') }}</option>
</select>
</td>
<td>
<select name="placental_site3" class="form-control foetus3r10 hidden">
<option></option>
<option>{{ __('investigations.anterior') }}</option>
<option>{{ __('investigations.posterior') }}</option>
<option>{{ __('investigations.fundal_anterior') }}</option>
<option>{{ __('investigations.fundal_posterior') }}</option>
<option>{{ __('investigations.low_lying_grade1') }}</option>
<option>{{ __('investigations.low_lying_grade2') }}</option>
<option>{{ __('investigations.low_lying_grade3') }}</option>
</select>
</td>
</tr>
<tr>
<td>{{ __('investigations.liquor_volume') }} (mls)</td>
<td>
<div class="form-group foetus1r11 hiddenx">
<input type="number" class="form-control" name="liquor_volume1" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus2r11 hidden">
<input type="number" class="form-control" name="liquor_volume2" step=".01" placeholder="">
</div>
</td>
<td>
<div class="form-group foetus3r11 hidden">
<input type="number" class="form-control" name="liquor_volume3" step=".01" placeholder="">
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.cord_artery_doppler') }}</td>
<td>
<div class="form-group foetus1r12 hiddenx">
{{ Form::text('cord_artery_doppler1', '', ['class' => 'form-control']) }}
</div>
</td>
<td>
<div class="form-group foetus2r12 hidden">
{{ Form::text('cord_artery_doppler2', '', ['class' => 'form-control']) }}
</div>
</td>
<td>
<div class="form-group foetus3r12 hidden">
{{ Form::text('cord_artery_doppler3', '', ['class' => 'form-control']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.comments_additional_info') }}</td>
<td>
<div class="form-group foetus1r13 hiddenx">
<textarea class="form-control" name="comments1" rows="7"></textarea>
</div>
</td>
<td>
<div class="form-group foetus2r13 hidden">
<textarea class="form-control" name="comments2" rows="7"></textarea>
</div>
</td>
<td>
<div class="form-group foetus3r13 hidden">
<textarea class="form-control" name="comments3" rows="7"></textarea>
</div>
</td>
</tr>
</tbody>
</table>
</div>
{{ Form::button('Submit',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'submit_button']) }}
{{ Form::close() }}
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
{{-- show foetus data columns on change of foetus number input --}}
<script>
function showFoetusColumns() {
var inputVal = parseInt(document.getElementById("numberInput").value);
// div classes with their respective visibility requirements
var divClasses = {
//foetus one sections
'foetus1header': 1,'foetus1r1': 1,'foetus1r2': 1, 'foetus1r3': 1,'foetus1r4': 1,'foetus1r5': 1,'foetus1r6': 1,'foetus1r7': 1,'foetus1r8': 1,'foetus1r9': 1, 'foetus1r10': 1,'foetus1r11': 1,'foetus1r12': 1,'foetus1r13': 1,
//foetus two sections
'foetus2header': 2,'foetus2r1': 2,'foetus2r2': 2,'foetus2r3': 2,'foetus2r4': 2,'foetus2r5': 2,'foetus2r6': 2,'foetus2r7': 2,'foetus2r8': 2,'foetus2r9': 2, 'foetus2r10': 2,'foetus2r11': 2,'foetus2r12': 2,'foetus2r13': 2,
//foetus three sections
'foetus3header': 3,'foetus3r1': 3,'foetus3r2': 3,'foetus3r3': 3,'foetus3r4': 3,'foetus3r5': 3,'foetus3r6': 3,'foetus3r7': 3,'foetus3r8': 3,'foetus3r9': 3, 'foetus3r10': 3,'foetus3r11': 3,'foetus3r12': 3,'foetus3r13': 3,
'foetus4': 4,
'foetus44': 4,
};
// Loop through the divClasses object
for (var className in divClasses) {
if (divClasses.hasOwnProperty(className)) {
var divs = document.querySelectorAll('.' + className);
divs.forEach(function(div) {
if (inputVal >= divClasses[className]) {
div.classList.remove('hidden');
} else {
div.classList.add('hidden');
}
});
}
}
}
</script>
<script type="text/javascript">
$('#scan_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#expected_delivery_date1').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#expected_delivery_date2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#expected_delivery_date3').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
@endpush
@@ -0,0 +1,185 @@
@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/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<h4 class="page-title">{{ __('investigations.view_cancelled_investigations') }}</h4>
</div>
<div class="col-lg-6 col-sm-6 col-md-6 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('investigations.dashboard') }}</a></li>
</ol>
</div>
</div>
{{ Form::open(['route' => 'investigations.view_deleted_ordered_invetigations', 'method' => 'ANY']) }}
<div class="white-box">
<div class="row">
<div class="col-md-3">
<div class="form-group" id="searchby">
{{ Form::label('search_by', __('investigations.date')) }}
{{ Form::select('search_by', ['0'=> __('investigations.last_24_hours'),'1'=>__('investigations.custom_date'),'2'=>__('investigations.date_range')], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-3" style="display: none;" id="date_search">
<div class="form-group" id="reg_date" style="padding-top: 23px;">
<div class="input-group">
{{ Form::text('reg_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-autoclose']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-3" style="display: none;" id="date_range_search">
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('start_date', __('investigations.from')) }}
<div class="input-group">
{{ Form::text('start_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-1']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="reg_date">
{{ Form::label('end_date', __('investigations.to')) }}
<div class="input-group">
{{ Form::text('end_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-2']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group" style="padding-top: 5px;"><br>
{{ Form::button(__('investigations.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_patient']) }}
</div>
</div>
</div>
</div>
{{ Form::close() }}
<div class="row">
<div class="col-sm-12">
@include('flash::message')
<div class="white-box" style="border-radius: 5px;">
<div class="table-responsive">
<table class="table table-hover color-bordered-table success-bordered-table table-striped">
<thead>
<tr>
<th>#</th>
<th>{{ __('investigations.date_ordered') }}</th>
<th>{{ __('investigations.date_cancelled') }}</th>
<th>{{ __('investigations.patient_number') }}</th>
<th>{{ __('investigations.patient_name') }}</th>
<th>{{ __('investigations.ordered_investigations') }}</th>
<th>{{ __('investigations.actions') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@php $count=1; @endphp
@if(count($deleted_ordered_investigations) > 0)
@foreach($deleted_ordered_investigations as $ordered_inv)
@php
$urgent_ids = $ordered_inv->urgent_ids;
$ordered_ids = explode(",", $ordered_inv->investigation_id);
$ordered_investigation_comments_string = "";
$ordered_investigation_comments_string = $ordered_inv->order_comments;
@endphp
<tr>
<td>{{ $count }}.</td>
<td>{{ streamline_date_time($ordered_inv->created_at) }}</td>
<td>{{ streamline_date_time($ordered_inv->deleted_at) }}</td>
<td>{{ get_name($ordered_inv->patient_id, 'id', 'number', 'patients') }}</td>
<td>{!! insurance_flag($ordered_inv->patient_id) !!}</td>
<td>
<ol>
@for($i=0; $i < count($ordered_ids); $i++)
<li>{{ get_name($ordered_ids[$i], 'id', 'name', 'investigations') }}</li>
@endfor
</ol>
</td>
<td>
{{ Form::model($ordered_inv->id ,['method' => 'POST', 'route' => ['investigations.restore_deleted_ordered_invetigations', $ordered_inv->id]]) }}
<button type="submit" class="btn btn-rounded btn-warning" onclick="return confirm('Are you sure?')"><i class="fa fa-restore"></i>
<span style="margin-left: 10px;">{{ __('investigations.restore_order') }}</span>
</button>
{{ Form::close() }}
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $ordered_inv->patient_id }}" class="btn btn-info btn-rounded">{{ __('investigations.select_patient') }}</a>
</td>
</tr>
@php $count++; @endphp
@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>
<!-- Date Picker Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
//order: [ [0, 'desc'] ],
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
],
'pageLength' : 50,
});
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#search_by').change(function () {
if ($(this).val() == 1) {
$('#date_search').show();
$('#date_range_search').hide();
}
else if ($(this).val() == 2) {
$('#date_range_search').show();
$('#date_search').hide();
}
else {
$('#date_search,#date_range_search').hide();
}
});
</script>
@endpush
@@ -0,0 +1,110 @@
@extends('layouts.main')
@section('content')
<div class="row bg-title">
<div class="col-md-7">
<h4 class="page-title">{{ __('investigations.historical_results_imaging') }}</h4>
</div>
<div class="col-md-5">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.results') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
</div>
</div>
<div class="white-box">
<div class="row">
<div class="col-md-2 offset-10 text-right">
<a class="btn btn-inverse" target="_blank" href="/investigations/print_historical_results_imaging/{{ $patient_id }}"><i class="fa fa-print"></i> {{ __('investigations.print') }}</a>
</div>
</div>
@include('flash::message')
<div class="table-responsive">
<table class="table table-primary table-striped table-thead-simple table-hover table-bordered table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.investigation') }}</th>
@foreach($dates as $date)
<th>{{ $date }}</th>
@endforeach
</tr>
</thead>
<tbody>
@for($i = 0; $i < count($invs_array); $i++)
<tr>
<td>{{ get_name($invs_array[$i], 'id', 'name', 'investigations') }}</td>
@foreach($values[$i] as $value)
@if(is_array($value))
<td>
{{ Form::open(['route' => 'investigations.view_patient_investigation_obstetric']) }}
{{ Form::hidden('patient_id',$value[2]) }}
{{ Form::hidden('episode_id',$value[3]) }}
{{ Form::hidden('obstetric_ultrasound_report_id',$value[0]) }}
{{ Form::hidden('order_id',$value[1]) }}
<button type="submit" class="btn btn-success btn-sm">{{ __('investigations.view_results') }}</button>
{{ Form::close() }}
</td>
@elseif(get_name($invs_array[$i], 'id', 'type', 'investigations') == 1 && is_numeric($value))
<td>
<a class="btn btn-info btn-rounded btn-sm" style="color: white" onclick="showSpecialisedResults({{ $value }})">{{ __('investigations.view_results') }}</a>
</td>
@else
<td>{{ $value }}</td>
@endif
@endforeach
</tr>
@endfor
</tbody>
</table>
</div>
</div>
<div class="modal" id="modal_specialised_results" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"><b id="modal_heading"></b></h4>
</div>
<div class="modal-body">
<div class="table-responsive" id="modal_table"></div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script>
function showSpecialisedResults(id) {
$.ajax({
method: 'GET',
url: '/investigations/view_lab_specialised_results/' + id,
success: function(response){
let responseArray = JSON.parse(response);
$("#modal_table").html(responseArray["html"]);
$("#modal_heading").html("<?php echo __('investigations.specialised_results_investigation') ?> " + responseArray["investigation_name"]);
$('#modal_specialised_results').modal('show');
}
});
}
</script>
@endpush
@@ -0,0 +1,112 @@
@extends('layouts.main')
@section('content')
<div class="row bg-title">
<div class="col-md-7">
<h4 class="page-title">{{ __('investigations.historical_results_labs') }}</h4>
</div>
<div class="col-md-5">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li class="active">{{ __('investigations.results') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
</div>
</div>
<br/>
<div class="white-box">
<div class="row">
<div class="col-md-2 offset-10 text-right">
<a class="btn btn-inverse" target="_blank" href="/investigations/print_historical_results_labs/{{ $patient_id }}"><i class="fa fa-print"></i> {{ __('investigations.print') }}</a>
</div>
</div>
@include('flash::message')
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table class="table table-primary table-striped table-thead-simple table-hover table-bordered table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('investigations.investigation') }}</th>
@foreach($dates as $date)
<th>{{ $date }}</th>
@endforeach
</tr>
</thead>
<tbody>
@for($i = 0; $i < count($invs_array); $i++)
<tr>
<td>{{ get_name($invs_array[$i], 'id', 'name', 'investigations') }}</td>
@foreach($values[$i] as $value)
@if(is_array($value))
<td>
{{ Form::open(['route' => 'investigations.view_patient_investigation_obstetric']) }}
{{ Form::hidden('patient_id',$value[2]) }}
{{ Form::hidden('episode_id',$value[3]) }}
{{ Form::hidden('obstetric_ultrasound_report_id',$value[0]) }}
{{ Form::hidden('order_id',$value[1]) }}
<button type="submit" class="btn btn-success btn-sm">{{ __('investigations.view_results') }}</button>
{{ Form::close() }}
</td>
@elseif(get_name($invs_array[$i], 'id', 'type', 'investigations') == 1 && is_numeric($value))
<td>
<a class="btn btn-info btn-rounded btn-sm" style="color: white" onclick="showSpecialisedResults({{ $value }})">{{ __('investigations.view_results') }}</a>
</td>
@else
<td>{{ $value }}</td>
@endif
@endforeach
</tr>
@endfor
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="modal" id="modal_specialised_results" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"><b id="modal_heading"></b></h4>
</div>
<div class="modal-body">
<div class="table-responsive" id="modal_table"></div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script>
function showSpecialisedResults(id) {
$.ajax({
method: 'GET',
url: '/investigations/view_lab_specialised_results/' + id,
success: function(response){
let responseArray = JSON.parse(response);
$("#modal_table").html(responseArray["html"]);
$("#modal_heading").html("<?php echo __('investigations.specialised_results_investigation') ?> " + responseArray["investigation_name"]);
$('#modal_specialised_results').modal('show');
}
});
}
</script>
@endpush
@@ -0,0 +1,432 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css"/>
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet"/>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-6">
<h4 class="page-title">{{ __('investigations.lab_results') }}</h4>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li class="active">{{ __('investigations.view_results') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['method'=>'post','route' => 'investigations.view_lab_results']) }}
{{ Form::hidden('patient_id', 0, ['id' => 'patient_id']) }}
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label>{{ __('pharmacy.select_date') }}:</label>
<select class="form-control compulsory required" name="search_date_by" id="search_date_by" required>
<option value="today">{{ __('pharmacy.today') }}</option>
<option value="yesterday">{{ __('pharmacy.yesterday') }}</option>
<option value="custom_date">{{ __('pharmacy.custom_date') }}</option>
<option value="custom_date_range">{{ __('pharmacy.date_range') }}</option>
</select>
</div>
</div>
<div class="col-md-2" id="start_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('pharmacy.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-2" id="end_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('pharmacy.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-2">
{{ Form::label('lab_number', __('investigations.search_by_lab_number')) }}
{{ Form::number('lab_number', '', ['class' => 'form-control']) }}
</div>
<div class="col-md-2">
{{ Form::label('search_patient', __('investigations.search_by_patient')) }}
<div class="input-group">
<select class="form-control" name="patient_number" id="patient_number"></select>
</div>
</div>
<div class="col-md-2">
<div class="form-group" style="margin-top: 25px;">
{{ Form::submit(__('investigations.search'), ['class'=>'btn btn-success pull-right']) }}
</div>
</div>
</div>
{{ Form::close() }}
</div>
<div class="white-box">
@include('flash::message')
@if($search_text != "")
<h4>
<label class="label label-info">{{ $search_text }}</label>
<label class="label"><a href="#" style="display: -webkit-inline-box;" onclick="export_to_excel();" title="Download {{ __('layout.lab_results') }} CSV" class="btn-sm btn-inverse waves-effect waves-light"><span class="glyphicon glyphicon-download"></span> Download CSV</a></label>
@if (count($urgent_incomings) > 0)
&nbsp;&nbsp;<label class="label label-danger">{{ __('investigations.urgent_incoming_lab_results_warning') }}</label>
@endif
</h4>
<br>
@elseif (count($urgent_incomings) > 0 && empty($search_text))
<h4><label class="label label-danger">{{ __('investigations.urgent_incoming_lab_results_warning') }}</label></h4>
@endif
<div class="row" id="lab_results_row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<ul class="nav nav-tabs" role="tablist">
@if (count($urgent_incomings) > 0)
<li role="presentation" class="nav-item"> <a href="#per_results_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.all_incomplete') }} ({{ count($incomings) }})</a> </li>
<li role="presentation" class="nav-item active"> <a href="#urgent_incoming_results" class="nav-link text-danger" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.urgent_incomplete') }} ({{ count($urgent_incomings) }})</a> </li>
<li role="presentation" class="nav-item"> <a href="#all_complete_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.all_complete') }} ({{ count($all_complete) }})</a> </li>
@else
<li role="presentation" class="nav-item active"> <a href="#per_results_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.all_incomplete') }} ({{ count($incomings) }})</a> </li>
<li role="presentation" class="nav-item"> <a href="#all_complete_nav_pill" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> {{ __('investigations.all_complete') }} ({{ count($all_complete) }})</a> </li>
@endif
</ul>
</div>
<div class="card-block">
<div class="tab-content">
<div id="per_results_nav_pill" class="tab-pane <?php if(count($urgent_incomings) < 1) echo 'active'; ?>">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>{{ __('investigations.lab_number') }}</th>
<th>{{ __('investigations.requested') }}</th>
<th>{{ __('investigations.received') }}</th>
<th>{{ __('investigations.patient') }}</th>
<th>{{ __('investigations.source') }}</th>
<th>{{ __('investigations.payment') }}</th>
<th>{{ __('investigations.request') }}</th>
<th>{{ __('investigations.specimen') }}</th>
<th>{{ __('investigations.results') }}</th>
</tr>
</thead>
<tbody>
@foreach($incomings as $incoming)
<tr>
<td>{{ $incoming->id }}</td>
<td>By {{ get_full_name($incoming->created_by, 'id', 'first_name', 'last_name', 'users') }} at {{ streamline_date_time_short($incoming->created_at) }}</td>
<td>By {{ get_full_name($incoming->request_received_by, 'id', 'first_name', 'last_name', 'users') }} at {{ streamline_date_time_short($incoming->request_received_date) }}</td>
<td>
{{ get_full_name($incoming->patient_id, 'id', 'first_name', 'last_name', 'patients') }}
({{ get_name($incoming->patient_id, 'id', 'number', 'patients') }}) - ({{ get_name(get_name($incoming->patient_id, 'id', 'category_id', 'patients'), 'id', 'name', 'patient_categories') }})
</td>
<td>
@if($incoming->inpatient == 1 || $incoming->inpatient_bill_generated == 1)
{{ get_ward_name($incoming->patient_id, $incoming->episode_id) }}
@else
OPD
@endif
</td>
<td>
@if($incoming->payment_status == 0)
@if($incoming->inpatient_bill_generated == 1)
<font color='green'>{{ __('investigations.inpatient_bill_generated') }}</font>
@else
<font color='red'>{{ __('investigations.not_paid') }}</font>
@endif
@else
<font color='green'>{{ __('investigations.paid') }}</font>
@endif
</td>
<td onclick="showQuickView({{ $incoming->id }}, 1)"><i class="fa fa-search"></i> {{ count(explode(",", $incoming->investigation_id)) }} {{ __('investigations.tests') }}</td>
<td onclick="showQuickView({{ $incoming->id }}, 2)"><i class="fa fa-search"></i> {{ count(explode(",", $incoming->specimen)) }} {{ __('investigations.samples') }}</td>
<td>
@if($incoming->inpatient == 0 && $incoming->inpatient_bill_generated == 0 && $incoming->payment_status == 0 && !can_investigations_be_performed(get_name($incoming->patient_id, 'id', 'category_id', 'patients')))
<code class="text-center">{{ __('investigations.patient_has_not_paid_for_ordered_investigations') }}</code>
@else
<a class="btn btn-success btn-rounded btn-sm" href="/investigations/view_lab_results_details/{{ $incoming->id }}">{{ __('investigations.add') }}</a>
@endif
</td>
</tr>
@endforeach
@if(count($incomings) < 1)
<tr>
<td colspan="9" class='text-center' style='color: maroon; font-weight: bold;'>{{ __('investigations.no_results_available') }}</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
@if (count($urgent_incomings) > 0)
<div id="urgent_incoming_results" class="tab-pane active">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>{{ __('investigations.lab_number') }}</th>
<th>{{ __('investigations.requested') }}</th>
<th>{{ __('investigations.received') }}</th>
<th>{{ __('investigations.patient') }}</th>
<th>{{ __('investigations.source') }}</th>
<th>{{ __('investigations.payment') }}</th>
<th>{{ __('investigations.request') }}</th>
<th>{{ __('investigations.specimen') }}</th>
<th>{{ __('investigations.results') }}</th>
</tr>
</thead>
<tbody>
@foreach($urgent_incomings as $urgent_incoming)
<tr>
<td>{{ $urgent_incoming->id }}</td>
<td>By {{ get_full_name($urgent_incoming->created_by, 'id', 'first_name', 'last_name', 'users') }} at {{ streamline_date_time_short($urgent_incoming->created_at) }}</td>
<td>By {{ get_full_name($urgent_incoming->request_received_by, 'id', 'first_name', 'last_name', 'users') }} at {{ streamline_date_time_short($urgent_incoming->request_received_date) }}</td>
<td>
{{ get_full_name($urgent_incoming->patient_id, 'id', 'first_name', 'last_name', 'patients') }}
({{ get_name($urgent_incoming->patient_id, 'id', 'number', 'patients') }}) - ({{ get_name(get_name($urgent_incoming->patient_id, 'id', 'category_id', 'patients'), 'id', 'name', 'patient_categories') }})
</td>
<td>
@if($urgent_incoming->inpatient == 1 || $urgent_incoming->inpatient_bill_generated == 1)
{{ get_ward_name($urgent_incoming->patient_id, $urgent_incoming->episode_id) }}
@else
OPD
@endif
</td>
<td>
@if($urgent_incoming->payment_status == 0)
@if($urgent_incoming->inpatient_bill_generated == 1)
<font color='green'>{{ __('investigations.inpatient_bill_generated') }}</font>
@else
<font color='red'>{{ __('investigations.not_paid') }}</font>
@endif
@else
<font color='green'>{{ __('investigations.paid') }}</font>
@endif
</td>
<td onclick="showQuickView({{ $urgent_incoming->id }}, 1)"><i class="fa fa-search"></i> {{ count(explode(",", $urgent_incoming->investigation_id)) }} {{ __('investigations.tests') }}</td>
<td onclick="showQuickView({{ $urgent_incoming->id }}, 2)"><i class="fa fa-search"></i> {{ count(explode(",", $urgent_incoming->specimen)) }} {{ __('investigations.samples') }}</td>
<td>
@if($urgent_incoming->inpatient == 0 && $urgent_incoming->inpatient_bill_generated == 0 && $urgent_incoming->payment_status == 0 && !can_investigations_be_performed(get_name($urgent_incoming->patient_id, 'id', 'category_id', 'patients')))
<code class="text-center">{{ __('investigations.patient_has_not_paid_for_ordered_investigations') }}</code>
@else
<a class="btn btn-success btn-rounded btn-sm" href="/investigations/view_lab_results_details/{{ $urgent_incoming->id }}">{{ __('investigations.add') }}</a>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endif
<div id="all_complete_nav_pill" class="tab-pane">
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>{{ __('investigations.lab_number') }}</th>
<th>{{ __('investigations.requested') }}</th>
<th>{{ __('investigations.received') }}</th>
<th>{{ __('investigations.performed_at') }}</th>
<th>{{ __('investigations.turn_around_time') }}</th>
<th>{{ __('investigations.patient') }}</th>
<th>{{ __('investigations.source') }}</th>
<th>{{ __('investigations.payment') }}</th>
<th>{{ __('investigations.request') }}</th>
<th>{{ __('investigations.specimen') }}</th>
<th>{{ __('investigations.results') }}</th>
</tr>
</thead>
<tbody>
@foreach($all_complete as $incoming)
<tr>
<td>{{ sprintf("%04u", $incoming->id) }}</td>
<td>{{ streamline_date_time_short($incoming->created_at) }}</td>
<td>{{ streamline_date_time_short($incoming->request_received_date) }}</td>
<td>{{ $incoming->results_created_at ? streamline_date_time_short($incoming->results_created_at) : "N/A" }}</td>
<td>{{ \Carbon\Carbon::parse($incoming->results_created_at)->diffForHumans(\Carbon\Carbon::parse($incoming->request_received_date)) }} request received</td>
<td>
{{ get_full_name($incoming->patient_id, 'id', 'first_name', 'last_name', 'patients') }}
({{ get_name($incoming->patient_id, 'id', 'number', 'patients') }}) - ({{ get_name(get_name($incoming->patient_id, 'id', 'category_id', 'patients'), 'id', 'name', 'patient_categories') }})
</td>
<td>
@if($incoming->inpatient == 1 || $incoming->inpatient_bill_generated == 1)
{{ get_ward_name($incoming->patient_id, $incoming->episode_id) }}
@else
OPD
@endif
</td>
<td>
@if($incoming->payment_status == 0)
@if($incoming->inpatient_bill_generated == 1)
<font color='green'>{{ __('investigations.inpatient_bill_generated') }}</font>
@else
<font color='red'>{{ __('investigations.not_paid') }}</font>
@endif
@else
<font color='green'>{{ __('investigations.paid') }}</font>
@endif
</td>
<td onclick="showQuickView({{ $incoming->id }}, 1)"><i class="fa fa-search"></i> {{ count(explode(",", $incoming->investigation_id)) }} {{ __('investigations.tests') }}</td>
<td onclick="showQuickView({{ $incoming->id }}, 2)"><i class="fa fa-search"></i> {{ count(explode(",", $incoming->specimen)) }} {{ __('investigations.samples') }}</td>
<td>
<a class="btn btn-success btn-rounded btn-sm" href="/investigations/view_lab_results_details/{{ $incoming->id }}">{{ __('investigations.view') }}</a>
</td>
</tr>
@endforeach
@if(count($all_complete) < 1)
<tr>
<td colspan="11" class='text-center' style='color: maroon; font-weight: bold;'>{{ __('investigations.no_results_available') }}</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal" id="modal_receive_request" tabindex="-1" role="dialog" aria-labelledby="debt_plan_modal_label" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"><b id="modal_heading"></b></h4>
</div>
<div class="modal-body">
<div class="table-responsive" id="modal_table"></div>
<div id="modal_specimen_edit"></div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/sheetjs/xlsx.full.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/sheetjs/FileSaver.min.js') }}"></script>
<script type="text/javascript">
$('#patient_number').change(function () {
let id = $('#patient_number').val();
$('#patient_id').val(id);
});
$('#patient_number').select2({
placeholder: 'Search by patient details (names and number)',
ajax: {
url: '/patients/search_patient_by_name_number',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.first_name + " " + item.last_name + " (" + item.number + ")",
id: item.id
}
})
};
},
cache: true
}
});
$('#search_date_by').change(function() {
if($(this).val() === "custom_date"){
$("#end_date_div").hide();
$("#start_date_div").show();
} else if($(this).val() === "custom_date_range") {
$("#start_date_div").show();
$("#end_date_div").show();
} else {
$("#end_date_div").hide();
$("#start_date_div").hide();
}
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
function showQuickView(id, type) {
$.ajax({
method: 'POST',
url: '/investigations/view_lab_results_quick_view',
data: {'id': id, 'type': type},
success: function(response){
let responseArray = JSON.parse(response);
$("#modal_table").html(responseArray["html"]);
$("#modal_heading").html("Lab details for " + responseArray["patient_name"] + "(" + responseArray["patient_number"] + ")");
if (type == 2) {
$("#modal_specimen_edit").html('<a class="btn btn-link btn-block" href="/investigations/edit_investigation_specimen/' + id +'">Edit Specimen</a>');
} else {
$("#modal_specimen_edit").html("");
}
$('#modal_receive_request').modal('show');
}
});
}
function export_to_excel() {
if ($('#urgent_incoming_results').is(":visible")) {
var row_ids = ['per_results_nav_pill','urgent_incoming_results','all_complete_nav_pill'];
var sheet_names = ['All Incoming','Urgent Incoming','All Complete'];
} else {
var row_ids = ['per_results_nav_pill','all_complete_nav_pill'];
var sheet_names = ['All Incoming','All Complete'];
}
var sheet_data =[];
for (let i = 0; i < row_ids.length; i++) {
sheet_data.push(XLSX.utils.table_to_sheet(document.getElementById(row_ids[i])));
}
/* create a new blank workbook */
var wb = XLSX.utils.book_new();
for (let index = 0; index < sheet_data.length; index++) {
XLSX.utils.book_append_sheet(wb, sheet_data[index], sheet_names[index]);
}
var wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'binary' });
saveAs(new Blob([s2ab(wbout)], { type: "application/octet-stream" }), '{{ __("layout.lab_results") }}.xlsx');
}
function s2ab(s) {
var buf = new ArrayBuffer(s.length);
var view = new Uint8Array(buf);
for (var i = 0; i < s.length; i++) view[i] = s.charCodeAt(i) & 0xFF;
return buf;
}
</script>
@endpush
@@ -0,0 +1,414 @@
@extends('layouts.main')
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('investigations.lab_results') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/view_lab_results/">{{ __('investigations.view_results') }}</a></li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
<a target="_blank" style="margin-left: 20px" class="btn btn-inverse btn-sm float-right" href='/investigations/print_lab_result_details/{{ $ordered_investigation->id }}'>{{ __('investigations.print') }}</a>
<a target="_blank" class="btn btn-primary btn-sm float-right" onclick="$('#modal_select_print_invs').modal('show');">Selective Print</a>
<br><br>
<div id="print_div">
<div class="row">
<div class="col-md-5">
<table class='table table-bordered table-striped'>
<tr>
<th style='color: black'>{{ __('investigations.patient_names') }}</th>
<td>
{{ get_full_name($ordered_investigation->patient_id, 'id', 'first_name', 'last_name', 'patients') }}
</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.age') }}/{{ __('investigations.gender') }}</th>
<td>
{{ get_patients_age(get_name($ordered_investigation->patient_id, 'id', 'date_of_birth', 'patients')) }}
/
{{ get_name($ordered_investigation->patient_id, 'id', 'gender', 'patients') == 1 ? __('investigations.male') : __('investigations.female') }}
</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.patient_number') }}</th>
<td>{{ get_name($ordered_investigation->patient_id, 'id', 'number', 'patients') }}</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.lab_number') }}</th>
<td>{{ $ordered_investigation->lab_number ?? $ordered_investigation->id }}</td>
</tr>
</table>
</div>
<div class="col-md-5">
<table class='table table-bordered table-striped'>
<tr>
<th style='color: black'>{{ __('investigations.ordered_by') }}</th>
<td>
@php
$created_by = Streamline\Models\User::find($ordered_investigation->created_by);
if ($ordered_investigation->ordered_by) {
$ordered_by_name = $ordered_investigation->ordered_by;
} elseif ($created_by && $created_by->hasRole('Doctors')) {
$ordered_by_name = get_full_name($ordered_investigation->created_by, 'id', 'first_name', 'last_name', 'users');
} else {
$ordered_by_name = __('investigations.self_request');
}
@endphp
@if(is_editing_name_of_lab_doctor_enabled() && Auth::user()->can('edit-name-of-lab-doctor'))
<div class="row">
<div class="col-md-9"><input class="form-control" id="input_ordered_by" value="{{ $ordered_by_name }}"></div>
<div class="col-md-3"><button class="btn btn-block btn-success" style="margin-top: 2px;" onclick="update_ordered_by()">Update</button></div>
</div>
@else
{{ $ordered_by_name }}
@endif
</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.hospital_unit') }}</th>
<td>
@if($ordered_investigation->inpatient == 1)
{{ get_ward_name($ordered_investigation->patient_id, $ordered_investigation->episode_id) }}
@else
OPD
@endif
</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.requested') }}</th>
<td>{{ streamline_date_time($ordered_investigation->created_at) }}</td>
</tr>
<tr>
<th style='color: black'>{{ __('investigations.received') }}</th>
<td>{{ streamline_date_time($ordered_investigation->request_received_date) }}</td>
</tr>
</table>
</div>
<div class="col-md-2">
<div class="pull-right">
{{ getDNS1DBarcodePNG($ordered_investigation->id) }}
<h4>{{ $ordered_investigation->id }}</h4>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-6">
<h4>{{ __('investigations.tests') }}</h4>
<table class='table table-bordered table-striped'>
<tbody>
@php
$records = explode(",", $ordered_investigation->investigation_id);
@endphp
@foreach($records as $record)
<tr>
<td>{{ get_name($record, 'id', 'name', 'investigations') }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="col-md-6">
<h4>{{ __('investigations.specimens') }}</h4>
<table class='table table-bordered table-striped'>
<tbody>
@php
$records = explode(",", $ordered_investigation->specimen);
$status_array = explode(",", $ordered_investigation->specimen_status);
$reason_array = explode(",", $ordered_investigation->specimen_reason);
@endphp
@for($i = 0; $i < count($records); $i++)
<tr>
<td>{{ get_name($records[$i], 'id', 'name', 'laboratory_specimens') }}</td>
<td>
@if ($status_array[$i] == 1)
<font color='green'>{{ __('investigations.taken') }}</font>
@elseif ($status_array[$i] == 2)
<font color='orange'>{{ __('investigations.not_taken') }}</font>
@elseif ($status_array[$i] == 3)
<font color='#ff4500'>{{ __('investigations.rejected') }}</font>
@endif
</td>
<td>{{ isset($reason_array[$i]) ? $reason_array[$i] : "" }}</td>
</tr>
@endfor
</tbody>
</table>
@if($ordered_investigation->investigation_status == 0)
<a class="btn btn-link btn-block" href="/investigations/edit_investigation_specimen/{{ $id }}">{{ __('investigations.edit_specimens') }}</a>
@endif
</div>
</div>
<hr>
<h4 class="text-center">{{ __('investigations.test_results') }}</h4>
<div class="table-responsive">
<table class='table table-bordered table-striped'>
<thead>
<tr>
<th>{{ __('investigations.status') }}</th>
<th>{{ __('investigations.investigation') }}</th>
<th>{{ __('investigations.results') }}</th>
<th>{{ __('investigations.normal_ranges') }}</th>
<th>{{ __('investigations.unit') }}</th>
<th>{{ __('investigations.comments') }}</th>
</tr>
</thead>
<tbody>
@foreach($results as $result)
@if($result['type'] == 0)
<tr>
<td>
@if($result['authenticated'] == 1)
<font color='green'>{{ __('investigations.authenticated') }}</font>
@else
<font color='#ff4500'>{{ __('investigations.not_authenticated') }}</font>
@endif
</td>
<td>{{ $result['name'] }}</td>
@if($result['result'] != "")
<td>
{!! nl2br(e($result['result'])) !!}
@if (!empty($result['document']))
<br><br> <a class="label label-info" href="/patient_documents/{{ $result['document'] }}" target="_blank">{{ __('investigations.lab_result_document') }}</a>
@endif
</td>
<td>{{ $result['range'] }}</td>
<td>
@if(get_name($result['units'], 'id', 'name', 'unit_of_measure') != "N/A")
{{ get_name($result['units'], 'id', 'name', 'unit_of_measure') }}
@endif
</td>
<td>{{ $result['comment'] }}</td>
@else
<td colspan="3" class="text-center"><code>{{ __('investigations.no_results_for_this_investigation') }}</code></td>
<td>
@if(Auth::user()->can('remove-investigation-with-no-result'))
<a class="btn btn-link btn-block btn-sm text-danger" href="/investigations/remove_investigation_with_no_result/{{ $result['id'] }}/{{ $ordered_investigation->id }}" onclick="return confirm('Are you sure you want to remove this investigation with no results?')">Remove Investigation</a>
@endif
</td>
@endif
</tr>
@elseif($result['type'] == 1)
<tr>
<td>
@if($result['authenticated'] == 1)
<font color='green'>{{ __('investigations.authenticated') }}</font>
@else
<font color='#ff4500'>{{ __('investigations.not_authenticated') }}</font>
@endif
</td>
<td colspan="5">{{ $result['name'] }}</td>
</tr>
@php
$specialised_results = \Streamline\Models\InvestigationSpecialisedResult::where('id', $result['result'])->first();
if (!$specialised_results) {
continue;
}
$variable_id_array = explode(',', $specialised_results->specialised_variable_id);
$variable_value_array = explode(',', $specialised_results->value);
$variable_comment_array = explode(',', $specialised_results->comment);
@endphp
@if($specialised_results)
<!-- check if specialised has no results which would be the same as having an array filled with empty values -->
@if($specialised_results->value == implode(",", array_fill(0, count($variable_value_array), "")))
<tr>
<td></td>
<td></td>
<td colspan="3" class="text-center"><code>{{ __('investigations.no_results_for_this_investigation') }}</code></td>
<td>
@if(Auth::user()->can('remove-investigation-with-no-result'))
<a class="btn btn-link btn-block btn-sm text-danger" href="/investigations/remove_investigation_with_no_result/{{ $result['id'] }}/{{ $ordered_investigation->id }}" onclick="return confirm('Are you sure you want to remove this investigation with no results?')">Remove Investigation</a>
@endif
</td>
</tr>
@else
@for($i = 0; $i < count($variable_id_array); $i++)
<tr>
<td></td>
<td>{{ get_name($variable_id_array[$i], 'id', 'name', 'investigation_specialised_variables') }}</td>
<td>{!! nl2br(e($variable_value_array[$i])) !!}</td>
<td>
@if(get_name($variable_id_array[$i], 'id', 'range_type', 'investigation_specialised_variables') == 1)
{{ get_dynamic_normal_range_specialized($variable_id_array[$i], get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients')) }}
@else
{{ get_name($variable_id_array[$i], 'id', 'normal_ranges', 'investigation_specialised_variables') }}
@endif
</td>
<td>
@if(get_name(get_name($variable_id_array[$i], 'id', 'units', 'investigation_specialised_variables'), 'id', 'name', 'unit_of_measure') != "N/A")
{{ get_name(get_name($variable_id_array[$i], 'id', 'units', 'investigation_specialised_variables'), 'id', 'name', 'unit_of_measure') }}
@endif
</td>
<td>{{ $variable_comment_array[$i] }}</td>
</tr>
@endfor
@endif
@endif
<tr><td colspan="6"></td></tr>
@endif
@endforeach
@if(count($results) < 1)
<tr>
<td colspan="6" class="text-center">
<p><code>{{ __('investigations.no_results_available') }}</code></p>
<a class="btn btn-primary btn-rounded btn-sm" href="/investigations/reverse_receiving_investigations/{{ $ordered_investigation->id }}" onclick="return confirm('Are you sure you want to un-receive this investigation order')">Un-receive Investigation Order</a>
</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
<br>
<div class="row">
<div class="col-md-6">
@if($ordered_investigation->investigation_status == 0)
<div class="row">
<div class="col-md-6">
{{ Form::open(['route' => 'investigations.ordered_results']) }}
{{ Form::hidden('order_id',$ordered_investigation->id) }}
{{ Form::hidden('order_type', 'Lab') }}
{{ Form::hidden('patient_id',$ordered_investigation->patient_id) }}
{{ Form::hidden('episode_id',$ordered_investigation->episode_id) }}
<button type="submit" class="btn btn-success btn-rounded btn-sm">{{ __('investigations.enter_manual_results') }}</button>
{{ Form::close() }}
</div>
<div class="col-md-6">
@php $lab_machine_result = \Streamline\Models\LabMachineResult::where('sample_id', $ordered_investigation->id)->first(); @endphp
@if($lab_machine_result)
<a class="btn btn-primary btn-rounded btn-sm" href="javascript:void(0);" onclick="previewLabMachineResults({{ $lab_machine_result->id }})">Preview Results From Machine</a>
@endif
</div>
</div>
@endif
</div>
<div class="col-md-6">
@if(count($results) > 0 && is_sms_enabled())
<a class="btn btn-primary btn-rounded btn-sm pull-right" onclick="send_sms_to_patient('{{ $ordered_investigation->patient_id }}')">Send SMS Alert to Patient</a>
@endif
</div>
</div>
</div>
<div class="modal" id="modal_select_print_invs" tabindex="-1" role="dialog" aria-labelledby="modal_select_print_invs" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"><b>Select investigations you want to print</b></h4>
</div>
<div class="modal-body">
{{ Form::open(['route' => 'investigations.print_selective_lab_result_details', 'target' => '_blank']) }}
@php $records = explode(",", $ordered_investigation->investigation_id); @endphp
@foreach($records as $record)
<input type="checkbox" name="invs_to_print[]" value="{{ $record }}">
<label>{{ get_name($record, 'id', 'name', 'investigations') }}</label><br>
@endforeach
{{ Form::hidden('id', $ordered_investigation->id) }}
<br><br><br>
<button type="submit" class="btn btn-success">Print</button>
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('layout.cancel') }}</button>
{{ Form::close() }}
</div>
</div>
</div>
</div>
<div class="modal" id="modal_lab_machine_preview" tabindex="-1" role="dialog" aria-labelledby="debt_plan_modal_label" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Results Preview</h4>
</div>
<div class="modal-body">
<div class="table-responsive" id="modal_table"></div>
<a class="btn btn-primary btn-rounded btn-sm" href="/lab_machines/import_results/{{ $ordered_investigation->id }}" onclick="return confirm('Are you sure you want to import these results')">Import Results From Machine</a>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script>
function send_sms_to_patient(patient_id) {
if (confirm("Are you sure you want to send an sms alert to the patient?")){
$.ajax({
method: 'GET',
url: '/sms/send_investigation_alert/' + patient_id,
success: function(response){
alert(response);
}
});
} else {
return false;
}
}
function previewLabMachineResults(id) {
$.ajax({
method: 'GET',
url: '/lab_machines/preview_lab_machine_results/' + id,
success: function(response){
let responseArray = JSON.parse(response);
$("#modal_table").html(responseArray["html"]);
$('#modal_lab_machine_preview').modal('show');
}
});
}
function update_ordered_by () {
let id = "{{ $ordered_investigation->id }}";
let name = $('#input_ordered_by').val();
$.ajax({
url: '/investigations/update_by_ordered_by',
method : 'POST',
data : {'id':id,'name':name},
success : function (response) {
if(response == 1){
alert('Doctor Has Been Updated Successfully.')
$('#input_ordered_by').val(name);
}
},
error : function (error) {
console.log(error)
}
});
};
</script>
@endpush
@@ -0,0 +1,143 @@
@extends('layouts.main')
@push('styles')
<style type="text/css">
#divToPrint{
font-size: 13px;
color: #7c7c7c;
}
#results_table{
font-size: 1em;
font-weight: normal;
font-family: monospace
}
#results_table th{
border: 1px solid #dddddd;
}
#results_table td{
border: 1px solid #dddddd;
}
</style>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-4 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">{{ __('investigations.result_details') }}</h4>
</div>
<div class="col-lg-8 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li><a href="/investigations/index">{{ __('investigations.investigations') }}</a></li>
<li class="active">{{ __('investigations.result_details') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
</div>
</div>
<br>
<div class="white-box">
<a target="_blank" href="/investigations/print_patient_investigation_results/{{ $result_id }}" class="btn btn-inverse float-right">{{ __('investigations.print') }}</a>
<a target="_blank" class="btn btn-primary float-right" onclick="$('#modal_select_print_invs').modal('show');">{{ __('investigations.selective_print') }}</a>
@include('flash::message')
<h4>{{ __('investigations.results_for_episode') }} {{ $inv['date'] }}</h4>
<table class="table table-striped table-bordered color-table success-table" id="results_table">
<thead>
<tr>
<th style="width: 30%">{{ __('investigations.investigation') }}</th>
<th @if($result_type != "Lab") style="display: none;" @else style="width: 20%" @endif>{{ __('investigations.normal_range') }}</th>
<th style="width: 30%">{{ __('investigations.results') }}</th>
<th style="width: 20%">{{ __('investigations.comments') }}</th>
</tr>
</thead>
<tbody>
@foreach($inv['data'] as $value)
@if($value['type'] == 0)
<tr>
<td>{{ $value['name'] }}</td>
<td @if($result_type != "Lab") style="display: none;" @endif>{{ $value['range'] }}</td>
@if($value['result'] != "" || $value['slug'] == "echo")
<td>
@if($value['slug'] == "echo" && $value['result'] == "")
<a target="_blank" class="fcbtn btn btn-sm btn-info btn-outline btn-1d" href='{{ url("/investigations/print-cardio-echo/{$patient->id}/{$episode_id}") }}'> <i class="fa fa-print"></i> <span>{{ __('investigations.view_echo_results') }}</span></a>
@else
{!! nl2br(e($value['result'])) !!}
@endif
</td>
<td>{!! nl2br(e($value['comment'])) !!}</td>
@else
<td class="text-center"><code>{{ __('investigations.no_results_for_this_investigation') }}</code></td>
<td>
@if(Auth::user()->can('remove-investigation-with-no-result'))
<a class="btn btn-link btn-block btn-sm text-danger" href="/investigations/remove_investigation_with_no_result/{{ $value['id'] }}/{{ $order_id }}" onclick="return confirm('Are you sure you want to remove this investigation with no results?')">{{ __('investigations.remove_investigation') }}</a>
@endif
</td>
@endif
</tr>
@else
<tr>
<td colspan="3">{{ $value['name'] }}</td>
</tr>
@php
$specialised_results = \Streamline\Models\InvestigationSpecialisedResult::where('id', $value['result'])->first();
if (!$specialised_results) {
continue;
}
$variable_id_array = explode(',', $specialised_results->specialised_variable_id);
$variable_value_array = explode(',', $specialised_results->value);
$variable_comment_array = explode(',', $specialised_results->comment);
@endphp
@for($i = 0; $i < count($variable_id_array); $i++)
<tr>
<td>{{ get_name($variable_id_array[$i], 'id', 'name', 'investigation_specialised_variables') }}</td>
<td>{{ $variable_value_array[$i] }}</td>
<td>{{ $variable_comment_array[$i] }}</td>
</tr>
@endfor
<tr><td colspan="3"></td></tr>
@endif
@endforeach
</tbody>
</table>
<br><br>
</div>
<div class="modal" id="modal_select_print_invs" tabindex="-1" role="dialog" aria-labelledby="modal_select_print_invs" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"><b>{{ __('investigations.select_investigations_you_want_to_print') }}</b></h4>
</div>
<div class="modal-body">
{{ Form::open(['route' => 'investigations.print_selective_patient_investigation_results', 'target' => '_blank']) }}
@foreach($inv['data'] as $value)
<input type="checkbox" name="invs_to_print[]" value="{{ $value['id'] }}">
<label>{{ $value['name'] }}</label><br>
@endforeach
{{ Form::hidden('result_id', $result_id) }}
<br><br><br>
<button type="submit" class="btn btn-success">{{ __('investigations.print') }}</button>
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('layout.cancel') }}</button>
{{ Form::close() }}
</div>
</div>
</div>
</div>
@endsection
@@ -0,0 +1,447 @@
@extends('layouts.main')
@section('content')
<div class="row bg-title">
<div class="col-md-7">
<h4 class="page-title">{{ __('investigations.other_ultrasound_results') }}</h4>
</div>
<div class="col-md-5">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('investigations.dashboard') }}</a></li>
<li class="active">{{ __('investigations.results') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('patients::allergies.header')
</div>
</div>
<div class="white-box">
@include('flash::message')
<div class="row">
<div class="col-md-3">
<div class="form-group">
{{ Form::label('scan_date', __('investigations.date_of_scan')) }}
<div class="input-group">
{{ Form::text('scan_date', streamline_date($report->scan_date), ['class'=>'form-control compulsory', 'readonly']) }}
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
{{ Form::label('sonographer_name', __('investigations.sonographer')) }}
{{ Form::text('sonographer_name', get_full_name($report->sonographer, 'id', 'first_name', 'last_name', 'users'), ['class' => 'form-control compulsory', 'readonly']) }}
</div>
</div>
<div class="col-md-3">
<div class="form-group">
{{ Form::label('no_of_foetus', __('investigations.number_of_foetus')) }}
<input type="number" id="numberInput" name="no_of_foetus" class="form-control compulsory" min="1" readonly value="{{ $report->no_of_foetus ?? '1' }}" onchange="showFoetusColumns()">
</div>
</div>
<div class="col-md-2"></div>
<div class="col-md-1">
<label style="display: block;">&nbsp;</label>
<a href="<?php echo url("/investigations/print_ultrasound_results_obstetric/{$obstetric_result_id}") ?>" target="_blank" class="btn btn-inverse">{{ __('investigations.print') }}</a>
</div>
</div>
<h4>{{ __('investigations.obstetric_ultrasound_order_details') }}</h4>
<div class="table-responsive">
<table class="table table-primary table-striped table-thead-simple table-hover table-bordered">
<tr>
<th>{{ __('investigations.order_date') }}</th>
<td colspan="5">{{ streamline_date($invs_order->created_at) }}</td>
</tr>
@if($anc_details)
<tr>
<th>{{ __('investigations.gravida') }}</th>
<td>{{ $anc_details->gravida }}</td>
<th>{{ __('investigations.para') }}</th>
<td>{{ $anc_details->para }}</td>
<th>{{ __('investigations.abortions') }}</th>
<td>{{ $anc_details->abortion }}</td>
</tr>
<tr>
<th>{{ __('investigations.lmp') }}</th>
<td>{{ streamline_date($anc_details->lmp) }}</td>
<th>{{ __('investigations.accuracy') }}</th>
<td>{{ get_name($anc_details->accuracy, 'id', 'name', 'ante_natal_clinic_accuracies') }}</td>
<th>{{ __('investigations.edd') }}</th>
<td>{{ streamline_date($anc_details->edd) }}</td>
</tr>
<tr>
<th>{{ __('investigations.clinic') }}</th>
<td>{{ get_name(get_name($episode_id, 'id', 'clinic_id', 'patient_episodes'), 'id', 'name', 'clinics') }}</td>
<th>{{ __('investigations.requested_by') }}</th>
<td>
{{ get_full_name($invs_order->created_by, 'id', 'first_name', 'last_name', 'users') }}
</td>
<th>{{ __('investigations.phone') }}</th>
<td>{{ get_name($invs_order->created_by, 'id', 'phone', 'users') }}</td>
</tr>
<tr>
<th>{{ __('investigations.comment') }}</th>
<td colspan="5">{{ $invs_order->comment }}</td>
</tr>
@else
<tr>
<td colspan="2">{{ __('investigations.information_not_available') }}</td>
</tr>
@endif
</table>
</div>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th >{{ __('investigations.item') }}</th>
<th ><div class="foetus1header hiddenx">1</div></th>
<th><div class="foetus2header hidden">2</div></th>
<th><div class="foetus3header hidden">3</div></th>
</tr>
</thead>
<tbody>
{{-- @dd($report->crown_rump) --}}
<tr>
<td>{{ __('investigations.crown_rump_length') }} (cm)</td>
<td>
<div class="form-group">
{{ Form::text('crown_rump1', split_string_null_check($report->crown_rump, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r1 hidden">
{{ Form::text('crown_rump2', split_string_null_check($report->crown_rump, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r1 hidden">
{{ Form::text('crown_rump3', split_string_null_check($report->crown_rump, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.bi_parietal_diameter') }} (cm)</td>
<td>
<div class="form-group">
{{ Form::text('bi_parietal_diameter1', split_string_null_check($report->bi_parietal_diameter, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r2 hidden">
{{ Form::text('bi_parietal_diameter2', split_string_null_check($report->bi_parietal_diameter, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r2 hidden">
{{ Form::text('bi_parietal_diameter3', split_string_null_check($report->bi_parietal_diameter, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.head_circumference') }} (cm)</td>
<td>
<div class="form-group">
{{ Form::text('head_circumference1', split_string_null_check($report->head_circumference, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r3 hidden">
{{ Form::text('head_circumference2', split_string_null_check($report->head_circumference, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r3 hidden">
{{ Form::text('head_circumference3', split_string_null_check($report->head_circumference, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.abdominal_circumference') }} (cm)</td>
<td>
<div class="form-group">
{{ Form::text('abdominal_circumference1', split_string_null_check($report->abdominal_circumference, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r4 hidden">
{{ Form::text('abdominal_circumference2', split_string_null_check($report->abdominal_circumference, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r4 hidden">
{{ Form::text('abdominal_circumference3', split_string_null_check($report->abdominal_circumference, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
{{-- @dd($report) --}}
<tr>
<td>{{ __('investigations.femur_length') }} (cm)</td>
<td>
<div class="form-group">
{{ Form::text('femur_length1', split_string_null_check($report->femur_length, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r5 hidden">
{{ Form::text('femur_length2', split_string_null_check($report->femur_length, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r5 hidden">
{{ Form::text('femur_length3', split_string_null_check($report->femur_length, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.estimated_foetal_weight') }} (kg)</td>
<td>
<div class="form-group">
{{ Form::text('estimated_foetal_weight1', split_string_null_check($report->estimated_foetal_weight, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r6 hidden">
{{ Form::text('estimated_foetal_weight2', split_string_null_check($report->estimated_foetal_weight, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r6 hidden">
{{ Form::text('estimated_foetal_weight3', split_string_null_check($report->estimated_foetal_weight, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.average_gestation_age') }} ({{ __('investigations.weeks') }})</td>
<td>
<div class="form-group">
{{ Form::text('average_gestational_age1', split_string_null_check($report->average_gestational_age, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r7 hidden">
{{ Form::text('average_gestational_age2', split_string_null_check($report->average_gestational_age, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r7 hidden">
{{ Form::text('average_gestational_age3', split_string_null_check($report->average_gestational_age, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.edd') }}</td>
<td>
<div class="input-group">
{{ Form::text('expected_delivery_date1', split_string_null_check($report->expected_delivery_date, 0), ['class'=>'form-control', 'id'=>'expected_delivery_date1', 'readonly']) }}
</div>
</td>
<td>
<div class="input-group foetus2r8 hidden">
{{ Form::text('expected_delivery_date2', split_string_null_check($report->expected_delivery_date, 1), ['class'=>'form-control', 'id'=>'expected_delivery_date2', 'readonly']) }}
</div>
</td>
<td>
<div class="input-group foetus3r8 hidden">
{{ Form::text('expected_delivery_date3', split_string_null_check($report->expected_delivery_date, 2), ['class'=>'form-control', 'id'=>'expected_delivery_date2', 'readonly']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.presentation') }}</td>
<td>
<div class="form-group">
{{ Form::text('presentation1', split_string_null_check($report->presentation, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r9 hidden">
{{ Form::text('presentation2', split_string_null_check($report->presentation, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r9 hidden">
{{ Form::text('presentation3', split_string_null_check($report->presentation, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.placental_site') }}</td>
<td>
<div class="form-group">
{{ Form::text('placental_site2', split_string_null_check($report->placental_site, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r10 hidden">
{{ Form::text('placental_site2', split_string_null_check($report->placental_site, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r10 hidden">
{{ Form::text('placental_site3', split_string_null_check($report->placental_site, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.liquor_volume') }} (mls)</td>
<td>
<div class="form-group">
{{ Form::text('liquor_volume1', split_string_null_check($report->liquor_volume, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r11 hidden">
{{ Form::text('liquor_volume2', split_string_null_check($report->liquor_volume, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r11 hidden">
{{ Form::text('liquor_volume3', split_string_null_check($report->liquor_volume, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
<tr>
<td>{{ __('investigations.cord_artery_doppler') }}</td>
<td>
<div class="form-group">
{{ Form::text('cord_artery_doppler1', split_string_null_check($report->cord_artery_doppler, 0), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus2r12 hidden">
{{ Form::text('cord_artery_doppler2', split_string_null_check($report->cord_artery_doppler, 1), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
<td>
<div class="form-group foetus3r12 hidden">
{{ Form::text('cord_artery_doppler3', split_string_null_check($report->cord_artery_doppler, 2), ['class' => 'form-control', 'readonly']) }}
</div>
</td>
</tr>
@php
//explode comments with separator ,,,
$comments = !empty($report->comments) ? explode(",,,",$report->comments) : '';
@endphp
<tr>
<td>{{ __('investigations.comments_additional_info') }}</td>
<td>
<div class="form-group">
<textarea class="form-control " name="comments1" rows="7" readonly > {{ $comments[0] ?? ''}} </textarea>
</div>
</td>
<td>
<div class="form-group foetus2r13 hidden">
<textarea class="form-control" name="comments2" rows="7" readonly > {{ $comments[1] ?? ''}} </textarea>
</div>
</td>
<td>
<div class="form-group foetus3r13 hidden">
<textarea class="form-control" name="comments3" rows="7" readonly > {{ $comments[2] ?? ''}} </textarea>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
@endsection
@push('scripts')
{{-- show foetus data columns on change of foetus number input --}}
<script>
//function to load the colummns
function showFoetusColumns() {
var inputVal = parseInt(document.getElementById("numberInput").value);
// div classes with their respective visibility requirements
var divClasses = {
//foetus one sections
'foetus1header': 1,'foetus1r1': 1,'foetus1r2': 1, 'foetus1r3': 1,'foetus1r4': 1,'foetus1r5': 1,'foetus1r6': 1,'foetus1r7': 1,'foetus1r8': 1,'foetus1r9': 1, 'foetus1r10': 1,'foetus1r11': 1,'foetus1r12': 1,'foetus1r13': 1,
//foetus two sections
'foetus2header': 2,'foetus2r1': 2,'foetus2r2': 2,'foetus2r3': 2,'foetus2r4': 2,'foetus2r5': 2,'foetus2r6': 2,'foetus2r7': 2,'foetus2r8': 2,'foetus2r9': 2, 'foetus2r10': 2,'foetus2r11': 2,'foetus2r12': 2,'foetus2r13': 2,
//foetus three sections
'foetus3header': 3,'foetus3r1': 3,'foetus3r2': 3,'foetus3r3': 3,'foetus3r4': 3,'foetus3r5': 3,'foetus3r6': 3,'foetus3r7': 3,'foetus3r8': 3,'foetus3r9': 3, 'foetus3r10': 3,'foetus3r11': 3,'foetus3r12': 3,'foetus3r13': 3,
};
// Loop through the divClasses object
for (var className in divClasses) {
if (divClasses.hasOwnProperty(className)) {
var divs = document.querySelectorAll('.' + className);
divs.forEach(function(div) {
if (inputVal >= divClasses[className]) {
// Show the div
div.classList.remove('hidden');
} else {
// Hide the div and clear its input fields
div.classList.add('hidden');
var inputs = div.querySelectorAll('input, textarea');
inputs.forEach(function(input) {
input.value = ''; // Clear the value of the input field
});
// Reset select elements
var selects = div.querySelectorAll('select');
selects.forEach(function(select) {
select.selectedIndex = 0; // Reset to the first option
//select.value = '';
});
}
});
}
}
}
</script>
<script type="text/javascript">
//load all columns depending on number in input , on page load
window.onload = function() {
showFoetusColumns();
};
</script>
@endpush