mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-13 11:41:31 +00:00
updated streamline-setup v2
This commit is contained in:
+207
-98
@@ -25,6 +25,11 @@ use Streamline\Models\CardioEchoResult;
|
||||
use Barryvdh\Snappy\Facades\SnappyPdf;
|
||||
use Streamline\Models\Investigation;
|
||||
use Streamline\Models\Outcome;
|
||||
use Streamline\Models\PrioritySign;
|
||||
use Streamline\Models\EmergencySign;
|
||||
use Streamline\Models\WardInpatientDetailedNote;
|
||||
use Streamline\Models\MessageBoard;
|
||||
use Illuminate\Database\QueryException;
|
||||
|
||||
class ConsultationController extends Controller
|
||||
{
|
||||
@@ -49,7 +54,8 @@ class ConsultationController extends Controller
|
||||
|
||||
if (!session()->has('patient_id') || !session()->has('episode_id')) :
|
||||
flash('Patient is not selected')->error();
|
||||
return view('home');
|
||||
$messages = MessageBoard::orderBy('created_at', 'desc')->paginate(3);
|
||||
return view('home', compact('messages'));
|
||||
endif;
|
||||
|
||||
$clinics = Clinic::orderBy('name')->pluck("name", "id")->toArray();
|
||||
@@ -285,7 +291,8 @@ class ConsultationController extends Controller
|
||||
|
||||
if (!session()->has('patient_id') || !session()->has('episode_id')) :
|
||||
flash('Patient is not selected')->error();
|
||||
return view('home');
|
||||
$messages = MessageBoard::orderBy('created_at', 'desc')->paginate(3);
|
||||
return view('home', compact('messages'));
|
||||
endif;
|
||||
|
||||
$consultation = new Consultation;
|
||||
@@ -493,7 +500,17 @@ class ConsultationController extends Controller
|
||||
}
|
||||
|
||||
$episode = PatientEpisode::find($episode_id);
|
||||
|
||||
if(!empty($request->investigation_and_management_plan_comments) || !empty($request->clinic_examination_comments) || !empty($request->history_comments)){
|
||||
$notes = new WardInpatientDetailedNote;
|
||||
$notes->patient_id = $patient_id;
|
||||
$notes->episode_id = $episode_id;
|
||||
$notes->ward_id = 0;
|
||||
$notes->investigation_and_management_plan_comments = $request->investigation_and_management_plan_comments?? null;
|
||||
$notes->clinic_examination_comments = $request->clinic_examination_comments?? null;
|
||||
$notes->history_comments = $request->history_comments;
|
||||
$notes->created_by = Auth::user()->id;
|
||||
$notes->save();
|
||||
}
|
||||
|
||||
// Handle the buttons on the consultation page
|
||||
switch ($request->get('submit-btn')):
|
||||
@@ -595,8 +612,9 @@ class ConsultationController extends Controller
|
||||
|
||||
if (session()->get('consultation_with_notes') == 1) {
|
||||
$consultation_with_notes = true;
|
||||
$consultation_notes = WardInpatientDetailedNote::where(['patient_id' => $patient->id, 'episode_id' => $episode->id, 'ward_id' => 0])->latest()->get();
|
||||
} else {
|
||||
$consultation_with_notes = false;
|
||||
$consultation_with_notes = false; $consultation_notes = '';
|
||||
}
|
||||
|
||||
$is_mental_health_clinic = false;
|
||||
@@ -657,7 +675,7 @@ class ConsultationController extends Controller
|
||||
/* ========end of varibales added to cater for review episodes ========*/
|
||||
|
||||
$cardio_echo = CardioEchoResult::where('episode_id', $consultation->episode_id)->first();
|
||||
|
||||
$users = DB::table('users')->pluck(DB::raw("CONCAT(first_name,' ',last_name) AS name"), 'id');
|
||||
return view('patients::consultations.show', compact(
|
||||
'consultation',
|
||||
'patient',
|
||||
@@ -688,7 +706,9 @@ class ConsultationController extends Controller
|
||||
'parent_episode_ordered_sundries',
|
||||
'parent_episode_ordered_investigations',
|
||||
'parent_episode_investigation_results',
|
||||
'cardio_echo'
|
||||
'cardio_echo',
|
||||
'consultation_notes',
|
||||
'users'
|
||||
));
|
||||
}
|
||||
|
||||
@@ -705,7 +725,7 @@ class ConsultationController extends Controller
|
||||
|
||||
$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();
|
||||
$users = User::pluck(DB::raw("CONCAT(first_name,' ',last_name) AS name"), 'id');
|
||||
|
||||
//Patient, Triage and Episode
|
||||
$patient = Patient::where('id', $consultation->patient_id)->first();
|
||||
@@ -714,10 +734,13 @@ class ConsultationController extends Controller
|
||||
|
||||
if (session()->get('consultation_with_notes') == 1) {
|
||||
$consultation_with_notes = true;
|
||||
$all_notes = WardInpatientDetailedNote::where(['patient_id' => $patient->id, 'episode_id' => $episode->id, 'ward_id' => 0])->latest()->get();
|
||||
$consultation_notes = $all_notes->take(5);
|
||||
$notes = $all_notes->skip(5);
|
||||
$view_notes = $notes->all();
|
||||
} else {
|
||||
$consultation_with_notes = false;
|
||||
}
|
||||
|
||||
$consultation_with_notes = false; $consultation_notes = $view_notes ='';
|
||||
}
|
||||
$is_mental_health_clinic = false;
|
||||
// fetch the clinic id and determine if this is a mental health consultation
|
||||
$clinic_slug = get_name($episode->clinic_id, "id", "slug", "clinics");
|
||||
@@ -918,7 +941,9 @@ class ConsultationController extends Controller
|
||||
'users_array',
|
||||
'is_mental_health_clinic',
|
||||
'hmis_categories',
|
||||
'cardio_echo'
|
||||
'cardio_echo',
|
||||
'consultation_notes',
|
||||
'view_notes'
|
||||
));
|
||||
}
|
||||
|
||||
@@ -927,7 +952,8 @@ class ConsultationController extends Controller
|
||||
|
||||
if (!session()->has('patient_id') || !session()->has('episode_id')) :
|
||||
flash('Patient is not selected')->error();
|
||||
return view('home');
|
||||
$messages = MessageBoard::orderBy('created_at', 'desc')->paginate(3);
|
||||
return view('home', compact('messages'));
|
||||
endif;
|
||||
|
||||
$consultation = Consultation::find($id);
|
||||
@@ -1131,6 +1157,26 @@ class ConsultationController extends Controller
|
||||
$mental_health_consultation->update();
|
||||
}
|
||||
|
||||
if(!empty($request->investigation_and_management_plan_comments) || !empty($request->clinic_examination_comments) || !empty($request->history_comments)){
|
||||
$notes = new WardInpatientDetailedNote;
|
||||
$notes->patient_id = $patient_id;
|
||||
$notes->episode_id = $episode_id;
|
||||
$notes->ward_id = 0;
|
||||
$notes->investigation_and_management_plan_comments = $request->investigation_and_management_plan_comments?? null;
|
||||
$notes->clinic_examination_comments = $request->clinic_examination_comments?? null;
|
||||
$notes->history_comments = $request->history_comments?? null;
|
||||
$notes->created_by = Auth::user()->id;
|
||||
$notes->save();
|
||||
}
|
||||
if(!empty($request->deleted_notes)){
|
||||
foreach($request->deleted_notes as $note){
|
||||
if(!empty($note)) {
|
||||
$notes = WardInpatientDetailedNote::find($note);
|
||||
$notes->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch ($request->get('submit-btn')):
|
||||
case 'investigation':
|
||||
$consultation->save();
|
||||
@@ -1292,10 +1338,8 @@ class ConsultationController extends Controller
|
||||
$diagnosis->save();
|
||||
return $diagnosis->id;
|
||||
} catch (QueryException $e) {
|
||||
$errorCode = $e->errorInfo[1];
|
||||
if ($errorCode == 1062) { //error code for duplicate entry to a unique field
|
||||
return response()->json(['error' => $e]);
|
||||
}
|
||||
flash("An error occurred")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1319,20 +1363,20 @@ class ConsultationController extends Controller
|
||||
$hospitalInfo = DB::table('hospital_information')->find(1);
|
||||
|
||||
$consultation = Consultation::where(['patient_id' => $patient_id, 'episode_id' => $episode_id])->orderBy('created_at', 'desc')->first();
|
||||
|
||||
$triage = Triage::where(['patient_id' => $patient_id, 'episode_id' => $episode_id])->first();
|
||||
$patient_discount = \Streamline\Models\PatientDiscount::where(['patient_category' => $patient->category_id])->select("discount", "pay_later")->first();
|
||||
|
||||
if (!is_null($patient_discount)) {
|
||||
$patient_discount->toArray();
|
||||
}
|
||||
$treatments = Treatment::where(['patient_id' => $patient_id, 'episode_id' => $episode_id])->get();
|
||||
$all_diagnoses = DB::table('diagnoses')->pluck("name", "id");
|
||||
|
||||
/* ====== start work on investigations */
|
||||
// prep the inpatient investigation arrays and counters
|
||||
$opd_investigations = [];
|
||||
$opd_investigations_position = [];
|
||||
$opd_investigations_date = [];
|
||||
$ward_investigations = [];
|
||||
$ward_investigations_position = [];
|
||||
$ward_investigations_date = [];
|
||||
|
||||
// get all investigations ordered in this episode
|
||||
@@ -1342,22 +1386,6 @@ class ConsultationController extends Controller
|
||||
$investigation_results_order_ids = InvestigationResults::pluck('order_id', 'id')->toArray();
|
||||
|
||||
foreach ($ordered_investigations as $investigation) {
|
||||
if (isset($ward_investigations['id'])) {
|
||||
$ward_investigations_position[] = count($ward_investigations['id']);
|
||||
} else {
|
||||
$ward_investigations_position[] = 0;
|
||||
}
|
||||
|
||||
if (isset($opd_investigations['id'])) {
|
||||
$opd_investigations_position[] = count($opd_investigations['id']);
|
||||
} else {
|
||||
$opd_investigations_position[] = 0;
|
||||
}
|
||||
|
||||
$ward_investigations_date[] = "Ordered on " . streamline_date_time($investigation->created_at) . " by " .
|
||||
get_full_name($investigation->created_by, 'id', 'first_name', 'last_name', 'users');
|
||||
$opd_investigations_date[] = streamline_date_time($investigation->created_at);
|
||||
|
||||
$investigation_ids = explode(",", $investigation->investigation_id);
|
||||
$inpatient_status = explode(",", $investigation->for_inpatient);
|
||||
|
||||
@@ -1377,61 +1405,81 @@ class ConsultationController extends Controller
|
||||
|
||||
if ($results->all_authenticated == 1) {
|
||||
for ($i = 0; $i < count($inpatient_status); $i++) {
|
||||
if (isset($inpatient_status[$i]) && $inpatient_status[$i] == 0) {
|
||||
$result = Investigation::withTrashed()->find($investigation_ids[$i]);
|
||||
$opd_investigations['id'][] = $result->id;
|
||||
$opd_investigations['name'][] = $result->name;
|
||||
$opd_investigations['type'][] = $result->type;
|
||||
$opd_investigations['slug'][] = $result->slug;
|
||||
$opd_investigations['value'][] = $investigation_results[$i];
|
||||
$opd_investigations['comment'][] = $investigation_comments[$i];
|
||||
if ($inpatient_status[$i] == 0) {
|
||||
if (isset($investigation_ids[$i]) && $investigation_ids[$i] != "") {
|
||||
$result = Investigation::where('id', $investigation_ids[$i])->first();
|
||||
$opd_investigations['name'][] = $result->name;
|
||||
$opd_investigations['value'][] = $investigation_results[$i];
|
||||
$opd_investigations['comment'][] = $investigation_comments[$i];
|
||||
|
||||
if($result->range_type == 1) {
|
||||
$opd_investigations['normal_ranges'][] = get_dynamic_normal_range($result->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients'));
|
||||
} else {
|
||||
$opd_investigations['normal_ranges'][] = $result->normal_ranges;
|
||||
}
|
||||
|
||||
$opd_investigations['type'][] = $result->type;
|
||||
}
|
||||
} else {
|
||||
$result = Investigation::withTrashed()->find($investigation_ids[$i]);
|
||||
$ward_investigations['id'][] = $result->id;
|
||||
$ward_investigations['name'][] = $result->name;
|
||||
$ward_investigations['type'][] = $result->type;
|
||||
$ward_investigations['slug'][] = $result->slug;
|
||||
$ward_investigations['value'][] = isset($investigation_results[$i]) ? $investigation_results[$i] : "";
|
||||
$ward_investigations['comment'][] = isset($investigation_comments[$i]) ? $investigation_comments[$i] : "";
|
||||
if (isset($investigation_ids[$i]) && $investigation_ids[$i] != "") {
|
||||
$result = Investigation::where('id', $investigation_ids[$i])->first();
|
||||
$ward_investigations['name'][] = $result->name;
|
||||
$ward_investigations['value'][] = $investigation_results[$i];
|
||||
$ward_investigations['comment'][] = $investigation_comments[$i];
|
||||
$ward_investigations['type'][] = $result->type;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for ($i = 0; $i < count($inpatient_status); $i++) {
|
||||
|
||||
$investigation = \Streamline\Models\Investigation::withTrashed()->find($investigation_ids[$i]);
|
||||
|
||||
if (isset($investigation_per_valid[$i]) && $investigation_per_valid[$i] == 1) {
|
||||
if ($investigation_per_valid[$i] == 1) {
|
||||
// this investigation is authenticated
|
||||
if (isset($inpatient_status[$i]) && $inpatient_status[$i] == 0) {
|
||||
$opd_investigations['id'][] = $investigation->id;
|
||||
$opd_investigations['name'][] = $investigation->name;
|
||||
$opd_investigations['type'][] = $investigation->type;
|
||||
$opd_investigations['slug'][] = $investigation->slug;
|
||||
$opd_investigations['value'][] = $investigation_results[$i];
|
||||
$opd_investigations['comment'][] = $investigation_comments[$i];
|
||||
if ($inpatient_status[$i] == 0) {
|
||||
if (isset($investigation_ids[$i]) && $investigation_ids[$i] != "") {
|
||||
$result = Investigation::where('id', $investigation_ids[$i])->first();
|
||||
$opd_investigations['name'][] = $result->name;
|
||||
$opd_investigations['value'][] = $investigation_results[$i];
|
||||
|
||||
if($result->range_type == 1) {
|
||||
$opd_investigations['normal_ranges'][] = get_dynamic_normal_range($result->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients'));
|
||||
} else {
|
||||
$opd_investigations['normal_ranges'][] = $result->normal_ranges;
|
||||
}
|
||||
|
||||
$opd_investigations['comment'][] = $investigation_comments[$i];
|
||||
$opd_investigations['type'][] = $result->type;
|
||||
}
|
||||
} else {
|
||||
$ward_investigations['id'][] = $investigation->id;
|
||||
$ward_investigations['name'][] = $investigation->name;
|
||||
$ward_investigations['type'][] = $investigation->type;
|
||||
$ward_investigations['slug'][] = $investigation->slug;
|
||||
$ward_investigations['value'][] = $investigation_results[$i];
|
||||
$ward_investigations['comment'][] = $investigation_comments[$i];
|
||||
if (isset($investigation_ids[$i]) && $investigation_ids[$i] != "") {
|
||||
$result = Investigation::where('id', $investigation_ids[$i])->first();
|
||||
$ward_investigations['name'][] = $result->name;
|
||||
$ward_investigations['value'][] = $investigation_results[$i];
|
||||
$ward_investigations['comment'][] = $investigation_comments[$i];
|
||||
$ward_investigations['type'][] = $result->type;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isset($investigation_per_valid[$i]) && $inpatient_status[$i] == 0) {
|
||||
$opd_investigations['id'][] = $investigation->id;
|
||||
$opd_investigations['name'][] = $investigation->name;
|
||||
$opd_investigations['type'][] = $investigation->type;
|
||||
$opd_investigations['slug'][] = $investigation->slug;
|
||||
$opd_investigations['value'][] = "Pending";
|
||||
$opd_investigations['comment'][] = "Pending";
|
||||
if ($inpatient_status[$i] == 0) {
|
||||
if (isset($investigation_ids[$i]) && $investigation_ids[$i] != "") {
|
||||
$result = Investigation::where('id', $investigation_ids[$i])->first();
|
||||
$opd_investigations['name'][] = $result->name;
|
||||
$opd_investigations['value'][] = "Pending";
|
||||
|
||||
if($result->range_type == 1) {
|
||||
$opd_investigations['normal_ranges'][] = get_dynamic_normal_range($result->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients'));
|
||||
} else {
|
||||
$opd_investigations['normal_ranges'][] = $result->normal_ranges;
|
||||
}
|
||||
|
||||
$opd_investigations['comment'][] = "Pending";
|
||||
}
|
||||
} else {
|
||||
$ward_investigations['id'][] = $investigation->id;
|
||||
$ward_investigations['name'][] = $investigation->name;
|
||||
$ward_investigations['type'][] = $investigation->type;
|
||||
$ward_investigations['slug'][] = $investigation->slug;
|
||||
$ward_investigations['value'][] = "Pending";
|
||||
$ward_investigations['comment'][] = "Pending";
|
||||
if (isset($investigation_ids[$i]) && $investigation_ids[$i] != "") {
|
||||
$result = Investigation::where('id', $investigation_ids[$i])->first();
|
||||
$ward_investigations['name'][] = $result->name;
|
||||
$ward_investigations['value'][] = "Pending";
|
||||
$ward_investigations['comment'][] = "Pending";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1439,27 +1487,58 @@ class ConsultationController extends Controller
|
||||
}
|
||||
} else {
|
||||
for ($i = 0; $i < count($inpatient_status); $i++) {
|
||||
if (isset($inpatient_status[$i]) && $inpatient_status[$i] == 0) {
|
||||
$result = Investigation::withTrashed()->find($investigation_ids[$i]);
|
||||
$opd_investigations['id'][] = $result->id;
|
||||
$opd_investigations['name'][] = $result->name;
|
||||
$opd_investigations['type'][] = $result->type;
|
||||
$opd_investigations['slug'][] = $result->slug;
|
||||
$opd_investigations['value'][] = "Pending";
|
||||
$opd_investigations['comment'][] = "Pending";
|
||||
if ($inpatient_status[$i] == 0) {
|
||||
if (isset($investigation_ids[$i]) && $investigation_ids[$i] != "") {
|
||||
$result = Investigation::where('id', $investigation_ids[$i])->first();
|
||||
$opd_investigations['name'][] = $result->name;
|
||||
$opd_investigations['value'][] = "Pending";
|
||||
|
||||
if($result->range_type == 1) {
|
||||
$opd_investigations['normal_ranges'][] = get_dynamic_normal_range($result->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients'));
|
||||
} else {
|
||||
$opd_investigations['normal_ranges'][] = $result->normal_ranges;
|
||||
}
|
||||
|
||||
$opd_investigations['comment'][] = "Pending";
|
||||
}
|
||||
} else {
|
||||
$result = Investigation::withTrashed()->find($investigation_ids[$i]);
|
||||
$ward_investigations['id'][] = $result->id;
|
||||
$ward_investigations['name'][] = $result->name;
|
||||
$ward_investigations['type'][] = $result->type;
|
||||
$ward_investigations['slug'][] = $result->slug;
|
||||
$ward_investigations['value'][] = "Pending";
|
||||
$ward_investigations['comment'][] = "Pending";
|
||||
if (isset($investigation_ids[$i]) && $investigation_ids[$i] != "") {
|
||||
$result = Investigation::where('id', $investigation_ids[$i])->first();
|
||||
$ward_investigations['name'][] = $result->name;
|
||||
$ward_investigations['value'][] = "Pending";
|
||||
$ward_investigations['comment'][] = "Pending";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* ====== end work on investigations */
|
||||
$ordered_procedures = OrderedProcedure::where(['patient_id' => $patient_id, 'episode_id' => $episode_id])->get();
|
||||
$procedures = DB::table('procedures')->where('available', 1)->pluck("name", "id");
|
||||
$cons_notes = WardInpatientDetailedNote::where(['patient_id' => $patient_id, 'episode_id' => $episode_id, 'ward_id' => 0])->latest()->get(['investigation_and_management_plan_comments', 'clinic_examination_comments', 'history_comments', 'created_by']);
|
||||
$priority_signs = $emergent_signs =[];
|
||||
$dateBorn = Carbon::parse($patient->date_of_birth);
|
||||
$years = $dateBorn->diffInYears();
|
||||
if(between($years, 0, 12) && !empty($triage)) {
|
||||
$priority_signs_records = PrioritySign::where('triage_id', $triage->id)->first();
|
||||
|
||||
if ($priority_signs_records) {
|
||||
$priority_signs = unserialize($priority_signs_records->signs);
|
||||
}
|
||||
|
||||
$emergency_signs = EmergencySign::where('triage_id', $triage->id)->first();
|
||||
|
||||
if (!empty($emergency_signs)) {
|
||||
$airway = unserialize($emergency_signs->airway);
|
||||
$circulation = unserialize($emergency_signs->circulation);
|
||||
$neurological = unserialize($emergency_signs->neurological);
|
||||
$dehydration = unserialize($emergency_signs->dehydration);
|
||||
$emergencySigns= array_merge($airway,$circulation, $dehydration,$neurological);
|
||||
foreach($emergencySigns as $key => $sign) if($sign == 'Yes') $emergent_signs[] = $key;
|
||||
}
|
||||
}
|
||||
// get all symptoms
|
||||
$symptoms = DB::table('symptoms')->where('available', 1)->pluck("name", "id");
|
||||
|
||||
$data = [
|
||||
'patient' => $patient,
|
||||
@@ -1469,12 +1548,20 @@ class ConsultationController extends Controller
|
||||
'patient_discount' => $patient_discount,
|
||||
'ward_investigations' => $ward_investigations,
|
||||
'opd_investigations' => $opd_investigations,
|
||||
'opd_investigations_position' => $opd_investigations_position,
|
||||
'ward_investigations_position' => $ward_investigations_position,
|
||||
'ordered_procedures' => $ordered_procedures,
|
||||
'procedures' => $procedures,
|
||||
'treatments' => $treatments,
|
||||
'all_diagnoses' => $all_diagnoses,
|
||||
'cons_notes' => $cons_notes,
|
||||
'triage' => $triage,
|
||||
'years' => $years,
|
||||
'symptoms' => $symptoms,
|
||||
'priority_signs' => $priority_signs,
|
||||
'emergent_signs' => $emergent_signs,
|
||||
'opd_investigations_date' => $opd_investigations_date,
|
||||
'ward_investigations_date' => $ward_investigations_date
|
||||
];
|
||||
|
||||
// return view('patients::consultations/referral_notes_print', $data);
|
||||
$pdf = SnappyPDF::loadView('patients::consultations/referral_notes_print', $data)
|
||||
->setOrientation('portrait')
|
||||
->setOption('margin-bottom', 7)
|
||||
@@ -1493,4 +1580,26 @@ class ConsultationController extends Controller
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
public function delete_consultation_clinical_notes($id)
|
||||
{
|
||||
$ward_doctor_notes = WardInpatientDetailedNote::find($id);
|
||||
$ward_doctor_notes->delete();
|
||||
|
||||
flash('Notes have been deleted')->success();
|
||||
return redirect('in_patient_sheet');
|
||||
}
|
||||
|
||||
public function update_consultation_clinical_notes(Request $request)
|
||||
{
|
||||
$consultation_clinical_notes = WardInpatientDetailedNote::find($request->id);
|
||||
$consultation_clinical_notes->history_comments = $request->history_comments?? null;
|
||||
$consultation_clinical_notes->investigation_and_management_plan_comments = $request->investigation_and_management_plan_comments?? null;
|
||||
$consultation_clinical_notes->clinic_examination_comments = $request->clinic_examination_comments?? null;
|
||||
$consultation_clinical_notes->updated_by = Auth::user()->id;
|
||||
|
||||
if($consultation_clinical_notes->save()) return $consultation_clinical_notes->id;
|
||||
else return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+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;
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+210
-147
@@ -43,6 +43,13 @@ use Streamline\Models\User;
|
||||
use Streamline\Models\Consultation;
|
||||
use Streamline\Models\OrderedSundry;
|
||||
use Streamline\Models\Services;
|
||||
use Streamline\Models\WardInpatientDetailedNote;
|
||||
use Streamline\Models\GeneralSettings;
|
||||
use Streamline\Models\DischargeMortalityRisk;
|
||||
use Barryvdh\DomPDF\Facade\Pdf as DomPDF;
|
||||
|
||||
|
||||
|
||||
|
||||
class PatientEpisodeController extends Controller
|
||||
{
|
||||
@@ -71,7 +78,7 @@ class PatientEpisodeController extends Controller
|
||||
$categories = DB::table('patient_categories')->where('available', 1)->pluck("name", "id");
|
||||
$marital_statuses = DB::table('marital_statuses')->pluck("name", "id");
|
||||
$diagnoses = DB::table('diagnoses')->where('available', 1)->pluck("name", "id");
|
||||
$clinics = DB::table('clinics')->pluck("name", "id")->prepend('- select -', '');;
|
||||
$clinics = DB::table('clinics')->pluck("name", "id")->prepend('- select -', '');
|
||||
$relationships = DB::table('family_relations')->pluck('name', 'id');
|
||||
$occupations = DB::table('occupations')->pluck('name', 'id');
|
||||
$patient_categories = DB::table('patient_categories')->where('available', 1)->pluck('name', 'id');
|
||||
@@ -86,7 +93,7 @@ class PatientEpisodeController extends Controller
|
||||
$known_patient_alerts = Alert::where('patient_id', $patient_id)->orderBy('created_at', 'desc')->take(2)->get();
|
||||
$drug_categories_array = DB::table('drug_categories')->pluck('name', 'id');
|
||||
//$special_clinics = DB::table('clinics')->where('slug', '!=', 'general')->pluck("name", "id")->prepend('GENERAL OPD', 'general_opd')->prepend('- select -', '');
|
||||
$special_clinics = DB::table('clinics')->where('available', 1)->whereNull('deleted_at')->pluck("name", "id")->prepend('- select -', '');
|
||||
$special_clinics = DB::table('clinics')->where('available', 1)->whereNull('deleted_at')->orderBy('name', 'asc')->pluck("name", "id")->prepend('- select -', '');
|
||||
$wards = DB::table('wards')->where('available', 1)->whereNull('deleted_at')->pluck("name", "id")->prepend('- select -', '');
|
||||
$users_collection = DB::table('users')->orderBy("first_name", "asc")->select("id")->get()->toArray();
|
||||
$users_array = [];
|
||||
@@ -209,11 +216,8 @@ class PatientEpisodeController extends Controller
|
||||
return redirect('/patient_episodes/');
|
||||
}
|
||||
} catch (QueryException $e) {
|
||||
$errorCode = $e->errorInfo[1];
|
||||
if ($errorCode == 1062) { //error code for duplicate entry to a unique field
|
||||
flash("This episode already exists!")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
flash("An error occurred")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -238,7 +242,6 @@ class PatientEpisodeController extends Controller
|
||||
*/
|
||||
public function route_patient_episode(Request $request)
|
||||
{
|
||||
|
||||
//set session for episode_id
|
||||
session()->put('episode_id', $request->episode_id);
|
||||
$is_patient_allowed_to_do_consultation = $this->is_patient_allowed_to_have_consultation(session()->get('patient_id'), $request->episode_id);
|
||||
@@ -315,7 +318,7 @@ class PatientEpisodeController extends Controller
|
||||
case 'base_refraction_exam':
|
||||
return redirect('/eye_clinic/base_exam_refraction');
|
||||
case 'eye_glasses':
|
||||
return redirect('/eye_glasses/order');
|
||||
return redirect('/opticals/order');
|
||||
case 'treatment_sheet':
|
||||
session()->put(['treatment_sheet_route' => 'patient_home']);
|
||||
return redirect('treatment_sheet/view');
|
||||
@@ -447,7 +450,7 @@ class PatientEpisodeController extends Controller
|
||||
$service_order->updated_by = auth()->user()->id;
|
||||
$service_order->save();
|
||||
|
||||
$episode->consultation_id = $consultation->id;
|
||||
$episode->consultation_id = $consultation_record->id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -520,11 +523,8 @@ class PatientEpisodeController extends Controller
|
||||
|
||||
return redirect('/patient_episodes/');
|
||||
} catch (QueryException $e) {
|
||||
$errorCode = $e->errorInfo[1];
|
||||
if ($errorCode == 1062) { //error code for duplicate entry to a unique field
|
||||
flash("This episode already exists!")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
flash("An error occurred")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -560,11 +560,8 @@ class PatientEpisodeController extends Controller
|
||||
flash("Patient admitted in " . $ward_name)->success();
|
||||
return redirect('/patient_episodes/');
|
||||
} catch (QueryException $e) {
|
||||
$errorCode = $e->errorInfo[1];
|
||||
if ($errorCode == 1062) { //error code for duplicate entry to a unique field
|
||||
flash("This episode already exists!")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
flash("An error occurred")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -749,11 +746,8 @@ class PatientEpisodeController extends Controller
|
||||
|
||||
return redirect('/patient_episodes/');
|
||||
} catch (QueryException $e) {
|
||||
$errorCode = $e->errorInfo[1];
|
||||
if ($errorCode == 1062) { //error code for duplicate entry to a unique field
|
||||
flash("This episode already exists!")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
flash("An error occurred")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -775,17 +769,18 @@ class PatientEpisodeController extends Controller
|
||||
flash("Episode has started")->success();
|
||||
return redirect('/investigations/investigations_review');
|
||||
} catch (QueryException $e) {
|
||||
$errorCode = $e->errorInfo[1];
|
||||
if ($errorCode == 1062) { //error code for duplicate entry to a unique field
|
||||
flash("This episode already exists!")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
flash("An error occurred")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
public function episode_summary($episode_id)
|
||||
{
|
||||
$patient_id = session()->get('patient_id');
|
||||
$general_settings = json_decode(GeneralSettings::find(1)->data, true);
|
||||
$episode_summary_content_setting = $general_settings['episode_summary_content'] ?? '';
|
||||
|
||||
|
||||
|
||||
if(is_eye_module_enabled() && is_patient_in_eye_clinic($episode_id)) {
|
||||
$main_exam = EyeClinicMainExam::where(['patient_id' => $patient_id, 'episode_id' => $episode_id])->first();
|
||||
@@ -813,10 +808,35 @@ class PatientEpisodeController extends Controller
|
||||
$sundries_results = Sundry::select('id', 'name')->get();
|
||||
/* Patient File : It should show Diagnosis, Prescriptions, Lab results, Procedures */
|
||||
$consultation = Consultation::where(['patient_id' => $patient_id, 'episode_id' => $episode_id])->first();
|
||||
$treatments = Treatment::where(["patient_id" => $patient_id, "episode_id" => $episode_id])->get(); //fetch treatment the way Douglas fetches it in printing the treatment receipt
|
||||
$ordered_procedures = OrderedProcedure::where(['patient_id' => $patient_id, 'episode_id' => $episode_id])->get();
|
||||
$ordered_sundries = OrderedSundry::where(['patient_id' => $patient_id, 'episode_id' => $episode_id])->get();
|
||||
$ordered_services = OrderedService::where(['patient_id' => $patient_id, 'episode_id' => $episode_id])->get();
|
||||
|
||||
$treatments = null;
|
||||
if (is_array($episode_summary_content_setting) && in_array(10, $episode_summary_content_setting ?? '') ){
|
||||
$treatments = Treatment::where(["patient_id" => $patient_id, "episode_id" => $episode_id])->get();
|
||||
|
||||
}
|
||||
|
||||
|
||||
$ordered_procedures = null;
|
||||
|
||||
|
||||
if (is_array($episode_summary_content_setting) && in_array(4, $episode_summary_content_setting ?? '') ){
|
||||
$ordered_procedures = OrderedProcedure::where(['patient_id' => $patient_id, 'episode_id' => $episode_id])->get();
|
||||
|
||||
}
|
||||
|
||||
|
||||
$ordered_sundries = null;
|
||||
if (is_array($episode_summary_content_setting) && in_array(8, $episode_summary_content_setting ?? '') ){
|
||||
$ordered_sundries = OrderedSundry::where(['patient_id' => $patient_id, 'episode_id' => $episode_id])->get();
|
||||
}
|
||||
|
||||
|
||||
$ordered_services = null;
|
||||
if (is_array($episode_summary_content_setting) && in_array(6, $episode_summary_content_setting ?? '') ){
|
||||
$ordered_services = OrderedService::where(['patient_id' => $patient_id, 'episode_id' => $episode_id])->get();
|
||||
}
|
||||
|
||||
|
||||
$inpatient_infos = InpatientInfo::where(['patient_id' => $patient_id, 'episode_id' => $episode_id])->get();
|
||||
$antenatal_data = DB::table('ante_natal_clinic_followups')->where(['patient_id' => $patient_id, 'episode_id' => $episode_id])->first();
|
||||
|
||||
@@ -833,67 +853,47 @@ class PatientEpisodeController extends Controller
|
||||
|
||||
//triage details
|
||||
$triage = null;
|
||||
if ($episode && $episode->triage_id) {
|
||||
$triage = \Streamline\Models\Triage::where(['id' => $episode->triage_id])->first();
|
||||
}
|
||||
if (is_array($episode_summary_content_setting) && in_array(3, $episode_summary_content_setting ?? '') ){
|
||||
if ($episode && $episode->triage_id) {
|
||||
$triage = \Streamline\Models\Triage::where(['id' => $episode->triage_id])->first();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// get all symptoms
|
||||
$symptoms = DB::table('symptoms')->where('available', 1)->pluck("name", "id");
|
||||
$symptoms = '';
|
||||
if (is_array($episode_summary_content_setting) && in_array(5, $episode_summary_content_setting ?? '') ){
|
||||
$symptoms = DB::table('symptoms')->where('available', 1)->pluck("name", "id");
|
||||
}
|
||||
|
||||
|
||||
foreach ($ordered_investigations as $investigation) {
|
||||
$investigation_ids = explode(",", $investigation->investigation_id);
|
||||
$inpatient_status = explode(",", $investigation->for_inpatient);
|
||||
// investigations setting check
|
||||
if (is_array($episode_summary_content_setting) && in_array(2, $episode_summary_content_setting ?? '') ){
|
||||
foreach ($ordered_investigations as $investigation) {
|
||||
$investigation_ids = explode(",", $investigation->investigation_id);
|
||||
$inpatient_status = explode(",", $investigation->for_inpatient);
|
||||
|
||||
// check if results are available for this investigation
|
||||
if (in_array($investigation->id, $investigation_results_order_ids)) {
|
||||
// get the key if available
|
||||
$key = array_search($investigation->id, $investigation_results_order_ids);
|
||||
// check if results are available for this investigation
|
||||
if (in_array($investigation->id, $investigation_results_order_ids)) {
|
||||
// get the key if available
|
||||
$key = array_search($investigation->id, $investigation_results_order_ids);
|
||||
|
||||
// get the results object
|
||||
$results = InvestigationResults::find($key);
|
||||
// get the results object
|
||||
$results = InvestigationResults::find($key);
|
||||
|
||||
// exclude obstetric u/s results
|
||||
if ($results->result_type != "Ultrasound_Obstetric") {
|
||||
$investigation_results = explode(",", $results->value);
|
||||
$investigation_per_valid = explode(",", $results->per_investigation);
|
||||
$investigation_comments = explode(",", $results->comment);
|
||||
// exclude obstetric u/s results
|
||||
if ($results->result_type != "Ultrasound_Obstetric") {
|
||||
$investigation_results = explode(",", $results->value);
|
||||
$investigation_per_valid = explode(",", $results->per_investigation);
|
||||
$investigation_comments = explode(",", $results->comment);
|
||||
|
||||
if ($results->all_authenticated == 1) {
|
||||
for ($i = 0; $i < count($inpatient_status); $i++) {
|
||||
if ($inpatient_status[$i] == 0) {
|
||||
if (isset($investigation_ids[$i]) && $investigation_ids[$i] != "") {
|
||||
$result = Investigation::where('id', $investigation_ids[$i])->first();
|
||||
$opd_investigations['name'][] = $result->name;
|
||||
$opd_investigations['value'][] = $investigation_results[$i];
|
||||
$opd_investigations['comment'][] = $investigation_comments[$i];
|
||||
|
||||
if($result->range_type == 1) {
|
||||
$opd_investigations['normal_ranges'][] = get_dynamic_normal_range($result->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients'));
|
||||
} else {
|
||||
$opd_investigations['normal_ranges'][] = $result->normal_ranges;
|
||||
}
|
||||
|
||||
$opd_investigations['type'][] = $result->type;
|
||||
}
|
||||
} else {
|
||||
if (isset($investigation_ids[$i]) && $investigation_ids[$i] != "") {
|
||||
$result = Investigation::where('id', $investigation_ids[$i])->first();
|
||||
$ward_investigations['name'][] = $result->name;
|
||||
$ward_investigations['value'][] = $investigation_results[$i];
|
||||
$ward_investigations['comment'][] = $investigation_comments[$i];
|
||||
$ward_investigations['type'][] = $result->type;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for ($i = 0; $i < count($inpatient_status); $i++) {
|
||||
if ($investigation_per_valid[$i] == 1) {
|
||||
// this investigation is authenticated
|
||||
if ($results->all_authenticated == 1) {
|
||||
for ($i = 0; $i < count($inpatient_status); $i++) {
|
||||
if ($inpatient_status[$i] == 0) {
|
||||
if (isset($investigation_ids[$i]) && $investigation_ids[$i] != "") {
|
||||
$result = Investigation::where('id', $investigation_ids[$i])->first();
|
||||
$opd_investigations['name'][] = $result->name;
|
||||
$opd_investigations['value'][] = $investigation_results[$i];
|
||||
$opd_investigations['comment'][] = $investigation_comments[$i];
|
||||
|
||||
if($result->range_type == 1) {
|
||||
$opd_investigations['normal_ranges'][] = get_dynamic_normal_range($result->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients'));
|
||||
@@ -901,7 +901,6 @@ class PatientEpisodeController extends Controller
|
||||
$opd_investigations['normal_ranges'][] = $result->normal_ranges;
|
||||
}
|
||||
|
||||
$opd_investigations['comment'][] = $investigation_comments[$i];
|
||||
$opd_investigations['type'][] = $result->type;
|
||||
}
|
||||
} else {
|
||||
@@ -913,69 +912,117 @@ class PatientEpisodeController extends Controller
|
||||
$ward_investigations['type'][] = $result->type;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($inpatient_status[$i] == 0) {
|
||||
if (isset($investigation_ids[$i]) && $investigation_ids[$i] != "") {
|
||||
$result = Investigation::where('id', $investigation_ids[$i])->first();
|
||||
$opd_investigations['name'][] = $result->name;
|
||||
$opd_investigations['value'][] = "Pending";
|
||||
}
|
||||
} else {
|
||||
for ($i = 0; $i < count($inpatient_status); $i++) {
|
||||
if ($investigation_per_valid[$i] == 1) {
|
||||
// this investigation is authenticated
|
||||
if ($inpatient_status[$i] == 0) {
|
||||
if (isset($investigation_ids[$i]) && $investigation_ids[$i] != "") {
|
||||
$result = Investigation::where('id', $investigation_ids[$i])->first();
|
||||
$opd_investigations['name'][] = $result->name;
|
||||
$opd_investigations['value'][] = $investigation_results[$i];
|
||||
|
||||
if($result->range_type == 1) {
|
||||
$opd_investigations['normal_ranges'][] = get_dynamic_normal_range($result->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients'));
|
||||
} else {
|
||||
$opd_investigations['normal_ranges'][] = $result->normal_ranges;
|
||||
if($result->range_type == 1) {
|
||||
$opd_investigations['normal_ranges'][] = get_dynamic_normal_range($result->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients'));
|
||||
} else {
|
||||
$opd_investigations['normal_ranges'][] = $result->normal_ranges;
|
||||
}
|
||||
|
||||
$opd_investigations['comment'][] = $investigation_comments[$i];
|
||||
$opd_investigations['type'][] = $result->type;
|
||||
}
|
||||
} else {
|
||||
if (isset($investigation_ids[$i]) && $investigation_ids[$i] != "") {
|
||||
$result = Investigation::where('id', $investigation_ids[$i])->first();
|
||||
$ward_investigations['name'][] = $result->name;
|
||||
$ward_investigations['value'][] = $investigation_results[$i];
|
||||
$ward_investigations['comment'][] = $investigation_comments[$i];
|
||||
$ward_investigations['type'][] = $result->type;
|
||||
}
|
||||
|
||||
$opd_investigations['comment'][] = "Pending";
|
||||
}
|
||||
} else {
|
||||
if (isset($investigation_ids[$i]) && $investigation_ids[$i] != "") {
|
||||
$result = Investigation::where('id', $investigation_ids[$i])->first();
|
||||
$ward_investigations['name'][] = $result->name;
|
||||
$ward_investigations['value'][] = "Pending";
|
||||
$ward_investigations['comment'][] = "Pending";
|
||||
if ($inpatient_status[$i] == 0) {
|
||||
if (isset($investigation_ids[$i]) && $investigation_ids[$i] != "") {
|
||||
$result = Investigation::where('id', $investigation_ids[$i])->first();
|
||||
$opd_investigations['name'][] = $result->name;
|
||||
$opd_investigations['value'][] = "Pending";
|
||||
|
||||
if($result->range_type == 1) {
|
||||
$opd_investigations['normal_ranges'][] = get_dynamic_normal_range($result->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients'));
|
||||
} else {
|
||||
$opd_investigations['normal_ranges'][] = $result->normal_ranges;
|
||||
}
|
||||
|
||||
$opd_investigations['comment'][] = "Pending";
|
||||
}
|
||||
} else {
|
||||
if (isset($investigation_ids[$i]) && $investigation_ids[$i] != "") {
|
||||
$result = Investigation::where('id', $investigation_ids[$i])->first();
|
||||
$ward_investigations['name'][] = $result->name;
|
||||
$ward_investigations['value'][] = "Pending";
|
||||
$ward_investigations['comment'][] = "Pending";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for ($i = 0; $i < count($inpatient_status); $i++) {
|
||||
if ($inpatient_status[$i] == 0) {
|
||||
if (isset($investigation_ids[$i]) && $investigation_ids[$i] != "") {
|
||||
$result = Investigation::where('id', $investigation_ids[$i])->first();
|
||||
$opd_investigations['name'][] = $result->name;
|
||||
$opd_investigations['value'][] = "Pending";
|
||||
} else {
|
||||
for ($i = 0; $i < count($inpatient_status); $i++) {
|
||||
if ($inpatient_status[$i] == 0) {
|
||||
if (isset($investigation_ids[$i]) && $investigation_ids[$i] != "") {
|
||||
$result = Investigation::where('id', $investigation_ids[$i])->first();
|
||||
$opd_investigations['name'][] = $result->name;
|
||||
$opd_investigations['value'][] = "Pending";
|
||||
|
||||
if($result->range_type == 1) {
|
||||
$opd_investigations['normal_ranges'][] = get_dynamic_normal_range($result->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients'));
|
||||
} else {
|
||||
$opd_investigations['normal_ranges'][] = $result->normal_ranges;
|
||||
if($result->range_type == 1) {
|
||||
$opd_investigations['normal_ranges'][] = get_dynamic_normal_range($result->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients'));
|
||||
} else {
|
||||
$opd_investigations['normal_ranges'][] = $result->normal_ranges;
|
||||
}
|
||||
|
||||
$opd_investigations['comment'][] = "Pending";
|
||||
}
|
||||
} else {
|
||||
if (isset($investigation_ids[$i]) && $investigation_ids[$i] != "") {
|
||||
$result = Investigation::where('id', $investigation_ids[$i])->first();
|
||||
$ward_investigations['name'][] = $result->name;
|
||||
$ward_investigations['value'][] = "Pending";
|
||||
$ward_investigations['comment'][] = "Pending";
|
||||
}
|
||||
|
||||
$opd_investigations['comment'][] = "Pending";
|
||||
}
|
||||
} else {
|
||||
if (isset($investigation_ids[$i]) && $investigation_ids[$i] != "") {
|
||||
$result = Investigation::where('id', $investigation_ids[$i])->first();
|
||||
$ward_investigations['name'][] = $result->name;
|
||||
$ward_investigations['value'][] = "Pending";
|
||||
$ward_investigations['comment'][] = "Pending";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$discharge_mortality_risk = null;
|
||||
$priority_signs_records = null;
|
||||
$emergency_signs = null;
|
||||
$emergencySigns = null;
|
||||
|
||||
if(between($years, 0, 12)) {
|
||||
$priority_signs_records = PrioritySign::where('triage_id', $episode->triage_id)->first();
|
||||
|
||||
|
||||
if (is_array($episode_summary_content_setting) && in_array(9, $episode_summary_content_setting ?? '') ){
|
||||
$priority_signs_records = PrioritySign::where('triage_id', $episode->triage_id)->first();
|
||||
|
||||
}
|
||||
|
||||
if ($priority_signs_records) {
|
||||
$priority_signs = unserialize($priority_signs_records->signs);
|
||||
}
|
||||
|
||||
$emergency_signs = EmergencySign::where('triage_id', $episode->triage_id)->first();
|
||||
|
||||
|
||||
if (is_array($episode_summary_content_setting) && in_array(11, $episode_summary_content_setting ?? '') ){
|
||||
$emergency_signs = EmergencySign::where('triage_id', $episode->triage_id)->first();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (!empty($emergency_signs)) {
|
||||
$airway = unserialize($emergency_signs->airway);
|
||||
$circulation = unserialize($emergency_signs->circulation);
|
||||
@@ -983,10 +1030,22 @@ class PatientEpisodeController extends Controller
|
||||
$dehydration = unserialize($emergency_signs->dehydration);
|
||||
$emergencySigns= array_merge($airway,$circulation, $dehydration,$neurological);
|
||||
foreach($emergencySigns as $key => $sign) if($sign == 'Yes') $emergent_signs[] = $key;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (is_array($episode_summary_content_setting) && in_array(13, $episode_summary_content_setting ?? '') ){
|
||||
$discharge_mortality_risk = DischargeMortalityRisk::where(['patient_id' => $patient_id, 'episode_id' => $episode_id])->first();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
$cons_notes = [];
|
||||
if (is_array($episode_summary_content_setting) && in_array(12, $episode_summary_content_setting ?? '') ){
|
||||
$cons_notes = WardInpatientDetailedNote::where(['patient_id' => $patient_id, 'episode_id' => $episode_id, 'ward_id' => 0])->latest()->get(['investigation_and_management_plan_comments', 'clinic_examination_comments', 'history_comments', 'created_by','created_at']);
|
||||
}
|
||||
|
||||
$data = [
|
||||
'main_exam' => $main_exam,
|
||||
@@ -1016,9 +1075,15 @@ class PatientEpisodeController extends Controller
|
||||
'triage' =>$triage,
|
||||
'priority_signs' => $priority_signs,
|
||||
'emergent_signs'=> $emergent_signs,
|
||||
'years'=>$years
|
||||
'discharge_mortality_risk' => $discharge_mortality_risk,
|
||||
'cons_notes' => $cons_notes,
|
||||
'years'=>$years,
|
||||
'episode_summary_content_setting' => $episode_summary_content_setting,
|
||||
];
|
||||
|
||||
|
||||
// return view('patients::patient_episodes/episode_summary', $data);
|
||||
|
||||
$pdf = SnappyPDF::loadView('patients::patient_episodes/episode_summary', $data)
|
||||
->setOrientation('portrait')
|
||||
->setOption('margin-bottom', 7)
|
||||
@@ -1198,16 +1263,9 @@ class PatientEpisodeController extends Controller
|
||||
return redirect('/patient_episodes/');
|
||||
}
|
||||
} catch (QueryException $e) {
|
||||
$errorCode = $e->errorInfo[1];
|
||||
if ($errorCode == 1062) { //error code for duplicate entry to a unique field
|
||||
flash("This episode already exists!")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
flash("An error occurred")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
/*================= end of creation of new episode on starting an appointment =================*/
|
||||
|
||||
flash("Patient follow up completed successfully")->success();
|
||||
return redirect('/patient_episodes/set_patient_id/' . $patient_id);
|
||||
} else {
|
||||
flash("An error occurred!")->error();
|
||||
return back()->withInput();
|
||||
@@ -1241,7 +1299,7 @@ class PatientEpisodeController extends Controller
|
||||
|
||||
$diagnoses = DB::table('diagnoses')->where('available', 1)->pluck("name", "id");
|
||||
$clinics = DB::table('clinics')->pluck("name", "id")->prepend('- select -', '');
|
||||
$special_clinics = DB::table('clinics')->where('available', 1)->whereNull('deleted_at')->pluck("name", "id")->prepend('- select -', '');
|
||||
$special_clinics = DB::table('clinics')->where('available', 1)->whereNull('deleted_at')->orderBy('name', 'asc')->pluck("name", "id")->prepend('- select -', '');
|
||||
$wards = DB::table('wards')->where('available', 1)->pluck("name", "id")->prepend('- select -', '');
|
||||
$users_collection = DB::table('users')->orderBy("first_name", "asc")->select("id")->get()->toArray();
|
||||
$users_array = [];
|
||||
@@ -1595,7 +1653,9 @@ class PatientEpisodeController extends Controller
|
||||
$ordered_sundry->episode_id = $episode_id_to_keep;
|
||||
$ordered_sundry->update();
|
||||
}
|
||||
$tables = ['ward_inpatient_sheet_nurse_comments', 'ward_inpatient_detailed_notes', 'ward_dispensing_per_charts', 'patient_documents', 'patient_one_off_discounts', 'triage_nutrition', 'triage_news', 'surgeries', 'sundries_deposits', 'smart_triage', 'patient_refunds', 'patient_account_consumptions', 'patient_appointments', 'phone_followup_patients', 'point_of_sale_records', 'procedure_deposits', 'cancel_patient_transactions', 'central_billing_deposits', 'chronic_patients', 'chi_deposits', 'debtors', 'debt_plan', 'dependants_consumptions', 'family_account_consumptions', 'inpatient_attendant_passes', 'inpatient_ward_discounts', 'inpatient_sheet_audits', 'maternity_delivery_records', 'maternity_inpatients', 'mental_health_consultation', 'ordered_investigations', 'ordered_procedures'];
|
||||
|
||||
// TODO Refactor this merge to be in a separate controller and remove repeated table throughs by using one-to-many relationships
|
||||
$tables = ['ward_inpatient_sheet_nurse_comments', 'ward_inpatient_detailed_notes', 'patient_documents', 'patient_one_off_discounts', 'triage_nutrition', 'triage_news', 'surgeries', 'sundries_deposits', 'smart_triage', 'patient_refunds', 'patient_account_consumptions', 'patient_appointments', 'phone_followup_patients', 'point_of_sale_records', 'procedure_deposits', 'cancel_patient_transactions', 'central_billing_deposits', 'chronic_patients', 'chi_deposits', 'debtors', 'debt_plan', 'dependants_consumptions', 'family_account_consumptions', 'inpatient_attendant_passes', 'inpatient_ward_discounts', 'inpatient_sheet_audits', 'maternity_delivery_records', 'maternity_inpatients', 'mental_health_consultation', 'ordered_investigations', 'ordered_procedures'];
|
||||
foreach ($tables as $table) {
|
||||
$episodes = DB::table($table)->where('episode_id', $episode_id_to_delete)->get();
|
||||
foreach ($episodes as $episode) DB::table($table)->where('id', $episode->id)->update(['episode_id' => $episode_id_to_keep]);
|
||||
@@ -1616,12 +1676,15 @@ class PatientEpisodeController extends Controller
|
||||
|
||||
public function check_clinical_consultation_payment(Request $request)
|
||||
{
|
||||
$service_deposit = \Streamline\Models\ServiceDeposit::where('episode_id', $request->episode_id)->first();
|
||||
if ($service_deposit) {
|
||||
return "paid";
|
||||
}
|
||||
|
||||
return "unpaid";
|
||||
$is_patient_allowed_to_do_consultation = $this->is_patient_allowed_to_have_consultation($request->patient_id, $request->episode_id);
|
||||
if ($is_patient_allowed_to_do_consultation) {
|
||||
if($request->action == 'consultation_with_notes') session()->put('consultation_with_notes', 1);
|
||||
else session()->put('consultation_with_notes', 0);
|
||||
session()->put(['patient_id' => $request->patient_id]);
|
||||
session()->put(['episode_id' => $request->episode_id]);
|
||||
return response()->json('/consultation/route');
|
||||
}
|
||||
else return response()->json("unpaid");
|
||||
}
|
||||
|
||||
public function is_patient_allowed_to_have_consultation($patient_id, $episode_id)
|
||||
|
||||
+14
-7
@@ -5,6 +5,7 @@ namespace Modules\Patients\Http\Controllers;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\View\View;
|
||||
use Streamline\Models\Clinic;
|
||||
use Streamline\Models\PatientEpisode;
|
||||
use Streamline\Models\InpatientInfo;
|
||||
@@ -18,7 +19,8 @@ class PatientFlowMonitoringController extends Controller {
|
||||
$this->middleware('permission:patient-flow-monitoring');
|
||||
}
|
||||
|
||||
public function index(Request $request){
|
||||
public function index(Request $request): View
|
||||
{
|
||||
$clinic_id = $request->clinic_id;
|
||||
$search_by = $request->search_by;
|
||||
$reg_date = $request->reg_date;
|
||||
@@ -42,11 +44,13 @@ class PatientFlowMonitoringController extends Controller {
|
||||
session()->put('order_by', $order_by);
|
||||
}
|
||||
|
||||
if($search_by === 0){
|
||||
// last 24 hours
|
||||
|
||||
|
||||
|
||||
if($search_by == 3){
|
||||
//yesterday
|
||||
$start_date_search = Carbon::yesterday()->startOfDay()->toDateTimeString();
|
||||
$end_date_search = Carbon::yesterday()->endOfDay()->toDateTimeString();
|
||||
|
||||
$date_search = "Yesterday";
|
||||
} elseif($search_by == 1){
|
||||
// custom date
|
||||
@@ -70,14 +74,14 @@ class PatientFlowMonitoringController extends Controller {
|
||||
|
||||
switch (get_select_clinic_order_type()) {
|
||||
case 0:
|
||||
if ($order_by == 0) {
|
||||
if ($order_by == 1) {
|
||||
$order_by_text = "patient_episodes.id";
|
||||
} else {
|
||||
$order_by_text = "triage.severe_grade desc, patient_episodes.id";
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if ($order_by == 0) {
|
||||
if ($order_by == 1) {
|
||||
$order_by_text = "patient_episodes.id desc";
|
||||
} else {
|
||||
$order_by_text = "triage.severe_grade desc, patient_episodes.id desc";
|
||||
@@ -85,7 +89,7 @@ class PatientFlowMonitoringController extends Controller {
|
||||
break;
|
||||
case 2:
|
||||
default:
|
||||
if ($order_by == 0) {
|
||||
if ($order_by == 1) {
|
||||
$order_by_text = "consultations.completed, patient_episodes.id";
|
||||
} else {
|
||||
$order_by_text = "consultations.completed, triage.severe_grade desc, patient_episodes.id";
|
||||
@@ -94,6 +98,7 @@ class PatientFlowMonitoringController extends Controller {
|
||||
}
|
||||
|
||||
if($clinic_id == 0){
|
||||
//opd
|
||||
$patient_episodes = DB::table('patient_episodes')
|
||||
->whereNull('patient_episodes.deleted_at')
|
||||
->leftJoin('consultations', 'patient_episodes.id', '=', 'consultations.episode_id')
|
||||
@@ -105,6 +110,7 @@ class PatientFlowMonitoringController extends Controller {
|
||||
->paginate(200);
|
||||
$clinic_name = "OPD";
|
||||
} else {
|
||||
//other clinics
|
||||
$patient_episodes = DB::table('patient_episodes')
|
||||
->whereNull('patient_episodes.deleted_at')
|
||||
->leftJoin('consultations', 'patient_episodes.id', '=', 'consultations.episode_id')
|
||||
@@ -128,6 +134,7 @@ class PatientFlowMonitoringController extends Controller {
|
||||
|
||||
$wards = DB::table('wards')->where('available', 1)->whereNull('deleted_at')->pluck("name", "id")->prepend('- select -', '');
|
||||
|
||||
// dd($date_search);
|
||||
return view('patients::patient_flow_monitoring.index', compact('patient_episodes', 'clinics', 'patient_categories','clinic_name','search_by', 'date_search', 'wards', 'diagnoses'));
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ use Illuminate\Database\QueryException;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Streamline\Models\Drug;
|
||||
use Streamline\Models\EyeGlasses;
|
||||
use Streamline\Models\HospitalInformation;
|
||||
@@ -21,9 +22,14 @@ use Streamline\Models\ReferralHospital;
|
||||
use Streamline\Models\Sundry;
|
||||
use Streamline\Models\Services;
|
||||
use Streamline\Models\Treatment;
|
||||
use Streamline\Services\ItemsStockService;
|
||||
|
||||
class PointOfSaleController extends Controller {
|
||||
|
||||
public function __construct(protected ItemsStockService $itemStockService)
|
||||
{
|
||||
}
|
||||
|
||||
public function index(Request $request){
|
||||
$search_text = "";
|
||||
|
||||
@@ -68,7 +74,8 @@ class PointOfSaleController extends Controller {
|
||||
return view('patients::point_of_sale.order_items', compact('drugs', 'eye_glasses', 'sundries', 'referral_hospitals', 'services'));
|
||||
}
|
||||
|
||||
public function confirm_items(Request $request){
|
||||
public function confirm_items(Request $request)
|
||||
{
|
||||
$pre_ordered_eye_glasses = [];
|
||||
$manual_patient_prescriptions = [];
|
||||
$automatic_patient_prescriptions = [];
|
||||
@@ -87,8 +94,8 @@ class PointOfSaleController extends Controller {
|
||||
$episode = new PatientEpisode;
|
||||
$episode->patient_id = $patient_id;
|
||||
$episode->paid_over = "pos";
|
||||
$episode->created_by = Auth::user()->id;
|
||||
$episode->updated_by = Auth::user()->id;
|
||||
$episode->created_by = Auth::id();
|
||||
$episode->updated_by = Auth::id();
|
||||
$episode->save();
|
||||
flash('A new episode for patient with patient number ' . $patient_number . ' has been initiated.');
|
||||
|
||||
@@ -106,7 +113,7 @@ class PointOfSaleController extends Controller {
|
||||
$patient->phone = $request->phone_number ?? "";
|
||||
$patient->referred_from = $request->referral_hospital ?? 1;
|
||||
$patient->category_id = 1;
|
||||
$patient->created_by = Auth::user()->id;
|
||||
$patient->created_by = Auth::id();
|
||||
$patient->gender = $request->gender ?? 2;
|
||||
|
||||
if (is_null($request->date_of_birth)) {
|
||||
@@ -133,8 +140,8 @@ class PointOfSaleController extends Controller {
|
||||
$episode->patient_id = $patient_id;
|
||||
$episode->clinic_id = get_default_hospital_clinic();
|
||||
$episode->paid_over = "pos";
|
||||
$episode->created_by = Auth::user()->id;
|
||||
$episode->updated_by = Auth::user()->id;
|
||||
$episode->created_by = Auth::id();
|
||||
$episode->updated_by = Auth::id();
|
||||
|
||||
try {
|
||||
$episode->save();
|
||||
@@ -148,16 +155,39 @@ class PointOfSaleController extends Controller {
|
||||
|
||||
if ($request->selected_eye_glasses) {
|
||||
$pre_ordered_eye_glasses = EyeGlasses::whereIn('id', $request->selected_eye_glasses)->get();
|
||||
if (stock_levels_to_consider() == 0) {//getting total stock for optical from both stores and pharmacy
|
||||
foreach($pre_ordered_eye_glasses as $eye) {$eye->total_stock = $this->itemStockService->getItemAllQuantityByTotal($eye->id, 7);}
|
||||
} else{//getting total stock for opticals from pharmacy
|
||||
foreach($pre_ordered_eye_glasses as $eye) {$eye->total_stock = $this->itemStockService->getItemQuantity('pharmacy_stock',$eye->id, 7);}
|
||||
}
|
||||
|
||||
}
|
||||
if ($request->selected_drugs) {
|
||||
if($request->manual_drug_select == 1){
|
||||
$manual_patient_prescriptions = Drug::whereIn('id', $request->selected_drugs)->get();
|
||||
if (stock_levels_to_consider() == 0) {//getting total stock for drugs from both stores and pharmacy
|
||||
foreach($manual_patient_prescriptions as $drug) {$drug->total_stock = $this->itemStockService->getItemAllQuantityByTotal($drug->id, 1);}
|
||||
} else {//getting total stock for drugs from pharmacy
|
||||
foreach($manual_patient_prescriptions as $drug) {$drug->total_stock = $this->itemStockService->getItemQuantity('pharmacy_stock',$drug->id, 1);}
|
||||
}
|
||||
|
||||
}else if($request->automatic_drug_select == 1){
|
||||
$automatic_patient_prescriptions = Drug::whereIn('id', $request->selected_drugs)->get();
|
||||
if (stock_levels_to_consider() == 0) {//getting total stock for drugs from both stores and pharmacy
|
||||
foreach($automatic_patient_prescriptions as $drug) {$drug->total_stock = $this->itemStockService->getItemAllQuantityByTotal($drug->id, 1);}
|
||||
} else{//getting total stock for optical from pharmacy
|
||||
foreach($automatic_patient_prescriptions as $drug) {$drug->total_stock = $this->itemStockService->getItemQuantity('pharmacy_stock',$drug->id, 1);}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($request->selected_sundries) {
|
||||
$pre_ordered_sundries = Sundry::whereIn('id', $request->selected_sundries)->get();
|
||||
if (stock_levels_to_consider() == 0) {//getting total stock for sundry from both stores and pharmacy
|
||||
foreach($pre_ordered_sundries as $sundry) {$sundry->total_stock = $this->itemStockService->getItemAllQuantityByTotal($sundry->id, 2);}
|
||||
} else{//getting total stock for optical from pharmacy
|
||||
foreach($pre_ordered_sundries as $sundry) {$sundry->total_stock = $this->itemStockService->getItemQuantity('pharmacy_stock',$sundry->id, 2);}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($request->selected_services) {
|
||||
@@ -171,6 +201,11 @@ class PointOfSaleController extends Controller {
|
||||
}
|
||||
|
||||
public function confirm_pricing(Request $request){
|
||||
$order_sundries_id = NULL;
|
||||
$treatment_id = NULL;
|
||||
$order_optical_id = NULL;
|
||||
$order_service_id = NULL;
|
||||
|
||||
if($request->treatment_item){
|
||||
$treatment = new Treatment;
|
||||
$treatment->patient_id = $request->patient_id;
|
||||
@@ -219,26 +254,25 @@ class PointOfSaleController extends Controller {
|
||||
$treatment->durations = implode(',', $time_duration);
|
||||
$treatment->quantities_dispensed = implode(',', $request->treatment_quantity);
|
||||
$treatment->dispense_status = 0;
|
||||
$treatment->is_pos = 1;
|
||||
$treatment->created_by = Auth::id();
|
||||
$treatment->save();
|
||||
|
||||
$request->treatment_id = DB::table('treatments')->where('episode_id', $request->episode_id)->where('patient_id', $request->patient_id)->latest()->pluck('id')->first();
|
||||
$treatment_id = $treatment->id;
|
||||
}
|
||||
|
||||
$eye_glass_ids = $request->eye_glass_item;
|
||||
$eye_glass_quantity = $request->eye_glass_quantity;
|
||||
|
||||
if($request->eye_glass_item){
|
||||
for ($i=0; $i < count($eye_glass_ids) ; $i++) {
|
||||
$new_ordered_eye_glasses = new OrderedEyeGlasses;
|
||||
$new_ordered_eye_glasses->patient_id = $request->patient_id;
|
||||
$new_ordered_eye_glasses->episode_id = $request->episode_id;
|
||||
$new_ordered_eye_glasses->eye_glasses_id = $eye_glass_ids[$i];
|
||||
$new_ordered_eye_glasses->quantity = $eye_glass_quantity[$i];
|
||||
$new_ordered_eye_glasses->payment_status = 0; //0 by default to mean not paid
|
||||
$new_ordered_eye_glasses->created_by = auth()->user()->id;
|
||||
$new_ordered_eye_glasses->save();
|
||||
}
|
||||
$new_ordered_eye_glasses = new OrderedEyeGlasses;
|
||||
$new_ordered_eye_glasses->patient_id = $request->patient_id;
|
||||
$new_ordered_eye_glasses->episode_id = $request->episode_id;
|
||||
$new_ordered_eye_glasses->eye_glasses_id = implode(",", $request->eye_glass_item);
|
||||
$new_ordered_eye_glasses->quantity = implode(",", $request->eye_glass_quantity);
|
||||
$new_ordered_eye_glasses->payment_status = 0; //0 by default to mean not paid
|
||||
$new_ordered_eye_glasses->created_by = auth()->id();
|
||||
$new_ordered_eye_glasses->is_pos = 1;
|
||||
$new_ordered_eye_glasses->save();
|
||||
|
||||
$order_optical_id = $new_ordered_eye_glasses->id;
|
||||
}
|
||||
|
||||
if($request->pos_sundry_ids){
|
||||
@@ -247,8 +281,11 @@ class PointOfSaleController extends Controller {
|
||||
$new_ordered_sundries->episode_id = $request->episode_id;
|
||||
$new_ordered_sundries->sundries_id = implode(",", $request->pos_sundry_ids);
|
||||
$new_ordered_sundries->quantity = implode(",", $request->sundry_quantity);
|
||||
$new_ordered_sundries->created_by = auth()->user()->id;
|
||||
$new_ordered_sundries->created_by = auth()->id();
|
||||
$new_ordered_sundries->is_pos = 1;
|
||||
$new_ordered_sundries->save();
|
||||
|
||||
$order_sundries_id = $new_ordered_sundries->id;
|
||||
}
|
||||
|
||||
if ($request->service_id && $request->service_id[0] != null) {
|
||||
@@ -259,16 +296,16 @@ class PointOfSaleController extends Controller {
|
||||
$new_ordered_service->quantity = implode(",", $request->quantity);
|
||||
$new_ordered_service->performed = 0;
|
||||
$new_ordered_service->performed_id = 0;
|
||||
$new_ordered_service->created_by = auth()->user()->id;
|
||||
$new_ordered_service->created_by = auth()->id();
|
||||
$new_ordered_service->is_pos = 1;
|
||||
$new_ordered_service->save();
|
||||
}
|
||||
|
||||
$request->ordered_sundry_ids = OrderedSundry::where('episode_id', $request->episode_id)->where('patient_id', $request->patient_id)
|
||||
->whereDate('created_at', Carbon::today()->toDateString())->pluck('id')->toArray();
|
||||
$order_service_id = $new_ordered_service->id;
|
||||
}
|
||||
|
||||
$treatment_item = $treatment_quantity = $treatment_subtotal = [];
|
||||
// save for treatment
|
||||
if($request->treatment_id){
|
||||
if($request->treatment_item){
|
||||
$treatment_item = $request->treatment_item;
|
||||
$treatment_quantity = $request->treatment_quantity;
|
||||
$treatment_subtotal = $request->treatment_subtotal;
|
||||
@@ -277,7 +314,7 @@ class PointOfSaleController extends Controller {
|
||||
$eye_glasses_prices_array = $eye_glasses_quantity_array = $eye_glasses_ids_array = [];
|
||||
// save for eye_glasses arrays
|
||||
if($request->eye_glass_item){
|
||||
$eye_glasses_prices_array = $request->eye_glass_amount;
|
||||
$eye_glasses_prices_array = $request->eye_glass_subtotal;
|
||||
$eye_glasses_quantity_array = $request->eye_glass_quantity;
|
||||
$eye_glasses_ids_array = $request->eye_glass_item;
|
||||
}
|
||||
@@ -306,19 +343,19 @@ class PointOfSaleController extends Controller {
|
||||
$pos_record->episode_id = $request->episode_id;
|
||||
$pos_record->treatments = count($treatment_item) > 0 ? json_encode([
|
||||
"ids" => $treatment_item, "quantity" => $treatment_quantity,
|
||||
"subtotal" => $treatment_subtotal
|
||||
"subtotal" => $treatment_subtotal, "order_id" => $treatment_id
|
||||
]) : NULL;
|
||||
$pos_record->eye_glasses = count($eye_glasses_ids_array) > 0 ? json_encode([
|
||||
"ids" => $eye_glasses_ids_array, "quantity" => $eye_glasses_quantity_array,
|
||||
"subtotal" => $eye_glasses_prices_array
|
||||
"subtotal" => $eye_glasses_prices_array, "order_id" => $order_optical_id
|
||||
]) : NULL;
|
||||
$pos_record->sundries = count($sundry_item) > 0 ? json_encode([
|
||||
"ids" => $sundry_item, "quantity" => $sundry_quantity,
|
||||
"subtotal" => $sundry_subtotal
|
||||
"subtotal" => $sundry_subtotal, "order_id" => $order_sundries_id
|
||||
]) : NULL;
|
||||
$pos_record->services = count($service_ids_array) > 0 ? json_encode([
|
||||
"ids" => $service_ids_array, "quantity" => $service_quantity_array,
|
||||
"subtotal" => $service_prices_array
|
||||
"subtotal" => $service_prices_array, "order_id" => $order_service_id
|
||||
]) : NULL;
|
||||
$pos_record->created_by = Auth::id();
|
||||
$pos_record->save();
|
||||
@@ -327,8 +364,7 @@ class PointOfSaleController extends Controller {
|
||||
}
|
||||
|
||||
public function add_referral(Request $request) {
|
||||
|
||||
$logged_in_user_id = Auth::user()->id;
|
||||
$logged_in_user_id = Auth::id();
|
||||
$referral_hospital = new ReferralHospital;
|
||||
$referral_hospital->name = $request->name;
|
||||
$referral_hospital->created_by = $logged_in_user_id;
|
||||
@@ -356,6 +392,7 @@ class PointOfSaleController extends Controller {
|
||||
$patient = Patient::find($record->patient_id);
|
||||
$receipt_date = $record->created_at;
|
||||
$receipt_reprint_date = date('Y-m-d h:i:s');
|
||||
$first_printed_by = $record->created_by;
|
||||
|
||||
$treatments_array = json_decode($record->treatments, true);
|
||||
$sundries_array = json_decode($record->sundries, true);
|
||||
@@ -365,19 +402,24 @@ class PointOfSaleController extends Controller {
|
||||
$treatment_item = $treatments_array ? $treatments_array["ids"] : [];
|
||||
$treatment_quantity = $treatments_array ? $treatments_array["quantity"] : [];
|
||||
$treatment_subtotal = $treatments_array ? $treatments_array["subtotal"] : [];
|
||||
$treatment_number = $treatments_array ? ($treatments_array["order_id"] ?? 0) : [];
|
||||
$eye_glasses_ids_array = $eye_glasses_array ? $eye_glasses_array["ids"] : [];
|
||||
$eye_glasses_quantity_array = $eye_glasses_array ? $eye_glasses_array["quantity"] : [];
|
||||
$eye_glasses_prices_array = $eye_glasses_array ? $eye_glasses_array["subtotal"] : [];
|
||||
$eye_glasses_number = $eye_glasses_array ? ($eye_glasses_array["order_id"] ?? 0) : [];
|
||||
$sundry_item = $sundries_array ? $sundries_array["ids"] : [];
|
||||
$sundry_quantity = $sundries_array ? $sundries_array["quantity"] : [];
|
||||
$sundry_subtotal = $sundries_array ? $sundries_array["subtotal"] : [];
|
||||
$sundry_number = $sundries_array ? ($sundries_array["order_id"] ?? 0) : [];
|
||||
$service_ids_array = $services_array ? $services_array["ids"] : [];
|
||||
$service_quantity_array = $services_array ? $services_array["quantity"] : [];
|
||||
$service_prices_array = $services_array ? $services_array["subtotal"] : [];
|
||||
$service_number = $services_array ? ($services_array["order_id"] ?? 0) : [];
|
||||
|
||||
return view('patients::point_of_sale.receipt', compact('treatment_item', 'treatment_quantity', 'treatment_subtotal',
|
||||
'eye_glasses_prices_array', 'eye_glasses_quantity_array', 'eye_glasses_ids_array', 'hospital_information', 'patient', 'receipt_date',
|
||||
'sundry_item','sundry_quantity','sundry_subtotal', 'service_ids_array', 'service_prices_array', 'service_quantity_array', 'receipt_reprint_date'));
|
||||
'eye_glasses_prices_array', 'eye_glasses_quantity_array', 'eye_glasses_ids_array', 'hospital_information', 'patient', 'receipt_date', 'first_printed_by',
|
||||
'sundry_item','sundry_quantity','sundry_subtotal', 'service_ids_array', 'service_prices_array', 'service_quantity_array', 'receipt_reprint_date',
|
||||
'eye_glasses_number', 'treatment_number', 'sundry_number', 'service_number'));
|
||||
} else {
|
||||
// set up the redirect link for html
|
||||
session()->put('print_pos_pdf', 1);
|
||||
@@ -418,15 +460,19 @@ class PointOfSaleController extends Controller {
|
||||
$treatment_item = $treatments_array ? $treatments_array["ids"] : [];
|
||||
$treatment_quantity = $treatments_array ? $treatments_array["quantity"] : [];
|
||||
$treatment_subtotal = $treatments_array ? $treatments_array["subtotal"] : [];
|
||||
$treatment_number = $treatments_array ? ($treatments_array["order_id"] ?? 0) : [];
|
||||
$eye_glasses_ids_array = $eye_glasses_array ? $eye_glasses_array["ids"] : [];
|
||||
$eye_glasses_quantity_array = $eye_glasses_array ? $eye_glasses_array["quantity"] : [];
|
||||
$eye_glasses_prices_array = $eye_glasses_array ? $eye_glasses_array["subtotal"] : [];
|
||||
$eye_glasses_number = $eye_glasses_array ? ($eye_glasses_array["order_id"] ?? 0) : [];
|
||||
$sundry_item = $sundries_array ? $sundries_array["ids"] : [];
|
||||
$sundry_quantity = $sundries_array ? $sundries_array["quantity"] : [];
|
||||
$sundry_subtotal = $sundries_array ? $sundries_array["subtotal"] : [];
|
||||
$sundry_number = $sundries_array ? ($sundries_array["order_id"] ?? 0) : [];
|
||||
$service_ids_array = $services_array ? $services_array["ids"] : [];
|
||||
$service_quantity_array = $services_array ? $services_array["quantity"] : [];
|
||||
$service_prices_array = $services_array ? $services_array["subtotal"] : [];
|
||||
$service_number = $services_array ? ($services_array["order_id"] ?? 0) : [];
|
||||
|
||||
$data = [
|
||||
"patient" => $patient, "receipt_date" => $receipt_date, "receipt_reprint_date" => $receipt_reprint_date, "hospital_information" => $hospital_information,
|
||||
@@ -434,6 +480,7 @@ class PointOfSaleController extends Controller {
|
||||
"eye_glasses_ids_array" => $eye_glasses_ids_array, "eye_glasses_quantity_array" => $eye_glasses_quantity_array, "eye_glasses_prices_array" => $eye_glasses_prices_array,
|
||||
"sundry_item" => $sundry_item, "sundry_quantity" => $sundry_quantity, "sundry_subtotal" => $sundry_subtotal,
|
||||
"service_ids_array" => $service_ids_array, "service_quantity_array" => $service_quantity_array, "service_prices_array" => $service_prices_array,
|
||||
"treatment_number" => $treatment_number, "eye_glasses_number" => $eye_glasses_number, "sundry_number" => $sundry_number, "service_number" => $service_number,
|
||||
];
|
||||
|
||||
$pdf = SnappyPDF::loadView('patients::point_of_sale.print_pos_pdf', $data)
|
||||
|
||||
@@ -470,11 +470,8 @@ class TriageController extends Controller
|
||||
|
||||
return redirect("/patient_episodes");
|
||||
} catch (QueryException $e) {
|
||||
$errorCode = $e->errorInfo[1];
|
||||
if ($errorCode == 1062) { //error code for duplicate entry to a unique field
|
||||
flash("Triage already exists!")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
flash("An error occurred")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -540,10 +537,9 @@ class TriageController extends Controller
|
||||
|
||||
$age_diff_months = Carbon::parse($patient->date_of_birth)->diffInMonths(Carbon::now());
|
||||
$triage_hiv = HivGenderBaseViolence::where('triage_id', $triage->id)->first();
|
||||
$triage_gbv = GenderBasedViolence::where('triage_id', $triage->id)->first();
|
||||
|
||||
return view('patients::triage.show', compact('triage', 'patient_episode', 'patient', 'clinics', 'referral_hospitals', 'symptoms', 'categories', 'family_planning_methods', 'triage_hiv',
|
||||
'episode_id', 'years', 'airway', 'circulation', 'neurological', 'dehydration', 'discharge_mortality', 'age_diff_months', 'priority_signs', 'nutrition', 'triage_without_etat', 'triage_gbv'));
|
||||
'episode_id', 'years', 'airway', 'circulation', 'neurological', 'dehydration', 'discharge_mortality', 'age_diff_months', 'priority_signs', 'nutrition', 'triage_without_etat'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -666,7 +662,6 @@ class TriageController extends Controller
|
||||
|
||||
$age_diff_months = $dob->diffInMonths(Carbon::now());
|
||||
$triage_hiv = HivGenderBaseViolence::where('triage_id', $triage->id)->first();
|
||||
$triage_gbv = GenderBasedViolence::where('triage_id', $triage->id)->first();
|
||||
|
||||
return view('patients::triage.edit', compact(
|
||||
'episode_id',
|
||||
@@ -691,7 +686,6 @@ class TriageController extends Controller
|
||||
'symptoms_periods',
|
||||
'age_diff_months',
|
||||
'triage_hiv',
|
||||
'triage_gbv'
|
||||
));
|
||||
}
|
||||
|
||||
@@ -959,13 +953,13 @@ class TriageController extends Controller
|
||||
|
||||
$result = DB::table('symptoms')->where('id', $request->symptom_id)->first();
|
||||
|
||||
if ($result->prompts) {
|
||||
if (!empty($result->prompts)) {
|
||||
$prompt = $result->prompts;
|
||||
} else {
|
||||
$prompt = "No prompt available";
|
||||
}
|
||||
|
||||
if ($result->reference_link && !empty($result->reference_link) && $result->reference_link != "-") {
|
||||
if (!empty($result->reference_link) && !empty($result->reference_link) && $result->reference_link != "-") {
|
||||
//some links just have "-"
|
||||
$ref_text = '<a style="color: blue;" href="' . $result->reference_link . '" target="_blank">' . $result->reference_text . '</a>';
|
||||
} else {
|
||||
|
||||
+95
-23
@@ -13,6 +13,13 @@
|
||||
background: #b6cce2;
|
||||
border: 1px solid #e4e7ea;
|
||||
}
|
||||
|
||||
.modal_diagnosis {
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@@ -51,6 +58,10 @@
|
||||
@php
|
||||
$parent_episode_details = \Streamline\Models\PatientEpisode::find($episode->parent_episode_id);
|
||||
$parent_consultations = \Streamline\Models\Consultation::where(['episode_id' => $parent_episode_details->id])->get();
|
||||
//consultation notes
|
||||
$consultation_notes = \Streamline\Models\WardInpatientDetailedNote::where(['patient_id' => $patient_id, 'episode_id' => $parent_episode_details->id, 'ward_id' => 0])->latest()->get(['investigation_and_management_plan_comments', 'clinic_examination_comments', 'history_comments', 'created_by','created_at']);
|
||||
$consultation_notes_details = count($consultation_notes) > 0 ? $consultation_notes : null;
|
||||
$consultation_notes_created_at = isset($consultation_notes_details) ? streamline_date($consultation_notes_details->pluck('created_at')->first()) : null;
|
||||
$parent_consultation_details = count($parent_consultations) > 0 ? $parent_consultations->first() : null;
|
||||
$parent_triage_details = \Streamline\Models\Triage::where(['id' => $parent_episode_details->triage_id])->first();
|
||||
|
||||
@@ -818,26 +829,84 @@
|
||||
|
||||
@if($consultation_with_notes)
|
||||
<div class="white-box">
|
||||
@if(check_if_episode_is_a_followup($episode->id) && !is_null($parent_consultation_details))
|
||||
@php
|
||||
$parent_consultation_history = $parent_consultation_details->history_comments;
|
||||
$parent_consultation_clinical_examination = $parent_consultation_details->clinic_examination_comments;
|
||||
$parent_consultation_inv_and_mgt = $parent_consultation_details->investigation_and_management_plan_comments;
|
||||
@endphp
|
||||
@if(check_if_episode_is_a_followup($episode->id) && !is_null($consultation_notes_details))
|
||||
|
||||
<font color="green"><b>History {{ __('consultations.for_episode_of') }} {{ streamline_date($parent_consultation_details->created_at) }}</b></font>
|
||||
<textarea class="form-control" name="parent_history_comments" readonly>{{ $parent_consultation_history }}</textarea>
|
||||
{{-- fetch all consultation notes --}}
|
||||
@if ( count($consultation_notes) > 0 )
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<font color="green"><b>{{ __('consultations.clinical_examination') }} {{ __('consultations.for_episode_of') }} {{ streamline_date($parent_consultation_details->created_at) }}</b></font>
|
||||
<textarea class="form-control" name="parent_clinic_examination_comments" readonly>{{ $parent_consultation_clinical_examination }}</textarea>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<font color="green"><b>{{ __('consultations.investigation_and_mgt_plan') }} {{ __('consultations.for_episode_of') }} {{ streamline_date($parent_consultation_details->created_at) }}</b></font>
|
||||
<textarea class="form-control" name="parent_investigation_and_management_plan_comments" readonly>{{ $parent_consultation_inv_and_mgt }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
{{-- History consultation notes --}}
|
||||
|
||||
<h4>{{ __('consultations.consultation_for_episode_of') }} {{ streamline_date($consultation_notes_created_at) }}</h4>
|
||||
|
||||
<table class="table table-condensed color-bordered-table success-bordered-table " style="table-layout: fixed; width:100%">
|
||||
<tr>
|
||||
<thead>
|
||||
<th colspan="2" class="line-height-table" >{{ __('consultations.history') }}</th>
|
||||
<th></th>
|
||||
</thead>
|
||||
</tr>
|
||||
|
||||
@forelse ($consultation_notes as $consultation_note)
|
||||
@if(!empty($consultation_note->history_comments))
|
||||
<tr>
|
||||
<td colspan="2" class="line-height-table" style="width:80%; word-wrap:break-word;"> {{ $consultation_note->history_comments ?? '' }} </td>
|
||||
<td class="line-height-table" style="width:20%; word-wrap:break-word;"> By {{ get_full_name($consultation_note->created_by, 'id', 'first_name', 'last_name', 'users') }} on {{ streamline_date_time($consultation_note->created_at) ?? '' }} </td>
|
||||
|
||||
</tr>
|
||||
@endif
|
||||
@empty
|
||||
{{-- <tr><td colspan="4" class="line-height-table"><code>{{ __('consultations.no_previous_notes') }}</code></td></tr> --}}
|
||||
@endforelse
|
||||
</table>
|
||||
|
||||
{{-- Clinic Examination consultation notes --}}
|
||||
|
||||
<table class="table table-condensed color-bordered-table success-bordered-table " style="table-layout: fixed; width:100%">
|
||||
<tr>
|
||||
<thead>
|
||||
<th colspan="2" class="line-height-table">{{ __('consultations.clinical_examination') }}</th>
|
||||
<th></th>
|
||||
</thead>
|
||||
</tr>
|
||||
|
||||
@forelse ($consultation_notes as $consultation_note)
|
||||
@if(!empty($consultation_note->clinic_examination_comments))
|
||||
<tr>
|
||||
<td colspan="2" class="line-height-table" style="width:80%; word-wrap:break-word;"> {{ $consultation_note->clinic_examination_comments ?? '' }} </td>
|
||||
<td class="line-height-table" style="width:20%; word-wrap:break-word;"> By {{ get_full_name($consultation_note->created_by, 'id', 'first_name', 'last_name', 'users') }} on {{ streamline_date_time($consultation_note->created_at) ?? '' }} </td>
|
||||
</tr>
|
||||
@endif
|
||||
@empty
|
||||
|
||||
{{-- <tr><td colspan="4" class="line-height-table"><code>{{ __('consultations.no_previous_notes') }}</code></td></tr> --}}
|
||||
|
||||
@endforelse
|
||||
</table>
|
||||
|
||||
{{-- Investigation and Management Plan consultation notes --}}
|
||||
<table class="table table-condensed color-bordered-table success-bordered-table " style="table-layout: fixed; width:100%">
|
||||
<tr>
|
||||
<thead>
|
||||
<th colspan="2" class="line-height-table">{{ __('consultations.investigation_and_mgt_plan') }}</th>
|
||||
<th></th>
|
||||
</thead>
|
||||
</tr>
|
||||
|
||||
@forelse ($consultation_notes as $consultation_note)
|
||||
@if(!empty($consultation_note->investigation_and_management_plan_comments))
|
||||
<tr>
|
||||
<td colspan="2" class="line-height-table" style="width:80%; word-wrap:break-word;"> {{ $consultation_note->investigation_and_management_plan_comments ?? '' }} </td>
|
||||
<td class="line-height-table" style="width:20%; word-wrap:break-word;"> By {{ get_full_name($consultation_note->created_by, 'id', 'first_name', 'last_name', 'users') }} on {{ streamline_date_time($consultation_note->created_at) ?? '' }} </td>
|
||||
</tr>
|
||||
@endif
|
||||
@empty
|
||||
{{-- <tr class="line-height-table"><td colspan="4"><code>{{ __('consultations.no_previous_notes') }}</code></td></tr> --}}
|
||||
@endforelse
|
||||
</table>
|
||||
|
||||
@endif
|
||||
|
||||
{{-- end fetch all consultation notes --}}
|
||||
@endif
|
||||
|
||||
<h4>{{ __('consultations.history') }}</h4>
|
||||
@@ -886,7 +955,7 @@
|
||||
</div>
|
||||
</td>
|
||||
<td style="width: 45%; color: #C85F6A;">
|
||||
<div class="well well-sm" id="primary_diagnosis_prompt">{{ $diagnoses_all->firstWhere('id',$parent_consultation_details->primary_diagnosis)->prompts }} </div>
|
||||
<div class="well well-sm" id="primary_diagnosis_prompt">{{ $diagnoses_all->firstWhere('id',$parent_consultation_details->primary_diagnosis)->prompts?? '' }} </div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="well well-sm" id="primary_diagnosis_reference">
|
||||
@@ -2012,8 +2081,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="confirm_diagnosis_modal" tabindex="-1" role="dialog" style="min-width: 400px;position: absolute;top: 80%;left: 10%;">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal fade modal_diagnosis " id="confirm_diagnosis_modal" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true">
|
||||
<div class="modal-dialog" style="max-width: 60%;" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body form-group">
|
||||
<div class="modal-header"></div>
|
||||
@@ -2027,6 +2096,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
@@ -2208,6 +2279,7 @@
|
||||
let prim_diag = $('#primary_diagnosis').val();
|
||||
$('#confirm_primary_diagnosis').val(prim_diag).trigger('change');
|
||||
$('#confirm_diagnosis_modal').modal('toggle');
|
||||
$('#confirm_primary_diagnosis').select2({ width: '96%'});
|
||||
|
||||
}
|
||||
|
||||
@@ -2399,7 +2471,7 @@
|
||||
});
|
||||
});
|
||||
|
||||
$('#primary_diagnosis, #confirm_primary_diagnosis, .procedure_performed_by').select2({
|
||||
$('#primary_diagnosis, .procedure_performed_by').select2({
|
||||
placeholder: "-- select --",
|
||||
width: "100%"
|
||||
});
|
||||
@@ -2460,7 +2532,7 @@
|
||||
function submit_after_confirmation(){
|
||||
let confirmed = $('#confirm_primary_diagnosis').val();
|
||||
$('#primary_diagnosis').val(confirmed).trigger('change');
|
||||
$("<input type='text' value='complete' />").attr("id", "complete_consultation").attr("name", "submit-btn").appendTo("#consultation_form");
|
||||
$("<input type='hidden' value='complete' />").attr("id", "complete_consultation").attr("name", "submit-btn").appendTo("#consultation_form");
|
||||
$('#consultation_form').submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
+228
-35
@@ -13,10 +13,24 @@
|
||||
background: #b6cce2;
|
||||
border: 1px solid #e4e7ea;
|
||||
}
|
||||
.modal_diagnosis {
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
/* increase width of select2 */
|
||||
.select2-container {
|
||||
width: 100% !important;
|
||||
}
|
||||
</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">{{ __('consultations.edit_consultation') }}</h4>
|
||||
@@ -50,6 +64,7 @@
|
||||
$parent_consultations = \Streamline\Models\Consultation::where(['episode_id' => $parent_episode_details->id])->get();
|
||||
$parent_consultation_details = count($parent_consultations) > 0 ? $parent_consultations->first() : null;
|
||||
$parent_triage_details = \Streamline\Models\Triage::where(['id' => $parent_episode_details->triage_id])->first();
|
||||
$parent_consultation_notes = \Streamline\Models\WardInpatientDetailedNote::where(['patient_id' => $episode->patient_id, 'episode_id' => $episode->parent_episode_id, 'ward_id' => 0])->get();
|
||||
|
||||
if(check_if_episode_is_a_followup($parent_episode_details->id)){
|
||||
$episode_has_grand_parent_episode = true;
|
||||
@@ -624,39 +639,131 @@
|
||||
|
||||
@if($consultation_with_notes)
|
||||
<div class="white-box">
|
||||
@if(check_if_episode_is_a_followup($episode->id) && !is_null($parent_consultation_details))
|
||||
@php
|
||||
$parent_consultation_history = $parent_consultation_details->history_comments;
|
||||
$parent_consultation_clinical_examination = $parent_consultation_details->clinic_examination_comments;
|
||||
$parent_consultation_inv_and_mgt = $parent_consultation_details->investigation_and_management_plan_comments;
|
||||
@endphp
|
||||
|
||||
<font color="green"><b>History {{ __('consultations.for_episode_of') }} {{ streamline_date($parent_consultation_details->created_at) }}</b></font>
|
||||
<textarea class="form-control" name="parent_history_comments" readonly>{{ $parent_consultation_history }}</textarea>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<font color="green"><b>{{ __('consultations.clinical_examination') }} {{ __('consultations.for_episode_of') }} {{ streamline_date($parent_consultation_details->created_at) }}</b></font>
|
||||
<textarea class="form-control" name="parent_clinic_examination_comments" readonly>{{ $parent_consultation_clinical_examination }}</textarea>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<font color="green"><b>{{ __('consultations.investigation_and_mgt_plan') }} {{ __('consultations.for_episode_of') }} {{ streamline_date($parent_consultation_details->created_at) }}</b></font>
|
||||
<textarea class="form-control" name="parent_investigation_and_management_plan_comments" readonly>{{ $parent_consultation_inv_and_mgt }}</textarea>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<table class="table table-hover color-table success-table table-bordered" style="table-layout:fixed; width:100%;">
|
||||
<thead>
|
||||
<tr><th colspan="{{ (Auth::user()->can('edit-consultation-note') || Auth::user()->can('delete-consultation-note'))? '5':'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>
|
||||
@if(Auth::user()->can('edit-consultation-note') || Auth::user()->can('delete-consultation-note'))
|
||||
<th>{{ __('banking.action') }}</th>
|
||||
@endif
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($consultation_notes as $consultation_note)
|
||||
<tr id="row_{{ $consultation_note->id }}">
|
||||
<td id="clinic_history_comments_{{ $consultation_note->id }}" style="word-wrap:break-word;">{{ $consultation_note->history_comments }}</td>
|
||||
<td id="clinic_examination_comments_{{ $consultation_note->id }}" style="word-wrap:break-word;">{{ $consultation_note->clinic_examination_comments }}</td>
|
||||
<td id="investigation_and_management_plan_comments_{{ $consultation_note->id }}" style="word-wrap:break-word;">{{ $consultation_note->investigation_and_management_plan_comments}}</td>
|
||||
<td id="created_{{ $consultation_note->id }}" style="word-wrap:break-word;">{{ streamline_date_time($consultation_note->created_at) }} <br> by {{ $users[$consultation_note->created_by]?? '' }}</td>
|
||||
@if (Auth::user()->can('edit-consultation-note') || Auth::user()->can('delete-consultation-note'))
|
||||
<td style="word-wrap:break-word;">
|
||||
@if(Auth::user()->can('edit-consultation-note'))
|
||||
<a class="btn btn-inverse btn-sm btn-rounded" onclick="show_edit_consultation_clinical_notes_modal({{ $consultation_note->id }})" title="{{ __('consultations.edit_clinical_note') }}"><i class="fa fa-pencil"></i> {{ __('consultations.edit_clinical_note') }}</a>
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->can('delete-consultation-note'))
|
||||
<a class="btn btn-danger btn-sm btn-rounded" style="margin-left: 5px" id="delete_row_{{ $consultation_note->id }}" onclick="delete_consultation_clinical_notes({{ $consultation_note->id }})" title="Delete this note"><i class="fa fa-trash"></i></a>
|
||||
@endif
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
<input type='hidden' value='{{ $consultation_note->clinic_examination_comments}}' name='prev_clinic_examination_comments' id='prev_clinic_examination_comments_{{ $consultation_note->id }}' />
|
||||
<input type='hidden' value='{{ $consultation_note->history_comments}}' name='prev_clinic_history_comments' id='prev_clinic_history_comments_{{ $consultation_note->id }}' />
|
||||
<input type='hidden' value='{{ $consultation_note->investigation_and_management_plan_comments}}' name='prev_investigation_and_management_plan_comments' id='prev_investigation_and_management_plan_comments_{{ $consultation_note->id }}' />
|
||||
{{ Form::hidden('deleted_notes[]', '', ['id' => 'deleted_note_id_'.$consultation_note->id]) }}
|
||||
@empty
|
||||
<tr><td colspan="{{ (Auth::user()->can('edit-consultation-note') || Auth::user()->can('delete-consultation-note'))? '5':'4' }}"><code>{{ __('consultations.no_previous_notes') }}</code></td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
@if (!empty($view_notes))
|
||||
<tr id="read_more"><td colspan="5"><a class="read_more font-weight-bold" style="color : #0099CC; float: right;" onclick="show_all_consultation_notes();">{{ __('consultations.view_more_notes') }}</a></td></tr>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="row col" id="all_consultation_notes" style="display: none">
|
||||
<div class="panel-group" >
|
||||
<div class="panel panel-inverse">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#collapse_all_notes">{{ __('consultations.all_consultation_notes') }}</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="panel-body table-bordered" id="collapse_all_notes">
|
||||
<table class="table table-hover color-table success-table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('consultations.history') }}</th>
|
||||
<th>{{ __('consultations.clinical_examination') }}</th>
|
||||
<th>{{ __('consultations.investigation_and_mgt_plan') }}</th>
|
||||
<th>{{ __('consultations.date') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($view_notes as $note)
|
||||
<tr>
|
||||
<td>{{ $note->history_comments }}</td>
|
||||
<td>{{ $note->clinic_examination_comments }}</td>
|
||||
<td>{{ $note->investigation_and_management_plan_comments}}</td>
|
||||
<td>{{ streamline_date_time($note->created_at) }} <br> by {{ $users[$note->created_by]?? '' }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<h4>{{ __('consultations.history') }}</h4>
|
||||
<textarea class="form-control" name="history_comments" rows="5" placeholder="Notes Here...">{{ $consultation->history_comments }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="white-box">
|
||||
@if(check_if_episode_is_a_followup($episode->id) && !empty($parent_consultation_notes))
|
||||
<div class="row">
|
||||
<div class="col table-responsive">
|
||||
<table class="table table-hover color-table success-table table-bordered" style="table-layout:fixed;">
|
||||
<thead>
|
||||
<tr><th colspan="4">Previously Added Consultation Notes {{ __('consultations.for_episode_of') }} {{ streamline_date($parent_consultation_details->created_at) }}</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 ($parent_consultation_notes as $consultation_note)
|
||||
<tr>
|
||||
<td style="word-wrap:break-word;">{{ $consultation_note->history_comments }}</td>
|
||||
<td style="word-wrap:break-word;">{{ $consultation_note->clinic_examination_comments }}</td>
|
||||
<td style="word-wrap:break-word;">{{ $consultation_note->investigation_and_management_plan_comments}}</td>
|
||||
<td style="word-wrap:break-word;">{{ streamline_date_time($consultation_note->created_at) }} <br> by {{ $users[$consultation_note->created_by]?? '' }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="4"><code>No previously added consultation notes {{ __('consultations.for_episode_of') }} {{ streamline_date($parent_consultation_details->created_at) }}.</code></td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h4>{{ __('consultations.clinical_examination') }}</h4>
|
||||
<textarea class="form-control" name="clinic_examination_comments" rows="5" placeholder="Notes Here...">{{ $consultation->clinic_examination_comments }}</textarea>
|
||||
<div class="col">
|
||||
<h4>{{ __('consultations.history') }}</h4>
|
||||
<textarea class="form-control" name="history_comments" rows="5" placeholder="History Notes Here..."></textarea>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="col">
|
||||
<h4>{{ __('consultations.clinical_examination') }}</h4>
|
||||
<textarea class="form-control" name="clinic_examination_comments" rows="5" placeholder="Clinic Examination Notes Here..."></textarea>
|
||||
</div>
|
||||
<div class="col">
|
||||
<h4>{{ __('consultations.investigation_and_mgt_plan') }}</h4>
|
||||
<textarea class="form-control" name="investigation_and_management_plan_comments" rows="5" placeholder="Notes Here...">{{ $consultation->investigation_and_management_plan_comments }}</textarea>
|
||||
<textarea class="form-control" name="investigation_and_management_plan_comments" rows="5" placeholder="Investigation and Management Plan Notes Here..."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -917,7 +1024,7 @@
|
||||
<tr>
|
||||
<td><input type="checkbox" name="chk" id="chk"></td>
|
||||
<td style="width: 30%;">
|
||||
{{ Form::select('other_diagnosis[]', $diagnoses, '', ['class' => 'sec_d form-control col-sm-12']) }}
|
||||
{{ Form::select('other_diagnosis[]', $diagnoses, '', ['class' => 'sec_d form-control col-sm-12 ']) }}
|
||||
</td>
|
||||
<td style="width: 45%"><div class="well well-sm" id="secondary_diagnosis_prompt1"> </div></td>
|
||||
<td style="width: 25%"><div class="well well-sm" id="secondary_diagnosis_reference1"> </div></td>
|
||||
@@ -928,7 +1035,7 @@
|
||||
<tr>
|
||||
<td><input type="checkbox" name="chk" id="chk"></td>
|
||||
<td style="width: 30%;">
|
||||
{{ Form::select('other_diagnosis[]', $diagnoses, $diagnosis, ['class' => 'sec_d form-control col-sm-12']) }}
|
||||
{{ Form::select('other_diagnosis[]', $diagnoses, $diagnosis, ['class' => 'other_diagnosisx sec_d form-control col-sm-12']) }}
|
||||
</td>
|
||||
<td style="width: 45%; color: #C85F6A;"><div class="well well-sm" id="secondary_diagnosis_prompt1">{{ is_object($diagnoses_all->firstWhere('id',$diagnosis)) ? $diagnoses_all->firstWhere('id',$diagnosis)->prompts : '' }} </div></td>
|
||||
<td style="width: 25%"><div class="well well-sm" id="secondary_diagnosis_reference1">{{ is_object($diagnoses_all->firstWhere('id',$diagnosis)) ? $diagnoses_all->firstWhere('id',$diagnosis)->reference_names : '' }} </div></td>
|
||||
@@ -1927,8 +2034,8 @@
|
||||
{{ Form::label('followup_in_charge', __('consultations.assign_incharge')) }}
|
||||
<select name="followup_in_charge" class="form-control col-sm-12 compulsory">
|
||||
<option value="0" selected>{{ __('consultations.not_assigned') }}</option>
|
||||
@foreach($users as $user)
|
||||
<option value="{{ $user->id }}">{{ $user->first_name }} {{ $user->last_name }}</option>
|
||||
@foreach($users as $key => $user)
|
||||
<option value="{{ $key }}">{{ $user }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
@@ -2023,8 +2130,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="confirm_diagnosis_modal" tabindex="-1" role="dialog" style="min-width: 400px;position: absolute;top: 80%;left: 10%;">
|
||||
<div class="modal-dialog modal-dialog-centered" style="align-items: flex-end;" role="document">
|
||||
<div class="modal fade modal_diagnosis " id="confirm_diagnosis_modal" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true">
|
||||
<div class="modal-dialog" style="max-width: 60%;" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body form-group">
|
||||
<h4 class="modal-title" id="exampleModalLabel1">{{ __('consultations.confirm_primary_diagnosis') }}</h4>
|
||||
@@ -2036,7 +2143,42 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- modal to add a new referral -->
|
||||
<div class="modal" id="modal-consultation-notes" tabindex="-1" aria-labelledby="exampleModalLongTitle" aria-hidden="true" role="dialog" style="top:5%;min-height:70%; ">
|
||||
<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">Edit Clinical Consultation Notes</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<h4>{{ __('consultations.history') }}</h4>
|
||||
<textarea class="form-control" name="edit_history_comments" rows="3" id="edit_history_comments">Yes</textarea>
|
||||
</div>
|
||||
<div class="row">
|
||||
<h4>{{ __('consultations.clinical_examination') }}</h4>
|
||||
<textarea class="form-control" name="edit_clinic_examination_comments" rows="3" id="edit_clinic_examination_comments"></textarea>
|
||||
</div>
|
||||
<div class="row">
|
||||
<h4>{{ __('consultations.investigation_and_mgt_plan') }}</h4>
|
||||
<textarea class="form-control" name="edit_investigation_and_management_plan_comments" rows="3" id="edit_investigation_and_management_plan_comments"></textarea>
|
||||
</div>
|
||||
{{ Form::hidden('note_id', '', ['id' => 'note_id']) }}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||
<a class="btn btn-primary" onclick="edit_consultation_clinical_notes()">Edit Notes</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
@@ -2181,6 +2323,7 @@
|
||||
let prim_diag = $('#primary_diagnosis').val();
|
||||
$('#confirm_primary_diagnosis').val(prim_diag).trigger('change');
|
||||
$('#confirm_diagnosis_modal').modal('toggle');
|
||||
$('#confirm_primary_diagnosis').select2({ width: '96%'});
|
||||
}
|
||||
|
||||
function submitDiagnosis(){
|
||||
@@ -2291,7 +2434,7 @@
|
||||
});
|
||||
});
|
||||
|
||||
$('#primary_diagnosis, #confirm_primary_diagnosis, .procedure_performed_by').select2({
|
||||
$('#primary_diagnosis, .procedure_performed_by, .other_diagnosis').select2({
|
||||
placeholder: "-- select --",
|
||||
width: "100%"
|
||||
});
|
||||
@@ -2343,8 +2486,58 @@
|
||||
function submit_after_confirmation(){
|
||||
let confirmed = $('#confirm_primary_diagnosis').val();
|
||||
$('#primary_diagnosis').val(confirmed).trigger('change');
|
||||
$("<input type='text' value='complete' />").attr("id", "complete_consultation").attr("name", "submit-btn").appendTo("#consultation_edit_form");
|
||||
$("<input type='hidden' value='complete' />").attr("id", "complete_consultation").attr("name", "submit-btn").appendTo("#consultation_edit_form");
|
||||
$('#consultation_edit_form').submit();
|
||||
}
|
||||
|
||||
function delete_consultation_clinical_notes(row_id){
|
||||
if(confirm('Are you sure you want to delete this clinical note?')){
|
||||
$("#deleted_note_id_"+row_id).val(row_id);
|
||||
$("#row_"+row_id).hide();
|
||||
}
|
||||
}
|
||||
|
||||
function show_edit_consultation_clinical_notes_modal(id){
|
||||
$("#note_id").val(id);
|
||||
var investigation_and_management_plan_comments = $('#prev_investigation_and_management_plan_comments_'+id).val();
|
||||
var clinic_examination_comments = $('#prev_clinic_examination_comments_'+id).val();
|
||||
var history_comments = $('#prev_clinic_history_comments_'+id).val();
|
||||
$("#edit_investigation_and_management_plan_comments").val(investigation_and_management_plan_comments);
|
||||
$("#edit_clinic_examination_comments").val(clinic_examination_comments);
|
||||
$("#edit_history_comments").val(history_comments);
|
||||
$('#modal-consultation-notes').modal('show');
|
||||
}
|
||||
|
||||
function edit_consultation_clinical_notes(){
|
||||
var id = $("#note_id").val();
|
||||
var investigation_and_management_plan_comments = $("#edit_investigation_and_management_plan_comments").val();
|
||||
var clinic_examination_comments = $("#edit_clinic_examination_comments").val();
|
||||
var history_comments =$("#edit_history_comments").val();
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/update_consultation_clinical_notes',
|
||||
data: {'id' : id, 'investigation_and_management_plan_comments':investigation_and_management_plan_comments, 'clinic_examination_comments':clinic_examination_comments, 'history_comments':history_comments },
|
||||
success: function(response){
|
||||
if(!isNaN(response)){
|
||||
|
||||
$('#clinic_examination_comments_'+id).html(clinic_examination_comments);
|
||||
$('#clinic_history_comments_'+id).html(history_comments);
|
||||
$('#investigation_and_management_plan_comments_'+id).html(investigation_and_management_plan_comments);
|
||||
$('#modal-consultation-notes').modal('hide'); //manually hide the modal
|
||||
} else {
|
||||
alert("Clinical Notes could not be edited.");
|
||||
}
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
console.log(JSON.stringify(jqXHR));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function show_all_consultation_notes(){
|
||||
$('.read_more').hide();
|
||||
$('#all_consultation_notes').show();
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
+377
-74
@@ -56,9 +56,9 @@
|
||||
<div class="container-fluid">
|
||||
@include('layouts.header_pdf_print')
|
||||
|
||||
<h5 class="heading" style="text-align: center;"> OUT-PATIENT REFERRAL NOTES</h5>
|
||||
<h5 class="heading" style="text-align: center;"> OUTPATIENT REFERRAL NOTE</h5>
|
||||
|
||||
<div class="row">
|
||||
<div class="row col">
|
||||
<table class="table table-light table-sm table-borderless">
|
||||
<tr>
|
||||
<th scope="row">{{ __('inpatient.patient_number') }}</th>
|
||||
@@ -76,14 +76,16 @@
|
||||
<th>Consultation Date</th>
|
||||
<td>
|
||||
{{ streamline_date($consultation->created_at) }}
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">{{ __('inpatient.age') }}</th>
|
||||
<td><?php echo get_patients_age($patient->date_of_birth); ?></td>
|
||||
<td>{{ get_patients_age($patient->date_of_birth, $consultation->created_at) }}</td>
|
||||
<td style="border-top: 0px;"> </td>
|
||||
<th></th>
|
||||
<th>Referral Number</th>
|
||||
<td>
|
||||
{{ $patient->number }}
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -102,95 +104,396 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{-- Symptoms, Priority and Emergency Signs --}}
|
||||
<div class="row">
|
||||
@if( Auth::user()->can('view-patient-episode-primary-diagnoses'))
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<strong>Primary Diagnosis</strong>
|
||||
<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
|
||||
$primary_diagnosis = \Streamline\Models\Diagnosis::withTrashed()->find($consultation->primary_diagnosis);
|
||||
@endphp
|
||||
|
||||
<table class="table table-light table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>{{ $primary_diagnosis ? $primary_diagnosis->name : "" }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
$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>
|
||||
|
||||
@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)
|
||||
@php
|
||||
$other_diagnosis = \Streamline\Models\Diagnosis::withTrashed()->find($diagnosis);
|
||||
@endphp
|
||||
<tr>
|
||||
<td>{{ $other_diagnosis ? $other_diagnosis->name : "" }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
</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>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<strong>Investigations done</strong>
|
||||
</div>
|
||||
<table class="table table-light table-sm">
|
||||
<thead>
|
||||
@if(count($ward_investigations) > 0)
|
||||
@for($i = 0; $i < count($ward_investigations['name']); $i++)
|
||||
@if(in_array($i, $ward_investigations_position))
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<h5><code>{{ $ward_investigations_date[array_search($i, $ward_investigations_position)] }}</code></h5>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@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>{{ $ward_investigations['name'][$i] }}</td>
|
||||
<input type="hidden" name="ward_investigation_ids[]" value="{{ $ward_investigations['id'][$i] }}">
|
||||
<td>
|
||||
@if($ward_investigations['type'][$i] == 1 && $ward_investigations['value'][$i] != "Pending")
|
||||
<i style="color: blue"> Refer to investigation report </i>
|
||||
@else
|
||||
{{ $ward_investigations['value'][$i] }}
|
||||
{{ $drug_details->name }}
|
||||
|
||||
@if($purchased_elsewhere_array[$x] == 1)
|
||||
<code>( To Be Purchased elsewhere )</code>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $ward_investigations['comment'][$i] }}</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
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="3">No investigations done</td>
|
||||
</tr>
|
||||
@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
|
||||
</thead>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
+62
-69
@@ -44,6 +44,7 @@
|
||||
$parent_consultations = \Streamline\Models\Consultation::where(['episode_id' => $parent_episode_details->id])->get();
|
||||
$parent_consultation_details = count($parent_consultations) > 0 ? $parent_consultations->first() : null;
|
||||
$parent_triage_details = \Streamline\Models\Triage::where(['id' => $parent_episode_details->triage_id])->first();
|
||||
$parent_consultation_notes = \Streamline\Models\WardInpatientDetailedNote::where(['patient_id' => $episode->patient_id, 'episode_id' => $episode->parent_episode_id, 'ward_id' => 0])->get();
|
||||
|
||||
if(check_if_episode_is_a_followup($parent_episode_details->id)){
|
||||
$episode_has_grand_parent_episode = true;
|
||||
@@ -224,7 +225,7 @@
|
||||
<code>{{ __('consultations.no_observations_recorded') }}</code>
|
||||
@endif
|
||||
|
||||
{{ __('consultations.triage_done_by') }} {!! isset($triage) ? '<font style="color:blue;">'.\Streamline\Models\User::withTrashed()->find($triage->created_by)->first_name. " ".\Streamline\Models\User::withTrashed()->find($triage->created_by)->last_name.' on '.streamline_date_time($triage->created_at).'</font>' : "" !!}
|
||||
{{ __('consultations.triage_done_by') }} {!! isset($triage) ? '<font style="color:blue;">'.$users[$triage->created_by].' on '.streamline_date_time($triage->created_at).'</font>' : "" !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -685,38 +686,68 @@
|
||||
|
||||
@if($consultation_with_notes)
|
||||
<div class="white-box">
|
||||
@if(check_if_episode_is_a_followup($episode->id) && !is_null($parent_consultation_details))
|
||||
@php
|
||||
$parent_consultation_history = $parent_consultation_details->history_comments;
|
||||
|
||||
$parent_consultation_clinical_examination = $parent_consultation_details->clinic_examination_comments;
|
||||
|
||||
$parent_consultation_inv_and_mgt = $parent_consultation_details->investigation_and_management_plan_comments;
|
||||
@endphp
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<font color="green"><b>History {{ __('consultations.for_episode_of') }} {{ streamline_date($parent_consultation_details->created_at) }}</b></font>
|
||||
<textarea class="form-control" name="parent_history_comments" readonly>{{ $parent_consultation_history }}</textarea>
|
||||
</div>
|
||||
<h4 class="text-center">Previously Added Consultation Notes</h4>
|
||||
<div class="row">
|
||||
<div class="col table-responsive">
|
||||
<table class="table table-hover color-table success-table table-bordered" style="table-layout:fixed;">
|
||||
<thead>
|
||||
<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 ($consultation_notes as $consultation_note)
|
||||
<tr>
|
||||
<td style="word-wrap:break-word;">{{ $consultation_note->history_comments }}</td>
|
||||
<td style="word-wrap:break-word;">{{ $consultation_note->clinic_examination_comments }}</td>
|
||||
<td style="word-wrap:break-word;">{{ $consultation_note->investigation_and_management_plan_comments}}</td>
|
||||
<td style="word-wrap:break-word;">{{ streamline_date_time($consultation_note->created_at) }} <br> by {{ $users[$consultation_note->created_by]?? '' }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="4"><code>No previously added consultation notes.</code></td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<font color="green"><b>{{ __('consultations.clinical_examination') }} {{ __('consultations.for_episode_of') }} {{ streamline_date($parent_consultation_details->created_at) }}</b></font>
|
||||
<textarea class="form-control" name="parent_clinic_examination_comments" readonly>{{ $parent_consultation_clinical_examination }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<font color="green"><b>{{ __('consultations.investigation_and_mgt_plan') }} {{ __('consultations.for_episode_of') }} {{ streamline_date($parent_consultation_details->created_at) }}</b></font>
|
||||
<textarea class="form-control" name="parent_investigation_and_management_plan_comments" readonly>{{ $parent_consultation_inv_and_mgt }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(check_if_episode_is_a_followup($episode->id) && !empty($parent_consultation_notes))
|
||||
<div class="white-box">
|
||||
<div class="row">
|
||||
<div class="col table-responsive">
|
||||
<table class="table table-hover color-table success-table table-bordered" style="table-layout:fixed;">
|
||||
<thead>
|
||||
<tr><th colspan="4">Previously Added Consultation Notes {{ __('consultations.for_episode_of') }} {{ streamline_date($parent_consultation_details->created_at) }}</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 ($parent_consultation_notes as $consultation_note)
|
||||
<tr>
|
||||
<td style="word-wrap:break-word;">{{ $consultation_note->history_comments }}</td>
|
||||
<td style="word-wrap:break-word;">{{ $consultation_note->clinic_examination_comments }}</td>
|
||||
<td style="word-wrap:break-word;">{{ $consultation_note->investigation_and_management_plan_comments}}</td>
|
||||
<td style="word-wrap:break-word;">{{ streamline_date_time($consultation_note->created_at) }} <br> by {{ $users[$consultation_note->created_by]?? '' }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="4"><code>No previously added consultation notes {{ __('consultations.for_episode_of') }} {{ streamline_date($parent_consultation_details->created_at) }}.</code></td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
{{-- <div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover color-table success-table table-bordered">
|
||||
@@ -733,46 +764,8 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover color-table success-table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('consultations.clinical_examination') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{!! ($consultation->clinic_examination_comments) ? nl2br(e($consultation->clinic_examination_comments)) : "No comments available" !!}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover color-table success-table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('consultations.investigation_and_mgt_plan') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{!! ($consultation->investigation_and_management_plan_comments) ? nl2br(e($consultation->investigation_and_management_plan_comments)) : "No comments available" !!}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> --}}
|
||||
|
||||
@endif
|
||||
|
||||
<div class="white-box">
|
||||
|
||||
+998
-707
File diff suppressed because it is too large
Load Diff
+131
-116
@@ -76,24 +76,24 @@
|
||||
<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>
|
||||
<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>
|
||||
<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)
|
||||
@foreach($patient_episodes as $patient_episode)
|
||||
@php
|
||||
$episode_id = $patient_episode->id;
|
||||
$created_at = Carbon\Carbon::parse($patient_episode->created_at);
|
||||
@@ -139,99 +139,99 @@
|
||||
@endif
|
||||
|
||||
@php
|
||||
$primary_diagnosis = $diagnoses[$primary_diagnosis_id] ?? '';
|
||||
$other_diagnoses = "";
|
||||
$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]] . ", ") : '';
|
||||
}
|
||||
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);
|
||||
$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>
|
||||
<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))
|
||||
@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
|
||||
$original_episode = \Streamline\Models\PatientEpisode::find($patient_episode->parent_episode_id);
|
||||
$consultation_done_by = !empty($anc->created_by)? $anc->created_by :get_doctor_who_completed_episode_consultation($patient_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 }}
|
||||
@if(!is_null($consultation_done_by))
|
||||
{{ get_full_name($consultation_done_by, "id", "first_name", "last_name", "users") }}
|
||||
@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>
|
||||
@if($patient_episode->episode_type == 1)
|
||||
<span>{{ __('patient_flow_monitoring.lab_self_request') }}</span>
|
||||
@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
|
||||
</td>
|
||||
<td class="hidden-phone">
|
||||
{!! read_more($triage_and_consultation_comments, 'short_comment' . $patient_episode->id, 'long_comment' . $patient_episode->id) !!}
|
||||
|
||||
@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>
|
||||
<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');
|
||||
@@ -276,7 +276,14 @@
|
||||
{{ get_full_name($consultation_done_by, "id", "first_name", "last_name", "users") }}
|
||||
@endif
|
||||
</td>
|
||||
<td> {{ $inpatient_info->comments }}</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 }}"/>
|
||||
@@ -325,7 +332,14 @@
|
||||
{{ get_full_name($consultation_done_by, "id", "first_name", "last_name", "users") }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $theatre_information['comments'] }}</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>
|
||||
@@ -366,7 +380,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -502,7 +516,7 @@
|
||||
<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 Eye Glasses</button>
|
||||
<button type="submit" name="submit" class="btn btn-success btn-sm col-sm-12" value="eye_glasses">Order Opticals</button>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@@ -512,19 +526,19 @@
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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">
|
||||
@@ -540,7 +554,7 @@
|
||||
<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>
|
||||
<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>
|
||||
@@ -556,19 +570,19 @@
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
@@ -785,6 +799,7 @@
|
||||
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) {
|
||||
|
||||
+59
-13
@@ -488,12 +488,26 @@
|
||||
{{ isset($marital_statuses[$patient->marital_status]) ? $marital_statuses[$patient->marital_status] : 'N/A' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="highlight">National ID</th>
|
||||
<td>
|
||||
{{ strtoupper($patient->national_id) }}
|
||||
</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);
|
||||
@@ -533,12 +547,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<th class="highlight">{{ __('layout.next_of_kin') }}</th>
|
||||
<td>{{ $patient->next_of_kin }}</td>
|
||||
@@ -553,6 +562,15 @@
|
||||
<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>
|
||||
@@ -606,6 +624,34 @@
|
||||
{{ 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>
|
||||
@@ -899,6 +945,6 @@
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$('#new_episode_options').select2();
|
||||
$('#new_episode_options, #admission_ward_id').select2({width: "100%"});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
+53
-29
@@ -48,7 +48,7 @@
|
||||
<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', '0'=>'Yesterday','1'=>'Custom Date','2'=>'Custom Range'], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
|
||||
{{ 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>
|
||||
@@ -150,7 +150,7 @@
|
||||
$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>
|
||||
@@ -237,7 +237,7 @@
|
||||
</td>
|
||||
<td>
|
||||
@if(is_object($patient) && is_null($patient->deleted_at))
|
||||
<input type="radio" onchange="show({{ $episode->id }})" class="radio-option centered" name="episode_id" value="{{ $episode->id }}" />
|
||||
<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
|
||||
@@ -445,7 +445,7 @@
|
||||
<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">{{ __('patient_flow_monitoring.consultation') }}</button>
|
||||
<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">
|
||||
@@ -500,7 +500,7 @@
|
||||
</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">{{ __('patient_episode.consultation_with_notes') }}</button>
|
||||
<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">
|
||||
@@ -531,7 +531,7 @@
|
||||
<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">{{ __('patient_flow_monitoring.consultation') }}</button>
|
||||
<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">
|
||||
@@ -586,7 +586,7 @@
|
||||
</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">{{ __('patient_episode.consultation_with_notes') }}</button>
|
||||
<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">
|
||||
@@ -657,6 +657,28 @@
|
||||
</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')
|
||||
@@ -669,26 +691,6 @@
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
/*$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
bInfo: false,
|
||||
bPaginate: false,
|
||||
buttons: [
|
||||
{extend: 'pdf',
|
||||
exportOptions: {
|
||||
stripHtml: false,
|
||||
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
|
||||
}
|
||||
},
|
||||
{extend: 'print',
|
||||
exportOptions: {
|
||||
stripHtml: false,
|
||||
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
|
||||
}
|
||||
}
|
||||
]
|
||||
});*/
|
||||
|
||||
let selected_row = 0;
|
||||
|
||||
function show(episodeId) {
|
||||
@@ -727,8 +729,8 @@
|
||||
}
|
||||
});
|
||||
|
||||
$('#triage,#consultation,#create_anaesthetics,#anaesthetics_history,#create_surgery,#surgery_index,#treatment,#investigation,#anc_registration_button,' +
|
||||
'#anc_followup_button,#view_patient_history,#consultation_with_notes,#triage_without_etat,#main_exam,#base_refraction_exam').click(function() {
|
||||
$('#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;
|
||||
@@ -821,5 +823,27 @@
|
||||
$('.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
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
</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']) }}
|
||||
{{ 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>
|
||||
@@ -127,7 +127,7 @@
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('phone',__('patients.phone')) }}
|
||||
{{ Form::text('phone','',['class' => 'form-control compulsory','id' => 'phone', 'required' ]) }}
|
||||
{{ 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>
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('alternative_phone', 'Alternative Phone Number') }}
|
||||
{{ Form::text('alternative_phone','',['class' => 'form-control','id' => 'alternative_phone']) }}
|
||||
{{ 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">
|
||||
@@ -181,11 +181,34 @@
|
||||
<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']) }}
|
||||
{{ 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') }}
|
||||
@@ -236,6 +259,9 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<hr>
|
||||
@@ -356,6 +382,36 @@
|
||||
</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">
|
||||
@@ -437,6 +493,70 @@
|
||||
});
|
||||
}
|
||||
|
||||
// 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();
|
||||
@@ -655,7 +775,7 @@
|
||||
});
|
||||
|
||||
/* make residence dropdowns searchable */
|
||||
$('#district_id,#county_id,#subcounty_id,#parish_id,#company,#occupation').select2({
|
||||
$('#district_id,#county_id,#subcounty_id,#parish_id,#company,#occupation,#foreginer_refugee').select2({
|
||||
placeholder: "<?php echo __('patients.select')?>",
|
||||
width: '100%',
|
||||
});
|
||||
@@ -790,4 +910,21 @@
|
||||
}
|
||||
});
|
||||
</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
|
||||
@@ -1,4 +1,3 @@
|
||||
@php use Streamline\Enums\Roles; @endphp
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
@@ -103,7 +102,7 @@
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
@if( Auth::user()->hasRole(Roles::SUPER_ADMIN->value))
|
||||
@if( Auth::user()->hasRole('Super Admin'))
|
||||
<div class="form-group">
|
||||
{{ Form::label('is_test_patient',__('patients.is_test_patient')) }}
|
||||
<br>
|
||||
@@ -131,17 +130,17 @@
|
||||
{{ 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']) }}
|
||||
{{ 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']) }}
|
||||
{{ 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']) }}
|
||||
{{ 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">
|
||||
@@ -199,6 +198,27 @@
|
||||
{{ 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>
|
||||
|
||||
@@ -51,13 +51,12 @@
|
||||
|
||||
<div class="col-md-2">
|
||||
<button type="submit" class="btn btn-rounded btn-success"><span class="glyphicon glyphicon-search"></span> {{ __('patients.search') }}</button>
|
||||
<span class="label label-info float-right" style="font-size: 12.5px;"> {{ $patientCount }} {{ __('patients.patients_registered') }}</span>
|
||||
<span class="label label-info float-right" style="font-size: 12.5px;"> {{ count($patient_numbers) }} {{ __('patients.patients_registered') }}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@if(isset($criteria) && isset($resultCount))
|
||||
<p>{{ __('patients.search_criteria') }} : <code>{{ $criteria }}</code> {{ __('patients.total_results') }} : <code>{{ $resultCount }}</code> <a href="{{ route('patients.index') }}">{{ __('patients.clear_search') }}</a></p>
|
||||
@if(isset($criteria))
|
||||
<p>{{ __('patients.search_criteria') }} : <code>{{ $criteria }}</code></p>
|
||||
@endif
|
||||
{{ Form::close() }}
|
||||
|
||||
@@ -78,8 +77,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(count($patients) > 0)
|
||||
@foreach($patients as $patient)
|
||||
@foreach($patients as $patient)
|
||||
<tr>
|
||||
<td>{{ $patient->number }}</td>
|
||||
<td>{!! insurance_flag($patient->id) !!}</td>
|
||||
@@ -92,8 +90,8 @@
|
||||
</td>
|
||||
<td>{{ get_patients_age($patient->date_of_birth) }}</td>
|
||||
<td>{{ $patient->phone }}</td>
|
||||
<td><?php echo isset($categories[$patient->category_id]) ? $categories[$patient->category_id] : "N/A"; ?></td>
|
||||
<td>{{ isset($patient_villages[$patient->village_id]) ? $patient_villages[$patient->village_id] : '' }}</td>
|
||||
<td>{{ $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>
|
||||
@@ -102,10 +100,7 @@
|
||||
<a href="/patient_episodes/set_patient_id/{{ $patient->id }}" class="btn btn-rounded btn-primary btn-sm"><i class="fa fa-hand-pointer-o"></i> <strong>{{ __('patients.select') }}</strong></a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr class="warning"><td class="center" colspan="10"><code>{{ __('patients.no_records_found') }}</code></td></tr>
|
||||
@endif
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
@@ -177,30 +172,6 @@ $('#previous_numbers .typeahead').typeahead(
|
||||
}
|
||||
);
|
||||
|
||||
$('#first_names .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'first_names',
|
||||
source: substringMatcher(<?php echo json_encode($first_names); ?>)
|
||||
}
|
||||
);
|
||||
|
||||
$('#last_names .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'last_names',
|
||||
source: substringMatcher(<?php echo json_encode($last_names); ?>)
|
||||
}
|
||||
);
|
||||
|
||||
$('#villages .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
@@ -209,7 +180,7 @@ $('#villages .typeahead').typeahead(
|
||||
},
|
||||
{
|
||||
name: 'villages',
|
||||
source: substringMatcher(<?php echo json_encode($villages); ?>)
|
||||
source: substringMatcher(<?php echo json_encode(array_values($villages)); ?>)
|
||||
}
|
||||
);
|
||||
|
||||
@@ -275,19 +246,7 @@ $('.table').DataTable({
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$('.sorting').removeClass('sorting');//remove the sorting class
|
||||
$('.sorting_asc').removeClass('sorting_asc');//remove the sorting class
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@push('styles')
|
||||
<style type="text/css">
|
||||
.color-bordered-table.success-bordered-table {
|
||||
border-top: 0px;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
|
||||
+120
-147
@@ -1,160 +1,133 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
<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;
|
||||
}
|
||||
|
||||
<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="">
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ base_path('public/uploads/streamline/color/streamline_icon-02.png') }}">
|
||||
<title>{{ config('app.name', 'CHI Membership Card - Stre@mline') }}</title>
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{{ base_path('public/bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
|
||||
|
||||
<style style="text-css">
|
||||
body{
|
||||
/*font-size: 1.2em;*/
|
||||
}
|
||||
|
||||
thead {
|
||||
/*display: table-header-group;*/
|
||||
}
|
||||
|
||||
tfoot {
|
||||
/*display: table-row-group;*/
|
||||
}
|
||||
|
||||
tr {
|
||||
/*page-break-inside: avoid;*/
|
||||
}
|
||||
|
||||
th{
|
||||
font-weight: bolder;
|
||||
font-size: 22px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
td{
|
||||
font-size: 24px;
|
||||
padding-top: 5px;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div style="background-color: rgb(43, 116, 91); color:#fff">
|
||||
<div class="hospital-logo" style="padding-top: 10px;">
|
||||
@include('layouts.header_pdf_print')
|
||||
</div>
|
||||
|
||||
<div class="row" style="padding: 30px;">
|
||||
<div class="col-12" style="padding-top: 10px;">
|
||||
<table>
|
||||
<tr>
|
||||
<td><u>NAME</u></td>
|
||||
<td style="padding-left: 15px;"><u>SEX</u></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
{{ get_full_name($patient->id, "id", "first_name", "last_name", "patients") }}
|
||||
</th>
|
||||
<th style="padding-left: 15px;">
|
||||
{{ $patient->gender == 1 ? "MALE" : "FEMALE" }}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td style="padding-left: 15px;"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><u>Stre@mline NUMBER</u></td>
|
||||
<td style="padding-left: 15px;"><u>DATE OF BIRTH</u></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
{{ $patient->number }}
|
||||
</th>
|
||||
<th style="padding-left: 15px;">
|
||||
{{ streamline_date($patient->date_of_birth) }}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td style="padding-left: 10px;"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><u>NIN</u></td>
|
||||
<td style="padding-left: 10px;"><u>HOLDER'S SIGNATURE</u></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
{{ $patient->national_id }}
|
||||
</th>
|
||||
<th style="padding-left: 10px;">
|
||||
{{-- signature --}}
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
.a8-container {
|
||||
/*
|
||||
width: 8.5cm;
|
||||
height: 5.4cm; */
|
||||
|
||||
|
||||
<br><br><br>
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
<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>
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<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>
|
||||
{{-- <div class="a8-container"> --}}
|
||||
<table >
|
||||
{{-- row 1 --}}
|
||||
<tr style=" border-bottom: 1px solid gray; ">
|
||||
<td style="padding:8px;">
|
||||
|
||||
<tr>
|
||||
<td colspan="2" style="background-color: #fff">
|
||||
{{ getDNS1DBarcodePNGOtherOption(sprintf("%04u", $patient->id)) }}
|
||||
{{-- 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", $patient->id) }}</h4>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h4 style="color: black">{{ sprintf("%04u", $data['patient']->id) }}</h4></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<div style="text-align: center; color: #fff; padding: 10px; font-size: 22px;">
|
||||
This card should only be used for identification at a Stre@mline network hospital.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<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>
|
||||
|
||||
+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
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
@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>
|
||||
@@ -42,7 +48,7 @@
|
||||
<tr>
|
||||
<th>Code</th>
|
||||
<td>
|
||||
{{ getDNS1DBarcodePNGOtherOption(sprintf("%04u", $patient->id)) }}
|
||||
{{ getDNS1DBarcodePNG(sprintf("%04u", $patient->id)) }}
|
||||
<h4>{{ sprintf("%04u", $patient->id) }}</h4>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -65,7 +71,9 @@
|
||||
</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>
|
||||
@@ -94,6 +102,7 @@
|
||||
<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>
|
||||
@@ -102,6 +111,11 @@
|
||||
<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>
|
||||
|
||||
@@ -127,10 +141,46 @@
|
||||
<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
|
||||
|
||||
+22
-24
@@ -74,7 +74,9 @@
|
||||
@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)
|
||||
@@ -82,6 +84,10 @@
|
||||
@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"/>
|
||||
@@ -118,7 +124,7 @@
|
||||
<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="" type="number" name="eye_glass_subtotal[]"> .UGx
|
||||
<input id="pre_order_cost_sum_{{ $pre_order->id }}" class="form-control compulsory" type="number" name="eye_glass_subtotal[]"> .UGx
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@@ -275,35 +281,28 @@
|
||||
@php
|
||||
$total_stock = $prescription->pharmacy_stock;
|
||||
@endphp
|
||||
@if ($total_stock > 0 && $allergy_check != 'Allergic')
|
||||
@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
|
||||
@php
|
||||
$insurance_color = ($prescription->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1) ? "green" : "orange";
|
||||
@endphp
|
||||
@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 ($total_stock <= 0)
|
||||
@if ($prescription->total_stock <= 0)
|
||||
<span class="badge badge-danger">{{ __('point_of_sale.out_of_stock') }}</span>
|
||||
@endif
|
||||
<span style="color:{{ $insurance_color }}"> {{ $prescription->name }}</span>
|
||||
<?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 = []; }
|
||||
|
||||
for ($x = 0; $x < count($reference_array); $x++) {
|
||||
?>
|
||||
|
||||
<a style="font-weight:normal;" href="{{ $reference_array[$x] }}" target="blank">{{ $reference_name[$x] }}</a>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
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;
|
||||
@@ -413,7 +412,7 @@
|
||||
@php
|
||||
$total_stock = $prescription->pharmacy_stock;
|
||||
@endphp
|
||||
@if ($total_stock > 0 && $allergy_check != 'Allergic')
|
||||
@if ($prescription->total_stock > 0 && $allergy_check != 'Allergic')
|
||||
<input type="checkbox" name="drug_id[]" id="chk" class="prescription-check" value="{{ $prescription->id }}" />
|
||||
@endif
|
||||
</td>
|
||||
@@ -421,25 +420,18 @@
|
||||
@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 ($total_stock <= 0)
|
||||
@if ($prescription->total_stock <= 0)
|
||||
<span class="badge badge-danger">{{ __('point_of_sale.out_of_stock') }}</span>
|
||||
@endif
|
||||
<span style="color:{{ $insurance_color }}"> {{ $prescription->name }}</span>
|
||||
<?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 = []; }
|
||||
|
||||
for ($x = 0; $x < count($reference_array); $x++) {
|
||||
?>
|
||||
|
||||
<a style="font-weight:normal;" href="{{ $reference_array[$x] }}" target="blank">{{ $reference_name[$x] }}</a>
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
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;
|
||||
@@ -546,7 +538,9 @@
|
||||
@foreach($pre_ordered_sundries as $pre_order)
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" name="pos_sundry_ids[]" value="{{ $pre_order->id }}" checked>
|
||||
@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)
|
||||
@@ -554,6 +548,10 @@
|
||||
@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
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
<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>
|
||||
@@ -104,6 +105,32 @@
|
||||
@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>
|
||||
|
||||
+23
-23
@@ -176,43 +176,43 @@
|
||||
<div class="col-md-12 mt-5">
|
||||
<h4>{{ __('point_of_sale.select_items') }}</h4>
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="col-md-3">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon bg-success">
|
||||
<input id="manual_drugs" type="checkbox">
|
||||
</span>
|
||||
<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-2">
|
||||
<div class="col-md-3">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon bg-warning">
|
||||
<input id="automatic_drugs" type="checkbox">
|
||||
</span>
|
||||
<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-2">
|
||||
<div class="col-md-3">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon bg-primary">
|
||||
<input id="eye_glasses" type="checkbox">
|
||||
</span>
|
||||
<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-2">
|
||||
<div class="col-md-3 ">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon bg-danger">
|
||||
<input id="sundries" type="checkbox">
|
||||
</span>
|
||||
<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 class="col-md-2">
|
||||
</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">
|
||||
@@ -221,11 +221,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="col-md-3 mt-3">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon bg-danger">
|
||||
<input id="all" type="checkbox">
|
||||
</span>
|
||||
<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>
|
||||
|
||||
+4
-38
@@ -47,12 +47,6 @@
|
||||
<td><b>{{ __('patient_finance.patient_category') }}</b></td>
|
||||
<td>{{ get_name($patient->category_id, "id", "name", "patient_categories") }}</td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<td><b>{{ __('point_of_sale.record_date') }}</b></td>
|
||||
<td colspan="2">{{ streamline_date_time_short($receipt_date) }}</td>
|
||||
<td><b>{{ __('point_of_sale.print_date') }}</b></td>
|
||||
<td colspan="2">{{ streamline_date_time_short($receipt_reprint_date) }}</td>
|
||||
</tr>-->
|
||||
</table>
|
||||
|
||||
<table class="table table-bordered">
|
||||
@@ -67,7 +61,7 @@
|
||||
|
||||
@if(isset($service_ids_array) && count($service_ids_array) > 0)
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Services</td>
|
||||
<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>
|
||||
@@ -81,7 +75,7 @@
|
||||
|
||||
@if(isset($eye_glasses_ids_array) && count($eye_glasses_ids_array) > 0)
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Eye Glasses</td>
|
||||
<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>
|
||||
@@ -93,37 +87,9 @@
|
||||
@endfor
|
||||
@endif
|
||||
|
||||
@if(isset($procedure_ids_array) && count($procedure_ids_array) > 0)
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Procedures</td>
|
||||
</tr>
|
||||
@for($i = 0; $i < count($procedure_ids_array); $i++)
|
||||
<tr>
|
||||
<td>{{ get_name($procedure_ids_array[$i], "id", "name", "procedures") }}</td>
|
||||
<td>N/A</td>
|
||||
<td>{{ ugandan_shillings($procedure_amounts_array[$i]) }}</td>
|
||||
</tr>
|
||||
@php $total_to_pay += $procedure_amounts_array[$i]; @endphp
|
||||
@endfor
|
||||
@endif
|
||||
|
||||
@if(isset($investigation_ids_array) && count($investigation_ids_array) > 0)
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Investigations</td>
|
||||
</tr>
|
||||
@for($i = 0; $i < count($investigation_ids_array); $i++)
|
||||
<tr>
|
||||
<td>{{ get_name($investigation_ids_array[$i], "id", "name", "investigations") }}</td>
|
||||
<td>N/A</td>
|
||||
<td>{{ ugandan_shillings($investigation_amounts_array[$i]) }}</td>
|
||||
</tr>
|
||||
@php $total_to_pay += $investigation_amounts_array[$i]; @endphp
|
||||
@endfor
|
||||
@endif
|
||||
|
||||
@if(isset($treatment_item) && count($treatment_item) > 0)
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Treatments</td>
|
||||
<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>
|
||||
@@ -137,7 +103,7 @@
|
||||
|
||||
@if(isset($sundry_item) && count($sundry_item) > 0)
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Sundries</td>
|
||||
<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>
|
||||
|
||||
+8
-37
@@ -63,13 +63,12 @@
|
||||
<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.cashier') }}:</b> {{ get_full_name($cashier, 'id', 'first_name', 'last_name', 'users') }}</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.receipt_number') }}:</b> {{ $receipt_number }}</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.category') }} :</b> {{ get_name($patient->category_id, "id", "name", "patient_categories") }}</span>
|
||||
<span class="receipt-label"><b>{{ __('patient_finance.patient_category') }} :</b> {{ get_name($patient->category_id, "id", "name", "patient_categories") }}</span>
|
||||
</p>
|
||||
|
||||
<div>
|
||||
@@ -85,7 +84,7 @@
|
||||
|
||||
@if(isset($service_ids_array) && count($service_ids_array) > 0)
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Services</td>
|
||||
<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>
|
||||
@@ -99,49 +98,21 @@
|
||||
|
||||
@if(isset($eye_glasses_ids_array) && count($eye_glasses_ids_array) > 0)
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Eye Glasses</td>
|
||||
<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>
|
||||
<td>{{ ugandan_shillings($eye_glasses_prices_array[$i] ) }}</td>
|
||||
</tr>
|
||||
@php $total_to_pay += $eye_glasses_prices_array[$i] * $eye_glasses_quantity_array[$i]; @endphp
|
||||
@endfor
|
||||
@endif
|
||||
|
||||
@if(isset($procedure_ids_array) && count($procedure_ids_array) > 0)
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Procedures</td>
|
||||
</tr>
|
||||
@for($i = 0; $i < count($procedure_ids_array); $i++)
|
||||
<tr>
|
||||
<td>{{ get_name($procedure_ids_array[$i], "id", "name", "procedures") }}</td>
|
||||
<td>N/A</td>
|
||||
<td>{{ ugandan_shillings($procedure_amounts_array[$i]) }}</td>
|
||||
</tr>
|
||||
@php $total_to_pay += $procedure_amounts_array[$i]; @endphp
|
||||
@endfor
|
||||
@endif
|
||||
|
||||
@if(isset($investigation_ids_array) && count($investigation_ids_array) > 0)
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Investigations</td>
|
||||
</tr>
|
||||
@for($i = 0; $i < count($investigation_ids_array); $i++)
|
||||
<tr>
|
||||
<td>{{ get_name($investigation_ids_array[$i], "id", "name", "investigations") }}</td>
|
||||
<td>N/A</td>
|
||||
<td>{{ ugandan_shillings($investigation_amounts_array[$i]) }}</td>
|
||||
</tr>
|
||||
@php $total_to_pay += $investigation_amounts_array[$i]; @endphp
|
||||
@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</td>
|
||||
<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>
|
||||
@@ -155,7 +126,7 @@
|
||||
|
||||
@if(isset($sundry_item) && count($sundry_item) > 0)
|
||||
<tr>
|
||||
<td colspan="3" class="text-center">Sundries</td>
|
||||
<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>
|
||||
|
||||
@@ -121,9 +121,6 @@
|
||||
@endif
|
||||
|
||||
@if (is_hiv_and_gbv_screening_tool_enabled())
|
||||
<script>
|
||||
alert('Please have this disabled');
|
||||
</script>
|
||||
@include('patients::triage.hiv_gbv_screening')
|
||||
@endif
|
||||
|
||||
@@ -269,7 +266,7 @@
|
||||
<td colspan="2">
|
||||
{{ Form::label('child_with_proven_infection', 'Does the child have a proven or suspected infection e.g is the child having fever, cough, diarrhoea?') }}
|
||||
</td>
|
||||
<td>{{ Form::radio('child_with_proven_infection', 0, false, ['onclick' => 'show_proven_infection_questions()']) }}
|
||||
<td>{{ Form::radio('child_with_proven_infection', 1, false, ['onclick' => 'show_proven_infection_questions()']) }}
|
||||
Yes</td>
|
||||
<td>{{ Form::radio('child_with_proven_infection', 0, false, ['onclick' => 'hide_proven_infection_questions()']) }}
|
||||
No</td>
|
||||
|
||||
@@ -76,10 +76,7 @@
|
||||
<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.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>
|
||||
@@ -87,13 +84,13 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class='symptoms_input_fields_wrap'>
|
||||
@php
|
||||
$symptoms_array = explode(',', $triage->symptoms);
|
||||
$symptoms_duration_array = explode(',', $triage->symptom_duration);
|
||||
@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 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>";
|
||||
@@ -124,79 +121,41 @@
|
||||
$duration_array = explode(" ", $symptoms_duration_array[$i]);
|
||||
@endphp
|
||||
<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 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='symptoms_duration_0' class='col-sm-12 form-control h-100'>
|
||||
<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='symptoms_time_0'
|
||||
class='col-sm-12 form-control select2-hidden-accessible'>@php echo $option_symptoms_periods; @endphp</select>
|
||||
<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_0' style='width: 30%'></td>
|
||||
<td id='symptoms_reference_0'></td>
|
||||
<td style='width: 1%;'></td>
|
||||
<td id="symptoms_prompt_{{ $i }}" style="width: 30%"></td>
|
||||
<td id="symptoms_reference_{{ $i }}"></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 m-0 d-flex justify-content-between align-items-stretch">
|
||||
<div class="col-sm-3 p-0">
|
||||
<input type="text" style="display: block;" name="duration[]"
|
||||
id="duration[]" class="col-sm-12 form-control h-100"
|
||||
value="{{ $duration_array[0] }}">
|
||||
</div>
|
||||
<div class="col-sm-9 p-0">
|
||||
<select style="display: inline-block;" name="time[]" id="time[]"
|
||||
class="w-100 form-control select-2 h-100">
|
||||
<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
|
||||
@endfor
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
<a class="btn btn-success btn-xs" onclick="add_symptom_row()"
|
||||
id="add_row">{{ __('triage.add_row') }}</a>
|
||||
<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.edit_tb_screening')
|
||||
@include('patients::triage.edit_tb_screening')
|
||||
@endif
|
||||
|
||||
@if (is_hiv_screening_tool_enabled())
|
||||
|
||||
+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
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::group(['middleware' => ['auth', 'disablebackbutton', 'user-locale']], function () {
|
||||
Route::group(['middleware' => ['auth', 'disablebackbutton', 'user-locale','subscription-tracking', 'password-expiry']], function () {
|
||||
/* Alerts */
|
||||
Route::post('store_patient_alerts', 'AlertsController@store_patient_alerts');
|
||||
Route::any('alerts/view_alerts', 'AlertsController@view_alerts');
|
||||
@@ -24,6 +24,8 @@ Route::group(['middleware' => ['auth', 'disablebackbutton', 'user-locale']], fun
|
||||
Route::any('opd_referral_notes_print/{patient_id}/{episode_id}', 'ConsultationController@opd_referral_notes_print')->name('consultation.opd_referral_notes_print');
|
||||
Route::any('consultation/add_diagnosis', 'ConsultationController@add_diagnosis')->name('consultation.add_diagnosis');
|
||||
Route::get('get_outcome_slug/{id}', 'ConsultationController@get_outcome_slug');
|
||||
Route::get('delete_consultation_clinical_notes/{id}', 'ConsultationController@delete_consultation_clinical_notes');
|
||||
Route::post('update_consultation_clinical_notes', 'ConsultationController@update_consultation_clinical_notes');
|
||||
|
||||
/* Triage Controller */
|
||||
Route::any('/triage/add_symptom', 'TriageController@add_symptom')->name('triage.add_symptom');
|
||||
@@ -114,60 +116,63 @@ Route::group(['middleware' => ['auth', 'disablebackbutton', 'user-locale']], fun
|
||||
|
||||
/* Patient Controller */
|
||||
Route::get('/patients/inactive', 'PatientController@inactive')->name('patients.inactive');
|
||||
Route::get('/patients/follow_up', 'PatientController@follow_up')->name('patients.follow_up');
|
||||
Route::get('/patients/appointment_requests', 'PatientController@appointment_requests')->name('patients.appointment_requests');
|
||||
Route::get('/patients/confirm_appointment/{id}', 'PatientController@confirm_appointment');
|
||||
Route::any('/patients/save_confirmed_appointment', 'PatientController@save_confirmed_appointment')->name('patients.save_confirmed_appointment');
|
||||
Route::any('/patients/follow_up_fetch_patients', 'PatientController@follow_up_fetch_patients')->name('patients.follow_up_fetch_patients');
|
||||
Route::any('/patients/create_appointment', 'PatientController@create_appointment')->name('patients.create_appointment');
|
||||
Route::any('/patients/save_appointment', 'PatientController@save_appointment')->name('patients.save_appointment');
|
||||
Route::any('/patients/complete_appointment/{id}', 'PatientController@complete_appointment');
|
||||
Route::any('/patients/cancel_patient_appointment/{id}', 'PatientController@cancel_patient_appointment');
|
||||
Route::any('/patients/reschedule_appointment/{id}', 'PatientController@reschedule_appointment');
|
||||
Route::any('/patients/save_rescheduled_appointment', 'PatientController@save_rescheduled_appointment')->name('patients.save_rescheduled_appointment');
|
||||
Route::any('/patients/patient_cards/search_patient_cards_to_print', 'PatientController@search_patient_cards_to_print')->name('patients.search_patient_cards_to_print');
|
||||
Route::post('/patients/patient_cards/print_patients_cards', 'PatientController@print_patients_cards')->name('patients.print_patients_cards');
|
||||
Route::get('/patients/follow_up', 'PatientAppointmentsController@follow_up')->name('patients.follow_up');
|
||||
Route::get('/patients/appointment_requests', 'PatientAppointmentsController@appointment_requests')->name('patients.appointment_requests');
|
||||
Route::get('/patients/confirm_appointment/{id}', 'PatientAppointmentsController@confirm_appointment');
|
||||
Route::any('/patients/save_confirmed_appointment', 'PatientAppointmentsController@save_confirmed_appointment')->name('patients.save_confirmed_appointment');
|
||||
Route::any('/patients/follow_up_fetch_patients', 'PatientAppointmentsController@follow_up_fetch_patients')->name('patients.follow_up_fetch_patients');
|
||||
Route::any('/patients/create_appointment', 'PatientAppointmentsController@create_appointment')->name('patients.create_appointment');
|
||||
Route::any('/patients/save_appointment', 'PatientAppointmentsController@save_appointment')->name('patients.save_appointment');
|
||||
Route::any('/patients/complete_appointment/{id}', 'PatientAppointmentsController@complete_appointment');
|
||||
Route::any('/patients/cancel_patient_appointment/{id}', 'PatientAppointmentsController@cancel_patient_appointment');
|
||||
Route::any('/patients/reschedule_appointment/{id}', 'PatientAppointmentsController@reschedule_appointment');
|
||||
Route::any('/patients/save_rescheduled_appointment', 'PatientAppointmentsController@save_rescheduled_appointment')->name('patients.save_rescheduled_appointment');
|
||||
Route::get('/patients/search_patient_by_name_number', 'PatientController@search_patient_by_name_number')->name('patients.search_patient_by_name_number');
|
||||
Route::get('/patients/update_patient_info/{id}', 'PatientController@update_patient_info')->name('patients.update_patient_info');
|
||||
Route::get('/patients/create', 'PatientController@create')->name('patients.create');
|
||||
Route::any('/patients/selected', 'PatientController@select')->name('patients.selected');
|
||||
Route::any('/patients/select', 'PatientController@select')->name('patients.select');
|
||||
Route::post('/activate{id}/patients', 'PatientController@activate')->name('patients.activate');
|
||||
Route::any('/patients/get_counties/{id}', 'PatientController@get_counties')->name('patients.get_counties');
|
||||
Route::any('/patients/get_subcounties/{id}', 'PatientController@get_subcounties')->name('patients.get_subcounties');
|
||||
Route::any('/patients/get_parishes/{id}', 'PatientController@get_parishes')->name('patients.get_parishes');
|
||||
Route::any('/patients/get_villages/{id}', 'PatientController@get_villages')->name('patients.get_villages');
|
||||
Route::any('/patients/get_counties/{id}', 'ResidenceController@get_counties')->name('patients.get_counties');
|
||||
Route::any('/patients/get_subcounties/{id}', 'ResidenceController@get_subcounties')->name('patients.get_subcounties');
|
||||
Route::any('/patients/get_parishes/{id}', 'ResidenceController@get_parishes')->name('patients.get_parishes');
|
||||
Route::any('/patients/get_villages/{id}', 'ResidenceController@get_villages')->name('patients.get_villages');
|
||||
Route::get('/patients/search_residences', 'PatientController@search_residences')->name('patients.search_residences');
|
||||
Route::any('/patients/save_patient_with_episode', 'PatientController@save_patient_with_episode')->name('patients.save_patient_with_episode');
|
||||
Route::any('/patients/check_duplicate_patients', 'PatientController@check_duplicate_patients')->name('patients.check_duplicate_patients');
|
||||
Route::post('/patients/delete_patient_with_reason', 'PatientController@delete_patient_with_reason')->name('patients.delete_patient_with_reason');
|
||||
Route::any('/patients/search', 'PatientController@search')->name('patients.search');
|
||||
Route::any('patients/add_company', 'PatientController@add_company')->name('patients.add_company');
|
||||
Route::any('patients/add_country', 'PatientController@add_country')->name('patients.add_country');
|
||||
Route::any('patients/quick_add_district_residence', 'PatientController@quick_add_district_residence');
|
||||
Route::any('patients/quick_add_village_residence', 'PatientController@quick_add_village_residence');
|
||||
Route::any('patients/quick_add_residence', 'PatientController@quick_add_residence');
|
||||
Route::any('patients/quick_add_residence', 'ResidenceController@quick_add_residence');
|
||||
Route::any('patients/get_fingerprint/{id}', 'PatientController@get_fingerprint');
|
||||
Route::any('patients/fetch_fingerprint_from_scanner/', 'PatientController@fetch_fingerprint_from_scanner');
|
||||
Route::any('patients/compare_fingerprint_from_scanner/', 'PatientController@compare_fingerprint_from_scanner');
|
||||
|
||||
/* patient residences */
|
||||
Route::get('patient_residence/{disctrict_id}', 'PatientController@get_residence');
|
||||
Route::get('patient_residence/search_districts', 'PatientController@search_districts');
|
||||
Route::get('patient_residence/search_counties', 'PatientController@search_counties');
|
||||
Route::get('patient_residence/search_subcounties', 'PatientController@search_subcounties');
|
||||
Route::get('patient_residence/search_parishes', 'PatientController@search_parishes');
|
||||
Route::get('patient_residence/search_villages', 'PatientController@search_villages');
|
||||
Route::get('patient_residence/district/{district_id}', 'PatientController@get_residence_district');
|
||||
Route::get('patient_residence/county/{county_id}', 'PatientController@get_residence_county');
|
||||
Route::get('patient_residence/sub_county/{sub_county_id}', 'PatientController@get_residence_sub_county');
|
||||
Route::get('patient_residence/parish/{parish_id}', 'PatientController@get_residence_parish');
|
||||
Route::get('patient_residence/{disctrict_id}', 'ResidenceController@get_residence');
|
||||
Route::get('patient_residence/search_districts', 'ResidenceController@search_districts');
|
||||
Route::get('patient_residence/search_counties', 'ResidenceController@search_counties');
|
||||
Route::get('patient_residence/search_subcounties', 'ResidenceController@search_subcounties');
|
||||
Route::get('patient_residence/search_parishes', 'ResidenceController@search_parishes');
|
||||
Route::get('patient_residence/search_villages', 'ResidenceController@search_villages');
|
||||
Route::get('patient_residence/district/{district_id}', 'ResidenceController@get_residence_district');
|
||||
Route::get('patient_residence/county/{county_id}', 'ResidenceController@get_residence_county');
|
||||
Route::get('patient_residence/sub_county/{sub_county_id}', 'ResidenceController@get_residence_sub_county');
|
||||
Route::get('patient_residence/parish/{parish_id}', 'ResidenceController@get_residence_parish');
|
||||
|
||||
Route::resource('patients', 'PatientController');
|
||||
|
||||
Route::any('add_new_occupation_dynamically', 'PatientController@add_new_occupation_dynamically');
|
||||
Route::any('add_new_district_dynamically', 'PatientController@add_new_district_dynamically');
|
||||
Route::any('add_new_county_dynamically', 'PatientController@add_new_county_dynamically');
|
||||
Route::any('add_new_subcounty_dynamically', 'PatientController@add_new_subcounty_dynamically');
|
||||
Route::any('add_new_parish_dynamically', 'PatientController@add_new_parish_dynamically');
|
||||
Route::any('add_new_village_dynamically', 'PatientController@add_new_village_dynamically');
|
||||
Route::any('add_new_occupation_dynamically', 'ResidenceController@add_new_occupation_dynamically');
|
||||
Route::any('add_new_district_dynamically', 'ResidenceController@add_new_district_dynamically');
|
||||
Route::any('add_new_county_dynamically', 'ResidenceController@add_new_county_dynamically');
|
||||
Route::any('add_new_subcounty_dynamically', 'ResidenceController@add_new_subcounty_dynamically');
|
||||
Route::any('add_new_parish_dynamically', 'ResidenceController@add_new_parish_dynamically');
|
||||
Route::any('add_new_village_dynamically', 'ResidenceController@add_new_village_dynamically');
|
||||
|
||||
// duplicate patients
|
||||
Route::any('possible_duplicate_patients/{id}', 'PatientController@possible_duplicate_patients');
|
||||
@@ -175,9 +180,10 @@ Route::group(['middleware' => ['auth', 'disablebackbutton', 'user-locale']], fun
|
||||
Route::any('merge_patient_records', 'PatientController@merge_records')->name('patients.merge_records');
|
||||
|
||||
//patient appointments report
|
||||
Route::any('patient_appointments_report', 'PatientController@patient_appointments_report')->name('patients.patient_appointments_report');
|
||||
Route::any('patient_appointments_report', 'PatientAppointmentsController@patient_appointments_report')->name('patients.patient_appointments_report');
|
||||
Route::post('view_dna_patient_demographic', 'PatientController@view_dna_patient_demographic');
|
||||
Route::any('store_appointment_comment', 'PatientController@store_appointment_comment');
|
||||
Route::any('store_appointment_comment', 'PatientAppointmentsController@store_appointment_comment');
|
||||
|
||||
Route::any('patient_card/{id}', 'PatientController@patient_card');
|
||||
Route::get('patient_cards', 'PatientController@patient_cards')->name('patients.patient_cards');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user