mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-13 11:41:31 +00:00
updated streamline-setup v2
This commit is contained in:
Executable
+63
@@ -0,0 +1,63 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
@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">{{ __('patients.appointments') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('patients.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('patients.index') }}">{{ __('patients.patients') }}</a></li>
|
||||
<li class="active">{{ __('patients.appointments') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('patients.patient_name') }}</th>
|
||||
<th>{{ __('patients.clinic') }}</th>
|
||||
<th>{{ __('patients.incharge') }}</th>
|
||||
<th>{{ __('patients.appointment_time') }}</th>
|
||||
<th>{{ __('patients.patient_contact') }}</th>
|
||||
<th>{{ __('patients.comments') }}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($appointments as $appointment)
|
||||
<tr>
|
||||
<td>{{ get_full_name($appointment->patient_id, 'id', 'first_name', 'last_name', 'patients') }}</td>
|
||||
<td>{{ get_name($appointment->clinic_allocation, 'id', 'name', 'clinics') }}</td>
|
||||
<td>
|
||||
@if($appointment->incharge_id != 0)
|
||||
{{ get_full_name($appointment->incharge_id, 'id', 'first_name', 'last_name', 'users') }}
|
||||
@else
|
||||
N/A
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $appointment->appointment_date }} at {{ $appointment->appointment_time }}</td>
|
||||
<td>{{ get_name($appointment->patient_id, 'id', 'phone', 'patients') }}</td>
|
||||
<td>{{ $appointment->comments }}</td>
|
||||
<td><a href="/patients/confirm_appointment/{{ $appointment->id }}" class="btn btn-success">Select</a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript"></script>
|
||||
@endpush
|
||||
Executable
+431
@@ -0,0 +1,431 @@
|
||||
@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">{{ __('patients.patient_appointments_report') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('patients.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('patients.index') }}">{{ __('patients.patients') }}</a></li>
|
||||
<li><a href="{{ url('patients/follow_up') }}">{{ __('patients.patient_appointments') }}</a></li>
|
||||
<li class="active">{{ __('patients.patient_appointments_report') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
{{ Form::open(['route' => 'patients.patient_appointments_report', 'method' => 'ANY', 'role' => 'search']) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
{{ Form::label('clinic_id', __('patients.clinics')) }}
|
||||
{{ Form::select('clinic_id', $clinics, '', ['class' => 'form-control', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
{{ Form::label('appointment_outcome', __('patients.outcome')) }}
|
||||
{{ Form::select('appointment_outcome', ['all' => 'All records', 0 => 'Pending', 1 => 'Complete', 2 => 'Cancelled', 3 => 'Reschedule'], '', ['class' => 'form-control']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="searchby">
|
||||
{{ Form::label('search_by', 'Date') }}
|
||||
{{ Form::select('search_by', ['0'=>'All Records','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', __('patients.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', __('patients.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(__('patients.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_patient']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table success-table table-sm">
|
||||
<thead >
|
||||
<tr style="background-color: #00c292; color: white;">
|
||||
<th>#</th>
|
||||
<th>{{ __('patients.appointment_date') }}</th>
|
||||
<th>{{ __('patients.name') }}</th>
|
||||
<th>{{ __('patients.number') }}</th>
|
||||
<th>{{ __('patients.clinic') }}</th>
|
||||
<th>{{ __('patients.comment') }}</th>
|
||||
<th>{{ __('patients.outcome') }}</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; @endphp
|
||||
@if(count($patient_appointments) > 0)
|
||||
@foreach($patient_appointments as $appointment)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ streamline_date($appointment->appointment_date) }}</td>
|
||||
<td>{!! insurance_flag($appointment->patient_id) !!}</td>
|
||||
<td>{{ get_name($appointment->patient_id, 'id', 'number', 'patients') }}</td>
|
||||
<td>{{ get_name($appointment->clinic_allocation, 'id', 'name', 'clinics') }}</td>
|
||||
<td>
|
||||
{{ $appointment->action_comment }}
|
||||
@if(!is_null($appointment->action_comment))
|
||||
<br><small>{{ __('patients.comment_by') }}: <b>{{ get_full_name($appointment->action_comment_by, "id", "first_name", "last_name", "users") }}</b></small>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($appointment->appointment_fulfilled == 0)
|
||||
Pending
|
||||
@elseif($appointment->appointment_fulfilled == 1)
|
||||
Complete
|
||||
@elseif($appointment->appointment_fulfilled == 2)
|
||||
Cancelled
|
||||
@elseif($appointment->appointment_fulfilled == 3)
|
||||
Rescheduled
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<button class="btn btn-primary btn-sm btn-rounded viewDemographic" value="{{ $appointment->patient_id }}">
|
||||
{{ __('patients.demographics') }}
|
||||
</button>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/patient_episodes/set_patient_id/{{ $appointment->patient_id }}" class="btn btn-default btn-rounded btn-sm">{{ __('patients.select') }}</a>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<a class="btn btn-success btn-rounded btn-sm" onclick="displayAppointmentActions({{ $appointment->patient_id}},{{ $appointment->id}})">{{ __('patients.appointment_actions') }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- modal that pops up when its an action on an appointment -->
|
||||
<div class="modal" id="modal_select_actions" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">{{ __('patients.select_actions') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<a class="btn btn-warning btn-rounded" onclick="reschedule_appointment()">{{ __('patients.reschedule_appointment') }}</a>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<a class="btn btn-danger btn-rounded" onclick="cancel_appointment()">{{ __('patients.cancel_appointment') }}</a>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<button type="button" class="btn btn-default btn-rounded" id="otherAppointmentAction">{{ __('patients.other') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- other comments appointment action -->
|
||||
<div class="modal" id="otherAppointmentActionModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="exampleModalLabel1">{{ __('patients.other_appointment_action') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label>{{ __('patients.comment') }}</label>
|
||||
<textarea name="appointment_comment" class="form-control compulsory" id="appointment_comment" rows="10"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('patients.cancel') }}</button>
|
||||
<input type="button" class="btn btn-success" id="submitAppointmentComment" value="Save"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- patient demographics -->
|
||||
<div class="modal" id="showPatientDemographicModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">{{ __('patients.patient_details') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table class="success-table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="show_patient_demographic">
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<!-- Data table javascript -->
|
||||
<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 type="text/javascript">
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 100,
|
||||
buttons: [
|
||||
'copy',
|
||||
{ extend: 'csv',
|
||||
message: 'LIST OF DID NOT ATTEND APPOINTMENT'
|
||||
},
|
||||
{ extend: 'excel',
|
||||
message: 'LIST OF DID NOT ATTEND APPOINTMENT',
|
||||
exportOptions: {
|
||||
columns: [ 1, 2, 3, 4, 5 ]
|
||||
},
|
||||
sheetName: 'LIST OF DID NOT ATTEND APPOINTMENT ON STREAMLINE'
|
||||
},
|
||||
{ extend: 'pdf',
|
||||
message: 'LIST OF DID NOT ATTEND APPOINTMENT',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'LETTER',
|
||||
exportOptions: {
|
||||
columns: [ 1, 2, 3, 4, 5 ]
|
||||
},
|
||||
customize: function(doc) {
|
||||
doc.defaultStyle.fontSize = 10;
|
||||
// doc.styles.tableHeader.alignment = 'left';
|
||||
}
|
||||
},
|
||||
{ extend: 'print',
|
||||
message: 'LIST OF DID NOT ATTEND APPOINTMENT',
|
||||
exportOptions: {
|
||||
columns: [ 1, 2, 3, 4, 5 ]
|
||||
},
|
||||
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');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
$('.sorting').removeClass('sorting');//remove the sorting class
|
||||
$('.sorting_asc').removeClass('sorting_asc');//remove the sorting class
|
||||
|
||||
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd'
|
||||
});
|
||||
|
||||
$('#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();
|
||||
}
|
||||
});
|
||||
|
||||
$("#otherAppointmentAction").click(function(e){
|
||||
e.preventDefault();
|
||||
$("#modal_select_actions").modal("hide");
|
||||
$("#otherAppointmentActionModal").modal("show");
|
||||
});
|
||||
|
||||
/* stuff for patient appointments */
|
||||
let selectedPatientId = 0;
|
||||
let appointmentId = 0;
|
||||
|
||||
function reschedule_appointment() {
|
||||
if (confirm("Are you sure you want to reschedule the appointment? This action can not be reversed")) {
|
||||
window.location.href = "/patients/reschedule_appointment/" + appointmentId;
|
||||
}
|
||||
}
|
||||
|
||||
function cancel_appointment() {
|
||||
if (confirm("Are you sure you want to cancel the appointment? This action can not be reversed")){
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: '/patients/cancel_patient_appointment/' + appointmentId,
|
||||
success: function(response){
|
||||
if(response == 1) {
|
||||
alert("Appointment has been cancelled");
|
||||
$("#modal_select_actions").modal("hide");
|
||||
location.reload();
|
||||
} else {
|
||||
alert("Cancelling appointment failed. Please try again.");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function displayAppointmentActions(patientId, appointment_id) {
|
||||
selectedPatientId = patientId;
|
||||
appointmentId = appointment_id;
|
||||
|
||||
$("#modal_select_actions").modal("show");
|
||||
}
|
||||
|
||||
function displayActivationModel(){
|
||||
window.location.href = "/patients/complete_appointment/" + appointmentId;
|
||||
}
|
||||
/* end of appointment stuff */
|
||||
|
||||
$('.viewDemographic').click(function(e){
|
||||
e.preventDefault();
|
||||
var episodeId = "";
|
||||
|
||||
var patientId = $(this).val();
|
||||
|
||||
$("#showPatientDemographicModal").modal("show");
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/view_dna_patient_demographic",
|
||||
data: {
|
||||
patient_id: patientId,
|
||||
},
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
$('#show_patient_demographic').html(response);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#submitAppointmentComment').click(function () {
|
||||
var patient_id = selectedPatientId;
|
||||
var set_appointment_id = appointmentId;
|
||||
var appointment_comment = $('#appointment_comment').val();
|
||||
console.log("patient_id " + patient_id);
|
||||
console.log("appointment_id " + set_appointment_id);
|
||||
if (appointment_comment === '') {
|
||||
alert("Please fill out the comment");
|
||||
} else {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/store_appointment_comment",
|
||||
data: {patient_id: patient_id, appointment_comment: appointment_comment, set_appointment_id:set_appointment_id},
|
||||
cache: false,
|
||||
success: function (result) {
|
||||
if (result == 1) {
|
||||
$('#appointment_comment').text(''); //clear appointment comment
|
||||
$('#appointment_comment').val(''); //clear appointment comment
|
||||
$('#otherAppointmentActionModal').modal('hide'); //manually hide the modal
|
||||
location.reload();
|
||||
} else{
|
||||
alert("Error occured. Kindly contact your IT Support");
|
||||
}
|
||||
},
|
||||
error: function (error) {
|
||||
console.log(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@push('styles')
|
||||
<style type="text/css">
|
||||
.color-bordered-table.success-bordered-table {
|
||||
border-top: 0px;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
Executable
+426
@@ -0,0 +1,426 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-md-6">
|
||||
<h4 class="page-title">{{ __('patients.possible_patient_duplicates') }}</h4>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('patients.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('patients.index') }}">{{ __('patients.patients') }}</a></li>
|
||||
<li class="active">{{ __('patients.patient_duplicates') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<h4><strong>{{ __('patients.name') }}: </strong><font style="color: blue">{!! insurance_flag($original_patient->id) !!}</font></h4>
|
||||
<a class="img" href="#modal-photo" data-toggle="modal" style="color: whitesmoke">
|
||||
@if(!is_null($original_patient->photo) && $original_patient->photo != "")
|
||||
<img src='{{ asset($original_patient->photo) }}' class="img-rounded center" alt='Photo not available' />
|
||||
@else
|
||||
<img src="/uploads/streamline_images/person-place-holder.jpg" class="img-rounded center" style='height: 120px; width: 50%' alt='Photo not available' />
|
||||
@endif
|
||||
</a>
|
||||
<hr>
|
||||
<a href="/patient_episodes/set_patient_id/{{ $original_patient->id }}" class="btn btn-success btn-sm">{{ __('patients.select_patient_history') }}</a>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<table class="table-bordered table-condensed table-striped">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.patient_number') }}</b></th>
|
||||
<td>{{ $original_patient->number }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.full_names') }}</b></th>
|
||||
<td>{{ $original_patient->first_name }} {{ $original_patient->last_name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.gender') }}</b></th>
|
||||
<td>{{ $original_patient->gender == 1 ? 'Male' : 'Female' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="hidden-phone"><b>{{ __('patients.age') }}</b></th>
|
||||
<td>{{ get_patients_age($original_patient->date_of_birth) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.district') }}</b></th>
|
||||
<td>{{ isset($districts[$original_patient->district_id]) ? $districts[$original_patient->district_id] : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.county') }}</b></th>
|
||||
<td>{{ isset($counties[$original_patient->county_id]) ? $counties[$original_patient->county_id] : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.sub_county') }}</b></th>
|
||||
<td>{{ isset($subcounties[$original_patient->subcounty_id]) ? $subcounties[$original_patient->subcounty_id] : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.parish') }}</b></th>
|
||||
<td>{{ isset($parishes[$original_patient->parish_id]) ? $parishes[$original_patient->parish_id] : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.village') }}</b></th>
|
||||
<td>{{ isset($villages[$original_patient->village_id]) ? $villages[$original_patient->village_id] : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.patient_record_created_on') }}</b></th>
|
||||
<td>{{streamline_date($original_patient->created_at) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="col-md-5">
|
||||
<table class="table-bordered table-condensed table-striped">
|
||||
<tr>
|
||||
<th><b>{{ __('patients.phone') }}</b></th>
|
||||
<td>{{ $original_patient->phone }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.occupation') }}</b></th>
|
||||
<td>{{ isset($occupations[$original_patient->occupation_id]) ? $occupations[$original_patient->occupation_id] : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.insurance') }}</b></th>
|
||||
<td>{{ $original_patient->insurance_status == 1 ? __('patients.yes') : __('patients.no') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.religion') }}</b></th>
|
||||
<td>{{ !is_null($original_patient->religion_id) ? $religions[$original_patient->religion_id] : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{__('patients.next_of_kin')}}</b></th>
|
||||
<td>{{ $original_patient->next_of_kin }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.next_of_kin_relationship') }}</b></th>
|
||||
<td>{{ isset($relationships[$original_patient->next_of_kin_relationship]) ? $relationships[$original_patient->next_of_kin_relationship] : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{__('patients.phone_of_next_of_kin')}}</b></th>
|
||||
<td>{{ $original_patient->phone_of_next_of_kin }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.last_patient_visit') }} : </b></th>
|
||||
<td>
|
||||
@if(!is_null($last_episode))
|
||||
@php
|
||||
$diagnosis = null;
|
||||
$primary_diagnosis_id = get_name($last_episode->id, 'episode_id', 'primary_diagnosis', 'consultations');
|
||||
|
||||
if($primary_diagnosis_id != "N/A" && $primary_diagnosis_id != ""){
|
||||
$diagnosis = \Streamline\Models\Diagnosis::withTrashed()->find($primary_diagnosis_id);
|
||||
}
|
||||
@endphp
|
||||
<strong>{{ __('consultations.primary_diagnosis') }} : </strong>{{ !is_null($diagnosis) ? $diagnosis->name : '' }}<br>
|
||||
<strong>{{ __('patients.comments') }} : </strong>{{ get_name($last_episode->id, 'episode_id', 'comments', 'consultations') }}<br>
|
||||
@endif
|
||||
<strong>{{ __('patients.date') }} : </strong> {{ !is_null($last_episode) ? streamline_date($last_episode->created_at) : __('patients.no_visit_yet') }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($possible_duplicate_patients)
|
||||
<div class="white-box">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<h2><strong style="color: red">{{ __('patients.possible_duplicate_records') }}</strong></h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@foreach($possible_duplicate_patients as $patient)
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<h4><strong>{{ __('patients.name') }}: </strong><font style="color: blue">{!! insurance_flag($patient->id) !!}</font></h4>
|
||||
<a class="img" href="#modal-photo" data-toggle="modal" style="color: whitesmoke">
|
||||
@if(!is_null($patient->photo) && $patient->photo != "")
|
||||
<img src='{{ asset($patient->photo) }}' class="img-rounded center" alt='Photo not available' />
|
||||
@else
|
||||
<img src="/uploads/streamline_images/person-place-holder.jpg" class="img-rounded center" style='height: 120px; width: 50%' alt='Photo not available' />
|
||||
@endif
|
||||
</a>
|
||||
|
||||
<hr>
|
||||
|
||||
<a href="/patient_episodes/set_patient_id/{{ $patient->id }}" class="btn btn-success btn-sm" >{{ __('patients.select_patient_history') }}</a>
|
||||
<br><br>
|
||||
<a class="btn btn-info btn-sm merge-record" onclick="mergeRecord({{ $patient->id }})">{{ __('patients.merge_records') }}</a>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<table class="table-bordered table-condensed table-striped">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.patient_number') }}</b></th>
|
||||
<td>{{ $patient->number }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.full_names') }}</b></th>
|
||||
<td>{{ $patient->first_name }} {{ $patient->last_name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.gender') }}</b></th>
|
||||
<td>{{ $patient->gender == 1 ? 'Male' : 'Female' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="hidden-phone"><b>{{ __('patients.age') }}</b></th>
|
||||
<td>{{ get_patients_age($patient->date_of_birth) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.district') }}</b></th>
|
||||
<td>{{ isset($districts[$patient->district_id]) ? $districts[$patient->district_id] : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.county') }}</b></th>
|
||||
<td>{{ isset($counties[$patient->county_id]) ? $counties[$patient->county_id] : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.sub_county') }}</b></th>
|
||||
<td>{{ isset($subcounties[$patient->subcounty_id]) ? $subcounties[$patient->subcounty_id] : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.parish') }}</b></th>
|
||||
<td>{{ isset($parishes[$patient->parish_id]) ? $parishes[$patient->parish_id] : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.village') }}</b></th>
|
||||
<td>{{ isset($villages[$patient->village_id]) ? $villages[$patient->village_id] : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.date_registered') }} :</b></th>
|
||||
<td>{{streamline_date($patient->created_at) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="col-md-5">
|
||||
<table class="table-bordered table-condensed table-striped">
|
||||
<tr>
|
||||
<th><b>{{ __('patients.phone') }}</b></th>
|
||||
<td>{{ $patient->phone }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.occupation') }}</b></th>
|
||||
<td>{{ isset($occupations[$patient->occupation_id]) ? $occupations[$patient->occupation_id] : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.insurance') }}</b></th>
|
||||
<td>{{ $patient->insurance_status == 1 ? __('patients.yes') : __('patients.no') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.religion') }}</b></th>
|
||||
<td>{{ !is_null($patient->religion_id) ? $religions[$patient->religion_id] : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{__('patients.next_of_kin')}}</b></th>
|
||||
<td>{{ $patient->next_of_kin }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.next_of_kin_relationship') }}</b></th>
|
||||
<td>{{ isset($relationships[$patient->next_of_kin_relationship]) ? $relationships[$patient->next_of_kin_relationship] : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{__('patients.phone_of_next_of_kin')}}</b></th>
|
||||
<td>{{ $patient->phone_of_next_of_kin }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('patients.last_patient_visit') }} : </b></th>
|
||||
<td>
|
||||
@php
|
||||
$last_episode = \Streamline\Models\PatientEpisode::where('patient_id',$patient->id)->orderBy('created_at', 'desc')->first();
|
||||
@endphp
|
||||
@if(!is_null($last_episode))
|
||||
@php
|
||||
$diagnosis = null;
|
||||
$primary_diagnosis_id = get_name($last_episode->id, 'episode_id', 'primary_diagnosis', 'consultations');
|
||||
|
||||
if($primary_diagnosis_id != "N/A" && $primary_diagnosis_id != ""){
|
||||
$diagnosis = \Streamline\Models\Diagnosis::withTrashed()->find($primary_diagnosis_id);
|
||||
}
|
||||
@endphp
|
||||
<strong>{{ __('patients.primary_diagnosis') }} : </strong>{{ !is_null($diagnosis) ? $diagnosis->name : '' }}<br>
|
||||
<strong>{{ __('patients.comments') }} : </strong>{{ get_name($last_episode->id, 'episode_id', 'comments', 'consultations') }}<br>
|
||||
@endif
|
||||
<strong>{{ __('patients.date') }} : </strong> {{ !is_null($last_episode) ? streamline_date($last_episode->created_at) : __('patients.no_visit_yet') }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- merge dialog box to allow user select master field value -->
|
||||
<div class="modal fade" id="selectMasterDialog" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg" role="document" style="margin-top: 15%;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="wardDispensationModalLabel1">{{ __('patients.select_master_record_or_fields_to_keep') }} </h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{ Form::open(['route' => 'patients.merge_records']) }}
|
||||
<div class="row">
|
||||
<div class="col-sm-8" style="padding-right: 1px;">
|
||||
{{ Form::hidden('original_id', $original_patient->id)}}
|
||||
<table class="table table-bordered table-striped">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><strong>{{ __('patients.select_which_values_to_keep') }}</strong></th>
|
||||
<td><input type="checkbox" name="all_original_fields" id="all_original_fields">{{ __('patients.all_values_from') }} {!! insurance_flag($original_patient->id)!!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.first_name') }}</font></th>
|
||||
<td><input type="radio" class="original_radio" name="first_name" value="{{$original_patient->first_name}}"> {{ $original_patient->first_name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.last_name') }}</font></th>
|
||||
<td><input type="radio" class="original_radio" name="last_name" value="{{$original_patient->last_name}}"> {{ $original_patient->last_name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.gender') }}</font></th>
|
||||
<td><input type="radio" class="original_radio" name="gender" value="{{$original_patient->gender}}"> {{ $original_patient->gender == 1 ? 'Male' : 'Female' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="hidden-phone"><font color="black">{{ __('patients.age') }}</font></th>
|
||||
<td><input type="radio" class="original_radio" name="dob" value="{{$original_patient->date_of_birth}}">{{ get_patients_age($original_patient->date_of_birth) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="hidden-phone"><font color="black">{{ __('patients.phone') }}</font></th>
|
||||
<td><input type="radio" class="original_radio" name="phone" value="{{$original_patient->phone}}">{{ $original_patient->phone }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.category') }}</font></th>
|
||||
<td><input type="radio" class="original_radio" name="category_id" value="{{$original_patient->category_id}}">{{ get_name($original_patient->category_id, "id", "name", "patient_categories") }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.district') }}</font></th>
|
||||
<td><input type="radio" class="original_radio" name="district_id" value="{{$original_patient->district_id}}">{{ isset($districts[$original_patient->district_id]) ? $districts[$original_patient->district_id] : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.county') }}</font></th>
|
||||
<td><input type="radio" class="original_radio" name="county_id" value="{{$original_patient->county_id}}">{{ isset($counties[$original_patient->county_id]) ? $counties[$original_patient->county_id] : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.sub_county') }}</font></th>
|
||||
<td><input type="radio" class="original_radio" name="subcounty_id" value="{{$original_patient->subcounty_id}}">{{ isset($subcounties[$original_patient->subcounty_id]) ? $subcounties[$original_patient->subcounty_id] : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.parish') }}</font></th>
|
||||
<td><input type="radio" class="original_radio" name="parish_id" value="{{$original_patient->parish_id}}">{{ isset($parishes[$original_patient->parish_id]) ? $parishes[$original_patient->parish_id] : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.village') }}</font></th>
|
||||
<td><input type="radio" class="original_radio" name="village_id" value="{{$original_patient->village_id}}">{{ isset($villages[$original_patient->village_id]) ? $villages[$original_patient->village_id] : '' }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-sm-4" style="padding-left: 1px;">
|
||||
<div class="table-responsive" id="modal_table"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-success" id="completeMerge">{{ __('patients.complete') }}</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('layout.close') }}</button>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function mergeRecord(selectedDuplicatePatientId) {
|
||||
console.log(selectedDuplicatePatientId);
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/display_original_and_duplicate_patients',
|
||||
data: {'patient_id': selectedDuplicatePatientId},
|
||||
success: function(response){
|
||||
let responseArray = JSON.parse(response);
|
||||
|
||||
$("#modal_table").html(responseArray["html"]);
|
||||
|
||||
$("#selectMasterDialog").modal("show");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#all_original_fields').change(function() {
|
||||
if (this.checked === true) {
|
||||
$(".original_radio").each(function() {
|
||||
this.checked = true;
|
||||
});
|
||||
$(".duplicate_radio").each(function() {
|
||||
this.checked = false;
|
||||
});
|
||||
$("#all_duplicate_fields").attr('checked', false);
|
||||
} else {
|
||||
$(".original_radio").each(function() {
|
||||
this.checked = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#modal_table").on("change", "#all_duplicate_fields", function (e) {
|
||||
if (this.checked === true) {
|
||||
$(".duplicate_radio").each(function() {
|
||||
this.checked = true;
|
||||
});
|
||||
$(".original_radio").each(function() {
|
||||
this.checked = false;
|
||||
});
|
||||
$("#all_original_fields").attr('checked', false); //false for uncheck
|
||||
} else {
|
||||
$(".duplicate_radio").each(function() {
|
||||
this.checked = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#completeMerge').click(function (e) {
|
||||
|
||||
if($("input[name='first_name']").is(':checked') == false){
|
||||
alert("Please select first name");
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
if($("input[name='last_name']").is(':checked') == false){
|
||||
alert("Please select last name");
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
if($("input[name='gender']").is(':checked') == false){
|
||||
alert("Please select gender");
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
if($("input[name='dob']").is(':checked') == false){
|
||||
alert("Please select age");
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
if($("input[name='district_id']").is(':checked') == false){
|
||||
alert("Please select residence");
|
||||
e.preventDefault();
|
||||
};
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
Executable
+142
@@ -0,0 +1,142 @@
|
||||
@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">{{ __('patients.confirm_appointment') }}</h4>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('patients.dashboard') }}</a></li>
|
||||
<li><a href="{{ url('/patients/follow_up') }}">{{ __('patients.appointments') }}</a></li>
|
||||
<li class="active">{{ __('patients.create') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
@include('errors.list')
|
||||
|
||||
<div class="white-box">
|
||||
<h4>{{ __('patients.patient_information') }}</h4>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<p>{{ __('patients.first_name') }}: {{ get_name($appointment->patient_id, 'id', 'first_name', 'patients') }}</p>
|
||||
<p>{{ __('patients.last_name') }}: {{ get_name($appointment->patient_id, 'id', 'last_name', 'patients') }}</p>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<p>{{ __('patients.patient_number') }}: {{ get_name($appointment->patient_id, 'id', 'number', 'patients') }}</p>
|
||||
<p>{{ __('patients.phone') }}: {{ get_name($appointment->patient_id, 'id', 'phone', 'patients') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h4>{{ __('patients.previous_details') }}</h4>
|
||||
<div class="form-group">
|
||||
{{ Form::label('clinic_allocation', __('patients.assigned_clinic')) }}
|
||||
@if($appointment->clinic_allocation == 0)
|
||||
{{ Form::text('clinic_allocation_previous', __('patients.not_assigned'), ['class' => 'form-control col-sm-12 compulsory', 'readonly']) }}
|
||||
@else
|
||||
{{ Form::text('clinic_allocation_previous', $clinics[$appointment->clinic_allocation], ['class' => 'form-control col-sm-12 compulsory', 'readonly']) }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('in_charge', __('patients.assigned_incharge')) }}
|
||||
@if($appointment->incharge_id == 0)
|
||||
{{ Form::text('in_charge_previous', __('patients.not_assigned'), ['class' => 'form-control col-sm-12 compulsory', 'readonly']) }}
|
||||
@else
|
||||
{{ Form::text('in_charge_previous', get_full_name($appointment->incharge_id, 'id', 'first_name', 'last_name', 'users'), ['class' => 'form-control col-sm-12 compulsory', 'readonly']) }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('appointment_date_previous',__('patients.appointment_date')) }}
|
||||
{{ Form::text('appointment_date_previous', streamline_date($appointment->appointment_date), ['class' => 'form-control col-sm-12 compulsory', 'readonly']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('appointment_time_previous',__('patients.appointment_time')) }}
|
||||
{{ Form::text('appointment_time_previous', $appointment->appointment_time, ['class' => 'form-control col-sm-12 compulsory', 'readonly']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('comments_previous',__('patients.comments')) }}
|
||||
{{ Form::text('comments_previous', $appointment->comments, ['class' => 'form-control col-sm-12 compulsory', 'readonly']) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h4>{{ __('patients.new_details') }}</h4>
|
||||
{{ Form::open(['route' => 'patients.save_confirmed_appointment']) }}
|
||||
|
||||
{{ Form::hidden('appointment_id', $appointment->id) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('clinic_allocation', __('patients.assign_clinic')) }}
|
||||
{{ Form::select('clinic_allocation', $clinics, $appointment->clinic_allocation, ['class' => 'form-control col-sm-12 compulsory search_criteria', 'id' => 'clinic_allocation']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('in_charge', __('patients.assign_incharge')) }}
|
||||
<select name="in_charge" class="form-control col-sm-12 compulsory search_criteria">
|
||||
<option value="0" selected>{{ __('patients.dont_assign_incharge') }}</option>
|
||||
@foreach($users as $user)
|
||||
<option value="{{ $user->id }}">{{ $user->first_name }} {{ $user->last_name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('appointment_date',__('patients.appointment_date')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('appointment_date', date('d-m-Y', strtotime($appointment->appointment_date)),['class' => 'compulsory form-control','readonly','id'=>'appointment_date', 'required']) }}
|
||||
</div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('appointment_time',__('patients.appointment_time')) }}
|
||||
{{ Form::time('appointment_time',$appointment->appointment_time,['class' => 'compulsory form-control','required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('comments',__('patients.comments')) }}
|
||||
{{ Form::textarea('comments',$appointment->comments,['class' => 'form-control', 'data-error'=>'','id'=>'comments']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
{{ Form::button(__('patients.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
|
||||
{{ Form::button(__('patients.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/js/validator.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#appointment_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy',
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+793
@@ -0,0 +1,793 @@
|
||||
@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-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('patients.new_patient') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('patients.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('patients.index') }}">{{ __('patients.patients') }}</a></li>
|
||||
<li class="active">{{ __('patients.register') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box" id="white-box">
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
{{ Form::open(['route' => 'patients.store','data-toggle'=>'validator']) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group">
|
||||
{{ Form::label('first_name',__('patients.first_name')) }}
|
||||
{{ Form::text('first_name','',['class' => 'form-control compulsory', 'required', 'placeholder'=>'Christian name eg Fred', 'id' => 'first_name']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('last_name',__('patients.last_name')) }}
|
||||
{{ Form::text('last_name','',['class' => 'form-control compulsory', 'required','placeholder'=>'Surname eg Asiimwe', 'id' => 'last_name']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<label class="alert alert-danger" id="similar_patients_names" style="display: none"></label>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('gender',__('patients.gender')) }}
|
||||
<br>
|
||||
{{ Form::radio('gender', 1, false, ["required"]) }} {{ __('patients.male') }}
|
||||
{{ Form::radio('gender', 2, false, ["required"]) }} {{ __('patients.female') }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('national_id',__('patients.national_id')) }}
|
||||
{{ Form::text('national_id','',['class' => 'form-control','maxlength'=>15]) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('date_of_birth',__('patients.date_of_birth')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('date_of_birth','',['class' => 'form-control compulsory','readonly','id'=>'date_of_birth', 'required']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group">
|
||||
{{ Form::label('age',__('patients.years')) }}
|
||||
{{ Form::number('age_in_years','0',['class' => 'form-control compulsory','id'=>'age_in_years','min'=>'0','max'=>'120', 'required']) }}
|
||||
</div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<div class="form-group">
|
||||
{{ Form::label('age',__('patients.months')) }}
|
||||
{{ Form::number('age_in_months','0',['class' => 'form-control','id'=>'age_in_months','min'=>'0','max'=>'12']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('marital_status',__('patients.marital_status')) }}
|
||||
<br>
|
||||
@foreach($marital_statuses as $key=>$value)
|
||||
{{ Form::radio('marital_status', $key,false,[]) }} {{ $value }}
|
||||
@endforeach
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('religion',__('patients.religion')) }}
|
||||
{{ Form::select('religion',$religions,'',['class' => 'form-control x']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('occupation',__('patients.occupation')) }}
|
||||
{{ Form::select('occupation',$occupations,'',['class' => 'form-control occupation', 'id' => 'occupation']) }}
|
||||
<a href="#modal_occupation" data-toggle="modal" id="modal_occupation_link"><font size="1">Add new occupation </font></a>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('next_of_kin',__('patients.next_of_kin')) }}
|
||||
{{ Form::text('next_of_kin','',['class' => 'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="kin_div">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
{{ Form::label('next_of_kin_relationship',__('patients.next_of_kin_relationship')) }}
|
||||
{{ Form::select('next_of_kin_relationship',$relationships,'',['class' => 'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
{{ Form::label('next_of_kin_phone',__('patients.next_of_kin_phone')) }}
|
||||
{{ Form::text('next_of_kin_phone','',['class' => 'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('phone',__('patients.phone')) }}
|
||||
{{ Form::text('phone','',['class' => 'form-control compulsory','id' => 'phone', 'required' ]) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<label class="alert alert-danger" id="similar_phone_number" style="display: none"></label>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('alternative_phone', 'Alternative Phone Number') }}
|
||||
{{ Form::text('alternative_phone','',['class' => 'form-control','id' => 'alternative_phone']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('phone_owner',__('patients.phone_owner')) }}
|
||||
<br>
|
||||
{{ Form::radio('phone_owner','self',false,['id'=>'owned']) }} {{ __('patients.self') }}
|
||||
{{ Form::radio('phone_owner','other',false,['id'=>'non_owned']) }} {{ __('patients.other') }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group owner_name" style="display: none;">
|
||||
{{ Form::label("owner_name",__('patients.phone_owner_name')) }}
|
||||
{{ Form::text('owner_name','',['id'=>'owner_name','class' => 'form-control']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('patient_category',__('patients.patient_category'))}}
|
||||
{{ Form::select('patient_category',$patient_categories,'1',['class' => 'form-control compulsory', 'required', 'data-error'=>'']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('company',__('patients.company_slash_employer'))}}
|
||||
{{ Form::select('company', $companies ,'',['class' => 'form-control', 'data-error'=>'', 'id' => 'company']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
<a href="#modal_company" data-toggle="modal" id="modal_company_link"><font size="1">{{ __('patients.add_new_company') }} </font></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-4">
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('language',__('patients.preferred_language')) }}
|
||||
{{ Form::select('language',['vern'=>'Vernacular','eng'=>'English',],'eng',['class' => 'form-control compulsory', 'required', 'data-error'=>'Select the language']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('citizenship',__('patients.citizenship')) }}
|
||||
{{ Form::select('citizenship',['1'=>'Ugandan','0'=>'Non Ugandan'],'',['class' => 'form-control compulsory', 'required', 'data-error'=>'Select the language','id' => 'citizenship']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div id="not_ugandan_regions" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('country_id',__('patients.country_of_origin')) }}
|
||||
{{ Form::select('country_id', $countries, '',['class' => 'form-control', 'data-error'=>'Select the country']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="ugandan_regions">
|
||||
<div class="form-group">
|
||||
{{ Form::label('residence','Residence') }}
|
||||
<select class="form-control col-md-12" name="residence" id="residence" style="display: block; width: 100%" required></select>
|
||||
<div class="help-block with-errors"></div>
|
||||
<a href="#modal_residence" data-toggle="modal" id="modal_residence_link"><font size="1">{{ __('patients.add_new_residence') }} </font></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (!empty($patient_registration_fields))
|
||||
@foreach ($patient_registration_fields as $patient_registration_field)
|
||||
<input type="hidden" name="registration_field_names[]" id="reg_field_{{$patient_registration_field->id}}" value="reg_field_{{$patient_registration_field->id}}"/>
|
||||
@if (!empty($patient_registration_field->options))
|
||||
<div class="form-group">
|
||||
{{ Form::label($patient_registration_field->name, $patient_registration_field->name) }}
|
||||
<select name="registration_field_values[]" id="{{$patient_registration_field->name}}" class="col-sm-12 {{ ($patient_registration_field->compulsory == 1)? 'compulsory':'' }} form-control" {{ ($patient_registration_field->compulsory == 1)? 'required':'' }}>
|
||||
<option value="">--select--</option>
|
||||
@php
|
||||
$options = explode(',',$patient_registration_field->options);
|
||||
for ($i=0; $i < count($options) ; $i++) {
|
||||
echo '<option value="'.$options[$i].'">'.$options[$i].'</option>';
|
||||
}
|
||||
@endphp
|
||||
</select>
|
||||
</div>
|
||||
@else
|
||||
<div class="form-group">
|
||||
{{ Form::label($patient_registration_field->name, $patient_registration_field->name) }}
|
||||
<input type="text" name="registration_field_values[]" class="col-sm-12 {{ ($patient_registration_field->compulsory == 1)? 'compulsory':'' }} form-control" {{ ($patient_registration_field->compulsory == 1)? 'required':'' }}>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@if(is_fingerprint_enabled())
|
||||
<div>
|
||||
{{ Form::label('fingerprint_template',__('patients.patient_fingerprint')) }}
|
||||
|
||||
<div class="fingerprint_box text-center">
|
||||
<img id="fingerprint_image" height="240" width="220">
|
||||
</div>
|
||||
|
||||
{{ Form::hidden('fingerprint_template', '', ['id' => 'fingerprint_template']) }}
|
||||
|
||||
<button type="button" onClick='capture_fingerprint()' class="btn btn-sm btn-primary">{{ __('patients.capture_fingerprint') }}</button>
|
||||
|
||||
<p id="scanner_msg"></p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<hr>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
{{ Form::button(__('patients.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id' => 'patients_submit']) }}
|
||||
{{ Form::button(__('patients.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
<div class="modal fade" id="modal_occupation" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="exampleModalLabel1">{{ __('patients.register_occupation') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="controls">
|
||||
<input id="new_occupation_name" name="new_occupation_name"
|
||||
type="text"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('patients.cancel') }}</button>
|
||||
<input type="button" class="btn btn-success" id="submit_new_occupation" value="<?php echo __('patients.save') ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="modal_company" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="exampleModalLabel1">{{ __('patients.register_company') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
{{ Form::label('company_name', __('patients.company_name')) }}
|
||||
{{ Form::text('company_name', '', ['class' => 'form-control compulsory', 'id' => 'company_name']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('company_contact', __('patients.contact')) }}
|
||||
{{ Form::text('company_contact', '', ['class' => 'form-control compulsory', 'id' => 'company_contact']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('company_identifier', __('patients.identifier')) }}
|
||||
{{ Form::text('company_identifier', '', ['class' => 'form-control', 'id' => 'company_identifier']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('patients.cancel') }}</button>
|
||||
<a class="btn btn-success" onclick="submitCompany()">{{ __('patients.save') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="modal_residence" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">{{ __('patients.add_new_residence') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label>{{ __('patients.district') }}</label>
|
||||
<div id="district_id_div">{{ Form::select('district_id', $districts, '', ['id'=>'district_id','class'=>'form-control compulsory']) }}</div>
|
||||
{{ Form::text('new_district_name', '', ['id' => 'new_district_name', 'class' => 'form-control compulsory', 'style' => 'display: none']) }}
|
||||
<a href="#" id="modal_district_link">{{ __('patients.add_new_district') }}</a>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>{{ __('patients.county') }}</label>
|
||||
<div id="county_id_div"><select class='form-control' name='county_id' id='county_id'></select></div>
|
||||
{{ Form::text('new_county_name', '', ['id' => 'new_county_name', 'class' => 'form-control', 'style' => 'display: none']) }}
|
||||
<a href="#" id="modal_county_link">{{ __('patients.add_new_county') }}</a>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>{{ __('patients.sub_county') }}</label>
|
||||
<div id="subcounty_id_div"><select class='form-control' name='subcounty_id' id='subcounty_id'></select></div>
|
||||
{{ Form::text('new_subcounty_name', '', ['id' => 'new_subcounty_name', 'class' => 'form-control', 'style' => 'display: none']) }}
|
||||
<a href="#" id="modal_subcounty_link">{{ __('patients.add_new_subcounty') }}</a>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>{{ __('patients.parish') }}</label>
|
||||
<div id="parish_id_div"><select class='form-control' name='parish_id' id='parish_id'></select></div>
|
||||
{{ Form::text('new_parish_name', '', ['id' => 'new_parish_name', 'class' => 'form-control', 'style' => 'display: none']) }}
|
||||
<a href="#" id="modal_parish_link">{{ __('patients.add_new_parish') }}</a>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>{{ __('patients.village') }}</label>
|
||||
{{ Form::text('new_village_name', '', ['id' => 'new_village_name', 'class' => 'form-control compulsory']) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('patients.cancel') }}</button>
|
||||
<a class="btn btn-success" onclick="submitResidenceVillage()">{{ __('patients.save') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end of residence modals -->
|
||||
|
||||
<div class="modal" id="modal_similar_patients" 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 text-center"><b>{{ __('patients.similar_patients') }}</b></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="table-responsive" id="modal_table"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('patients.close') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
<!-- pull in select2 for auto searchanble drop downs -->
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
{{-- <script src="{{ asset('elite/js/validator.js') }}"></script> --}}
|
||||
<script src="{{ asset('js/patients/create.js') }}"></script>
|
||||
<script src="{{ asset('elite/js/mask.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
function capture_fingerprint() {
|
||||
$.ajax({
|
||||
url: '/patients/fetch_fingerprint_from_scanner/',
|
||||
success: function(response){
|
||||
let responseArray = JSON.parse(response);
|
||||
|
||||
if (responseArray["error_code"] == "0") {
|
||||
let template = responseArray["template"];
|
||||
let pngImage = "data:image/png;base64," + responseArray["image"];
|
||||
|
||||
$("#fingerprint_image").attr('src', pngImage);
|
||||
$('#fingerprint_template').val(template);
|
||||
|
||||
$('#scanner_msg').text("Fingerprint Captured").css('color', 'green');
|
||||
} else {
|
||||
$('#scanner_msg').text("Error Code: " + responseArray["error_code"] + " - Error Message: " + responseArray["error_message"]).css('color', 'red');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function submitResidenceVillage() {
|
||||
let district_id = $("#district_id").val();
|
||||
let county_id = $("#county_id").val();
|
||||
let subcounty_id = $("#subcounty_id").val();
|
||||
let parish_id = $("#parish_id").val();
|
||||
let new_district_name = $("#new_district_name").val();
|
||||
let new_county_name = $("#new_county_name").val();
|
||||
let new_subcounty_name = $("#new_subcounty_name").val();
|
||||
let new_parish_name = $("#new_parish_name").val();
|
||||
let new_village_name = $("#new_village_name").val();
|
||||
|
||||
if ((district_id === "" && new_district_name === "") || new_village_name === "") {
|
||||
alert("Please make sure that you fill in a village name and a district");
|
||||
return false;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/patients/quick_add_residence',
|
||||
data: {
|
||||
'district_id' : district_id, 'county_id' : county_id, 'subcounty_id' : subcounty_id, 'parish_id' : parish_id, 'new_district_name' : new_district_name,
|
||||
'new_county_name' : new_county_name, 'new_subcounty_name' : new_subcounty_name, 'new_parish_name' : new_parish_name, 'new_village_name' : new_village_name
|
||||
},
|
||||
success: function(response){
|
||||
$('#residence').append($('<option>', {
|
||||
value: response,
|
||||
text: new_village_name
|
||||
})).val(response);
|
||||
$('#modal_residence').modal('hide');
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
console.log(JSON.stringify(jqXHR));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function submitCompany() {
|
||||
var company_name = $("#company_name").val();
|
||||
var company_contact = $("#company_contact").val();
|
||||
var company_identifier = $("#company_identifier").val();
|
||||
|
||||
if ($("#company_name").val() === "" || !$("#company_name").val()) {
|
||||
alert("Please make sure that you fill in a company name");
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($("#company_contact").val() === "" || !$("#company_contact").val()) {
|
||||
alert("Please make sure that you add the company contact");
|
||||
return false;
|
||||
}
|
||||
|
||||
var data = {'company_name':company_name, 'company_contact': company_contact, 'company_identifier': company_identifier};
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/patients/add_company',
|
||||
data: data,
|
||||
success: function(response){
|
||||
if(!isNaN(response)){
|
||||
//response = last inserted id
|
||||
$('#company').append($('<option>', {
|
||||
value: response,
|
||||
text: company_name
|
||||
}));
|
||||
$('#company').val(response);//preselect the newly added referral
|
||||
$('#modal_company').modal('hide'); //manually hide the modal
|
||||
} else {
|
||||
alert("error occurred");
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
alert(JSON.stringify(jqXHR));
|
||||
console.log(JSON.stringify(jqXHR));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#date_of_birth').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd/mm/yyyy',
|
||||
endDate: new Date()
|
||||
});
|
||||
|
||||
$('#age_in_years, #age_in_months').on('change', function () {
|
||||
let years = parseInt($('#age_in_years').val());
|
||||
let months = parseInt($('#age_in_months').val());
|
||||
let possibleBirthday = new Date();
|
||||
|
||||
if (!isNaN(years) || !isNaN(months)) {
|
||||
possibleBirthday.setMonth(possibleBirthday.getMonth() - (months + (years * 12)));
|
||||
$('#date_of_birth').val(format_date(possibleBirthday));
|
||||
} else {
|
||||
alert("<?php echo __('patients.valid_number_years')?>")
|
||||
}
|
||||
});
|
||||
|
||||
function format_date(date) {
|
||||
let d = new Date(date),
|
||||
month = '' + (d.getMonth() + 1),
|
||||
day = '' + d.getDate(),
|
||||
year = d.getFullYear();
|
||||
|
||||
if (month.length < 2) {
|
||||
month = '0' + month;
|
||||
}
|
||||
|
||||
if (day.length < 2) {
|
||||
day = '0' + day;
|
||||
}
|
||||
|
||||
return [day, month, year].join('/');
|
||||
}
|
||||
|
||||
$("#date_of_birth").on('change', function () {
|
||||
var today = new Date();
|
||||
var birthDate = $(this).val();
|
||||
var temp_date = birthDate.split("/");
|
||||
birthDate = new Date(temp_date[2], (temp_date[1] - 1), temp_date[0]);
|
||||
|
||||
//calculate years
|
||||
var age = today.getFullYear() - birthDate.getFullYear();
|
||||
age = parseInt(age);
|
||||
var m = today.getMonth() - birthDate.getMonth();
|
||||
if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
|
||||
age--;
|
||||
}
|
||||
|
||||
//calculate months
|
||||
var monthBirth = birthDate.getMonth() + 1;
|
||||
var monthToday = today.getMonth() + 1;
|
||||
if (monthToday > monthBirth) {
|
||||
var months = monthToday - monthBirth;
|
||||
} else if (monthToday == monthBirth) {
|
||||
var months = 0;
|
||||
} else if (monthToday < monthBirth) {
|
||||
var months = monthToday - monthBirth;
|
||||
months = months + 12;
|
||||
}
|
||||
if (months < 10) {
|
||||
months = '0' + months
|
||||
}
|
||||
|
||||
//set the values
|
||||
$('#age_in_years').val(age);
|
||||
$('#age_in_months').val(months);
|
||||
});
|
||||
|
||||
$('#next_of_kin').on('change', function () {
|
||||
if ($(this).val() != "" && $(this).val() != " ") {
|
||||
$('#kin_div').show();
|
||||
} else {
|
||||
$('#kin_div').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('#first_name, #last_name').change(function () {
|
||||
let first_name = $('#first_name').val();
|
||||
let last_name = $('#last_name').val();
|
||||
|
||||
if (first_name !== "" && last_name !== "") {
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/patients/check_duplicate_patients',
|
||||
data: {'first_name': first_name, 'last_name': last_name},
|
||||
success: function(response){
|
||||
let responseArray = JSON.parse(response);
|
||||
|
||||
if (responseArray["results_count"] > 0) {
|
||||
$("#similar_patients_names").text(responseArray["results_count"] + " patient(s) with similar names were found. Click here to view them and avoid duplicate patient records");
|
||||
$("#similar_patients_names").show();
|
||||
$("#modal_table").html(responseArray["html"]);
|
||||
} else {
|
||||
$("#similar_patients_names").hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#phone').change(function () {
|
||||
let phone = $('#phone').val();
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/patients/check_duplicate_patients',
|
||||
data: {'phone': phone},
|
||||
success: function(response){
|
||||
let responseArray = JSON.parse(response);
|
||||
|
||||
if (responseArray["results_count"] > 0) {
|
||||
$("#similar_phone_number").text(responseArray["results_count"] + " patient(s) with similar phone numbers were found. Click to view them");
|
||||
$("#similar_phone_number").show();
|
||||
$("#modal_table").html(responseArray["html"]);
|
||||
} else {
|
||||
$("#similar_phone_number").hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#similar_patients_names, #similar_phone_number').click(function () {
|
||||
$('#modal_similar_patients').modal('show');
|
||||
});
|
||||
|
||||
$('#district_id').on('change', function () {
|
||||
//remove content from all dependant dropdowns
|
||||
$('#county_id').empty();
|
||||
$('#subcounty_id').empty();
|
||||
$('#parish_id').empty();
|
||||
|
||||
//get selected value
|
||||
let id = $('#district_id').val();
|
||||
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: '/patients/get_counties/' + id,
|
||||
success: function(response){
|
||||
$('#county_id').html(response);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#county_id').on('change', function () {
|
||||
$('#subcounty_id').empty();
|
||||
$('#parish_id').empty();
|
||||
|
||||
//get selected value
|
||||
let id = $('#county_id').val();
|
||||
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: '/patients/get_subcounties/' + id,
|
||||
success: function(response){
|
||||
$('#subcounty_id').html(response);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#subcounty_id').on('change', function () {
|
||||
$('#parish_id').empty();
|
||||
|
||||
//get selected value
|
||||
let id = $('#subcounty_id').val();
|
||||
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: '/patients/get_parishes/' + id,
|
||||
success: function(response){
|
||||
$('#parish_id').html(response);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/* make residence dropdowns searchable */
|
||||
$('#district_id,#county_id,#subcounty_id,#parish_id,#company,#occupation').select2({
|
||||
placeholder: "<?php echo __('patients.select')?>",
|
||||
width: '100%',
|
||||
});
|
||||
|
||||
$('#modal_district_link').click(function () {
|
||||
if($('#new_district_name').is(":visible")) {
|
||||
$('#district_id_div').show();
|
||||
$('#new_district_name').val('').hide();
|
||||
} else {
|
||||
$('#new_district_name').show();
|
||||
$('#district_id_div').val('').hide();
|
||||
$('#district_id').val('');
|
||||
}
|
||||
});
|
||||
|
||||
$('#modal_county_link').click(function () {
|
||||
if($('#new_county_name').is(":visible")) {
|
||||
$('#county_id_div').show();
|
||||
$('#new_county_name').val('').hide();
|
||||
} else {
|
||||
$('#new_county_name').show();
|
||||
$('#county_id_div').hide();
|
||||
$('#county_id').val('');
|
||||
}
|
||||
});
|
||||
|
||||
$('#modal_subcounty_link').click(function () {
|
||||
if($('#new_subcounty_name').is(":visible")) {
|
||||
$('#subcounty_id_div').show();
|
||||
$('#new_subcounty_name').val('').hide();
|
||||
} else {
|
||||
$('#new_subcounty_name').show();
|
||||
$('#subcounty_id_div').hide();
|
||||
$('#subcounty_id').val('');
|
||||
}
|
||||
});
|
||||
|
||||
$('#modal_parish_link').click(function () {
|
||||
if($('#new_parish_name').is(":visible")) {
|
||||
$('#parish_id_div').show();
|
||||
$('#new_parish_name').val('').hide();
|
||||
} else {
|
||||
$('#new_parish_name').show();
|
||||
$('#parish_id_div').hide();
|
||||
$('#parish_id').val('');
|
||||
}
|
||||
});
|
||||
|
||||
//$('.select2-selection.select2-selection--single').addClass('form-control');//add class to select2 display
|
||||
$('.select2-selection.select2-selection--single').css('height', 'calc(3.85rem)');
|
||||
$('.select2-selection.select2-selection--single').css('padding-top', '5px');
|
||||
$('.select2-selection__arrow').css('top', '3px');
|
||||
|
||||
$("#submit_new_occupation").click(function () {
|
||||
var new_occupation_name = $("#new_occupation_name").val();
|
||||
if (new_occupation_name == '') {
|
||||
alert("<?php echo __('patients.fill_name')?>");
|
||||
} else {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/add_new_occupation_dynamically",
|
||||
data: {name: new_occupation_name},
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
if (response == 'false') {
|
||||
alert("<?php echo __('patients.new_occupation_error')?>");
|
||||
} else {
|
||||
$('.occupation').append($('<option>', {
|
||||
value: response,
|
||||
text: new_occupation_name
|
||||
}));
|
||||
$('.occupation').val(response);//preselect the newly added referral
|
||||
//$('#modal_occupation').hide();
|
||||
$('#modal_occupation').modal('hide');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
$("#new_occupation_name").val('');
|
||||
$("#modal_occupation #close").click();
|
||||
});
|
||||
|
||||
$("#citizenship").click(function(){
|
||||
var citizenship = $("#citizenship").val();
|
||||
if (citizenship == 0) {
|
||||
$("#not_ugandan_regions").show();
|
||||
$("#ugandan_regions").hide();
|
||||
$('#residence').prop('required', false);
|
||||
} else {
|
||||
$("#not_ugandan_regions").hide();
|
||||
$("#ugandan_regions").show();
|
||||
$("#country_id").val('');
|
||||
$('#residence').prop('required', true);
|
||||
}
|
||||
});
|
||||
|
||||
$('#residence').select2({
|
||||
placeholder: 'Search residences',
|
||||
ajax: {
|
||||
url: '/patients/search_residences',
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
processResults: function (data) {
|
||||
return {
|
||||
results: $.map(data, function (item) {
|
||||
return {
|
||||
text: item.text,
|
||||
id: item.ids
|
||||
}
|
||||
})
|
||||
};
|
||||
},
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
$("#patients_submit").click(function (e) { // make sure that all compulsory fields have been filled out
|
||||
var empty_compulsory_fields = [];
|
||||
$("#white-box.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;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
Executable
+145
@@ -0,0 +1,145 @@
|
||||
@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">{{ __('patients.create') }}</h4>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('patients.dashboard') }}</a></li>
|
||||
<li><a href="{{ url('/patients/follow_up') }}">{{ __('patients.appointments') }}</a></li>
|
||||
<li class="active">{{ __('patients.create') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
@include('errors.list')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="white-box">
|
||||
<h3 class="box-title m-b-0">{{ __('patients.patient_search') }}</h3>
|
||||
<div class="form-group">
|
||||
<select class="patient_full_name form-control" style="width:100%;" name="patient_full_name" id="patient_full_name"></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<div class="white-box">
|
||||
<h3 class="box-title m-b-0">{{ __('patients.patient_information') }}</h3>
|
||||
<div id="patient_information"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
{{ Form::open(['route' => 'patients.save_appointment']) }}
|
||||
|
||||
{{ Form::hidden('patient_id', '', ['class' => 'patient_id', 'id' => 'patient_id']) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
{{ Form::label('clinic_allocation', __('patients.assign_clinic')) }}
|
||||
{{ Form::select('clinic_allocation', $clinics, '', ['class' => 'form-control col-sm-12 compulsory search_criteria', 'id' => 'clinic_allocation']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('in_charge', __('patients.assign_incharge')) }}
|
||||
<select id="in_charge" class="form-control col-sm-12 compulsory search_criteria">
|
||||
<option value="0">{{ __('patients.dont_assign_incharge') }}</option>
|
||||
@foreach($users as $user)
|
||||
<option value="{{ $user->id }}">{{ $user->first_name }} {{ $user->last_name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
{{ Form::label('appointment_date',__('patients.appointment_date')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('appointment_date','',['class' => 'compulsory form-control','readonly','id'=>'appointment_date', 'required']) }}
|
||||
</div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('appointment_time',__('patients.appointment_time')) }}
|
||||
{{ Form::time('appointment_time','',['class' => 'compulsory form-control','required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('comments',__('patients.comments')) }}
|
||||
{{ Form::textarea('comments','',['class' => 'form-control', 'data-error'=>'','id'=>'comments']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
{{ Form::button(__('patients.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id' => 'submit_button']) }}
|
||||
{{ Form::button(__('patients.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/js/validator.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#appointment_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy',
|
||||
});
|
||||
|
||||
$('.patient_full_name').change(function() {
|
||||
let id = $('#patient_full_name').val();
|
||||
$('#patient_id').val(id);
|
||||
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: "/patients/update_patient_info/" + id,
|
||||
success: function(response){
|
||||
$('#patient_information').html(response).show();
|
||||
},
|
||||
error: function (error) {
|
||||
//console.log(error);
|
||||
}
|
||||
});
|
||||
}).select2({
|
||||
placeholder: "<?php echo "Search by patient name or 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 + ") " + item.phone,
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
};
|
||||
},
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+768
@@ -0,0 +1,768 @@
|
||||
@php use Streamline\Enums\Roles; @endphp
|
||||
@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-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('patients.edit_patient') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('patients.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('patients.index') }}">{{ __('patients.patients') }}</a></li>
|
||||
<li class="active">{{ __('patients.edit_patient') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
<!-- /.col-lg-12 -->
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
@include('flash::message')
|
||||
@foreach ($errors->all() as $error)
|
||||
<div>
|
||||
<font color="red">{{ $error }}</font>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
<div class="white-box" id="white-box">
|
||||
{{ Form::model($patient, ['method' => 'PUT', 'route' => ['patients.update',$patient], 'data-toggle' => 'validator']) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group">
|
||||
{{ Form::label('first_name',__('patients.first_name')) }}
|
||||
{{ Form::text('first_name',$patient->first_name,['class' => 'form-control compulsory', 'required', 'data-error'=>'','placeholder'=>'Christian name eg Fred']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('last_name',__('patients.last_name')) }}
|
||||
{{ Form::text('last_name',$patient->last_name,['class' => 'form-control compulsory', 'required','placeholder'=>'Surname eg Asiimwe']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('gender',__('patients.gender')) }}
|
||||
<br>
|
||||
{{ Form::radio('gender', 1, false, ["required"]) }} {{ __('patients.male') }}
|
||||
{{ Form::radio('gender', 2, false, ["required"]) }} {{ __('patients.female') }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('national_id',__('patients.national_id')) }}
|
||||
{{ Form::text('national_id', strtoupper($patient->national_id),['class' => 'form-control','maxlength'=>15]) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('date_of_birth',__('patients.date_of_birth')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('date_of_birth',$dob,['class' => 'form-control compulsory', 'required','readonly','id'=>'date_of_birth']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group">
|
||||
{{ Form::label('age',__('patients.years')) }}
|
||||
{{ Form::number('age_in_years',\Carbon\Carbon::now()->diffInYears($patient->date_of_birth),['class' => 'form-control compulsory','id'=>'age_in_years','min'=>'0', 'max'=>'120']) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<div class="form-group">
|
||||
@php
|
||||
$months = \Carbon\Carbon::now()->diffInMonths($patient->date_of_birth) - (\Carbon\Carbon::now()->diffInYears($patient->date_of_birth) *12);
|
||||
@endphp
|
||||
{{ Form::label('age',__('patients.months')) }}
|
||||
{{ Form::number('age_in_months',$months,['class' => 'form-control','id'=>'age_in_months','min'=>'0','max'=>'12']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('marital_status',__('patients.marital_status')) }}
|
||||
<br>
|
||||
@foreach($marital_statuses as $key=>$value)
|
||||
{{ Form::radio('marital_status', $key,false,[]) }} {{ $value }}
|
||||
@endforeach
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('religion',__('patients.religion')) }}
|
||||
{{ Form::select('religion',$religions,$patient->religion_id,['class' => 'form-control']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
@if( Auth::user()->hasRole(Roles::SUPER_ADMIN->value))
|
||||
<div class="form-group">
|
||||
{{ Form::label('is_test_patient',__('patients.is_test_patient')) }}
|
||||
<br>
|
||||
{{ Form::radio('is_test_patient', 1, $patient->is_test_patient == 1) }} Yes
|
||||
{{ Form::radio('is_test_patient', 0, $patient->is_test_patient == 0) }} No
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
{{ Form::label('occupation',__('patients.occupation')) }}
|
||||
{{ Form::select('occupation',$occupations, $patient->occupation_id,['class' => 'form-control']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('next_of_kin',__('patients.next_of_kin')) }}
|
||||
{{ Form::text('next_of_kin',$patient->next_of_kin,['class' => 'form-control compulsory','required', 'onchange' => "show('kin_div')"]) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="kin_div">
|
||||
{{ Form::label('next_of_kin_relationship',__('patients.next_of_kin_relationship')) }}
|
||||
{{ Form::select('next_of_kin_relationship',$relationships,$patient->next_of_kin_relationship,['class' => 'form-control compulsory']) }}
|
||||
<br>
|
||||
{{ Form::label('next_of_kin_phone',__('patients.next_of_kin_phone')) }}
|
||||
{{ Form::text('next_of_kin_phone',$patient->phone_of_next_of_kin,['class' => 'form-control']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('phone',__('patients.phone')) }}
|
||||
{{ Form::text('phone',$patient->phone,['class' => 'form-control compulsory']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('alternative_phone', 'Alternative Phone Number') }}
|
||||
{{ Form::text('alternative_phone',$patient->alternative_phone,['class' => 'form-control','id' => 'alternative_phone']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('phone_owner',__('patients.phone_owner')) }}
|
||||
<br>
|
||||
{{ Form::radio('phone_owner','self',($patient->phone_owner == "Self" || $patient->phone_owner == "self") ? 1 : 0,['id'=>'owned']) }} {{ __('patients.self') }}
|
||||
|
||||
{{ Form::radio('phone_owner','other',$patient->phone_owner != "Self" ? 1 : 0,['id'=>'non_owned']) }} {{ __('patients.other') }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group owners_name">
|
||||
{{ Form::label("owner_name",__('patients.phone_owner_name')) }}
|
||||
{{ Form::text('owner_name',$patient->phone_owner,['id'=>'owner_name','class' => 'form-control compulsory']) }}
|
||||
</div>
|
||||
|
||||
<!-- <div class="form-group">
|
||||
{{ Form::label('lc_one',__('patients.lc_one')) }}
|
||||
{{ Form::text('lc_one',$patient->lc_one,['class' => 'form-control', 'data-error'=>'LC 1 chairman\'s name']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div> -->
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('patient_category',__('patients.patient_category'))}}
|
||||
{{ Form::select('patient_category',$patient_categories,$patient->category_id,['class' => 'form-control compulsory', 'required', 'data-error'=>'']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('company',__('patients.company_slash_employer'))}}
|
||||
{{ Form::select('company', $companies ,$patient->company_id,['class' => 'form-control', 'data-error'=>'', 'id' => 'company']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
<a href="#modal_company" data-toggle="modal" id="modal_company_link"><font
|
||||
size="1">{{ __('patients.add_new_company') }} </font></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-4">
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('language',__('patients.preferred_language')) }}
|
||||
{{ Form::select('language',['' => '- select -','eng'=>'English','vern'=>'Vernacular'],$patient->language,['class' => 'form-control compulsory', 'required', 'data-error'=>'Select the language']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('citizenship',__('patients.citizenship')) }}
|
||||
{{ Form::select('citizenship',['' => '- Select -','1'=>'Ugandan','0'=>'Non Ugandan'],$patient->citizenship,['class' => 'form-control compulsory', 'required', 'data-error'=>'Select the language','id' => 'citizenship']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div id="not_ugandan_regions" @if($patient->citizenship == 1) style="display: none" @endif>
|
||||
<div class="form-group">
|
||||
{{ Form::label('country_id',__('patients.country_of_origin')) }}
|
||||
{{ Form::select('country_id', $countries, $patient->country_id, ['class' => 'form-control', 'data-error'=>'Select the country']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="ugandan_regions" @if($patient->citizenship == 0) style="display: none" @endif>
|
||||
<div class="form-group">
|
||||
{{ Form::label('residence','Residence') }}
|
||||
<select class="form-control" name="residence" id="residence" required>
|
||||
@php
|
||||
$residence_array = explode(",", $patient->address_details);
|
||||
$district_id = $residence_array[4] ?? 0;
|
||||
$county_id = $residence_array[3] ?? 0;
|
||||
$subcounty_id = $residence_array[2] ?? 0;
|
||||
$parish_id = $residence_array[1] ?? 0;
|
||||
$village_id = $residence_array[0] ?? 0;
|
||||
@endphp
|
||||
<option value="{{ $patient->address_details ?? '0,0,0,0,0' }}" selected>{{ __('patients.village') }}
|
||||
: {{ get_name($village_id, "id", "name", "villages") }} {{ __('patients.district') }}
|
||||
: {{ get_name($district_id, "id", "name", "districts") }}</option>
|
||||
</select>
|
||||
<div class="help-block with-errors"></div>
|
||||
|
||||
<a href="#modal_village_residence" data-toggle="modal"
|
||||
id="modal_village_residence_link"><font
|
||||
size="1">{{ __('patients.add_new_residence') }} </font></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (!empty($patient_registration_fields))
|
||||
@php $registration_fields = !empty($patient->registration_fields)? json_decode($patient->registration_fields, true):[]; @endphp
|
||||
@foreach ($patient_registration_fields as $patient_registration_field)
|
||||
@php
|
||||
$field_value = 'reg_field_'.$patient_registration_field->id;
|
||||
@endphp
|
||||
<input type="hidden" name="registration_field_names[]"
|
||||
id="reg_field_{{$patient_registration_field->id}}"
|
||||
value="reg_field_{{$patient_registration_field->id}}"/>
|
||||
@if (!empty($patient_registration_field->options))
|
||||
<div class="form-group">
|
||||
{{ Form::label($patient_registration_field->name, $patient_registration_field->name) }}
|
||||
<select name="registration_field_values[]"
|
||||
id="{{$patient_registration_field->name}}"
|
||||
class="col-sm-12 {{ ($patient_registration_field->compulsory == 1)? 'compulsory':'' }} form-control" {{ ($patient_registration_field->compulsory == 1)? 'required':'' }}>
|
||||
<option value="">--select--</option>
|
||||
@php
|
||||
$options = explode(',',$patient_registration_field->options);
|
||||
for ($i=0; $i < count($options) ; $i++) {
|
||||
if(!empty($registration_fields[$field_value]) && $options[$i] == $registration_fields[$field_value]) echo '<option selected value="'.$options[$i].'">'.$options[$i].'</option>';
|
||||
else echo '<option value="'.$options[$i].'">'.$options[$i].'</option>';
|
||||
}
|
||||
@endphp
|
||||
</select>
|
||||
</div>
|
||||
@else
|
||||
<div class="form-group">
|
||||
{{ Form::label($patient_registration_field->name, $patient_registration_field->name) }}
|
||||
<input type="text" name="registration_field_values[]"
|
||||
class="col-sm-12 {{ ($patient_registration_field->compulsory == 1)? 'compulsory':'' }} form-control"
|
||||
{{ ($patient_registration_field->compulsory == 1)? 'required':'' }} value="{{ !empty($registration_fields[$field_value])? $registration_fields[$field_value]:'' }}">
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@if(is_fingerprint_enabled())
|
||||
<div>
|
||||
{{ Form::label('fingerprint_template', __('patients.patient_fingerprint')) }}
|
||||
|
||||
<div class="fingerprint_box text-center">
|
||||
<img id="fingerprint_image" height="240" width="220">
|
||||
</div>
|
||||
|
||||
{{ Form::hidden('fingerprint_template', '', ['id' => 'fingerprint_template']) }}
|
||||
|
||||
<button type="button" onClick='capture_fingerprint()'
|
||||
class="btn btn-sm btn-primary">{{ __('patients.capture_fingerprint') }}</button>
|
||||
|
||||
<p id="scanner_msg"></p>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<hr>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
{{ Form::button(__('patients.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id' => 'patients_submit']) }}
|
||||
{{ Form::button(__('patients.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
|
||||
|
||||
{{ Form::close() }}
|
||||
@if (!in_array($patient->id, $episodes))
|
||||
<form action="{{url('patients', [$patient->id])}}" method="POST" style="float: right;">
|
||||
<input type="hidden" name="_method" value="<?php echo __('patients.delete') ?>">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}">
|
||||
<input href="#modal_reason" data-toggle="modal" id="modal_reason_link" type="button"
|
||||
class="btn btn-danger" value="<?php echo __('patients.deactivate_patient') ?>"/>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Reason for Patient De-activation modal -->
|
||||
<div class="modal fade" id="modal_reason" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
|
||||
aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title"
|
||||
id="exampleModalLabel1">{{ __('patients.reason_for_deactivating_patient') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<input class="form-control compulsory" id="patient_deactivation_reasons"
|
||||
name="patient_deactivation_reasons" type="text" cols="44" rows="5"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default"
|
||||
data-dismiss="modal">{{ __('patients.cancel') }}</button>
|
||||
<button type="button" class="btn btn-danger"
|
||||
onclick="submitDeactivationReason()"><?php echo __('patients.deactivate_patient') ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- new residence modals (add village + add district) -->
|
||||
<div class="modal fade" id="modal_village_residence" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
|
||||
aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="exampleModalLabel1">{{ __('patients.add_new_residence') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label>{{ __('patients.district') }}</label>
|
||||
{{ Form::select('residence_district_name', $districts, '', ['id'=>'residence_district_name','class'=>'form-control compulsory']) }}
|
||||
<a id="modal_district_residence_link" style="cursor: pointer;"><font
|
||||
size="1">{{ __('patients.add_new_district') }} </font></a>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>{{ __('patients.village') }}</label>
|
||||
<input class="form-control compulsory" id="new_residence_village_name"
|
||||
name="new_residence_village_name" type="text"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default"
|
||||
data-dismiss="modal">{{ __('patients.cancel') }}</button>
|
||||
<a class="btn btn-success" onclick="submitResidenceVillage()">{{ __('patients.save') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="modal_district_residence" tabindex="-1" role="dialog" style="padding-top: 50px;">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
|
||||
aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="exampleModalLabel1">{{ __('patients.add_new_residence') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group">
|
||||
<label>{{ __('patients.district') }}</label>
|
||||
<input class="form-control compulsory" id="new_residence_district_name"
|
||||
name="new_residence_district_name" type="text"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default"
|
||||
data-dismiss="modal">{{ __('patients.cancel') }}</button>
|
||||
<a class="btn btn-success" onclick="submitResidenceDistrict()">{{ __('patients.save') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end of residence modals -->
|
||||
|
||||
<div class="modal fade" id="modal_company" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
|
||||
aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="exampleModalLabel1">{{ __('patients.register_company') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
{{ Form::label('company_name', __('patients.company_name')) }}
|
||||
{{ Form::text('company_name', '', ['class' => 'form-control compulsory', 'id' => 'company_name']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('company_contact', __('patients.contact')) }}
|
||||
{{ Form::text('company_contact', '', ['class' => 'form-control compulsory', 'id' => 'company_contact']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('company_identifier', __('patients.identifier')) }}
|
||||
{{ Form::text('company_identifier', '', ['class' => 'form-control', 'id' => 'company_identifier']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default"
|
||||
data-dismiss="modal">{{ __('patients.cancel') }}</button>
|
||||
<a class="btn btn-success" onclick="submitCompany()">{{ __('patients.save') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<!-- <script src="{{ asset('elite/js/validator.js') }}"></script> -->
|
||||
<!-- pull in select2 for auto searchanble drop downs -->
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
<!-- Date Picker Plugin JavaScript -->
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
|
||||
<script src="{{ asset('elite/js/mask.js') }}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
let patient_id = <?php echo $patient->id; ?>;
|
||||
|
||||
function capture_fingerprint() {
|
||||
$.ajax({
|
||||
url: '/patients/fetch_fingerprint_from_scanner/',
|
||||
success: function (response) {
|
||||
let responseArray = JSON.parse(response);
|
||||
|
||||
if (responseArray["error_code"] == "0") {
|
||||
let template = responseArray["template"];
|
||||
let pngImage = "data:image/png;base64," + responseArray["image"];
|
||||
|
||||
$("#fingerprint_image").attr('src', pngImage);
|
||||
$('#fingerprint_template').val(template);
|
||||
|
||||
$('#scanner_msg').text("Fingerprint Captured").css('color', 'green');
|
||||
} else {
|
||||
$('#scanner_msg').text("Error Code: " + responseArray["error_code"] + " - Error Message: " + responseArray["error_message"]).css('color', 'red');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function submitResidenceDistrict() {
|
||||
var new_residence_district_name = $("#new_residence_district_name").val();
|
||||
|
||||
if ($("#new_residence_district_name").val() === "" || !$("#new_residence_district_name").val()) {
|
||||
alert("Please make sure that you fill in a district name");
|
||||
return false;
|
||||
}
|
||||
|
||||
var data = {'new_residence_district_name': new_residence_district_name};
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/patients/quick_add_district_residence',
|
||||
data: data,
|
||||
success: function (response) {
|
||||
if (!isNaN(response)) {
|
||||
//response = last inserted id
|
||||
$('#residence_district_name').append($('<option>', {
|
||||
value: response,
|
||||
text: new_residence_district_name
|
||||
}));
|
||||
$('#residence_district_name').val(response);//preselect the newly added
|
||||
$('#modal_district_residence').modal('hide'); //manually hide the modal
|
||||
$('#modal_village_residence').modal('show');
|
||||
} else {
|
||||
alert("error occurred");
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert(JSON.stringify(jqXHR));
|
||||
console.log(JSON.stringify(jqXHR));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function submitResidenceVillage() {
|
||||
var residence_district_name = $("#residence_district_name").val();
|
||||
var new_residence_village_name = $("#new_residence_village_name").val();
|
||||
|
||||
if ($("#new_residence_village_name").val() === "" || !$("#new_residence_village_name").val() || !$("#residence_district_name").val()) {
|
||||
alert("Please make sure that you fill in a village name and a district");
|
||||
return false;
|
||||
}
|
||||
|
||||
var data = {
|
||||
'residence_district_name': residence_district_name,
|
||||
'new_residence_village_name': new_residence_village_name
|
||||
};
|
||||
var district_village_ids = "";
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/patients/quick_add_village_residence',
|
||||
data: data,
|
||||
success: function (response) {
|
||||
if (!isNaN(response)) {
|
||||
//response = newly created village. Now create residence string i.e village,parish etc
|
||||
district_village_ids = response + ",0" + ",0" + ",0," + residence_district_name;
|
||||
$('#residence').append($('<option>', {
|
||||
value: district_village_ids,
|
||||
text: new_residence_village_name
|
||||
}));
|
||||
$('#residence').val(district_village_ids);//preselect the newly added
|
||||
$('#modal_village_residence').modal('hide'); //manually hide the modal
|
||||
} else {
|
||||
alert("error occurred");
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert(JSON.stringify(jqXHR));
|
||||
console.log(JSON.stringify(jqXHR));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function submitDeactivationReason() {
|
||||
var reason = $("#patient_deactivation_reasons").val();
|
||||
|
||||
if ($("#patient_deactivation_reasons").val() === "" || !$("#patient_deactivation_reasons").val()) {
|
||||
alert("Please fill in the reason for deleting the Patient");
|
||||
return false;
|
||||
}
|
||||
|
||||
var data = {'patient_deactivation_reasons': reason, 'patient_id': patient_id};
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/patients/delete_patient_with_reason',
|
||||
data: data,
|
||||
success: function (response) {
|
||||
if (response == 1) {
|
||||
window.location.href = "/patients";
|
||||
} else {
|
||||
alert("error occurred");
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert(JSON.stringify(jqXHR));
|
||||
console.log(JSON.stringify(jqXHR));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function submitCompany() {
|
||||
var company_name = $("#company_name").val();
|
||||
var company_contact = $("#company_contact").val();
|
||||
var company_identifier = $("#company_identifier").val();
|
||||
|
||||
if ($("#company_name").val() === "" || !$("#company_name").val()) {
|
||||
alert("Please make sure that you fill in a company name");
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($("#company_contact").val() === "" || !$("#company_contact").val()) {
|
||||
alert("Please make sure that you add the company contact");
|
||||
return false;
|
||||
}
|
||||
|
||||
var data = {
|
||||
'company_name': company_name,
|
||||
'company_contact': company_contact,
|
||||
'company_identifier': company_identifier
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/patients/add_company',
|
||||
data: data,
|
||||
success: function (response) {
|
||||
if (!isNaN(response)) {
|
||||
//response = last inserted id
|
||||
$('#company').append($('<option>', {
|
||||
value: response,
|
||||
text: company_name
|
||||
}));
|
||||
$('#company').val(response);//preselect the newly added referral
|
||||
$('#modal_company').modal('hide'); //manually hide the modal
|
||||
} else {
|
||||
alert("error occurred");
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert(JSON.stringify(jqXHR));
|
||||
console.log(JSON.stringify(jqXHR));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#owned').on("click", function () {
|
||||
$('.owners_name').hide();
|
||||
$('#owner_name').val('');
|
||||
});
|
||||
|
||||
$('#non_owned').on("click", function () {
|
||||
$('.owners_name').show();
|
||||
});
|
||||
|
||||
$('#h_contact_yes').on("click", function () {
|
||||
$('.hosp_contact_div').show();
|
||||
});
|
||||
|
||||
$('#h_contact_no').on("click", function () {
|
||||
$('.hosp_contact_div').hide();
|
||||
$('#hospital_contact').val('');
|
||||
});
|
||||
|
||||
jQuery('#date_of_birth').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd/mm/yyyy',
|
||||
endDate: new Date()
|
||||
|
||||
});
|
||||
|
||||
$('#age_in_years, #age_in_months').on('change', function () {
|
||||
let years = parseInt($('#age_in_years').val());
|
||||
let months = parseInt($('#age_in_months').val());
|
||||
let possibleBirthday = new Date();
|
||||
|
||||
if (!isNaN(years) || !isNaN(months)) {
|
||||
possibleBirthday.setMonth(possibleBirthday.getMonth() - (months + (years * 12)));
|
||||
$('#date_of_birth').val(format_date(possibleBirthday));
|
||||
} else {
|
||||
alert("<?php echo __('patients.valid_number_years') ?>")
|
||||
}
|
||||
});
|
||||
|
||||
function format_date(date) {
|
||||
let d = new Date(date),
|
||||
month = '' + (d.getMonth() + 1),
|
||||
day = '' + d.getDate(),
|
||||
year = d.getFullYear();
|
||||
|
||||
if (month.length < 2) {
|
||||
month = '0' + month;
|
||||
}
|
||||
|
||||
if (day.length < 2) {
|
||||
day = '0' + day;
|
||||
}
|
||||
|
||||
return [day, month, year].join('/');
|
||||
}
|
||||
|
||||
$("#date_of_birth").on('change', function () {
|
||||
var today = new Date();
|
||||
var birthDate = $(this).val();
|
||||
var temp_date = birthDate.split("/");
|
||||
birthDate = new Date(temp_date[2], (temp_date[1] - 1), temp_date[0]);
|
||||
|
||||
//calculate years
|
||||
var age = today.getFullYear() - birthDate.getFullYear();
|
||||
age = parseInt(age);
|
||||
var m = today.getMonth() - birthDate.getMonth();
|
||||
if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
|
||||
age--;
|
||||
}
|
||||
|
||||
//calculate months
|
||||
var monthBirth = birthDate.getMonth() + 1;
|
||||
var monthToday = today.getMonth() + 1;
|
||||
if (monthToday > monthBirth) {
|
||||
var months = monthToday - monthBirth;
|
||||
} else if (monthToday == monthBirth) {
|
||||
var months = 0;
|
||||
} else if (monthToday < monthBirth) {
|
||||
var months = monthToday - monthBirth;
|
||||
months = months + 12;
|
||||
}
|
||||
if (months < 10) {
|
||||
months = '0' + months
|
||||
}
|
||||
|
||||
//set the values
|
||||
$('#age_in_years').val(age);
|
||||
$('#age_in_months').val(months);
|
||||
});
|
||||
|
||||
$('#next_of_kin').on('change', function () {
|
||||
if ($(this).val() != "" && $(this).val() != " ") {
|
||||
$('#kin_div').show();
|
||||
} else {
|
||||
$('#kin_div').hide();
|
||||
}
|
||||
});
|
||||
|
||||
/* make residence drop downs searchable */
|
||||
$('#company').select2({
|
||||
placeholder: "-- select --"
|
||||
});
|
||||
|
||||
//$('.select2-selection.select2-selection--single').addClass('form-control');//add class to select2 display
|
||||
$('.select2-selection.select2-selection--single').css('height', 'calc(3.85rem)');
|
||||
$('.select2-selection.select2-selection--single').css('padding-top', '5px');
|
||||
$('.select2-selection__arrow').css('top', '3px');
|
||||
|
||||
$("#citizenship").click(function () {
|
||||
var citizenship = $("#citizenship").val();
|
||||
if (citizenship == 0) {
|
||||
$("#not_ugandan_regions").show();
|
||||
$("#ugandan_regions").hide();
|
||||
$('#residence').prop('required', false);
|
||||
} else {
|
||||
$("#not_ugandan_regions").hide();
|
||||
$("#ugandan_regions").show();
|
||||
$('#residence').prop('required', true);
|
||||
}
|
||||
});
|
||||
|
||||
$('#residence').select2({
|
||||
placeholder: 'Search residences',
|
||||
ajax: {
|
||||
url: '/patients/search_residences',
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
processResults: function (data) {
|
||||
return {
|
||||
results: $.map(data, function (item) {
|
||||
return {
|
||||
text: item.text,
|
||||
id: item.ids
|
||||
}
|
||||
})
|
||||
};
|
||||
},
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
$("#patients_submit").click(function (e) { // make sure that all compulsory fields have been filled out
|
||||
var empty_compulsory_fields = [];
|
||||
$("#white-box.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;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+262
@@ -0,0 +1,262 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('fullcalendar/packages/core/main.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('fullcalendar/packages/daygrid/main.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">{{ __('patients.appointments') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('patients.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('patients.index') }}">{{ __('patients.patients') }}</a></li>
|
||||
<li class="active">{{ __('patients.appointments') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<a href="{{ url('/patients/appointment_requests') }}" class="btn btn-success">{{ __('patients.view_appointment_requests') }}</a>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<a href="{{ url('/patients/create_appointment') }}" class="btn btn-success pull-right">{{ __('patients.create_new_appointment') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
{{ Form::label('clinic_allocation', __('patients.clinic_allocation')) }}
|
||||
{{ Form::select('clinic_allocation', $clinics, '', ['class' => 'form-control col-sm-12 compulsory search_criteria', 'id' => 'clinic_allocation']) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
{{ Form::label('in_charge', __('patients.incharge')) }}
|
||||
<select id="in_charge" class="form-control col-sm-12 compulsory search_criteria">
|
||||
<option value="0">{{ __('patients.all_staff') }}</option>
|
||||
@foreach($users as $user)
|
||||
<option value="{{ $user->id }}">{{ $user->first_name }} {{ $user->last_name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='calendar'></div>
|
||||
<br><br>
|
||||
<p>{{ __('patients.search_criteria') }} <code id="search_criteria_text">{{ __('patients.all') }}</code></p>
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('patients.patient_name') }}</th>
|
||||
<th>{{ __('patients.clinic') }}</th>
|
||||
<th>{{ __('patients.incharge') }}</th>
|
||||
<th>{{ __('patients.appointment_time') }}</th>
|
||||
<th>{{ __('patients.patient_contact') }}</th>
|
||||
<th>{{ __('patients.comments') }}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="patients_table"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" id="modal_select_actions" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">{{ __('patients.select_actions') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<button class="btn btn-success btn-rounded" data-toggle="modal" id="startAppWithClinicBtn">{{ __('layout.start_appointment_with_clinic') }}</button>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a class="btn btn-success btn-rounded" onclick="displayActivationModel()">{{ __('patients.start_appointment') }}</a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a class="btn btn-warning btn-rounded" onclick="reschedule_appointment()">{{ __('patients.reschedule_appointment') }}</a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a class="btn btn-danger btn-rounded" onclick="cancel_appointment()">{{ __('patients.cancel_appointment') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- start an appointment with a clinic and a doctor option -->
|
||||
<div class="modal fade" id="startAppointmentWithClinicModal" tabindex="-1" role="dialog" aria-labelledby="appointmentWithDoctorAndClinicLabel1">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="appointmentWithDoctorAndClinicLabel1">{{ __('patient_episode.doctor_and_clinic_allocation') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{ Form::open(['route' => 'patient_episodes.start_appointment_with_doctor_and_clinic']) }}
|
||||
|
||||
{{ Form::hidden('patient_id', 0, ['id' => 'selected_patient_id']) }}
|
||||
{{ Form::hidden('selected_appointment_id', 0, ['id' => 'selected_appointment_id']) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('special_clinic_id', __('layout.select_clinic')) }}
|
||||
{{ Form::select('special_clinic_id', $special_clinics, '', ['class' => 'form-control', 'required' => 'true'])}}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('allocated_services_id_with_doctor_id', __('patient_episode.doctor_allocation')) }}
|
||||
{{ Form::select('allocated_services_id_with_doctor_id', $users_array, '', ['class' => 'form-control appWithClinicDoctorDropDown'])}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-success btn-sm" onclick="return confirm('<?php echo __('patient_episode.are_you_sure_doctor_and_clinic'); ?>');">{{ __('patient_episode.continue_allocation') }}</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 src="{{ asset('fullcalendar/packages/core/main.js') }}"></script>
|
||||
<script src="{{ asset('fullcalendar/packages/interaction/main.js') }}"></script>
|
||||
<script src="{{ asset('fullcalendar/packages/daygrid/main.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
let clinic_id = -1;
|
||||
let user_id = 0;
|
||||
let selected_date_search = "2020-01-01";
|
||||
let selectedPatientId = 0;
|
||||
let appointmentId = 0;
|
||||
|
||||
function reschedule_appointment() {
|
||||
if (confirm("<?php echo __('patients.reschedule_appointment_warning')?>")) {
|
||||
window.location.href = "/patients/reschedule_appointment/" + appointmentId;
|
||||
}
|
||||
}
|
||||
|
||||
function cancel_appointment() {
|
||||
if (confirm("<?php echo __('patients.cancel_appointment_warning')?>")){
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: '/patients/cancel_patient_appointment/' + appointmentId,
|
||||
success: function(response){
|
||||
if(response == 1) {
|
||||
alert("<?php echo __('patients.appointment_cancelled')?>");
|
||||
$("#modal_select_actions").modal("hide");
|
||||
fetch_patients();
|
||||
} else {
|
||||
alert("<?php echo __('patients.cancel_appointment_failed')?>");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function displayAppointmentActions(patientId, appointment_id) {
|
||||
selectedPatientId = patientId;
|
||||
appointmentId = appointment_id;
|
||||
|
||||
$("#modal_select_actions").modal("show");
|
||||
}
|
||||
|
||||
function displayActivationModel(){
|
||||
window.location.href = "/patients/complete_appointment/" + appointmentId;
|
||||
}
|
||||
|
||||
$('#startAppWithClinicBtn').click(function(e) {
|
||||
$('#modal_select_actions').modal('hide');
|
||||
$('#selected_appointment_id').val(appointmentId);
|
||||
$('#selected_patient_id').val(selectedPatientId);
|
||||
$('#startAppointmentWithClinicModal').modal('show');
|
||||
});
|
||||
|
||||
$('.appWithClinicDoctorDropDown').select2({
|
||||
placeholder: "Select",
|
||||
width: "100%",
|
||||
dropdownParent: $('#startAppointmentWithClinicModal')
|
||||
});
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
$('#clinic_allocation, #in_charge').select2({
|
||||
//
|
||||
});
|
||||
|
||||
// ever felt like you're spelling a word wrong and auto-correct is taking it's sweet vacation time!
|
||||
$('.search_criteria').change(function () {
|
||||
user_id = $('#in_charge').val();
|
||||
clinic_id = $('#clinic_allocation').val();
|
||||
|
||||
let user_name = $('#in_charge').find('option:selected').text();
|
||||
let clinic_name = $('#clinic_allocation').find('option:selected').text();
|
||||
|
||||
let text = "<?php echo __('patients.clinic')?>: " + clinic_name + " | <?php echo __('patients.user')?>: " + user_name;
|
||||
|
||||
$('#search_criteria_text').text(text);
|
||||
fetch_patients();
|
||||
});
|
||||
|
||||
let calendarEl = document.getElementById('calendar');
|
||||
|
||||
let calendar = new FullCalendar.Calendar(calendarEl, {
|
||||
plugins: [ 'interaction', 'dayGrid','bootstrap' ],
|
||||
themeSystem: 'bootstrap',
|
||||
height: 100,
|
||||
selectable: true,
|
||||
select: function(arg) {
|
||||
selected_date_search = arg.start.getFullYear() + "-" + (arg.start.getMonth() + 1) + "-" + arg.start.getDate();
|
||||
fetch_patients();
|
||||
},
|
||||
editable: true,
|
||||
eventLimit: true,
|
||||
events: <?php echo json_encode($calender_dates); ?>
|
||||
});
|
||||
|
||||
calendar.render();
|
||||
|
||||
$(".fc-day-header").css("background", "#43c392");
|
||||
|
||||
$(".fc-button").click(function () {
|
||||
$(".fc-day-header").css("background", "#43c392");
|
||||
});
|
||||
});
|
||||
|
||||
function fetch_patients() {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/patients/follow_up_fetch_patients",
|
||||
data: {
|
||||
selected_date: selected_date_search,
|
||||
clinic_id: clinic_id,
|
||||
user_id: user_id
|
||||
},
|
||||
cache: false,
|
||||
success: function (response) {
|
||||
$('#patients_table').html(response);
|
||||
}/*,
|
||||
error: function(xhr, status, error) {
|
||||
alert(xhr.responseText);
|
||||
}*/
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@endpush
|
||||
+125
@@ -0,0 +1,125 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@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">{{ __('patients.view') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('patients.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('patients.index') }}">{{ __('patients.patients') }}</a></li>
|
||||
<li class="active">{{ __('patients.view') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
<!-- /.col-lg-12 -->
|
||||
</div>
|
||||
<div class="white-box">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<form action="{{ route('patients.search') }}" method="POST" role="search">
|
||||
{{ csrf_field() }}
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="number" placeholder="Patient number">
|
||||
<!--<span class="input-group-btn">-->
|
||||
<button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-search"></span></button>
|
||||
<!--</span>-->
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<form action="{{ route('patients.search') }}" method="POST" role="search">
|
||||
{{ csrf_field() }}
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="first_name" placeholder="First name">
|
||||
<!--<span class="input-group-btn">-->
|
||||
<button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-search"></span></button>
|
||||
<!--</span>-->
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<form action="{{ route('patients.search') }}" method="POST" role="search">
|
||||
{{ csrf_field() }}
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="last_name" placeholder="Last name">
|
||||
<!--<span class="input-group-btn">-->
|
||||
<button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-search"></span></button>
|
||||
<!--</span>-->
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-1"></div>
|
||||
<div class="col-md-2">
|
||||
<div class="text-center label-info btn-rounded">
|
||||
<p class="text-white">{{ $PatientCount }} {{ __('patients.patients') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@if(isset($criteria) && isset($resultCount))
|
||||
<p>{{ __('patients.search_criteria') }} : <code>{{ $criteria }}</code> {{ __('patients.total_results') }} : <code>{{ $resultCount }}</code> <a href="{{ route('patients.index') }}">{{ __('patients.clear_search') }}</a></p>
|
||||
@endif
|
||||
<div class="white-box">
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('patients.patient_number') }}</th>
|
||||
<th>{{ __('patients.full_names') }}</th>
|
||||
<th>{{ __('patients.gender') }}</th>
|
||||
<th>{{ __('patients.age') }}</th>
|
||||
<th>{{ __('patients.phone') }}</th>
|
||||
<th>{{ __('patients.category') }}</th>
|
||||
<th>{{ __('patients.marital_status') }}</th>
|
||||
<th>{{ __('patients.deleted_by') }}</th>
|
||||
<th>{{ __('patients.deleted_on') }}</th>
|
||||
<th>{{ __('patients.reason_for_deactivation') }}</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(count($patients) > 0)
|
||||
@foreach($patients as $patient)
|
||||
@php $dob = new Carbon\Carbon($patient->date_of_birth); @endphp
|
||||
<tr>
|
||||
<td>{{ $patient->number }}</td>
|
||||
<td>{{ $patient->first_name." ".$patient->last_name }}</td>
|
||||
<td>
|
||||
@if($patient->gender == 1)
|
||||
{{ __('patients.male') }}
|
||||
@else
|
||||
{{ __('patients.female') }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $dob->diffInYears(Carbon\Carbon::now()) }}yrs</td>
|
||||
<td>{{ $patient->phone }}</td>
|
||||
<td>{{ isset($categories[$patient->category_id]) ? $categories[$patient->category_id] : "N/A" }}</td>
|
||||
<td>{{ isset($marital_statuses[$patient->marital_status]) ? $marital_statuses[$patient->marital_status] : null }}</td>
|
||||
<td>{{ is_null($patient->deleted_by) ? get_full_name(get_name($patient->id, 'patient_id','created_by', 'patient_deactivation_reasons'), "id", "first_name", "last_name", "users") : get_full_name($patient->deleted_by, "id", "first_name", "last_name", "users")}}</td>
|
||||
<td>{{ streamline_date_time($patient->deleted_at)}}</td>
|
||||
<td>{{ get_name($patient->id, 'patient_id','reason', 'patient_deactivation_reasons') }}</td>
|
||||
<td><a href="/patients/{{ $patient->id }}/" class="fcbtn btn btn-outline btn-info btn-rounded"><i class="fa fa-info"></i> {{ __('patients.details') }}</a></td>
|
||||
<td>
|
||||
{{ Form::model($patient->id ,['method' => 'POST', 'route' => ['patients.activate', $patient->id]]) }}
|
||||
<button type="submit" class="btn btn-warning btn-rounded" onclick="return confirm('<?php echo __('patients.are_you_sure') ?>')"><i class="fa fa-check"></i> {{ __('patients.activate') }}</button>
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr class="warning"><td class="center" colspan="8">{{ __('patients.no_records_found') }}</td></tr>
|
||||
@endif
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
{{ $patients->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
+293
@@ -0,0 +1,293 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('patients.view') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('patients.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('patients.index') }}">{{ __('patients.patients') }}</a></li>
|
||||
<li class="active">{{ __('patients.view') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
{{ Form::open(['route' => 'patients.search', 'method' => 'ANY', 'role' => 'search']) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group" id="patient_numbers">
|
||||
{{ Form::text('number', '', ['class' => 'form-control typeahead', 'placeholder' => 'Patient number', 'autocomplete' => 'off', 'spellcheck' => false]) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2" @if(!is_eye_module_enabled()) style='display: none' @endif>
|
||||
<div class="form-group" id="previous_numbers">
|
||||
{{ Form::text('previous_id', '', ['class' => 'form-control typeahead', 'placeholder' => 'Previous Number', 'autocomplete' => 'off', 'spellcheck' => false]) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group" id="full_names">
|
||||
{{ Form::text('full_name', '', ['class' => 'form-control typeahead', 'placeholder' => 'Patient Name', 'autocomplete' => 'off', 'spellcheck' => false]) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group" id="villages">
|
||||
{{ Form::text('village', '', ['class' => 'form-control typeahead', 'placeholder' => 'Village', 'autocomplete' => 'off', 'spellcheck' => false]) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<button type="submit" class="btn btn-rounded btn-success"><span class="glyphicon glyphicon-search"></span> {{ __('patients.search') }}</button>
|
||||
<span class="label label-info float-right" style="font-size: 12.5px;"> {{ $patientCount }} {{ __('patients.patients_registered') }}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@if(isset($criteria) && isset($resultCount))
|
||||
<p>{{ __('patients.search_criteria') }} : <code>{{ $criteria }}</code> {{ __('patients.total_results') }} : <code>{{ $resultCount }}</code> <a href="{{ route('patients.index') }}">{{ __('patients.clear_search') }}</a></p>
|
||||
@endif
|
||||
{{ Form::close() }}
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table success-table table-sm table-striped table-hover" style="color: white;">
|
||||
<thead >
|
||||
<tr style="background-color: #00c292; color: white;">
|
||||
<th>{{ __('patients.patient_number') }}</th>
|
||||
<th>{{ __('patients.full_names') }}</th>
|
||||
<th>{{ __('patients.gender') }}</th>
|
||||
<th>{{ __('patients.age') }}</th>
|
||||
<th>{{ __('patients.phone') }}</th>
|
||||
<th>{{ __('patients.category') }}</th>
|
||||
<th>{{ __('patients.village') }}</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(count($patients) > 0)
|
||||
@foreach($patients as $patient)
|
||||
<tr>
|
||||
<td>{{ $patient->number }}</td>
|
||||
<td>{!! insurance_flag($patient->id) !!}</td>
|
||||
<td>
|
||||
@if($patient->gender == 1)
|
||||
{{ __('patients.male') }}
|
||||
@else
|
||||
{{ __('patients.female') }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ get_patients_age($patient->date_of_birth) }}</td>
|
||||
<td>{{ $patient->phone }}</td>
|
||||
<td><?php echo isset($categories[$patient->category_id]) ? $categories[$patient->category_id] : "N/A"; ?></td>
|
||||
<td>{{ isset($patient_villages[$patient->village_id]) ? $patient_villages[$patient->village_id] : '' }}</td>
|
||||
<td><a href="/patients/{{ $patient->id }}/" class="btn btn-rounded btn-info btn-sm"><i class="fa fa-info-circle"></i> {{ __('patients.details') }}</a></td>
|
||||
<td>
|
||||
<a href="/patients/{{ $patient->id }}/edit/" class="btn btn-warning btn-rounded btn-sm"><i class="fa fa-pencil"></i> {{ __('patients.edit') }}</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/patient_episodes/set_patient_id/{{ $patient->id }}" class="btn btn-rounded btn-primary btn-sm"><i class="fa fa-hand-pointer-o"></i> <strong>{{ __('patients.select') }}</strong></a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr class="warning"><td class="center" colspan="10"><code>{{ __('patients.no_records_found') }}</code></td></tr>
|
||||
@endif
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
{{ $patients->links() }}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<!-- Typehead Plugin JavaScript -->
|
||||
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
|
||||
|
||||
<!-- Data table javascript -->
|
||||
<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">
|
||||
|
||||
var substringMatcher = function (strs) {
|
||||
return function findMatches(q, cb) {
|
||||
var matches, substringRegex;
|
||||
|
||||
// an array that will be populated with substring matches
|
||||
matches = [];
|
||||
|
||||
// regex used to determine if a string contains the substring `q`
|
||||
substrRegex = new RegExp(q, 'i');
|
||||
|
||||
// iterate through the pool of strings and for any string that
|
||||
// contains the substring `q`, add it to the `matches` array
|
||||
$.each(strs, function (i, str) {
|
||||
if (substrRegex.test(str)) {
|
||||
matches.push(str);
|
||||
}
|
||||
});
|
||||
|
||||
cb(matches);
|
||||
};
|
||||
};
|
||||
|
||||
$('#patient_numbers .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'patient_numbers',
|
||||
source: substringMatcher(<?php echo json_encode($patient_numbers); ?>)
|
||||
}
|
||||
);
|
||||
|
||||
$('#previous_numbers .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'previous_numbers',
|
||||
source: substringMatcher(<?php echo json_encode($previous_ids); ?>)
|
||||
}
|
||||
);
|
||||
|
||||
$('#first_names .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'first_names',
|
||||
source: substringMatcher(<?php echo json_encode($first_names); ?>)
|
||||
}
|
||||
);
|
||||
|
||||
$('#last_names .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'last_names',
|
||||
source: substringMatcher(<?php echo json_encode($last_names); ?>)
|
||||
}
|
||||
);
|
||||
|
||||
$('#villages .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'villages',
|
||||
source: substringMatcher(<?php echo json_encode($villages); ?>)
|
||||
}
|
||||
);
|
||||
|
||||
$('#full_names .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'full_names',
|
||||
source: substringMatcher(<?php echo json_encode($full_names); ?>)
|
||||
}
|
||||
);
|
||||
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 200,
|
||||
buttons: [
|
||||
'copy',
|
||||
{extend: 'csv',
|
||||
message: "<php echo __('patients.registered_patients')?>",
|
||||
exportOptions: {
|
||||
columns: [0, 1, 2, 3, 4, 5, 6]
|
||||
},
|
||||
},
|
||||
{extend: 'excel',
|
||||
message: "<php echo __('patients.registered_patients')?>",
|
||||
exportOptions: {
|
||||
columns: [0, 1, 2, 3, 4, 5, 6]
|
||||
},
|
||||
sheetName: "<php echo __('patients.registered_patients')?>"
|
||||
},
|
||||
{extend: 'pdf',
|
||||
message: "<php echo __('patients.registered_patients')?>",
|
||||
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 __('patients.registered_patients')?>",
|
||||
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');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$('.sorting').removeClass('sorting');//remove the sorting class
|
||||
$('.sorting_asc').removeClass('sorting_asc');//remove the sorting class
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@push('styles')
|
||||
<style type="text/css">
|
||||
.color-bordered-table.success-bordered-table {
|
||||
border-top: 0px;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
+160
@@ -0,0 +1,160 @@
|
||||
<!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="{{ base_path('public/uploads/streamline/color/streamline_icon-02.png') }}">
|
||||
<title>{{ config('app.name', 'CHI Membership Card - Stre@mline') }}</title>
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{{ base_path('public/bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
|
||||
|
||||
<style style="text-css">
|
||||
body{
|
||||
/*font-size: 1.2em;*/
|
||||
}
|
||||
|
||||
thead {
|
||||
/*display: table-header-group;*/
|
||||
}
|
||||
|
||||
tfoot {
|
||||
/*display: table-row-group;*/
|
||||
}
|
||||
|
||||
tr {
|
||||
/*page-break-inside: avoid;*/
|
||||
}
|
||||
|
||||
th{
|
||||
font-weight: bolder;
|
||||
font-size: 22px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
td{
|
||||
font-size: 24px;
|
||||
padding-top: 5px;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div style="background-color: rgb(43, 116, 91); color:#fff">
|
||||
<div class="hospital-logo" style="padding-top: 10px;">
|
||||
@include('layouts.header_pdf_print')
|
||||
</div>
|
||||
|
||||
<div class="row" style="padding: 30px;">
|
||||
<div class="col-12" style="padding-top: 10px;">
|
||||
<table>
|
||||
<tr>
|
||||
<td><u>NAME</u></td>
|
||||
<td style="padding-left: 15px;"><u>SEX</u></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
{{ get_full_name($patient->id, "id", "first_name", "last_name", "patients") }}
|
||||
</th>
|
||||
<th style="padding-left: 15px;">
|
||||
{{ $patient->gender == 1 ? "MALE" : "FEMALE" }}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td style="padding-left: 15px;"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><u>Stre@mline NUMBER</u></td>
|
||||
<td style="padding-left: 15px;"><u>DATE OF BIRTH</u></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
{{ $patient->number }}
|
||||
</th>
|
||||
<th style="padding-left: 15px;">
|
||||
{{ streamline_date($patient->date_of_birth) }}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td style="padding-left: 10px;"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><u>NIN</u></td>
|
||||
<td style="padding-left: 10px;"><u>HOLDER'S SIGNATURE</u></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
{{ $patient->national_id }}
|
||||
</th>
|
||||
<th style="padding-left: 10px;">
|
||||
{{-- signature --}}
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<br><br><br>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div style="background-color: rgb(43, 116, 91); padding:10px; padding-top: 120px;">
|
||||
<table align="center">
|
||||
|
||||
<tr>
|
||||
<td>HOST HEALTH FACILITY </td>
|
||||
<td>
|
||||
{{ $hospitalInfo->name }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>VILLAGE</td>
|
||||
<td>
|
||||
{{ get_name(get_name($patient->id, "id", "village_id", "patients"), "id", "name", "villages") }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>DISTRICT</td>
|
||||
<td>
|
||||
{{ get_name($patient->district_id, "id", "name", "districts") }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" style="background-color: #fff">
|
||||
{{ getDNS1DBarcodePNGOtherOption(sprintf("%04u", $patient->id)) }}
|
||||
<br>
|
||||
<h4 style="color: black">{{ sprintf("%04u", $patient->id) }}</h4>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div style="text-align: center; color: #fff; padding: 10px; font-size: 22px;">
|
||||
This card should only be used for identification at a Stre@mline network hospital.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Executable
+142
@@ -0,0 +1,142 @@
|
||||
@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">{{ __('patients.reschedule_appointment') }}</h4>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('patients.dashboard') }}</a></li>
|
||||
<li><a href="{{ url('/patients/follow_up') }}">{{ __('patients.appointments') }}</a></li>
|
||||
<li class="active">{{ __('patients.create') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
@include('errors.list')
|
||||
|
||||
<div class="white-box">
|
||||
<h4>{{ __('patients.patient_information') }}</h4>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<p>{{ __('patients.first_name') }}: {{ get_name($appointment->patient_id, 'id', 'first_name', 'patients') }}</p>
|
||||
<p>{{ __('patients.last_name') }}: {{ get_name($appointment->patient_id, 'id', 'last_name', 'patients') }}</p>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<p>{{ __('patients.patient_number') }}: {{ get_name($appointment->patient_id, 'id', 'number', 'patients') }}</p>
|
||||
<p>{{ __('patients.phone') }}: {{ get_name($appointment->patient_id, 'id', 'phone', 'patients') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h4>{{ __('patients.previous_details') }}</h4>
|
||||
<div class="form-group">
|
||||
{{ Form::label('clinic_allocation', __('patients.assigned_clinic')) }}
|
||||
@if($appointment->clinic_allocation == 0)
|
||||
{{ Form::text('clinic_allocation_previous', __('patients.not_assigned'), ['class' => 'form-control col-sm-12 compulsory', 'readonly']) }}
|
||||
@else
|
||||
{{ Form::text('clinic_allocation_previous', $clinics[$appointment->clinic_allocation], ['class' => 'form-control col-sm-12 compulsory', 'readonly']) }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('in_charge', __('patients.assigned_incharge')) }}
|
||||
@if($appointment->incharge_id == 0)
|
||||
{{ Form::text('in_charge_previous', __('patients.not_assigned'), ['class' => 'form-control col-sm-12 compulsory', 'readonly']) }}
|
||||
@else
|
||||
{{ Form::text('in_charge_previous', get_full_name($appointment->incharge_id, 'id', 'first_name', 'last_name', 'users'), ['class' => 'form-control col-sm-12 compulsory', 'readonly']) }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('appointment_date_previous',__('patients.appointment_date')) }}
|
||||
{{ Form::text('appointment_date_previous', streamline_date($appointment->appointment_date), ['class' => 'form-control col-sm-12 compulsory', 'readonly']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('appointment_time_previous',__('patients.appointment_time')) }}
|
||||
{{ Form::text('appointment_time_previous', $appointment->appointment_time, ['class' => 'form-control col-sm-12 compulsory', 'readonly']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('comments_previous',__('patients.comments')) }}
|
||||
{{ Form::text('comments_previous', $appointment->comments, ['class' => 'form-control col-sm-12 compulsory', 'readonly']) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h4>{{ __('patients.new_details') }}</h4>
|
||||
{{ Form::open(['route' => 'patients.save_rescheduled_appointment']) }}
|
||||
|
||||
{{ Form::hidden('appointment_id', $appointment->id, ['class' => 'patient_id']) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('clinic_allocation', __('patients.assign_clinic')) }}
|
||||
{{ Form::select('clinic_allocation', $clinics, $appointment->clinic_allocation, ['class' => 'form-control col-sm-12 compulsory search_criteria', 'id' => 'clinic_allocation']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('in_charge', __('patients.assign_incharge')) }}
|
||||
<select name="in_charge" class="form-control col-sm-12 compulsory search_criteria">
|
||||
<option value="0" selected>{{ __('patients.dont_assign_incharge') }}</option>
|
||||
@foreach($users as $user)
|
||||
<option value="{{ $user->id }}">{{ $user->first_name }} {{ $user->last_name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('appointment_date',__('patients.appointment_date')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('appointment_date', date('d-m-Y', strtotime($appointment->appointment_date)),['class' => 'compulsory form-control','readonly','id'=>'appointment_date', 'required']) }}
|
||||
</div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('appointment_time',__('patients.appointment_time')) }}
|
||||
{{ Form::time('appointment_time',$appointment->appointment_time,['class' => 'compulsory form-control','required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('comments',__('patients.comments')) }}
|
||||
{{ Form::textarea('comments',$appointment->comments,['class' => 'form-control', 'data-error'=>'','id'=>'comments']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
{{ Form::button(__('patients.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
|
||||
{{ Form::button(__('patients.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/js/validator.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#appointment_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy',
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+286
@@ -0,0 +1,286 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
|
||||
<style type="text/css">
|
||||
label{
|
||||
background-color: #3a87ad;
|
||||
color: #fff;
|
||||
border-radius: 3px;
|
||||
display: inline-block;
|
||||
padding: 2px 4px;
|
||||
font-size: 11.844px;
|
||||
font-weight: bold;
|
||||
line-height: 14px;
|
||||
vertical-align: baseline;
|
||||
white-space: nowrap;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
</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">{{ __('patients.view') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('patients.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('patients.index') }}">{{ __('patients.patients') }}</a></li>
|
||||
<li class="active">{{ __('patients.view') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
{{ Form::open(['route' => 'patients.select', 'method' => 'ANY', 'role' => 'search']) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="patient_numbers">
|
||||
{{ Form::label('number', __('patients.patient_number')) }}
|
||||
{{ Form::text('number', '', ['class' => 'form-control typeahead', 'placeholder' => 'Patient number', 'autocomplete' => 'off', 'spellcheck' => false]) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="first_names">
|
||||
{{ Form::label('first_name', __('patients.first_name')) }}
|
||||
{{ Form::text('first_name', '', ['class' => 'form-control typeahead', 'placeholder' => 'First name', 'autocomplete' => 'off', 'spellcheck' => false]) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="last_names">
|
||||
{{ Form::label('last_name', __('patients.last_name')) }}
|
||||
{{ Form::text('last_name', '', ['class' => 'form-control typeahead', 'placeholder' => 'Last name', 'autocomplete' => 'off', 'spellcheck' => false]) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="national_ids">
|
||||
{{ Form::label('national_id', __('patients.national_id')) }}
|
||||
{{ Form::text('national_id', '', ['class' => 'form-control typeahead', 'placeholder' => 'National ID', 'autocomplete' => 'off', 'spellcheck' => false]) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(is_chi_enabled())
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="insurance_groups">
|
||||
{{ Form::label('insurance_group', __('patients.insurance_group')) }}
|
||||
{{ Form::text('insurance_group', '', ['class' => 'form-control typeahead', 'placeholder' => 'Insurance Group', 'autocomplete' => 'off', 'spellcheck' => false]) }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="patient_categorys">
|
||||
{{ Form::label('patient_category', __('patients.patient_category')) }}
|
||||
{{ Form::text('patient_category', '', ['class' => 'form-control typeahead', 'placeholder' => 'Patient Category', 'autocomplete' => 'off', 'spellcheck' => false]) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="subcountys">
|
||||
{{ Form::label('subcounty', __('patients.sub_county')) }}
|
||||
{{ Form::text('subcounty', '', ['class' => 'form-control typeahead', 'placeholder' => 'SubCounty', 'autocomplete' => 'off', 'spellcheck' => false]) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="parishs">
|
||||
{{ Form::label('parish', __('patients.parish')) }}
|
||||
{{ Form::text('parish', '', ['class' => 'form-control typeahead', 'placeholder' => 'Parish', 'autocomplete' => 'off', 'spellcheck' => false]) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="villages">
|
||||
{{ Form::label('village', __('patients.village')) }}
|
||||
{{ Form::text('village', '', ['class' => 'form-control typeahead', 'placeholder' => 'Village', 'autocomplete' => 'off', 'spellcheck' => false]) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
{{ Form::label('date_of_birth', __('patients.date_of_birth')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('date_of_birth','',['class' => 'form-control', 'readonly', 'id'=>'datepicker-autoclose']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="phone_number">
|
||||
{{ Form::label('phone_number', __('patients.phone_number')) }}
|
||||
{{ Form::text('phone_number', '', ['class' => 'form-control typeahead', 'placeholder' => __('patients.phone_number'), 'autocomplete' => 'off', 'spellcheck' => false]) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1" style="padding-top: 23px;">
|
||||
<button type="submit" class="btn btn-success">{{ __('patients.search') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<img src="/uploads/streamline_images/two_surgeons.jpg" class="img-rounded" style=" height: 150px; margin: auto;" alt="surgery" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<!-- Typehead Plugin JavaScript -->
|
||||
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
$('#datepicker-autoclose').datepicker(
|
||||
{
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd/mm/yyyy'
|
||||
}
|
||||
);
|
||||
|
||||
let substringMatcher = function(strs) {
|
||||
return function findMatches(q, cb) {
|
||||
let matches, substrRegex;
|
||||
|
||||
// an array that will be populated with substring matches
|
||||
matches = [];
|
||||
|
||||
// regex used to determine if a string contains the substring `q`
|
||||
substrRegex = new RegExp(q, 'i');
|
||||
|
||||
// iterate through the pool of strings and for any string that
|
||||
// contains the substring `q`, add it to the `matches` array
|
||||
$.each(strs, function(i, str) {
|
||||
if (substrRegex.test(str)) {
|
||||
matches.push(str);
|
||||
}
|
||||
});
|
||||
|
||||
cb(matches);
|
||||
};
|
||||
};
|
||||
|
||||
$('#patient_numbers .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'patient_numbers',
|
||||
source: substringMatcher(<?php echo json_encode($patient_numbers); ?>)
|
||||
}
|
||||
);
|
||||
|
||||
$('#first_names .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'first_names',
|
||||
source: substringMatcher(<?php echo json_encode($first_names); ?>)
|
||||
}
|
||||
);
|
||||
|
||||
$('#last_names .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'last_names',
|
||||
source: substringMatcher(<?php echo json_encode($last_names); ?>)
|
||||
}
|
||||
);
|
||||
|
||||
$('#national_ids .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'national_ids',
|
||||
source: substringMatcher(<?php echo json_encode($national_ids); ?>)
|
||||
}
|
||||
);
|
||||
|
||||
$('#insurance_groups .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'insurance_groups',
|
||||
source: substringMatcher(<?php echo json_encode($insurance_groups); ?>)
|
||||
}
|
||||
);
|
||||
|
||||
$('#patient_categorys .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'patient_categorys',
|
||||
source: substringMatcher(<?php echo json_encode($patient_categories); ?>)
|
||||
}
|
||||
);
|
||||
|
||||
$('#subcountys .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'subcountys',
|
||||
source: substringMatcher(<?php echo json_encode($subcounties); ?>)
|
||||
}
|
||||
);
|
||||
|
||||
$('#parishs .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'parishs',
|
||||
source: substringMatcher(<?php echo json_encode($parishes); ?>)
|
||||
}
|
||||
);
|
||||
|
||||
$('#villages .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'villages',
|
||||
source: substringMatcher(<?php echo json_encode($villages); ?>)
|
||||
}
|
||||
);
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
+237
@@ -0,0 +1,237 @@
|
||||
@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>
|
||||
ul#results li {
|
||||
display:inline;
|
||||
}
|
||||
</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">{{ __('patients.search_results') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('patients.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('patients.index') }}">{{ __('patients.patients') }}</a></li>
|
||||
<li class="active">{{ __('patients.search_results') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
@include ('errors.list')
|
||||
|
||||
<div class="white-box">
|
||||
<h3 class="page-title">{{ __('patients.search_results') }}</h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@if(isset($criteria) && isset($patient_count))
|
||||
|
||||
<p>{{ __('patients.search_criteria') }} : <code>{{ $criteria }}</code> {{ __('patients.total_results') }} : <code>{{ count($patients) }}</code> <a href="{{ route('patients.select') }}">{{ __('patients.clear_search') }}</a></p>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 5%">{{ __('patients.patient_number') }}</th>
|
||||
<th style="width: 10%">{{ __('patients.full_names') }}</th>
|
||||
<th style="width: 10%">{{ __('patients.gender') }}</th>
|
||||
<th style="width: 10%">{{ __('patients.age') }}</th>
|
||||
<th style="width: 10%">{{ __('patients.next_of_kin') }}</th>
|
||||
<th style="width: 10%">{{ __('patients.marital_status') }}</th>
|
||||
<th style="width: 5%">{{ __('patients.phone') }}</th>
|
||||
<th style="width: 10%">{{ __('patients.occupation') }}</th>
|
||||
<th style="width: 10%">{{ __('patients.category') }}</th>
|
||||
<th style="width: 10%"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(count($patients ) > 0)
|
||||
@foreach($patients as $patient)
|
||||
<tr>
|
||||
<td>{{ $patient->number }}</td>
|
||||
<td>{{ $patient->first_name." ".$patient->last_name }}</td>
|
||||
<td>{{ $patient->gender == 2 ? "Female" : "Male" }}</td>
|
||||
<td>{{ get_patients_age($patient->date_of_birth) }}</td>
|
||||
<td>{{ $patient->next_of_kin }}</td>
|
||||
<td>{{ array_key_exists($patient->marital_status, $marital_statuses) ? $marital_statuses[$patient->marital_status] : "N/A" }}</td>
|
||||
<td>{{ $patient->phone }}</td>
|
||||
<td>{{ array_key_exists($patient->occupation_id, $occupations) ? $occupations[$patient->occupation_id] : "N/A" }}</td>
|
||||
<td>{{ array_key_exists($patient->category_id, $categories) ? $categories[$patient->category_id] : "N/A" }}</td>
|
||||
<td>
|
||||
<a href="/patient_episodes/set_patient_id/{{ $patient->id }}" class="btn btn-success btn-sm">{{ __('patients.select') }}</a>
|
||||
@if(is_fingerprint_enabled() && !is_null($patient->fingerprint_template))
|
||||
<br><br>
|
||||
<a href="#" onclick="confirm_fingerprint({{ $patient->id }})" class="btn btn-success btn-sm">{{ __('patients.confirm_fingerprint') }}</a>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr><td colspan="10"><code>{{ __('patients.no_records_found') }}</code></td></tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" id="modal_confirm_fingerprint" tabindex="-1" role="dialog" aria-labelledby="confirm_fingerprint_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">{{ __('patients.confirm_fingerprint') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="fingerprint_box text-center">
|
||||
<img id="fingerprint_image" height="240" width="220">
|
||||
</div>
|
||||
|
||||
{{ Form::hidden('fingerprint_patient_id', '', ['id' => 'fingerprint_patient_id']) }}
|
||||
{{ Form::hidden('fingerprint_template', '', ['id' => 'fingerprint_template']) }}
|
||||
{{ Form::hidden('saved_fingerprint_template', '', ['id' => 'saved_fingerprint_template']) }}
|
||||
|
||||
<button type="button" onClick='capture_fingerprint()' class="btn btn-sm btn-primary">{{ __('patients.capture_fingerprint') }}</button>
|
||||
<button type="button" onClick='search_fingerprint()' class="btn btn-sm btn-primary">{{ __('patients.confirm_fingerprint') }}</button>
|
||||
|
||||
<p id="scanner_msg"></p>
|
||||
</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',
|
||||
{
|
||||
extend: 'pdf',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3, 4, 5, 6, 7, 8 ]
|
||||
},
|
||||
title: 'Selected patients'
|
||||
},
|
||||
{
|
||||
extend: 'print',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3, 4, 5, 6, 7, 8 ]
|
||||
},
|
||||
title: 'Selected patients'
|
||||
},
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3, 4, 5, 6, 7, 8 ]
|
||||
},
|
||||
title: 'Selected patients'
|
||||
}
|
||||
],
|
||||
});
|
||||
$('.sorting').removeClass('sorting');//remove the sorting class
|
||||
$('.sorting_asc').removeClass('sorting_asc');//remove the sorting class
|
||||
|
||||
function confirm_fingerprint(id) {
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: '/patients/get_fingerprint/' + id,
|
||||
success: function(response){
|
||||
if (response != '0') {fingerprint_patient_id
|
||||
$('#saved_fingerprint_template').val(response);
|
||||
$('#fingerprint_patient_id').val(id);
|
||||
$('#modal_confirm_fingerprint').modal('show');
|
||||
} else {
|
||||
alert("Patient has no registered fingerprints");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function search_fingerprint() {
|
||||
let fingerprint_template = $('#fingerprint_template').val();
|
||||
let saved_fingerprint_template = $('#saved_fingerprint_template').val();
|
||||
let fingerprint_patient_id = $('#fingerprint_patient_id').val();
|
||||
|
||||
if (fingerprint_template !== '' && saved_fingerprint_template !== '') {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '/patients/compare_fingerprint_from_scanner/',
|
||||
data: {fingerprint_template: fingerprint_template, saved_fingerprint_template: saved_fingerprint_template},
|
||||
success: function(response){
|
||||
let responseArray = JSON.parse(response);
|
||||
console.log(responseArray);
|
||||
|
||||
if (responseArray["error_code"] == "0") {
|
||||
let score = Math.round(responseArray["score"]);
|
||||
|
||||
if(score > 50) {
|
||||
window.location.href = "/patient_episodes/set_patient_id/" + fingerprint_patient_id;
|
||||
} else {
|
||||
alert("Fingerprint does not match with record");
|
||||
}
|
||||
} else {
|
||||
$('#scanner_msg').text("Error Code: " + responseArray["error_code"] + " - Error Message: " + responseArray["error_message"]).css('color', 'red');
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
alert("Please capture the patient's fingerprint before searching");
|
||||
}
|
||||
}
|
||||
|
||||
function capture_fingerprint() {
|
||||
$.ajax({
|
||||
url: '/patients/fetch_fingerprint_from_scanner/',
|
||||
success: function(response){
|
||||
let responseArray = JSON.parse(response);
|
||||
|
||||
if (responseArray["error_code"] == "0") {
|
||||
let template = responseArray["template"];
|
||||
let pngImage = "data:image/png;base64," + responseArray["image"];
|
||||
|
||||
$("#fingerprint_image").attr('src', pngImage);
|
||||
$('#fingerprint_template').val(template);
|
||||
|
||||
$('#scanner_msg').text("Fingerprint Captured").css('color', 'green');
|
||||
} else {
|
||||
$('#scanner_msg').text("Error Code: " + responseArray["error_code"] + " - Error Message: " + responseArray["error_message"]).css('color', 'red');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@push('styles')
|
||||
<style type="text/css">
|
||||
.color-bordered-table.success-bordered-table {
|
||||
border-top: 0px;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
+215
@@ -0,0 +1,215 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@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">{{ __('patients.view') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('patients.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('patients.index') }}">{{ __('patients.patients') }}</a></li>
|
||||
<li class="active">{{ __('patients.view') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="white-box">
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<a class="img" href="#modal-photo" data-toggle="modal" style="color: whitesmoke">
|
||||
@if(!is_null($patient->photo) && $patient->photo != "")
|
||||
<img src='{{ asset($patient->photo) }}' class="img-rounded center" alt='Photo not available' />
|
||||
@else
|
||||
<img src="/uploads/streamline_images/person-place-holder.jpg" class="img-rounded center" style='height: 120px; width: 50%' alt='Photo not available' />
|
||||
@endif
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<table class="table-bordered table-condensed table-striped">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.patient_number') }}</font></th>
|
||||
<td>{{ $patient->number }}</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
<tr>
|
||||
<th>Code</th>
|
||||
<td>
|
||||
{{ getDNS1DBarcodePNGOtherOption(sprintf("%04u", $patient->id)) }}
|
||||
<h4>{{ sprintf("%04u", $patient->id) }}</h4>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.full_names') }}</font></th>
|
||||
<td>{{ $patient->first_name }} {{ $patient->last_name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.gender') }}</font></th>
|
||||
<td>{{ $patient->gender == 1 ? 'Male' : 'Female' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="hidden-phone"><font color="black">{{ __('patients.age') }}</font></th>
|
||||
<td>{{ get_patients_age($patient->date_of_birth) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<a href="/patient_card/{{ $patient->id }}" target="_blank" class="btn btn-rounded btn-primary btn-sm float-right">{{ __('patients.print_patient_card') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<table class="table-bordered table-condensed table-striped">
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.phone') }}</font></th>
|
||||
<td>{{ $patient->phone }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.occupation') }}</font></th>
|
||||
<td>{{ get_name($patient->occupation_id, 'id', 'name', 'occupations') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.insurance') }}</font></th>
|
||||
<td>{{ $patient->insurance_status == 1 ? __('patients.yes') : __('patients.no') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.religion') }}</font></th>
|
||||
<td>{{ get_name($patient->religion_id, 'id', 'name', 'religions') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><font color="black">{{__('patients.next_of_kin')}}</font></th>
|
||||
<td>{{ $patient->next_of_kin }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.next_of_kin_relationship') }}</font></th>
|
||||
<td>{{ get_name($patient->next_of_kin_relationship, 'id', 'name', 'family_relations') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><font color="black">{{__('patients.phone_of_next_of_kin')}}</font></th>
|
||||
<td>{{ $patient->phone_of_next_of_kin }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-4">
|
||||
<table class="table-bordered table-condensed table-striped">
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.district') }}</font></th>
|
||||
<td>{{ get_name($patient->district_id, 'id', 'name', 'districts') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.county') }}</font></th>
|
||||
<td>{{ get_name($patient->county_id, 'id', 'name', 'counties') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.sub_county') }}</font></th>
|
||||
<td>{{ get_name($patient->subcounty_id, 'id', 'name', 'subcounties') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.parish') }}</font></th>
|
||||
<td>{{ get_name($patient->parish_id, 'id', 'name', 'parishes') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><font color="black">{{ __('patients.village') }}</font></th>
|
||||
<td>{{ get_name($patient->village_id, 'id', 'name', 'villages') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><font color="black">Referred From</font></th>
|
||||
<td>{{ $patient->referred_from }}</td>
|
||||
</tr>
|
||||
@php $registration_fields = !empty($patient->registration_fields)? json_decode($patient->registration_fields, true):[]; @endphp
|
||||
@foreach ($registration_fields as $key => $registration_field)
|
||||
@php $keys = explode("_",$key) @endphp
|
||||
@if (!empty($keys[2]))
|
||||
<tr>
|
||||
<th><font color="black">{{ get_name($keys[2], 'id', 'name', 'patient_registration_fields') }}</font></th>
|
||||
<td>{{ $registration_field }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-4">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th style="width: 30%"><font color="black">{{ __('patients.last_patient_visit') }} : </font></th>
|
||||
<td>
|
||||
@if(!is_null($last_episode))
|
||||
@php
|
||||
$diagnosis = null;
|
||||
$primary_diagnosis_id = get_name($last_episode->id, 'episode_id', 'primary_diagnosis', 'consultations');
|
||||
|
||||
if($primary_diagnosis_id != "N/A" && $primary_diagnosis_id != ""){
|
||||
$diagnosis = \Streamline\Models\Diagnosis::withTrashed()->find($primary_diagnosis_id);
|
||||
}
|
||||
@endphp
|
||||
<strong>{{ __('patients.primary_diagnosis') }} : </strong>{{ !is_null($diagnosis) ? $diagnosis->name : '' }}<br>
|
||||
<strong>{{ __('patients.comments') }} : </strong>{{ get_name($last_episode->id, 'episode_id', 'comments', 'consultations') }}<br>
|
||||
@endif
|
||||
<strong>{{ __('patients.date') }} : </strong> {{ !is_null($last_episode) ? streamline_date($last_episode->created_at) : __('patients.no_visit_yet') }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 30%"><font color="black">{{ __('patients.date_registered') }} :</font></th>
|
||||
<td>{{streamline_date($patient->created_at) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 30%"><font color="black">{{ __('patients.created_by') }} :</font></th>
|
||||
<td>{{ get_full_name($patient->created_by, "id", "first_name", "last_name", "users") }}</td>
|
||||
</tr>
|
||||
@if (mother_of_patient($patient->id))
|
||||
@php
|
||||
$mother_id = mother_of_patient($patient->id);
|
||||
@endphp
|
||||
<tr>
|
||||
<th style="width: 30%; font-size: 16px; font-weight:bolder"><font color="black">{{ __('patients.mother_name') }}:</font></th>
|
||||
<td style="font-size: 16px;">
|
||||
<a href="/patients/{{ $mother_id }}">
|
||||
{{ get_full_name($mother_id, "id", "first_name", "last_name", "patients") }} ({{ get_name($mother_id, "id", "number", "patients") }})
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@if (children_of_patient($patient->id))
|
||||
@php
|
||||
$children_ids_array = children_of_patient($patient->id);
|
||||
@endphp
|
||||
<tr>
|
||||
<th style="width: 30%; font-size: 16px; font-weight:bolder"><font color="black">{{ __('patients.children') }}:</font></th>
|
||||
<td style="font-size: 16px;">
|
||||
<ol>
|
||||
@for ($i = 0; $i < count($children_ids_array); $i++)
|
||||
<li>
|
||||
<a href="/patients/{{ $children_ids_array[$i] }}">
|
||||
{{ get_full_name($children_ids_array[$i], "id", "first_name", "last_name", "patients") }} ({{ get_name($children_ids_array[$i], "id", "number", "patients") }})
|
||||
</a>
|
||||
</li>
|
||||
@endfor
|
||||
</ol>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
<a href="/patient_episodes/set_patient_id/{{ $patient->id }}" class="btn btn-success btn-sm">{{ __('patients.select_patient_history') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user