mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-13 03:31:31 +00:00
resolved conflicts
This commit is contained in:
+2539
File diff suppressed because it is too large
Load Diff
+2543
File diff suppressed because it is too large
Load Diff
Executable
+553
@@ -0,0 +1,553 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
|
||||
<title>{{ config('app.name', 'Referral Notes - Stre@mline') }}</title>
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
body{
|
||||
font-size: 0.8em;
|
||||
}
|
||||
/*thead, tfoot { display: table-row-group }*/
|
||||
thead {
|
||||
display: table-header-group;
|
||||
}
|
||||
tfoot {
|
||||
display: table-row-group;
|
||||
}
|
||||
tr {
|
||||
page-break-before: always;
|
||||
page-break-after: always;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
.card-header{
|
||||
padding: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
@php
|
||||
$total_deposits_paid = 0;
|
||||
$total_amount_to_pay = 0;
|
||||
$discount_amount = 0;
|
||||
$insurance_hospital_stay = 0;
|
||||
$insurance_investigations = 0;
|
||||
$insurance_treatments = 0;
|
||||
$insurance_sundries = 0;
|
||||
$insurance_procedures = 0;
|
||||
$insurance_tta = 0;
|
||||
$insurance_services = 0;
|
||||
$price_list_id = is_patient_category_attached_to_price_list($patient_id);
|
||||
$investigation_amount_total = 0;
|
||||
@endphp
|
||||
|
||||
<body>
|
||||
<div class="container-fluid">
|
||||
@include('layouts.header_pdf_print')
|
||||
|
||||
<h5 class="heading" style="text-align: center;"> OUTPATIENT REFERRAL NOTE</h5>
|
||||
|
||||
<div class="row col">
|
||||
<table class="table table-light table-sm table-borderless">
|
||||
<tr>
|
||||
<th scope="row">{{ __('inpatient.patient_number') }}</th>
|
||||
<td>{{ $patient->number}}</td>
|
||||
<td width="60" style="border-top: 0px;"> </td>
|
||||
<th>Clinic</th>
|
||||
<td>
|
||||
{{ get_name($consultation->clinic_id, 'id', 'name', 'clinics') }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">{{ __('inpatient.patient_names') }}</th>
|
||||
<td>{{ $patient->first_name}} {{ $patient->last_name}}</td>
|
||||
<td style="border-top: 0px;"> </td>
|
||||
<th>Consultation Date</th>
|
||||
<td>
|
||||
{{ streamline_date($consultation->created_at) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">{{ __('inpatient.age') }}</th>
|
||||
<td>{{ get_patients_age($patient->date_of_birth, $consultation->created_at) }}</td>
|
||||
<td style="border-top: 0px;"> </td>
|
||||
<th>Referral Number</th>
|
||||
<td>
|
||||
{{ $patient->number }}
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">{{ __('inpatient.gender') }}</th>
|
||||
<td>{{ $patient->gender == 1 ? __('inpatient.male') : __('inpatient.female') }}</td>
|
||||
<td style="border-top: 0px;"> </td>
|
||||
<th scope="row">{{ __('inpatient.category') }}</th>
|
||||
<td>
|
||||
{{ get_name($patient->category_id, 'id', 'name', 'patient_categories') }}
|
||||
|
||||
@if(!is_null($patient_discount))
|
||||
({{ $patient_discount["discount"] }} % {{ __('inpatient.discount') }})
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{-- Symptoms, Priority and Emergency Signs --}}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card-deck">
|
||||
<div class="card border-0">
|
||||
<div class="card-block">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title text-center">{{ __('consultations.symptoms') }}</h5>
|
||||
</div>
|
||||
@if (!empty($triage->symptoms) || !empty($consultation->symptoms))
|
||||
@php
|
||||
$symptoms_explode = !empty($triage->symptoms)? explode(",", $triage->symptoms):explode(",", $consultation->symptoms);
|
||||
$symptoms_duration = !empty($triage->symptom_duration)? explode(",", $triage->symptom_duration):explode(",", $consultation->symptom_duration);
|
||||
@endphp
|
||||
<p class="card-text">
|
||||
<ul class="list-group list-group-flush">
|
||||
@foreach ($symptoms_explode as $key => $symptom)
|
||||
<li class="list-group-item text-center">{{ ucwords($symptoms[$symptom] ?? '') }} for {{ $symptoms_duration[$key]?? '' }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</p>
|
||||
@else
|
||||
<p class="card-text">
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class='list-group-item text-center font-weight-bold text-danger'>{{ __('consultations.no_symptom_recorded') }}</li>
|
||||
</ul>
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@if (between($years, 0, 12))
|
||||
<div class="card border-0">
|
||||
<div class="card-block">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title text-center">{{ __('triage.emergency_signs') }}</h5>
|
||||
</div>
|
||||
@if (!empty($emergent_signs))
|
||||
<p class="card-text">
|
||||
<ul class="list-group list-group-flush">
|
||||
@foreach ($emergent_signs as $emergent_sign)
|
||||
<li class='list-group-item text-center'>{{ ucwords($emergent_sign ?? '') }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</p>
|
||||
@else
|
||||
<p class="card-text text-success">
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class='list-group-item text-center text-success font-weight-bold'>{{ __('layout.no_emergency_signs') }}</li>
|
||||
</ul>
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="card border-0">
|
||||
<div class="card-block">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title text-center">{{ __('layout.priority_signs') }}</h5>
|
||||
</div>
|
||||
@if (count($priority_signs) > 0)
|
||||
<p class="card-text">
|
||||
<ul class="list-group list-group-flush">
|
||||
@foreach ($priority_signs as $priority_sign)
|
||||
<li class='list-group-item text-center'>{{ ucwords($priority_sign ?? '') }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</p>
|
||||
@else
|
||||
<p class="card-text">
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class='list-group-item text-center text-success font-weight-bold'>{{ __('layout.no_priority_signs') }}</li>
|
||||
</ul>
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@if (isset($triage->any_tb_sysmptoms) && $triage->any_tb_sysmptoms == 1)
|
||||
<div class="card border-0">
|
||||
<div class="card-block">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title text-center">{{ __('layout.tb_screening') }}</h5>
|
||||
</div>
|
||||
<table class="table table-bordered">
|
||||
<tr class="cough_tb_question">
|
||||
<td>A cough for more than two weeks?</td>
|
||||
<td>{{ $triage->cough_for_2_weeks == 1 ? "Yes" : "No" }}</td>
|
||||
</tr>
|
||||
<tr class="fever_tb_question">
|
||||
<td>Persistent fevers for 2 weeks or more?</td>
|
||||
<td>{{ $triage->fever_for_2_weeks == 1 ? "Yes" : "No" }}</td>
|
||||
</tr>
|
||||
<tr class="weight_loss_tb_question">
|
||||
<td>Noticeable weight loss of more than 3 Kg?</td>
|
||||
<td>{{ $triage->tb_weight_loss == 1 ? "Yes" : "No" }}</td>
|
||||
</tr>
|
||||
<tr class="weight_loss_tb_question">
|
||||
<td>Poor weight gain in the last one month?</td>
|
||||
<td>{{ $triage->tb_poor_weight_gain == 1 ? "Yes" : "No" }}</td>
|
||||
</tr>
|
||||
<tr class="excessive_night_sweats_tb_question">
|
||||
<td>Excessive night sweats for three weeks or more?</td>
|
||||
<td>{{ $triage->tb_excessive_night_sweats == 1 ? "Yes" : "No" }}</td>
|
||||
</tr>
|
||||
<tr class="excessive_night_sweats_tb_question">
|
||||
<td>Contact with a person with pulmonary TB or chronic cough?</td>
|
||||
<td>{{ $triage->tb_contact_with_tb_person == 1 ? "Yes" : "No" }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div> <br>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card-deck">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<strong>Primary Diagnosis</strong>
|
||||
</div>
|
||||
<table class="table table-light table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>{{ $all_diagnoses[$consultation->primary_diagnosis]?? "" }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$other_diagnoses = @unserialize($consultation->other_diagnoses);
|
||||
@endphp
|
||||
|
||||
@if(!empty($other_diagnoses))
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<strong>Secondary Diagnosis</strong>
|
||||
</div>
|
||||
<table class="table table-light table-sm">
|
||||
<thead>
|
||||
@foreach($other_diagnoses as $diagnosis)
|
||||
<tr>
|
||||
<td>{{ $all_diagnoses[$diagnosis]?? "" }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div> <br>
|
||||
|
||||
<div class="row">
|
||||
@if(!is_null($consultation->comments))
|
||||
<div class="col">
|
||||
<table class="table table-sm table-bordered">
|
||||
<thead class="thead-light">
|
||||
<tr><th>{{ __('patient_episode.comments') }}</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>{!! nl2br(e($consultation->comments)) !!}</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(!is_null($consultation->history_comments))
|
||||
<div class="col">
|
||||
<table class="table table-sm table-bordered">
|
||||
<thead class="thead-light">
|
||||
<tr><th>{{ __('patient_episode.history_comments') }}</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>{!! nl2br(e($consultation->history_comments)) !!}</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(!is_null($consultation->clinic_examination_comments))
|
||||
<div class="col">
|
||||
<table class="table table-sm table-bordered">
|
||||
<thead class="thead-light">
|
||||
<tr><th>{{ __('patient_episode.clinic_examination_comments') }}</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>{!! nl2br(e($consultation->clinic_examination_comments)) !!}</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@if (!empty($cons_notes))
|
||||
<table class="table table-sm table-bordered">
|
||||
<thead class="thead-light">
|
||||
<tr><th colspan="4" class="text-center">{{ __('consultations.previous_notes') }}</th></tr>
|
||||
<tr>
|
||||
<th>{{ __('consultations.history') }}</th>
|
||||
<th>{{ __('consultations.clinical_examination') }}</th>
|
||||
<th>{{ __('consultations.investigation_and_mgt_plan') }}</th>
|
||||
<th>{{ __('consultations.date') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($cons_notes as $consultation_note)
|
||||
<tr>
|
||||
<td>{{ $consultation_note->history_comments }}</td>
|
||||
<td>{{ $consultation_note->clinic_examination_comments }}</td>
|
||||
<td>{{ $consultation_note->investigation_and_management_plan_comments}}</td>
|
||||
<td>{{ streamline_date_time($consultation_note->created_at) }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="4"><code>{{ __('consultations.no_previous_notes') }}</code></td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
@if(count($opd_investigations) > 0)
|
||||
<div class="col">
|
||||
<table class="table table-light table-sm table-bordered">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>{{ __('patient_file.investigation') }}</th>
|
||||
<th>{{ __('patient_file.result') }}</th>
|
||||
<th>{{ __('patient_file.normal_ranges') }}</th>
|
||||
<th>{{ __('patient_file.comment') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(count($opd_investigations) > 0)
|
||||
@for($i = 0; $i < count($opd_investigations['name']); $i++)
|
||||
@if(isset($opd_investigations['name'][$i]))
|
||||
<tr>
|
||||
<td>{{ $opd_investigations['name'][$i] }}</td>
|
||||
<td>
|
||||
@if (!empty($opd_investigations['type'][$i]))
|
||||
<strong><code>See attached</code></strong>
|
||||
@else
|
||||
{!! nl2br(e($opd_investigations['value'][$i])) !!}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $opd_investigations['normal_ranges'][$i] }}</td>
|
||||
<td>{!! nl2br(e($opd_investigations['comment'][$i])) !!}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endfor
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(count($ordered_procedures) > 0)
|
||||
<div class="col">
|
||||
<table class="table table-light table-sm table-bordered">
|
||||
<thead class="thead-light">
|
||||
<tr><th>{{ __('patient_episode.procedure_name') }}</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($ordered_procedures as $procedure)
|
||||
@php
|
||||
$procedure_ids = explode(',', $procedure->procedure_id);
|
||||
@endphp
|
||||
@foreach ($procedure_ids as $id)
|
||||
<tr>
|
||||
<td>{{ $procedures[$id] ?? "" }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@if(count($treatments) > 0)
|
||||
<div class="col">
|
||||
<table class="table table-bordered table-sm">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>{{ __('patient_file.treatment') }}</th>
|
||||
<th>{{ __('patient_file.dosage_freq') }}</th>
|
||||
<th></th>
|
||||
<th>{{ __('prescriptions.instructions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $progressive_ids = []; @endphp
|
||||
@foreach($treatments as $treatment)
|
||||
<?php
|
||||
$drugs_array = explode(",", $treatment->drugs);
|
||||
$dosage_array = explode(",", $treatment->doses);
|
||||
$dosage2_array = explode(",", $treatment->dose2);
|
||||
$frequencies_array = explode(",", $treatment->frequencies);
|
||||
$duration_array = explode(",", $treatment->durations);
|
||||
$quantity_dispensed_array = explode(",", $treatment->quantities_dispensed);
|
||||
$instructions_array = explode(",", $treatment->instruction);
|
||||
$purchased_elsewhere_array = explode(",", $treatment->purchased_elsewhere);
|
||||
|
||||
// check if treatment is progressive and ignore
|
||||
if ($treatment->is_treatment_progressive != 0) {
|
||||
$progressive_ids[] = $treatment->is_treatment_progressive;
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
@for ($x = 0; $x < count($drugs_array); $x++)
|
||||
<?php
|
||||
$drug_details = \Streamline\Models\Drug::find($drugs_array[$x]);
|
||||
|
||||
if (!$drug_details) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$drug_form_name = get_name($drug_details->form_id, "id", "name", "unit_of_measure");
|
||||
$drug_unit = get_name($drug_details->unit_id, "id", "name", "drug_units");
|
||||
$drug_strength = $drug_details->strength;
|
||||
|
||||
$treatment_dosage = $dosage_array[$x] ?? "";
|
||||
$treatment_strength = $drug_strength ?? "";
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
{{ $drug_details->name }}
|
||||
|
||||
@if($purchased_elsewhere_array[$x] == 1)
|
||||
<code>( To Be Purchased elsewhere )</code>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
({{ $dosage_array[$x] }} {!! $drug_unit !!} {{ get_name($frequencies_array[$x], 'id', 'name', 'dosage_frequencies') }})
|
||||
</td>
|
||||
<td>{{ $duration_array[$x] ?? "" }}</td>
|
||||
<td>{{ $instructions_array[$x] ?? "" }}</td>
|
||||
</tr>
|
||||
@endfor
|
||||
@endforeach
|
||||
|
||||
@if(count($progressive_ids) > 0)
|
||||
@php
|
||||
$progressive_treatments = \Illuminate\Support\Facades\DB::table('treatments_opd_progressive')->whereIn('id', $progressive_ids)->get();
|
||||
@endphp
|
||||
|
||||
@foreach($progressive_treatments as $treatment)
|
||||
<?php
|
||||
$drugs_array = explode(",", $treatment->drugs);
|
||||
$dosage_array = explode(",", $treatment->dose);
|
||||
$frequencies_array = explode(",", $treatment->drug_frequency);
|
||||
$duration_array = explode(",", $treatment->durations);
|
||||
$quantity_dispensed_array = explode(",", $treatment->quantities_to_dispense);
|
||||
$instructions_array = explode(",", $treatment->instruction);
|
||||
?>
|
||||
@for ($x = 0; $x < count($drugs_array); $x++)
|
||||
<?php
|
||||
$drug_details = \Streamline\Models\Drug::find($drugs_array[$x]);
|
||||
|
||||
if (!$drug_details) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$drug_form_name = get_name($drug_details->form_id, "id", "name", "unit_of_measure");
|
||||
$drug_unit = get_name($drug_details->unit_id, "id", "name", "drug_units");
|
||||
$drug_strength = $drug_details->strength;
|
||||
|
||||
$treatment_dosage = $dosage_array[$x] ?? "";
|
||||
$treatment_strength = $drug_strength ?? "";
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td>{{ $drug_details->name }}</td>
|
||||
<td>
|
||||
({{ $dosage_array[$x] }} {!! $drug_unit !!} {{ get_name($frequencies_array[$x], 'id', 'name', 'dosage_frequencies') }})
|
||||
</td>
|
||||
<td>{{ $duration_array[$x] ?? "" }}</td>
|
||||
<td>{{ $instructions_array[$x] ?? "" }}</td>
|
||||
</tr>
|
||||
@endfor
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<strong>Referral Notes</strong>
|
||||
</div>
|
||||
<table class="table table-light table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>{{ $consultation->referral_notes }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<table class="table table-light table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><b>Referred By: </b></td>
|
||||
<td>{{ !is_null($consultation->consultation_done_by) ? get_full_name($consultation->consultation_done_by, "id", "first_name", "last_name", "users") : get_full_name($consultation->created_by, "id", "first_name", "last_name", "users")}} to {{ get_name($consultation->referred_to, 'id', 'name', 'referral_hospitals') }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Printed By
|
||||
</div>
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item">
|
||||
<?php echo Auth::user()->first_name . ' ' . Auth::user()->last_name; ?>
|
||||
....................................................
|
||||
({{ streamline_date(date("Y-m-d")) }})
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+1654
File diff suppressed because it is too large
Load Diff
Executable
+1520
File diff suppressed because it is too large
Load Diff
+980
@@ -0,0 +1,980 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<style type="text/css">
|
||||
button.h-100.br-5 {
|
||||
min-height: 4rem;
|
||||
}
|
||||
|
||||
#t_header th {
|
||||
background-color: #708090;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.color-tr {
|
||||
background: #FFFF99;
|
||||
}
|
||||
|
||||
.admitted_row_color {
|
||||
background: #d9edf7;
|
||||
}
|
||||
|
||||
.theatre_row_color {
|
||||
background: #f2e6ff;
|
||||
}
|
||||
|
||||
.appointment_row_color {
|
||||
background: #e4e0a8;
|
||||
}
|
||||
|
||||
.aTable tr {
|
||||
background-color: #DDD;
|
||||
}
|
||||
|
||||
.table_no_padding td {
|
||||
padding: 4px;
|
||||
}
|
||||
</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">{{ __('patient_episode.patient_episodes') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('patient_episode.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('patients.index') }}">{{ __('patient_episode.patients') }}</a></li>
|
||||
<li class="active">{{ __('patient_episode.episodes') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('patients::allergies.header')
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('patients::patient_episodes.menu')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
{{ Form::open(['route' => 'patient_episodes.route_patient_episode', 'id' => 'episodesForm']) }}
|
||||
|
||||
{{ Form::hidden('patient_id', $patient->id, ['id' => 'patient_id']) }}
|
||||
|
||||
<div class="white-box br-5">
|
||||
@include('flash::message')
|
||||
@if(Auth::user()->can('merge-patient-episodes'))
|
||||
<p>
|
||||
<a class="btn btn-warning btn-sm btn-rounded" style="background-color: #d4984a; float:right" target="_blank" href="{{ url('episode_merge_preview') }}"><strong>{{ __('patient_episode.merge_episodes') }}</strong></a><br>
|
||||
</p>
|
||||
@endif
|
||||
<div class="table-responsive">
|
||||
<table class="table color-table success-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('patient_episode.episode_date') }}</th>
|
||||
<th>{{ __('patient_episode.clinic') }}</th>
|
||||
<th>{{ __('patient_episode.patient_diagnosis') }}</th>
|
||||
<th>{{ __('patient_episode.consultation_by') }}</th>
|
||||
<th>{{ __('patient_episode.comments') }}</th>
|
||||
<th>{{ __('patient_episode.select') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($patient_episodes as $patient_episode)
|
||||
@php
|
||||
$episode_id = $patient_episode->id;
|
||||
$created_at = Carbon\Carbon::parse($patient_episode->created_at);
|
||||
$triage_id = $patient_episode->triage_id;
|
||||
$anc = \DB::table('ante_natal_clinic_followups')->where([['episode_id', $episode_id],['patient_id', $patient_episode->patient_id]])->first();
|
||||
$consultation_id = !empty($anc->primary_diagnosis)? $anc->primary_diagnosis:$patient_episode->consultation_id;
|
||||
$primary_diagnosis_id = '';
|
||||
$other_diagnoses_ids = [];
|
||||
$triage_comment = '';
|
||||
$consultation_comment = '';
|
||||
$clinic = (isset($clinics[$patient_episode->clinic_id]) && !is_null($patient_episode->clinic_id)) ? $clinics[$patient_episode->clinic_id] : '';
|
||||
$primary_diagnosis = '';
|
||||
$other_diagnoses = '';
|
||||
$triage_and_consultation_comments = '';
|
||||
$right_eye_diagnoses = $left_eye_diagnoses = [];
|
||||
$eye_consultation_comment = "";
|
||||
$eye_triage_comment = '';
|
||||
$eye_triage_and_consultation_comments = "";
|
||||
@endphp
|
||||
|
||||
@if (!empty($consultation_id))
|
||||
@php
|
||||
$primary_diagnosis_id = !empty($anc->primary_diagnosis)? $anc->primary_diagnosis: get_name($consultation_id, 'id', 'primary_diagnosis', 'consultations');
|
||||
|
||||
try {
|
||||
$other_diagnoses_ids = !empty($anc->other_diagnoses)? explode(',',$anc->other_diagnoses): unserialize(trim(get_name($consultation_id, 'id', 'other_diagnoses', 'consultations')));
|
||||
} catch (\ErrorException $exception) {}
|
||||
|
||||
// confirm it's an array
|
||||
$other_diagnoses_ids = is_array($other_diagnoses_ids) ? $other_diagnoses_ids : [];
|
||||
|
||||
$consultation_comment = !empty($anc->comments)? trim($anc->comments): trim(get_name($consultation_id, 'id', 'comments', 'consultations'));
|
||||
$consultation_comment = clean_streamline_database_output(trim(get_name($consultation_id, 'id', 'comments', 'consultations')));
|
||||
$triage_comment = !is_null($triage_id) ? trim(get_name($triage_id, 'id', 'comments', 'triage')) : '';
|
||||
$triage_and_consultation_comments = '<b>Triage: </b>'.$triage_comment.' '.'<br><b>Consultation: </b>'.$consultation_comment;
|
||||
|
||||
$right_eye_diagnoses = explode(',',get_name($consultation_id, 'id', 'right_eye_diagnosis', 'eye_clinic_main_exam'));
|
||||
$left_eye_diagnoses = explode(',',get_name($consultation_id, 'id', 'left_eye_diagnosis', 'eye_clinic_main_exam'));
|
||||
$eye_consultation_comment = trim(get_name($consultation_id, 'id', 'advice', 'eye_clinic_main_exam'));
|
||||
$eye_triage_comment = !is_null($triage_id) ? trim(get_name($triage_id, 'id', 'comment', 'eye_clinic_base_exam_refraction')) : '';
|
||||
$eye_triage_and_consultation_comments = '<b>Base Refraction Exam: </b>'.$eye_triage_comment.' '.'<br><b>Main Exam: </b>'.$eye_consultation_comment;
|
||||
@endphp
|
||||
@endif
|
||||
|
||||
@php
|
||||
$primary_diagnosis = $diagnoses[$primary_diagnosis_id] ?? '';
|
||||
$other_diagnoses = "";
|
||||
|
||||
for($s = 0; $s < count($other_diagnoses_ids); $s++){
|
||||
$other_diagnoses .= isset($diagnoses[$other_diagnoses_ids[$s]]) ? ($diagnoses[$other_diagnoses_ids[$s]] . ", ") : '';
|
||||
}
|
||||
|
||||
$is_patient_in_eye_clinic = is_patient_in_eye_clinic($episode_id);
|
||||
@endphp
|
||||
|
||||
<tr id='my_row{{ $episode_id }}'>
|
||||
<td>
|
||||
<a href="#" style="color: #0099CC">{{ streamline_date_time($patient_episode->created_at) }} </a>
|
||||
<br>
|
||||
<small>{{ __('patient_episode.started_by') }}</small>
|
||||
<small style="color: blue">{{ get_full_name($patient_episode->created_by, "id", "first_name", "last_name", "users") }}</small>
|
||||
|
||||
@if(check_if_episode_is_a_followup($patient_episode->id))
|
||||
@php
|
||||
$original_episode = \Streamline\Models\PatientEpisode::find($patient_episode->parent_episode_id);
|
||||
@endphp
|
||||
<small style="color: green"><br>({{ __('patient_episode.review_from') }} {{ $original_episode ? streamline_date($original_episode->created_at) : '' }})</small>
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->can('delete-empty-episode') && is_episode_safe_to_delete($patient_episode->id))
|
||||
<br>
|
||||
<br>
|
||||
<a class="btn btn-danger btn-sm" href="/patient_episodes/delete_episode/{{ $patient_episode->id }}" onclick="return confirm('Are you sure you want to delete this episode?')">{{ __('patient_episode.remove_episode') }}</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if( Auth::user()->can('view-patient-episode-clinic-from-patient-home'))
|
||||
{{ $clinic }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if( Auth::user()->can('view-patient-episode-primary-diagnoses'))
|
||||
@if(is_eye_module_enabled() && $is_patient_in_eye_clinic)
|
||||
@if(count($right_eye_diagnoses) > 0)
|
||||
@for($x = 0; $x < count($right_eye_diagnoses); $x++)
|
||||
{{ get_name(get_name($right_eye_diagnoses[$x], 'id', 'diagnosis_category', 'diagnoses'), 'id', 'name', 'diagnosis_categories') }} - {{ $diagnoses[$right_eye_diagnoses[$x]] ?? '' }}<br/>
|
||||
@endfor
|
||||
@endif
|
||||
@else
|
||||
{{ __('patient_episode.primary_diagnosis') . ': ' . $primary_diagnosis }}
|
||||
@endif
|
||||
@endif
|
||||
|
||||
<hr>
|
||||
|
||||
@if( Auth::user()->can('view-patient-episode-other-diagnoses'))
|
||||
@if(is_eye_module_enabled() && $is_patient_in_eye_clinic)
|
||||
@if(count($left_eye_diagnoses) > 0)
|
||||
@for($x = 0; $x < count($left_eye_diagnoses); $x++)
|
||||
{{ get_name(get_name($left_eye_diagnoses[$x], 'id', 'diagnosis_category', 'diagnoses'), 'id', 'name', 'diagnosis_categories') }} - {{ $diagnoses[$left_eye_diagnoses[$x]] ?? '' }}<br/>
|
||||
@endfor
|
||||
@endif
|
||||
@else
|
||||
{!! __('patient_episode.other_diagnosis') . ': <br>' !!}
|
||||
{!! read_more($other_diagnoses, 'other_diagnoses_short' . $patient_episode->id, 'other_diagnoses_long' . $patient_episode->id) !!}
|
||||
|
||||
<div id="other_diagnoses_long{{ $patient_episode->id }}" style="display: none;">
|
||||
{!! $other_diagnoses !!}<br/>
|
||||
<a class="read_more" style="color : #0099CC;" onclick= "hide('other_diagnoses_long{{ $patient_episode->id }}');show('other_diagnoses_short{{ $patient_episode->id }}');">{{ __('patient_episode.read_less') }}</a>
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td class="hidden-phone">
|
||||
@php
|
||||
$consultation_done_by = !empty($anc->created_by)? $anc->created_by :get_doctor_who_completed_episode_consultation($patient_episode->id);
|
||||
@endphp
|
||||
|
||||
@if(!is_null($consultation_done_by))
|
||||
{{ get_full_name($consultation_done_by, "id", "first_name", "last_name", "users") }}
|
||||
@endif
|
||||
|
||||
@if($patient_episode->episode_type == 1)
|
||||
<span>{{ __('patient_flow_monitoring.lab_self_request') }}</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="hidden-phone">
|
||||
{!! read_more($triage_and_consultation_comments, 'short_comment' . $patient_episode->id, 'long_comment' . $patient_episode->id) !!}
|
||||
|
||||
<div id="long_comment{{ $patient_episode->id }}" style="display: none;">
|
||||
{!! $triage_and_consultation_comments !!}<br/>
|
||||
<a class="read_more" style="color : #0099CC;" onclick= "hide('long_comment{{ $patient_episode->id }}');show('short_comment{{ $patient_episode->id }}');">{{ __('patient_episode.read_less') }}</a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<input type="radio" onchange="show('menu1'), hide('theatre_menu'), hide('menu2'), hide('pic1'), hide('menu_maternity'), manage_eye_menus('{{ $is_patient_in_eye_clinic }}')" class="radio-option center" name="episode_id" id="episode_id_{{ $patient_episode->id }}" value="{{ $patient_episode->id }}" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@php
|
||||
$inpatient_info = get_all_first(['episode_id' => $patient_episode->id, 'patient_id' => $patient->id], 'inpatient_info');
|
||||
$maternity_ward_id = get_name("maternity", "slug", "id", "wards");
|
||||
@endphp
|
||||
@if ($inpatient_info != 'N/A')
|
||||
<tr id='my_row2{{ $inpatient_info->episode_id }}' class="admitted_row_color">
|
||||
<td style='background-color: white; font-size: smaller;'>
|
||||
@if($inpatient_info->discharged)
|
||||
<a style="color: #0099CC">{{ __('patient_episode.discharged') }} on {{ streamline_date($inpatient_info->discharged_on) }}</a>
|
||||
<br><small style="color: blue">By {{ get_full_name($inpatient_info->discharged_by, "id", "first_name", "last_name", "users") }}</small>
|
||||
@else
|
||||
<a style="color: #0099CC">{{ __('patient_episode.admitted') }} on {{ streamline_date($inpatient_info->admitted_on) }}</a>
|
||||
<br><small style="color: blue">By {{ get_full_name($inpatient_info->created_by, "id", "first_name", "last_name", "users") }}</small>
|
||||
@endif
|
||||
</td>
|
||||
<td> {{ get_name($inpatient_info->ward_id, "id", "name", "wards") }} </td>
|
||||
@php
|
||||
$sec_diagnoses = (!is_null($inpatient_info->other_diagnoses) && !is_null(unserialize($inpatient_info->other_diagnoses))) ? array_values(unserialize($inpatient_info->other_diagnoses)) : [] ;
|
||||
$sec_diagnosis = "";
|
||||
for ($s = 0; $s < count($sec_diagnoses); $s++) $sec_diagnosis .= get_name($sec_diagnoses[$s], "id", "name", "diagnoses") . ", ";
|
||||
@endphp
|
||||
<td>
|
||||
@if( Auth::user()->can('view-patient-episode-primary-diagnoses'))
|
||||
{{ get_name($inpatient_info->primary_diagnosis, "id", "name", "diagnoses") }}
|
||||
@endif
|
||||
|
||||
@if( Auth::user()->can('view-patient-episode-other-diagnoses'))
|
||||
{!! read_more($sec_diagnosis, 'sec_diagnosis_short' . $episode_id, 'sec_diagnosis_long' . $episode_id) !!}
|
||||
<div id="sec_diagnosis_long{{ $episode_id }}" style="display: none;">
|
||||
{!! $sec_diagnosis !!}<br/>
|
||||
<a class="read_more" style="color : #0099CC;" onclick= "hide('sec_diagnosis_long{{ $episode_id }}');show('sec_diagnosis_short{{ $episode_id }}');">{{ __('patient_episode.read_less') }}</a>
|
||||
</div>
|
||||
@endif
|
||||
</td>
|
||||
<td class="hidden-phone">
|
||||
@php
|
||||
$consultation_done_by = !empty($anc->created_by)? $anc->created_by :get_doctor_who_has_done_episode_consultation($patient_episode->patient_id, $patient_episode->id);
|
||||
@endphp
|
||||
|
||||
@if(!is_null($consultation_done_by))
|
||||
{{ get_full_name($consultation_done_by, "id", "first_name", "last_name", "users") }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{!! read_more($inpatient_info->comments, 'short_inpatient_comment' . $inpatient_info->id, 'long_inpatient_comment' . $inpatient_info->id) !!}
|
||||
|
||||
<div id="long_inpatient_comment{{ $inpatient_info->id }}" style="display: none;">
|
||||
{!! $inpatient_info->comments !!}<br/>
|
||||
<a class="read_more" style="color : #0099CC;" onclick= "hide('long_inpatient_comment{{ $inpatient_info->id }}');show('short_inpatient_comment{{ $inpatient_info->id }}');">{{ __('patient_episode.read_less') }}</a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
@if(get_name($inpatient_info->ward_id, "id", "slug", "wards") == "maternity")
|
||||
<input type="radio" onchange="show('menu_maternity'), hide('theatre_menu'), hide('menu1'), hide('menu2'), hide('pic1')" class="radio-option-inpatient center" name="episode_id" id="episode_id" value="{{ $patient_episode->id }}"/>
|
||||
@else
|
||||
<input type="radio" onchange="show('menu2'), hide('theatre_menu'), hide('menu_maternity'), hide('menu1'), hide('pic1')" class="radio-option-inpatient center" name="episode_id" id="episode_id" value="{{ $patient_episode->id }}"/>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@php
|
||||
$theatre_information = does_episode_have_theatre_information($patient_episode->id);
|
||||
@endphp
|
||||
|
||||
@if ($theatre_information)
|
||||
<tr id='my_row3' class="theatre_row_color">
|
||||
<td style='background-color: white; font-size: smaller;'>
|
||||
@if($theatre_information['surgery_completed'])
|
||||
<span style="color: green">{{ __('patient_episode.surgery_complete') }}</span>
|
||||
@else
|
||||
<span style="color: red">{{ __('patient_episode.surgery_not_complete') }}</span>
|
||||
@endif
|
||||
|
||||
<br>
|
||||
|
||||
@if($theatre_information['anaesthesia_completed'])
|
||||
<span style="color: green">{{ __('patient_episode.anaesthesia_complete') }}</span>
|
||||
@else
|
||||
<span style="color: red">{{ __('patient_episode.anaesthesia_not_complete') }}</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{ __('patient_episode.procedure') }}: {{ $theatre_information['procedure_name'] }}
|
||||
|
||||
<br><br>
|
||||
|
||||
{{ __('patient_episode.surgery_type') }}: {{ $theatre_information['surgery_type'] }}
|
||||
</td>
|
||||
<td>{{ __('patient_episode.outcome') }}: {{ $theatre_information['outcome'] }}</td>
|
||||
<td class="hidden-phone">
|
||||
@php
|
||||
$consultation_done_by = !empty($anc->created_by)? $anc->created_by :get_doctor_who_has_done_episode_consultation($patient_episode->patient_id, $patient_episode->id);
|
||||
@endphp
|
||||
|
||||
@if(!is_null($consultation_done_by))
|
||||
{{ get_full_name($consultation_done_by, "id", "first_name", "last_name", "users") }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{!! read_more($theatre_information['comments'], 'short_theatre_comment' . $patient_episode->id, 'long_theatre_comment' . $patient_episode->id) !!}
|
||||
|
||||
<div id="long_theatre_comment{{ $patient_episode->id }}" style="display: none;">
|
||||
{!! $theatre_information['comments'] !!}<br/>
|
||||
<a class="read_more" style="color : #0099CC;" onclick= "hide('long_theatre_comment{{ $patient_episode->id }}');show('short_theatre_comment{{ $patient_episode->id }}');">{{ __('patient_episode.read_less') }}</a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<input type="radio" onchange="show('theatre_menu'), hide('menu_maternity'), hide('menu1'), hide('menu2'), hide('pic1')" class="radio-option-inpatient center" name="episode_id" id="episode_id" value="{{ $patient_episode->id }}"/>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@php
|
||||
$episode_appointment = get_all_first(['episode_id' => $patient_episode->id, 'patient_id' => $patient->id], 'patient_appointments');
|
||||
@endphp
|
||||
|
||||
@if($episode_appointment != 'N/A' && $episode_appointment->appointment_fulfilled == 1)
|
||||
<tr id='my_row4' class="appointment_row_color">
|
||||
<td style='background-color: white; font-size: small;'>
|
||||
@if($episode_appointment->appointment_fulfilled == 1)
|
||||
<span style="color: red">{{ __('patient_episode.follow_up') }}</span>
|
||||
@else
|
||||
<span style="color: red">{{ __('patient_episode.follow_up_complete') }}</span>
|
||||
@endif
|
||||
</td>
|
||||
<td><b>{{ __('patient_episode.clinic') }}:</b> {{ get_name($episode_appointment->clinic_allocation, 'id', 'name', 'clinics') }}</td>
|
||||
<td>
|
||||
<b>{{ __('patient_episode.appointment_date') }}:</b> {{ is_null($episode_appointment->appointment_date) ? '' : streamline_date($episode_appointment->appointment_date) }}
|
||||
<br><br>
|
||||
<b>{{ __('patient_episode.in_charge') }}:</b> {{ get_full_name($episode_appointment->incharge_id, 'id', 'first_name', 'last_name', 'users') != "ALL STAFF" ? get_full_name($episode_appointment->incharge_id, 'id', 'first_name', 'last_name', 'users') : "N/A" }}
|
||||
</td>
|
||||
<td class="hidden-phone">
|
||||
@php
|
||||
$consultation_done_by = !empty($anc->created_by)? $anc->created_by : get_doctor_who_has_done_episode_consultation($patient_episode->patient_id, $patient_episode->id);
|
||||
@endphp
|
||||
|
||||
@if(!is_null($consultation_done_by))
|
||||
{{ get_full_name($consultation_done_by, "id", "first_name", "last_name", "users") }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $episode_appointment->comments }}</td>
|
||||
<td>
|
||||
<input type="radio" onchange="show('menu1'), hide('theatre_menu'), hide('menu2'), hide('pic1'), hide('menu_maternity')" class="radio-option center" name="episode_id" id="episode_id_{{ $patient_episode->id }}" value="{{ $patient_episode->id }}" />
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div id="menu1" style="display: none;">
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12 eye_button" value="base_refraction_exam">Base Refraction Exam</button>
|
||||
|
||||
@if(Auth::user()->can('perform-triage') && !is_add_attendance_to_consultation_enabled())
|
||||
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12 normal_button" value="triage">{{ __('patient_episode.triage') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12 eye_button" value="main_exam">Main Exam</button>
|
||||
|
||||
@if(Auth::user()->can('create-consultation'))
|
||||
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12 normal_button" value="consultation" id="consultation_button">{{ __('patient_episode.consultation') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
@if(Auth::user()->can('create-prescription'))
|
||||
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12" value="prescription">{{ __('patient_episode.prescriptions') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
@if(Auth::user()->can('order-for-investigations'))
|
||||
<div class="btn-group dropup m-r-10 col-sm-12">
|
||||
<button aria-expanded="false" data-toggle="dropdown" class="btn btn-sm btn-success dropdown-toggle waves-effect waves-light btn-block" type="button">{{ __('patient_episode.investigations') }} <span class="caret"></span></button>
|
||||
<ul role="menu" class="dropdown-menu">
|
||||
<li><button type="submit" name="submit" class="btn btn-link w-100 h-100" value="investigations" >{{ __('patient_episode.investigations') }}</button></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="/investigations/view_historical_results_labs/{{ $patient->id }}" style="text-align:center; color:black" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.historical_investigations') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
@if(Auth::user()->can('order-for-procedures'))
|
||||
<button type="submit" name="submit" class="btn btn-success btn-sm btn-block" value="procedure">{{ __('patient_episode.procedures') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<button class="btn btn-success btn-sm btn-block" type="submit" name="submit" value="patient_document">{{ __('patient_episode.add_document') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
@if(Auth::user()->can('order-for-sundries'))
|
||||
<button type="submit" name="submit" class="btn btn-success btn-sm btn-block" value="sundries">{{ __('patient_episode.sundries') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2">
|
||||
@if(Auth::user()->can('order-for-services-from-patient-home'))
|
||||
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12" value="services">{{ __('patient_episode.services') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2">
|
||||
@if(Auth::user()->can('view-episode-summary'))
|
||||
<button type="button" class="btn btn-primary btn-sm btn-block" id="patient_file">{{ __('patient_episode.episode_summary') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
@if(Auth::user()->can('transfer-patient-internally'))
|
||||
<div class="btn-group dropup m-r-10 col-sm-12">
|
||||
<button aria-expanded="false" data-toggle="dropdown" class="btn btn-primary btn-sm dropdown-toggle btn-block" type="button">{{ __('patient_episode.internal_transfer') }} <span class="caret"></span></button>
|
||||
<ul role="menu" class="dropdown-menu">
|
||||
<li><button type="button" class="btn btn-primary btn-sm btn-block" id="internal_transfer">{{ __('patient_episode.clinic_transfer') }}</button></li>
|
||||
<li><button type="button" class="btn btn-info btn-sm btn-block" id="doctor_transfer">{{ __('patient_episode.doctor_transfer') }}</button></li>
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
@if(Auth::user()->can('view-death-report'))
|
||||
<button type="submit" name="submit" id="death_report_btn" value="death_report_btn" class="btn btn-sm btn-block btn-inverse" >NIRA {{ __('patient_episode.death_report') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
@if(Auth::user()->can('create-theatre-surgery') || Auth::user()->can('create-theatre-anaesthesia'))
|
||||
<div class="btn-group dropup m-r-10 col-sm-12">
|
||||
<button aria-expanded="false" data-toggle="dropdown" class="btn btn-info btn-sm dropdown-toggle waves-effect waves-light col-sm-12" type="button">{{ __('patient_episode.theatre') }} <span class="caret"></span></button>
|
||||
<ul role="menu" class="dropdown-menu">
|
||||
<li><button type="submit" name="submit" value="create_anaesthetics" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.theatre_anaesthetics') }}</button></li>
|
||||
<li><button type="submit" name="submit" value="anaesthetics_history" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.historical_anaesthetics') }}</button></li>
|
||||
<li><button type="submit" name="submit" value="create_surgery" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.theatre_surgery') }}</button></li>
|
||||
<li><button type="submit" name="submit" value="surgery_index" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.historical_surgeries') }}</button></li>
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
@if(Auth::user()->can('perform-triage-without-etat'))
|
||||
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12" value="triage_without_etat">{{ __('patient_episode.triage_without') }} ETAT</button>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
@if(Auth::user()->can('create-consultation-with-notes'))
|
||||
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12" value="consultation_with_notes">{{ __('patient_episode.consultation_with_notes') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2">
|
||||
@if(Auth::user()->can('drug-refill'))
|
||||
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12" value="drug_refill">{{ __('patient_episode.drug_refill') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@if(Auth::user()->can('drug-refill') && is_patient_category_pay_later($patient->category_id))
|
||||
<div class="col-sm-2">
|
||||
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12" value="edit_claim_number">{{ __('patient_episode.edit_claim_number') }}</button>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="col-sm-2">
|
||||
@if(Auth::user()->can('admit-patient-from-patient-home'))
|
||||
<button type="button" name="admit_patient" class="btn btn-success btn-sm col-sm-12" id="admit_patient">{{ __('patient_episode.admit_patient') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2">
|
||||
@if(Auth::user()->can('record-staff-service-performance'))
|
||||
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12" value="record_all_items">{{ __('patient_episode.order_multiple_items') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
</div> <br>
|
||||
<div class="row">
|
||||
@if(Auth::user()->can('order-for-eye-glasses') && is_eye_module_enabled())
|
||||
<div class="col-sm-2">
|
||||
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12" value="eye_glasses">Order Opticals</button>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- maternity menu at the shown at the bottom -->
|
||||
<div class="white-box" id="menu_maternity" style="display: none;">
|
||||
<div class="row">
|
||||
@if(Auth::user()->can('view-maternity-admission'))
|
||||
<div class="col-sm-2">
|
||||
<button name="submit" value="maternity_admission" class="btn btn-success btn-sm btn-block">{{ __('patient_episode.maternity_admission') }}</button>
|
||||
</div>
|
||||
@endif
|
||||
@if(Auth::user()->can('view-delivery-record'))
|
||||
<div class="col-sm-2">
|
||||
<button name="submit" value="delivery_record" class="btn btn-success btn-sm btn-block" >{{ __('patient_episode.delivery_record') }}</button>
|
||||
</div>
|
||||
@endif
|
||||
@if(Auth::user()->can('view-inpatient-sheet'))
|
||||
<div class="col-sm-2">
|
||||
<button name="submit" value="maternity_summary" class="btn btn-success btn-sm btn-block" >{{ __('patient_episode.inpatient_sheet') }}</button>
|
||||
</div>
|
||||
@endif
|
||||
@if(Auth::user()->can('view-birth-report'))
|
||||
<div class="col-sm-2">
|
||||
<button name="submit" value="birth_report" class="btn btn-sm btn-inverse btn-block" >NIRA {{ __('patient_episode.birth_report') }}</button>
|
||||
</div>
|
||||
@endif
|
||||
<div class="col-sm-2"></div>
|
||||
<div class="col-sm-2">
|
||||
<div class="btn-group dropup m-r-10 col-sm-12">
|
||||
<button aria-expanded="false" data-toggle="dropdown" class="btn btn-sm btn-info dropdown-toggle waves-effect waves-light btn-block" type="button">{{ __('patient_episode.theatre') }} <span class="caret"></span></button>
|
||||
<ul role="menu" class="dropdown-menu">
|
||||
@if(Auth::user()->can('create-anaesthetics'))
|
||||
<li><button type="submit" name="submit" value="create_anaesthetics" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.theatre_anaesthetics') }}</button></li>
|
||||
@endif
|
||||
@if(Auth::user()->can('view-anaesthetics-history'))
|
||||
<li><button type="submit" name="submit" value="anaesthetics_history" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.historical_anaesthetics') }}</button></li>
|
||||
@endif
|
||||
@if(Auth::user()->can('create-surgery'))
|
||||
<li><button type="submit" name="submit" value="create_surgery" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.theatre_surgery') }}</button></li>
|
||||
@endif
|
||||
@if(Auth::user()->can('view-surgery'))
|
||||
<li><button type="submit" name="submit" value="surgery_index" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.historical_surgeries') }}</button></li>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="menu2" style="display: none;">
|
||||
<div class="row">
|
||||
@if(Auth::user()->can('view-inpatient-sheet'))
|
||||
<div class="col-sm-2">
|
||||
<button type="submit" name="submit" class="btn btn-success btn-block btn-sm" value="inpatient-sheet-button">{{ __('patient_episode.inpatient_sheet') }}</button>
|
||||
</div>
|
||||
@endif
|
||||
@if(Auth::user()->can('view-inpatient-billing'))
|
||||
<div class="col-sm-2">
|
||||
<button type="submit" name="submit" class="btn btn-success btn-block btn-sm" value="inpatient_billing">{{ __('patient_episode.inpatient_billing') }}</button>
|
||||
</div>
|
||||
@endif
|
||||
@if(Auth::user()->can('issue-inpatient-attendant-pass'))
|
||||
<div class="col-sm-2">
|
||||
<button type="submit" name="submit" class="btn btn-default btn-block btn-sm" value="inpatient_attendant_pass">{{ __('patient_episode.inpatient_attendant_pass') }}</button>
|
||||
</div>
|
||||
@endif
|
||||
<div class="col-sm-2">
|
||||
<button type="submit" name="submit" class="btn btn-primary btn-block btn-sm" value="treatment_sheet">{{ __('patient_episode.treatment_sheet') }}</button>
|
||||
</div>
|
||||
<div class="col-sm-2"></div>
|
||||
<div class="col-sm-2">
|
||||
<div class="btn-group dropup m-r-10 col-sm-12">
|
||||
<button aria-expanded="false" data-toggle="dropdown" class="btn btn-info dropdown-toggle waves-effect waves-light btn-sm btn-block " type="button">{{ __('patient_episode.theatre') }} <span class="caret"></span></button>
|
||||
<ul role="menu" class="dropdown-menu">
|
||||
<li><button type="submit" name="submit" value="create_anaesthetics" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.theatre_anaesthetics') }}</button></li>
|
||||
<li><button type="submit" name="submit" value="anaesthetics_history" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.historical_anaesthetics') }}</button></li>
|
||||
<li><button type="submit" name="submit" value="create_surgery" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.theatre_surgery') }}</button></li>
|
||||
<li><button type="submit" name="submit" value="surgery_index" class="btn btn-default btn-sm btn-link">{{ __('patient_episode.historical_surgeries') }}</button></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="theatre_menu" style="display: none;">
|
||||
<div class="row">
|
||||
@if(Auth::user()->can('create-anaesthetics'))
|
||||
<div class="col-md-3">
|
||||
<button type="submit" name="submit" class="btn btn-success btn-block" value="create_anaesthetics">{{ __('patient_episode.theatre_anaesthetics') }}</button>
|
||||
</div>
|
||||
@endif
|
||||
@if(Auth::user()->can('view-anaesthetics-history'))
|
||||
<div class="col-md-3">
|
||||
<button type="submit" name="submit" class="btn btn-success btn-block" value="anaesthetics_history">{{ __('patient_episode.historical_anaesthetics') }}</button>
|
||||
</div>
|
||||
@endif
|
||||
@if(Auth::user()->can('create-surgery'))
|
||||
<div class="col-md-3">
|
||||
<button type="submit" name="submit" class="btn btn-success btn-block" value="create_surgery">{{ __('patient_episode.theatre_surgery') }}</button>
|
||||
</div>
|
||||
@endif
|
||||
@if(Auth::user()->can('view-surgery'))
|
||||
<div class="col-md-3">
|
||||
<button type="submit" name="submit" class="btn btn-success btn-block" value="surgery_index">{{ __('patient_episode.historical_surgeries') }}</button>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="white-box" id="pic1" style="display: none;">
|
||||
<div class="row">
|
||||
<div class="col-sm-8"></div>
|
||||
<div class="col-sm-4">
|
||||
<img src="KH_photos/Picture3.jpg" style="max-height: 250px; margin: auto;" class="image-preview" alt="child" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::close() }}
|
||||
|
||||
<div class="modal hide fade" id="modal-age">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h3>{{ __('patient_episode.select_a_patient') }}</h3>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
{{ __('patient_episode.select_patient_warning') }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<a href="#" class="btn btn-danger" data-dismiss="modal">{{ __('patient_episode.close') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="internal_transfer_dialog" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">{{ __('patient_episode.internal_transfer') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
{{ Form::label('current_clinic', __('patient_episode.current_clinic')) }}
|
||||
{{ Form::hidden('current_clinic_id', 0, ['id' => 'current_clinic_id']) }}
|
||||
{{ Form::hidden('current_triage_id', 0, ['id' => 'current_triage_id']) }}
|
||||
{{ Form::hidden('current_episode_id', 0, ['id' => 'current_episode_id']) }}
|
||||
{{ Form::text('current_clinic', '', ['class' => 'form-control compulsory', 'readonly', 'id' => 'current_clinic_transfer']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('transfered_from_doctor', __('patient_episode.transfer_from_doctor')) }}
|
||||
{{ Form::select('transfered_from_doctor', $users_array, '', ['class' => 'form-control transferedToDoctor', 'id' => 'transfer_from_doctor']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('transfer_to', __('patient_episode.transfer_to')) }}
|
||||
{{ Form::select('transfer_to', $clinics, null, ['class' => 'form-control compulsory', 'required', 'id' => 'transfer_to']) }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('transfered_to_doctor', __('patient_episode.transfer_to_doctor')) }}
|
||||
{{ Form::select('transfered_to_doctor', $users_array, '', ['class' => 'form-control transferedToDoctor', 'id' => 'transfer_to_doctor']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('patient_episode.close') }}</button>
|
||||
<button type="button" class="btn btn-success" id="submit_clinic_transfer" >{{ __('patient_episode.transfer_patient') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="doctor_transfer_dialog" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">{{ __('patient_episode.transfer_doctor') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
{{ Form::hidden('dt_episode_id', 0, ['id' => 'dt_episode_id']) }}
|
||||
{{ Form::label('transfered_from_doctor', __('patient_episode.transfer_from_doctor')) }}
|
||||
{{ Form::text('dt_from_doctor', '', ['class' => 'form-control', 'readonly', 'id' => 'dt_doctor_from']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('transfered_to_doctor', __('patient_episode.transfer_to_doctor')) }}
|
||||
@php $users_array = ['remove_from_doctor' => 'Remove from assigned doctor'] + $users_array; @endphp
|
||||
{{ Form::select('dt_doctor_to', $users_array, '', ['class' => 'form-control transferedDtToDoctor', 'id' => 'dt_doctor_to']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('patient_episode.close') }}</button>
|
||||
<button type="button" class="btn btn-success" id="submit_doctor_transfer" >{{ __('patient_episode.transfer_patient') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="ward_admission_episode" 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">{{ __('layout.ward_admission') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{ Form::open(['route' => 'patient_episodes.admit_patient_with_episode']) }}
|
||||
{{ Form::hidden('patient_id', $patient->id, ['id' => 'patient_id']) }}
|
||||
{{ Form::hidden('episode_admission_episode_id', 0, ['id' => 'episode_admission_episode_id']) }}
|
||||
|
||||
{{ Form::label('admission_ward_id', __('layout.select_ward')) }}
|
||||
{{ Form::select('admission_ward_id', $wards, '', ['class' => 'form-control', 'required' => 'true']) }}
|
||||
<br>
|
||||
{{ Form::label('ward_admission_date', __('layout.admission_date')) }}
|
||||
<input type="date" class="form-control" name="ward_admission_date" id="ward_admission_date" value="{{ date('Y-m-d') }}" required="true">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-success btn-sm" onclick="return confirm('<?php echo __('layout.are_you_sure_admit'); ?>');">{{ __('layout.continue_ward_admission') }}</button>
|
||||
{{ Form::close() }}
|
||||
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">{{ __('layout.close') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(session()->has('consultation_not_paid'))
|
||||
<div class="modal fade" id="unpaid_consultation_warning" 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>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h4 style="color: red">{{ __('patient_episode.patient_not_paid_consultation') }}</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('patient_episode.okay') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@php session()->forget('consultation_not_paid'); @endphp
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('js/streamline_plugins/jquery.session.js') }}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$("#admit_patient").click(function () {
|
||||
$.ajax({
|
||||
url: '/inpatient/check_for_open_admissions/' + $('#patient_id').val(),
|
||||
type: 'get',
|
||||
success: function (response) {
|
||||
if (response > 0) {
|
||||
$("#modal_patient_already_admitted").modal("show");
|
||||
} else {
|
||||
let current_episode_id = $('input[name=episode_id]:checked').val();
|
||||
$("#episode_admission_episode_id").val(current_episode_id);
|
||||
$("#ward_admission_episode").modal("show");
|
||||
$('#admission_ward_id').select2();
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#patient_file").click(function () {
|
||||
let current_episode_id = $('input[name=episode_id]:checked').val();
|
||||
|
||||
let win = window.open('/patients/episode_summary/' + current_episode_id, '_blank');
|
||||
if (win) {
|
||||
win.focus();
|
||||
} else {
|
||||
alert("Please allow pop-ups for this system")
|
||||
}
|
||||
});
|
||||
|
||||
$("#internal_transfer").click(function () {
|
||||
let current_episode_id = $('input[name=episode_id]:checked').val();
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/patient_episodes/internal_clinic_transfer/" + current_episode_id,
|
||||
success: function (result) {
|
||||
if (result != 0) {
|
||||
let arr = result.split(',');
|
||||
$('#current_clinic_transfer').val(arr[2]);
|
||||
$('#current_clinic_id').val(arr[1]);
|
||||
$('#current_triage_id').val(arr[0]);
|
||||
$('#current_episode_id').val(current_episode_id);
|
||||
$('#internal_transfer_dialog').modal('show');
|
||||
} else {
|
||||
alert("<?php echo __('patient_episode.triage_not_performed') ?>");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#submit_clinic_transfer").click(function () {
|
||||
let transfer_clinic = $("#transfer_to").val();
|
||||
let clinic = $("#current_clinic_id").val();
|
||||
let triage_id = $("#current_triage_id").val();
|
||||
let episode_id = $("#current_episode_id").val();
|
||||
let patient_id = $('#patient_id').val();
|
||||
let transfer_to_doctor = $('#transfer_to_doctor').val();
|
||||
let transfer_from_doctor = $('#transfer_from_doctor').val();
|
||||
|
||||
if (transfer_clinic == 0) {
|
||||
alert("<?php echo __('patient_episode.select_new_clinic') ?>");
|
||||
} else {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/patient_episodes/save_internal_clinic_transfer",
|
||||
data: {new_clinic: transfer_clinic, old_clinic: clinic, triage_id: triage_id, episode_id: episode_id, patient_id: patient_id, transfer_from_doctor: transfer_from_doctor, transfer_to_doctor: transfer_to_doctor},
|
||||
cache: false,
|
||||
success: function (result) {
|
||||
if (result == 1) {
|
||||
alert("<?php echo __('patient_episode.patient_transfer_successful') ?>");
|
||||
location.reload();
|
||||
} else {
|
||||
alert("<?php echo __('patient_episode.patient_transfer_failed') ?>");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#doctor_transfer").click(function (e) {
|
||||
e.preventDefault();
|
||||
let episode_id = $('input[name=episode_id]:checked').val();
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/patient_episodes/get_assigned_doctor/" + episode_id,
|
||||
success: function (result) {
|
||||
console.log(result);
|
||||
if (result != 0) {
|
||||
$("#dt_doctor_from").val(result);
|
||||
$("#doctor_transfer_dialog").modal('show');
|
||||
} else {
|
||||
//alert("No assigned doctor");
|
||||
$("#doctor_transfer_dialog").modal('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#submit_doctor_transfer").click(function () {
|
||||
let episode_id = $('input[name=episode_id]:checked').val();
|
||||
let dt_doctor_to = $('#dt_doctor_to').val();
|
||||
console.log('episode_id = ' + episode_id);
|
||||
console.log('doctor_id = ' + dt_doctor_to);
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/patient_episodes/save_doctor_transfer",
|
||||
data: {episode_id: episode_id, dt_doctor_to: dt_doctor_to},
|
||||
cache: false,
|
||||
success: function (result) {
|
||||
if (result == 1) {
|
||||
alert("<?php echo __('patient_episode.patient_transfer_successful') ?>");
|
||||
location.reload();
|
||||
} else {
|
||||
alert("<?php echo __('patient_episode.patient_transfer_failed') ?>");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function manage_eye_menus(is_patient_in_eye_clinic) {
|
||||
if(is_patient_in_eye_clinic == 1) {
|
||||
$('.eye_button').show();
|
||||
$('.normal_button').hide();
|
||||
} else {
|
||||
$('.eye_button').hide();
|
||||
$('.normal_button').show();
|
||||
}
|
||||
}
|
||||
|
||||
function show(id) {
|
||||
if (document.getElementById(id).style.display === 'none') {
|
||||
document.getElementById(id).style.display = '';
|
||||
}
|
||||
}
|
||||
|
||||
function hide(id) {
|
||||
document.getElementById(id).style.display = 'none';
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
$(".to_hide").each(function () {
|
||||
$(this).hide();
|
||||
});
|
||||
$("#edit").click(function () {
|
||||
$(this).hide();
|
||||
$("#submit_edit").show();
|
||||
$(".to_show").each(function () {
|
||||
$(this).hide();
|
||||
});
|
||||
$(".to_hide").each(function () {
|
||||
$(this).show();
|
||||
});
|
||||
});
|
||||
$("#close_modal").click(function () {
|
||||
$("#submit_edit").hide();
|
||||
$(".to_show").each(function () {
|
||||
$(this).show();
|
||||
});
|
||||
$(".to_hide").each(function () {
|
||||
$(this).hide();
|
||||
});
|
||||
$("#edit").show();
|
||||
});
|
||||
|
||||
$('.transferedToDoctor').select2({
|
||||
placeholder: "Select",
|
||||
width: "100%",
|
||||
dropdownParent: $('#internal_transfer_dialog')
|
||||
});
|
||||
|
||||
$('.transferedDtToDoctor').select2({
|
||||
placeholder: "Select",
|
||||
width: "100%",
|
||||
dropdownParent: $('#doctor_transfer_dialog')
|
||||
});
|
||||
|
||||
$("#unpaid_consultation_warning").modal("show");
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@push('styles')
|
||||
<style type="text/css">
|
||||
.btn-default.btn-sm.btn-link{
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
+950
@@ -0,0 +1,950 @@
|
||||
@push('styles')
|
||||
<style>
|
||||
.episode-menu li {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.episode-menu a {
|
||||
white-space: normal !important;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.modal-dialog {
|
||||
position: absolute;
|
||||
top: 40%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%) !important;
|
||||
}
|
||||
</style>
|
||||
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
||||
@endpush
|
||||
|
||||
<div class="row d-flex align-items-stretch">
|
||||
<div class="col-sm-9 mb-4">
|
||||
<div class="white-box h-100 br-5 mb-0">
|
||||
<ul class="episode-menu m-0 p-0">
|
||||
<div class="row m-0 w-100">
|
||||
<div class="col-sm-2">
|
||||
<li class="w-100">
|
||||
<button type="button" class="btn btn-success btn-sm w-100 h-100 br-5" data-toggle="modal"
|
||||
data-target="#demographicsModal">{{ __('layout.demographics') }}</button>
|
||||
</li>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<div class="form-group">
|
||||
<select class="form-control w-100" name="new_episode_option" id="new_episode_options">
|
||||
<option value="" selected disabled>{{ __('layout.create_new_episode') }}</option>
|
||||
@if (Auth::user()->can('create-patient-episode'))
|
||||
<option value="1">{{ __('layout.new_episode') }}</option>
|
||||
@endif
|
||||
@if (Auth::user()->can('create-patient-episode-with-clinic'))
|
||||
<option value="2"> {{ __('layout.new_episode_with_clinic') }}</option>
|
||||
@endif
|
||||
@if (Auth::user()->can('create-patient-episode-with-doctor'))
|
||||
<option value="3">{{ __('layout.new_episode_with_doctor') }}</option>
|
||||
@endif
|
||||
@if (Auth::user()->can('create-patient-episode-with-doctor-and-clinic'))
|
||||
<option value="4"> {{ __('layout.new_episode_with_doctor_and_clinic') }}
|
||||
</option>
|
||||
@endif
|
||||
@if (Auth::user()->can('create-patient-episode-with-admission'))
|
||||
<option value="5"> {{ __('layout.new_episode_with_admission') }}</option>
|
||||
@endif
|
||||
@if (Auth::user()->can('create-patient-episode-with-self-lab-request'))
|
||||
<option value="6"> {{ __('layout.new_episode_with_inv_self_request') }}
|
||||
</option>
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
<div class="modal fade" id="newEpisodeModal" tabindex="-1" role="dialog"
|
||||
aria-labelledby="modalNewEpisodeModelLabel1">
|
||||
<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="modalNewEpisodeModelLabel1">
|
||||
{{ __('patient_episode.new_episode_option') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{ Form::open(['route' => 'patient_episodes.create_special_clinic_episode']) }}
|
||||
{{ Form::hidden('patient_id', $patient->id) }}
|
||||
|
||||
{{ Form::label('new_episode_option', __('patient_episode.new_episode_option')) }}
|
||||
{{ Form::select('new_episode_option', [], '', ['class' => 'form-control', 'required' => 'true']) }}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-success btn-sm w-100 h-100 br-5"
|
||||
onclick="return confirm('<?php echo __('layout.are_you_sure_clinic'); ?>');">{{ __('layout.continue_clinic_allocation') }}</button>
|
||||
{{ Form::close() }}
|
||||
<button type="button" class="btn btn-danger btn-sm w-100 h-100 br-5"
|
||||
data-dismiss="modal">{{ __('layout.close') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (Auth::user()->can('create-patient-episode'))
|
||||
<li>
|
||||
<!-- <button type="submit" class="btn btn-success btn-sm show-episode-modal" data-backdrop="static" data-keyboard="false" data-toggle="modal" data-target="#episodeModal">{{ __('layout.new_episode') }}</button> -->
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if (Auth::user()->can('create-patient-episode-with-clinic'))
|
||||
<li>
|
||||
<!-- <a class="btn btn-success btn-sm" data-toggle="modal" data-target="#newEpisodeAndClinicModal">{{ __('layout.new_episode_clinic') }}</a> -->
|
||||
|
||||
<div class="modal fade" id="newEpisodeAndClinicModal" tabindex="-1" role="dialog"
|
||||
aria-labelledby="modalSpecialLabel1">
|
||||
<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="modalSpecialLabel1">
|
||||
{{ __('layout.clinic_allocation') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{ Form::open(['route' => 'patient_episodes.create_special_clinic_episode']) }}
|
||||
{{ Form::hidden('patient_id', $patient->id) }}
|
||||
|
||||
{{ Form::label('special_clinic_id', __('layout.select_clinic')) }}
|
||||
{{ Form::select('special_clinic_id', $special_clinics, '', ['class' => 'form-control', 'required' => 'true']) }}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-success btn-sm w-100 h-100 br-5"
|
||||
onclick="return confirm('<?php echo __('layout.are_you_sure_clinic'); ?>');">{{ __('layout.continue_clinic_allocation') }}</button>
|
||||
{{ Form::close() }}
|
||||
<button type="button" class="btn btn-danger btn-sm w-100 h-100 br-5"
|
||||
data-dismiss="modal">{{ __('layout.close') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if (Auth::user()->can('create-patient-episode-with-doctor-and-clinic'))
|
||||
<li>
|
||||
<!-- <a class="btn btn-success btn-sm" data-toggle="modal" data-target="#episodeWithDoctorAndClinicModal">{{ __('patient_episode.new_episode_with_doctor_and_clinic') }}</a> -->
|
||||
|
||||
<div class="modal fade" id="episodeWithDoctorAndClinicModal" tabindex="-1"
|
||||
role="dialog" aria-labelledby="episodeWithDoctorAndClinicLabel1">
|
||||
<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="episodeWithDoctorAndClinicLabel1">
|
||||
{{ __('patient_episode.doctor_and_clinic_allocation') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{ Form::open(['route' => 'patient_episodes.create_episode_with_doctor_and_clinic']) }}
|
||||
{{ Form::hidden('patient_id', $patient->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 doctorWithClinicDoctorDropDown', 'required' => 'true']) }}
|
||||
</div>
|
||||
|
||||
@if (is_patient_category_pay_later($patient->category_id))
|
||||
<div class="form-group">
|
||||
{{ Form::label('claim_number', __('patient_episode.claim_number')) }}
|
||||
{{ Form::text('claim_number', '', ['class' => 'form-control', 'required' => 'true', 'id' => 'claim_number']) }}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-success btn-sm w-100 h-100 br-5"
|
||||
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 w-100 h-100 br-5"
|
||||
data-dismiss="modal">{{ __('layout.close') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if (Auth::user()->can('create-patient-episode-with-doctor'))
|
||||
<li>
|
||||
<!-- <a class="btn btn-success btn-sm" data-toggle="modal" data-target="#episodeWithDoctorModal">{{ __('patient_episode.new_episode_with_doctor') }}</a> -->
|
||||
|
||||
<div class="modal fade" id="episodeWithDoctorModal" tabindex="-1" role="dialog"
|
||||
aria-labelledby="episodeWithDoctorLabel1">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-label="Close"><span
|
||||
aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="episodeWithDoctorLabel1">
|
||||
{{ __('patient_episode.doctor_allocation') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{ Form::open(['route' => 'patient_episodes.create_episode_with_doctor']) }}
|
||||
{{ Form::hidden('patient_id', $patient->id) }}
|
||||
|
||||
{{ 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 doctorDropDown', 'required' => 'true']) }}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-success btn-sm w-100 h-100 br-5"
|
||||
onclick="return confirm('<?php echo __('patient_episode.are_you_sure_doctor'); ?>');">{{ __('patient_episode.continue_doctor_allocation') }}</button>
|
||||
{{ Form::close() }}
|
||||
<button type="button" class="btn btn-danger btn-sm w-100 h-100 br-5"
|
||||
data-dismiss="modal">{{ __('layout.close') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if (Auth::user()->can('create-patient-episode-with-self-lab-request'))
|
||||
<li>
|
||||
<div class="modal fade" id="episodeWithSelfLabRequestModal" tabindex="-1"
|
||||
role="dialog" aria-labelledby="episodeWithSelfLabRequestLabel1">
|
||||
<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="episodeWithSelfLabRequestLabel1">
|
||||
{{ __('patient_episode.new_episode_with_self_lab_request') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-9" style="margin-top: 5px;">
|
||||
{{ __('layout.are_you_sure_inv_self_request') }}</div>
|
||||
<div class="col-sm-3">
|
||||
{{ Form::open(['route' => 'patient_episodes.create_episode_with_lab_self_request']) }}
|
||||
{{ Form::hidden('patient_id', $patient->id) }}
|
||||
<button type="submit"
|
||||
class="btn btn-success btn-sm w-100 h-100 br-5"
|
||||
name="createNewEpisode">{{ __('layout.yes') }}</button>
|
||||
<button type="button"
|
||||
class="btn btn-default w-100 h-100 br-5"
|
||||
data-dismiss="modal">{{ __('layout.cancel') }}</button>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<li>
|
||||
<a class="btn btn-info btn-small"
|
||||
onclick="return popitup('https://primaryreporting.who-umc.org/Reporting/Reporter?OrganizationID=UG')">
|
||||
{{ __('layout.sadr_report') }}
|
||||
</a>
|
||||
</li>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
@if ($patient->gender == 2)
|
||||
<li>
|
||||
@if (Auth::user()->can('create-maternity-admission'))
|
||||
<a class="btn btn-default" id="maternityAdmissionBtn"><i
|
||||
class="fa fa-plus-square"></i> {{ __('layout.maternity_admission') }}</a>
|
||||
@endif
|
||||
|
||||
@if (Module::has('Maternity') && Module::isEnabled('Maternity'))
|
||||
<!-- materninty modal -->
|
||||
<div class="modal fade" id="maternityModal" tabindex="-1" role="dialog"
|
||||
aria-labelledby="modalMaternityLabel1">
|
||||
<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="modalMaternityLabel1">
|
||||
{{ __('layout.date_of_maternity_admission') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{ Form::open(['route' => 'maternity.create_episode']) }}
|
||||
{{ Form::hidden('patient_id', $patient->id) }}
|
||||
<input type="date" class="form-control" name="maternity_date"
|
||||
id="maternity_date_field" value="{{ date('Y-m-d') }}">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-success btn-sm"
|
||||
onclick="return confirm('<?php echo __('layout.are_you_sure_admit_maternity'); ?>');">{{ __('layout.continue_maternity_admission') }}</button>
|
||||
{{ Form::close() }}
|
||||
<button type="button" class="btn btn-danger btn-sm"
|
||||
data-dismiss="modal">{{ __('layout.close') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end maternity modal -->
|
||||
@endif
|
||||
</li>
|
||||
@endif
|
||||
|
||||
<li>
|
||||
@if (Auth::user()->can('create-ward-admission'))
|
||||
<!-- <a class="btn btn-success btn-sm" data-toggle="modal" data-target="#wardAdmissionModal">{{ __('layout.ward_admission') }}</a> -->
|
||||
@endif
|
||||
<div class="modal fade" id="wardAdmissionModal" tabindex="-1" role="dialog"
|
||||
aria-labelledby="modalWardAdmissionLabel1">
|
||||
<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="modalWardAdmissionLabel1">
|
||||
{{ __('layout.ward_admission') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{ Form::open(['route' => 'patient_episodes.create_episode_with_ward']) }}
|
||||
{{ Form::hidden('patient_id', $patient->id, ['id' => 'patient_id']) }}
|
||||
|
||||
{{ Form::label('admission_ward_id', __('layout.select_ward')) }}
|
||||
{{ Form::select('admission_ward_id', $wards, '', ['class' => 'form-control', 'required' => 'true']) }}
|
||||
<br>
|
||||
{{ Form::label('ward_admission_date', __('layout.admission_date')) }}
|
||||
<input type="date" class="form-control" name="ward_admission_date"
|
||||
id="ward_admission_date" value="{{ date('Y-m-d') }}"
|
||||
required="true">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-success btn-sm"
|
||||
onclick="return confirm('<?php echo __('layout.are_you_sure_admit'); ?>');">{{ __('layout.continue_ward_admission') }}</button>
|
||||
{{ Form::close() }}
|
||||
<button type="button" class="btn btn-danger btn-sm"
|
||||
data-dismiss="modal">{{ __('layout.close') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-3 mb-4">
|
||||
<div class="white-box h-100 br-5 mb-0">
|
||||
|
||||
<div class="row">
|
||||
<a data-toggle="collapse" data-target="#collapseDiv" class="white-link">
|
||||
<b>{{ __('layout.patient_documents') }} </b><small
|
||||
style="color: blue;">({{ $documents ? count($documents) : '' }})</small>
|
||||
<span class="fa fa-angle-down">
|
||||
</span>
|
||||
</a>
|
||||
<a href="#" style="color: #003399" class="details pull-right">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div id="collapseDiv" class="">
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
@if (!is_null($documents))
|
||||
<ul>
|
||||
@foreach ($documents as $document)
|
||||
<li><a href="/patient_documents/{{ $document->id }}"
|
||||
target="_blank">{{ $document->title }}</a></li>
|
||||
@endforeach
|
||||
<li>
|
||||
<div class="label label-danger">
|
||||
{{ count($documents) }} {{ __('layout.documents_attached') }}
|
||||
</div>
|
||||
</li>
|
||||
<small>
|
||||
<a href="#" onclick="go()"
|
||||
style="font: blue; cursor: pointer; font-weight: bold;">
|
||||
{{ __('layout.view_all') }} </a>
|
||||
</small>
|
||||
<ul>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<!-- <a class="btn btn-warning btn-sm" href="">Add New</a> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- patient appointments not attached to any episode -->
|
||||
@php
|
||||
$un_fullfilled_appointments = un_fullfilled_patient_appointments($patient->id);
|
||||
@endphp
|
||||
|
||||
@if (count($un_fullfilled_appointments) > 0)
|
||||
<div class="col-sm-12">
|
||||
<div class="white-box" style="padding: 10px;">
|
||||
<strong>{{ __('layout.patient_appointments') }}</strong>
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table warning-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('layout.appointment_date') }}</th>
|
||||
<th>{{ __('layout.appointment_time') }}</th>
|
||||
<th>{{ __('layout.episode_started_on') }}</th>
|
||||
<th>{{ __('layout.clinic') }}</th>
|
||||
<th>{{ __('layout.in_charge') }}</th>
|
||||
<th>{{ __('layout.comments') }}</th>
|
||||
<th style="width: 5%"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($un_fullfilled_appointments as $appointment)
|
||||
<tr>
|
||||
<td>
|
||||
{{ is_null($appointment->appointment_date) ? '' : streamline_date($appointment->appointment_date) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $appointment->appointment_time }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $appointment->episode_id == 0 ? '' : streamline_date_time(get_name($appointment->episode_id, 'id', 'created_at', 'patient_episodes')) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ get_name($appointment->clinic_allocation, 'id', 'name', 'clinics') }}
|
||||
</td>
|
||||
<td>
|
||||
{{ get_full_name($appointment->incharge_id, 'id', 'first_name', 'last_name', 'users') != 'ALL STAFF' ? get_full_name($appointment->incharge_id, 'id', 'first_name', 'last_name', 'users') : 'N/A' }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $appointment->comments }}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<a class="btn btn-success btn-rounded btn-xs"
|
||||
onclick="displayAppointmentActions({{ $appointment->patient_id }},{{ $appointment->id }})">{{ __('layout.appointment_actions') }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
|
||||
@php $dob = new Carbon\Carbon($patient->date_of_birth); @endphp
|
||||
<div class="modal fade" id="demographicsModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
|
||||
aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="exampleModalLabel1">{{ __('layout.patient_details') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="highlight">{{ __('layout.patient_number') }}</th>
|
||||
<td>{{ $patient->number }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="highlight">{{ __('layout.patient_names') }}</th>
|
||||
<td>{{ $patient->first_name }} {{ $patient->last_name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="highlight">{{ __('layout.gender') }}</th>
|
||||
<td>{{ $patient->gender == 1 ? __('layout.male') : __('layout.female') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="highlight">{{ __('layout.date_of_birth') }}</th>
|
||||
<td>{{ streamline_date($patient->date_of_birth) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="highlight">{{ __('layout.age') }}</th>
|
||||
<td>{{ $dob->diffInYears(Carbon\Carbon::now()) }} {{ __('layout.years') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="highlight">{{ __('layout.residence') }}</th>
|
||||
<td>
|
||||
{{ patient_residence($patient->id) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="highlight">{{ __('layout.marital_status') }}</th>
|
||||
<td>
|
||||
{{ isset($marital_statuses[$patient->marital_status]) ? $marital_statuses[$patient->marital_status] : 'N/A' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@if (isset($other_patients_info_data->non_ugandan_national_id_no))
|
||||
|
||||
<tr>
|
||||
<th class="highlight"> ID Number</th>
|
||||
<td>{{ $other_patients_info_data->non_ugandan_national_id_no ?? '' }}</td>
|
||||
</tr>
|
||||
|
||||
@else
|
||||
<tr>
|
||||
<th class="highlight">National ID</th>
|
||||
<td>{{ $patient->national_id ?? '' }}</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
@if (mother_of_patient($patient->id))
|
||||
@php
|
||||
$mother_id = mother_of_patient($patient->id);
|
||||
@endphp
|
||||
<tr>
|
||||
<th class="highlight">
|
||||
<font color="black">{{ __('patients.mother_name') }}:</font>
|
||||
</th>
|
||||
<td>
|
||||
<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 class="highlight">
|
||||
<font color="black">{{ __('patients.children') }}:</font>
|
||||
</th>
|
||||
<td>
|
||||
<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
|
||||
|
||||
<tr>
|
||||
<th class="highlight">{{ __('layout.next_of_kin') }}</th>
|
||||
<td>{{ $patient->next_of_kin }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="highlight">{{ __('layout.relationship') }}</th>
|
||||
<td>
|
||||
{{ isset($relationships[$patient->next_of_kin_relationship]) ? $relationships[$patient->next_of_kin_relationship] : 'N/A' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="highlight">{{ __('layout.mobile_number') }}</th>
|
||||
<td>{{ $patient->phone }}</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<th class="highlight">{{ __('layout.phone_name') }}</th>
|
||||
<td>{{ $patient->phone_owner }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="highlight">{{ __('layout.insurance_status') }}</th>
|
||||
<td>
|
||||
@if ($patient->insurance_status == 1)
|
||||
{{ __('layout.insured') }}
|
||||
@else
|
||||
{{ __('layout.not_insured') }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="highlight">{{ __('layout.occupation') }}</th>
|
||||
<td>
|
||||
{{ isset($occupations[$patient->occupation_id]) ? $occupations[$patient->occupation_id] : 'N/A' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="highlight">{{ __('layout.patient_category') }}</th>
|
||||
<td>
|
||||
{{ isset($patient_categories[$patient->category_id]) ? $patient_categories[$patient->category_id] : 'N/A' }}
|
||||
</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 class="highlight">{{ get_name($keys[2], 'id', 'name', 'patient_registration_fields') }}</th>
|
||||
<td>{{ $registration_field }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
<tr>
|
||||
<th class="highlight">Referred From</th>
|
||||
<td>{{ $patient->referred_from }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="highlight">{{ __('layout.registered_by') }}</th>
|
||||
<td>{{ get_full_name($patient->created_by, 'id', 'first_name', 'last_name', 'users') }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="highlight">{{ __('layout.registered_on') }}</th>
|
||||
<td>
|
||||
{{ streamline_date($patient->created_at) }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<th class="highlight">Country</th>
|
||||
<td>{{ $country->name ?? '' }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th class="highlight">Foreigner / Refugee</th>
|
||||
<td>
|
||||
|
||||
@if(!empty($other_patients_info_data))
|
||||
@if ($other_patients_info_data->non_ugandan_foreigner_or_refugee == 1)
|
||||
<span>{{ __('patients.foreigner') }} </span>
|
||||
@elseif ($other_patients_info_data->non_ugandan_foreigner_or_refugee == 2)
|
||||
<span>{{ __('patients.refugee') }} </span>
|
||||
@else
|
||||
<span></span>
|
||||
@endif
|
||||
@else
|
||||
<span></span>
|
||||
@endif
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default"
|
||||
data-dismiss="modal">{{ __('layout.close') }}</button>
|
||||
<button type="button" class="btn btn-primary" id="edit_patient"
|
||||
onclick="window.location.href='/patients/{{ $patient->id }}/edit'">{{ __('layout.edit_patient') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- modal that pops up when a new episode is clicked -->
|
||||
@if (Auth::user()->can('create-patient-episode'))
|
||||
<div class="modal fade" id="episodeModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-9" style="margin-top: 5px;">{{ __('layout.begin_episode_for_patient') }}
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
{{ Form::open(['route' => 'patient_episodes.create_episode', 'onsubmit' => 'createNewEpisode.disabled = true; return true;']) }}
|
||||
{{ Form::hidden('patient_id', $patient->id) }}
|
||||
<button type="submit" class="btn btn-success btn-sm"
|
||||
name="createNewEpisode">{{ __('layout.yes') }}</button>
|
||||
<button type="button" class="btn btn-default"
|
||||
data-dismiss="modal">{{ __('layout.cancel') }}</button>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- 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">{{ __('layout.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()">{{ __('layout.start_appointment') }}</a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a class="btn btn-warning btn-rounded"
|
||||
onclick="reschedule_appointment()">{{ __('layout.reschedule_appointment') }}</a>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a class="btn btn-danger btn-rounded"
|
||||
onclick="cancel_appointment()">{{ __('layout.cancel_appointment') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" id="modal_patient_already_admitted" 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">{{ __('layout.patient_alert') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<h5>{{ __('layout.pat_still_admitted_discharge') }}</h5>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<a class="btn btn-info btn-rounded" data-dismiss="modal">{{ __('layout.cancel') }}</a>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<a class="btn btn-info btn-rounded pull-right"
|
||||
id="discharge_patient_button">{{ __('layout.discharge_pat_continue') }}</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', $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>
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$("#new_episode_options").change(function() {
|
||||
var clicked_episode_option = $(this).val();
|
||||
if (clicked_episode_option == 1) {
|
||||
$("#episodeModal").modal("show");
|
||||
} else if (clicked_episode_option == 2) {
|
||||
$("#newEpisodeAndClinicModal").modal("show");
|
||||
} else if (clicked_episode_option == 3) {
|
||||
$("#episodeWithDoctorModal").modal("show");
|
||||
} else if (clicked_episode_option == 4) {
|
||||
$("#episodeWithDoctorAndClinicModal").modal("show");
|
||||
} else if (clicked_episode_option == 5) {
|
||||
$.ajax({
|
||||
url: '/inpatient/check_for_open_admissions/' + $('#patient_id').val(),
|
||||
type: 'get',
|
||||
success: function(response) {
|
||||
if (response > 0) {
|
||||
$("#modal_patient_already_admitted").modal("show");
|
||||
} else {
|
||||
$("#wardAdmissionModal").modal("show");
|
||||
}
|
||||
},
|
||||
error: function(response) {}
|
||||
});
|
||||
} else if (clicked_episode_option == 6) {
|
||||
$("#episodeWithSelfLabRequestModal").modal("show");
|
||||
}
|
||||
});
|
||||
|
||||
$("#discharge_patient_button").click(function() {
|
||||
$.ajax({
|
||||
url: '/inpatient/discharge_patient_past_admissions/' + $('#patient_id').val(),
|
||||
type: 'get',
|
||||
success: function(response) {
|
||||
$("#modal_patient_already_admitted").modal("hide");
|
||||
$("#wardAdmissionModal").modal("show");
|
||||
},
|
||||
error: function(response) {}
|
||||
});
|
||||
});
|
||||
|
||||
$("#maternityAdmissionBtn").click(function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
url: '/inpatient/check_for_open_admissions/' + $('#patient_id').val(),
|
||||
type: 'get',
|
||||
success: function(response) {
|
||||
if (response > 0) {
|
||||
$("#modal_patient_already_admitted").modal("show");
|
||||
} else {
|
||||
$("#maternityModal").modal("show");
|
||||
}
|
||||
},
|
||||
error: function(response) {}
|
||||
});
|
||||
});
|
||||
|
||||
$('.doctorDropDown').select2({
|
||||
placeholder: "Select",
|
||||
width: "100%",
|
||||
dropdownParent: $('#episodeWithDoctorModal')
|
||||
});
|
||||
|
||||
$('.doctorWithClinicDoctorDropDown').select2({
|
||||
placeholder: "Select",
|
||||
width: "100%",
|
||||
dropdownParent: $('#episodeWithDoctorAndClinicModal')
|
||||
});
|
||||
|
||||
$('#startAppWithClinicBtn').click(function(e) {
|
||||
$('#modal_select_actions').modal('hide');
|
||||
$('#selected_appointment_id').val(appointmentId);
|
||||
$('#startAppointmentWithClinicModal').modal('show');
|
||||
});
|
||||
|
||||
$('.appWithClinicDoctorDropDown').select2({
|
||||
placeholder: "Select",
|
||||
width: "100%",
|
||||
dropdownParent: $('#startAppointmentWithClinicModal')
|
||||
});
|
||||
|
||||
function popitup(url) {
|
||||
newwindow = window.open(url, 'name', 'height=700,width=850, top=50, left=300');
|
||||
if (window.focus) {
|
||||
newwindow.focus();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function go(url) {
|
||||
event.preventDefault();
|
||||
let options = document.getElementsByName('episode_id');
|
||||
let episodeId = 0;
|
||||
if (options) {
|
||||
for (let i = 0; i < options.length; i++) {
|
||||
if (options[i].checked) {
|
||||
episodeId = options[i].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: 'set_episode_id/' + episodeId + '/patient_documents',
|
||||
type: 'get',
|
||||
success: function(response) {
|
||||
window.location.href = '/patient_documents';
|
||||
},
|
||||
error: function(response) {}
|
||||
});
|
||||
}
|
||||
|
||||
/* stuff for patient appointments */
|
||||
let selectedPatientId = 0;
|
||||
let appointmentId = 0;
|
||||
|
||||
function reschedule_appointment() {
|
||||
if (confirm("<?php echo __('layout.reschedule_appointment_question'); ?>")) {
|
||||
window.location.href = "/patients/reschedule_appointment/" + appointmentId;
|
||||
}
|
||||
}
|
||||
|
||||
function cancel_appointment() {
|
||||
if (confirm("<?php echo __('layout.cancel_appointment_cancel'); ?>")) {
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: '/patients/cancel_patient_appointment/' + appointmentId,
|
||||
success: function(response) {
|
||||
if (response == 1) {
|
||||
alert("<?php echo __('layout.appointment_cancelled'); ?>");
|
||||
$("#modal_select_actions").modal("hide");
|
||||
fetch_patients();
|
||||
} else {
|
||||
alert("<?php echo __('layout.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;
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$('#new_episode_options, #admission_ward_id').select2({width: "100%"});
|
||||
</script>
|
||||
@endpush
|
||||
Executable
+849
@@ -0,0 +1,849 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
|
||||
<style type="text/css">
|
||||
.color-tr {
|
||||
background: #FFFF99;
|
||||
}
|
||||
</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">{{ __('patient_flow_monitoring.select_clinic') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('patient_flow_monitoring.dashboard') }}</a></li>
|
||||
<li class="active">{{ __('patient_flow_monitoring.select_clinic') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
@include ('errors.list')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="white-box">
|
||||
{{ Form::open(['route' => 'patient_flow_monitoring.index', 'method' => 'ANY']) }}
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
{{ Form::label('clinic_id', __('patient_flow_monitoring.clinics')) }}
|
||||
{{ Form::select('clinic_id', $clinics, '', ['class' => 'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group" id="searchby">
|
||||
{{ Form::label('search_by', __('patient_flow_monitoring.date')) }}
|
||||
{{ Form::select('search_by', ['4'=>'Today', '3'=>'Yesterday','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', __('patient_flow_monitoring.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', __('patient_flow_monitoring.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-2">
|
||||
<div class="form-group" id="searchby">
|
||||
{{ Form::label('order_by', __('patient_flow_monitoring.order_by')) }}
|
||||
{{ Form::select('order_by', ['0'=>'Triage Grade', '1'=>'Time of Arrival'], 0, ['class' => 'form-control','required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-1">
|
||||
<div class="form-group" style="padding-top: 5px;"><br>
|
||||
{{ Form::button(__('patient_flow_monitoring.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_patient']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$counter = 0;
|
||||
$patients_array = [];
|
||||
$new_patients = 0;
|
||||
$returning_patients = 0;
|
||||
$can_user_view_diagnosis = Auth::user()->can('view-patient-episode-primary-diagnoses');
|
||||
@endphp
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="white-box">
|
||||
<h3><label class="label label-info">{{ __('patient_flow_monitoring.clinics') }}: {{ $clinic_name }} - {{ __('patient_flow_monitoring.date') }}: {{ $date_search }}</label></h3>
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 3%">#</th>
|
||||
<th>{{ __('patient_flow_monitoring.time') }}</th>
|
||||
<th>{{ __('patient_flow_monitoring.patient_number') }}</th>
|
||||
<th>{{ __('patient_flow_monitoring.name') }}</th>
|
||||
<th>{{ __('patient_flow_monitoring.gender') }}</th>
|
||||
<th>{{ __('patient_flow_monitoring.age') }}</th>
|
||||
<th>{{ __('patient_flow_monitoring.triage') }}</th>
|
||||
<th>{{ __('patient_flow_monitoring.clinic_allocation') }}</th>
|
||||
<th>{{ __('patient_flow_monitoring.diagnosis') }}</th>
|
||||
<th>{{ __('patient_flow_monitoring.investigations') }}</th>
|
||||
<th>{{ __('patient_flow_monitoring.consultation') }}</th>
|
||||
<th>{{ __('patient_flow_monitoring.treatment') }}</th>
|
||||
<th>{{ __('patient_flow_monitoring.outcome') }}</th>
|
||||
<th>{{ __('patient_flow_monitoring.select') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (isset($patient_episodes))
|
||||
@foreach($patient_episodes as $episode)
|
||||
@php
|
||||
$counter++;
|
||||
|
||||
$patient = \Illuminate\Support\Facades\DB::table('patients')->where('id', $episode->patient_id)->first();
|
||||
$investigation_results = \Illuminate\Support\Facades\DB::table('investigation_results')->where('episode_id', $episode->id)->first();
|
||||
$investigation_orders = \Illuminate\Support\Facades\DB::table('ordered_investigations')->where('episode_id', $episode->id)->first();
|
||||
$treatment_details = \Illuminate\Support\Facades\DB::table('treatments')->where('episode_id', $episode->id)->orderBy('created_at', 'desc')->first();
|
||||
$main_exam = \Illuminate\Support\Facades\DB::table('eye_clinic_main_exam')->where('episode_id', $episode->id)->first();
|
||||
$is_patient_in_eye_clinic = is_patient_in_eye_clinic($episode->id);
|
||||
@endphp
|
||||
<input type="hidden" name="patient_id_{{ $episode->id }}" id="patient_id_{{ $episode->id }}" value="{{ $episode->patient_id }}">
|
||||
@if($episode->paid_over == "pos")
|
||||
<tr id="row{{ $episode->id }}">
|
||||
<td>{{ $counter }}</td>
|
||||
<td>
|
||||
{{ streamline_date_time($episode->created_at) }}
|
||||
</td>
|
||||
<td>
|
||||
@if(is_object($patient))
|
||||
{{ $patient->number }} <i style="font-size: smaller;">({{ $patient_categories[$patient->category_id] ?? "" }})</i>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{!! is_object($patient) ? insurance_flag($patient->id) : "" !!}
|
||||
</td>
|
||||
<td> <label class="label label-success">{{ __('patient_flow_monitoring.point_of_sale') }} </label></td>
|
||||
<td> <label class="label label-success">{{ __('patient_flow_monitoring.point_of_sale') }} </label></td>
|
||||
<td> <label class="label label-success">{{ __('patient_flow_monitoring.point_of_sale') }} </label></td>
|
||||
<td> <label class="label label-success">{{ __('patient_flow_monitoring.point_of_sale') }} </label></td>
|
||||
<td> <label class="label label-success"> - </label></td>
|
||||
<td> <label class="label label-success"> - </label></td>
|
||||
<td> <label class="label label-success"> - </label></td>
|
||||
<td> <label class="label label-success"> - </label></td>
|
||||
<td> <label class="label label-success"> - </label></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@elseif($episode->episode_type == 1)
|
||||
<tr id="row{{ $episode->id }}">
|
||||
<td>{{ $counter }}</td>
|
||||
<td>
|
||||
{{ streamline_date_time($episode->created_at) }}
|
||||
</td>
|
||||
<td>
|
||||
@if(is_object($patient))
|
||||
{{ $patient->number }} <i style="font-size: smaller;">({{ isset($patient_categories[$patient->category_id]) ? $patient_categories[$patient->category_id] : "" }})</i>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{!! is_object($patient) ? insurance_flag($patient->id) : "" !!}
|
||||
</td>
|
||||
<td>
|
||||
@if(is_object($patient))
|
||||
{{ $patient->gender == 1 ? "Male" : "Female" }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if(is_object($patient))
|
||||
{{ get_patients_age($patient->date_of_birth) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<span class="label label-info">{{ __('patient_flow_monitoring.lab_self_request') }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="label label_info">{{ __('patient_flow_monitoring.lab_self_request') }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="label label-info">{{ __('patient_flow_monitoring.lab_self_request') }}</span>
|
||||
</td>
|
||||
<td>
|
||||
@if(isset($investigation_results))
|
||||
@php $per_inv_explode = explode(",", $investigation_results->per_investigation); @endphp
|
||||
|
||||
@if ($investigation_results->all_authenticated == 1)
|
||||
<span style = "color: #009900; font-weight: bold;">{{ __('patient_flow_monitoring.all_results_available') }}</span>
|
||||
@elseif (in_array("1", $per_inv_explode) && in_array("0", $per_inv_explode))
|
||||
<span style = "color: #33CC33; font-weight: bold;">{{ __('patient_flow_monitoring.some_results_available') }}<span>
|
||||
@elseif (array_unique($per_inv_explode) == array("0"))
|
||||
<span style = "color: #99CC00; font-weight: bold;">{{ __('patient_flow_monitoring.ordered') }}</span>
|
||||
@endif
|
||||
@elseif(isset($investigation_orders))
|
||||
<span style="color: #99CC00">{{ __('patient_flow_monitoring.ordered') }}</span>
|
||||
@else
|
||||
N/A
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<span class="label label-info">{{ __('patient_flow_monitoring.lab_self_request') }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="label label-info">{{ __('patient_flow_monitoring.lab_self_request') }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="label label-info">{{ __('patient_flow_monitoring.lab_self_request') }}</span>
|
||||
</td>
|
||||
<td>
|
||||
@if(is_object($patient) && is_null($patient->deleted_at))
|
||||
<input type="radio" onchange="show({{ $episode->id }}), manage_eye_menus('{{ $is_patient_in_eye_clinic }}')" class="radio-option centered" name="episode_id" value="{{ $episode->id }}" />
|
||||
@else
|
||||
<b style="color: red">Patient was deleted</b>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@else
|
||||
<tr id="row{{ $episode->id }}">
|
||||
<td>{{ $counter }}</td>
|
||||
<td>
|
||||
{{ streamline_date_time($episode->created_at) }}
|
||||
</td>
|
||||
<td>
|
||||
@if(is_object($patient))
|
||||
{{ $patient->number }} <i style="font-size: smaller;">({{ $patient_categories[$patient->category_id] ?? "" }})</i>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{!! is_object($patient) ? insurance_flag($patient->id) : "" !!}
|
||||
</td>
|
||||
<td>
|
||||
@if(is_object($patient))
|
||||
{{ $patient->gender == 1 ? "Male" : "Female" }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if(is_object($patient))
|
||||
{{ get_patients_age($patient->date_of_birth) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($is_patient_in_eye_clinic)
|
||||
@php $base_refraction = \Illuminate\Support\Facades\DB::table('eye_clinic_base_exam_refraction')->where('episode_id', $episode->id)->first() @endphp
|
||||
|
||||
@if($base_refraction)
|
||||
Base Exam Completed By {{ get_full_name($base_refraction->created_by, 'id', 'first_name', 'last_name', 'users') }}
|
||||
@else
|
||||
<span style="background-color: #FFFF00; color: black" class="label">Pending Base Exam</span>
|
||||
@endif
|
||||
|
||||
<hr>
|
||||
|
||||
@if (is_null($episode->consultation_id))
|
||||
<span style="background-color: red" class="label">Pending Main Exam</span>
|
||||
@elseif (!is_null($episode->consultation_id) && get_name($episode->consultation_id, 'id', 'completed', 'eye_clinic_main_exam') == 0)
|
||||
<span style="background-color: #FFFF00; color: black" class="label">Ongoing Main Exam</span>
|
||||
@else
|
||||
Main Exam Outcome: {{ $main_exam ? get_name($main_exam->outcome_id, 'id', 'name', 'outcomes') : "N/A" }}
|
||||
@endif
|
||||
@else
|
||||
@if (!$episode->episode_triage_id)
|
||||
N/A
|
||||
@else
|
||||
{!! severe_grade($episode->severe_grade) !!}
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$episode_clinic_name = get_name($episode->clinic_id, 'id', 'name', 'clinics');
|
||||
|
||||
$episode_transfer = \Streamline\Models\PatientClinicTransfers::where('episode_id', $episode->id)->orderBy('id', 'desc')->first();
|
||||
@endphp
|
||||
|
||||
@if ($episode_transfer)
|
||||
<span style="color: #1b81b5">{{ __('patient_flow_monitoring.transferred_from') }} <b>{{ get_name($episode_transfer->old_clinic, 'id', 'name', 'clinics') }}</b> {{ __('patient_flow_monitoring.to') }} <b>{{ get_name($episode_transfer->new_clinic, 'id', 'name', 'clinics') }}</b></span>
|
||||
@else
|
||||
@if($episode_clinic_name != "N/A")
|
||||
{{ $episode_clinic_name }}
|
||||
@elseif (!$episode->episode_triage_id)
|
||||
<span style="background-color: #FFFF00; color: black" class="label">{{ __('patient_flow_monitoring.pending_triage') }}</span>
|
||||
@else
|
||||
{{ get_name($episode->clinic_allocation, 'id', 'name', 'clinics') }}
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($is_patient_in_eye_clinic)
|
||||
@php
|
||||
$right_eye_diagnoses = explode(',',get_name($episode->consultation_id, 'id', 'right_eye_diagnosis', 'eye_clinic_main_exam'));
|
||||
$left_eye_diagnoses = explode(',',get_name($episode->consultation_id, 'id', 'left_eye_diagnosis', 'eye_clinic_main_exam'));
|
||||
@endphp
|
||||
|
||||
@if(count($right_eye_diagnoses) > 0)
|
||||
<h5>Right Eye Diagnosis</h5>
|
||||
<ul>
|
||||
@for($x = 0; $x < count($right_eye_diagnoses); $x++)
|
||||
<li>{{ get_name(get_name($right_eye_diagnoses[$x], 'id', 'diagnosis_category', 'diagnoses'), 'id', 'name', 'diagnosis_categories') }} - {{ $diagnoses[$right_eye_diagnoses[$x]] ?? '' }}</li>
|
||||
@endfor
|
||||
</ul>
|
||||
|
||||
@endif
|
||||
|
||||
@if(count($left_eye_diagnoses) > 0)
|
||||
<h5>Left Eye Diagnosis</h5>
|
||||
<ul>
|
||||
@for($x = 0; $x < count($left_eye_diagnoses); $x++)
|
||||
<li>{{ get_name(get_name($left_eye_diagnoses[$x], 'id', 'diagnosis_category', 'diagnoses'), 'id', 'name', 'diagnosis_categories') }} - {{ $diagnoses[$left_eye_diagnoses[$x]] ?? '' }}</li>
|
||||
@endfor
|
||||
</ul>
|
||||
@endif
|
||||
@else
|
||||
@php
|
||||
$primary_diagnosis_id = empty($episode->consultation_id)? $episode->antenatal_primary_diagnosis :get_name($episode->consultation_id, 'id', 'primary_diagnosis', 'consultations');
|
||||
@endphp
|
||||
@if($can_user_view_diagnosis)
|
||||
{{ get_name($primary_diagnosis_id, "id", "name", "diagnoses") }}
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if(isset($investigation_results))
|
||||
@php $per_inv_explode = explode(",", $investigation_results->per_investigation); @endphp
|
||||
|
||||
@if ($investigation_results->all_authenticated == 1)
|
||||
<span style = "color: #009900; font-weight: bold;">{{ __('patient_flow_monitoring.all_results_available') }}</span>
|
||||
@elseif (in_array("1", $per_inv_explode) && in_array("0", $per_inv_explode))
|
||||
<span style = "color: #33CC33; font-weight: bold;">{{ __('patient_flow_monitoring.some_results_available') }}<span>
|
||||
@elseif (array_unique($per_inv_explode) == array("0"))
|
||||
<span style = "color: #99CC00; font-weight: bold;">{{ __('patient_flow_monitoring.ordered') }}</span>
|
||||
@endif
|
||||
@elseif(isset($investigation_orders))
|
||||
<span style="color: #99CC00">{{ __('patient_flow_monitoring.ordered') }}</span>
|
||||
@else
|
||||
N/A
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@php $outcome = "N/A"; @endphp
|
||||
@if($episode->consultation_id || $episode->antenatal_outcome_id)
|
||||
@if($main_exam)
|
||||
{{ get_full_name($main_exam->created_by, 'id', 'first_name', 'last_name', 'users') }}
|
||||
@elseif(!is_null($episode->consultation_done_by) && empty($episode->antenatal_outcome_id))
|
||||
{{ get_full_name($episode->consultation_done_by, "id", "first_name", "last_name","users") }}
|
||||
@else
|
||||
@php
|
||||
$outcome_id = !empty($episode->antenatal_outcome_id)? $episode->antenatal_outcome_id:$episode->outcome_id;
|
||||
$created_by = !empty($episode->consultation_created_by)? $episode->consultation_created_by:$episode->antenatal_created_by;
|
||||
$updated_by = !empty($episode->consultation_updated_by)? $episode->consultation_updated_by:$episode->antenatal_updated_by;
|
||||
$outcome = get_name($outcome_id, 'id', 'name', 'outcomes'); @endphp
|
||||
@if(is_null($updated_by))
|
||||
{{ get_full_name($created_by, "id", "first_name", "last_name","users") }}
|
||||
@else
|
||||
{{ get_full_name($updated_by, "id", "first_name", "last_name", "users") }}
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if(is_null($treatment_details))
|
||||
<span>N/A</span>
|
||||
@elseif($treatment_details->dispense_status == 1)
|
||||
<span style="color: #009900; font-weight: bold;">{{ __('patient_flow_monitoring.dispensed') }}</span>
|
||||
@else
|
||||
<span style="background-color: #FFFF00; color: black" class="label">
|
||||
{{ __('patient_flow_monitoring.orderd_but_not_dispensed') }}
|
||||
</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{-- @if (get_name($episode->id, 'episode_id', 'id', 'ante_natal_clinic_registrations') != "N/A")
|
||||
<span style="background-color: #FFFF00; color: black" class="label">Ongoing Consultation (ANC)</span> --}}
|
||||
@if (is_null($episode->consultation_id) && empty($episode->antenatal_primary_diagnosis))
|
||||
<span style="background-color: red" class="label">{{ __('patient_flow_monitoring.pending_consultation') }}</span>
|
||||
@elseif($episode->consultation_id && empty($episode->antenatal_primary_diagnosis))
|
||||
@if(!is_null($episode->consultation_done_by) && is_null($episode->primary_diagnosis))
|
||||
<span style="background-color: red" class="label">{{ __('patient_flow_monitoring.pending_consultation') }}</span>
|
||||
@elseif($episode->completed == 0)
|
||||
@if($main_exam)
|
||||
{{ get_name($main_exam->outcome_id, 'id', 'name', 'outcomes') }}
|
||||
@else
|
||||
<span style="background-color: #FFFF00; color: black" class="label">{{ __('patient_flow_monitoring.ongoing_consultation') }}</span>
|
||||
@endif
|
||||
@else
|
||||
{{ get_name($episode->outcome_id, 'id', 'name', 'outcomes') }}
|
||||
@endif
|
||||
@elseif (!is_null($episode->consultation_id) && get_name($episode->consultation_id, 'id', 'completed', 'consultations') == 0 && empty($episode->antenatal_primary_diagnosis))
|
||||
<span style="background-color: #FFFF00; color: black" class="label">{{ __('patient_flow_monitoring.ongoing_consultation') }}</span>
|
||||
@else
|
||||
{{ $outcome }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if(is_object($patient) && is_null($patient->deleted_at))
|
||||
<input type="radio" onchange="show({{ $episode->id }}), manage_eye_menus('{{ $is_patient_in_eye_clinic }}')" class="radio-option centered" name="episode_id" value="{{ $episode->id }}" />
|
||||
@else
|
||||
<b style="color: red">Patient was deleted</b>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
<tr>
|
||||
<td colspan="14" id="menu_div">
|
||||
<div class="white-box" id="menu1" style="display: none;">
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<button type="submit" name="base_refraction_exam" class="btn btn-success btn-sm col-sm-12 eye_button" value="base_refraction_exam" id="base_refraction_exam">Base Refraction Exam</button>
|
||||
|
||||
@if(Auth::user()->can('perform-triage') && !is_add_attendance_to_consultation_enabled())
|
||||
<button type="submit" name="triage" class="btn btn-success btn-sm col-sm-12 normal_button" value="triage" id="triage">{{ __('patient_flow_monitoring.triage') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2">
|
||||
<button type="submit" name="main_exam" class="btn btn-success btn-sm col-sm-12 eye_button" value="main_exam" id="main_exam">Main Exam</button>
|
||||
|
||||
@if(Auth::user()->can('create-consultation'))
|
||||
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12 normal_button" value="consultation" id="consultation" onclick="paymentCheck(this.value)">{{ __('patient_flow_monitoring.consultation') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
@if(Auth::user()->can('create-theatre-surgery') || Auth::user()->can('create-theatre-anaesthesia'))
|
||||
<div class="btn-group dropup m-r-10 col-sm-12">
|
||||
<button aria-expanded="false" data-toggle="dropdown" class="btn btn-info dropdown-toggle waves-effect waves-light col-sm-12" type="button">{{ __('patient_flow_monitoring.theatre') }} <span class="caret"></span></button>
|
||||
<ul role="menu" class="dropdown-menu">
|
||||
<li><button type="submit" name="submit" value="create_anaesthetics" class="btn btn-default btn-sm btn-link" id="create_anaesthetics">{{ __('patient_flow_monitoring.theatre_anaesthetics') }}</button></li>
|
||||
<li><button type="submit" name="submit" value="anaesthetics_history" class="btn btn-default btn-sm btn-link" id="anaesthetics_history">{{ __('patient_flow_monitoring.historical_anaesthetics') }}</button></li>
|
||||
<li><button type="submit" name="submit" value="create_surgery" class="btn btn-default btn-sm btn-link" id="create_surgery">{{ __('patient_flow_monitoring.theatre_surgery') }}</button></li>
|
||||
<li><button type="submit" name="submit" value="surgery_index" class="btn btn-default btn-sm btn-link" id="surgery_index">{{ __('patient_flow_monitoring.historical_surgeries') }}</button></li>
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@if(Auth::user()->can('patient-flow-monitoring-inpatient-admission'))
|
||||
<div class="col-sm-2">
|
||||
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12" value="inpatient_admission" id="inpatient_admission2">{{ __('patient_flow_monitoring.admit_patient') }}</button>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="col-sm-2"> {{-- middle menu --}}
|
||||
<button type="button" class="btn btn-primary btn-sm btn-block" id="internal_transfer_middle">{{ __('patient_episode.clinic_transfer') }}</button>
|
||||
</div>
|
||||
|
||||
@if ($clinic_name == "FAMILY PLANNING")
|
||||
<div class="col-sm-2">
|
||||
<button type="submit" name="fp_button" class="btn btn-success btn-sm col-sm-12" value="fp_button" id="fp_button">{{ __('patient_flow_monitoring.family_planning') }}</button>
|
||||
</div>
|
||||
@endif
|
||||
@if ($clinic_name == "ANTE-NATAL")
|
||||
<div class="col-sm-2">
|
||||
<button type="submit" name="anc_registration_button" class="btn btn-success btn-sm col-sm-12" value="anc_registration_button" id="anc_registration_button">{{ __('patient_flow_monitoring.anc_registration') }}</button>
|
||||
</div>
|
||||
<div class="col-sm-1">
|
||||
<button type="submit" name="anc_followup_button" class="btn btn-success btn-sm col-sm-12" value="anc_followup_button" id="anc_followup_button">{{ __('patient_flow_monitoring.anc_follow_up') }}</button>
|
||||
</div>
|
||||
<div class="col-sm-1">
|
||||
<button type="submit" name="treatment" class="btn btn-success btn-sm col-sm-12" value="treatment" id="treatment">{{ __('patient_flow_monitoring.treatment') }}</button>
|
||||
</div>
|
||||
<div class="col-sm-1">
|
||||
<button type="submit" name="investigation" class="btn btn-success btn-sm col-sm-12" value="investigation" id="investigation">{{ __('patient_flow_monitoring.investigations') }}</button>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
@if(Auth::user()->can('perform-triage-without-etat'))
|
||||
<button type="submit" name="triage_without_etat" id="triage_without_etat" class="btn btn-success btn-sm col-sm-12" value="triage_without_etat">{{ __('patient_episode.triage_without') }} ETAT</button>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
@if(Auth::user()->can('create-consultation-with-notes'))
|
||||
<button type="submit" name="consultation_with_notes" id="consultation_with_notes" class="btn btn-success btn-sm col-sm-12" value="consultation_with_notes" onclick="paymentCheck(this.value)">{{ __('patient_episode.consultation_with_notes') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<button type="submit" name="view_patient_history" id="view_patient_history" class="btn btn-success btn-sm col-sm-12" value="view_patient_history">{{ __('patient_episode.view_history') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
{{ $patient_episodes->render() }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box" id="menu2" style="display: none;">
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<button type="submit" name="base_refraction_exam" class="btn btn-success btn-sm col-sm-12 eye_button" value="base_refraction_exam" id="base_refraction_exam">Base Refraction Exam</button>
|
||||
|
||||
@if(Auth::user()->can('perform-triage') && !is_add_attendance_to_consultation_enabled())
|
||||
<button type="submit" name="triage" class="btn btn-success btn-sm col-sm-12 normal_button" value="triage" id="triage">{{ __('patient_flow_monitoring.triage') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2">
|
||||
<button type="submit" name="main_exam" class="btn btn-success btn-sm col-sm-12 eye_button" value="main_exam" id="main_exam">Main Exam</button>
|
||||
|
||||
@if(Auth::user()->can('create-consultation'))
|
||||
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12 normal_button" value="consultation" id="consultation" onclick="paymentCheck(this.value)">{{ __('patient_flow_monitoring.consultation') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
@if(Auth::user()->can('create-theatre-surgery') || Auth::user()->can('create-theatre-anaesthesia'))
|
||||
<div class="btn-group dropup m-r-10 col-sm-12">
|
||||
<button aria-expanded="false" data-toggle="dropdown" class="btn btn-info dropdown-toggle waves-effect waves-light col-sm-12" type="button">{{ __('patient_flow_monitoring.theatre') }} <span class="caret"></span></button>
|
||||
<ul role="menu" class="dropdown-menu">
|
||||
<li><button type="submit" name="submit" value="create_anaesthetics" class="btn btn-default btn-sm btn-link" id="create_anaesthetics">{{ __('patient_flow_monitoring.theatre_anaesthetics') }}</button></li>
|
||||
<li><button type="submit" name="submit" value="anaesthetics_history" class="btn btn-default btn-sm btn-link" id="anaesthetics_history">{{ __('patient_flow_monitoring.historical_anaesthetics') }}</button></li>
|
||||
<li><button type="submit" name="submit" value="create_surgery" class="btn btn-default btn-sm btn-link" id="create_surgery">{{ __('patient_flow_monitoring.theatre_surgery') }}</button></li>
|
||||
<li><button type="submit" name="submit" value="surgery_index" class="btn btn-default btn-sm btn-link" id="surgery_index">{{ __('patient_flow_monitoring.historical_surgeries') }}</button></li>
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@if(Auth::user()->can('patient-flow-monitoring-inpatient-admission'))
|
||||
<div class="col-sm-2">
|
||||
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12" value="inpatient_admission" id="inpatient_admission2">{{ __('patient_flow_monitoring.admit_patient') }}</button>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="col-sm-2"> {{-- bottom menu --}}
|
||||
<button type="button" class="btn btn-primary btn-sm btn-block" id="internal_transfer_bottom">{{ __('patient_episode.clinic_transfer') }}</button>
|
||||
</div>
|
||||
|
||||
@if ($clinic_name == "FAMILY PLANNING")
|
||||
<div class="col-sm-2">
|
||||
<button type="submit" name="fp_button" class="btn btn-success btn-sm col-sm-12" value="fp_button" id="fp_button">{{ __('patient_flow_monitoring.family_planning') }}</button>
|
||||
</div>
|
||||
@endif
|
||||
@if ($clinic_name == "ANTE-NATAL")
|
||||
<div class="col-sm-2">
|
||||
<button type="submit" name="anc_registration_button" class="btn btn-success btn-sm col-sm-12" value="anc_registration_button" id="anc_registration_button">{{ __('patient_flow_monitoring.anc_registration') }}</button>
|
||||
</div>
|
||||
<div class="col-sm-1">
|
||||
<button type="submit" name="anc_followup_button" class="btn btn-success btn-sm col-sm-12" value="anc_followup_button" id="anc_followup_button">{{ __('patient_flow_monitoring.anc_follow_up') }}</button>
|
||||
</div>
|
||||
<div class="col-sm-1">
|
||||
<button type="submit" name="treatment" class="btn btn-success btn-sm col-sm-12" value="treatment" id="treatment">{{ __('patient_flow_monitoring.treatment') }}</button>
|
||||
</div>
|
||||
<div class="col-sm-1">
|
||||
<button type="submit" name="investigation" class="btn btn-success btn-sm col-sm-12" value="investigation" id="investigation">{{ __('patient_flow_monitoring.investigations') }}</button>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
@if(Auth::user()->can('perform-triage-without-etat'))
|
||||
<button type="submit" name="triage_without_etat" id="triage_without_etat" class="btn btn-success btn-sm col-sm-12" value="triage_without_etat">{{ __('patient_episode.triage_without') }} ETAT</button>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
@if(Auth::user()->can('create-consultation-with-notes'))
|
||||
<button type="submit" name="consultation_with_notes" id="consultation_with_notes" class="btn btn-success btn-sm col-sm-12" value="consultation_with_notes" onclick="paymentCheck(this.value)">{{ __('patient_episode.consultation_with_notes') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<button type="submit" name="view_patient_history" id="view_patient_history" class="btn btn-success btn-sm col-sm-12" value="view_patient_history">{{ __('patient_episode.view_history') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="ward_admission_episode" 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">{{ __('layout.ward_admission') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{ Form::open(['route' => 'patient_flow_monitoring.inpatient_admission']) }}
|
||||
{{ Form::hidden('admission_episode_id', 0, ['id' => 'admission_episode_id']) }}
|
||||
|
||||
{{ Form::label('admission_ward_id', __('layout.select_ward')) }}
|
||||
{{ Form::select('admission_ward_id', $wards, '', ['class' => 'form-control', 'required' => 'true']) }}
|
||||
<br>
|
||||
{{ Form::label('ward_admission_date', __('layout.admission_date')) }}
|
||||
<input type="date" class="form-control" name="ward_admission_date" id="ward_admission_date" value="{{ date('Y-m-d') }}" required="true">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-success btn-sm" onclick="return confirm('<?php echo __('layout.are_you_sure_admit'); ?>');">{{ __('layout.continue_ward_admission') }}</button>
|
||||
{{ Form::close() }}
|
||||
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">{{ __('layout.close') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- clinic transfer modal --}}
|
||||
<div class="modal fade" id="internal_transfer_dialog" tabindex="-1" role="dialog" style="padding-top: 50px;">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">{{ __('patient_episode.internal_transfer') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
{{ Form::label('current_clinic', __('patient_episode.current_clinic')) }}
|
||||
{{ Form::hidden('current_clinic_id', 0, ['id' => 'current_clinic_id']) }}
|
||||
{{ Form::hidden('current_triage_id', 0, ['id' => 'current_triage_id']) }}
|
||||
{{ Form::hidden('current_episode_id', 0, ['id' => 'current_episode_id']) }}
|
||||
{{ Form::hidden('current_patient_id', 0, ['id' => 'current_patient_id']) }}
|
||||
{{ Form::text('current_clinic', '', ['class' => 'form-control compulsory', 'readonly', 'id' => 'current_clinic_transfer']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('transfer_to', __('patient_episode.transfer_to')) }}
|
||||
{{ Form::select('transfer_to', $clinics, null, ['class' => 'form-control compulsory', 'required', 'id' => 'transfer_to']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('patient_episode.close') }}</button>
|
||||
<button type="button" class="btn btn-success" id="submit_clinic_transfer" >{{ __('patient_episode.transfer_patient') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="unpaid_consultation_warning" 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>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h4 style="color: red">{{ __('patient_episode.patient_not_paid_consultation') }}</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('patient_episode.okay') }}</button>
|
||||
</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.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>
|
||||
let selected_row = 0;
|
||||
|
||||
function show(episodeId) {
|
||||
// remove previous coloring
|
||||
$('#row'+selected_row).removeClass('color-tr');
|
||||
selected_row = episodeId;
|
||||
|
||||
// add color to current selected
|
||||
$('#row'+episodeId).addClass('color-tr');
|
||||
|
||||
// bring up the buttons
|
||||
var row1 = $("#menu_div").closest("tr");
|
||||
var row2 = $('#row'+episodeId).closest("tr");
|
||||
row2.after(row1);
|
||||
$('#menu1').show();
|
||||
$('#menu2').show();
|
||||
}
|
||||
|
||||
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2,#ward_admission_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
$('#search_by').change(function () {
|
||||
if ($(this).val() == 1) {
|
||||
$('#date_search').show();
|
||||
$('#date_range_search').hide();
|
||||
}
|
||||
else if ($(this).val() == 2) {
|
||||
$('#date_range_search').show();
|
||||
$('#date_search').hide();
|
||||
}
|
||||
else {
|
||||
$('#date_search,#date_range_search').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('#triage,#create_anaesthetics,#anaesthetics_history,#create_surgery,#surgery_index,#treatment,#investigation,#anc_registration_button,' +
|
||||
'#anc_followup_button,#view_patient_history,#triage_without_etat,#main_exam,#base_refraction_exam').click(function() {
|
||||
event.preventDefault();
|
||||
let options = document.getElementsByName('episode_id');
|
||||
let episodeId = 0;
|
||||
|
||||
if (options) {
|
||||
for (let i = 0; i < options.length; i++) {
|
||||
if (options[i].checked){
|
||||
episodeId = options[i].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let clicked_btn = $(this).val();
|
||||
console.log("clicked and ready to submit to the flow monitoring route");
|
||||
|
||||
$.ajax({
|
||||
url: '/patient_flow_monitoring/patient_route/'+episodeId+'/'+clicked_btn,
|
||||
type: 'get',
|
||||
success: function(response){
|
||||
window.location.href = response;
|
||||
},
|
||||
error: function(xhr, status, error){
|
||||
// alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#inpatient_admission1,#inpatient_admission2").click(function () {
|
||||
let current_episode_id = $('input[name=episode_id]:checked').val();
|
||||
$("#admission_episode_id").val(current_episode_id);
|
||||
$("#ward_admission_episode").modal("show");
|
||||
});
|
||||
|
||||
$("#internal_transfer_bottom,#internal_transfer_middle").click(function () {
|
||||
let current_episode_id = $('input[name=episode_id]:checked').val();
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/patient_episodes/internal_clinic_transfer/" + current_episode_id,
|
||||
success: function (result) {
|
||||
if (result != 0) {
|
||||
let arr = result.split(',');
|
||||
console.log(arr);
|
||||
$('#current_clinic_transfer').val(arr[2]);
|
||||
$('#current_clinic_id').val(arr[1]);
|
||||
$('#current_triage_id').val(arr[0]);
|
||||
$('#current_episode_id').val(current_episode_id);
|
||||
$('#current_patient_id').val(arr[4]);
|
||||
$('#internal_transfer_dialog').modal('show');
|
||||
} else {
|
||||
alert("<?php echo __('patient_episode.triage_not_performed') ?>");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#submit_clinic_transfer").click(function () {
|
||||
let transfer_clinic = $("#transfer_to").val();
|
||||
let clinic = $("#current_clinic_id").val();
|
||||
let triage_id = $("#current_triage_id").val();
|
||||
let episode_id = $("#current_episode_id").val();
|
||||
let patient_id = $('#current_patient_id').val();
|
||||
|
||||
if (transfer_clinic == 0) {
|
||||
alert("<?php echo __('patient_episode.select_new_clinic') ?>");
|
||||
} else {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/patient_episodes/save_internal_clinic_transfer",
|
||||
data: {new_clinic: transfer_clinic, old_clinic: clinic, triage_id: triage_id, episode_id: episode_id, patient_id: patient_id},
|
||||
cache: false,
|
||||
success: function (result) {
|
||||
if (result == 1) {
|
||||
alert("<?php echo __('patient_episode.patient_transfer_successful') ?>");
|
||||
location.reload();
|
||||
} else {
|
||||
alert("<?php echo __('patient_episode.patient_transfer_failed') ?>");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function manage_eye_menus(is_patient_in_eye_clinic) {
|
||||
if(is_patient_in_eye_clinic == 1) {
|
||||
$('.eye_button').show();
|
||||
$('.normal_button').hide();
|
||||
} else {
|
||||
$('.eye_button').hide();
|
||||
$('.normal_button').show();
|
||||
}
|
||||
}
|
||||
|
||||
function paymentCheck(data){
|
||||
let episode_to_check_for_payment = $('input[name=episode_id]:checked').val();
|
||||
let patient_id = $('#patient_id_'+episode_to_check_for_payment).val();
|
||||
let action = data;
|
||||
event.preventDefault();
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/check_clinical_consultation_payment',
|
||||
data: {'episode_id' : episode_to_check_for_payment, 'patient_id':patient_id, 'action':action},
|
||||
success: function(response){
|
||||
if (response == "unpaid") {
|
||||
$("#unpaid_consultation_warning").modal("show");
|
||||
} else{
|
||||
window.location.href = response;
|
||||
}
|
||||
},
|
||||
error:function(error){
|
||||
console.log(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
+930
@@ -0,0 +1,930 @@
|
||||
@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','pattern' => '\d{10}', 'title'=>'Phone number must be exactly 10 digits']) }}
|
||||
<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','pattern' => '\d{10}', 'title'=>'Phone number must be exactly 10 digits' ]) }}
|
||||
<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','pattern' => '\d{10}', 'title'=>'Phone number must be exactly 10 digits']) }}
|
||||
</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','id' => 'country_picker']) }}
|
||||
<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> --}}
|
||||
<a href="#modal_add_country_foreigner" data-toggle="modal" id="modal_add_country_foreigner_id"><font size="1">Add new country </font></a>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="non_ugandan_foreigner_or_refugee">{{ __('patients.foreigner_or_refugee') }}</label>
|
||||
<select id="foreginer_refugee" name="non_ugandan_foreigner_or_refugee" class="form-control ">
|
||||
<option value="null"> -- {{ __('patients.select') }} --</option>
|
||||
<option value="1"> {{ __('patients.foreigner') }} </option>
|
||||
<option value="2"> {{ __('patients.refugee') }} </option>
|
||||
|
||||
</select>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="non_ugandan_national_id">{{ __('patients.national_id') }}</label>
|
||||
<input type="text" name="non_ugandan_national_id_no" value="" class="form-control">
|
||||
<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 -->
|
||||
|
||||
{{-- start of add other foreigner country modal --}}
|
||||
<div class="modal fade" id="modal_add_country_foreigner" 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">Add New Country</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Country Name</label>
|
||||
<input type="text" name="new_country_name" id="new_country_name" value="" class="form-control compulsory">
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
{{-- @error('name')
|
||||
<span class="text-danger">{{ $message }}</span>
|
||||
@enderror --}}
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('patients.cancel') }}</button>
|
||||
<a class="btn btn-success" onclick="submitCountry()">{{ __('patients.save') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<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));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// add new country
|
||||
function submitCountry() {
|
||||
var new_country_name = $("#new_country_name").val();
|
||||
|
||||
if ($("#new_country_name").val() === "" || !$("#new_country_name").val()) {
|
||||
alert("Please make sure that you fill in a country name");
|
||||
return false;
|
||||
}
|
||||
|
||||
var data = {
|
||||
'name':new_country_name,
|
||||
};
|
||||
|
||||
// $.ajax({
|
||||
// method: 'POST',
|
||||
// url: '/patients/add_country',
|
||||
// data: data,
|
||||
// success: function(response){
|
||||
// if(!isNaN(response)){
|
||||
// //response = last inserted id
|
||||
// $('#country_picker').append($('<option>', {
|
||||
// value: response,
|
||||
// text: new_country_name
|
||||
// }));
|
||||
// $('#country_picker').val(response);//preselect the newly added referral
|
||||
// $('#modal_add_country_foreigner').modal('hide'); //manually hide the modal
|
||||
// } else {
|
||||
// alert("error occurred");
|
||||
// }
|
||||
// },
|
||||
// error: function(jqXHR, textStatus, errorThrown) {
|
||||
// alert(JSON.stringify(jqXHR));
|
||||
// console.log(JSON.stringify(jqXHR));
|
||||
// }
|
||||
// });
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/patients/add_country',
|
||||
data: data,
|
||||
success: function(response) {
|
||||
if (!isNaN(response)) {
|
||||
// response = last inserted id
|
||||
$('#country_picker').append($('<option>', {
|
||||
value: response,
|
||||
text: new_country_name
|
||||
}));
|
||||
$('#country_picker').val(response); // preselect the newly added country
|
||||
$('#modal_add_country_foreigner').modal('hide'); // manually hide the modal
|
||||
} else {
|
||||
alert(response.error || "An unknown error occurred");
|
||||
}
|
||||
},
|
||||
error: function(jqXHR) {
|
||||
var response = jqXHR.responseJSON;
|
||||
if (jqXHR.status === 409 && response && response.error) {
|
||||
alert(response.error); // Show the "Country already exists" message
|
||||
} else {
|
||||
alert("An error occurred: " + 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,#foreginer_refugee').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>
|
||||
|
||||
|
||||
{{-- palm vein scanner --}}
|
||||
|
||||
|
||||
{{-- <script type="text/javascript" src="{{ asset('js/palmsecure/fbf.standalone.js') }}" xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5"></script> --}}
|
||||
|
||||
{{-- <script type ="text/javascript" src="{{ asset('js/palmsecure/fbf.module.js') }}"></script> --}}
|
||||
<script type ="text/javascript" src="{{ asset('js/palmsecure/demo.bundle.js') }}"></script>
|
||||
<script type ="text/javascript" src="{{ asset('js/palmsecure/demo.js') }}"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
start();
|
||||
</script>
|
||||
|
||||
{{-- end of palm vein scanner --}}
|
||||
@endpush
|
||||
+788
@@ -0,0 +1,788 @@
|
||||
@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('Super Admin'))
|
||||
<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','pattern' => '\d{10}', 'title'=>'Phone number must be exactly 10 digits']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('phone',__('patients.phone')) }}
|
||||
{{ Form::text('phone',$patient->phone,['class' => 'form-control compulsory','pattern' => '\d{10}', 'title'=>'Phone number must be exactly 10 digits']) }}
|
||||
</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','pattern' => '\d{10}', 'title'=>'Phone number must be exactly 10 digits']) }}
|
||||
</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>
|
||||
|
||||
@php
|
||||
$other_patients_info_data = !empty($patient->other_patients_info) ? json_decode($patient->other_patients_info) : '';
|
||||
@endphp
|
||||
<div class="form-group">
|
||||
<label for="non_ugandan_foreigner_or_refugee">{{ __('patients.foreigner_or_refugee') }}</label>
|
||||
<select id="foreginer_refugee" name="non_ugandan_foreigner_or_refugee" class="form-control ">
|
||||
<option value="null"> -- {{ __('patients.select') }} --</option>
|
||||
<option value="1" @selected(isset($other_patients_info_data) && is_int($other_patients_info_data) && $other_patients_info_data->non_ugandan_foreigner_or_refugee == 1 ?? '')> {{ __('patients.foreigner') }} </option>
|
||||
<option value="2" @selected(isset($other_patients_info_data) && is_int($other_patients_info_data) && $other_patients_info_data->non_ugandan_foreigner_or_refugee == 2 ?? '')> {{ __('patients.refugee') }} </option>
|
||||
|
||||
</select>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="non_ugandan_national_id">{{ __('patients.national_id') }}</label>
|
||||
<input type="text" name="non_ugandan_national_id_no" value=" {{ $other_patients_info_data->non_ugandan_national_id_no ?? '' }}" class="form-control">
|
||||
<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
|
||||
+252
@@ -0,0 +1,252 @@
|
||||
@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;"> {{ count($patient_numbers) }} {{ __('patients.patients_registered') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(isset($criteria))
|
||||
<p>{{ __('patients.search_criteria') }} : <code>{{ $criteria }}</code></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>
|
||||
@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>{{ $categories[$patient->category_id] ?? "N/A" }}</td>
|
||||
<td>{{ $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
|
||||
</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); ?>)
|
||||
}
|
||||
);
|
||||
|
||||
$('#villages .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'villages',
|
||||
source: substringMatcher(<?php echo json_encode(array_values($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
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Patient Card</title>
|
||||
<style>
|
||||
@page {
|
||||
size: A8 landscape;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
}
|
||||
.a8-container {
|
||||
/*
|
||||
width: 8.5cm;
|
||||
height: 5.4cm; */
|
||||
|
||||
|
||||
width: 450px;
|
||||
height: 280px;
|
||||
border: 1px solid #000;
|
||||
display: flex;
|
||||
/* align-items: center;
|
||||
justify-content: center; */
|
||||
/* margin: auto; */
|
||||
/* page-break-inside: avoid; */
|
||||
}
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
th, td {
|
||||
border: 0px solid #000;
|
||||
padding: 0px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
{{-- <div class="a8-container"> --}}
|
||||
<table >
|
||||
{{-- row 1 --}}
|
||||
<tr style=" border-bottom: 1px solid gray; ">
|
||||
<td style="padding:8px;">
|
||||
|
||||
{{-- LOGO --}}
|
||||
<img style="max-width: 100px; max-height: 25px;" src="{{ asset($data['hospitalInfo']->logo ?? '') }}" class="" alt="">
|
||||
|
||||
</td>
|
||||
<td style="padding:8px; text-align:right; font-weight:600;">PATIENT CARD</td>
|
||||
</tr>
|
||||
|
||||
|
||||
{{-- row 2 --}}
|
||||
<tr>
|
||||
<td colspan="2" style="font-size:5px; padding-top:10px;padding-left:7px; padding-right:7px; ">NAME</td>
|
||||
</tr>
|
||||
|
||||
{{-- row 3 --}}
|
||||
<tr>
|
||||
<td colspan="2" style="font-size:9px; font-weight:600;padding-left:7px; padding-right:7px;text-transform: uppercase " >
|
||||
{{ $data['patient']->first_name ?? '' }}
|
||||
{{ $data['patient']->last_name ?? '' }}
|
||||
{{ $data['patient']->other_names ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{{-- row 4 --}}
|
||||
<tr style="">
|
||||
<td style="font-size:5px; padding-top:10px;padding-left:7px; ">PATIENT NUMBER</td>
|
||||
<td style="font-size:5px; padding-top:10px; padding-right:7px; text-transform: uppercase">RESIDENCE</td>
|
||||
</tr>
|
||||
|
||||
{{-- row 5 --}}
|
||||
|
||||
<tr >
|
||||
<td style="font-size:9px; font-weight:600; padding-left:7px; text-transform: uppercase">{{ $data['patient']->number ?? '' }} </td>
|
||||
<td style="font-size:9px; font-weight:600; padding-right:7px;text-transform: uppercase">{{ get_name(get_name($data['patient']->id, "id", "village_id", "patients"), "id", "name", "villages") }}</td>
|
||||
|
||||
</tr>
|
||||
|
||||
{{-- row 6 --}}
|
||||
|
||||
<tr >
|
||||
<td style="font-size:5px; padding-top:10px; padding-left:7px;vertical-align: top; ">DISTRICT <br>
|
||||
<span style="font-size:9px; font-weight:600; text-transform: uppercase">{{ get_name($data['patient']->district_id, "id", "name", "districts") }} </span>
|
||||
</td>
|
||||
<td style="font-size:5px; padding-top:10px; padding-right:7px;">
|
||||
{{ getDNS1DBarcodePNGOCards(sprintf("%04u", $data['patient']->id)) }}
|
||||
<br>
|
||||
<h4 style="color: black">{{ sprintf("%04u", $data['patient']->id) }}</h4></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td colspan="2" style="font-size:5px; padding-top:5px; padding-left:7px; padding-right:7px; text-align:left; border-bottom: 0px solid gray; font-style:italic;">
|
||||
This card is a property of {{ $data['hospitalInfo']->name ?? '' }}, If found please return to the facility. <br>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr >
|
||||
<td style="font-size:4px; text-align:left; padding-left:7px; padding-top:-12px; ">Supported by Streamline ; www.streamlinehealth.org</td>
|
||||
<td style="text-align:right; ">
|
||||
<img style="max-width: 60px; max-height: 25px; padding-right:7px; padding-top:5px;" src="{{ asset('uploads/streamline/color/280X50-06.png') }}" class="" alt="">
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
{{-- </div> --}}
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+265
@@ -0,0 +1,265 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('content')
|
||||
|
||||
@php
|
||||
$other_patients_info_data = !empty($patient->other_patients_info) ? json_decode($patient->other_patients_info) : '';
|
||||
|
||||
@endphp
|
||||
|
||||
<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>
|
||||
{{ getDNS1DBarcodePNG(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">
|
||||
@if (Auth::user()->can('print-patient-cards'))
|
||||
<a href="/patient_card/{{ $patient->id }}" target="_blank" class="btn btn-rounded btn-primary btn-sm float-right">{{ __('patients.print_patient_card') }}</a>
|
||||
@endif
|
||||
</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>
|
||||
<tr>
|
||||
<th><font color="black">Country</font></th>
|
||||
<td>{{ $country->name ?? '' }}</td>
|
||||
</tr>
|
||||
<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>
|
||||
<tr>
|
||||
<th><font color="black">Foreigner / Refugee </font></th>
|
||||
<td>
|
||||
|
||||
@if(!empty($other_patients_info_data))
|
||||
@if ($other_patients_info_data->non_ugandan_foreigner_or_refugee == 1)
|
||||
<span>{{ __('patients.foreigner') }} </span>
|
||||
@elseif ($other_patients_info_data->non_ugandan_foreigner_or_refugee == 2)
|
||||
<span>{{ __('patients.refugee') }} </span>
|
||||
@else
|
||||
<span></span>
|
||||
@endif
|
||||
@else
|
||||
<span></span>
|
||||
@endif
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@if (isset($other_patients_info_data->non_ugandan_national_id_no))
|
||||
|
||||
<tr>
|
||||
<th class="highlight"> ID Number</th>
|
||||
<td>{{ $other_patients_info_data->non_ugandan_national_id_no ?? '' }}</td>
|
||||
</tr>
|
||||
|
||||
@else
|
||||
<tr>
|
||||
<th class="highlight">National ID</th>
|
||||
<td>{{ $patient->national_id ?? '' }}</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@endif
|
||||
|
||||
|
||||
@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
|
||||
+945
@@ -0,0 +1,945 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
||||
<style></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">{{ __('point_of_sale.point_of_sale') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('point_of_sale.home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-shopping-cart"></i> {{ __('point_of_sale.point_of_sale') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
|
||||
{{ Form::open(['route'=>'point_of_sale.confirm_pricing']) }}
|
||||
|
||||
<div class="tap_div_to_calculate_bill_total">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">#</th>
|
||||
<th class="text-center">{{ __('point_of_sale.first_name') }}</th>
|
||||
<th class="text-center">{{ __('point_of_sale.last_name') }}</th>
|
||||
<th class="text-center">{{ __('point_of_sale.patient_category') }}</th>
|
||||
<th class="text-center">{{ __('point_of_sale.phone_number') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="5"><h5><b>{{ __('point_of_sale.patient_information') }}</b></h5></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-center">{{ $patient->number }}</td>
|
||||
<td class="text-center">{{ $patient->first_name }}</td>
|
||||
<td class="text-center">{{ $patient->last_name }}</td>
|
||||
<td class="text-center">{{ get_name($patient->category_id, 'id', 'name', 'patient_categories') }}</td>
|
||||
<td class="text-center">{{ $patient->phone }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
@if($pre_ordered_eye_glasses)
|
||||
<div class="row">
|
||||
<div class="col-10">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">{{ __('point_of_sale.select') }}</th>
|
||||
<th class="text-center">{{ __('point_of_sale.eye_glasses') }}</th>
|
||||
<th class="text-center">{{ __('point_of_sale.quantity') }}</th>
|
||||
<th class="text-center">{{ __('point_of_sale.unit_cost') }}</th>
|
||||
<th class="text-center">{{ __('point_of_sale.cost') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $pre_order_amount_sum = 0; @endphp
|
||||
<tr><td colspan='5' style='background-color: #FFE6E6; font-weight: bolder; text-decoration: underline;'>{{ __('point_of_sale.selected') }}</td></tr>
|
||||
@foreach($pre_ordered_eye_glasses as $pre_order)
|
||||
<tr id="eye_glass_row{{ $pre_order->id }}" class="eye_glass_remove">
|
||||
<td>
|
||||
@if ($pre_order->total_stock > 0 )
|
||||
<input type="checkbox" id="chk" name="eye_glass_item[]" class="eye_glass_check" value="{{ $pre_order->id }}">
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($pre_order->insurance == 1)
|
||||
<span style='color: green'> {{ $pre_order->name }} </span>
|
||||
@else
|
||||
<span style='color: orange'> {{ $pre_order->name }} </span>
|
||||
@endif
|
||||
<br/>
|
||||
@if ($pre_order->total_stock <= 0)
|
||||
<span class="badge badge-danger">{{ __('point_of_sale.out_of_stock') }}</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<input type='number' name='eye_glass_quantity[]' style="margin-bottom: 0px;" id="pre_order_quantity_{{$pre_order->id}}" class="form-control compulsory"/>
|
||||
</td>
|
||||
<td>
|
||||
@if($pre_order->insurance == 1 && patient_insurance_status($patient_id) == 1)
|
||||
{{-- {{ ugandan_shillings($pre_order->insured_price) }}--}}
|
||||
<input type='number' disabled name='pre_order_cost[]' id="pre_order_cost_{{ $pre_order->id }}" class="form-control" value="{{ $pre_order->insured_price }}"/>
|
||||
@else
|
||||
{{-- {{ ugandan_shillings($pre_order->non_insured_price) }}--}}
|
||||
<input type='number' disabled name='pre_order_cost[]' id="pre_order_cost_{{ $pre_order->id }}" class="form-control" value="{{ $pre_order->non_insured_price }}"/>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
@php
|
||||
// get insurance status for drug
|
||||
|
||||
$eye_glass_insurance_status = get_name($pre_order->id, "id", "insurance", "eye_glasses");
|
||||
$eye_glass_amount = get_name($pre_order->id, "id", "non_insured_price", "eye_glasses");
|
||||
// insurance flag
|
||||
$is_insured = 0;
|
||||
|
||||
// check if drug and patient is eligible for insurance
|
||||
if($eye_glass_insurance_status == 1 && patient_insurance_status($patient_id) == 1){
|
||||
$insurance_amount = get_name($pre_order->id, "id", "non_insured_price", "eye_glasses") - $eye_glass_amount;
|
||||
$is_insured = 1;
|
||||
} else {
|
||||
$insurance_amount = 0;
|
||||
}
|
||||
|
||||
@endphp
|
||||
<input type="hidden" name="eye_glass_amount[]" id="eye_glass_amount_{{ $pre_order->id }}">
|
||||
<input type="hidden" name="eye_glass_insurance_amount[]" value="0">
|
||||
<input type="hidden" name="eye_glass_insurance_status[]" value="{{ $eye_glass_insurance_status }}">
|
||||
<input type="hidden" name="eye_glass_order_ids[]" value="{{ $pre_order->id }}">
|
||||
<td>
|
||||
<input id="pre_order_cost_sum_{{ $pre_order->id }}" class="form-control compulsory" type="number" name="eye_glass_subtotal[]"> .UGx
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<div>
|
||||
<label for="pre_eye_glasses_grand_total"><b>{{ __('point_of_sale.eye_glass_total') }} :</b></label>
|
||||
<input id="pre_eye_glasses_grand_total" readonly name="eye_glass_total" class="form-control" type="number"> {{ __('point_of_sale.ugx') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<br/>
|
||||
|
||||
@if($pre_ordered_services)
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">{{ __('service_items.select') }}</th>
|
||||
<th class="text-center">{{ __('service_items.service') }}</th>
|
||||
<th class="text-center">{{ __('service_items.quantity') }}</th>
|
||||
<th class="text-center">{{ __('service_items.unit_cost') }}</th>
|
||||
<th class="text-center">{{ __('service_items.total_cost') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$service_order_amount_sum = 0;
|
||||
@endphp
|
||||
<tr>
|
||||
<td colspan='5' style='background-color: #FFE6E6; font-weight: bolder; text-decoration: underline;'>{{ __('service_items.selected_service_orders') }}</td>
|
||||
</tr>
|
||||
|
||||
@foreach($pre_ordered_services as $service_order)
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" name="service_id[]" value="{{ $service_order->id }}" checked>
|
||||
</td>
|
||||
<td>
|
||||
@if($service_order->insurance_coverage == 1)
|
||||
<span style='color: green'> {{ $service_order->name }} </span>
|
||||
@else
|
||||
<span style='color: orange'> {{ $service_order->name }} </span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<input type='number' name='quantity[]' style="margin-bottom: 0px;" id="service_order_quantity_{{$service_order->id}}" class="form-control compulsory" required />
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$price_list_id = is_patient_category_attached_to_price_list($patient_id);
|
||||
@endphp
|
||||
@if($price_list_id)
|
||||
{{ ugandan_shillings(get_price_list_category_price($price_list_id, 6, $service_order->id)) }}
|
||||
<input type='hidden' name='service_order_cost[]' id="service_order_cost_{{ $service_order->id }}" class="form-control" value="{{ get_price_list_category_price($price_list_id, 6, $service_order->id) }}"/>
|
||||
@else
|
||||
@php
|
||||
$service_insurance = $service_order->insurance_coverage;
|
||||
@endphp
|
||||
|
||||
@if($service_insurance == 1 && patient_insurance_status($patient_id) == 1)
|
||||
{{ ugandan_shillings($service_order->insured_price) }}
|
||||
<input type='hidden' name='service_order_cost[]' id="service_order_cost_{{ $service_order->id }}" class="form-control" value="{{ $service_order->insured_price }}"/>
|
||||
@else
|
||||
{{ ugandan_shillings($service_order->non_insured_price) }}
|
||||
<input type='hidden' name='service_order_cost[]' id="service_order_cost_{{ $service_order->id }}" class="form-control" value="{{ $service_order->non_insured_price }}"/>
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<input id="service_order_cost_sum_{{ $service_order->id }}" class="form-control" readonly type="number" name="service_item_subtotal[]">
|
||||
<span class="input-group-addon">{{ __('point_of_sale.ugx') }}</span>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<!-- display row showing total amount -->
|
||||
|
||||
@if(!$pre_ordered_services)
|
||||
<tr>
|
||||
<td colspan="5" class='text-center' style='color: maroon; font-weight: bold;'>{{ __('service_items.select_services_above') }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<label for="service_grand_total"><b>SERVICES TOTAL :</b></label>
|
||||
<div class="input-group">
|
||||
<input id="service_grand_total" class="form-control" readonly type="number" name="service_grand_total">
|
||||
<span class="input-group-addon">{{ __('point_of_sale.ugx') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@php
|
||||
$allergy_check = "";
|
||||
$fre_drop = "";
|
||||
$results = \DB::select("select * from dosage_frequencies order by name");
|
||||
foreach ($results as $result){
|
||||
$fre_drop .= "<option value='" . $result->id . "'>" . $result->name . "</option>";
|
||||
}
|
||||
@endphp
|
||||
|
||||
@if($manual_patient_prescriptions)
|
||||
<div class="row">
|
||||
<div class="col-10">
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table" id="manual_prescription_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ __('point_of_sale.drug') }}</th>
|
||||
<th style="display: none">{{ __('point_of_sale.dosage') }}</th>
|
||||
<th style="display: none">{{ __('point_of_sale.frequency') }}</th>
|
||||
<!-- <th style="width: 20%;">Prompt</th> -->
|
||||
<th style="display:none;">{{ __('point_of_sale.duration') }}</th>
|
||||
<th>{{ __('point_of_sale.quantity_to_dispense') }}</th>
|
||||
<th>{{ __('point_of_sale.price') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" style="background-color: #FFE6E6; font-weight: bolder; text-decoration: underline;border: 1px solid #ddd;">{{ __('point_of_sale.selected') }}</td>
|
||||
<td colspan="2" style="border: 1px solid #ddd;"></td>
|
||||
</tr>
|
||||
@if($manual_patient_prescriptions)
|
||||
@if(count($manual_patient_prescriptions) > 0)
|
||||
@foreach($manual_patient_prescriptions as $prescription)
|
||||
@php
|
||||
if(isset($allergies['names'])){
|
||||
$allergies_explode = explode(",", $allergies['names']);
|
||||
$allergy_check = \Modules\Pharmacy\Http\Controllers\PrescriptionsController::checkPatientAllergies($allergies_explode, $prescription->drug_category);
|
||||
}
|
||||
@endphp
|
||||
<tr id="my_row{{ $prescription->id }}" class="to_remove">
|
||||
@php
|
||||
$is_insured = 0;
|
||||
@endphp
|
||||
<!-- # -->
|
||||
<td style="border: 1px solid #ddd;">
|
||||
@php
|
||||
$total_stock = $prescription->pharmacy_stock;
|
||||
@endphp
|
||||
@if ($prescription->total_stock > 0 && $allergy_check != 'Allergic')
|
||||
<input type="checkbox" name="drug_id[]" id="chk" class="prescription-check" value="{{ $prescription->id }}" />
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<!-- drug -->
|
||||
<td style="border: 1px solid #ddd;">
|
||||
@php
|
||||
$insurance_color = ($prescription->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1) ? "green" : "orange";
|
||||
@endphp
|
||||
<span style="color:{{ $insurance_color }}"> {{ $prescription->name }}</span> <br/>
|
||||
@if ($allergy_check == 'Allergic')
|
||||
<span class='allergic'>{{ __('point_of_sale.patient_is_allergic') }}</span>
|
||||
@endif
|
||||
@if ($prescription->total_stock <= 0)
|
||||
<span class="badge badge-danger">{{ __('point_of_sale.out_of_stock') }}</span>
|
||||
@endif
|
||||
<?php
|
||||
$pharm_comment = trim($prescription->pharmacy_comment);
|
||||
if(isset($prescription->reference_areas)){ $reference_array = explode(",", $prescription->reference_areas); } else { $reference_array = []; }
|
||||
if(isset($prescription->reference_name)){ $reference_name = explode(",", $prescription->reference_name); } else { $reference_name = []; }
|
||||
|
||||
if (!empty($pharm_comment)):
|
||||
echo "<div style='padding: 1px; margin: 6px 1px 0px 1px; font-size: smaller' class='alert alert-info span12 margin-none well'>" . $pharm_comment . "</div>";
|
||||
endif;
|
||||
?>
|
||||
@for ($x = 0; $x < count($reference_array); $x++)
|
||||
@if(isset($reference_array[$x]) && isset($reference_name[$x]))
|
||||
<a style="font-weight:normal;" href="{{ $reference_array[$x] }}" target="blank">{{ $reference_name[$x] }}</a><br>
|
||||
@endif
|
||||
@endfor
|
||||
@if (!empty($pharm_comment))
|
||||
<div style='padding: 1px; margin: 6px 1px 0px 1px; font-size: smaller' class='alert alert-info span12 margin-none well'>{{ $pharm_comment }}</div>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<td style="border: 1px solid #ddd;">
|
||||
<input type='number' style="margin-bottom: 0px;" name='treatment_quantity[]' id="manual_quantity_dispensed{{$prescription->id}}" class="form-control" required />
|
||||
<span style="margin-bottom: 4px; font-size: x-small; float: right;" id="price_per_unit_drug{{ $prescription->id }}"></span>
|
||||
|
||||
<input type="hidden" name="treatment_id"/>
|
||||
<input type="hidden" name="treatment_item[]" value="{{ $prescription->id }}" />
|
||||
<!-- <input type="hidden" name="drug_id[]" id="chk" value="{{ $prescription->id }}" />-->
|
||||
<input type="hidden" name="treatment_amount[]" value="{{ $prescription->non_insured_price }}">
|
||||
<input type="hidden" name="treatment_insurance_status[]" value="{{ $prescription->insurance_coverage }}">
|
||||
<input type="hidden" name="treatment_insurance_amount[]" value="{{ $prescription->insured_price }}">
|
||||
|
||||
<?php $drug_form = getTableInfo('unit_of_measure','name','id='.$prescription->form_id); ?>
|
||||
<input type="hidden" id="drug_form{{$prescription->id}}" value="{{$drug_form}}">
|
||||
|
||||
@if($prescription->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1)
|
||||
<input type="hidden" id="selling_price{{$prescription->id}}" value="{{$prescription->insured_price}}">
|
||||
@else
|
||||
<input type="hidden" id="selling_price{{$prescription->id}}" value="{{$prescription->non_insured_price}}">
|
||||
@endif
|
||||
|
||||
|
||||
<input type="hidden" name="pack[]" id="pack{{$prescription->id}}" value="{{$prescription->pack}}">
|
||||
<input type="hidden" name="strength[]" id="strength{{$prescription->id}}" value="{{$prescription->strength}}">
|
||||
|
||||
</td>
|
||||
<!-- price -->
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<input class="center form-control" id="auto_prescription_price{{$prescription->id}}" style="padding: 2px;border: 1px solid #ddd;" name="treatment_subtotal[]">
|
||||
<span class="input-group-addon">{{ __('point_of_sale.ugx') }}</span>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
@else
|
||||
<tr class="warning"><td class="center" colspan="8" style="border: 1px solid #ddd;">{{ __('point_of_sale.no_drugs_have_been_searched_yet') }}</td></tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<label for="grand_total_column"><b>{{ __('point_of_sale.drugs_total') }} :</b></label>
|
||||
<div class="input-group">
|
||||
<input id="grand_total_column" name="treatment_total" class="form-control" readonly type="number">
|
||||
<span class="input-group-addon">{{ __('point_of_sale.ugx') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($automatic_patient_prescriptions)
|
||||
<div class="row">
|
||||
<div class="col-10">
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table" id="prescription_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 5%;">#</th>
|
||||
<th style="width: 15%;">{{ __('point_of_sale.drug') }}</th>
|
||||
<th style="width: 20%;">{{ __('point_of_sale.dosage') }}</th>
|
||||
<!-- <th style="width: 20%;">Prompt</th> -->
|
||||
<th style="width: 20%;">{{ __('point_of_sale.duration') }}</th>
|
||||
<th style="width: 20%;">{{ __('point_of_sale.dispense') }}</th>
|
||||
<th style="width: 20%;">{{ __('point_of_sale.price') }}</th>
|
||||
<!-- <th style="width: 10%;">Instruction</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" style="background-color: #FFE6E6; font-weight: bolder; text-decoration: underline;border: 1px solid #ddd;">{{ __('point_of_sale.selected') }}</td>
|
||||
<td colspan="4" style="border: 1px solid #ddd;"></td>
|
||||
</tr>
|
||||
|
||||
@if($automatic_patient_prescriptions)
|
||||
@if(count($automatic_patient_prescriptions) > 0)
|
||||
@foreach($automatic_patient_prescriptions as $prescription)
|
||||
@php
|
||||
if(isset($allergies['names'])){
|
||||
$allergies_explode = explode(",", $allergies['names']);
|
||||
$allergy_check = \Modules\Pharmacy\Http\Controllers\PrescriptionsController::checkPatientAllergies($allergies_explode, $prescription->drug_category);
|
||||
}
|
||||
@endphp
|
||||
<tr id="my_row{{ $prescription->id }}" class="to_remove">
|
||||
@php
|
||||
$is_insured = 0;
|
||||
@endphp
|
||||
|
||||
<td style="border: 1px solid #ddd;">
|
||||
@php
|
||||
$total_stock = $prescription->pharmacy_stock;
|
||||
@endphp
|
||||
@if ($prescription->total_stock > 0 && $allergy_check != 'Allergic')
|
||||
<input type="checkbox" name="drug_id[]" id="chk" class="prescription-check" value="{{ $prescription->id }}" />
|
||||
@endif
|
||||
</td>
|
||||
<td style="border: 1px solid #ddd;">
|
||||
@php
|
||||
$insurance_color = ($prescription->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1) ? "green" : "orange";
|
||||
@endphp
|
||||
<span style="color:{{ $insurance_color }}"> {{ $prescription->name }}</span> <br/>
|
||||
@if ($allergy_check == 'Allergic')
|
||||
<span class='allergic'>{{ __('point_of_sale.patient_is_allergic') }}</span>
|
||||
@endif
|
||||
@if ($prescription->total_stock <= 0)
|
||||
<span class="badge badge-danger">{{ __('point_of_sale.out_of_stock') }}</span>
|
||||
@endif
|
||||
<?php
|
||||
$pharm_comment = trim($prescription->pharmacy_comment);
|
||||
if(isset($prescription->reference_areas)){ $reference_array = explode(",", $prescription->reference_areas); } else { $reference_array = []; }
|
||||
if(isset($prescription->reference_name)){ $reference_name = explode(",", $prescription->reference_name); } else { $reference_name = []; }
|
||||
|
||||
if (!empty($pharm_comment)):
|
||||
echo "<div style='padding: 1px; margin: 6px 1px 0px 1px; font-size: smaller' class='alert alert-info span12 margin-none well'>" . $pharm_comment . "</div>";
|
||||
endif;
|
||||
?>
|
||||
@for ($x = 0; $x < count($reference_array); $x++)
|
||||
@if(isset($reference_array[$x]) && isset($reference_name[$x]))
|
||||
<a style="font-weight:normal;" href="{{ $reference_array[$x] }}" target="blank">{{ $reference_name[$x] }}</a><br>
|
||||
@endif
|
||||
@endfor
|
||||
@if (!empty($pharm_comment))
|
||||
<div style='padding: 1px; margin: 6px 1px 0px 1px; font-size: smaller' class='alert alert-info span12 margin-none well'>{{ $pharm_comment }}</div>
|
||||
@endif
|
||||
</td>
|
||||
<td style="border: 1px solid #ddd;">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<input type='number' step="0.001" style="margin-bottom: 0px;" name='dose[]' id="dose{{$prescription->id}}" class="form-control" required />
|
||||
<span style="margin-bottom: 4px; font-size: smaller;">
|
||||
<?php $drugunit = getTableInfo('drug_units','name','id='.$prescription->unit_id); ?>
|
||||
{{ $drugunit }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name='frequency[]' style="margin-bottom: 0px;" id="frequency{{$prescription->id}}" required>
|
||||
<option value=''>{{ __('point_of_sale._select') }}</option>
|
||||
<?php echo $fre_drop; ?>
|
||||
</select>
|
||||
<span style="margin-bottom: 4px; font-size: smaller;" id="equiv1{{$prescription->id}}"></span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td style="border: 1px solid #ddd;">
|
||||
<input type='number' style="margin-bottom: 0px;" name='duration[]' id="duration{{$prescription->id}}" class="form-control" placeholder="days" required />
|
||||
<input type="hidden" name="time[]" value="Days" class="span4" readonly required >
|
||||
<span style="margin-bottom: 4px; font-size: xx-small; float: right;">{{ __('point_of_sale.duration_in_days') }}</span>
|
||||
</td>
|
||||
<td style="border: 1px solid #ddd;">
|
||||
<input type='number' style="margin-bottom: 0px;" name='treatment_quantity[]' id="quantity_dispensed{{$prescription->id}}" class="form-control" required readonly />
|
||||
<input type="hidden" name="treatment_item[]" value="{{ $prescription->id }}" />
|
||||
<!-- <input type="hidden" name="drug_id[]" id="chk" value="{{ $prescription->id }}" />-->
|
||||
<input type="hidden" name="treatment_amount[]" value="{{ $prescription->non_insured_price }}">
|
||||
<input type="hidden" name="treatment_insurance_status[]" value="{{ $prescription->insurance_coverage }}">
|
||||
<input type="hidden" name="treatment_insurance_amount[]" value="{{ $prescription->insured_price }}">
|
||||
|
||||
<?php $drug_form = getTableInfo('unit_of_measure','name','id='.$prescription->form_id); ?>
|
||||
<input type="hidden" id="drug_form{{$prescription->id}}" value="{{$drug_form}}">
|
||||
|
||||
@if($prescription->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1)
|
||||
<input type="hidden" id="selling_price{{$prescription->id}}" value="{{$prescription->insured_price}}">
|
||||
@else
|
||||
<input type="hidden" id="selling_price{{$prescription->id}}" value="{{$prescription->non_insured_price}}">
|
||||
@endif
|
||||
|
||||
|
||||
<input type="hidden" name="pack[]" id="pack{{$prescription->id}}" value="{{$prescription->pack}}">
|
||||
<input type="hidden" name="strength[]" id="strength{{$prescription->id}}" value="{{$prescription->strength}}">
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<input class="center" id="auto_prescription_price{{$prescription->id}}" style="padding: 2px;border: 1px solid #ddd;" name="treatment_subtotal[]">
|
||||
<span class="input-group-addon">{{ __('point_of_sale.ugx') }}</span>
|
||||
</div>
|
||||
</td>
|
||||
<!-- <td style="padding: 2px;border: 1px solid #ddd;">
|
||||
<textarea name="instructions[]" id="instructions{{$prescription->id}}" class="form-control" rows="3" placeholder="Instructions to the patient .."></textarea>
|
||||
</td> -->
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
@else
|
||||
<tr class="warning"><td class="center" colspan="8" style="border: 1px solid #ddd;">{{ __('point_of_sale.no_drugs_have_searched_yet') }}</td></tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<label for="grand_total_column"><b>{{ __('point_of_sale.drugs_total') }} :</b></label>
|
||||
<div class="input-group">
|
||||
<input id="grand_total_column" name="treatment_total" class="form-control" readonly type="number">
|
||||
<span class="input-group-addon">{{ __('point_of_sale.ugx') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($pre_ordered_sundries)
|
||||
<div class="row">
|
||||
<div class="col-10">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">{{ __('point_of_sale.select') }}</th>
|
||||
<th class="text-center">{{ __('point_of_sale.sundry') }}</th>
|
||||
<th class="text-center">{{ __('point_of_sale.quantity') }}</th>
|
||||
<th class="text-center">{{ __('point_of_sale.unit_cost') }}</th>
|
||||
<th class="text-center">{{ __('point_of_sale.total_cost') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $pre_order_amount_sum = 0; @endphp
|
||||
<tr><td colspan='5' style='background-color: #FFE6E6; font-weight: bolder; text-decoration: underline;'>{{ __('point_of_sale.selected_sundries_orders') }}</td></tr>
|
||||
@foreach($pre_ordered_sundries as $pre_order)
|
||||
<tr>
|
||||
<td>
|
||||
@if ($pre_order->total_stock > 0)
|
||||
<input type="checkbox" name="pos_sundry_ids[]" value="{{ $pre_order->id }}" >
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($pre_order->insurance == 1)
|
||||
<span style='color: green'> {{ $pre_order->name }} </span>
|
||||
@else
|
||||
<span style='color: orange'> {{ $pre_order->name }} </span>
|
||||
@endif
|
||||
<br/>
|
||||
@if ($pre_order->total_stock <= 0)
|
||||
<span class="badge badge-danger">{{ __('point_of_sale.out_of_stock') }}</span>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
@php
|
||||
|
||||
$insurance_amount = 0;
|
||||
|
||||
// get insurance status for sundry
|
||||
$sundry_insurance_status = get_name($pre_order->id, "id", "insurance", "sundries");
|
||||
|
||||
// insurance flag
|
||||
$is_insured = 0;
|
||||
if($sundry_insurance_status == 1 && patient_insurance_status($patient_id) == 1){
|
||||
$sundry_amount = get_name($pre_order->id, "id", "insured_price", "sundries");
|
||||
$insurance_amount = get_name($pre_order->id, "id", "non_insured_price", "sundries") - $sundry_amount;
|
||||
$is_insured = 1;
|
||||
} else {
|
||||
$sundry_amount = get_name($pre_order->id, "id", "non_insured_price", "sundries");
|
||||
}
|
||||
// }
|
||||
@endphp
|
||||
|
||||
<td>
|
||||
<input type='number' name='sundry_quantity[]' style="margin-bottom: 0px;" id="pre_order_sundry_quantity_{{$pre_order->id}}" class="form-control compulsory" required />
|
||||
</td>
|
||||
<td>
|
||||
@php $price_list_id = is_patient_category_attached_to_price_list($patient_id); @endphp
|
||||
@if($price_list_id)
|
||||
{{ ugandan_shillings(get_price_list_category_price($price_list_id, 5, $pre_order->id)) }}
|
||||
<input type='hidden' name='pre_order_sundry_cost[]' id="pre_order_sundry_cost_{{ $pre_order->id }}" class="form-control" value="{{ get_price_list_category_price($price_list_id, 5, $pre_order->id) }}"/>
|
||||
@else
|
||||
@php $sundry_insurance = $pre_order->insurance; @endphp
|
||||
@if($sundry_insurance == 1 && patient_insurance_status($patient_id) == 1)
|
||||
{{ ugandan_shillings($pre_order->insured_price) }}
|
||||
<input type='hidden' name='pre_order_sundry_cost[]' id="pre_order_sundry_cost_{{ $pre_order->id }}" class="form-control" value="{{ $pre_order->insured_price }}"/>
|
||||
@else
|
||||
{{ ugandan_shillings($pre_order->non_insured_price) }}
|
||||
<input type='hidden' name='pre_order_sundry_cost[]' id="pre_order_sundry_cost_{{ $pre_order->id }}" class="form-control" value="{{ $pre_order->non_insured_price }}"/>
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<input id="pre_order_sundry_cost_sum_{{ $pre_order->id }}" class="form-control" name="sundry_subtotal[]" readonly>
|
||||
<span class="input-group-addon">{{ __('point_of_sale.ugx') }}</span>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
{{ Form::hidden('sundry_insurance_status[]', $is_insured) }}
|
||||
{{ Form::hidden('sundry_insurance_amount[]', $insurance_amount, ['class' => 'insurance_amount']) }}
|
||||
</tr>
|
||||
@endforeach
|
||||
<!-- display row showing total amount -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<label for="pre_grand_sundry_total"><b>{{ __('point_of_sale.sundries_total') }} :</b></label>
|
||||
<div class="input-group">
|
||||
<input id="pre_grand_sundry_total" name="sundry_grand_total" class="form-control" readonly type="number">
|
||||
<span class="input-group-addon">{{ __('point_of_sale.ugx') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<br/>
|
||||
<div class="row">
|
||||
<div class="col-md-2 offset-10">
|
||||
<label for=""><b>BILL TOTAL :</b></label>
|
||||
<div class="input-group">
|
||||
<input id="bill_total" class="form-control" name="sundry_subtotal[]" type="number"readonly>
|
||||
<span class="input-group-addon">{{ __('point_of_sale.ugx') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-5">
|
||||
<div class="col-md-12">
|
||||
<input type="button" id="delete_row_button" class="btn btn-success btn-rounded pull-right" value="Confirm Selection" />
|
||||
<button class="btn btn-success btn-rounded pull-right" style="display: none;" id="approve_sale">{{ __('point_of_sale.approve_and_print_order') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="patient_id" value="{{ $patient_id }}" />
|
||||
<input type="hidden" name="episode_id" value="{{ $episode_id }}" />
|
||||
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<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">
|
||||
|
||||
$('.tap_div_to_calculate_bill_total').click(function() {
|
||||
//e.preventDefault();
|
||||
let sundry_grand_total = $('#pre_grand_sundry_total').val();
|
||||
let eye_glass_grand_total = $('#pre_eye_glasses_grand_total').val();
|
||||
let treatment_grand_total = $('#grand_total_column').val();
|
||||
let service_grand_total = $('#service_grand_total').val();
|
||||
|
||||
let grand_total = parseInt((isNaN(sundry_grand_total) || sundry_grand_total == "") ? 0 :sundry_grand_total) +
|
||||
parseInt((isNaN(eye_glass_grand_total) || eye_glass_grand_total == "") ? 0 :eye_glass_grand_total) +
|
||||
parseInt((isNaN(treatment_grand_total) || treatment_grand_total == "") ? 0 :treatment_grand_total) +
|
||||
parseInt((isNaN(service_grand_total) || service_grand_total == "") ? 0 :service_grand_total);
|
||||
|
||||
$('#bill_total').val(grand_total);
|
||||
});
|
||||
|
||||
$("#delete_row_button").click(function (e) {
|
||||
|
||||
var atleast_one_drug_selected = $('input:checkbox').is(':checked'); // Atleast one checkbox selected
|
||||
|
||||
if (atleast_one_drug_selected) {
|
||||
|
||||
// begin checking to ensure there is enough quantity dispensed
|
||||
let drug_id = $("input[name='drug_id[]']" ).map(function(){
|
||||
return this.value;
|
||||
}).get();
|
||||
|
||||
let quantity_dispensed = $("input[name='treatment_quantity[]']" ).map(function(){
|
||||
return this.value;
|
||||
}).get();
|
||||
|
||||
if(drug_id.length > 0){
|
||||
$.ajax({
|
||||
url: '/check_dispensed_drugs_quantity',
|
||||
data: {'drug_id_array[]':drug_id, 'quantity_dispensed_array[]':quantity_dispensed},
|
||||
success: function(response){
|
||||
if (response[0] === "1") {
|
||||
alert(response[1]);
|
||||
return false;
|
||||
} else {
|
||||
$(".to_remove").remove();
|
||||
$(".prescription-check").attr("disabled", "disabled");
|
||||
|
||||
$('#approve_sale').show();
|
||||
$('#delete_row_button').hide();
|
||||
/*loop thru the prescription_check row and is checked and get the auto_price*/
|
||||
/********************************************/
|
||||
var auto_price_grand_total = 0;
|
||||
$("[id^=auto_prescription_price]").each(function(){
|
||||
var unit_price = $(this).val();
|
||||
var auto_price = isNaN(unit_price) ? 0 : unit_price;
|
||||
var auto_price_integer = parseInt(auto_price);
|
||||
auto_price_grand_total += auto_price_integer;
|
||||
});
|
||||
$("#grand_total_column").val(auto_price_grand_total);
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$('#approve_sale').show();
|
||||
$('#delete_row_button').hide();
|
||||
}
|
||||
} else {
|
||||
e.preventDefault();
|
||||
alert("Please Be Sure To Select Atleast One Item.");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$("[id^='manual_dose'],[id^='manual_frequency'],[id^='duration'], [id^='manual_quantity_dispensed']").on("change keyup", function () {
|
||||
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
|
||||
|
||||
var pack = parseFloat($("#pack" + id).val());
|
||||
var strength = parseFloat($("#strength" + id).val()) || 0;
|
||||
|
||||
var dose1 = parseFloat($("#manual_dose" + id).val()) || 0;
|
||||
|
||||
var equiv1 = dose1 / strength;
|
||||
|
||||
var manual_qty_dispensed = $("#manual_quantity_dispensed" + id).val();
|
||||
|
||||
// Adding a prompt dynamically eg 500mg = 2tabs
|
||||
$("#equiv1" + id).text("( " + equiv1 + " " + $("#drug_form" + id).val() + " )");
|
||||
|
||||
var frequency_id = $("#manual_frequency" + id).val() || 0;
|
||||
|
||||
$.ajax({
|
||||
url: '/prescriptions/get_factor/'+frequency_id,
|
||||
data: {},
|
||||
success: function(data){
|
||||
var selling_price = parseInt($("#selling_price" + id).val());
|
||||
$('#price_per_unit_drug' + id).text(selling_price +'.ugx ' +' per '+ $("#drug_form" + id).val())
|
||||
var cost = selling_price * manual_qty_dispensed;
|
||||
if(isNaN(cost)){ cost = 0 }
|
||||
$("#auto_prescription_price" + id).val(cost);
|
||||
},
|
||||
error: function(response){
|
||||
//
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/* on table losing focus */
|
||||
$("#manual_prescription_table").focusout(function(e) {
|
||||
var manual_auto_price_grand_total = 0;
|
||||
$("[id^=auto_prescription_price]").each(function(){
|
||||
var unit_price = $(this).val();
|
||||
var auto_price = isNaN(unit_price) ? 0 : unit_price;
|
||||
var auto_price_integer = parseInt(auto_price);
|
||||
manual_auto_price_grand_total += auto_price_integer;
|
||||
});
|
||||
$("#grand_total_column").val(manual_auto_price_grand_total);
|
||||
});
|
||||
|
||||
$("#instruction_button").click(function () {
|
||||
$(".instruction_td").show();
|
||||
$(this).hide();
|
||||
$("#hide_instruction_button").show();
|
||||
});
|
||||
|
||||
$("#hide_instruction_button").click(function () {
|
||||
$(".instruction_td").hide();
|
||||
$(this).hide();
|
||||
$("#instruction_button").show();
|
||||
});
|
||||
|
||||
/* highlight the checked treatment table row */
|
||||
$('.prescription-check').click(function(e) {
|
||||
if($(this).is(':checked')){
|
||||
$(this).parent().parent().css({'background-color': '#FFFF99'});
|
||||
$('#my_row' + $(this).val()).addClass('color-tr').removeClass('to_remove');
|
||||
} else{
|
||||
$(this).parent().parent().css({'background-color': '#fff'});
|
||||
$('#my_row' + $(this).val()).removeClass('color-tr').addClass('to_remove');
|
||||
}
|
||||
});
|
||||
|
||||
$('.eye_glass_check').click(function(e) {
|
||||
if($(this).is(':checked')){
|
||||
$(this).parent().parent().css({'background-color': '#FFFF99'});
|
||||
$('#eye_glass_row' + $(this).val()).addClass('color-tr').removeClass('eye_glass_remove');
|
||||
} else{
|
||||
$(this).parent().parent().css({'background-color': '#fff'});
|
||||
$('#eye_glass_row' + $(this).val()).removeClass('color-tr').addClass('eye_glass_remove');
|
||||
}
|
||||
});
|
||||
|
||||
$("[id^='dose'],[id^='frequency'],[id^='duration'], [id^='quantity_dispensed']").on("change keyup", function () {
|
||||
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
|
||||
|
||||
var pack = parseFloat($("#pack" + id).val());
|
||||
var strength = parseFloat($("#strength" + id).val()) || 0;
|
||||
|
||||
var dose = parseFloat($("#dose" + id).val()) || 0;
|
||||
|
||||
var equiv1 = dose / strength;
|
||||
|
||||
// Adding a prompt dynamically eg 500mg = 2tabs
|
||||
$("#equiv1" + id).text("( " + equiv1 + " " + $("#drug_form" + id).val() + " )");
|
||||
|
||||
var equiv_total = dose / strength;
|
||||
|
||||
var frequency_id = $("#frequency" + id).val() || 0;
|
||||
var duration_days = parseInt($("#duration" + id).val()) || 0;
|
||||
|
||||
$.ajax({
|
||||
url: '/prescriptions/get_factor/'+frequency_id,
|
||||
data: {},
|
||||
success: function(data){
|
||||
var factor = parseFloat(data);
|
||||
var quantity = parseFloat(equiv_total * factor * duration_days) || 0;
|
||||
var required = quantity / pack;
|
||||
var dispense = Math.ceil(required); // @TODO Roundup this to the nearest whole number
|
||||
|
||||
$("#quantity_dispensed" + id).val(dispense);
|
||||
|
||||
var selling_price = parseInt($("#selling_price" + id).val());
|
||||
var cost = dispense * selling_price;
|
||||
if(isNaN(cost)){ cost = 0 }
|
||||
$("#auto_prescription_price" + id).val(cost);
|
||||
},
|
||||
error: function(response){
|
||||
//
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/* on table losing focus */
|
||||
$("#prescription_table").focusout(function(e) {
|
||||
var auto_price_grand_total = 0;
|
||||
$("[id^=auto_prescription_price]").each(function(){
|
||||
var auto_price = $(this).val();
|
||||
var auto_price_integer = parseInt(auto_price);
|
||||
auto_price_grand_total += auto_price_integer;
|
||||
});
|
||||
|
||||
$("#grand_total_column").val(auto_price_grand_total);
|
||||
|
||||
});
|
||||
|
||||
$("[id^='pre_order_sundry_quantity_']").on("change", function () {
|
||||
let pre_auto_price_grand_total = 0;
|
||||
|
||||
|
||||
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
|
||||
var quantity = parseFloat($("#pre_order_sundry_quantity_" + id).val());
|
||||
var cost = parseFloat($("#pre_order_sundry_cost_" + id).val()) || 0;
|
||||
var total_cost = quantity * cost;
|
||||
$("#pre_order_sundry_cost_sum_" + id).val(total_cost);
|
||||
|
||||
$("[id^=pre_order_sundry_cost_sum_]").each(function(){
|
||||
var auto_price = $(this).val();
|
||||
// if (auto_price.slice(-3) == 'UGx') {
|
||||
var without_ugx = auto_price;
|
||||
var auto_price_integer = parseInt(without_ugx);
|
||||
pre_auto_price_grand_total += auto_price_integer;
|
||||
// }
|
||||
});
|
||||
$("#pre_grand_sundry_total").val(pre_auto_price_grand_total);
|
||||
});
|
||||
|
||||
//eye glasses
|
||||
$("[id^='order_quantity_']").on("change", function () {
|
||||
let auto_price_grand_total = 0;
|
||||
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
|
||||
|
||||
var quantity = parseFloat($("#order_quantity_" + id).val());
|
||||
var cost = parseFloat($("#order_cost_" + id).val()) || 0;
|
||||
var total_cost = quantity * cost;
|
||||
$("#order_cost_sum_" + id).text(total_cost + " UGx");
|
||||
|
||||
$("[id^=order_cost_sum_]").each(function(){
|
||||
var auto_price = $(this).text();
|
||||
if (auto_price.slice(-3) == 'UGx') { //if the auto_price column is a UGx
|
||||
var without_ugx = auto_price.slice(0,-3); /*remove 'UGx' e.g turn 2300UGx to 2300*/
|
||||
var auto_price_integer = parseInt(without_ugx);
|
||||
auto_price_grand_total += auto_price_integer;
|
||||
}
|
||||
});
|
||||
$("#order_grand_total").text(auto_price_grand_total + " UGx");
|
||||
});
|
||||
|
||||
$("[id^='pre_order_quantity_']").on("change", function () {
|
||||
let pre_auto_price_grand_total = 0;
|
||||
|
||||
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
|
||||
var quantity = parseFloat($("#pre_order_quantity_" + id).val());
|
||||
var cost = parseFloat($("#pre_order_cost_" + id).val()) || 0;
|
||||
var total_cost = quantity * cost;
|
||||
$("#pre_order_cost_sum_" + id).val(total_cost);
|
||||
|
||||
$("[id^=pre_order_cost_sum_]").each(function(){
|
||||
var auto_price = $(this).val();
|
||||
var auto_price_integer = parseInt(auto_price);
|
||||
pre_auto_price_grand_total += auto_price_integer;
|
||||
});
|
||||
$("#pre_eye_glasses_grand_total").val(pre_auto_price_grand_total);
|
||||
});
|
||||
|
||||
$("[id^='pre_order_cost_sum_']").on("change", function () {
|
||||
let pre_auto_price_grand_total = 0;
|
||||
|
||||
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
|
||||
var quantity = parseFloat($("#pre_order_quantity_" + id).val());
|
||||
var cost = this.value;
|
||||
var total_cost = quantity * cost;
|
||||
$("#pre_order_cost_sum_" + id).val(total_cost);
|
||||
$("#eye_glass_amount_"+ id).val(cost);
|
||||
|
||||
$("[id^=pre_order_cost_sum_]").each(function(){
|
||||
var auto_price = $(this).val();
|
||||
var auto_price_integer = parseInt(auto_price);
|
||||
pre_auto_price_grand_total += auto_price_integer;
|
||||
});
|
||||
$("#pre_eye_glasses_grand_total").val(pre_auto_price_grand_total);
|
||||
});
|
||||
|
||||
$("[id^='service_order_quantity_']").on("change", function () {
|
||||
let service_auto_price_grand_total = 0;
|
||||
|
||||
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
|
||||
var quantity = parseFloat($("#service_order_quantity_" + id).val());
|
||||
var cost = parseFloat($("#service_order_cost_" + id).val()) || 0;
|
||||
var total_cost = quantity * cost;
|
||||
$("#service_order_cost_sum_" + id).val(total_cost);
|
||||
|
||||
$("[id^=service_order_cost_sum_]").each(function(){
|
||||
var auto_price = $(this).val();
|
||||
var without_ugx = isNaN(auto_price) ? 0 : auto_price;
|
||||
var auto_price_integer = parseInt(without_ugx);
|
||||
service_auto_price_grand_total += isNaN(auto_price_integer) ? 0 : auto_price_integer;
|
||||
});
|
||||
$("#service_grand_total").val(service_auto_price_grand_total);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+200
@@ -0,0 +1,200 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css"/>
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<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">{{ __('point_of_sale.point_of_sale') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('point_of_sale.home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-shopping-cart"></i> {{ __('point_of_sale.point_of_sale') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
{{ Form::open(['method'=>'post','route' => 'point_of_sale.index']) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label>{{ __('pharmacy.select_date') }}:</label>
|
||||
<select class="form-control compulsory required" name="search_date_by" id="search_date_by" required>
|
||||
<option value="today">{{ __('pharmacy.today') }}</option>
|
||||
<option value="yesterday">{{ __('pharmacy.yesterday') }}</option>
|
||||
<option value="custom_date">{{ __('pharmacy.custom_date') }}</option>
|
||||
<option value="custom_date_range">{{ __('pharmacy.date_range') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2" id="start_date_div" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('start_date', __('pharmacy.date_on')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('start_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'start_date']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2" id="end_date_div" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('end_date', __('pharmacy.end_date')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('end_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'end_date']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group" style="margin-top: 25px;">
|
||||
{{ Form::submit(__('investigations.search'), ['class'=>'btn btn-success pull-right']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
@if(session()->get("print_pos_pdf") == 1)
|
||||
{{ Form::hidden('print_pos_pdf', 1, ['id' => 'print_pos_pdf']) }}
|
||||
@endif
|
||||
|
||||
@include('flash::message')
|
||||
<h4><label class="label label-info">{{ $search_text }}</label></h4>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table table-striped" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('point_of_sale.patient_names') }}</th>
|
||||
<th>{{ __('point_of_sale.items') }}</th>
|
||||
<th>{{ __('point_of_sale.totals') }}</th>
|
||||
<th>{{ __('point_of_sale.record_created_by') }}</th>
|
||||
<th>{{ __('point_of_sale.record_created_on') }}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($records as $record)
|
||||
<tr>
|
||||
<td>{{ $record->first_name . ' ' . $record->last_name }} ({{ $record->number }})</td>
|
||||
<td>
|
||||
<ul>
|
||||
@if(!is_null($record->treatments))
|
||||
<li>{{ __('point_of_sale.treatments') }}</li>
|
||||
@endif
|
||||
|
||||
@if(!is_null($record->eye_glasses))
|
||||
<li>{{ __('point_of_sale.eye_glasses') }}</li>
|
||||
@endif
|
||||
|
||||
@if(!is_null($record->sundries))
|
||||
<li>{{ __('point_of_sale.sundries') }}</li>
|
||||
@endif
|
||||
|
||||
@if(!is_null($record->services))
|
||||
<li>{{ __('point_of_sale.services') }}</li>
|
||||
@endif
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$treatments_array = json_decode($record->treatments, true);
|
||||
$sundries_array = json_decode($record->sundries, true);
|
||||
$eye_glasses_array = json_decode($record->eye_glasses, true);
|
||||
$services_array = json_decode($record->services, true);
|
||||
@endphp
|
||||
|
||||
<ul>
|
||||
@if(!is_null($treatments_array))
|
||||
<li>{{ ugandan_shillings(array_sum($treatments_array["subtotal"])) }}</li>
|
||||
@endif
|
||||
|
||||
@if(!is_null($eye_glasses_array))
|
||||
<li>{{ ugandan_shillings(array_sum($eye_glasses_array["subtotal"])) }}</li>
|
||||
@endif
|
||||
|
||||
@if(!is_null($sundries_array))
|
||||
<li>{{ ugandan_shillings(array_sum($sundries_array["subtotal"])) }}</li>
|
||||
@endif
|
||||
|
||||
@if(!is_null($services_array))
|
||||
<li>{{ ugandan_shillings(array_sum($services_array["subtotal"])) }}</li>
|
||||
@endif
|
||||
</ul>
|
||||
</td>
|
||||
<td>{{ get_full_name($record->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
|
||||
<td>{{ streamline_date_time($record->created_at) }}</td>
|
||||
<td><a href="/point_of_sale/print/{{ $record->id }}" class="btn btn-success btn-sm">{{ __('point_of_sale.print') }}</a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/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>
|
||||
// check if the patient has paid and a pdf print is required
|
||||
if ($('#print_pos_pdf').val() == 1) {
|
||||
var win = window.open('/point_of_sale/print_pos_pdf', '_blank');
|
||||
if (win) {
|
||||
win.focus();
|
||||
} else {
|
||||
alert('Please allow popups for Stre@mline');
|
||||
}
|
||||
}
|
||||
|
||||
$('#search_date_by').change(function() {
|
||||
if($(this).val() === "custom_date"){
|
||||
$("#end_date_div").hide();
|
||||
$("#start_date_div").show();
|
||||
} else if($(this).val() === "custom_date_range") {
|
||||
$("#start_date_div").show();
|
||||
$("#end_date_div").show();
|
||||
} else {
|
||||
$("#end_date_div").hide();
|
||||
$("#start_date_div").hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('#end_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
$('#start_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 100,
|
||||
buttons: ['copy', 'csv', 'excel', 'pdf', 'print']
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+632
@@ -0,0 +1,632 @@
|
||||
@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" />
|
||||
<style>
|
||||
.modal {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 768px) {
|
||||
.modal:before {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
content: " ";
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.modal-dialog {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
width: 500px;
|
||||
}
|
||||
</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">{{ __('point_of_sale.point_of_sale') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('point_of_sale.home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-shopping-cart"></i> {{ __('point_of_sale.point_of_sale') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@include('flash::message')
|
||||
<div class="panel">
|
||||
<div class="panel-body">
|
||||
{{ Form::open(['route'=>'point_of_sale.confirm_items']) }}
|
||||
{{ Form::hidden('patient_id', '', ['class' => 'patient_id', 'id' => 'patient_id']) }}
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12">
|
||||
<h4>Patient / Client</h4>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon bg-info">
|
||||
<input id="new_patient" type="checkbox">
|
||||
</span>
|
||||
<label for="new_patient" type="text" class="form-control" aria-label="Text input with checkbox">{{ __('point_of_sale.new_patient') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon bg-info">
|
||||
<input id="existing_patient" type="checkbox">
|
||||
</span>
|
||||
<label for="existing_patient" type="text" class="form-control" aria-label="Text input with checkbox">{{ __('point_of_sale.existing_patient') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div id="new_patient_div" class="mt-5" style="display: none;">
|
||||
<h4>Patient / Client Information.</h4>
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label for="">First Name</label>
|
||||
<input class="form-control compulsory" id="first_name" name="first_name" placeholder="First Name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label for="">Last Name</label>
|
||||
<input class="form-control compulsory" id="last_name" name="last_name" placeholder="Last Name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
{{ Form::label('gender',__('patients.gender')) }}
|
||||
<br>
|
||||
{{ Form::radio('gender', 1, false) }} {{ __('patients.male') }}
|
||||
{{ Form::radio('gender', 2, false) }} {{ __('patients.female') }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<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']) }}
|
||||
<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','',['class' => 'form-control compulsory','id'=>'age_in_years','min'=>'0']) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group">
|
||||
{{ Form::label('age',__('patients.months')) }}
|
||||
{{ Form::number('age_in_months','',['class' => 'form-control','id'=>'age_in_months','readonly','min'=>'0']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label for="">Phone Number</label>
|
||||
<input class="form-control compulsory" id="phone_number" data-mask="0799 999 999" name="phone_number" placeholder="Phone Number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label for="">Referral Hospital</label>
|
||||
<select class="form-control" id="referral_hospital" name="referral_hospital">
|
||||
<option value="">{{ __('point_of_sale._select') }}</option>
|
||||
@foreach($referral_hospitals as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<a class="pull-right label label-success" style="font-size: x-small; margin-top: 10px; color: white;"
|
||||
data-toggle="modal" data-target="#referralsmodal" >Add New</a>
|
||||
|
||||
<div class="modal fade" id="referralsmodal" 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">Add New Referral</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{ Form::text('referral_name', '', ['class' => 'form-control', 'id' => 'referral_name', 'placeholder' => 'Referral Name']) }}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ __('point_of_sale.cancel') }}</button>
|
||||
<a class="btn btn-primary" onclick="submitReferral()">Save Referral</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="existing_patient_div" class="mt-5" style="display: none;">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<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 class="col-md-6 text-left" id="patient_info" style="display: none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 mt-5">
|
||||
<h4>{{ __('point_of_sale.select_items') }}</h4>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon bg-success">
|
||||
<input id="manual_drugs" type="checkbox">
|
||||
</span>
|
||||
<label for="manual_drugs" type="text" class="label label-success form-control" aria-label="Text input with checkbox">{{ __('point_of_sale.drugs_with_quantity') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon bg-warning">
|
||||
<input id="automatic_drugs" type="checkbox">
|
||||
</span>
|
||||
<label for="automatic_drugs" type="text" class="label label-success form-control" aria-label="Text input with checkbox">{{ __('point_of_sale.drugs_with_prescription') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon bg-primary">
|
||||
<input id="eye_glasses" type="checkbox">
|
||||
</span>
|
||||
<label for="eye_glasses" type="text" class="label label-success form-control" aria-label="Text input with checkbox">{{ __('point_of_sale.eye_glasses') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 ">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon bg-danger">
|
||||
<input id="sundries" type="checkbox">
|
||||
</span>
|
||||
<label for="sundries" type="text" class="label label-success form-control" aria-label="Text input with checkbox">{{ __('point_of_sale.sundries') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3 mt-3">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon bg-info">
|
||||
<input id="services" type="checkbox">
|
||||
</span>
|
||||
<label for="services" type="text" class="label label-success form-control" aria-label="Text input with checkbox">Services</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 mt-3">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon bg-danger">
|
||||
<input id="all" type="checkbox">
|
||||
</span>
|
||||
<label for="all" type="text" class="label label-success form-control" aria-label="Text input with checkbox">{{ __('point_of_sale.all') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="row" >
|
||||
<div class="col-md-12" id="items" style="display: none">
|
||||
<h4> {{ __('point_of_sale.items') }}</h4>
|
||||
<div id="manual_drugs_div" style="display: none;">
|
||||
<h4>{{ __('point_of_sale.drugs') }}</h4>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<input type="hidden" name="manual_drug_select" id="manual_drug_select">
|
||||
<select class="form-control select" id="man_select_drugs" name="selected_drugs[]" multiple="multiple" style="width: 100%;">
|
||||
<option value="">{{ __('point_of_sale._select') }}</option>
|
||||
@foreach($drugs as $drug)
|
||||
<option value="{{ $drug->id }}">{{ $drug->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="automatic_drugs_div" style="display: none;">
|
||||
<h4>Drugs</h4>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<input type="hidden" name="automatic_drug_select" id="automatic_drug_select">
|
||||
<select class="form-control select" id="auto_select_drugs" name="selected_drugs[]" multiple="multiple" style="width: 100%;">
|
||||
<option value="">{{ __('point_of_sale._select') }}</option>
|
||||
@foreach($drugs as $drug)
|
||||
<option value="{{ $drug->id }}">{{ $drug->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="eye_glasses_div" style="display: none;">
|
||||
<h4>{{ __('point_of_sale.eye_glasses') }}</h4>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<select class="form-control select" id="select_eye_glasses" name="selected_eye_glasses[]" multiple="multiple" style="width: 100%;">
|
||||
<option value="">{{ __('point_of_sale._select') }}</option>
|
||||
@foreach($eye_glasses as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="sundries_div" style="display: none;">
|
||||
<h4>{{ __('point_of_sale.sundries') }}</h4>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<select class="form-control select" id="select_sundries" name="selected_sundries[]" multiple="multiple" style="width: 100%;">
|
||||
<option value="">{{ __('point_of_sale.select') }}</option>
|
||||
@foreach($sundries as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="services_div" style="display: none;">
|
||||
<h4>Services</h4>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<select class="form-control select" id="select_services" name="selected_services[]" multiple="multiple" style="width: 100%;">
|
||||
<option value="">{{ __('point_of_sale.select') }}</option>
|
||||
@foreach($services as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
|
||||
<div id="proceed-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<i style="color: red" class="fa fa-3x fa-question-circle"></i> <h4 class="modal-title">Do you wish proceed ?</h4>
|
||||
</div>
|
||||
<div class="modal-footer" style="background-color: lightgrey">
|
||||
<button type="button" class="btn btn-default btn-rounded waves-effect" data-dismiss="modal">{{ __('point_of_sale.close') }}</button>
|
||||
<button class="btn btn-success waves-effect btn-rounded waves-light" >{{ __('point_of_sale.proceed') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::close() }}
|
||||
|
||||
<div class="row" id="confirm_info">
|
||||
<br/>
|
||||
<div class="col-md-12">
|
||||
<button class="btn btn-success btn-rounded pull-right" onclick="confirm_info()">{{ __('point_of_sale.confirm_selection') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<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/mask.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
$('#date_of_birth').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd/mm/yyyy',
|
||||
endDate: new Date()
|
||||
});
|
||||
|
||||
$('#age_in_years').on('change', function () {
|
||||
let years = parseInt($(this).val());
|
||||
let possibleBirthday = new Date();
|
||||
|
||||
if (!isNaN(years)) {
|
||||
possibleBirthday.setMonth(possibleBirthday.getMonth() - (years * 12));
|
||||
$('#date_of_birth').val(format_date(possibleBirthday));
|
||||
} else {
|
||||
alert("<?php echo __('patients.valid_number_years')?>")
|
||||
}
|
||||
});
|
||||
|
||||
$("#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);
|
||||
});
|
||||
|
||||
$('.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_info').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
|
||||
}
|
||||
});
|
||||
|
||||
function confirm_info() {
|
||||
|
||||
var new_patient_checkbox = $('#new_patient:checkbox:checked').length ;
|
||||
var existing_patient_checkbox = $('#existing_patient:checkbox:checked').length;
|
||||
|
||||
var man_drugs = $('#man_select_drugs').val();
|
||||
var auto_drugs = $('#auto_select_drugs').val();
|
||||
var sundries = $('#select_sundries').val();
|
||||
var services = $('#select_services').val();
|
||||
var eye_glasses = $('#select_eye_glasses').val();
|
||||
|
||||
if(new_patient_checkbox != 0 || existing_patient_checkbox != 0){
|
||||
if(auto_drugs != null || man_drugs != null || sundries != null || eye_glasses != null || services != null){
|
||||
|
||||
if ((is_new_patient && $('#first_name').val() != '' && $('#last_name').val() != '') ||
|
||||
(!is_new_patient && +$('#patient_id').val() != NaN)) {
|
||||
$('#confirm_info').hide();
|
||||
$('#proceed-modal').modal('show');
|
||||
} else {
|
||||
alert("Please Be Sure to Enter The Patient's Details Or Select A Patient.");
|
||||
}
|
||||
}else{
|
||||
alert('Please Be Sure to Select An Item.');
|
||||
}
|
||||
}else{
|
||||
alert('Please Be Sure to Select A Patient Or Register A New One.');
|
||||
}
|
||||
}
|
||||
|
||||
$('.sundries').select2({
|
||||
placeholder: "Select sundry"
|
||||
});
|
||||
|
||||
$('.eye_glasses').select2({
|
||||
placeholder: "Select eye glasses"
|
||||
});
|
||||
|
||||
function submitReferral(){
|
||||
var name = $("#referral_name").val();
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/triage/add_referral',
|
||||
data: {'name' : name},
|
||||
success: function(response){
|
||||
if(!isNaN(response)){
|
||||
//response = last inserted id
|
||||
$('#referral_hospital').append($('<option>', {
|
||||
value: response,
|
||||
text: name
|
||||
}));
|
||||
$('#referral_hospital').val(response);//preselect the newly added referral
|
||||
$('#referralsmodal').modal('hide'); //manually hide the modal
|
||||
} else {
|
||||
alert("Adding referral failed");
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
alert(JSON.stringify(jqXHR));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// searchable select on input fields
|
||||
$('.select').select2();
|
||||
|
||||
let is_new_patient = false;
|
||||
|
||||
// get existing patient form.
|
||||
$("#existing_patient").change(function() {
|
||||
if(this.checked) {
|
||||
is_new_patient = false;
|
||||
$('#new_patient_div').hide();
|
||||
$('#existing_patient_div').show();
|
||||
$('#new_patient').prop('checked', false);
|
||||
}
|
||||
});
|
||||
|
||||
// get new patient form.
|
||||
$("#new_patient").change(function() {
|
||||
if(this.checked) {
|
||||
is_new_patient = true;
|
||||
$('#new_patient_div').show();
|
||||
$('#existing_patient_div').hide();
|
||||
$('#existing_patient').prop('checked', false);
|
||||
}
|
||||
});
|
||||
|
||||
// get manual drugs form.
|
||||
$("#manual_drugs").change(function() {
|
||||
if(this.checked) {
|
||||
$('#items').show();
|
||||
$('#manual_drugs_div').show();
|
||||
$('#automatic_drugs_div').hide();
|
||||
$('#eye_glasses_div').hide();
|
||||
$('#sundries_div').hide();
|
||||
$('#services_div').hide();
|
||||
$('#automatic_drugs').prop('checked', false);
|
||||
$('#sundries').prop('checked', false);
|
||||
$('#eye_glasses').prop('checked', false);
|
||||
$('#all').prop('checked', false);
|
||||
$('#manual_drug_select').val(1);
|
||||
$('#automatic_drug_select').val(0);
|
||||
}
|
||||
});
|
||||
|
||||
// get automatic drugs form.
|
||||
$("#automatic_drugs").change(function() {
|
||||
if(this.checked) {
|
||||
$('#items').show();
|
||||
$('#automatic_drugs_div').show();
|
||||
$('#manual_drugs_div').hide();
|
||||
$('#eye_glasses_div').hide();
|
||||
$('#sundries_div').hide();
|
||||
$('#services_div').hide();
|
||||
$('#manual_drugs').prop('checked', false);
|
||||
$('#sundries').prop('checked', false);
|
||||
$('#eye_glasses').prop('checked', false);
|
||||
$('#all').prop('checked', false);
|
||||
$('#manual_drug_select').val(0);
|
||||
$('#automatic_drug_select').val(1);
|
||||
}
|
||||
});
|
||||
|
||||
// get eyeglasses form.
|
||||
$("#eye_glasses").change(function() {
|
||||
if(this.checked) {
|
||||
$('#items').show();
|
||||
$('#eye_glasses_div').show();
|
||||
$('#manual_drugs_div').hide();
|
||||
$('#automatic_drugs_div').hide();
|
||||
$('#drugs_div').hide();
|
||||
$('#sundries_div').hide();
|
||||
$('#services_div').hide();
|
||||
$('#manual_drugs').prop('checked', false);
|
||||
$('#automatic_drugs').prop('checked', false);
|
||||
$('#sundries').prop('checked', false);
|
||||
$('#all').prop('checked', false);
|
||||
$('#drugs').prop('checked', false);
|
||||
}
|
||||
});
|
||||
|
||||
// get sundries form.
|
||||
$("#sundries").change(function() {
|
||||
if(this.checked) {
|
||||
$('#items').show();
|
||||
$('#sundries_div').show();
|
||||
$('#eye_glasses_div').hide();
|
||||
$('#manual_drugs_div').hide();
|
||||
$('#automatic_drugs_div').hide();
|
||||
$('#drugs_div').hide();
|
||||
$('#services_div').hide();
|
||||
$('#manual_drugs').prop('checked', false);
|
||||
$('#automatic_drugs').prop('checked', false);
|
||||
$('#all').prop('checked', false);
|
||||
$('#drugs').prop('checked', false);
|
||||
$('#eye_glasses').prop('checked', false);
|
||||
}
|
||||
});
|
||||
|
||||
// get services form.
|
||||
$("#services").change(function() {
|
||||
if(this.checked) {
|
||||
$('#items').show();
|
||||
$('#services_div').show();
|
||||
$('#sundries_div').hide();
|
||||
$('#eye_glasses_div').hide();
|
||||
$('#manual_drugs_div').hide();
|
||||
$('#automatic_drugs_div').hide();
|
||||
$('#drugs_div').hide();
|
||||
$('#manual_drugs').prop('checked', false);
|
||||
$('#automatic_drugs').prop('checked', false);
|
||||
$('#all').prop('checked', false);
|
||||
$('#drugs').prop('checked', false);
|
||||
$('#eye_glasses').prop('checked', false);
|
||||
}
|
||||
});
|
||||
|
||||
// get all item forms.
|
||||
$("#all").change(function() {
|
||||
if(this.checked) {
|
||||
$('#items').show();
|
||||
$('#eye_glasses_div').show();
|
||||
$('#sundries_div').show();
|
||||
$('#manual_drugs_div').show();
|
||||
$('#services_div').show();
|
||||
$('#automatic_drugs_div').hide();
|
||||
$('#manual_drugs').prop('checked', false);
|
||||
$('#automatic_drugs').prop('checked', false);
|
||||
$('#sundries').prop('checked', false);
|
||||
$('#eye_glasses').prop('checked', false);
|
||||
$('#drugs').prop('checked', false);
|
||||
$('#manual_drug_select').val(1);
|
||||
$('#automatic_drug_select').val(0);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
|
||||
<title>{{ config('app.name', 'Patient Receipt - Stre@mline') }}</title>
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
body{
|
||||
font-size: 0.8em;
|
||||
}
|
||||
/*thead, tfoot { display: table-row-group }*/
|
||||
thead {
|
||||
display: table-header-group;
|
||||
}
|
||||
tfoot {
|
||||
display: table-row-group;
|
||||
}
|
||||
tr {
|
||||
page-break-before: always;
|
||||
page-break-after: always;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container-fluid">
|
||||
@include('layouts.header_pdf_print')
|
||||
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td><b>{{ __('patient_finance.patient_names') }}</b></td>
|
||||
<td>{{ $patient->first_name }} {{ $patient->last_name }}</td>
|
||||
<td><b>{{ __('patient_finance.patient_number') }}</b></td>
|
||||
<td>{{ $patient->number }}</td>
|
||||
<td><b>{{ __('patient_finance.patient_category') }}</b></td>
|
||||
<td>{{ get_name($patient->category_id, "id", "name", "patient_categories") }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<th style="width: 60%"><b>{{ __('point_of_sale.description') }}</b></th>
|
||||
<th style="width: 20%"><b>{{ __('point_of_sale.quantity') }}</b></th>
|
||||
<th style="width: 20%"><b>{{ __('point_of_sale.price') }}</b></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@php $total_to_pay = 0; @endphp
|
||||
|
||||
@if(isset($service_ids_array) && count($service_ids_array) > 0)
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Services ({{ __('patient_finance.pos_order_number') }} #{{ $service_number }})</td>
|
||||
</tr>
|
||||
@for($i = 0; $i < count($service_ids_array); $i++)
|
||||
<tr>
|
||||
<td>{{ get_name($service_ids_array[$i], "id", "name", "services") }}</td>
|
||||
<td>{{ $service_quantity_array[$i] }}</td>
|
||||
<td>{{ ugandan_shillings($service_prices_array[$i]) }}</td>
|
||||
</tr>
|
||||
@php $total_to_pay += $service_prices_array[$i]; @endphp
|
||||
@endfor
|
||||
@endif
|
||||
|
||||
@if(isset($eye_glasses_ids_array) && count($eye_glasses_ids_array) > 0)
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Eye Glasses ({{ __('patient_finance.pos_order_number') }} #{{ $eye_glasses_number }})</td>
|
||||
</tr>
|
||||
@for($i = 0; $i < count($eye_glasses_ids_array); $i++)
|
||||
<tr>
|
||||
<td>{{ get_name($eye_glasses_ids_array[$i], "id", "name", "eye_glasses") }}</td>
|
||||
<td>{{ $eye_glasses_quantity_array[$i] }}</td>
|
||||
<td>{{ ugandan_shillings($eye_glasses_prices_array[$i] * $eye_glasses_quantity_array[$i]) }}</td>
|
||||
</tr>
|
||||
@php $total_to_pay += $eye_glasses_prices_array[$i] * $eye_glasses_quantity_array[$i]; @endphp
|
||||
@endfor
|
||||
@endif
|
||||
|
||||
@if(isset($treatment_item) && count($treatment_item) > 0)
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Treatments ({{ __('patient_finance.pos_order_number') }} #{{ $treatment_number }})</td>
|
||||
</tr>
|
||||
@for($i = 0; $i < count($treatment_item); $i++)
|
||||
<tr>
|
||||
<td>{{ get_name($treatment_item[$i], "id", "name", "drugs") }}</td>
|
||||
<td>{{ $treatment_quantity[$i] }}</td>
|
||||
<td>{{ ugandan_shillings($treatment_subtotal[$i]) }}</td>
|
||||
</tr>
|
||||
@php $total_to_pay += $treatment_subtotal[$i]; @endphp
|
||||
@endfor
|
||||
@endif
|
||||
|
||||
@if(isset($sundry_item) && count($sundry_item) > 0)
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Sundries ({{ __('patient_finance.pos_order_number') }} #{{ $sundry_number }})</td>
|
||||
</tr>
|
||||
@for($i = 0; $i < count($sundry_item); $i++)
|
||||
<tr>
|
||||
<td>{{ get_name($sundry_item[$i], "id", "name", "sundries") }}</td>
|
||||
<td>{{ $sundry_quantity[$i] }}</td>
|
||||
<td>{{ ugandan_shillings($sundry_subtotal[$i]) }}</td>
|
||||
</tr>
|
||||
@php $total_to_pay += $sundry_subtotal[$i]; @endphp
|
||||
@endfor
|
||||
@endif
|
||||
|
||||
<tr>
|
||||
<td colspan="3"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><b>{{ __('point_of_sale.total_to_pay') }}</b></td>
|
||||
<td><b>{{ ugandan_shillings($total_to_pay) }}</b></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<i style="font-size: 0.8em; float: left">© {{ date('Y') }} Stre@mline</i>
|
||||
</div>
|
||||
<div class="col">
|
||||
<i style="float: right">{{ __('patient_finance.printed_on') }} {{ date(" d M Y h:ia") }} {{ __('patient_finance.by') }} {{ auth()->user()->first_name }} {{ auth()->user()->last_name }}</i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+191
@@ -0,0 +1,191 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
|
||||
<style type="text/css">
|
||||
#divToPrint{
|
||||
font-size: 13px;
|
||||
color: #7c7c7c;
|
||||
}
|
||||
|
||||
#receipt_table{
|
||||
font-size: 1em;
|
||||
font-weight: normal;
|
||||
font-family: monospace
|
||||
}
|
||||
|
||||
#receipt_table th{
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
#receipt_table td{
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
.receipt-label{
|
||||
margin-top: 10px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.receipt-title{
|
||||
font-weight: bolder;
|
||||
text-decoration: underline;
|
||||
display: block; font-family:
|
||||
monospace
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row bg-title">
|
||||
<div class="col-md-7">
|
||||
<h4>{{ __('point_of_sale.patient_order_request') }}</h4>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('point_of_sale.point_of_sale') }}</a></li>
|
||||
<li class="active">{{ __('point_of_sale.point_of_sale') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
<div class="row" style="float:right;"><button class="btn btn-success glyphicon glyphicon-print" onclick="print_receipt()"> {{ __('point_of_sale.print') }}</button></div>
|
||||
<div class="row" id="divToPrint">
|
||||
<div class="col-sm-3"></div>
|
||||
<div class="col-sm-6" style="text-align: center;">
|
||||
<p style="text-align: center; font-size: 1em">
|
||||
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace"><b>{{ $hospital_information->name }}</b></span>
|
||||
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace">{{ $hospital_information->address }}</span>
|
||||
<span class="receipt-label"><b>{{ __('patient_finance.tel') }}:</b> {{ $hospital_information->phone_number }}</span><br>
|
||||
<span class="receipt-label"><b>{{ __('patient_finance.email') }}:</b> {{ $hospital_information->email }}</span><br>
|
||||
<span class="receipt-label"><b>{{ __('patient_finance.printed_by') }}:</b> {{ get_full_name($first_printed_by, 'id', 'first_name', 'last_name', 'users') }}</span><br>
|
||||
<span class="receipt-label"><b>{{ __('patient_finance.original_print_date') }}:</b> {{ streamline_date_time_short($receipt_date) }}</span><br>
|
||||
<span class="receipt-label"><b>{{ __('patient_finance.reprint_date') }}:</b> {{ streamline_date_time_short(date('Y-m-d H:i:s')) }}</span><br>
|
||||
<span class="receipt-label"><b>{{ __('patient_finance.patient_name') }}</b> : {{ $patient->first_name }} {{ $patient->last_name }}</span><br>
|
||||
<span class="receipt-label"><b>{{ __('patient_finance.patient_number') }}</b> : {{ $patient->number }} </span><br>
|
||||
<span class="receipt-label"><b>{{ __('patient_finance.patient_category') }} :</b> {{ get_name($patient->category_id, "id", "name", "patient_categories") }}</span>
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<table class="table" id="receipt_table">
|
||||
<thead>
|
||||
<th style="width: 60%"><b>{{ __('point_of_sale.description') }}</b></th>
|
||||
<th style="width: 20%"><b>{{ __('point_of_sale.quantity') }}</b></th>
|
||||
<th style="width: 20%"><b>{{ __('point_of_sale.price') }}</b></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@php $total_to_pay = 0; @endphp
|
||||
|
||||
@if(isset($service_ids_array) && count($service_ids_array) > 0)
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Services ({{ __('patient_finance.pos_order_number') }} #{{ $service_number }})</td>
|
||||
</tr>
|
||||
@for($i = 0; $i < count($service_ids_array); $i++)
|
||||
<tr>
|
||||
<td>{{ get_name($service_ids_array[$i], "id", "name", "services") }}</td>
|
||||
<td>{{ $service_quantity_array[$i] }}</td>
|
||||
<td>{{ ugandan_shillings($service_prices_array[$i]) }}</td>
|
||||
</tr>
|
||||
@php $total_to_pay += $service_prices_array[$i]; @endphp
|
||||
@endfor
|
||||
@endif
|
||||
|
||||
@if(isset($eye_glasses_ids_array) && count($eye_glasses_ids_array) > 0)
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Eye Glasses ({{ __('patient_finance.pos_order_number') }} #{{ $eye_glasses_number }})</td>
|
||||
</tr>
|
||||
@for($i = 0; $i < count($eye_glasses_ids_array); $i++)
|
||||
<tr>
|
||||
<td>{{ get_name($eye_glasses_ids_array[$i], "id", "name", "eye_glasses") }}</td>
|
||||
<td>{{ $eye_glasses_quantity_array[$i] }}</td>
|
||||
<td>{{ ugandan_shillings($eye_glasses_prices_array[$i] ) }}</td>
|
||||
</tr>
|
||||
@php $total_to_pay += $eye_glasses_prices_array[$i]; @endphp
|
||||
@endfor
|
||||
@endif
|
||||
|
||||
@if(isset($treatment_item) && count($treatment_item) > 0)
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Treatments ({{ __('patient_finance.pos_order_number') }} #{{ $treatment_number }})</td>
|
||||
</tr>
|
||||
@for($i = 0; $i < count($treatment_item); $i++)
|
||||
<tr>
|
||||
<td>{{ get_name($treatment_item[$i], "id", "name", "drugs") }}</td>
|
||||
<td>{{ $treatment_quantity[$i] }}</td>
|
||||
<td>{{ ugandan_shillings($treatment_subtotal[$i]) }}</td>
|
||||
</tr>
|
||||
@php $total_to_pay += $treatment_subtotal[$i]; @endphp
|
||||
@endfor
|
||||
@endif
|
||||
|
||||
@if(isset($sundry_item) && count($sundry_item) > 0)
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Sundries ({{ __('patient_finance.pos_order_number') }} #{{ $sundry_number }})</td>
|
||||
</tr>
|
||||
@for($i = 0; $i < count($sundry_item); $i++)
|
||||
<tr>
|
||||
<td>{{ get_name($sundry_item[$i], "id", "name", "sundries") }}</td>
|
||||
<td>{{ $sundry_quantity[$i] }}</td>
|
||||
<td>{{ ugandan_shillings($sundry_subtotal[$i]) }}</td>
|
||||
</tr>
|
||||
@php $total_to_pay += $sundry_subtotal[$i]; @endphp
|
||||
@endfor
|
||||
@endif
|
||||
|
||||
@if(isset($optic_item) && count($optic_item) > 0)
|
||||
<tr>
|
||||
<td colspan="3" class="text-center"><b>Optical Items</b></td>
|
||||
</tr>
|
||||
@for($i = 0; $i < count($optic_item); $i++)
|
||||
<tr>
|
||||
<td>{{ get_name($optic_item[$i], "id", "name", "eye_glasses") }}</td>
|
||||
<td>{{ $optic_quantity[$i] }}</td>
|
||||
<td>{{ ugandan_shillings($optic_subtotal[$i]) }}</td>
|
||||
@php $total_amount_pay += $optic_subtotal[$i]; @endphp
|
||||
</tr>
|
||||
@endfor
|
||||
@endif
|
||||
|
||||
<tr>
|
||||
<td colspan="3"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><b>{{ __('point_of_sale.total_to_pay') }}</b></td>
|
||||
<td><b>{{ ugandan_shillings($total_to_pay) }}</b></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
</div>
|
||||
<i style="font-size: 0.8em; margin-left: 50%;">{{ __('point_of_sale.streamline') }}</i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('styles')
|
||||
<script type="text/javascript">
|
||||
function print_receipt() {
|
||||
let myDiv = document.getElementById('divToPrint');
|
||||
let newWindow = window.open('', 'SecondWindow', 'toolbar=0,stat=0');
|
||||
|
||||
newWindow.document.write("<html><body " +
|
||||
"class='' " +
|
||||
" onload='window.print()'>" +
|
||||
myDiv.innerHTML +
|
||||
"</body></html>");
|
||||
newWindow.document.close();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
+1150
File diff suppressed because it is too large
Load Diff
+566
@@ -0,0 +1,566 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
||||
|
||||
<style>
|
||||
.triage-grade li {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.same_width {
|
||||
width: 100%;
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
border: 1px solid #00c292;
|
||||
border-radius: 6px;
|
||||
padding: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-6 col-md-7 col-sm-7 col-xs-12">
|
||||
<h4 class="page-title">{{ __('triage.edit_triage') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-6 col-sm-5 col-md-5 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('triage.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('patient_episodes.index') }}">{{ __('triage.patient_home') }}</a></li>
|
||||
<li class="active">{{ __('triage.triage') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('patients::allergies.header')
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<!--Flash messages at the top -->
|
||||
@include('flash::message')
|
||||
<div class="white-box br-5" style="padding-top: 5px;">
|
||||
<h5 class="page-title"><strong>{{ __('triage.triage') }} ({{ $age_group_display }})
|
||||
{{ __('triage.for_episode') }} : <font color="blue">
|
||||
{{ streamline_date(get_name($episode_id, 'id', 'created_at', 'patient_episodes')) }}</font>
|
||||
</strong></h5>
|
||||
<hr>
|
||||
{{ Form::model($triage, ['method' => 'PUT', 'route' => ['triage.update', $triage], 'data-toggle' => 'validator']) }}
|
||||
|
||||
{{ Form::hidden('episode_id', $episode_id) }}
|
||||
|
||||
{{ Form::hidden('patient_id', $patient_id) }}
|
||||
|
||||
@php
|
||||
$alert1 = '<div class="alert alert-warning "> <button type="button" class="close" data-dismiss="alert">×</button>' . __('triage.sick_children_warning') . '</div>';
|
||||
$alert2 = '<div class="alert alert-warning "> <button type="button" class="close" data-dismiss="alert">×</button>' . __('triage.poison_warning') . '</div>';
|
||||
$symptoms_array = [];
|
||||
@endphp
|
||||
|
||||
@php
|
||||
$option_symptoms = '';
|
||||
$option_symptoms_periods = '';
|
||||
$symptom_counter = 1;
|
||||
@endphp
|
||||
@if (!are_symptoms_on_consultation())
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover color-table success-table table-bordered" id="symptom_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">{{ __('triage.symptoms') }} <a data-toggle="modal" data-target="#symptomsmodal" class="label labelRight label-info pull-right">{{ __('triage.add_new') }}</a></th>
|
||||
<th class="text-center">{{ __('triage.duration') }}</th>
|
||||
<th class="text-center">{{ __('triage.prompt') }}</th>
|
||||
<th class="text-center">{{ __('triage.reference_text') }}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class='symptoms_input_fields_wrap'>
|
||||
@php
|
||||
$symptoms_array = explode(",", $triage->symptoms);
|
||||
$symptoms_duration_array = explode(",", $triage->symptom_duration);
|
||||
|
||||
foreach ($symptoms as $key => $value){
|
||||
$option_symptoms .= "<option value='$key'>" . str_replace('"', "", $value) . "</option>";
|
||||
}
|
||||
|
||||
foreach ($symptoms_periods as $key => $value){
|
||||
$option_symptoms_periods .= "<option value='$key'>$value</option>";
|
||||
}
|
||||
@endphp
|
||||
@if(empty($symptoms_array) || count($symptoms_array) != count($symptoms_duration_array))
|
||||
<tr>
|
||||
<td style='width: 20%;'>
|
||||
<select name='symptoms[]' id='symptoms_0' class='form-control col-sm-12 compulsory' onchange='showPrompt(this.value, 0)' required>@php echo $option_symptoms; @endphp</select>
|
||||
</td>
|
||||
<td style='width: 21%'>
|
||||
<div class='row'>
|
||||
<div class='col-sm-3'>
|
||||
<input type='text' style='display: block;' name='duration[]' id='symptoms_duration_0' class='col-sm-12 form-control' required>
|
||||
</div>
|
||||
<div class='col-sm-9'>
|
||||
<select style='display: inline-block;' name='time[]' id='symptoms_time_0' class='col-sm-12 form-control' required>@php echo $option_symptoms_periods; @endphp</select>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td id='symptoms_prompt_0' style='width: 30%'></td>
|
||||
<td id='symptoms_reference_0'></td>
|
||||
<td style='width: 1%;'></td>
|
||||
</tr>
|
||||
@else
|
||||
@for($i = 0; $i < count($symptoms_array); $i++)
|
||||
@php
|
||||
$duration_array = explode(" ", $symptoms_duration_array[$i]);
|
||||
@endphp
|
||||
<tr>
|
||||
<td style="width: 20%;">
|
||||
{{ Form::select('symptoms[]', $symptoms, $symptoms_array[$i], ['id' => 'symptoms_' . $i, 'class' => 'form-control col-sm-12 compulsory initial_symptoms_select', 'onchange' => 'showPrompt(this.value, ' . $i . ')']) }}
|
||||
</td>
|
||||
<td style="width: 21%">
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<input type="text" style="display: block;" name="duration[]" id="duration[]" class="col-sm-12 form-control" value="{{ $duration_array[0] }}">
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<select style="display: inline-block;" name="time[]" id="time[]" class="col-sm-12 form-control">
|
||||
<option value="{{ $duration_array[1] }}" selected>{{ $duration_array[1] }}</option>
|
||||
<option value="<?php echo __('triage.hours') ?>">{{ __('triage.hours') }}</option>
|
||||
<option value="<?php echo __('triage.days') ?>">{{ __('triage.days') }}</option>
|
||||
<option value="<?php echo __('triage.weeks') ?>">{{ __('triage.weeks') }}</option>
|
||||
<option value="<?php echo __('triage.months') ?>">{{ __('triage.months') }}</option>
|
||||
<option value="<?php echo __('triage.years') ?>">{{ __('triage.years') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td id="symptoms_prompt_{{ $i }}" style="width: 30%"></td>
|
||||
<td id="symptoms_reference_{{ $i }}"></td>
|
||||
<td style="width: 1%;"></td>
|
||||
</tr>
|
||||
@endfor
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
<a class="btn btn-success btn-xs" onclick="add_symptom_row()" id="add_row">{{ __('triage.add_row') }}</a>
|
||||
<hr>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (is_tuberculosis_screening_enabled())
|
||||
@include('patients::triage.edit_tb_screening')
|
||||
@endif
|
||||
|
||||
@if (is_hiv_screening_tool_enabled())
|
||||
@include('patients::triage.edit.edit_hiv_screening')
|
||||
@endif
|
||||
|
||||
@if (is_gbv_screening_tool_enabled())
|
||||
@include('patients::triage.edit.edit_gbv_screening')
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover table-striped color-table success-table table-bordered"
|
||||
id="observations_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('triage.observation') }}</th>
|
||||
<th>{{ __('triage.value') }}</th>
|
||||
<th>{{ __('triage.normal_range') }}</th>
|
||||
@if ($age_group == 5)
|
||||
<th>KEWS</th>
|
||||
<th>NEWS</th>
|
||||
@else
|
||||
<th>KEWS</th>
|
||||
@endif
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@include('patients::triage.edit.observations_changed')
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@if (between($years, 16, 50))
|
||||
@include('patients::triage.edit.family_planning_questions')
|
||||
@endif
|
||||
|
||||
@if (between($years, 0, 12))
|
||||
@include('patients::triage.edit.emergency_signs')
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
@if ($age_group == 1 || $age_group == 2)
|
||||
<?php echo $alert2; ?>
|
||||
<?php echo $alert1; ?>
|
||||
@else
|
||||
<?php echo $alert2; ?>
|
||||
@endif
|
||||
|
||||
<br>
|
||||
|
||||
@if (!is_add_attendance_to_consultation_enabled())
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover color-table success-table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2" class="text-center">
|
||||
{{ __('triage.patient_attendance') }}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<font color="#C85F6A" class="text-center">{{ __('triage.re_attendance_or_new') }}</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" name="new_attendance" id="new_attendance" @if(!empty($triage->new_attendance)) checked @endif/> {{ __('triage.new_attendance') }}
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" name="re_attendance" id="re_attendance" @if(!empty($triage->re_attendance)) checked @endif/> {{ __('triage.re_attendance') }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
@if (between($years, 0, 12))
|
||||
@include('patients::triage.edit.priority_signs')
|
||||
@endif
|
||||
|
||||
<div style="background: #F5F5F5; padding: 10px;">
|
||||
<h4 class="text-center">{{ __('triage.triage_grade') }}</h4>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="row text-center">
|
||||
<div class="col-md-4 br">
|
||||
{{ Form::radio('triage_grade', 1, $triage->severe_grade == 1, ['required', 'id' => 'triage_grade_green']) }}
|
||||
<b style="color: #006400; font-weight: 900; font-size: 18;">{{ __('triage.green') }}
|
||||
</b>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
{{ Form::radio('triage_grade', 2, $triage->severe_grade == 2, ['required', 'id' => 'triage_grade_yellow']) }}
|
||||
<b style="color: #FFC40C; font-weight: 900; font-size: 18; ">{{ __('triage.yellow') }}
|
||||
</b>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
{{ Form::radio('triage_grade', 3, $triage->severe_grade == 3, ['required', 'id' => 'triage_grade_red']) }}
|
||||
<b style="color: #FF4500; font-weight: 900; font-size: 18;">{{ __('triage.red') }}</b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4 style="background: #F5F5F5; padding: 10px;">{{ __('triage.referral_clinic_allocation') }}</h4>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('referral_hospital', __('triage.referred_by')) }}
|
||||
{{ Form::select('referral_hospital', $referral_hospitals, $triage->referral, ['class' => 'form-control compulsory', 'required', 'id' => 'referral_hospital']) }}
|
||||
|
||||
<a class="pull-right" style="font-size: x-small" data-toggle="modal"
|
||||
data-target="#referralsmodal">{{ __('triage.add_new') }}</a>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('clinic_allocation', __('triage.clinic_allocation')) }}
|
||||
|
||||
@if (is_numeric(get_name($episode_id, 'id', 'clinic_id', 'patient_episodes')))
|
||||
{{ Form::select('clinic_allocation', $clinics, get_name($episode_id, 'id', 'clinic_id', 'patient_episodes'), ['class' => 'form-control col-sm-12 compulsory', 'required']) }}
|
||||
@else
|
||||
{{ Form::select('clinic_allocation', $clinics, '', ['class' => 'form-control col-sm-12 compulsory', 'required']) }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<h4 style="background: #F5F5F5; padding: 10px;">{{ __('triage.comment') }}</h4>
|
||||
<textarea name='comment' id="comment" class="col-sm-12" placeholder="<?php echo __('triage.type_comments_here'); ?>">{{ $triage->comments }}</textarea>
|
||||
|
||||
<br><br>
|
||||
|
||||
{{ Form::button(__('triage.submit_triage'), ['type' => 'submit', 'class' => 'btn btn-success col-sm-12', 'id' => 'submit_triage']) }}
|
||||
<br><br>
|
||||
{{ __('triage.triage_done_by') }} : <span
|
||||
style="color: green; font-weight: bold;">{{ ucwords(Auth::user()->first_name) . ' ' . ucwords(Auth::user()->last_name) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="symptomsmodal" 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">{{ __('triage.add_new_symptom') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{ Form::text('symptom_name', '', ['class' => 'form-control', 'id' => 'symptom_name', 'placeholder' => __('triage.symptom_name')]) }}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default"
|
||||
data-dismiss="modal">{{ __('triage.cancel') }}</button>
|
||||
<a class="btn btn-success" onclick="submitSymptom()">{{ __('triage.add_symptom') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="referralsmodal" 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">{{ __('triage.add_new_referral') }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{ Form::text('referral_name', '', ['class' => 'form-control', 'id' => 'referral_name', 'placeholder' => __('triage.referral_name')]) }}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default"
|
||||
data-dismiss="modal">{{ __('triage.cancel') }}</button>
|
||||
<a class="btn btn-primary" onclick="submitReferral()">{{ __('triage.add_referral') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
let max_rows = 20;
|
||||
let wrapper = $(".symptoms_input_fields_wrap");
|
||||
let x = {{ !empty($symptoms_array)? count($symptoms_array):1 }};
|
||||
let smart_triage_variables = {};
|
||||
// check if smart triage is enabled
|
||||
let smart_triage_enabled = <?php echo is_smart_triage_enabled() ? 1 : 0; ?>;
|
||||
let apply_triage_grade = <?php echo apply_triage_grade() ? 1 : 0; ?>;
|
||||
|
||||
$(wrapper).on("click", ".remove_field", function(e) {
|
||||
e.preventDefault();
|
||||
$(this).parent('td').parent('tr').remove();
|
||||
x--;
|
||||
});
|
||||
|
||||
function add_symptom_row() {
|
||||
if (x < max_rows) {
|
||||
$(wrapper).append("<tr>\
|
||||
<td style='width: 20%;'>\
|
||||
<select name='symptoms[]' id='symptoms_" + x + "' class='form-control col-sm-12 compulsory' onchange='showPrompt(this.value, " + x + ")' required>@php echo $option_symptoms; @endphp</select>\
|
||||
</td>\
|
||||
<td style='width: 21%'>\
|
||||
<div class='row'>\
|
||||
<div class='col-sm-3'>\
|
||||
<input type='text' style='display: block;' name='duration[]' id='symptoms_duration_" + x + "' class='col-sm-12 form-control' required>\
|
||||
</div>\
|
||||
<div class='col-sm-9'>\
|
||||
<select style='display: inline-block;' name='time[]' id='symptoms_time_" + x + "' class='col-sm-12 form-control' required>@php echo $option_symptoms_periods; @endphp</select>\
|
||||
</div>\
|
||||
</div>\
|
||||
</td>\
|
||||
<td id='symptoms_prompt_" + x + "' style='width: 30%'></td>\
|
||||
<td id='symptoms_reference_" + x + "'></td>\
|
||||
<td style='width: 1%;'><a class='remove_field btn btn-sm btn-rounded btn-danger' style='color: white;'><i class='fa fa-trash'></i></a></td>\
|
||||
</tr>");
|
||||
|
||||
generalSelect2Set('symptoms_' + x);
|
||||
$("#symptoms_" + x).load('/symptoms/get_symptoms');
|
||||
x++;
|
||||
}
|
||||
}
|
||||
|
||||
function generalSelect2Set(id) {
|
||||
$('#' + id).select2({
|
||||
width: "100%"
|
||||
});
|
||||
}
|
||||
|
||||
function showPrompt(symptom_id, id) {
|
||||
|
||||
if (symptom_id == "") {
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/triage/get_prompt',
|
||||
data: {
|
||||
'symptom_id': symptom_id
|
||||
},
|
||||
success: function(response) {
|
||||
let returnText = response.split('&&&&');
|
||||
|
||||
$('#symptoms_prompt_' + id).html('<p style="color: #C85F6A;">' + returnText[0] + '</p>');
|
||||
$('#symptoms_reference_' + id).html(returnText[1]);
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
alert(JSON.stringify(jqXHR));
|
||||
console.log(JSON.stringify(jqXHR));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function submitSymptom() {
|
||||
var symptom_name = $("#symptom_name").val();
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/triage/add_symptom',
|
||||
data: {
|
||||
'symptom_name': symptom_name
|
||||
},
|
||||
success: function(response) {
|
||||
if (response == 1) {
|
||||
//reload all dropdowns
|
||||
$(".1000").load('/symptoms/get_symptoms');
|
||||
alert(symptom_name + ' symptom has been added.');
|
||||
$('#symptomsmodal').modal('hide');
|
||||
} else {
|
||||
alert("<?php echo __('triage.adding_symptom_failed'); ?>");
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
alert(JSON.stringify(jqXHR));
|
||||
console.log(JSON.stringify(jqXHR));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function submitReferral() {
|
||||
var name = $("#referral_name").val();
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/triage/add_referral',
|
||||
data: {
|
||||
'name': name
|
||||
},
|
||||
success: function(response) {
|
||||
if (!isNaN(response)) {
|
||||
//response = last inserted id
|
||||
$('#referral_hospital').append($('<option>', {
|
||||
value: response,
|
||||
text: name
|
||||
}));
|
||||
$('#referral_hospital').val(response); //preselect the newly added referral
|
||||
$('#referralsmodal').modal('hide'); //manually hide the modal
|
||||
} else {
|
||||
alert("<?php echo __('triage.adding_referral_failed'); ?>");
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
alert(JSON.stringify(jqXHR));
|
||||
console.log(JSON.stringify(jqXHR));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('.initial_symptoms_select').select2({
|
||||
width: "100%"
|
||||
});
|
||||
|
||||
$('.select-2').select2({
|
||||
width: "100%"
|
||||
});
|
||||
|
||||
var cons_attendance = <?php echo is_add_attendance_to_consultation_enabled() ? 1 : 0 ?>;
|
||||
|
||||
$("#submit_triage").click(function(e) { // make sure that all compulsory fields have been filled out
|
||||
var empty_compulsory_fields = [];
|
||||
$(".compulsory").each(function() {
|
||||
if ($(this).val() == "") {
|
||||
var textname = $(this).attr('name');
|
||||
$(this).focus();
|
||||
empty_compulsory_fields.push(textname);
|
||||
$(this).css('border', '1px solid #F08080');
|
||||
}
|
||||
});
|
||||
|
||||
if(cons_attendance == 0 && !$('#new_attendance').is(':checked') && !$('#re_attendance').is(':checked')){
|
||||
alert('Please fill in Patient attendance.');
|
||||
e.preventDefault();
|
||||
return false;
|
||||
$('#new_attendance, #re_attendance').css('border','1px solid #F08080');
|
||||
}
|
||||
/* check if the array containing empty compulsory fields is not empty then return false */
|
||||
if (empty_compulsory_fields.length != 0) {
|
||||
alert("<?php echo __('triage.compulsory_fields_warning'); ?>");
|
||||
console.log(empty_compulsory_fields);
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('#new_attendance').click(function() {
|
||||
$('#re_attendance').not('#new_attendance').removeAttr('checked');
|
||||
});
|
||||
|
||||
$('#re_attendance').click(function() {
|
||||
$('#new_attendance').not('#re_attendance').removeAttr('checked');
|
||||
});
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#child_feeling_unsafe_section").hide();
|
||||
$("#tested_for_hiv_last_3_months_section").hide();
|
||||
$(".hiv_positive_section").hide();
|
||||
});
|
||||
|
||||
function hide_tested_for_hiv_last_3_months_questions() {
|
||||
$("#tested_for_hiv_last_3_months_section").hide();
|
||||
}
|
||||
|
||||
function show_tested_for_hiv_last_3_months_questions() {
|
||||
$("#tested_for_hiv_last_3_months_section").show();
|
||||
}
|
||||
|
||||
function show_feeling_unsafe_questions() {
|
||||
$('#child_feeling_unsafe_section').show();
|
||||
}
|
||||
|
||||
function hide_feeling_unsafe_questions() {
|
||||
$('#child_feeling_unsafe_section').hide();
|
||||
}
|
||||
|
||||
function show_hiv_positive_questions() {
|
||||
$(".hiv_positive_section").show();
|
||||
}
|
||||
|
||||
function hide_hiv_positive_questions() {
|
||||
$(".hiv_positive_section").hide();
|
||||
}
|
||||
|
||||
// below 15
|
||||
|
||||
$('input[type=radio][name=mother_hiv_positive]').change(function() {
|
||||
if (this.value == '1') {
|
||||
$('.child-hiv-status').removeClass('d-none').css('display', '');
|
||||
$('.child-hiv-status-questions').removeClass('d-none').css('display', '');
|
||||
} else if (this.value == '0') {
|
||||
$('.child-hiv-status').addClass('d-none').css('display', 'none');
|
||||
$('.child-hiv-status-questions').addClass('d-none').css('display', 'none');
|
||||
$('.child-hiv-status-questions input[type=radio]').each(function() {
|
||||
this.value('');
|
||||
})
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
Reference in New Issue
Block a user