mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-13 11:41:31 +00:00
resolved conflicts
This commit is contained in:
+415
@@ -0,0 +1,415 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Patients\Http\Controllers;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Streamline\Http\Controllers\SMSController;
|
||||
use Streamline\Models\Clinic;
|
||||
use Streamline\Models\PatientAppointment;
|
||||
use Streamline\Models\PatientEpisode;
|
||||
use Streamline\Models\User;
|
||||
|
||||
class PatientAppointmentsController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function follow_up()
|
||||
{
|
||||
$follow_ups = PatientAppointment::where('is_confirmed', 1)->get();
|
||||
|
||||
$calender_dates = [];
|
||||
$count = 0;
|
||||
|
||||
foreach ($follow_ups as $follow_up) {
|
||||
$patient_name = get_full_name($follow_up->patient_id, 'id', 'first_name', 'last_name', 'patients');
|
||||
$calender_dates[$count] = ["title" => $patient_name, "start" => $follow_up->appointment_date . "T" . $follow_up->appointment_time];
|
||||
$count++;
|
||||
}
|
||||
|
||||
$clinics = Clinic::orderBy('name')->pluck("name", "id")->toArray();
|
||||
$clinics = ['0' => 'All Clinics'] + $clinics;
|
||||
|
||||
$users = User::orderBy('first_name')->select("id", "first_name", "last_name")->get();
|
||||
|
||||
$users_array = [];
|
||||
$users_collection = DB::table('users')->orderBy("first_name", "asc")->select("id")->get()->toArray();
|
||||
foreach ($users_collection as $value) {
|
||||
$user = User::find($value->id);
|
||||
if (!is_null($user)) {
|
||||
if ($user->hasRole('Doctors') || $user->hasRole('Doctor')) {
|
||||
//use this join query instead of the commented out query to cater for execution speed (N+1)
|
||||
$consultation_records = DB::table('services')
|
||||
->join('staff_payment_configurations', 'staff_payment_configurations.item_id', '=', 'services.id')
|
||||
->where('services.item_type', 'Consultation')
|
||||
->where('staff_payment_configurations.user_id', $value->id)
|
||||
->where('staff_payment_configurations.item_category', 3)
|
||||
->orderBy('staff_payment_configurations.created_at', 'asc')
|
||||
->select('services.*')
|
||||
->get();
|
||||
|
||||
foreach ($consultation_records as $record) {
|
||||
$users_consultation_fee = $record->non_insured_price;
|
||||
//concatnate the service_record_id with the users id to form the key for the array
|
||||
$users_array[$record->id . "__" . $value->id] = get_full_name($value->id, 'id', 'first_name', 'last_name', 'users') . " (Consultation Fee: " . ugandan_shillings($users_consultation_fee) . ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$users_array = ['' => '- select -'] + $users_array;
|
||||
$special_clinics = DB::table('clinics')->where('available', 1)->whereNull('deleted_at')->orderBy('name', 'asc')->pluck("name", "id")->prepend('- select -', '');
|
||||
|
||||
return view('patients::patients.follow_up', compact('calender_dates', 'clinics', 'users', 'users_array', 'special_clinics'));
|
||||
}
|
||||
|
||||
public function follow_up_fetch_patients(Request $request)
|
||||
{
|
||||
$selected_date = $request->selected_date;
|
||||
|
||||
if ($request->user_id != 0) {
|
||||
$follow_ups = PatientAppointment::where(['appointment_date' => $selected_date])->where(['incharge_id' => $request->user_id])->get();
|
||||
} else {
|
||||
$follow_ups = PatientAppointment::where(['appointment_date' => $selected_date])->get();
|
||||
}
|
||||
|
||||
$code = "";
|
||||
|
||||
if ($follow_ups->count() > 0) {
|
||||
foreach ($follow_ups as $follow_up) {
|
||||
|
||||
if ($request->clinic_id != -1) {
|
||||
if ($follow_up->clinic_allocation != $request->clinic_id) {
|
||||
// skip current loop
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$code .= "<tr>";
|
||||
$code .= "<td>";
|
||||
$code .= get_full_name($follow_up->patient_id, 'id', 'first_name', 'last_name', 'patients') . " (" . get_name($follow_up->patient_id, 'id', 'number', 'patients') . ")";
|
||||
$code .= "</td>";
|
||||
$code .= "<td>";
|
||||
$code .= ($follow_up->clinic_allocation == 0) ? "No clinic specified" : get_name($follow_up->clinic_allocation, 'id', 'name', 'clinics');
|
||||
$code .= "</td>";
|
||||
$code .= "<td>";
|
||||
$code .= ($follow_up->incharge_id == 0) ? "No incharge specified" : get_full_name($follow_up->incharge_id, 'id', 'first_name', 'last_name', 'users');
|
||||
$code .= "</td>";
|
||||
$code .= "<td>";
|
||||
$code .= $follow_up->appointment_time;
|
||||
$code .= "</td>";
|
||||
$code .= "<td>";
|
||||
$code .= "Phone Number: " . get_name($follow_up->patient_id, 'id', 'phone', 'patients') . " Email: " . get_name($follow_up->patient_id, 'id', 'email', 'patients');
|
||||
$code .= "</td>";
|
||||
$code .= "<td>";
|
||||
$code .= is_null($follow_up->comments) ? 'N/A' : $follow_up->comments;
|
||||
$code .= "</td>";
|
||||
$code .= "<td>";
|
||||
if ($follow_up->appointment_fulfilled == 1) {
|
||||
$code .= "<label class='label label-success'>Appointment Completed</label>";
|
||||
} else if ($follow_up->appointment_fulfilled == 2) {
|
||||
$code .= "<label class='label label-danger'>Appointment Cancelled</label>";
|
||||
} else {
|
||||
$code .= "<a class='btn btn-success btn-rounded' onclick='displayAppointmentActions(" . $follow_up->patient_id . "," . $follow_up->id . ")'>Actions</a>";
|
||||
}
|
||||
$code .= "</td>";
|
||||
$code .= "</tr>";
|
||||
}
|
||||
} else {
|
||||
$code .= "<tr><td colspan='8'><h4 class='text-center'>No patient appointments available for this date</h4></td></tr>";
|
||||
}
|
||||
|
||||
// check if the code is empty for when clinics selected are not available
|
||||
if ($code == '') {
|
||||
$code .= "<tr><td colspan='8'><h4 class='text-center'>No patient appointments available for this date</h4></td></tr>";
|
||||
}
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
public function create_appointment()
|
||||
{
|
||||
$clinics = Clinic::orderBy('name')->pluck("name", "id")->toArray();
|
||||
$clinics = ['0' => "Don't assign clinic"] + $clinics;
|
||||
|
||||
$users = User::orderBy('first_name')->select("id", "first_name", "last_name")->get();
|
||||
|
||||
return view('patients::patients.create_appointment', compact('clinics', 'users'));
|
||||
}
|
||||
|
||||
public function save_appointment(Request $request)
|
||||
{
|
||||
$appointment = new PatientAppointment();
|
||||
|
||||
if (is_null($request->in_charge)) {
|
||||
$in_charge = 0;
|
||||
} else {
|
||||
$in_charge = $request->in_charge;
|
||||
}
|
||||
|
||||
if (is_null($request->clinic_allocation)) {
|
||||
$clinic_allocation = 0;
|
||||
} else {
|
||||
$clinic_allocation = $request->clinic_allocation;
|
||||
}
|
||||
|
||||
$appointment->patient_id = $request->patient_id;
|
||||
$appointment->incharge_id = $in_charge;
|
||||
$appointment->clinic_allocation = $clinic_allocation;
|
||||
$appointment->episode_id = 0;
|
||||
$appointment->appointment_date = Carbon::parse($request->appointment_date)->format('Y-m-d');
|
||||
$appointment->appointment_time = $request->appointment_time;
|
||||
$appointment->comments = $request->comments;
|
||||
$appointment->created_from = "Patient Appointments";
|
||||
$appointment->created_by = Auth::user()->id;
|
||||
$appointment->updated_by = Auth::user()->id;
|
||||
|
||||
if ($appointment->save()) {
|
||||
flash("Patient appointment has been saved")->success();
|
||||
return redirect("/patients/follow_up");
|
||||
} else {
|
||||
flash("An error occurred!")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
public function complete_appointment($id)
|
||||
{
|
||||
$appointment = PatientAppointment::find($id);
|
||||
|
||||
$patient_id = $appointment->patient_id;
|
||||
|
||||
// reassign the appointment_fulfilled to 1
|
||||
$appointment->appointment_fulfilled = 1;
|
||||
$appointment->updated_by = Auth::user()->id;
|
||||
|
||||
if ($appointment->save()) {
|
||||
$episode = new PatientEpisode;
|
||||
$episode->patient_id = $appointment->patient_id;
|
||||
$episode->parent_episode_id = $appointment->episode_id == 0 ? null : $appointment->episode_id; //the original episode_id
|
||||
$episode->created_by = auth()->user()->id;
|
||||
$episode->updated_by = auth()->user()->id;
|
||||
//put this patient_id into session
|
||||
session()->put('patient_id', $patient_id);
|
||||
|
||||
try {
|
||||
$episode->save();
|
||||
flash("A new episode has been saved")->success();
|
||||
|
||||
//if the parent episode was an ANC visit then create a copy of previous anc registration and attach it to this episode
|
||||
$previous_anc_visit = \Streamline\Models\AnteNatalClinicFollowup::where(['patient_id' => $episode->patient_id, 'episode_id' => $episode->parent_episode_id])->first();
|
||||
if ($previous_anc_visit) {
|
||||
create_anc_registration_record_from_previous_visit($patient_id, $episode->parent_episode_id, $episode->id);
|
||||
//allocate to ANC clinic straight away
|
||||
$anc_clinic_id = get_name('ante_natal', 'slug', 'id', 'clinics');
|
||||
$episode->clinic_id = $anc_clinic_id;
|
||||
$episode->update();
|
||||
}
|
||||
|
||||
// check where the function was called from and return there
|
||||
if (isset($request->is_from_finance)) {
|
||||
// return to finance home
|
||||
return redirect('/patient_finance/home');
|
||||
} else {
|
||||
// return to normal patient home
|
||||
return redirect('/patient_episodes/');
|
||||
}
|
||||
} catch (QueryException $e) {
|
||||
flash("An error occurred")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
} else {
|
||||
flash("An error occurred!")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
public function cancel_patient_appointment($id)
|
||||
{
|
||||
$appointment = PatientAppointment::find($id);
|
||||
|
||||
// reassign the appointment_fulfilled to 2, indicating cancelled
|
||||
$appointment->appointment_fulfilled = 2;
|
||||
$appointment->updated_by = Auth::user()->id;
|
||||
|
||||
if ($appointment->save()) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public function reschedule_appointment($id)
|
||||
{
|
||||
$appointment = PatientAppointment::find($id);
|
||||
$clinics = Clinic::orderBy('name')->pluck("name", "id")->toArray();
|
||||
$clinics = ['0' => "Don't assign clinic"] + $clinics;
|
||||
|
||||
$users = User::orderBy('first_name')->select("id", "first_name", "last_name")->get();
|
||||
|
||||
return view('patients::patients.reschedule_appointment', compact('appointment', 'clinics', 'users'));
|
||||
}
|
||||
|
||||
public function save_rescheduled_appointment(Request $request)
|
||||
{
|
||||
$appointment = PatientAppointment::find($request->appointment_id);
|
||||
|
||||
if (is_null($request->in_charge)) {
|
||||
$in_charge = 0;
|
||||
} else {
|
||||
$in_charge = $request->in_charge;
|
||||
}
|
||||
|
||||
if (is_null($request->clinic_allocation)) {
|
||||
$clinic_allocation = 0;
|
||||
} else {
|
||||
$clinic_allocation = $request->clinic_allocation;
|
||||
}
|
||||
|
||||
$appointment->incharge_id = $in_charge;
|
||||
$appointment->clinic_allocation = $clinic_allocation;
|
||||
$appointment->appointment_date = Carbon::parse($request->appointment_date)->format('Y-m-d');
|
||||
$appointment->appointment_time = $request->appointment_time;
|
||||
$appointment->comments = $request->comments;
|
||||
$appointment->updated_by = Auth::user()->id;
|
||||
|
||||
if ($appointment->save()) {
|
||||
flash("Patient appointment has been rescheduled successfully")->success();
|
||||
return redirect("/patients/follow_up");
|
||||
} else {
|
||||
flash("An error occurred!")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
public function appointment_requests()
|
||||
{
|
||||
$appointments = PatientAppointment::where('is_confirmed', 0)
|
||||
->whereNotIn('appointment_fulfilled', [2])
|
||||
->where('appointment_date', '>', date('Y-m-d'))
|
||||
->get();
|
||||
|
||||
return view('patients::patients.appointment_requests', compact('appointments'));
|
||||
}
|
||||
|
||||
public function confirm_appointment($id)
|
||||
{
|
||||
$appointment = PatientAppointment::find($id);
|
||||
$clinics = Clinic::orderBy('name')->pluck("name", "id")->toArray();
|
||||
$clinics = ['0' => "Don't assign clinic"] + $clinics;
|
||||
|
||||
$users = User::orderBy('first_name')->select("id", "first_name", "last_name")->get();
|
||||
|
||||
return view('patients::patients.confirm_appointment', compact('appointment', 'clinics', 'users'));
|
||||
}
|
||||
|
||||
public function save_confirmed_appointment(Request $request)
|
||||
{
|
||||
$appointment = PatientAppointment::find($request->appointment_id);
|
||||
|
||||
if (is_null($request->in_charge)) {
|
||||
$in_charge = 0;
|
||||
} else {
|
||||
$in_charge = $request->in_charge;
|
||||
}
|
||||
|
||||
if (is_null($request->clinic_allocation)) {
|
||||
$clinic_allocation = 0;
|
||||
} else {
|
||||
$clinic_allocation = $request->clinic_allocation;
|
||||
}
|
||||
|
||||
$appointment->incharge_id = $in_charge;
|
||||
$appointment->clinic_allocation = $clinic_allocation;
|
||||
$appointment->appointment_date = Carbon::parse($request->appointment_date)->format('Y-m-d');
|
||||
$appointment->appointment_time = $request->appointment_time;
|
||||
$appointment->comments = $request->comments;
|
||||
$appointment->is_confirmed = 1;
|
||||
$appointment->updated_by = auth()->id();
|
||||
|
||||
if ($appointment->save()) {
|
||||
if (is_sms_enabled()) {
|
||||
// send sms alert to the patient
|
||||
$sms = "Your appointment at " . get_name(1, 'id', 'name', 'hospital_information') .
|
||||
" has been confirmed for the " . streamline_date($appointment->appointment_date) . " at " . $appointment->appointment_time;
|
||||
|
||||
(new SMSController)->send_appointments_alert($appointment->patient_id, $sms);
|
||||
}
|
||||
|
||||
flash("Patient appointment has been confirmed")->success();
|
||||
return redirect("/patients/appointment_requests");
|
||||
} else {
|
||||
flash("An error occurred!")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
public function patient_appointments_report(Request $request)
|
||||
{
|
||||
$clinic_id = $request->clinic_id;
|
||||
$search_by = $request->search_by;
|
||||
$reg_date = $request->reg_date;
|
||||
$start_date = $request->start_date;
|
||||
$end_date = $request->end_date;
|
||||
//dd($request->all());
|
||||
$clinics = Clinic::where('available', 1)->pluck('name', 'id')->prepend(['' => 'All clinics']);
|
||||
|
||||
$today = Carbon::now()->toDateString();
|
||||
|
||||
$filters = [];
|
||||
$clinic_name = Clinic::where('id', $clinic_id)->pluck('name')->first();
|
||||
|
||||
if ($search_by == 0) {
|
||||
array_push($filters, ['appointment_date', '<', $today]);
|
||||
} elseif ($search_by == 1) {
|
||||
// custom date
|
||||
$start_date_search = Carbon::parse($reg_date)->toDateString();
|
||||
array_push($filters, ['appointment_date', '=', $start_date_search]);
|
||||
} elseif ($search_by == 2) {
|
||||
// custom date range
|
||||
$start_date_search = Carbon::parse($start_date)->toDateString();
|
||||
$end_date_search = Carbon::parse($end_date)->toDateString();
|
||||
|
||||
array_push($filters, ['appointment_date', '>', $start_date_search]);
|
||||
array_push($filters, ['appointment_date', '<', $end_date_search]);
|
||||
} else {
|
||||
array_push($filters, ['appointment_date', '<', $today]);
|
||||
}
|
||||
|
||||
if ($clinic_id == 0 || is_null($clinic_id)) {
|
||||
if ($request->appointment_outcome != 'all') {
|
||||
$patient_appointments = PatientAppointment::where($filters)->where(['appointment_fulfilled' => $request->appointment_outcome])->orderBy('appointment_date', 'desc')->paginate(500);
|
||||
} else {
|
||||
$patient_appointments = PatientAppointment::where($filters)->orderBy('appointment_date', 'desc')->paginate(500);
|
||||
}
|
||||
} else {
|
||||
if ($request->appointment_outcome != 'all') {
|
||||
$patient_appointments = PatientAppointment::where(['clinic_allocation' => $clinic_id])->where(['appointment_fulfilled' => $request->appointment_outcome])->where($filters)->orderBy('appointment_date', 'desc')->paginate(400);
|
||||
} else {
|
||||
$patient_appointments = PatientAppointment::where(['clinic_allocation' => $clinic_id])->where($filters)->orderBy('appointment_date', 'desc')->paginate(400);
|
||||
}
|
||||
}
|
||||
|
||||
return view('patients::patients.appointments_report', compact('clinics', 'patient_appointments'));
|
||||
}
|
||||
|
||||
public function store_appointment_comment(Request $request)
|
||||
{
|
||||
$appointment_id = $request->set_appointment_id;
|
||||
$appointment_comment = $request->appointment_comment;
|
||||
|
||||
$appointment = PatientAppointment::find($appointment_id);
|
||||
$appointment->action_comment = $appointment_comment;
|
||||
$appointment->action_comment_by = Auth::user()->id;
|
||||
|
||||
if ($appointment->save()) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
+351
@@ -0,0 +1,351 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ base_path('public/uploads/streamline/color/streamline_icon-02.png') }}">
|
||||
<title>{{ config('app.name', 'CHI Membership Card - Stre@mline') }}</title>
|
||||
<!-- Bootstrap Core CSS -->
|
||||
{{-- <link href="{{ base_path('public/bootstrap/css/bootstrap.min.css') }}" rel="stylesheet"> --}}
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
|
||||
<style style="text-css">
|
||||
/* body{
|
||||
}
|
||||
|
||||
thead {
|
||||
}
|
||||
|
||||
tfoot {
|
||||
}
|
||||
|
||||
tr {
|
||||
}
|
||||
|
||||
th{
|
||||
font-weight: bolder;
|
||||
font-size: 22px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
td{
|
||||
font-size: 24px;
|
||||
padding-top: 5px;
|
||||
color: #fff;
|
||||
} */
|
||||
|
||||
/* new card */
|
||||
.a8-page {
|
||||
width: 8.5cm; /* A8 width */
|
||||
height: 5.4cm; /* A8 height */
|
||||
/* background-color: #f8f9fa; */
|
||||
margin: auto; /* Center the A8 page within the container */
|
||||
border: 1px solid #dee2e6; /* Light border */
|
||||
border-radius: 5px; /* Rounded corners */
|
||||
padding: 5px; /* Reduced padding to fit content */
|
||||
box-sizing: border-box; /* Include padding and border in element's total width and height */
|
||||
overflow: hidden; Hide overflow
|
||||
font-size: 10px; /* Adjust font size to fit content */
|
||||
}
|
||||
.container {
|
||||
height: 100vh; /* Full viewport height */
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.medical-card-title {
|
||||
font-size: 1.2em;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
margin-bottom: 5px; /* Reduced margin to fit content */
|
||||
}
|
||||
.medical-card-content p {
|
||||
margin: 2px 0; /* Reduced margins to fit content */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
{{-- column --}}
|
||||
<div class="col">
|
||||
<div class="a8-page">
|
||||
<div class="row" style="padding:3px; background-color:#eaeef3;" >
|
||||
<div class="col-12 col-md">
|
||||
<img style="max-width: 100px; max-height: 25px;" src="{{ asset($hospitalInfo->logo) }}" class="" alt="Responsive image">
|
||||
|
||||
</div>
|
||||
<div class="col-12 col-md text-right" style="font-size:9px; margin-top:8px; font-weight:600;">PATIENT CARD</div>
|
||||
</div>
|
||||
<hr style="margin-top:5px;">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-md">
|
||||
<p style="font-size:6px; margin-top:-10px;"> NAME</p>
|
||||
<p style="font-size:9px; margin-top:-15px; font-weight:600;"> AREBAHOONA MBABAZI ANGELLA MBABAZI OTHER NAME</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-md">
|
||||
<p style="font-size:6px; margin-top:-10px;"> PATIENT NUMBER</p>
|
||||
<p style="font-size:9px; margin-top:-15px; font-weight:600;"> SCH-24-01290000</p>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md">
|
||||
<p style="font-size:6px; margin-top:-10px;"> VILLAGE</p>
|
||||
<p style="font-size:9px; margin-top:-15px; font-weight:600;"> NAKAPIRIPIRITI WARD</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-top:-10px;">
|
||||
<div class="col-12 col-md">
|
||||
<p style="font-size:6px; "> DISTRICT</p>
|
||||
<p style="font-size:9px; margin-top:-15px; font-weight:600;">KABERAMAIDO DISTRICT</p>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md">
|
||||
<p style="font-size:6px; "> BARCODE</p>
|
||||
<p style="font-size:9px; margin-top:-15px; font-weight:600;">
|
||||
<img style="max-width: 100%; max-height: 20px; " src="{{ asset($hospitalInfo->lab_stamp) }}" class="" alt="Responsive image">
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row" style="margin-top:-8px;">
|
||||
<div class="col-12 col-md">
|
||||
<p style="font-size:8px;">This card is a property of Kisiizi Medical center, if found please return to the facility.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr style="margin-top:-15px;">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-8" style="margin-top:-6px;">
|
||||
<p style="font-size:7px; "><i>Supported by Streamline ; www.streamlinehealth.org </i></p>
|
||||
</div>
|
||||
<div class="col-12 col-md-4" style="margin-top:-17px;">
|
||||
<img style="max-width: 100px; max-height: 20px;" src="{{ asset($hospitalInfo->stamp) }}" class="" alt="Responsive image">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- column --}}
|
||||
{{-- <div class="col">
|
||||
<div class="a8-page">
|
||||
<div class="row" style="padding:3px; background-color:#eaeef3;" >
|
||||
<div class="col-12 col-md">
|
||||
<img style="max-width: 100px; max-height: 25px;" src="{{ asset($hospital_details->logo) }}" class="" alt="Responsive image">
|
||||
|
||||
</div>
|
||||
<div class="col-12 col-md text-right" style="font-size:9px; margin-top:8px; font-weight:600;">PATIENT CARD</div>
|
||||
</div>
|
||||
<hr style="margin-top:5px;">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-md">
|
||||
<p style="font-size:6px; margin-top:-10px;"> NAME</p>
|
||||
<p style="font-size:9px; margin-top:-15px; font-weight:600;"> AREBAHOONA MBABAZI ANGELLA MBABAZI OTHER NAME</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-md">
|
||||
<p style="font-size:6px; margin-top:-10px;"> PATIENT NUMBER</p>
|
||||
<p style="font-size:9px; margin-top:-15px; font-weight:600;"> SCH-24-01290000</p>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md">
|
||||
<p style="font-size:6px; margin-top:-10px;"> VILLAGE</p>
|
||||
<p style="font-size:9px; margin-top:-15px; font-weight:600;"> NAKAPIRIPIRITI WARD</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-top:-10px;">
|
||||
<div class="col-12 col-md">
|
||||
<p style="font-size:6px; "> DISTRICT</p>
|
||||
<p style="font-size:9px; margin-top:-15px; font-weight:600;">KABERAMAIDO DISTRICT</p>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md">
|
||||
<p style="font-size:6px; "> BARCODE</p>
|
||||
<p style="font-size:9px; margin-top:-15px; font-weight:600;">
|
||||
<img style="max-width: 100%; max-height: 20px; " src="{{ asset($hospital_details->lab_stamp) }}" class="" alt="Responsive image">
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row" style="margin-top:-8px;">
|
||||
<div class="col-12 col-md">
|
||||
<p style="font-size:8px;">This card is a property of Kisiizi Medical center, if found please return to the facility.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr style="margin-top:-15px;">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-8" style="margin-top:-6px;">
|
||||
<p style="font-size:7px; "><i>Supported by Streamline ; www.streamlinehealth.org </i></p>
|
||||
</div>
|
||||
<div class="col-12 col-md-4" style="margin-top:-17px;">
|
||||
<img style="max-width: 100px; max-height: 20px;" src="{{ asset($hospital_details->stamp) }}" class="" alt="Responsive image">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{{-- OLD VIEW --}}
|
||||
{{-- <div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div style="background-color: rgb(43, 116, 91); color:#fff">
|
||||
<div class="hospital-logo" style="padding-top: 10px;">
|
||||
@include('layouts.header_pdf_print')
|
||||
</div>
|
||||
|
||||
<div class="row" style="padding: 30px;">
|
||||
<div class="col-12" style="padding-top: 10px;">
|
||||
<table>
|
||||
<tr>
|
||||
<td><u>NAME</u></td>
|
||||
<td style="padding-left: 15px;"><u>SEX</u></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
{{ get_full_name($patient->id, "id", "first_name", "last_name", "patients") }}
|
||||
</th>
|
||||
<th style="padding-left: 15px;">
|
||||
{{ $patient->gender == 1 ? "MALE" : "FEMALE" }}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td style="padding-left: 15px;"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><u>Stre@mline NUMBER</u></td>
|
||||
<td style="padding-left: 15px;"><u>DATE OF BIRTH</u></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
{{ $patient->number }}
|
||||
</th>
|
||||
<th style="padding-left: 15px;">
|
||||
{{ streamline_date($patient->date_of_birth) }}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td style="padding-left: 10px;"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><u>NIN</u></td>
|
||||
<td style="padding-left: 10px;"><u>HOLDER'S SIGNATURE</u></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
{{ $patient->national_id }}
|
||||
</th>
|
||||
<th style="padding-left: 10px;">
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<br><br><br>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div style="background-color: rgb(43, 116, 91); padding:10px; padding-top: 120px;">
|
||||
<table align="center">
|
||||
|
||||
<tr>
|
||||
<td>HOST HEALTH FACILITY </td>
|
||||
<td>
|
||||
{{ $hospitalInfo->name }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>VILLAGE</td>
|
||||
<td>
|
||||
{{ get_name(get_name($patient->id, "id", "village_id", "patients"), "id", "name", "villages") }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>DISTRICT</td>
|
||||
<td>
|
||||
{{ get_name($patient->district_id, "id", "name", "districts") }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" style="background-color: #fff">
|
||||
{{ getDNS1DBarcodePNGOtherOption(sprintf("%04u", $patient->id)) }}
|
||||
<br>
|
||||
<h4 style="color: black">{{ sprintf("%04u", $patient->id) }}</h4>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div style="text-align: center; color: #fff; padding: 10px; font-size: 22px;">
|
||||
This card should only be used for identification at a Stre@mline network hospital.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.3/dist/umd/popper.min.js"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
+401
@@ -0,0 +1,401 @@
|
||||
@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" />
|
||||
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-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">{{ __('layout.patient_cards') }}</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 >{{ __('patients.print_patients_cards') }}</li>
|
||||
|
||||
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="white-box">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-md">
|
||||
<a href="{{ route('patients.create') }}" class="btn btn-success"><i class="fa fa-plus"></i> {{ __('patients.add_patient') }} </a>
|
||||
<a href="{{ route('patients.index') }}" class="btn btn-info"> <i class="fa fa-eye"></i> {{ __('patients.view_patients') }} </a>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md" style="text-align:right;">
|
||||
<a href="{{ route('patients.inactive') }}" class="btn btn-danger"><i class="fa fa-eye-slash"></i> {{ __('patients.inactive_patients') }} </a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default" style="border-radius: 5px;">
|
||||
<div class="panel-body">
|
||||
|
||||
{{-- Search Patient Cards --}}
|
||||
<form action="{{ route('patients.search_patient_cards_to_print') }}" method="POST" >
|
||||
@csrf
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md">
|
||||
<div class="form-group">
|
||||
<label>{{ __('patients.select_registered_date') }}:</label>
|
||||
<select class="form-control required" name="dates" id="dates">
|
||||
{{-- <option value="null">--Select--</option> --}}
|
||||
<option value="today">{{ __('patients.today') }}</option>
|
||||
<option value="yesterday">{{ __('patients.yesterday') }}</option>
|
||||
<option value="custom_date">{{ __('patients.custom_date') }}</option>
|
||||
<option value="custom_date_range">{{ __('patients.date_range') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md" id="sDate" style="display: none;">
|
||||
<div class="form-group">
|
||||
<label>{{ __('patients.start_date') }}:</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="start_date" id="start_date" class="form-control">
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md" id="eDate" style="display: none;">
|
||||
<div class="form-group">
|
||||
<label>{{ __('patients.end_date') }}:</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="end_date" id="end_date" class="form-control">
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md">
|
||||
<label>{{ __('patients.select_patients') }}:</label>
|
||||
<div class="input-group">
|
||||
<select class="form-control" name="number[]" id="patient_number" multiple></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md">
|
||||
<div class="form-group" style="margin-top: 25px;">
|
||||
<button type="submit" class="btn btn-success"><i class="fa fa-paper-plane"></i> {{ __('patients.submit') }}</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
|
||||
@php
|
||||
use \Carbon\Carbon;
|
||||
$today = Carbon::now();
|
||||
$patients_current_date = streamline_date($today);
|
||||
@endphp
|
||||
{{-- Process patient cards form --}}
|
||||
<form id="patient_cards_form" action="{{ route('patients.print_patients_cards') }}" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-12 col-md" style="text-align:left; margin-bottom:10px;">
|
||||
<h5 style="color:rgb(27, 144, 223);">{{ __('patients.patients_registered_today') }}</h5>
|
||||
</div>
|
||||
<div class="col-12 col-md" style="text-align:right; margin-bottom:10px;">
|
||||
@if (Auth::user()->can('print-patient-cards'))
|
||||
<button type="submit" id="submit-button" class="btn btn-rounded" style="background-color:purple; color:#ffffff;"><i class="fa fa-print"></i> {{ __('patients.print_cards') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="table-responsive" style="padding-right:15px; padding-left:15px;">
|
||||
<table class="table success-table table-sm table-striped table-hover " style="color: white; border: 1px solid #00c292;">
|
||||
<thead >
|
||||
<tr style="background-color: #00c292; color: white;">
|
||||
<th style="color: white;">{{ __('patients.hash') }}</th>
|
||||
<th style="color: white;">{{ __('patients.patient_number') }}</th>
|
||||
<th style="color: white;">{{ __('patients.full_names') }}</th>
|
||||
<th style="color: white;">{{ __('patients.gender') }}</th>
|
||||
<th style="color: white;">{{ __('patients.age') }}</th>
|
||||
<th style="color: white;">{{ __('patients.phone_number') }}</th>
|
||||
<th style="color: white;">{{ __('patients.category') }}</th>
|
||||
<th style="color: white;">{{ __('patients.residence') }}</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
|
||||
@forelse ( $patients as $key => $patient )
|
||||
|
||||
@php
|
||||
$village = \Streamline\Models\Village::find($patient->village_id);
|
||||
$patient_category = \Streamline\Models\PatientCategory::find($patient->category_id);
|
||||
@endphp
|
||||
|
||||
<tr>
|
||||
<td><input type="checkbox" value="{{ $patient->id }}" name="patients[]" class="patient_cards_checkbox"></td>
|
||||
<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>{{ $patient_category->name ?? '' }}</td>
|
||||
<td>{{ $village->name ?? '' }}</td>
|
||||
</tr>
|
||||
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="3" ></td>
|
||||
<td colspan="3" style="color:red;" >
|
||||
No Patients Found!
|
||||
</td>
|
||||
<td colspan="2" ></td>
|
||||
|
||||
</tr>
|
||||
@endforelse
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
<center>
|
||||
{{-- {{ $patients->links() }} --}}
|
||||
{{ $patients->appends(Request::except('page'))->links() }}
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<!-- Typehead Plugin JavaScript -->
|
||||
|
||||
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/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>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const checkboxes = document.querySelectorAll('.patient_cards_checkbox');
|
||||
const form = document.getElementById('patient_cards_form');
|
||||
const maxChecked = 10;
|
||||
|
||||
checkboxes.forEach(checkbox => {
|
||||
checkbox.addEventListener('change', function() {
|
||||
const checkedCount = document.querySelectorAll('.patient_cards_checkbox:checked').length;
|
||||
|
||||
if (checkedCount > maxChecked) {
|
||||
alert(`You can only select up to ${maxChecked} patients.`);
|
||||
|
||||
// this.disabled = true;
|
||||
this.checked = false;
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
form.addEventListener('submit', function(event) {
|
||||
const checkedCount = document.querySelectorAll('.patient_cards_checkbox:checked').length;
|
||||
|
||||
if (checkedCount === 0) {
|
||||
event.preventDefault();
|
||||
alert('Please select at least one patient.');
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
const todays_date = "Patients Registered On " + "{{ $patients_current_date }}";
|
||||
// disable data tables pagination
|
||||
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 200,
|
||||
paging: false,
|
||||
info: false,
|
||||
buttons: [
|
||||
'copy',
|
||||
{extend: 'csv',
|
||||
message: "Patients Registered",
|
||||
title: todays_date,
|
||||
exportOptions: {
|
||||
columns: [ 1, 2, 3, 4, 5, 6,7]
|
||||
},
|
||||
},
|
||||
{extend: 'excel',
|
||||
message: "Patients Registered",
|
||||
title: todays_date,
|
||||
exportOptions: {
|
||||
columns: [ 1, 2, 3, 4, 5, 6,7]
|
||||
},
|
||||
sheetName: "Patients Registered"
|
||||
},
|
||||
{extend: 'pdf',
|
||||
message: "Patients Registered",
|
||||
title: todays_date,
|
||||
orientation: 'portrait',
|
||||
pageSize: 'LETTER',
|
||||
exportOptions: {
|
||||
columns: [ 1, 2, 3, 4, 5, 6,7]
|
||||
},
|
||||
customize: function (doc) {
|
||||
doc.defaultStyle.fontSize = 10;
|
||||
}
|
||||
},
|
||||
{extend: 'print',
|
||||
message: "Patients Registered",
|
||||
title: todays_date,
|
||||
exportOptions: {
|
||||
columns: [ 1, 2, 3, 4, 5, 6,7]
|
||||
},
|
||||
customize: function (win) {
|
||||
$(win.document.body)
|
||||
.css('font-size', '10pt')
|
||||
.css('background', '#fff')
|
||||
.prepend(
|
||||
'<img src="<?php echo asset('uploads/logo/logo-sm.png'); ?>" style="position:absolute; top:0; right:0;" />'
|
||||
);
|
||||
$(win.document.body).find('table')
|
||||
.addClass('compact')
|
||||
.css('font-size', 'inherit');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
|
||||
$('#patient_number').change(function () {
|
||||
let id = $('#patient_number').val();
|
||||
$('#patient_id').val(id);
|
||||
});
|
||||
|
||||
$('#patient_number').select2({
|
||||
placeholder: 'Search by patient details (names and number)',
|
||||
ajax: {
|
||||
url: '/patients/search_patient_by_name_number',
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
processResults: function (data) {
|
||||
return {
|
||||
results: $.map(data, function (item) {
|
||||
return {
|
||||
text: item.first_name + " " + item.last_name + " (" + item.number + ")",
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
};
|
||||
},
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
$('#dates').change(function (e) {
|
||||
|
||||
if($(this).val() === "custom_date"){
|
||||
|
||||
$("#eDate").hide();
|
||||
$("#sDate").show();
|
||||
|
||||
}else if($(this).val() === "custom_date_range"){
|
||||
|
||||
$("#sDate").show();
|
||||
$("#eDate").show();
|
||||
}else{
|
||||
|
||||
$("#eDate").hide();
|
||||
$("#sDate").hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('#end_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
$('#start_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
|
||||
$('#staff_member').select2({
|
||||
placeholder: "-- select --"
|
||||
});
|
||||
$('#staff_member_accountant').select2({
|
||||
placeholder: "-- select --"
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
||||
@push('styles')
|
||||
<style type="text/css">
|
||||
.color-bordered-table.success-bordered-table {
|
||||
border-top: 0px;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
<!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 {
|
||||
|
||||
/* margin: 5;
|
||||
padding:0;
|
||||
size:A4 potrait;
|
||||
text-align:center; */
|
||||
|
||||
margin-left:35;
|
||||
margin-top:12;
|
||||
margin-right:0;
|
||||
margin-bottom:0;
|
||||
padding:0;
|
||||
size:A4 potrait;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
/* margin:0; */
|
||||
}
|
||||
.a8-container {
|
||||
|
||||
width: 8.5cm;
|
||||
height: 5.4cm;
|
||||
|
||||
/* width: 7.4cm;
|
||||
height: 5.2cm; */
|
||||
margin-top:10px;
|
||||
border: 1px solid #000;
|
||||
display: flex;
|
||||
}
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
th, td {
|
||||
border: 0px solid #000;
|
||||
padding: 0px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
@php
|
||||
$counter = 0;
|
||||
@endphp
|
||||
|
||||
@foreach($patient_cards as $key => $patient)
|
||||
<td>
|
||||
<div class="a8-container">
|
||||
<table >
|
||||
<tr style=" border-bottom: 1px solid gray; ">
|
||||
<td style="padding:8px;">
|
||||
<img style="max-width: 100px; max-height: 25px;" src="{{ asset($hospital_details->logo ?? '') }}" class="" alt="">
|
||||
</td>
|
||||
<td style="padding:8px; text-align:right; font-weight:600;">PATIENT CARD</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="font-size:6px; padding-top:14px;padding-left:7px; padding-right:7px; ">NAME</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="font-size:9px; font-weight:600;padding-left:7px; padding-right:7px; text-transform: uppercase " >
|
||||
{{ $patient->first_name ?? '' }}
|
||||
{{ $patient->last_name ?? '' }}
|
||||
{{ $patient->other_names ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="font-size:6px; padding-top:10px;padding-left:7px; ">PATIENT NUMBER</td>
|
||||
<td style="font-size:6px; padding-top:10px; padding-right:7px;text-transform: uppercase ">RESIDENCE</td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td style="font-size:9px; font-weight:600; padding-left:7px; ">{{ $patient->number ?? '' }} </td>
|
||||
<td style="font-size:9px; font-weight:600; padding-right:7px; text-transform: uppercase">{{ get_name(get_name($patient->id, "id", "village_id", "patients"), "id", "name", "villages") }}</td>
|
||||
</tr>
|
||||
<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($patient->district_id, "id", "name", "districts") }} </span>
|
||||
</td>
|
||||
<td style="font-size:5px; padding-top:10px; padding-right:7px;">
|
||||
{{ getDNS1DBarcodePNGOCards(sprintf("%04u", $patient->id)) }}
|
||||
<br>
|
||||
<h4 style="color: black">{{ sprintf("%04u", $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 {{ $hospital_details->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>
|
||||
|
||||
</td>
|
||||
@php
|
||||
$counter++;
|
||||
@endphp
|
||||
|
||||
@if($counter % 2 == 0)
|
||||
</tr><tr>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@if($counter % 2 != 0)
|
||||
<td></td>
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+411
@@ -0,0 +1,411 @@
|
||||
@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" />
|
||||
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-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">{{ __('layout.patient_cards') }}</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>
|
||||
@if (Auth::user()->can('print-patient-cards'))
|
||||
<li class="active">v{{ __('patients.print_patients_cards') }}</li>
|
||||
@endif
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="white-box">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 col-md">
|
||||
<a href="{{ route('patients.create') }}" class="btn btn-success"><i class="fa fa-plus"></i> {{ __('patients.add_patient') }} </a>
|
||||
<a href="{{ route('patients.index') }}" class="btn btn-info"> <i class="fa fa-eye"></i> {{ __('patients.view_patients') }} </a>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md" style="text-align:right;">
|
||||
<a href="{{ route('patients.inactive') }}" class="btn btn-danger"><i class="fa fa-eye-slash"></i> {{ __('patients.inactive_patients') }} </a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default" style="border-radius: 5px;">
|
||||
<div class="panel-body">
|
||||
|
||||
{{-- Search Patient Cards --}}
|
||||
<form action="{{ route('patients.search_patient_cards_to_print') }}" method="POST" >
|
||||
@csrf
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md">
|
||||
<div class="form-group">
|
||||
<label>{{ __('patients.select_registered_date') }}:</label>
|
||||
<select class="form-control required" name="dates" id="dates">
|
||||
{{-- <option value="null">--Select--</option> --}}
|
||||
<option value="today">{{ __('patients.today') }}</option>
|
||||
<option value="yesterday">{{ __('patients.yesterday') }}</option>
|
||||
<option value="custom_date">{{ __('patients.custom_date') }}</option>
|
||||
<option value="custom_date_range">{{ __('patients.date_range') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md" id="sDate" style="display: none;">
|
||||
<div class="form-group">
|
||||
<label>{{ __('patients.start_date') }}:</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="start_date" id="start_date" class="form-control">
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md" id="eDate" style="display: none;">
|
||||
<div class="form-group">
|
||||
<label>{{ __('patients.end_date') }}:</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="end_date" id="end_date" class="form-control">
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md">
|
||||
<label>{{ __('patients.select_patients') }}:</label>
|
||||
<div class="input-group">
|
||||
<select class="form-control" name="number[]" id="patient_number" multiple></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md">
|
||||
<div class="form-group" style="margin-top: 25px;">
|
||||
<button type="submit" class="btn btn-success"><i class="fa fa-paper-plane"></i> {{ __('patients.submit') }}</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
|
||||
{{-- Process patient cards form --}}
|
||||
<form id="patient_cards_form" action="{{ route('patients.print_patients_cards') }}" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-12 col-md" style="text-align:left; margin-bottom:10px;">
|
||||
<h5 style="color:rgb(27, 144, 223);">
|
||||
|
||||
{{ $searched_data_string ?? '' }}
|
||||
|
||||
</h5>
|
||||
</div>
|
||||
<div class="col-12 col-md" style="text-align:right; margin-bottom:10px;">
|
||||
@if (Auth::user()->can('print-patient-cards'))
|
||||
<button type="submit" id="submit-button" class="btn btn-rounded" style="background-color:purple; color:#ffffff;"><i class="fa fa-print"></i> {{ __('patients.print_cards') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="table-responsive" style="padding-right:15px; padding-left:15px;">
|
||||
<table class="table success-table table-sm table-striped table-hover disable_pagination" style="color: white; border: 1px solid #00c292;">
|
||||
<thead >
|
||||
<tr style="background-color: #00c292; color: white;">
|
||||
<th style="color: white;">{{ __('patients.hash') }}</th>
|
||||
<th style="color: white;">{{ __('patients.patient_number') }}</th>
|
||||
<th style="color: white;">{{ __('patients.full_names') }}</th>
|
||||
<th style="color: white;">{{ __('patients.gender') }}</th>
|
||||
<th style="color: white;">{{ __('patients.age') }}</th>
|
||||
<th style="color: white;">{{ __('patients.phone_number') }}</th>
|
||||
<th style="color: white;">{{ __('patients.category') }}</th>
|
||||
<th style="color: white;">{{ __('patients.residence') }}</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
|
||||
@forelse ( $patients as $key => $patient )
|
||||
|
||||
@php
|
||||
$village = \Streamline\Models\Village::find($patient->village_id);
|
||||
$patient_category = \Streamline\Models\PatientCategory::find($patient->category_id);
|
||||
@endphp
|
||||
|
||||
<tr>
|
||||
<td><input type="checkbox" value="{{ $patient->id }}" name="patients[]" class="patient_cards_checkbox"></td>
|
||||
<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>{{ $patient_category->name ?? '' }}</td>
|
||||
<td>{{ $village->name ?? '' }}</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="3" ></td>
|
||||
<td colspan="3" style="color:red;" >
|
||||
No Patients Found!
|
||||
</td>
|
||||
<td colspan="2" ></td>
|
||||
|
||||
</tr>
|
||||
@endforelse
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
|
||||
</table>
|
||||
{{-- laravel pagination --}}
|
||||
<center>
|
||||
{{-- {{ $patients->links() }} --}}
|
||||
|
||||
{{ $patients->appends(Request::except('page'))->links() }}
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<!-- Typehead Plugin JavaScript -->
|
||||
|
||||
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/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>
|
||||
|
||||
{{-- print patient cards --}}
|
||||
{{-- <script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js"></script> --}}
|
||||
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const checkboxes = document.querySelectorAll('.patient_cards_checkbox');
|
||||
const form = document.getElementById('patient_cards_form');
|
||||
const maxChecked = 10;
|
||||
|
||||
checkboxes.forEach(checkbox => {
|
||||
checkbox.addEventListener('change', function() {
|
||||
const checkedCount = document.querySelectorAll('.patient_cards_checkbox:checked').length;
|
||||
|
||||
if (checkedCount >= maxChecked) {
|
||||
checkboxes.forEach(box => {
|
||||
if (!box.checked) {
|
||||
box.disabled = true;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
checkboxes.forEach(box => {
|
||||
box.disabled = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
form.addEventListener('submit', function(event) {
|
||||
const checkedCount = document.querySelectorAll('.patient_cards_checkbox:checked').length;
|
||||
|
||||
if (checkedCount === 0) {
|
||||
event.preventDefault();
|
||||
alert('Please select at least one patient.');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var searchedDataString = "{{ $searched_data_string ?? '' }}";
|
||||
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 200,
|
||||
//disable js pagination
|
||||
paging: false,
|
||||
info: false,
|
||||
buttons: [
|
||||
'copy',
|
||||
{extend: 'csv',
|
||||
message: "Patients Registered",
|
||||
title: searchedDataString,
|
||||
exportOptions: {
|
||||
columns: [ 1, 2, 3, 4, 5, 6,7]
|
||||
},
|
||||
},
|
||||
{extend: 'excel',
|
||||
message: "Patients Registered",
|
||||
title: searchedDataString,
|
||||
exportOptions: {
|
||||
columns: [ 1, 2, 3, 4, 5, 6,7]
|
||||
},
|
||||
sheetName: "Patients Registered"
|
||||
},
|
||||
{extend: 'pdf',
|
||||
message: "Patients Registered",
|
||||
title: searchedDataString,
|
||||
orientation: 'portrait',
|
||||
pageSize: 'LETTER',
|
||||
exportOptions: {
|
||||
columns: [ 1, 2, 3, 4, 5, 6,7]
|
||||
},
|
||||
customize: function (doc) {
|
||||
doc.defaultStyle.fontSize = 10;
|
||||
// doc.styles.tableHeader.alignment = 'left';
|
||||
}
|
||||
},
|
||||
{extend: 'print',
|
||||
message: "Patients Registered",
|
||||
title: searchedDataString,
|
||||
exportOptions: {
|
||||
columns: [ 1, 2, 3, 4, 5, 6,7]
|
||||
},
|
||||
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('h1')
|
||||
.css('font-size', '9pt'); // Adjust font size as needed
|
||||
|
||||
$(win.document.body).find('table')
|
||||
.addClass('compact')
|
||||
.css('font-size', 'inherit');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
$('#patient_number').change(function () {
|
||||
let id = $('#patient_number').val();
|
||||
$('#patient_id').val(id);
|
||||
});
|
||||
|
||||
$('#patient_number').select2({
|
||||
placeholder: 'Search by patient details (names and number)',
|
||||
ajax: {
|
||||
url: '/patients/search_patient_by_name_number',
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
processResults: function (data) {
|
||||
return {
|
||||
results: $.map(data, function (item) {
|
||||
return {
|
||||
text: item.first_name + " " + item.last_name + " (" + item.number + ")",
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
};
|
||||
},
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
$('#dates').change(function (e) {
|
||||
|
||||
if($(this).val() === "custom_date"){
|
||||
|
||||
$("#eDate").hide();
|
||||
$("#sDate").show();
|
||||
|
||||
}else if($(this).val() === "custom_date_range"){
|
||||
|
||||
$("#sDate").show();
|
||||
$("#eDate").show();
|
||||
}else{
|
||||
|
||||
$("#eDate").hide();
|
||||
$("#sDate").hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('#end_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
$('#start_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#staff_member').select2({
|
||||
placeholder: "-- select --"
|
||||
});
|
||||
$('#staff_member_accountant').select2({
|
||||
placeholder: "-- select --"
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
||||
@push('styles')
|
||||
<style type="text/css">
|
||||
.color-bordered-table.success-bordered-table {
|
||||
border-top: 0px;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
+296
@@ -0,0 +1,296 @@
|
||||
<div class="row m-0 py-4 px-2" style="border: 1px solid #e4e7ea; margin: 5px">
|
||||
<div class="col-sm-12">
|
||||
<strong>INTENSIFIED TB CASE FINDING SCREEN: ({{ $age_group_display }})</strong>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="col-sm-12">
|
||||
DOES THE PATIENT HAVE ANY OF THE FOLLOWING:
|
||||
<input type="radio" name='any_tb_sysmptoms' id='tb_questions_yes' class="cough_class" value="1" @if(isset($triage->any_tb_sysmptoms) && $triage->any_tb_sysmptoms == 1) checked @endif> Yes
|
||||
<input type="radio" name='any_tb_sysmptoms' id='tb_questions_no' class="cough_class" value="0" @if(isset($triage->any_tb_sysmptoms) && $triage->any_tb_sysmptoms == 0) checked @endif> No
|
||||
@if ($age_group == 5 || $age_group_display == '> 12 Years')
|
||||
{{-- adults i.e above 12 years --}}
|
||||
<ol>
|
||||
<li>
|
||||
A cough for more than two weeks ?
|
||||
</li>
|
||||
<li>
|
||||
Persistent fevers for 2 weeks or more ?
|
||||
</li>
|
||||
<li>
|
||||
Noticeable weight loss of more than 3kg ?
|
||||
</li>
|
||||
<li>
|
||||
Excessive night sweats for three weeks or more ?
|
||||
</li>
|
||||
</ol>
|
||||
@elseif($age_group == 4 || $age_group_display == '6 - 12 Years')
|
||||
{{-- between 6-12 years --}}
|
||||
<ol>
|
||||
<li>
|
||||
A cough for more than two weeks ?
|
||||
</li>
|
||||
<li>
|
||||
Persistent fevers for 2 weeks or more ?
|
||||
</li>
|
||||
<li>
|
||||
Noticeable weight loss ?
|
||||
</li>
|
||||
<li>
|
||||
Excessive night sweats for three weeks or more ?
|
||||
</li>
|
||||
</ol>
|
||||
@elseif(
|
||||
$age_group == 3 ||
|
||||
$age_group == 2 ||
|
||||
$age_group == 1 ||
|
||||
$age_group_display == '1 - 12 Months' ||
|
||||
$age_group_display == '0 - 28 Days')
|
||||
{{-- children below 5 years --}}
|
||||
<ol>
|
||||
<li>
|
||||
A cough for more than two weeks ?
|
||||
</li>
|
||||
<li>
|
||||
Persistent fevers for 2 weeks or more ?
|
||||
</li>
|
||||
<li>
|
||||
Noticeable weight loss ?
|
||||
</li>
|
||||
<li>
|
||||
Poor weight gain in the last one month ?
|
||||
<br>
|
||||
<span style="color: red">
|
||||
(weight loss or “very low weight” = where weight for age is less than -3 z-score, or
|
||||
“underweight” =
|
||||
weight for age less than -2 z-score, or “confirmed weight loss”= more than 5% since last visit,
|
||||
or “growth
|
||||
curve flattening”).
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
Contact with a person with pulmonary tuberculosis or chronic cough ?
|
||||
</li>
|
||||
</ol>
|
||||
@endif
|
||||
|
||||
<br>
|
||||
<table class="tb_questions_table table table-bordered" style="display: none; background-color: #f3f3f5;">
|
||||
@if ($age_group == 5 || $age_group_display == '> 12 Years')
|
||||
<tr class="cough_tb_question">
|
||||
<td>A cough for more than two weeks ?</td>
|
||||
<td>
|
||||
<input type="radio" name='cough_for_2_weeks' id='cough_for_2_weeks_yes' class="tb_screening_radios" value="1" @if(isset($triage->cough_for_2_weeks) && $triage->cough_for_2_weeks == 1) checked @endif> Yes
|
||||
<input type="radio" name='cough_for_2_weeks' id='cough_for_2_weeks_no' class="tb_screening_radios" value="0" @if(isset($triage->cough_for_2_weeks) && $triage->cough_for_2_weeks == 0) checked @endif> No
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="fever_tb_question">
|
||||
<td>Persistent fevers for 2 weeks or more ?</td>
|
||||
<td>
|
||||
<input type="radio" name='fever_for_2_weeks' id='fever_for_2_weeks_yes' class="tb_screening_radios" value="1" @if(isset($triage->fever_for_2_weeks) && $triage->fever_for_2_weeks == 1) checked @endif> Yes
|
||||
<input type="radio" name='fever_for_2_weeks' id='fever_for_2_weeks_no' class="tb_screening_radios" value="0" @if(isset($triage->fever_for_2_weeks) && $triage->fever_for_2_weeks == 0) checked @endif> No
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="weight_loss_tb_question">
|
||||
<td>Noticeable weight loss of more than 3 Kg?</td>
|
||||
<td>
|
||||
<input type="radio" name='tb_weight_loss' id='tb_weight_loss_yes' class="tb_screening_radios" value="1" @if(isset($triage->tb_weight_loss) && $triage->tb_weight_loss == 1) checked @endif> Yes
|
||||
<input type="radio" name='tb_weight_loss' id='tb_weight_loss_no' class="tb_screening_radios" value="0" @if(isset($triage->tb_weight_loss) && $triage->tb_weight_loss == 0) checked @endif> No
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="excessive_night_sweats_tb_question">
|
||||
<td>Excessive night sweats for three weeks or more ?</td>
|
||||
<td>
|
||||
<input type="radio" name='tb_excessive_night_sweats' id='tb_excessive_night_sweats_yes' class="tb_screening_radios" value="1" @if(isset($triage->tb_excessive_night_sweats) && $triage->tb_excessive_night_sweats == 1) checked @endif> Yes
|
||||
<input type="radio" name='tb_excessive_night_sweats' id='tb_excessive_night_sweats_no' class="tb_screening_radios" value="0" @if(isset($triage->tb_excessive_night_sweats) && $triage->tb_excessive_night_sweats == 0) checked @endif> No
|
||||
</td>
|
||||
</tr>
|
||||
@elseif ($age_group == 4 || $age_group_display == '6 - 12 Years')
|
||||
<tr class="cough_tb_question">
|
||||
<td>A cough for more than two weeks ?</td>
|
||||
<td>
|
||||
<input type="radio" name='cough_for_2_weeks' id='cough_for_2_weeks_yes' class="tb_screening_radios" value="1" @if(isset($triage->cough_for_2_weeks) && $triage->cough_for_2_weeks == 1) checked @endif> Yes
|
||||
<input type="radio" name='cough_for_2_weeks' id='cough_for_2_weeks_no' class="tb_screening_radios" value="0" @if(isset($triage->cough_for_2_weeks) && $triage->cough_for_2_weeks == 0) checked @endif> No
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="fever_tb_question">
|
||||
<td>Persistent fevers for 2 weeks or more ?</td>
|
||||
<td>
|
||||
<input type="radio" name='fever_for_2_weeks' id='fever_for_2_weeks_yes' class="tb_screening_radios" value="1" @if(isset($triage->fever_for_2_weeks) && $triage->fever_for_2_weeks == 1) checked @endif> Yes
|
||||
<input type="radio" name='fever_for_2_weeks' id='fever_for_2_weeks_no' class="tb_screening_radios" value="0" @if(isset($triage->fever_for_2_weeks) && $triage->fever_for_2_weeks == 0) checked @endif> No
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="weight_loss_tb_question">
|
||||
<td>Noticeable weight loss ?</td>
|
||||
<td>
|
||||
<input type="radio" name='tb_weight_loss' id='tb_weight_loss_yes' class="tb_screening_radios" value="1" @if(isset($triage->tb_weight_loss) && $triage->tb_weight_loss == 1) checked @endif> Yes
|
||||
<input type="radio" name='tb_weight_loss' id='tb_weight_loss_no' class="tb_screening_radios" value="0" @if(isset($triage->tb_weight_loss) && $triage->tb_weight_loss == 0) checked @endif> No
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="excessive_night_sweats_tb_question">
|
||||
<td>Excessive night sweats for three weeks or more ?</td>
|
||||
<td>
|
||||
<input type="radio" name='tb_excessive_night_sweats' id='tb_excessive_night_sweats_yes' class="tb_screening_radios" value="1" @if(isset($triage->tb_excessive_night_sweats) && $triage->tb_excessive_night_sweats == 1) checked @endif> Yes
|
||||
<input type="radio" name='tb_excessive_night_sweats' id='tb_excessive_night_sweats_no' class="tb_screening_radios" value="0" @if(isset($triage->tb_excessive_night_sweats) && $triage->tb_excessive_night_sweats == 0) checked @endif> No
|
||||
</td>
|
||||
</tr>
|
||||
@elseif(
|
||||
$age_group == 3 ||
|
||||
$age_group == 2 ||
|
||||
$age_group == 1 ||
|
||||
$age_group_display == '1 - 12 Months' ||
|
||||
$age_group_display == '0 - 28 Days')
|
||||
{{-- children below 5 years --}}
|
||||
<tr class="cough_tb_question">
|
||||
<td>A cough for more than two weeks ?</td>
|
||||
<td>
|
||||
<input type="radio" name='cough_for_2_weeks' id='cough_for_2_weeks_yes' class="tb_screening_radios" value="1" @if(isset($triage->cough_for_2_weeks) && $triage->cough_for_2_weeks == 1) checked @endif> Yes
|
||||
<input type="radio" name='cough_for_2_weeks' id='cough_for_2_weeks_no' class="tb_screening_radios" value="0" @if(isset($triage->cough_for_2_weeks) && $triage->cough_for_2_weeks == 0) checked @endif> No
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="fever_tb_question">
|
||||
<td>Persistent fevers for 2 weeks or more ?</td>
|
||||
<td>
|
||||
<input type="radio" name='fever_for_2_weeks' id='fever_for_2_weeks_yes' class="tb_screening_radios" value="1" @if(isset($triage->fever_for_2_weeks) && $triage->fever_for_2_weeks == 1) checked @endif> Yes
|
||||
<input type="radio" name='fever_for_2_weeks' id='fever_for_2_weeks_no' class="tb_screening_radios" value="0" @if(isset($triage->fever_for_2_weeks) && $triage->fever_for_2_weeks == 0) checked @endif> No
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="weight_loss_tb_question">
|
||||
<td>Noticeable weight loss ?</td>
|
||||
<td>
|
||||
<input type="radio" name='tb_weight_loss' id='tb_weight_loss_yes' class="tb_screening_radios" value="1" @if(isset($triage->tb_weight_loss) && $triage->tb_weight_loss == 1) checked @endif> Yes
|
||||
<input type="radio" name='tb_weight_loss' id='tb_weight_loss_no' class="tb_screening_radios" value="0" @if(isset($triage->tb_weight_loss) && $triage->tb_weight_loss == 0) checked @endif> No
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="poor_weight_gain_tb_question">
|
||||
<td>Poor weight gain in the last one month ?
|
||||
<br>
|
||||
<span style="color: red">
|
||||
(weight loss or “very low weight” = where weight for age is<br> less than -3 z-score, or
|
||||
“underweight” = weight for age less than<br> -2 z-score, or “confirmed weight loss”= more
|
||||
than 5% since last visit, or “growth curve flattening”).
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="radio" name='tb_poor_weight_gain' id='tb_poor_weight_gain_yes' class="tb_screening_radios" value="1" @if(isset($triage->tb_poor_weight_gain) && $triage->tb_poor_weight_gain == 1) checked @endif> Yes
|
||||
<input type="radio" name='tb_poor_weight_gain' id='tb_poor_weight_gain_no' class="tb_screening_radios" value="0" @if(isset($triage->tb_poor_weight_gain) && $triage->tb_poor_weight_gain == 0) checked @endif> No
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="contact_with_tb_person_with_tb_question">
|
||||
<td>Contact with a person with pulmonary TB or chronic cough ?</td>
|
||||
<td>
|
||||
<input type="radio" name='tb_contact_with_tb_person' id='tb_contact_with_tb_person_yes' class="tb_screening_radios" value="1" @if(isset($triage->tb_contact_with_tb_person) && $triage->tb_contact_with_tb_person == 1) checked @endif> Yes
|
||||
<input type="radio" name='tb_contact_with_tb_person' id='tb_contact_with_tb_person_no' class="tb_screening_radios" value="0" @if(isset($triage->tb_contact_with_tb_person) && $triage->tb_contact_with_tb_person == 0) checked @endif> No
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<div class="modal fade" id="TBActionModal" tabindex="-1" role="dialog" aria-labelledby="modalTBActionLabel1"
|
||||
style="margin-top: 20%">
|
||||
<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>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<h4 class="modal-title"><u>ACTION NEEDED: <font color=red>Possible TB</font></u></h4><br>
|
||||
<div class="possible_tb_action_for_coughing" style="display:none; font: bolder">
|
||||
@if ($age_group == 5 || $age_group_display == '> 12 Years')
|
||||
<ol>
|
||||
<li>REQUEST FOR SPUTUM TEST</li>
|
||||
<li>REFER TO CLINICIAN FOR FURTHER INVESTIGATIONS</li>
|
||||
<li style="color: red">DIRECT THE PATIENT TO DESIGNATED AREA FOR PEOPLE WITH CHRONIC COUGH
|
||||
AWAY FROM THE MAIN QUEUE TO REDUCE THE RISK OF CROSS-INFECTION</li>
|
||||
</ol>
|
||||
@elseif ($age_group == 4 || $age_group_display == '6 - 12 Years')
|
||||
<ol>
|
||||
<li>REQUEST FOR SPUTUM TEST if child can manage</li>
|
||||
<li>REFER TO CLINICIAN FOR FURTHER INVESTIGATIONS</li>
|
||||
<li style="color: red">DIRECT THE PATIENT TO DESIGNATED AREA FOR PEOPLE WITH CHRONIC COUGH
|
||||
AWAY FROM THE MAIN QUEUE TO REDUCE THE RISK OF CROSS-INFECTION</li>
|
||||
</ol>
|
||||
@elseif(
|
||||
$age_group == 3 ||
|
||||
$age_group == 2 ||
|
||||
$age_group == 1 ||
|
||||
$age_group_display == '1 - 12 Months' ||
|
||||
$age_group_display == '0 - 28 Days')
|
||||
{{-- children below 5 years --}}
|
||||
<ol>
|
||||
<li>REFER TO CLINICIAN FOR FURTHER INVESTIGATIONS</li>
|
||||
<li style="color: red">DIRECT THE PATIENT TO DESIGNATED AREA FOR PEOPLE WITH CHRONIC COUGH
|
||||
AWAY FROM THE MAIN QUEUE TO REDUCE THE RISK OF CROSS-INFECTION</li>
|
||||
</ol>
|
||||
@endif
|
||||
</div>
|
||||
<div class="possible_tb_action_for_non_coughing" style="display:none; font: bolder">
|
||||
@if ($age_group == 5 || $age_group == 4 || $age_group_display == '6 - 12 Years' || $age_group_display == '> 12 Years')
|
||||
<ol>
|
||||
<li>REFER TO CLINICIAN FOR FURTHER INVESTIGATIONS</li>
|
||||
</ol>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
$("#tb_questions_no").change(function() {
|
||||
$(".tb_questions_table").hide();
|
||||
$(".tb_screening_radios").removeAttr("required");
|
||||
console.log('no tb screening');
|
||||
console.log($("#tb_questions_yes").is(':checked'));
|
||||
})
|
||||
|
||||
$("#tb_questions_yes").change(function() {
|
||||
$(".tb_questions_table").show();
|
||||
$(".tb_screening_radios").attr('required', 'true');
|
||||
console.log('yes tb screening');
|
||||
console.log($("#tb_questions_yes").is(':checked'));
|
||||
})
|
||||
|
||||
$('input[name="cough_for_2_weeks"]').change(function() {
|
||||
if ($("#cough_for_2_weeks_yes").is(':checked')) {
|
||||
//$("#TBActionModal").modal("show");
|
||||
$(".possible_tb_action_for_coughing").show();
|
||||
$(".possible_tb_action_for_non_coughing").hide();
|
||||
}
|
||||
})
|
||||
|
||||
$('input[name="fever_for_2_weeks"]').change(function() {
|
||||
if ($("#cough_for_2_weeks_yes").is(":not(:checked)") && $("#fever_for_2_weeks_yes").is(':checked')) {
|
||||
//$("#TBActionModal").modal("show");
|
||||
$(".possible_tb_action_for_coughing").hide();
|
||||
$(".possible_tb_action_for_non_coughing").show();
|
||||
}
|
||||
})
|
||||
|
||||
$('input[name="tb_weight_loss"]').change(function() {
|
||||
var ageGroup = <?php echo $age_group; ?>;
|
||||
console.log(ageGroup);
|
||||
if ($("#cough_for_2_weeks_yes").is(":not(:checked)") && $("#tb_weight_loss_yes").is(':checked')) {
|
||||
//$("#TBActionModal").modal("show");
|
||||
$(".possible_tb_action_for_coughing").hide();
|
||||
$(".possible_tb_action_for_non_coughing").show();
|
||||
}
|
||||
})
|
||||
|
||||
$('input[name="tb_excessive_night_sweats"]').change(function() {
|
||||
if ($("#cough_for_2_weeks_yes").is(":not(:checked)") && $("#tb_excessive_night_sweats_yes").is(
|
||||
':checked')) {
|
||||
//$("#TBActionModal").modal("show");
|
||||
$(".possible_tb_action_for_coughing").hide();
|
||||
$(".possible_tb_action_for_non_coughing").show();
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
Reference in New Issue
Block a user