resolved conflicts

This commit is contained in:
2025-03-31 03:46:05 +03:00
6454 changed files with 1520539 additions and 9 deletions
@@ -0,0 +1,5 @@
<?php
return [
'name' => 'Reports'
];
@@ -0,0 +1,13 @@
<?php
namespace Modules\Reports\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,161 @@
<?php
namespace Modules\Reports\Http\Controllers;
use Barryvdh\Snappy\Facades\SnappyPdf;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Streamline\Models\HospitalInformation;
use Streamline\Models\PatientEpisode;
use Streamline\Models\Investigation;
class HmisController002 extends Controller {
public function page_1(Request $request) {
$search_text = "";
switch ($request->search_date_by){
case 'yesterday':
$end_date = Carbon::yesterday()->endOfDay()->format('Y-m-d H:i:s');
$start_date = Carbon::yesterday()->startOfDay()->format('Y-m-d H:i:s');
$search_text .= "Yesterday ";
break;
case 'custom_date':
$end_date = Carbon::parse($request->start_date)->endOfDay()->format('Y-m-d H:i:s');
$start_date = Carbon::parse($request->start_date)->startOfDay()->format('Y-m-d H:i:s');
$search_text .= "From: " . streamline_date($start_date) . " ";
break;
case 'custom_date_range':
$end_date = Carbon::parse($request->end_date)->endOfDay()->format('Y-m-d H:i:s');
$start_date = Carbon::parse($request->start_date)->startOfDay()->format('Y-m-d H:i:s');
$search_text .= "From: " . streamline_date($start_date) . " to " . streamline_date($end_date) . " ";
break;
case 'today':
default:
$end_date = Carbon::today()->endOfDay()->format('Y-m-d H:i:s');
$start_date = Carbon::today()->startOfDay()->format('Y-m-d H:i:s');
$search_text .= "Today ";
break;
}
$episodes = PatientEpisode::leftJoin('triage', 'patient_episodes.triage_id', '=', 'triage.id')
->leftJoin('patients', 'patient_episodes.patient_id', '=', 'patients.id')
->leftJoin('consultations as c', 'patient_episodes.id', '=', 'c.episode_id')
->leftJoin('districts', 'patients.district_id', '=', 'districts.id')
->leftJoin('subcounties', 'patients.subcounty_id', '=', 'subcounties.id')
->leftJoin('parishes', 'patients.parish_id', '=', 'parishes.id')
->leftJoin('villages', 'patients.village_id', '=', 'villages.id')
->leftJoin('family_relations', 'patients.next_of_kin_relationship', '=', 'family_relations.id')
->select('patient_episodes.id as id', 'first_name', 'last_name', 'date_of_birth', 'gender', 'citizenship', 'next_of_kin', 'national_id', 'phone', 'rbs', 'phone_of_next_of_kin', 'next_of_kin_relationship', 'family_relations.name as relation', 'observations', 'new_attendance', 'villages.name as village', 'parishes.name as parish', 'subcounties.name as subcounty', 'districts.name as district', 'patient_episodes.created_at', 'patient_episodes.consultation_id','patient_episodes.triage_id')
->whereBetween('patient_episodes.created_at', [$start_date, $end_date])->orderBy('id', 'asc')
->get();
$hospital_info = HospitalInformation::find(1);
return view('reports::hmis_reports.002.page-1', compact('search_text', 'episodes', 'start_date','hospital_info','end_date'));
}
public function page_1_print($start_date, $end_date) {
$episodes = PatientEpisode::leftJoin('triage', 'patient_episodes.triage_id', '=', 'triage.id')
->leftJoin('patients', 'patient_episodes.patient_id', '=', 'patients.id')
->leftJoin('consultations as c', 'patient_episodes.id', '=', 'c.episode_id')
->leftJoin('districts', 'patients.district_id', '=', 'districts.id')
->leftJoin('subcounties', 'patients.subcounty_id', '=', 'subcounties.id')
->leftJoin('parishes', 'patients.parish_id', '=', 'parishes.id')
->leftJoin('villages', 'patients.village_id', '=', 'villages.id')
->leftJoin('family_relations', 'patients.next_of_kin_relationship', '=', 'family_relations.id')
->select('patient_episodes.id as id', 'first_name', 'last_name', 'date_of_birth', 'gender', 'citizenship', 'next_of_kin', 'national_id', 'phone', 'rbs', 'phone_of_next_of_kin', 'next_of_kin_relationship', 'family_relations.name as relation', 'observations', 'new_attendance', 'villages.name as village', 'parishes.name as parish', 'subcounties.name as subcounty', 'districts.name as district', 'patient_episodes.created_at', 'patient_episodes.consultation_id','patient_episodes.triage_id')
->whereBetween('patient_episodes.created_at', [$start_date, $end_date])->orderBy('id', 'asc')
->get();
$search_text = "From: " . streamline_date($start_date) . " to " . streamline_date($end_date);
$hospital_info = HospitalInformation::find(1);
$data = [
'search_text' => $search_text,
'episodes' => $episodes,
'hospital_info' => $hospital_info,
'start_date' => $start_date,
'end_date' => $end_date
];
$pdf = SnappyPDF::loadView('reports::hmis_reports/002/page-1-print', $data)
->setOrientation('landscape')
->setPaper('a3')
->setOption('margin-bottom', 10)
->setOption('footer-left', 'Stre@mline')
->setOption('footer-right', '[page] of [toPage]');
return $pdf->inline('HMIS OPD 002 - Outpatient Register' . date(" d-m-y h:ia") . '.pdf');
}
public function page_2(Request $request) {
$search_text = !empty($request->search_text)? $request->search_text :"";
if(!empty($request->page_1_start_date)){
$end_date = $request->end_date;
$start_date = $request->page_1_start_date;
} else
switch ($request->search_date_by){
case 'yesterday':
$end_date = Carbon::yesterday()->endOfDay()->format('Y-m-d H:i:s');
$start_date = Carbon::yesterday()->startOfDay()->format('Y-m-d H:i:s');
$search_text .= "Yesterday ";
break;
case 'custom_date':
$end_date = Carbon::parse($request->start_date)->endOfDay()->format('Y-m-d H:i:s');
$start_date = Carbon::parse($request->start_date)->startOfDay()->format('Y-m-d H:i:s');
$search_text .= "From: " . streamline_date($start_date) . " ";
break;
case 'custom_date_range':
$end_date = Carbon::parse($request->end_date)->endOfDay()->format('Y-m-d H:i:s');
$start_date = Carbon::parse($request->start_date)->startOfDay()->format('Y-m-d H:i:s');
$search_text .= "From: " . streamline_date($start_date) . " to " . streamline_date($end_date) . " ";
break;
case 'today':
default:
$end_date = Carbon::today()->endOfDay()->format('Y-m-d H:i:s');
$start_date = Carbon::today()->startOfDay()->format('Y-m-d H:i:s');
$search_text .= "Today ";
break;
}
$episodes = PatientEpisode::leftJoin('triage', 'patient_episodes.triage_id', '=', 'triage.id')
->leftJoin('patients', 'patient_episodes.patient_id', '=', 'patients.id')
->leftJoin('consultations as c', 'patient_episodes.id', '=', 'c.episode_id')
->leftJoin('treatments as t', 'patient_episodes.id', '=', 't.episode_id')
->leftJoin('investigation_results as or', 'or.episode_id','patient_episodes.id')
->leftJoin('eye_clinic_main_exam as e', 'patient_episodes.id', '=', 'e.episode_id')
->select('patient_episodes.id as id', 'first_name', 'last_name', 'date_of_birth', 'gender', 'next_of_kin', 'national_id','patients.id as patient_id', 'attendance', 'phone', 'phone_of_next_of_kin', 'new_attendance', 're_attendance','primary_diagnosis','other_diagnoses','rdt',DB::raw('GROUP_CONCAT(drugs) as drugs'),DB::raw('GROUP_CONCAT(frequencies) as frequencies'),DB::raw('GROUP_CONCAT(durations) as durations'),DB::raw('GROUP_CONCAT(doses) as doses'),'tb_status_assessment',
'next_of_kin_relationship', 'right_eye_diagnosis', 'triage.symptoms', 'c.symptoms as symps', 'patient_episodes.clinic_id', 'left_eye_diagnosis', DB::raw('GROUP_CONCAT(or.investigation_id) as investigation_ids'), 'observations', 'new_attendance', 'patient_episodes.created_at', 'patient_episodes.consultation_id','patient_episodes.triage_id', 'number', 'c.referred_to')
->whereBetween('patient_episodes.created_at', [$start_date, $end_date])->orderBy('id', 'asc')->groupBy('id')
->get();
$hospital_info = HospitalInformation::find(1);
$fever_symptom_ids = DB::table('symptoms')->where('name', 'LIKE', "%fever%")->orderBy('name')->pluck('id')->toArray();
$tb_clinic_ids = DB::table('clinics')->where('name', 'LIKE', "%tb%")->orWhere('name', 'LIKE', "%tuber%")->pluck('id')->toArray();
$investigations = Investigation::whereIn('hmis_002_slug', [2,3])->pluck('id')->toArray();
return view('reports::hmis_reports.002.page-2', compact('search_text', 'episodes', 'start_date', 'end_date', 'hospital_info', 'fever_symptom_ids','tb_clinic_ids','investigations'));
}
public function page_2_print(Request $request) {
$data = [
'search_text' => $request->search_text,
'episodes'=> unserialize($request->episodes),
'start_date' => $request->start_date,
'end_date' => $request->end_date,
'hospital_info' => unserialize($request->hospital_info),
'fever_symptom_ids'=> unserialize($request->fever_symptom_ids),
'tb_clinic_ids'=> unserialize($request->tb_clinic_ids),
'investigations'=> unserialize($request->investigations)
];
$pdf = SnappyPDF::loadView('reports::hmis_reports/002/page-2-print', $data)
->setOrientation('landscape')
->setPaper('a3')
->setOption('margin-bottom', 10)
->setOption('footer-left', 'Stre@mline')
->setOption('footer-right', '[page] of [toPage]');
return $pdf->inline('HMIS OPD 002 - Outpatient Register' . date(" d-m-y h:ia") . '.pdf');
}
}
@@ -0,0 +1,762 @@
<?php
namespace Modules\Reports\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Carbon\Carbon;
use DateTime;
use Barryvdh\Snappy\Facades\SnappyPdf;
use Streamline\Models\HospitalInformation;
use Streamline\Models\HmisCategory;
use Streamline\Models\HmisCategoryOptions;
use Streamline\Models\Diagnosis;
use Streamline\Models\Consultation;
use Streamline\Models\Investigation;
use Streamline\Models\Treatment;
use Streamline\Models\OrderedInvestigation;
class HmisController105 extends Controller {
/**
* OPD Attendances, Referrals and Diagnosis Totals HMIS
*/
public function hmis_105(Request $request) {
$hospital_information = HospitalInformation::find(1);
if(isset($request->date_from)) {
$attendance_from = Carbon::createFromFormat('d-m-Y', $request->date_from)->format('Y-m-d');
// Add one day to make the report accurate
$attendance_to = Carbon::createFromFormat('d-m-Y', $request->date_to)->addDays(1)->format('Y-m-d');
$dateRange = $request->date_from . '/' . $request->date_to;
} else {
$attendance_from = Carbon::today()->subDays(6)->format('Y-m-d');
$attendance_to = Carbon::today()->addDays(1)->format('Y-m-d');
$dateRange = Carbon::today()->subDays(6)->format('d-m-Y') . '/' . Carbon::today()->addDays(1)->format('d-m-Y');
}
$patient_ids_male_0_28_days_new_attendance = [];
$patient_ids_male_0_28_days_re_attendance = [];
$patient_ids_female_0_28_days_new_attendance = [];
$patient_ids_female_0_28_days_re_attendance = [];
$patient_ids_male_29days_4yrs_new_attendance = [];
$patient_ids_male_29days_4yrs_re_attendance = [];
$patient_ids_female_29days_4yrs_new_attendance = [];
$patient_ids_female_29days_4yrs_re_attendance = [];
$patient_ids_male_5_9yrs_new_attendance = [];
$patient_ids_male_5_9yrs_re_attendance = [];
$patient_ids_female_5_9yrs_new_attendance = [];
$patient_ids_female_5_9yrs_re_attendance = [];
$patient_ids_male_10_19yrs_new_attendance = [];
$patient_ids_male_10_19yrs_re_attendance = [];
$patient_ids_female_10_19yrs_new_attendance = [];
$patient_ids_female_10_19yrs_re_attendance = [];
$patient_ids_male_20yrs_new_attendance = [];
$patient_ids_male_20yrs_re_attendance = [];
$patient_ids_female_20yrs_new_attendance = [];
$patient_ids_female_20yrs_re_attendance = [];
/*$triageRecords = DB::table('triage')->whereIn('new_attendance', [0, 1])->whereIn('re_attendance', [0, 1])
->whereBetween('created_at', [$attendance_from, $attendance_to])
->select('patient_id', 'new_attendance', 're_attendance')->get();*/
$triageRecords = DB::table('triage')->whereBetween('created_at', [$attendance_from, $attendance_to])
->where(function($q) {
$q->whereIn('new_attendance', [0, 1])
->orWhereIn('re_attendance', [0, 1]);
})->select('patient_id', 'new_attendance', 're_attendance')->get();
foreach ($triageRecords as $triage):
// Get patient and their age
$patient = DB::table('patients')->where('id', $triage->patient_id)->select('id', 'date_of_birth', 'gender', 'created_at')->first();
if ($patient && in_array($patient->gender, [1, 2])): // Check if patient has valid gender
$dateOfBirth = Carbon::parse($patient->date_of_birth);
//$dateCreated = Carbon::parse($patient->created_at);
$currentDateTimeStamp = Carbon::now();
$diffInDays = $dateOfBirth->diffInDays($currentDateTimeStamp);
switch ($diffInDays):
case ($diffInDays >= 0 && $diffInDays <= 29): // 0 - 28 days olds
if ($patient->gender == 1): // Males
if (!empty($triage->new_attendance)):
$patient_ids_male_0_28_days_new_attendance[] = $patient->id;
endif;
if (!empty($triage->re_attendance)):
$patient_ids_male_0_28_days_re_attendance[] = $patient->id;
endif;
elseif ($patient->gender == 2): // Females
if (!empty($triage->new_attendance)):
$patient_ids_female_0_28_days_new_attendance[] = $patient->id;
endif;
if (!empty($triage->re_attendance)):
$patient_ids_female_0_28_days_re_attendance[] = $patient->id;
endif;
endif;
break;
case ($diffInDays >= 28 && $diffInDays <= 1825): // 29 Days - 4 Years
if ($patient->gender == 1): // Males
if (!empty($triage->new_attendance)):
$patient_ids_male_29days_4yrs_new_attendance[] = $patient->id;
endif;
if (!empty($triage->re_attendance)):
$patient_ids_male_29days_4yrs_re_attendance[] = $patient->id;
endif;
elseif ($patient->gender == 2): // Females
if (!empty($triage->new_attendance)):
$patient_ids_female_29days_4yrs_new_attendance[] = $patient->id;
endif;
if (!empty($triage->re_attendance)):
$patient_ids_female_29days_4yrs_re_attendance[] = $patient->id;
endif;
endif;
break;
case ($diffInDays >= 1826 && $diffInDays <= 3650): // 5 - 9 Years
if ($patient->gender == 1): // Males
if (!empty($triage->new_attendance)):
$patient_ids_male_5_9yrs_new_attendance[] = $patient->id;
endif;
if (!empty($triage->re_attendance)):
$patient_ids_male_5_9yrs_re_attendance[] = $patient->id;
endif;
elseif ($patient->gender == 2): // Females
if (!empty($triage->new_attendance)):
$patient_ids_female_5_9yrs_new_attendance[] = $patient->id;
endif;
if (!empty($triage->re_attendance)):
$patient_ids_female_5_9yrs_re_attendance[] = $patient->id;
endif;
endif;
break;
case ($diffInDays >= 3651 && $diffInDays <= 7300): // 10 - 19 Years
if ($patient->gender == 1): // Males
if (!empty($triage->new_attendance)):
$patient_ids_male_10_19yrs_new_attendance[] = $patient->id;
endif;
if (!empty($triage->re_attendance)):
$patient_ids_male_10_19yrs_re_attendance[] = $patient->id;
endif;
elseif ($patient->gender == 2): // Females
if (!empty($triage->new_attendance)):
$patient_ids_female_10_19yrs_new_attendance[] = $patient->id;
endif;
if (!empty($triage->re_attendance)):
$patient_ids_female_10_19yrs_re_attendance[] = $patient->id;
endif;
endif;
break;
case ($diffInDays >= 7301): // 20 Years & Above
if ($patient->gender == 1): // Males
if (!empty($triage->new_attendance)):
$patient_ids_male_20yrs_new_attendance[] = $patient->id;
endif;
if (!empty($triage->re_attendance)):
$patient_ids_male_20yrs_re_attendance[] = $patient->id;
endif;
elseif ($patient->gender == 2): // Females
if (!empty($triage->new_attendance)):
$patient_ids_female_20yrs_new_attendance[] = $patient->id;
endif;
if (!empty($triage->re_attendance)):
$patient_ids_female_20yrs_re_attendance[] = $patient->id;
endif;
endif;
break;
default:
break;
endswitch;
endif;
endforeach;
$printing = false;
return view('reports::hmis_reports.105.index', compact('hospital_information', 'attendance_from', 'attendance_to',
'patient_ids_male_0_28_days_new_attendance', 'patient_ids_male_0_28_days_re_attendance',
'patient_ids_female_0_28_days_new_attendance', 'patient_ids_female_0_28_days_re_attendance',
'patient_ids_male_29days_4yrs_new_attendance', 'patient_ids_male_29days_4yrs_re_attendance',
'patient_ids_female_29days_4yrs_new_attendance', 'patient_ids_female_29days_4yrs_re_attendance',
'patient_ids_male_5_9yrs_new_attendance', 'patient_ids_male_5_9yrs_re_attendance',
'patient_ids_female_5_9yrs_new_attendance', 'patient_ids_female_5_9yrs_re_attendance',
'patient_ids_male_10_19yrs_new_attendance', 'patient_ids_male_10_19yrs_re_attendance',
'patient_ids_female_10_19yrs_new_attendance', 'patient_ids_female_10_19yrs_re_attendance',
'patient_ids_male_20yrs_new_attendance', 'patient_ids_male_20yrs_re_attendance', 'dateRange',
'patient_ids_female_20yrs_new_attendance', 'patient_ids_female_20yrs_re_attendance', 'printing'));
}
public function print_hmis_105(Request $request) {
$hospital_information = HospitalInformation::find(1);
//dd($request->all());
if(request()->segment(4)) {
$attendance_from = request()->segment(4);
// Add one day to make the report accurate
$attendance_to = request()->segment(5);
$dateRange = $request->date_from . '/' . $request->date_to;
} else {
$attendance_from = Carbon::today()->subDays(6)->format('Y-m-d');
$attendance_to = Carbon::today()->addDays(1)->format('Y-m-d');
$dateRange = Carbon::today()->subDays(6)->format('d-m-Y') . '/' . Carbon::today()->addDays(1)->format('d-m-Y');
}
$patient_ids_male_0_28_days_new_attendance = [];
$patient_ids_male_0_28_days_re_attendance = [];
$patient_ids_female_0_28_days_new_attendance = [];
$patient_ids_female_0_28_days_re_attendance = [];
$patient_ids_male_29days_4yrs_new_attendance = [];
$patient_ids_male_29days_4yrs_re_attendance = [];
$patient_ids_female_29days_4yrs_new_attendance = [];
$patient_ids_female_29days_4yrs_re_attendance = [];
$patient_ids_male_5_9yrs_new_attendance = [];
$patient_ids_male_5_9yrs_re_attendance = [];
$patient_ids_female_5_9yrs_new_attendance = [];
$patient_ids_female_5_9yrs_re_attendance = [];
$patient_ids_male_10_19yrs_new_attendance = [];
$patient_ids_male_10_19yrs_re_attendance = [];
$patient_ids_female_10_19yrs_new_attendance = [];
$patient_ids_female_10_19yrs_re_attendance = [];
$patient_ids_male_20yrs_new_attendance = [];
$patient_ids_male_20yrs_re_attendance = [];
$patient_ids_female_20yrs_new_attendance = [];
$patient_ids_female_20yrs_re_attendance = [];
if (!empty($attendance_from) && !empty($attendance_to)) {
$triageRecords = DB::table('triage')->whereIn('new_attendance', [0, 1])->whereIn('re_attendance', [0, 1])
->whereBetween('created_at', [$attendance_from, $attendance_to])
->select('patient_id', 'new_attendance', 're_attendance')->get();
foreach ($triageRecords as $triage):
// Get patient and their age
$patient = DB::table('patients')->where('id', $triage->patient_id)->select('id', 'date_of_birth', 'gender', 'created_at')->first();
if ($patient && in_array($patient->gender, [1, 2])): // Check if patient has valid gender
$dateOfBirth = Carbon::parse($patient->date_of_birth);
$dateCreated = Carbon::parse($patient->created_at);
$diffInDays = $dateOfBirth->diffInDays($dateCreated);
switch ($diffInDays):
case ($diffInDays >= 0 && $diffInDays <= 29): // 0 - 28 days olds
if ($patient->gender == 1): // Males
if ($triage->new_attendance):
$patient_ids_male_0_28_days_new_attendance[] = $patient->id;
endif;
if ($triage->re_attendance):
$patient_ids_male_0_28_days_re_attendance[] = $patient->id;
endif;
elseif ($patient->gender == 2): // Females
if ($triage->new_attendance):
$patient_ids_female_0_28_days_new_attendance[] = $patient->id;
endif;
if ($triage->re_attendance):
$patient_ids_female_0_28_days_re_attendance[] = $patient->id;
endif;
endif;
break;
case ($diffInDays >= 28 && $diffInDays <= 1825): // 29 Days - 4 Years
if ($patient->gender == 1): // Males
if ($triage->new_attendance):
$patient_ids_male_29days_4yrs_new_attendance[] = $patient->id;
endif;
if ($triage->re_attendance):
$patient_ids_male_29days_4yrs_re_attendance[] = $patient->id;
endif;
elseif ($patient->gender == 2): // Females
if ($triage->new_attendance):
$patient_ids_female_29days_4yrs_new_attendance[] = $patient->id;
endif;
if ($triage->re_attendance):
$patient_ids_female_29days_4yrs_re_attendance[] = $patient->id;
endif;
endif;
break;
case ($diffInDays >= 1826 && $diffInDays <= 3650): // 5 - 9 Years
if ($patient->gender == 1): // Males
if ($triage->new_attendance):
$patient_ids_male_5_9yrs_new_attendance[] = $patient->id;
endif;
if ($triage->re_attendance):
$patient_ids_male_5_9yrs_re_attendance[] = $patient->id;
endif;
elseif ($patient->gender == 2): // Females
if ($triage->new_attendance):
$patient_ids_female_5_9yrs_new_attendance[] = $patient->id;
endif;
if ($triage->re_attendance):
$patient_ids_female_5_9yrs_re_attendance[] = $patient->id;
endif;
endif;
break;
case ($diffInDays >= 3651 && $diffInDays <= 7300): // 10 - 19 Years
if ($patient->gender == 1): // Males
if ($triage->new_attendance):
$patient_ids_male_10_19yrs_new_attendance[] = $patient->id;
endif;
if ($triage->re_attendance):
$patient_ids_male_10_19yrs_re_attendance[] = $patient->id;
endif;
elseif ($patient->gender == 2): // Females
if ($triage->new_attendance):
$patient_ids_female_10_19yrs_new_attendance[] = $patient->id;
endif;
if ($triage->re_attendance):
$patient_ids_female_10_19yrs_re_attendance[] = $patient->id;
endif;
endif;
break;
case ($diffInDays >= 7301): // 20 Years & Above
if ($patient->gender == 1): // Males
if ($triage->new_attendance):
$patient_ids_male_20yrs_new_attendance[] = $patient->id;
endif;
if ($triage->re_attendance):
$patient_ids_male_20yrs_re_attendance[] = $patient->id;
endif;
elseif ($patient->gender == 2): // Females
if ($triage->new_attendance):
$patient_ids_female_20yrs_new_attendance[] = $patient->id;
endif;
if ($triage->re_attendance):
$patient_ids_female_20yrs_re_attendance[] = $patient->id;
endif;
endif;
break;
default:
break;
endswitch;
endif;
endforeach;
}
$data = [
'hospital_information' => $hospital_information,
'attendance_from' => $attendance_from,
'attendance_to' => $attendance_to,
'patient_ids_male_0_28_days_new_attendance' => $patient_ids_male_0_28_days_new_attendance,
'patient_ids_male_0_28_days_re_attendance' => $patient_ids_male_0_28_days_re_attendance,
'patient_ids_female_0_28_days_new_attendance' => $patient_ids_female_0_28_days_new_attendance,
'patient_ids_female_0_28_days_re_attendance' => $patient_ids_female_0_28_days_re_attendance,
'patient_ids_male_29days_4yrs_new_attendance' => $patient_ids_male_29days_4yrs_new_attendance,
'patient_ids_male_29days_4yrs_re_attendance' => $patient_ids_male_29days_4yrs_re_attendance,
'patient_ids_female_29days_4yrs_new_attendance' => $patient_ids_female_29days_4yrs_new_attendance,
'patient_ids_female_29days_4yrs_re_attendance' => $patient_ids_female_29days_4yrs_re_attendance,
'patient_ids_male_5_9yrs_new_attendance' => $patient_ids_male_5_9yrs_new_attendance,
'patient_ids_male_5_9yrs_re_attendance' => $patient_ids_male_5_9yrs_re_attendance,
'patient_ids_female_5_9yrs_new_attendance' => $patient_ids_female_5_9yrs_new_attendance,
'patient_ids_female_5_9yrs_re_attendance' => $patient_ids_female_5_9yrs_re_attendance,
'patient_ids_male_10_19yrs_new_attendance' => $patient_ids_male_10_19yrs_new_attendance,
'patient_ids_male_10_19yrs_re_attendance' => $patient_ids_male_10_19yrs_re_attendance,
'patient_ids_female_10_19yrs_new_attendance' => $patient_ids_female_10_19yrs_new_attendance,
'patient_ids_female_10_19yrs_re_attendance' => $patient_ids_female_10_19yrs_re_attendance,
'patient_ids_male_20yrs_new_attendance' => $patient_ids_male_20yrs_new_attendance,
'patient_ids_male_20yrs_re_attendance' => $patient_ids_male_20yrs_re_attendance,
'patient_ids_female_20yrs_new_attendance' => $patient_ids_female_20yrs_new_attendance,
'patient_ids_female_20yrs_re_attendance' => $patient_ids_female_20yrs_re_attendance,
'printing' => false
];
$pdf = SnappyPDF::loadView('reports::hmis_reports/105/print', $data)
->setOrientation('landscape')
->setPaper('a4')
->setOption('margin-bottom', 10)
->setOption('footer-left', 'Stre@mline')
->setOption('footer-right', '[page] of [toPage]');
return $pdf->inline('HMIS 105 Report' . date(" d-m-y h:ia") . '.pdf');
}
public function opd_attendance_drill(Request $request) {
$patientIDs = unserialize($request->patients);
$patients = DB::table('patients')->whereIn('id', $patientIDs)->orderBy('last_name')->paginate(25);
$categories = DB::table('patient_categories')->pluck('name', 'id');
return view('reports::hmis_reports.105.opd-attendance-details', compact('patients', 'categories'));
}
public function opd_referral_drill(Request $request) {
$patientIDs = decrypt($request->patients);
$patients = DB::table('patients')->whereIn('id', $patientIDs)->orderBy('last_name')->paginate(25);
$categories = DB::table('patient_categories')->pluck('name', 'id');
return view('reports::hmis_reports.105.opd-referral-details', compact('patients', 'categories'));
}
public function opd_diagnosis_drill(Request $request) {
$patientIDs = decrypt($request->patients);
$patients = DB::table('patients')->whereIn('id', $patientIDs)->orderBy('last_name')->paginate(25);
$categories = DB::table('patient_categories')->pluck('name', 'id');
return view('reports::hmis_reports.105.opd-diagnosis-details', compact('patients', 'categories'));
}
/* form for displaying risky behaviour report */
public function risky_behaviours(Request $request) {
$hospital_information = HospitalInformation::find(1);
if (isset($request->date_from) && isset($request->date_to)) {
$attendance_from = Carbon::createFromFormat('d/m/Y', $request->date_from)->toDateString();
$attendance_to = Carbon::createFromFormat('d/m/Y', $request->date_to)->toDateString();
$search_button = $request->filterBtn;
} else {
$attendance_from = \Carbon\Carbon::today()->subDays(30)->format('Y-m-d');
$attendance_to = date("Y-m-d");
}
$alcohol_male_5to9 = [];
$alcohol_male_10to19 = [];
$alcohol_male_20plus = [];
$tobacco_male_5to9 = [];
$tobacco_male_10to19 = [];
$tobacco_male_20plus = [];
$alcohol_female_5to9 = [];
$alcohol_female_10to19 = [];
$alcohol_female_20plus = [];
$tobacco_female_5to9 = [];
$tobacco_female_10to19 = [];
$tobacco_female_20plus = [];
// $query_behavior = "SELECT t.patient_id as patient_id, t.id as triage_id, t.observations as observations, t.created_at as create_date,"
// . "d.date_of_birth as dob, d.gender as gender FROM triage t, patients d "
// . "WHERE (t.created_at BETWEEN '{$attendance_from}' AND '{$attendance_to}')"
// . " AND (patient_id = d.id) AND ((t.observations LIKE '%Alcohol use=High%') "
// . "OR (t.observations LIKE '%Alcohol use=Moderate%') "
// . "OR (t.observations LIKE '%Alcohol use=Low%') "
// . "OR (t.observations LIKE '%Tobacco use=High%') "
// . "OR (t.observations LIKE '%Tobacco use=Moderate%') "
// . "OR (t.observations LIKE '%Tobacco use=Low%')) ORDER BY patient_id DESC";
// $triage_results1 = DB::select($query_behavior);
$triage_results = DB::table('triage')
->leftJoin('patients', 'triage.patient_id', '=', 'patients.id')
->select('patient_id', 'date_of_birth as dob','gender','patient_id','observations','triage.id as triage_id','triage.created_at as create_date')
->whereBetween('triage.created_at', [$attendance_from, $attendance_to])
->orWhere([ ['observations', 'LIKE', '%Alcohol use=High%'],
['observations', 'LIKE', '%Alcohol use=Moderate%'],
['observations', 'LIKE', '%Alcohol use=Low%'],
['observations', 'LIKE', '%Tobacco use=High%'],
['observations', 'LIKE', '%Tobacco use=Moderate%'],
['observations', 'LIKE', '%Tobacco use=Low%']
])
->orderBy('patient_id', 'desc')
->get();
if (count($triage_results) > 0) {
foreach ($triage_results as $triage_result) {
$dob = new Carbon($triage_result->dob);
$age = $dob->diffInYears($triage_result->create_date);
$age = intval($age);
$sex = $triage_result->gender;
$observation_explode = explode(",", $triage_result->observations);
if ($age > 5 && $age < 10) {
if ($sex == 1 && (in_array('Alcohol use=High', $observation_explode) || in_array('Alcohol use=Moderate', $observation_explode) || in_array('Alcohol use=Low', $observation_explode))) {
array_push($alcohol_male_5to9, $triage_result->patient_id);
}
if ($sex == 1 && (in_array('Tobacco use=High', $observation_explode) || in_array('Tobacco use=Moderate', $observation_explode) || in_array('Tobacco use=Low', $observation_explode))) {
array_push($tobacco_male_5to9, $triage_result->patient_id);
}
if ($sex == 2 && (in_array('Alcohol use=High', $observation_explode) || in_array('Alcohol use=Moderate', $observation_explode) || in_array('Alcohol use=Low', $observation_explode))) {
array_push($alcohol_female_5to9, $triage_result->patient_id);
}
if ($sex == 2 && (in_array('Tobacco use=High', $observation_explode) || in_array('Tobacco use=Moderate', $observation_explode) || in_array('Tobacco use=Low', $observation_explode))) {
array_push($tobacco_female_5to9, $triage_result->patient_id);
}
} elseif ($age > 10 && $age < 20) {
if ($sex == 1 && (in_array('Alcohol use=High', $observation_explode) || in_array('Alcohol use=Moderate', $observation_explode) || in_array('Alcohol use=Low', $observation_explode))) {
array_push($alcohol_male_10to19, $triage_result->patient_id);
}
if ($sex == 1 && (in_array('Tobacco use=High', $observation_explode) || in_array('Tobacco use=Moderate', $observation_explode) || in_array('Tobacco use=Low', $observation_explode))) {
array_push($tobacco_male_10to19, $triage_result->patient_id);
}
if ($sex == 2 && (in_array('Alcohol use=High', $observation_explode) || in_array('Alcohol use=Moderate', $observation_explode) || in_array('Alcohol use=Low', $observation_explode))) {
array_push($alcohol_female_10to19, $triage_result->patient_id);
}
if ($sex == 2 && (in_array('Tobacco use=High', $observation_explode) || in_array('Tobacco use=Moderate', $observation_explode) || in_array('Tobacco use=Low', $observation_explode))) {
array_push($tobacco_female_10to19, $triage_result->patient_id);
}
} elseif ($age > 20) {
if ($sex == 1 && (in_array('Alcohol use=High', $observation_explode) || in_array('Alcohol use=Moderate', $observation_explode) || in_array('Alcohol use=Low', $observation_explode))) {
array_push($alcohol_male_20plus, $triage_result->patient_id);
}
if ($sex == 1 && (in_array('Tobacco use=High', $observation_explode) || in_array('Tobacco use=Moderate', $observation_explode) || in_array('Tobacco use=Low', $observation_explode))) {
array_push($tobacco_male_20plus, $triage_result->patient_id);
}
if ($sex == 2 && (in_array('Alcohol use=High', $observation_explode) || in_array('Alcohol use=Moderate', $observation_explode) || in_array('Alcohol use=Low', $observation_explode))) {
array_push($alcohol_female_20plus, $triage_result->patient_id);
}
if ($sex == 2 && (in_array('Tobacco use=High', $observation_explode) || in_array('Tobacco use=Moderate', $observation_explode) || in_array('Tobacco use=Low', $observation_explode))) {
array_push($tobacco_female_20plus, $triage_result->patient_id);
}
}
}
}
return view('reports::hmis_reports.105.risky-behaviours', compact('hospital_information', 'attendance_from', 'attendance_to',
'triage_results', 'alcohol_male_10to19', 'alcohol_male_5to9', 'alcohol_male_20plus',
'tobacco_male_10to19', 'tobacco_male_5to9', 'tobacco_male_20plus', 'alcohol_female_10to19',
'alcohol_female_5to9', 'alcohol_female_20plus', 'tobacco_female_10to19',
'tobacco_female_5to9', 'tobacco_female_20plus'));
}
public function risky_behaviour_drill(Request $request) {
$behaviour = $request->behaviour;
$gender = $request->sex;
$age = $request->age;
$patient_id_array = unserialize($request->patient_ids);
$patients_results = DB::table('patients')->whereIn('id', $patient_id_array)->get();
return view('reports::hmis_reports.105.risky-behaviours-drill', compact('behaviour', 'gender', 'age', 'patients_results'));
}
public function monthly_outpatient_diagnoses(Request $request) {
request()->validate([
'date_from' => 'nullable|date|required_with:date_to',
'date_to' => 'bail|nullable|required_with:date_from|date|after:date_from',
]);
$start = !empty($request->date_from)? date('Y-m-d', strtotime($request->date_from)) : Carbon::now()->subMonth()->startOfMonth()->format('Y-m-d');
$end = !empty($request->date_to)? date('Y-m-d', strtotime($request->date_to)) : date("Y-m-t", strtotime($start));
$page = 'Outpatient Diagnoses';$printing = false;
$citizenship = isset($request->type)? $request->type :1;
$dates = $primary_diagnosis = $other_diagnoses = $table_options = $dependent_options = $diagnoses_data = [];
if(empty($request->date_from)){
$dates['last_month'] = date('F', strtotime($start));
$dates['last_year'] = date('Y', strtotime($start));
$dates['days'] = date('t', strtotime($start));
$dates['citizenship'] = $citizenship;
$dateRange = $start . '/' . $end;
$attendance_from = $start;
$attendance_to = $end;
}else {
$dates['start'] = date('d-M-Y', strtotime($start));
$dates['end'] = date('d-M-Y', strtotime($end));
$dates['days'] = intval((new DateTime($start))->diff(new DateTime($end))->format("%a"));
$dates['citizenship'] = $citizenship;
$attendance_from = $start;
$attendance_to = $end;
$dateRange = $attendance_from . '/' . $attendance_to;
}
$parent_categories = array_unique(HmisCategoryOptions::where('parent_option', '<>','')->pluck('parent_option')->toArray());
$episodes = Consultation::leftJoin('patients as p', 'consultations.patient_id','p.id')
->leftJoin('triage as tr', 'consultations.episode_id','tr.episode_id')
->select('consultations.id','consultations.patient_id', 'consultations.episode_id', 'gender', 'date_of_birth as dob', 'primary_diagnosis', 'other_diagnoses', 'rdt')
->whereBetween('consultations.created_at', [Carbon::parse($start)->startOfDay()->toDateTimeString(), Carbon::parse($end)->endOfDay()->toDateTimeString()])->where('citizenship', $citizenship)->get();
$primary_diagnosis = $ordered_investigations = $prescribed_treatments = $ordered_investigation_results = $others =$other_diagnoses = $patientIds = [];
foreach ($episodes as $episode) {
$primary_diagnosis[] = $episode->primary_diagnosis;
$others = (!empty($episode->other_diagnoses))? unserialize($episode->other_diagnoses):[];
if(!empty($others)) foreach($others as $other) if(!empty($other)) $other_diagnoses[] = $other;
$patients[] = ['id'=> $episode->id,'patient_id'=> $episode->patient_id, 'episode_id'=>$episode->episode_id, 'gender'=> $episode->gender, 'age'=> $episode->dob, 'primary_diagnosis'=> $episode->primary_diagnosis, 'other_diagnoses'=> $others, 'rdt' => $episode->rdt ];
}
$malaria_diagnoses = Diagnosis::where('outpatient_hmis_category',10096)->whereIn('outpatient_dependent_option', [400, 401, 399, 402])->get(['id','name', 'outpatient_hmis_category_option','outpatient_hmis_category','outpatient_dependent_option'])->first();
$all_diagnoses = array_unique(array_merge($primary_diagnosis,$other_diagnoses));
$diag = Diagnosis::whereNotNull(['outpatient_hmis_category','outpatient_hmis_category_option'])->whereIn('id', $all_diagnoses)->get(['id','name', 'outpatient_hmis_category_option','outpatient_hmis_category','outpatient_dependent_option']);
foreach($diag as $dia) {
$diagnosis = $dia->id;$other = $primary = $other = [];
if(!empty($patients)) {
$primary = array_filter($patients, function ($item) use ($diagnosis) {
return $item['primary_diagnosis'] == $diagnosis;
});
foreach ($patients as $patient) if(in_array($diagnosis, $patient['other_diagnoses'] )) $other[] =$patient;
}
$diagnoses_data[]=['id'=>$diagnosis,'name'=>$dia->name, 'hmis_category'=>$dia->outpatient_hmis_category, 'hmis_category_option'=>$dia->outpatient_hmis_category_option, 'dependent_option'=>$dia->outpatient_dependent_option, 'primary'=>$primary, 'other'=>$other];
}
$diagnosis_categories = HmisCategory::where('section_number', '1')->select('id','number', 'title')->get()->toArray();
foreach($diagnosis_categories as $diagnosis_category) {
$options=[];
$category_options = HmisCategoryOptions::where('hmis_category_id', $diagnosis_category['id'])->select('id','number', 'name')->get()->toArray();
foreach($category_options as $category_option) {
$dependent_options = [];
if(in_array($category_option['id'], $parent_categories)) $dependent_options = HmisCategoryOptions::where('parent_option', $category_option['id'])->select('id','number', 'name')->get()->toArray();
$options[]=['id'=>$category_option['id'], 'name'=>$category_option['name'], 'number'=>$category_option['number'], 'dependent_options'=>$dependent_options];
}
$table_options[] = ['category_id'=>$diagnosis_category['id'],'category_name'=>$diagnosis_category['title'],'category_number'=>$diagnosis_category['number'],'category_options'=>$options, 'dependent_options'=>$dependent_options];
}
$hospital_information = HospitalInformation::find(1);
$malaria_investigations =Investigation::whereIn('hmis_002_slug', [2,3])->pluck('id')->toArray();
$malaria_ids = '';
foreach($malaria_investigations as $key => $malaria_investigation) {
if(count($malaria_investigations) == 1) $malaria_ids .= 'FIND_IN_SET('.$malaria_investigation.',r.investigation_id)';
else {
if($key == 0) $malaria_ids .= '(FIND_IN_SET('.$malaria_investigation.',r.investigation_id)';
else $malaria_ids .= ' OR FIND_IN_SET('.$malaria_investigation.',r.investigation_id)';
if($key == array_key_last($malaria_investigations)) $malaria_ids .=')';
}
}
if(!empty($malaria_ids)){
$results = OrderedInvestigation::leftJoin('patients as p', 'patient_id','p.id')->leftJoin('investigation_results as r', 'order_id','ordered_investigations.id')
->leftJoin('consultations as c', 'c.episode_id','ordered_investigations.episode_id')->where([['ordered_investigations.inpatient',0], ['citizenship', $citizenship]])
->whereRaw($malaria_ids)
->whereBetween('ordered_investigations.created_at', [Carbon::parse($start)->startOfDay()->toDateTimeString(), Carbon::parse($end)->endOfDay()->toDateTimeString()])
->get(['ordered_investigations.id','p.id as patient_id', 'r.investigation_id','r.episode_id','gender','date_of_birth as age','value', 'r.id as result_id', 'primary_diagnosis', 'other_diagnoses', 'per_investigation']);
foreach($results as $result) {
$other_diagnoses = unserialize($result->other_diagnoses);
$ordered_investigations[] = ['id'=> $result->id,'patient_id'=> $result->patient_id, 'episode_id'=>$result->episode_id, 'gender'=> $result->gender, 'age'=> $result->age, "primary_diagnosis" =>$result->primary_diagnosis?? 'N/A', "other_diagnoses" => (!empty($other_diagnoses))? $other_diagnoses:[]];
$ids = explode(',', $result->investigation_id);
$values = explode(',', $result->value);
$authenticated = explode(',', $result->per_investigation);
foreach($malaria_investigations as $malaria_investigation){
$id = array_search($malaria_investigation, $ids);
if($id !== false) {
$inv_result = strtolower($values[$id]);
$result_authenticated = $authenticated[$id];
if((str_contains($inv_result, 'pos') || $inv_result =='+'|| $inv_result =='++'|| $inv_result =='+++') && !in_array($result->patient_id, $patientIds) && !empty($result_authenticated)) {
$ordered_investigation_results[] = ['id'=> $result->result_id,'patient_id'=> $result->patient_id, 'result'=>$inv_result ,'episode_id'=>$result->episode_id, 'gender'=> $result->gender, 'age'=> $result->age, "primary_diagnosis" => $result->primary_diagnosis?? 'N/A', "other_diagnoses" => (!empty($other_diagnoses))? $other_diagnoses:[]];
$patientIds[] = $result->patient_id;
}
}
}
}
}
$anti_malarials = DB::table('drugs')->leftJoin('drug_categories as d', 'category_id','d.id')->where('d.anti_malarial', 1)->pluck('drugs.id')->toArray();
$patientIds = [];
$anti_malarial_ids = '';
foreach($anti_malarials as $key => $anti_malarial) {
if(count($anti_malarials) == 1) $anti_malarial_ids .= 'FIND_IN_SET('.$anti_malarial.',drugs)';
else {
if($key == 0) $anti_malarial_ids .= '(FIND_IN_SET('.$anti_malarial.',drugs)';
else $anti_malarial_ids .= ' OR FIND_IN_SET('.$anti_malarial.',drugs)';
if($key == array_key_last($anti_malarials)) $anti_malarial_ids .=')';
}
}
if(!empty($anti_malarial_ids)){
$treatments = Treatment::leftJoin('patients as p', 'patient_id','p.id') ->leftJoin('consultations as c', 'c.episode_id','treatments.episode_id')
->where([['citizenship', $citizenship]])->whereBetween('treatments.created_at', [Carbon::parse($start)->startOfDay()->toDateTimeString(), Carbon::parse($end)->endOfDay()->toDateTimeString()])
->whereRaw($anti_malarial_ids)
->groupBy('patient_id')
->get(['treatments.id','p.id as patient_id', DB::raw('GROUP_CONCAT(drugs) as drugs'),'c.episode_id','gender','date_of_birth as age', 'primary_diagnosis', 'other_diagnoses']);
foreach ($treatments as $treatment) {
$other_diagnoses = unserialize($treatment->other_diagnoses);
if(!in_array($treatment->patient_id, $patientIds)) {
$prescribed_treatments[] = ['id'=> $treatment->id,'patient_id'=> $treatment->patient_id, 'episode_id'=>$treatment->episode_id, 'gender'=> $treatment->gender, 'age'=> $treatment->age, "primary_diagnosis" => $treatment->primary_diagnosis, "other_diagnoses" => !empty($other_diagnoses)? $other_diagnoses:[], 'drugs'=> $treatment->drugs];
$patientIds[] = $treatment->patient_id;
}
}
}
return view('reports::hmis_reports.105.index', compact('hospital_information','dates','diagnoses_data','table_options','page', 'dateRange', 'attendance_from', 'attendance_to', 'printing', 'ordered_investigation_results', 'ordered_investigations', 'prescribed_treatments', 'malaria_diagnoses'));
}
public function print_hmis_105_information(Request $request){
$diagnoses_data =!empty($request->diagnoses_data)? unserialize($request->diagnoses_data):[];
$table_options = !empty($request->table_options)? unserialize($request->table_options):[];
$ordered_investigation_results = !empty($request->ordered_investigation_results)? unserialize($request->ordered_investigation_results):[];
$ordered_investigations = !empty($request->ordered_investigations)? unserialize($request->ordered_investigations):[];
$prescribed_treatments = !empty($request->prescribed_treatments)? unserialize($request->prescribed_treatments):[];
$dates = !empty($request->dates)? unserialize($request->dates):[];
$page = $request->page;
$pdf = SnappyPDF::loadView('reports::hmis_reports.105.print_hmis_105_information', compact('dates','page','table_options','diagnoses_data','ordered_investigations', 'ordered_investigation_results', 'prescribed_treatments'))
->setOrientation('portrait')
->setOption('margin-bottom', 7)
->setOption('margin-top', 5)
->setOption('footer-html', '<i>'. config('app.name') .' - Printed On ' . date('Y-m-d') . ' By ' . auth()->user()->first_name . " " . auth()->user()->last_name . '</i>');
return $pdf->inline(__('hmis_reports.hmis_108_report_census') . date(" d-m-y h:ia") . '.pdf');
}
public function hmis_data(){
try{
DB::transaction(function() {
$options = HmisCategoryOptions::leftJoin('hmis_categories AS a','a.id', 'hmis_category_options.hmis_category_id')
->select('a.id as outpatient_hmis_category','hmis_category_options.id','parent_option', 'hmis_category_options.number as number')
->where([['a.type', 0], ['a.section_number',1]])->orWhereNotNull('parent_option')
->get();
foreach ($options as $option) {
if(!empty($option->parent_option)) {
$outpatient_hmis_category = HmisCategoryOptions::find($option->parent_option);
Diagnosis::where('hmis_no_outpatient',$option->number)->update(['outpatient_hmis_category'=>$outpatient_hmis_category->hmis_category_id, 'outpatient_hmis_category_option'=>$option->parent_option, 'outpatient_dependent_option'=>$option->id]);
}
else Diagnosis::where('hmis_no_outpatient',$option->number)->update(['outpatient_hmis_category'=>$option->outpatient_hmis_category, 'outpatient_hmis_category_option'=>$option->id]);
}
});
}catch(\Exception $e){
flash('HMIS Outpatient Data has NOT been reconciled. Contact system admin. '.$e->getMessage())->error();
return redirect()->back()->withInput();
}
flash("HMIS Outpatient Data has been reconciled.")->success();
return redirect("/list/hmis-reports");
}
}
@@ -0,0 +1,209 @@
<?php
namespace Modules\Reports\Http\Controllers;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Streamline\Models\Consultation;
use Streamline\Models\Diagnosis;
use Streamline\Models\Drug;
use Streamline\Models\PatientAppointment;
use Streamline\Models\Treatment;
class MentalHealthReportsController extends Controller {
public function diagnosed_patients(Request $request){
if (isset($request->start_date)){
$start_date = Carbon::parse($request->start_date)->startOfDay()->toDateTimeString();
$end_date = Carbon::parse($request->end_date)->endOfDay()->toDateTimeString();
} else {
$start_date = Carbon::now()->startOfDay()->toDateTimeString();
$end_date = Carbon::now()->endOfDay()->toDateTimeString();
}
// get all diagnoses with hmis category mental health
$diagnoses = Diagnosis::where('hmis_category', 8)->get()->toArray();
$reports = [];
foreach ($diagnoses as $diagnosis){
$patient_ids =[];
$consultation = Consultation::where('primary_diagnosis', $diagnosis['id'])->whereBetween('created_at', [$start_date, $end_date])->get();
if(!empty($consultation)) foreach ($consultation as $key => $value) $patient_ids[] = $value->patient_id;
$reports[] = ['name'=>$diagnosis['name'], 'count'=>count($consultation), 'patient_ids'=>$patient_ids];
}
return view('reports::mental_health_reports.diagnosed_patients', compact('start_date', 'end_date', 'reports'));
}
public function persons_taking_psychotropic_drugs(Request $request){
// get array of accepted drugs
$drugs = Drug::whereIn('category_id', [13,27,32,37,46,53])->pluck('id', 'id')->toArray();
$drugs = array_fill_keys(array_keys($drugs), 0);
$drug_patient_id = [];
if (isset($request->start_date)){
$start_date = Carbon::parse($request->start_date)->startOfDay()->toDateTimeString();
$end_date = Carbon::parse($request->end_date)->endOfDay()->toDateTimeString();
} else {
$start_date = Carbon::now()->startOfDay()->toDateTimeString();
$end_date = Carbon::now()->endOfDay()->toDateTimeString();
}
// get all diagnoses with hmis category mental health
$diagnoses = Diagnosis::where('hmis_category', 8)->get()->toArray();
foreach ($diagnoses as $diagnosis){
$consultations = Consultation::where('primary_diagnosis', $diagnosis['id'])->whereBetween('created_at', [$start_date, $end_date])->get();
foreach ($consultations as $consultation){
$patient_id = $consultation->patient_id;
$episode_id = $consultation->episode_id;
// select treatments
$treatments = Treatment::where('patient_id', $patient_id)->where('episode_id', $episode_id)->get();
foreach ($treatments as $treatment){
$ordered_drugs_array = explode(",", $treatment->drugs);
// i'm tired of foreach's
foreach ($ordered_drugs_array as $record){
if (key_exists($record, $drugs)){
$drugs[$record]++;
$drug_patient_id[$record]['patient_ids'][]= $patient_id;
}
}
}
}
}
return view('reports::mental_health_reports.persons_taking_psychotropic_drugs', compact('drugs', 'start_date','drug_patient_id', 'end_date'));
}
public function diagnosed_persons_who_received_treatment(Request $request){
if (isset($request->start_date)){
$start_date = Carbon::parse($request->start_date)->startOfDay()->toDateTimeString();
$end_date = Carbon::parse($request->end_date)->endOfDay()->toDateTimeString();
} else {
$start_date = Carbon::now()->startOfDay()->toDateTimeString();
$end_date = Carbon::now()->endOfDay()->toDateTimeString();
}
// get all diagnoses with hmis category mental health
$diagnoses = Diagnosis::where('hmis_category', 8)->get()->toArray();
$reports = [];
$reports_counter = 0;
foreach ($diagnoses as $diagnosis){
$consultations = Consultation::where('primary_diagnosis', $diagnosis['id'])->whereBetween('created_at', [$start_date, $end_date])->get();
$reports[$reports_counter]['name'] = $diagnosis['name'];
$reports[$reports_counter]['number_of_patients'] = count($consultations);
$patient_ids = $treated_patient_ids =[];
$patients_who_received_treatment = 0;
foreach ($consultations as $consultation){
// select treatments
$treatments = Treatment::where('patient_id', $consultation->patient_id)->where('episode_id', $consultation->episode_id)->get();
if (count($treatments) > 0){
// patient received treatment
$patients_who_received_treatment++;
foreach($treatments as $treatment) $treated_patient_ids[] = $treatment->patient_id;
}
$patient_ids[]= $consultation->patient_id;
}
$reports[$reports_counter]['number_of_patients_with_treatment'] = $patients_who_received_treatment;
$reports[$reports_counter]['patient_ids'] = $patient_ids;
$reports[$reports_counter]['treated_patient_ids'] = $treated_patient_ids;
$reports_counter++;
}
return view('reports::mental_health_reports.diagnosed_persons_who_received_treatment', compact('reports', 'start_date', 'end_date'));
}
public function patients_lost_to_follow_up(Request $request) {
if (isset($request->start_date)){
$start_date = Carbon::createFromFormat('d/m/Y', $request->start_date)->toDateString();
$end_date = Carbon::createFromFormat('d/m/Y', $request->end_date)->toDateString();
} else {
$start_date = Carbon::now()->startOfDay()->toDateTimeString();
$end_date = Carbon::now()->endOfDay()->toDateTimeString();
}
// get all diagnoses with hmis category mental health
$diagnoses = Diagnosis::where('hmis_category', 8)->pluck('id')->toArray();
$follow_ups = $number_of_patients_lost_ids = $total_follow_ups_ids = [];
$number_of_patients_lost = 0;
$total_follow_ups = 0;
$lost_follow_ups = PatientAppointment::whereBetween('appointment_date', [$start_date, $end_date])->get();
foreach ($lost_follow_ups as $record) {
$consultation = Consultation::where('episode_id', $record->episode_id)->first();
if ($consultation && in_array($consultation->primary_diagnosis, $diagnoses)){
if ($record->appointment_fulfilled == 0){
$follow_ups[$number_of_patients_lost]['patient_id']= $number_of_patients_lost_ids[] = $record->patient_id;
$follow_ups[$number_of_patients_lost]['created_at'] = $record->created_at;
$follow_ups[$number_of_patients_lost]['appointment_date'] = $record->appointment_date;
$number_of_patients_lost++;
}
$total_follow_ups++;
$total_follow_ups_ids[]= $record->patient_id;
}
}
$number_of_patients_followed_up = $total_follow_ups - $number_of_patients_lost;
$number_of_patients_followed_up_ids = array_diff($total_follow_ups_ids, $number_of_patients_lost_ids);
$drop_out_rate = $total_follow_ups > 0 ? ($number_of_patients_lost / $total_follow_ups) * 100 : 0;
return view('reports::mental_health_reports.patients_lost_to_follow_up', compact('follow_ups', 'start_date', 'end_date', 'total_follow_ups', 'number_of_patients_followed_up', 'number_of_patients_lost', 'drop_out_rate','number_of_patients_followed_up_ids','number_of_patients_lost_ids', 'total_follow_ups_ids'));
}
public function days_drugs_out_of_stock(Request $request) {
$drugs = DB::table('drugs')->where('available', 1)->whereNull('deleted_at')
->whereIn('category_id', [13,27,32,37,46,53])
->pluck('id')->toArray();
if (isset($request->start_date)) {
$start_date = Carbon::createFromFormat('d/m/Y', $request->start_date);
$end_date = Carbon::createFromFormat('d/m/Y', $request->end_date);
} else {
$start_date = Carbon::now();
$end_date = Carbon::now();
}
$selected_drugs = [];
$stock_watcher_records = DB::table('stock_watcher')
->where('item_type', 1)
->whereIn('item_id', $drugs)
->get();
foreach ($stock_watcher_records as $record) {
$start_date_search = clone $start_date; // or you can use $start_date->copy()
$end_date_search = clone $end_date;
$details_arr = json_decode($record->details, true);
// keep incrementing the start date till it reaches the next day after the end date and stop
while (!$start_date_search->isAfter($end_date_search)) {
if (isset($details_arr[$start_date_search->toDateString()]) && $details_arr[$start_date_search->toDateString()]["pharmacy_stock"] < 1 && $details_arr[$start_date_search->toDateString()]["store_stock"] < 1) {
$selected_drugs[$record->item_id] = 1 + ($selected_drugs[$record->item_id] ?? 0);
}
$start_date_search->addDay();
}
}
return view('reports::mental_health_reports.days_drugs_out_of_stock', compact('selected_drugs', 'start_date', 'end_date'));
}
}
@@ -0,0 +1,78 @@
<?php
namespace Modules\Reports\Http\Controllers;
use Illuminate\Http\Request;
use Streamline\Models\MaternityDeliveryRecord;
use Carbon\Carbon;
use Streamline\Models\HospitalInformation;
use Streamline\Models\District;
use Streamline\Models\Parish;
use Streamline\Models\Subcounty;
use Streamline\Models\Patient;
use Streamline\Models\Occupation;
use Streamline\Models\County;
use Streamline\Models\Village;
class NiraReportController extends Controller {
public function __construct() {
$this->middleware('auth');
$this->middleware('permission:nira-birth-report', ['only' => ['birth_report']]);
}
public function birth_report() {
$episode_id = session()->get('episode_id');
// Getting details from the maternity delivery records table
$deliveryRecord = MaternityDeliveryRecord::select('patient_id', 'foetal_number', 'date_of_birth', 'delivery_time', 'gender', 'weight')
->where('episode_id', $episode_id)->first();
$hospitalInfo = HospitalInformation::select('name', 'district', 'parish', 'sub_county', 'country', 'sub_district')->where('id', 1)->first();
$hospitalDistrict = District::find($hospitalInfo->district)->name;
$hospitalSubcounty = Subcounty::find($hospitalInfo->sub_county)->name;
$hospitalParish = Parish::find($hospitalInfo->parish)->name;
$hospitalLocation = $hospitalParish . ',' . $hospitalSubcounty;
$hospitalDistrict = $hospitalDistrict . ',' . $hospitalInfo->country;
$date_of_birth = is_null($deliveryRecord) ? [] : explode(',', $deliveryRecord->date_of_birth);
$delivery_time = is_null($deliveryRecord) ? [] : explode(',', $deliveryRecord->delivery_time);
$babyOne = [
'dob' => is_null($deliveryRecord) ? 'NA' : $date_of_birth[0],
'delivery_time' => is_null($deliveryRecord) ? 'NA' : Carbon::parse($delivery_time[0])->format('g:i A'),
'hospitalLocation' => is_null($deliveryRecord) ? 'NA' : $hospitalLocation,
'hospitalDistrict' => is_null($deliveryRecord) ? 'NA' : $hospitalDistrict,
'hospitalName' => is_null($deliveryRecord) ? 'NA' : $hospitalInfo->name,
'gender' => is_null($deliveryRecord) ? 'NA' : $deliveryRecord->gender[0],
'weight' => is_null($deliveryRecord) ? 'NA' : $deliveryRecord->weight[0],
];
$motherDetail = is_null($deliveryRecord) ? '' :
Patient::select('first_name', 'last_name', 'occupation_id', 'national_id', 'district_id', 'county_id', 'subcounty_id', 'parish_id', 'village_id')
->where('id', $deliveryRecord->patient_id)->first();
$mother = [
'last_name' => is_null($deliveryRecord) ? 'NA' : $motherDetail->last_name,
'first_name' => is_null($deliveryRecord) ? 'NA' : $motherDetail->first_name,
'NIN' => is_null($deliveryRecord) ? 'NA' : $motherDetail->national_id,
'occupation' => is_null($deliveryRecord) ? 'NA' : Occupation::find($motherDetail->occupation_id)->name,
'district' => is_null($deliveryRecord) ? 'NA' : District::find($motherDetail->district_id)->name,
'county' => is_null($deliveryRecord) ? 'NA' : County::find($motherDetail->county_id)->name,
'subcounty' => is_null($deliveryRecord) ? 'NA' : Subcounty::find($motherDetail->subcounty_id)->name,
'parish' => is_null($deliveryRecord) ? 'NA' : Parish::find($motherDetail->parish_id)->name,
'village' => is_null($deliveryRecord) ? 'NA' : Village::find($motherDetail->village_id)->name
];
if (is_null($deliveryRecord)):
flash("The MATERNITY DELIVERY RECORD has not been saved on Stre@mline.")->error();
endif;
return view('reports::reports.nira.birth', compact('babyOne', 'mother'));
}
public function death_report() {
$episode_id = session()->get('episode_id');
return view('reports::reports.nira.death');
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,113 @@
<?php
namespace Modules\Reports\Providers;
use Illuminate\Support\ServiceProvider;
use Modules\Reports\Providers\RouteServiceProvider;
class ReportsServiceProvider extends ServiceProvider{
/**
* @var string $moduleName
*/
protected $moduleName = 'Reports';
/**
* @var string $moduleNameLower
*/
protected $moduleNameLower = 'reports';
/**
* Boot the application events.
*
* @return void
*/
public function boot()
{
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
$this->loadMigrationsFrom(module_path($this->moduleName, 'Database/Migrations'));
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->app->register(RouteServiceProvider::class);
}
/**
* Register config.
*
* @return void
*/
protected function registerConfig()
{
$this->publishes([
module_path($this->moduleName, 'Config/config.php') => config_path($this->moduleNameLower . '.php'),
], 'config');
$this->mergeConfigFrom(
module_path($this->moduleName, 'Config/config.php'), $this->moduleNameLower
);
}
/**
* Register views.
*
* @return void
*/
public function registerViews()
{
$viewPath = resource_path('views/modules/' . $this->moduleNameLower);
$sourcePath = module_path($this->moduleName, 'Resources/views');
$this->publishes([
$sourcePath => $viewPath
], ['views', $this->moduleNameLower . '-module-views']);
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
}
/**
* Register translations.
*
* @return void
*/
public function registerTranslations()
{
$langPath = resource_path('lang/modules/' . $this->moduleNameLower);
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
$this->loadJsonTranslationsFrom($langPath);
} else {
$this->loadTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower);
$this->loadJsonTranslationsFrom(module_path($this->moduleName, 'Resources/lang'));
}
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return [];
}
private function getPublishableViewPaths(): array
{
$paths = [];
foreach (\Config::get('view.paths') as $path) {
if (is_dir($path . '/modules/' . $this->moduleNameLower)) {
$paths[] = $path . '/modules/' . $this->moduleNameLower;
}
}
return $paths;
}
}
@@ -0,0 +1,68 @@
<?php
namespace Modules\Reports\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to your controller routes.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
*/
protected $namespace = 'Modules\Reports\Http\Controllers';
/**
* Define your route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
{
parent::boot();
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
{
$this->mapApiRoutes();
$this->mapWebRoutes();
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(module_path('Reports', '/Routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(module_path('Reports', '/Routes/api.php'));
}
}
@@ -0,0 +1,242 @@
@extends('layouts.main')
@push('styles')
<link href = "{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel = "stylesheet">
<link href = "{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel = "stylesheet" type = "text/css" />
<link href = "{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel = "stylesheet" type = "text/css" />
<link href = "{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel = "stylesheet" type = "text/css" />
@endpush
@section('content')
<div class = "row bg-title">
<div class = "col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class = "page-title">Out patient register report 1</h4>
</div>
<div class = "col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class = "breadcrumb">
<li><a href = "{{ route('home') }}">Dashboard</a></li>
<li><a href = "{{ url('list_memorised_reports') }}">Memorised stre@mline reports</a></li>
<li class = "active">Outpatient register report 1</li>
</ol>
</div>
</div>
<div class = "row">
<div class = "col-sm-12">
<div style = "float: right;">
<button class = "btn btn-primary" id = "printEssentialMedicinesReport">Print</button>
<br>
</div>
&nbsp; &nbsp;
<div style = "float: right; margin-right: 20px;">
<button class = "btn btn-info" onclick = "window.location.href='out_patient_register_report_2'">Page 2
</button>
<br>
</div>
</div>
</div><br>
<div class = "white-box">
@include('flash::message')
<h3 class = "heading" style = "text-align: center; text-decoration: underline;">OUT PATIENT REGISTER(HMIS 031)
PAGE 1</h3>
<div class = "row">
<div class = "col-sm-3">
<table class = "table">
{{ Form::open(['url' => 'out_patient_register_report','data-toggle'=>'validator']) }}
<tr>
<span class = "badge badge-info">search to view results</span>
<td>Select a date:</td>
</tr>
<tr>
<td>
{{ Form::text('filter_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-from']) }}
</td>
</tr>
<tr>
<td>
{{ Form::submit('Search',['class' => 'btn btn-success btn-sm','name' => 'date_filter']) }}
</td>
</tr>
{{ Form::close() }}
</table>
</div>
<div class = "col-sm-3">
<table class = "table">
<tr>
<th>HEALTH UNIT:</th>
<td>{{ $hospital_information->name }}</td>
</tr>
<tr>
<th>Date :</th>
<td>{{ streamline_date($filtering_date) }}</td>
</tr>
<tr>
<th><small><strong>No of patients:</th>
<td>{{ count($episodes_results) }}</strong></small></td>
</tr>
</table>
</div>
<div class = "col-sm-3">
</div>
<div class = "col-sm-3">
</div>
</div>
<hr>
<div id = "printableContent">
<div class = "row">
<div class = "table-responsive">
<table class = "table table-striped table-bordered color-table success-table">
<thead>
<tr>
<th rowspan = "3">Serial</th>
<th rowspan = "3">Name Of Patient</th>
<th rowspan = "2">Residence</th>
<th colspan = "4" rowspan = "3">Age
<span class = "text-small-italic" style = "display: none;"> (0-28 days, 28days-4yrs, 5-59yrs, 60 above)</span>
</th>
<th rowspan = "3">Sex</th>
<th>MUAC</th>
<th>BMI</th>
<th rowspan = "2">Blood Pressure</th>
<th rowspan = "3">Next Of Kin</th>
<th rowspan = "3">Classification<span class = "text-small-italic" style = "display: none;"> (New Attendance, Re-attendance)</span>
</th>
</tr>
<tr>
<th>Weight</th>
<th>Weight For Age Z Score</th>
</tr>
<tr>
<th><span class = "text-small-italic">Village, Parish, Subcounty, District </span></th>
<th>Height/Length</th>
<th>Height/Length For Age Z Score</th>
<th>Blood Sugar</th>
</tr>
</thead>
<tbody>
@if(count($episodes_results) > 0)
@foreach($episodes_results as $result)
<tr>
<td rowspan = "3">{{ $result->id }}</td>
<td rowspan = "3">{{ $result->first_name }} {{ $result->last_name }}</td>
<td rowspan = "3">{{ patient_residence($result->patient_id) }}</td>
<td colspan = "4" rowspan = "3">
<?php
$today = date('Y-m-d');
$difference = days_months_years($result->date_of_birth, $today);
$age_days = $difference[0];
$age_months = $difference[1];
$age_years = $difference[2];
if (between($age_days, 0, 28) && between($age_months, 0, 0) && between($age_years, 0, 0)):
echo "0 - 28 Days";
elseif (between($age_days, 0, 31) && between($age_months, 0, 12) && between($age_years, 0, 5)):
echo "28 days - 4 years";
elseif (between($age_days, 0, 31) && between($age_months, 0, 12) && between($age_years, 5, 59)):
echo "5 - 59 years";
elseif (between($age_days, 0, 31) && between($age_months, 0, 12) && between($age_years, 59, 140)):
echo " > 60 years";
endif;
?>
</td>
<td rowspan = "3">{{ $result->gender == 1 ? 'Male' : 'Female' }}</td>
<td>&nbsp;&nbsp;
<?php
$observations = explode(',', $result->observations);
$hmis_observations = array();
foreach ($observations as $key => $value):
$values = explode('=', $value);
if ($values[0] == 'MUAC' || $values[0] == 'Weight' || $values[0] == 'Height' || $values[0] == 'BMI' || $values[0] == 'Systolic bp' || $values[0] == 'Diastolic bp'):
$hmis_observations[$values[0]] = $values[1];
else:
continue;
endif;
endforeach;
?>
{{ isset($hmis_observations['MUAC']) ? $hmis_observations['MUAC'].'cm' : ""}}
</td>
<td>{{ isset($hmis_observations['BMI']) ? $hmis_observations['BMI'] : "" }}</td>
<td rowspan = "2">{{ isset($hmis_observations['Systolic bp']) && isset($hmis_observations['Diastolic bp']) ? $hmis_observations['Systolic bp'] . '/' . $hmis_observations['Diastolic bp'] . 'mmHg' : "" }}</td>
<td rowspan = "3">{{ ucwords($result->next_of_kin) }}</td>
<td rowspan = "3">{{ $result->new_attendance != null ? 'New atttendace' : 'Re attendance'}}</td>
</tr>
<tr>
<td>{{ isset($hmis_observations['Weight(Kg)']) ? $hmis_observations['Weight(Kg)'] . "kg" : "" }}</td>
<td></td>
</tr>
<tr>
<td>{{ isset($hmis_observations['Height(m)']) ? $hmis_observations['Height(m)'] . "m" : "" }}</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
@endforeach
@else
<tr>
<td style = "color: maroon; font-weight: bold; text-align: center;" colspan = "13">No
records available
</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<!-- Typehead Plugin JavaScript -->
<script src = "{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
<!-- Data table javascript -->
<script src = "{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src = "{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src = "{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src = "{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src = "{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src = "{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src = "{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src = "{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src = "{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type = "text/javascript">
jQuery('#datepicker-from, #datepicker-to').datepicker({
autoclose: true, todayHighlight: true, format: 'dd/mm/yyyy',
});
function printElementContent(elem, title) {
var mywindow = window.open('', 'PRINT', 'height=400,width=600');
var css = '<link href="elite/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">';
mywindow.document.write('<html><head><title></title>');
mywindow.document.write('</head><body >');
mywindow.document.write(css);
mywindow.document.write('<center><h3>' + title + '</h3></center>');
mywindow.document.write(document.getElementById(elem).innerHTML);
mywindow.document.write('</body></html>');
mywindow.document.close(); // necessary for IE >= 10
//mywindow.focus(); // necessary for IE >= 10*/
setTimeout(function () {
mywindow.focus();
mywindow.print();
mywindow.remove();
}, 500);
return true;
}
$("#printEssentialMedicinesReport").click(function (e) {
printElementContent('printableContent', 'Essential Medicines Report');
});
</script>
@endpush
@@ -0,0 +1,255 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">Out patient register report 2</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">Dashboard</a></li>
<li><a href="{{ url('list_memorised_reports') }}">HMIS Reports</a></li>
<li class="active">Outpatient register report 2</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div style="float: right;">
<button class="btn btn-primary" id="printEssentialMedicinesReport">Print</button><br>
</div>
&nbsp; &nbsp;
<div style="float: right; margin-right: 20px;">
<button class="btn btn-info" onclick="window.location.href='out_patient_register_report'">Page 1</button><br>
</div>
</div>
</div><br>
<div class="white-box">
@include('flash::message')
<h3 class="heading" style="text-align: center; text-decoration: underline;">OUT PATIENT REGISTER(HMIS 031) PAGE 2</h3>
<div class="row">
<div class="col-sm-3">
<table class="table">
{{ Form::open(['url' => 'out_patient_register_report_2','data-toggle'=>'validator']) }}
<tr>
<span class="badge badge-info">search to view results</span>
<td>Select a date:</td>
</tr>
<tr>
<td>
{{ Form::text('filter_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-from']) }}
</td>
</tr>
<tr>
<td>
{{ Form::submit('Search',['class' => 'btn btn-success btn-sm','name' => 'date_filter']) }}
</td>
</tr>
{{ Form::close() }}
</table>
</div>
<div class="col-sm-3">
<table class="table">
<tr>
<th>HEALTH UNIT:</th>
<td>{{ $hospital_information->name }}</td>
</tr>
<tr>
<th>Date :</th>
<td>{{ streamline_date($filtering_date) }}</td>
</tr>
<tr>
<th><small><strong>No of patients:</th>
<td>{{ count($episodes_results) }}</strong></small></td>
</tr>
</table>
</div>
<div class="col-sm-3">
</div>
<div class="col-sm-3">
</div>
</div>
<hr>
<div id="printableContent">
<div class="row">
<div class="table-responsive">
<table class="table table-striped table-bordered color-table success-table">
<thead>
<tr>
<th rowspan="3">Serial</th>
<th>&nbsp;</th>
<th colspan="3" >Malaria Test</th>
<th colspan="4" >TB</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
<tr>
<th>Tobacco use</th>
<th rowspan="2">Fever</th>
<th rowspan="2">Tests Done</th>
<th rowspan="2">Results</th>
<th rowspan="2">New Presumed TB Case</th>
<th rowspan="2">Patient Sent To The Lab</th>
<th rowspan="2">Lab TB Result</th>
<th rowspan="2">Link Ro TB Clinic</th>
<th rowspan="2">New Diagnosis</th>
<th rowspan="2">Drugs/Treatment</th>
<th rowspan="2">Disability</th>
<th rowspan="2">Ref. In Num</th>
<th rowspan="2">Ref. Out Num</th>
</tr>
<tr>
<th>Alcohol use</th>
</tr>
</thead>
<tbody>
@if(count($episodes_results) > 0)
@foreach($episodes_results as $results)
<tr>
<td rowspan="2">{{ $results->id }}</td>
<td style="font-size: smaller; font-style: italic;">
<?php
$observations = explode(',', $results->observations);
$hmis_observations = array();
foreach ($observations as $key => $value):
$values = explode('=', $value);
if ($values[0] == 'Alcohol use' || $values[0] == 'Tobacco use'):
$hmis_observations[$values[0]] = $values[1];
else:
continue;
endif;
endforeach;
echo empty($hmis_observations['Tobacco use']) ? '' : 'Tobacco -' . $hmis_observations['Tobacco use'];
?>
</td>
<td rowspan="2">&nbsp;</td>
<td rowspan="2">
<ul class="">
<?php
$investigations = get_name($results->id, 'episode_id', 'investigation_id', 'investigation_results');
if ($investigations != "N/A") {
$investigations_query = "SELECT name from investigations WHERE id IN ({$investigations})";
$investigation_query_results = \DB::select($investigations_query);
foreach ($investigation_query_results as $result) {
echo "<li>". $result->name ."</li>";
}
}
?>
</ul>
</td>
<td rowspan="2">
<ul class="">
<?php
$inv_values = explode(',', get_name($results->id, 'episode_id', 'value', 'investigation_results'));
for ($x = 1; $x < count($inv_values); $x++):
echo "<li>{$inv_values[$x]}</li>";
endfor;
?>
</ul>
</td>
<td rowspan="2">&nbsp;</td>
<td rowspan="2">&nbsp;</td>
<td rowspan="2">&nbsp;</td>
<td rowspan="2">&nbsp;</td>
<td rowspan="2">
<?php
$primary_diagnosis_id = get_name($results->id, 'episode_id', 'primary_diagnosis', 'consultations');
$diagnosis_name = get_name($primary_diagnosis_id, 'id', 'name', 'diagnoses');
echo $diagnosis_name;
?>
</td>
<td rowspan="2">
<?php
$drug_ids = get_name($results->id, 'episode_id', 'drugs', 'treatments');
$drugs_query = "SELECT name from drugs WHERE id IN({$drug_ids})";
$drugs_query_result = \DB::select($drugs_query);
foreach ($drugs_query_result as $result) {
echo "<li>".$result->name."</li>";
}
?>
</td>
<td rowspan="2">&nbsp;</td>
<td rowspan="2">&nbsp;</td>
<td rowspan="2">{{ get_name($results->patient_id, 'id', 'number', 'patients') }}</td>
</tr>
<tr>
<td style="font-size: smaller; font-style: italic;"><?php echo empty($hmis_observations['Alcohol use']) ? '' : 'Alcohol -' . $hmis_observations['Alcohol use']; ?></td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<!-- Typehead Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
<!-- Data table javascript -->
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
jQuery('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy',
});
function printElementContent(elem,title){
var mywindow = window.open('', 'PRINT', 'height=400,width=600');
var css = '<link href="elite/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">';
mywindow.document.write('<html><head><title></title>');
mywindow.document.write('</head><body >');
mywindow.document.write(css);
mywindow.document.write('<center><h3>' + title + '</h3></center>');
mywindow.document.write(document.getElementById(elem).innerHTML);
mywindow.document.write('</body></html>');
mywindow.document.close(); // necessary for IE >= 10
//mywindow.focus(); // necessary for IE >= 10*/
setTimeout(function () {
mywindow.focus();
mywindow.print();
mywindow.remove();
}, 500);
return true;
}
$("#printEssentialMedicinesReport").click(function(e){
printElementContent('printableContent','Essential Medicines Report');
});
</script>
@endpush
@@ -0,0 +1,277 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
<title>{{ config('app.name', 'HMIS Report 002 - Stre@mline') }}</title>
<!-- Bootstrap Core CSS -->
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ asset('elite/bower_components/bootstrap-extension/css/bootstrap-extension.css') }}" rel="stylesheet">
<style>
table tr {
page-break-inside: avoid;
}
</style>
</head>
<body>
<div class="container-fluid">
<img style="max-width: 100px; max-height: 150px;" src="{{ asset('uploads/streamline_images/coat_of_arms.png') }}" class="mx-auto d-block mx-3" alt="Responsive image">
<h2 class="heading" style="text-align: center;">HMIS OPD 002: OUTPATIENT REGISTER</h2>
@php $counter = 1; $month1 = ''; @endphp
<div class="row">
<div class="col-md-4">
<table class="table table-condensed table-borderless">
<tr>
<td>{{ __('hmis_reports.health_unit') }} : {{ $hospital_info->name }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.subcounty') }} : {{ get_name($hospital_info->sub_county,'id', 'name', 'subcounties') }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.district') }} : {{ get_name($hospital_info->district,'id', 'name', 'districts') }}</td>
</tr>
</table>
</div>
<div class="col-md-4">
<table class="table table-condensed table-borderless">
<tr>
<td>{{ __('hmis_reports.code') }} : {{ $hospital_info->code }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.level') }} : {{ $hospital_info->level }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.health_sub_district') }} : {{ $hospital_info->sub_district }}</td>
</tr>
</table>
</div>
<div class="col-md-4">
<table class="table table-condensed table-borderless">
<tr>
<td>{{ __('hmis_reports.reporting_period') }}</td>
</tr>
<tr>
<td>{{ __('hmis_reports.date_opened') }}:&nbsp; {{ streamline_date($start_date) }}</td>
</tr>
<tr>
<td>{{ __('hmis_reports.date_closed') }}:&nbsp;&nbsp;&nbsp;&nbsp;{{ streamline_date($end_date) }}</td>
</tr>
</table>
</div>
</div>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th rowspan="5">Serial No</th>
<th rowspan="5">NIN</th>
<th rowspan="5">Name</th>
<th rowspan="5">Age</th>
<th rowspan="5">Sex</th>
<th rowspan="4">
<span class="vertical-text">Client<br>Category</span>
</th>
<th rowspan="5">Residence</th>
<th rowspan="5">Next Of Kin Name</th>
<th colspan="3">Nutrition Assessment</th>
<th rowspan="3">Blood<br />
Pressure<br />
(mmHg)
</th>
<th rowspan="5">
<span class="vertical-text">Need For Palliative<br>Care (&check;/X)</span>
</th>
<th rowspan="3">Tobacco Use</th>
</tr>
<tr>
<th rowspan="2">MUAC (cm +(R/Y/G/ND)</th>
<th>BMI (SM/MM/N/ OW/O)</th>
<th rowspan="2">W/H Or L<br />
Score<br />
(Z Score)
</th>
</tr>
<tr>
<th>BMI For Age<br />
(SM/M/N/OW/O)
</th>
</tr>
<tr>
<th>Weight (Kg)</th>
<th colspan="2">Weight For Age Z Score<br />
(SU/U/N/OW/O)
</th>
<th rowspan="2">Blood Sugar<br />
(mm/l)
</th>
<th>Tobacco<br />
Exposure
</th>
</tr>
<tr>
<th>(N/R/F)</th>
<th>Height/ Length<br />
(cm)
</th>
<th colspan="2">Height/ Length for Age Z<br />
Score (N/S/SS)
</th>
<th>Alcohol Use</th>
</tr>
</thead>
@if(count($episodes) > 0)
<tbody>
@foreach($episodes as $episode)
@if (!empty($episode->consultation_id) || !empty($episode->triage_id))
<tr>
<td rowspan="4">
{{-- {{ $episode->id }} --}}
{{ sprintf("%04u", $counter) }}
</td>
<td rowspan="4">{{ strtoupper($episode->national_id) }}</td>
<td>{{ ucwords(strtolower($episode->last_name)) }}</td>
<td rowspan="4">
@php
$month2 = date('Y-m', strtotime($episode->created_at));
if (empty($month1) || $month1 === $month2) $counter++;
else $counter = 1;
$dateOfBirth = \Carbon\Carbon::parse($episode->date_of_birth);
$diffInDays = $dateOfBirth->diffInDays(\Carbon\Carbon::now());
if($diffInDays < 30) $age = $diffInDays .' Days';
elseif ($diffInDays > 29 && $diffInDays < 365) $age = $dateOfBirth->diffInMonths(\Carbon\Carbon::now()) .' MTH';
else $age = $dateOfBirth->diffInYears(\Carbon\Carbon::now()) .' Yrs';
echo $age; $month1 = date('Y-m', strtotime($episode->created_at));
@endphp
</td>
<td rowspan="4">
<?php
$gender=$episode->gender;
if ($gender == 1):
echo 'M';
elseif ($gender == 2):
echo 'F';
endif;
?>
</td>
<td rowspan="4">{{ ($episode->citizenship == '1')? 'N':'F' }}</td>
<td>{{ ucwords(strtolower($episode->village)) }}</td>
<td>{{ ucwords(strtolower($episode->next_of_kin)) }}</td>
<td rowspan="2">
@php
$observations = explode(',', $episode->observations);
$hmis_observations = [];
foreach ($observations as $key => $value){
$values = explode('=', $value);
$hmis_observations[$values[0]] = $values[1] ?? '';
}
$muac =$hmis_observations['MUAC']?? '';
@endphp
{{ isset($hmis_observations['MUAC']) ? $hmis_observations['MUAC'].' cm' : "ND"}}
@if ((12.5 <= $muac) && ($muac <= 50))
<h4 style='color:green'> G </h4>
@elseif ((11.5 <= $muac) && ($muac <= 12.4))
<h4 style='color:#FFC40C'> Y </h4>
@elseif ((1 <= $muac) && ($muac <= 11.4))
<h4 style='color:red'> R </h4>
@endif
</td>
<td>{{ !empty($hmis_observations['BMI'])? $hmis_observations['BMI']:"ND" }}</td>
<td rowspan="2"></td>
<td rowspan="2">
{{ isset($hmis_observations['Systolic bp']) && isset($hmis_observations['Diastolic bp']) ? $hmis_observations['Systolic bp'] . '/' . $hmis_observations['Diastolic bp'] . ' mmHg' : "ND" }}
</td>
<td rowspan="4">&nbsp;</td>
<td>
{{-- {{ $hmis_observations['Tobacco use'] ?? "" }} --}}
@if (isset($hmis_observations['Tobacco use']))
@if ($hmis_observations['Tobacco use'] == 'Nil')
No
{{-- <span class='glyphicon glyphicon-remove'></span> --}}
@else
Yes
{{-- <span class="glyphicon glyphicon-ok"></span> --}}
@endif
@else
ND
@endif
</td>
</tr>
<tr>
<td class="dashed-td">{{ ucwords(strtolower($episode->first_name)) }}</td>
<td class="dashed-td">{{ ucwords(strtolower($episode->parish)) }}</td>
<td class="dashed-td">{{ ucwords(strtolower($episode->phone_of_next_of_kin)) }}</td>
<td class="dashed-td"></td>
<td class="dashed-td"> {{-- Tobacco Exposure --}}
@if (isset($hmis_observations['Tobacco use']))
@if ($hmis_observations['Tobacco use'] == 'Nil')
No
{{-- <span class='glyphicon glyphicon-remove'></span> --}}
@else
Yes
{{-- <span class="glyphicon glyphicon-ok"></span> --}}
@endif
@else
ND
@endif
</td>
</tr>
<tr>
<td rowspan="2">{{ $episode->phone }}</td>
<td class="dashed-td">{{ ucwords(strtolower($episode->subcounty)) }}</td>
<td rowspan="2">{{ ucwords(strtolower($episode->relation)) }}</td>
<td class="dashed-td">
{{ isset($hmis_observations['Weight']) ? $hmis_observations['Weight'] . " kg" : "" }}
</td>
<td colspan="2" class="dashed-td"></td> {{-- Height/ Length for Age Z Score (N/S/SS) --}}
<td rowspan="2" class="dashed-td-top">{{ !empty($episode->rbs)? $episode->rbs :'ND' }}</td>{{-- Blood sugar --}}
<td rowspan="2">
@if (isset($hmis_observations['Alcohol use']))
@if ($hmis_observations['Alcohol use'] == 'Nil')
No
{{-- <span class='glyphicon glyphicon-remove'></span> --}}
@else
Yes
{{-- <span class="glyphicon glyphicon-ok"></span> --}}
@endif
@else
ND
@endif
</td>
</tr>
<tr>
<td>{{ ucwords(strtolower($episode->district)) }}</td>
<td>
{{ isset($hmis_observations['Height']) ? $hmis_observations['Height'] . " m" : "" }}
</td>
<td colspan="2">&nbsp;</td>
</tr>
@endif
@endforeach
</tbody>
@else
<tbody>
<tr>
<td style="color: maroon; font-weight: bold; text-align: center;" colspan="14">No records available</td>
</tr>
</tbody>
@endif
</table>
</div>
</body>
</html>
@@ -0,0 +1,421 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<style type="text/css">
.dashed-td {
border: thin dashed #999;
}
.dashed-td-top {
border-top-width: thin;
border-top-style: dashed;
border-top-color: #999;
}
.vertical-text {
writing-mode: vertical-rl;
text-orientation: mixed;
}
.custom-table th {
padding: 1px;
border: 1px solid #e4e7ea;
}
</style>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-5">
<h4 class="page-title">HMIS OPD 002 : OUTPATIENT REGISTER</h4>
</div>
<div class="col-md-7">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">Dashboard</a></li>
<li><a href="{{ url('list/hmis-reports') }}">HMIS Reports</a></li>
<li class="active">Outpatient Register</li>
</ol>
</div>
</div>
<div class="white-box">
<div class="row" style="display: flow-root;">
<div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
<h3 class="heading" style="text-align: center; text-decoration: underline;">
HMIS OPD 002: OUTPATIENT REGISTER PAGE 1
</h3>
</div>
<div class="col-lg-3 col-md-3 col-sm-12 col-xs-12 text-center">
<a href="#" onclick="export_to_excel();" title="Download {{ __('hmis_reports.hmis_002') }} CSV"
style="border-radius: 5px;" class="btn btn-inverse waves-effect waves-light">
<span class="glyphicon glyphicon-download"></span> Download CSV
</a>
<a href='{{ url("hmis/002/page-1/print/{$start_date}/{$end_date}") }}' target="_blank" title="Print {{ __('hmis_reports.hmis_002') }} PDF" class="btn btn-inverse float-left" style="border-radius: 5px;"><span class="glyphicon glyphicon-print"></span>Print</a>
</div>
{{ Form::open(['method' => 'POST', 'route' => 'hmis_report_002_page_2', 'target' => "_blank"]) }}
<input type="hidden" name="page_1_start_date" value='{{ $start_date }}' />
<input type="hidden" name="end_date" value='{{ $end_date }}' />
<input type="hidden" name="search_text" id="search_text" value='{{ $search_text }}' />
<div class="col-lg-1 col-md-1 col-sm-12 col-xs-12">
<button class="btn btn-info float-right" type="submit" style="border-radius: 5px;"> Page 2</button>
</div>
{{ Form::close() }}
</div>
<div class="row">
<div class="col-md-4">
<table class="table table-condensed table-borderless">
<tr>
<td>{{ __('hmis_reports.health_unit') }} : {{ $hospital_info->name }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.subcounty') }} : {{ get_name($hospital_info->sub_county,'id', 'name', 'subcounties') }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.district') }} : {{ get_name($hospital_info->district,'id', 'name', 'districts') }}</td>
</tr>
</table>
</div>
<div class="col-md-4">
<table class="table table-condensed table-borderless">
<tr>
<td>{{ __('hmis_reports.code') }} : {{ $hospital_info->code }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.level') }} : {{ $hospital_info->level }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.health_sub_district') }} : {{ $hospital_info->sub_district }}</td>
</tr>
</table>
</div>
<div class="col-md-4">
<table class="table table-condensed table-borderless">
<tr>
<td>{{ __('hmis_reports.reporting_period') }}</td>
</tr>
<tr>
<td>{{ __('hmis_reports.date_opened') }}:&nbsp; {{ streamline_date($start_date) }}</td>
</tr>
<tr>
<td>{{ __('hmis_reports.date_closed') }}:&nbsp;&nbsp;&nbsp;&nbsp;{{ streamline_date($end_date) }}</td>
</tr>
</table>
</div>
</div>
{{ Form::open(['url' => 'hmis/002/page-1','data-toggle'=>'validator']) }}
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label>{{ __('pharmacy.select_date') }}:</label>
<select class="form-control compulsory required" name="search_date_by" id="search_date_by" style="border-radius: 5px;" required>
<option value="today">{{ __('pharmacy.today') }}</option>
<option value="yesterday">{{ __('pharmacy.yesterday') }}</option>
<option value="custom_date">{{ __('pharmacy.custom_date') }}</option>
<option value="custom_date_range">{{ __('pharmacy.date_range') }}</option>
</select>
</div>
</div>
<div class="col-md-2" id="start_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('pharmacy.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-2" id="end_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('pharmacy.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-sm-3" style="margin-top: 22px!important;"> {{ Form::submit('Search',['class' => 'btn btn-success','name' => 'date_filter', "style"=>"border-radius: 5px;"]) }} </div>
</div>
{{ Form::close() }}
<h3>
<label class="label label-primary" id="text_params"></label>
</h3>
<hr>
@php $counter = 1; $month1 = ''; $episode_counter = 0; @endphp
<div class="table-responsive" id="csv">
<table class="table table-bordered table-sm custom-table color-table success-table">
<thead>
<tr>
<th rowspan="5" scope="col">Serial No</th>
<th rowspan="5" scope="col">NIN</th>
<th rowspan="5" scope="col">Name</th>
<th rowspan="5" scope="col">Age</th>
<th rowspan="5" scope="col">Sex</th>
<th rowspan="4" scope="col">
<span class="vertical-text">Client<br>Category</span>
</th>
<th rowspan="5" scope="col">Residence</th>
<th rowspan="5" scope="col">Next Of Kin Name</th>
<th colspan="3" scope="col">Nutrition Assessment</th>
<th rowspan="3" scope="col">Blood<br />
Pressure<br />
(mmHg)
</th>
<th rowspan="5" scope="col">
<span class="vertical-text">Need For Palliative<br>Care (&check;/X)</span>
</th>
<th rowspan="3" scope="col">Tobacco Use</th>
</tr>
<tr>
<th rowspan="2" scope="col">MUAC (cm +(R/Y/G/ND)</th>
<th scope="col">BMI (SM/MM/N/ OW/O)</th>
<th rowspan="2" scope="col">W/H Or L<br />
Score<br />
(Z Score)
</th>
</tr>
<tr>
<th scope="col">BMI For Age<br />
(SM/M/N/OW/O)
</th>
</tr>
<tr>
<th scope="col">Weight (Kg)</th>
<th colspan="2" scope="col">Weight For Age Z Score<br />
(SU/U/N/OW/O)
</th>
<th rowspan="2" scope="col">Blood Sugar<br />
(mm/l)
</th>
<th scope="col">Tobacco<br />
Exposure
</th>
</tr>
<tr>
<th scope="col">(N/R/F)</th>
<th scope="col">Height/ Length<br />
(cm)
</th>
<th colspan="2" scope="col">Height/ Length for Age Z<br />
Score (N/S/SS)
</th>
<th scope="col">Alcohol Use</th>
</tr>
</thead>
@if(count($episodes) > 0)
<tbody>
@foreach($episodes as $episode)
@if (!empty($episode->consultation_id) || !empty($episode->triage_id))
<tr>
<td rowspan="4">
{{ sprintf("%04u", $counter) }}
</td>
<td rowspan="4">{{ strtoupper($episode->national_id) }}</td>
<td>{{ ucwords(strtolower($episode->last_name)) }}</td>
<td rowspan="4">
@php
$month2 = date('Y-m', strtotime($episode->created_at));
if (empty($month1) || $month1 === $month2) $counter++;
else $counter = 1;
$dateOfBirth = \Carbon\Carbon::parse($episode->date_of_birth);
$diffInDays = $dateOfBirth->diffInDays(\Carbon\Carbon::now());
if($diffInDays < 30) $age = $diffInDays .' Days';
elseif ($diffInDays > 29 && $diffInDays < 365) $age = $dateOfBirth->diffInMonths(\Carbon\Carbon::now()) .' MTH';
else $age = $dateOfBirth->diffInYears(\Carbon\Carbon::now()) .' Yrs';
echo $age;
$month1 = date('Y-m', strtotime($episode->created_at));
$episode_counter++;
@endphp
</td>
<td rowspan="4">
<?php
$gender=$episode->gender;
if ($gender == 1):
echo 'M';
elseif ($gender == 2):
echo 'F';
endif;
?>
</td>
<td rowspan="4">{{ ($episode->citizenship == '1')? 'N':'F' }}</td>
<td>{{ ucwords(strtolower($episode->village)) }}</td>
<td>{{ ucwords(strtolower($episode->next_of_kin)) }}</td>
<td rowspan="2">
@php
$observations = explode(',', $episode->observations);
$hmis_observations = [];
foreach ($observations as $key => $value){
$values = explode('=', $value);
$hmis_observations[$values[0]] = $values[1] ?? '';
}
$muac =$hmis_observations['MUAC']?? '';
@endphp
{{ !empty($hmis_observations['MUAC']) ? $hmis_observations['MUAC'].' cm ' : "ND "}}
@if ((12.5 <= $muac) && ($muac <= 50))
<h4 style='color:green'> G </h4>
@elseif ((11.5 <= $muac) && ($muac <= 12.4))
<h4 style='color:#FFC40C'> Y </h4>
@elseif ((1 <= $muac) && ($muac <= 11.4))
<h4 style='color:red'> R </h4>
@endif
</td>
<td>
@php
if (!empty($hmis_observations['Height'])) {
if(intval($hmis_observations['Height']) > 4) $height = $hmis_observations['Height'];
else $height = ($hmis_observations['Height'] * 100);
}
else $height = '';
if (!empty($hmis_observations['BMI'])) $bmi = $hmis_observations['BMI'];
elseif (!empty($height) && !empty($hmis_observations['Weight'])) $bmi = round($hmis_observations['Weight'] / pow(($height / 100), 2), 1);
else $bmi = 'ND';
echo $bmi;
@endphp
{{-- {{ !empty($hmis_observations['BMI'])? $hmis_observations['BMI']:"ND" }} --}}
</td>
<td rowspan="2"></td> {{-- W/H Or L Score (Z Score) --}}
<td rowspan="2">
{{ !empty($hmis_observations['Systolic bp']) && !empty($hmis_observations['Diastolic bp']) ? $hmis_observations['Systolic bp'] . '/' . $hmis_observations['Diastolic bp'] . ' mmHg' : "ND" }}
</td>
<td rowspan="4">&nbsp;</td> {{-- Palliative care --}}
<td>
{{-- {{ $hmis_observations['Tobacco use'] ?? "" }} --}}
@if (!empty($hmis_observations['Tobacco use']))
@if ($hmis_observations['Tobacco use'] == 'Nil')
<span class='glyphicon glyphicon-remove'></span>
@else
<span class="glyphicon glyphicon-ok"></span>
@endif
@else
ND
@endif
</td>
</tr>
<tr>
<td class="dashed-td">{{ ucwords(strtolower($episode->first_name)) }}</td>
<td class="dashed-td">{{ ucwords(strtolower($episode->parish)) }}</td>
<td class="dashed-td">{{ ucwords($episode->phone_of_next_of_kin) }}</td>
<td class="dashed-td"></td> {{-- BMI For Age (SM/M/N/OW/O) --}}
<td class="dashed-td"> {{-- Tobacco Exposure --}}
@if (!empty($hmis_observations['Tobacco use']))
@if ($hmis_observations['Tobacco use'] == 'Nil')
<span class='glyphicon glyphicon-remove'></span>
@else
<span class="glyphicon glyphicon-ok"></span>
@endif
@else
ND
@endif
</td>
</tr>
<tr>
<td rowspan="2">{{ $episode->phone }}</td>
<td class="dashed-td">{{ ucwords(strtolower($episode->subcounty)) }}</td>
<td rowspan="2">{{ ucwords(strtolower($episode->relation)) }}</td>
<td class="dashed-td">
{{ isset($hmis_observations['Weight']) ? $hmis_observations['Weight'] . " kg" : "" }}
</td>
<td colspan="2" class="dashed-td"></td> {{-- Height/ Length for Age Z Score (N/S/SS) --}}
<td rowspan="2" class="dashed-td-top">{{ !empty($episode->rbs)? $episode->rbs :'ND' }}</td>{{-- Blood sugar --}}
<td rowspan="2">
@if (!empty($hmis_observations['Alcohol use']))
@if ($hmis_observations['Alcohol use'] == 'Nil')
<span class='glyphicon glyphicon-remove'></span>
@else
<span class="glyphicon glyphicon-ok"></span>
@endif
@else
ND
@endif
</td>
</tr>
<tr>
<td>{{ ucwords(strtolower($episode->district)) }}</td>
<td> {{ !empty($height)? $height .' cm': $height }} </td>
<td colspan="2">&nbsp;</td> {{-- Height/ Length for Age Z Score (N/S/SS) --}}
</tr>
@endif
@endforeach
@if ($episode_counter == 0)
<tr>
<td style="color: maroon; font-weight: bold; text-align: center;" colspan="14">No records available</td>
</tr>
@endif
</tbody>
@else
<tbody>
<tr>
<td style="color: maroon; font-weight: bold; text-align: center;" colspan="14">No records available</td>
</tr>
</tbody>
@endif
</table>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/sheetjs/xlsx.full.min.js') }}"></script>
<script type="text/javascript">
$('#search_date_by').change(function() {
if($(this).val() === "custom_date"){
$("#end_date_div").hide();
$("#start_date_div").show();
} else if($(this).val() === "custom_date_range") {
$("#start_date_div").show();
$("#end_date_div").show();
} else {
$("#end_date_div").hide();
$("#start_date_div").hide();
}
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy',
endDate: new Date(),
orientation: 'bottom'
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy',
endDate: new Date(),
orientation: 'bottom'
});
function export_to_excel(type, fn, dl) {
var elt = document.getElementById('csv');
var wb = XLSX.utils.table_to_book(elt, { sheet: "Outpatient Register Page-1", raw:true });
return dl ?
XLSX.write(wb, { bookType: type, bookSST: true, type: 'binary' }):
XLSX.writeFile(wb, fn || ('{{ __('hmis_reports.hmis_002') }}.' + (type || 'xlsx')));
}
let text = '{{ $search_text }}' +'- No of patients:' + '{{ $episode_counter }}';
$('#text_params').text(text);
</script>
@endpush
@@ -0,0 +1,324 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
<title>{{ config('app.name', 'HMIS Report 002 - Stre@mline') }}</title>
<!-- Bootstrap Core CSS -->
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<link href="{{ asset('elite/bower_components/bootstrap-extension/css/bootstrap-extension.css') }}" rel="stylesheet">
<style>
table tr {
page-break-inside: avoid;
}
</style>
</head>
<body>
<div class="container-fluid">
<img style="max-width: 100px; max-height: 150px;" src="{{ asset('uploads/streamline_images/coat_of_arms.png') }}" class="mx-auto d-block mx-3" alt="Responsive image">
<h2 class="heading" style="text-align: center;">HMIS OPD 002: OUTPATIENT REGISTER</h2>
@php
$counter = 1;$str_length = 3;
@endphp
<div class="row">
<div class="col-md-4">
<table class="table table-condensed table-borderless">
<tr>
<td>{{ __('hmis_reports.health_unit') }} : {{ $hospital_info['name'] }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.subcounty') }} : {{ get_name($hospital_info['sub_county'],'id', 'name', 'subcounties') }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.district') }} : {{ get_name($hospital_info['district'],'id', 'name', 'districts') }}</td>
</tr>
</table>
</div>
<div class="col-md-4">
<table class="table table-condensed table-borderless">
<tr>
<td>{{ __('hmis_reports.code') }} : {{ $hospital_info['code'] }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.level') }} : {{ $hospital_info['level'] }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.health_sub_district') }} : {{ $hospital_info['sub_district'] }}</td>
</tr>
</table>
</div>
<div class="col-md-4">
<table class="table table-condensed table-borderless">
<tr>
<td>{{ __('hmis_reports.reporting_period') }}</td>
</tr>
<tr>
<td>{{ __('hmis_reports.date_opened') }}:&nbsp; {{ streamline_date($start_date) }}</td>
</tr>
<tr>
<td>{{ __('hmis_reports.date_closed') }}:&nbsp;&nbsp;&nbsp;&nbsp;{{ streamline_date($end_date) }}</td>
</tr>
</table>
</div>
</div>
<table class="table table-bordered">
<thead class="thead-light">
<tr>
<th rowspan="5">Serial No</th>
<th rowspan="5">NIN</th>
<th rowspan="5">Name</th>
<th rowspan="5">Age</th>
<th rowspan="5">Sex</th>
<th colspan="3">Malaria Test</th>
<th colspan="4">TB</th>
<th colspan="2">Ticket Classification</th>
<th rowspan="5">Diagnosis</th>
<th rowspan="5">Prescription</th>
<th rowspan="5">Disability (Write code of disability)</th>
<th rowspan="5">Ref. In No.</th>
<th rowspan="5">Ref. Out No</th>
</tr>
<tr>
<th rowspan="5">Fever (Yes/No)</th>
<th rowspan="5">Tests Done (B/S. RDT/ND)</th>
<th rowspan="5">Results (POS/NEG/N/A)</th>
<th rowspan="1">Presumed TB Case <br/>(Y/N)</th>
<th rowspan="5">Patient Sent To The Lab For TB testing (Y/N)</th>
<th rowspan="5">Lab. TB Result (POS/ NEG/ NA)</th>
<th rowspan="1">Linked To TB Clinic</th>
<th rowspan="5">New Attendance</th>
<th rowspan="5">Re - Attendance</th>
</tr>
<tr>
<th>Screened For HIV (Y/N)</th>
<th>(Yes/No)</th>
</tr>
<tr>
<th>Eligible For HIV Testing (Y/N)</th>
<th>Where</th>
</tr>
<tr>
<th></th>
<th>Unit TB No.</th>
</tr>
</thead>
@if(count($episodes) > 0)
<tbody>
@foreach($episodes as $episode)
@if (!empty($episode['consultation_id']) || !empty($episode['triage_id']))
<tr>
<td rowspan="4">
{{ sprintf("%04u", $counter) }}
</td>
<td rowspan="4">{{ strtoupper($episode['national_id']) }}</td>
<td>{{ ucwords(strtolower($episode['last_name'])) }}</td>
<td rowspan="4">
@php
$month2 = date('Y-m', strtotime($episode['created_at']));
if (empty($month1) || $month1 === $month2) $counter++;
else $counter = 1;
$dateOfBirth = \Carbon\Carbon::parse($episode['date_of_birth']);
$diffInDays = $dateOfBirth->diffInDays(\Carbon\Carbon::now());
if($diffInDays < 30) $age = $diffInDays .' Days';
elseif ($diffInDays > 29 && $diffInDays < 365) $age = $dateOfBirth->diffInMonths(\Carbon\Carbon::now()) .' MTH';
else $age = $dateOfBirth->diffInYears(\Carbon\Carbon::now()) .' Yrs';
echo $age; $month1 = date('Y-m', strtotime($episode['created_at']));
@endphp
</td>
<td rowspan="4">
<?php
$gender=$episode['gender'];
if ($gender == 1):
echo 'M';
elseif ($gender == 2):
echo 'F';
endif;
?>
</td>
<td rowspan="4">
@php
$triage_symptoms = !empty($episode['symptoms'])? explode(',', $episode['symptoms']):[];
$consultation_symptoms = !empty($episode['symps'])? explode(',', $episode['symps']):[];
$symptoms = [];
foreach ($triage_symptoms as $triage_symptom) if (!empty($triage_symptom)) $symptoms[] =$triage_symptom;
foreach ($consultation_symptoms as $consultation_symptom) if (!empty($consultation_symptom)) $symptoms[] =$consultation_symptom;
@endphp
@if (array_intersect($symptoms, $fever_symptom_ids))
Y
@else
No
@endif
</td> {{-- Malaria Test ->fever --}}
<td rowspan="4">
@if (!empty($episode['investigation_ids']))
@php
$rdt = $bs = $tb = $bs_result = $tb_result = [];$inv_result='';
$investigation_ids = explode(',', $episode['investigation_ids']);
foreach ($investigation_ids as $investigation_id) {
if (in_array($investigation_id, array_keys($investigations))) {
if($investigations[$investigation_id] == 1) array_push($tb, $investigation_id);
elseif($investigations[$investigation_id] == 2) array_push($rdt, $investigation_id);
else array_push($bs, $investigation_id);
$results = Streamline\Models\InvestigationResults::whereRaw('FIND_IN_SET(' . $investigation_id . ',investigation_id)')->where([['episode_id', $episode['id']], ['patient_id', $episode['patient_id']]])->orderBy('id', 'DESC')->first(['id','investigation_id','value']);
if (!empty($results)) {
$ids = explode(',', $results->investigation_id);
$values = explode(',', $results->value);
$id = array_search($investigation_id, $ids);
$inv_result = strtolower($values[$id]);
}
}
}
@endphp
@endif
@if (!empty($rdt) || !is_null($episode['rdt']))
RDT
@elseif(!empty($bs))
B/S
@else
ND
@endif
</td>{{-- Malaria Test ->Tests Done --}}
<td rowspan="4">
@if (!is_null($episode['rdt']) || !empty($rdt))
@if (!empty($episode['rdt']) ||((!empty($rdt) && !empty($inv_result)) && (str_contains($inv_result, 'pos') || $inv_result == '+'|| $inv_result == '++'|| $inv_result == '+++')))
POS
@elseif($episode['rdt'] == 0 || (!empty($inv_result) && (str_contains($inv_result, 'neg') || $inv_result == '-')))
NEG
@endif
@elseif (!empty($bs) && !empty($inv_result))
{{ $inv_result }}
@else
N/A
@endif
</td>{{-- Malaria Test ->Results --}}
<td>
@if (!empty($episode['tb_status_assessment']) && ($episode['tb_status_assessment'] == '1' || $episode['tb_status_assessment'] == '2'))
Y
@else
N
@endif
</td>{{-- TB-> Presumed TB Case--}}
<td rowspan="4">
@if (!empty($tb))
Y
@else
N
@endif
</td> {{-- Patient Sent To The Lab For TB testing --}}
<td rowspan="4">
@if (!empty(!empty($tb) && !empty($inv_result)))
{{ $inv_result }}
@else
N/A
@endif
</td>{{-- Lab. TB Result --}}
<td rowspan="2">
{{ (!empty($episode['clinic_id']) && in_array($episode['clinic_id'], $tb_clinic_ids))? 'Yes':'No' }}
</td>{{-- TB->Linked To TB Clinic --}}
<td rowspan="4">
@if ($episode['new_attendance'] == 1 || $episode['attendance'] == 1)
<span class="glyphicon glyphicon-ok"></span>
@else
<span class='glyphicon glyphicon-remove'></span>
@endif
</td>
<td rowspan="4">
@if ($episode['re_attendance'] == 1 || $episode['attendance'] == 2)
<span class="glyphicon glyphicon-ok"></span>
@else
<span class='glyphicon glyphicon-remove'></span>
@endif
</td>
@php
$drug_names= $diagnoses = [];
if(!empty($episode['primary_diagnosis'])) $diagnoses[] = get_name($episode['primary_diagnosis'], 'id', 'name', 'diagnoses');
if(!empty($episode['other_diagnoses'])) {
$other_diagnoses = unserialize($episode['other_diagnoses']);
foreach ($other_diagnoses as $diagnosis) $diagnoses[] = get_name($diagnosis, 'id', 'name', 'diagnoses');
}
if (!empty($episode['right_eye_diagnosis'])) {
$right_eye_diagnoses = explode(',', $episode['right_eye_diagnosis']);
foreach ($right_eye_diagnoses as $diagnosis) $diagnoses[] = get_name($diagnosis, 'id', 'name', 'diagnoses');
}
if (!empty($episode['left_eye_diagnosis'])) {
$left_eye_diagnoses = explode(',', $episode['left_eye_diagnosis']);
foreach ($left_eye_diagnoses as $diagnosis) $diagnoses[] = get_name($diagnosis, 'id', 'name', 'diagnoses');
}
if(!empty($episode['drugs'])) {
$drugs =explode(',', $episode['drugs']);
$frequencies = explode(',', $episode['frequencies']);
$durations = explode(',', $episode['durations']);
$dose_explode = explode(",", $episode['doses']);
for($i=0; $i < count($drugs); $i++) {
$unit_id = get_name($drugs[$i], 'id', 'unit_id', 'drugs');
$unit_name = get_name($unit_id, 'id', 'name', 'drug_units');
$drug_names[]= ucwords(strtolower(get_name($drugs[$i], 'id' , 'name' , 'drugs'))) .' ( ' . $dose_explode[$i] . $unit_name . ' To be taken '.get_name($frequencies[$i], 'id' , 'name' , 'dosage_frequencies').' for '.$durations[$i] . ')';
}
}
@endphp
<td rowspan="4">
@if (!empty($diagnoses))
{{ ucwords(strtolower(implode(', ', $diagnoses))) }}.
@else
ND
@endif
</td>{{-- Diagnosis --}}
<td rowspan="4">
@if (!empty($drug_names))
{!! implode('<br><br> ', $drug_names) !!}.
@else
N/A
@endif
</td> {{-- Prescription --}}
<td rowspan="4"></td> {{-- Disability (Write code of disability) --}}
<td rowspan="4"></td>{{-- Ref. In No. --}}
<td rowspan="4">
@if (!empty($episode['referred_to']))
{{ $episode['number'] }}
@endif
</td>{{-- Ref. Out No. --}}
</tr>
<tr>
<td class="dashed-td">{{ ucwords(strtolower($episode['first_name'])) }}</td>
<td class="dashed-td"></td> {{-- Screened For HIV (Y/N) --}}
{{-- <td class="dashed-td"></td> Linked To TB Clinic ->(Yes/No) --}}
</tr>
<tr>
<td rowspan="2">{{ $episode['phone'] }}</td>
<td class="dashed-td" rowspan="2"></td> {{-- Eligible For HIV Testing (Y/N) --}}
<td class="dashed-td"></td>{{-- Linked To TB Clinic ->(Where) --}}
</tr>
<tr>
{{-- <td class="dashed-td"></td> TB empty space --}}
<td class="dashed-td"></td>{{-- TB-> Unit TB No. --}}
</tr>
@endif
@endforeach
</tbody>
@else
<tbody>
<tr>
<td style="color: maroon; font-weight: bold; text-align: center;" colspan="14">No records available </td>
</tr>
</tbody>
@endif
</table>
</div>
</body>
</html>
@@ -0,0 +1,466 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<style type="text/css">
.dashed-td {
border: thin dashed #999;
}
.dashed-td-top {
border-top-width: thin;
border-top-style: dashed;
border-top-color: #999;
}
.vertical-text {
writing-mode: vertical-rl;
text-orientation: mixed;
}
.custom-table th {
padding: 1px;
border: 1px solid #e4e7ea;
}
</style>
@endpush
@php
$counter = 1;$str_length = 3; $episode_counter = 0;
@endphp
@section('content')
<div class="row bg-title">
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
<h4 class="page-title">HMIS OPD 002 : OUTPATIENT REGISTER</h4>
</div>
<div class="col-lg-7 col-sm-7 col-md-7 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">Dashboard</a></li>
<li><a href="{{ url('list/hmis-reports') }}">HMIS Reports</a></li>
<li class="active">Outpatient Register</li>
</ol>
</div>
</div>
<div class="white-box">
<div class="row">
<div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
<h3 class="heading" style="text-align: center; text-decoration: underline;">
HMIS OPD 002: OUTPATIENT REGISTER PAGE 2
</h3>
</div>
<div class="col-lg-1 col-md-1 col-sm-12 col-xs-12 text-center">
{{ Form::open(['url' => 'hmis/002/page-2/print','data-toggle'=>'validator', 'target'=>"_blank"]) }}
{{ Form::hidden('search_text', $search_text) }}
{{ Form::hidden('episodes', serialize(($episodes->toArray()))) }}
{{ Form::hidden('start_date', $start_date) }}
{{ Form::hidden('end_date', $end_date) }}
{{ Form::hidden('hospital_info', serialize($hospital_info->toArray())) }}
{{ Form::hidden('fever_symptom_ids', serialize($fever_symptom_ids)) }}
{{ Form::hidden('tb_clinic_ids', serialize($tb_clinic_ids)) }}
{{ Form::hidden('investigations', serialize($investigations)) }}
<button class="btn btn-inverse" type="submit" style="border-radius: 5px;" title="Print {{ __('hmis_reports.hmis_002') }} to pdf"><span class="glyphicon glyphicon-print"></span> Print</button>
{{ Form::close() }}
</div>
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12 text-center">
<a href="#" onclick="export_to_excel();" title="Download {{ __('hmis_reports.hmis_002') }} CSV"
style="border-radius: 5px;" class="btn btn-inverse waves-effect waves-light">
<span class="glyphicon glyphicon-download"></span> Download CSV
</a>
</div>
<div class="col-lg-1 col-md-1 col-sm-12 col-xs-12 text-center">
<a href="{{ url('hmis/002/page-1') }}" class="btn btn-info" style="border-radius: 5px;">Page 1</a>
</div>
</div>
<div class="row">
<div class="col-md-4">
<table class="table table-condensed table-borderless">
<tr>
<td>{{ __('hmis_reports.health_unit') }} : {{ $hospital_info->name }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.subcounty') }} : {{ get_name($hospital_info->sub_county,'id', 'name', 'subcounties') }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.district') }} : {{ get_name($hospital_info->district,'id', 'name', 'districts') }}</td>
</tr>
</table>
</div>
<div class="col-md-4">
<table class="table table-condensed table-borderless">
<tr>
<td>{{ __('hmis_reports.code') }} : {{ $hospital_info->code }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.level') }} : {{ $hospital_info->level }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.health_sub_district') }} : {{ $hospital_info->sub_district }}</td>
</tr>
</table>
</div>
<div class="col-md-4">
<table class="table table-condensed table-borderless">
<tr>
<td>{{ __('hmis_reports.reporting_period') }}</td>
</tr>
<tr>
<td>{{ __('hmis_reports.date_opened') }}:&nbsp; {{ streamline_date($start_date) }}</td>
</tr>
<tr>
<td>{{ __('hmis_reports.date_closed') }}:&nbsp;&nbsp;&nbsp;&nbsp;{{ streamline_date($end_date) }}</td>
</tr>
</table>
</div>
</div>
{{ Form::open(['url' => 'hmis/002/page-2','data-toggle'=>'validator']) }}
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label>{{ __('pharmacy.select_date') }}:</label>
<select class="form-control compulsory required" name="search_date_by" id="search_date_by" required>
<option value="today">{{ __('pharmacy.today') }}</option>
<option value="yesterday">{{ __('pharmacy.yesterday') }}</option>
<option value="custom_date">{{ __('pharmacy.custom_date') }}</option>
<option value="custom_date_range">{{ __('pharmacy.date_range') }}</option>
</select>
</div>
</div>
<div class="col-md-2" id="start_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('start_date', __('pharmacy.date_on')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'start_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-2" id="end_date_div" style="display: none;">
<div class="form-group">
{{ Form::label('end_date', __('pharmacy.end_date')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class'=>'form-control compulsory', 'readonly', 'id'=>'end_date']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-sm-3 m-t-10"> {{ Form::submit('Search',['class' => 'btn btn-success mt-3','name' => 'date_filter']) }} </div>
</div>
{{ Form::close() }}
<h3>
<label class="label label-primary" id="text_params"></label>
</h3>
<hr>
<div class="row">
<div class="table-responsive" id="csv">
<table class="table table-bordered table-sm custom-table color-table success-table">
<thead>
<tr>
<th rowspan="5" scope="col">Serial No</th>
<th rowspan="5" scope="col">NIN</th>
<th rowspan="5" scope="col">Name</th>
<th rowspan="5" scope="col">Age</th>
<th rowspan="5" scope="col">Sex</th>
<th colspan="3" scope="col">Malaria Test</th>
<th colspan="4" scope="col">TB</th>
<th colspan="2" scope="col">Ticket Classification</th>
<th rowspan="5" scope="col">Diagnosis</th>
<th rowspan="5" scope="col">Prescription</th>
<th rowspan="5" scope="col">Disability (Write code of disability)</th>
<th rowspan="5" scope="col">Ref. In No.</th>
<th rowspan="5" scope="col">Ref. Out No</th>
</tr>
<tr>
<th rowspan="4" scope="col">Fever (Yes/No)</th>
<th rowspan="4" scope="col">Tests Done (B/S. RDT/ND)</th>
<th rowspan="4" scope="col">Results (POS/NEG/N/A)</th>
<th rowspan="1" scope="col">Presumed TB Case <br/>(Y/N)</th>
<th rowspan="5" scope="col">Patient Sent To The Lab For TB testing (Y/N)</th>
<th rowspan="5" scope="col">Lab. TB Result (POS/ NEG/ NA)</th>
<th rowspan="2" scope="col">Linked To TB Clinic (Yes/No)</th>
<th rowspan="5" scope="col">New Attendance</th>
<th rowspan="5" scope="col">Re - Attendance</th>
</tr>
<tr>
<th scope="col">Screened For HIV (Y/N)</th>
{{-- <th scope="col">(Yes/No)</th> --}}
</tr>
<tr>
<th scope="col" rowspan="2">Eligible For HIV Testing (Y/N)</th>
<th scope="col">Where</th>
</tr>
<tr>
{{-- <th></th> --}}
<th scope="col">Unit TB No.</th>
</tr>
</thead>
<tbody>
@if(count($episodes) > 0)
@foreach($episodes as $episode)
@if (!empty($episode->consultation_id) || !empty($episode->triage_id))
<tr>
<td rowspan="4">
{{ sprintf("%04u", $counter) }}
</td>
<td rowspan="4">{{ strtoupper($episode->national_id) }}</td>
<td>{{ ucwords(strtolower($episode->last_name)) }}</td>
<td rowspan="4">
@php
$month2 = date('Y-m', strtotime($episode->created_at));
if (empty($month1) || $month1 === $month2) $counter++;
else $counter = 1;
$dateOfBirth = \Carbon\Carbon::parse($episode->date_of_birth);
$diffInDays = $dateOfBirth->diffInDays(\Carbon\Carbon::now());
if($diffInDays < 30) $age = $diffInDays .' Days';
elseif ($diffInDays > 29 && $diffInDays < 365) $age = $dateOfBirth->diffInMonths(\Carbon\Carbon::now()) .' MTH';
else $age = $dateOfBirth->diffInYears(\Carbon\Carbon::now()) .' Yrs';
echo $age; $month1 = date('Y-m', strtotime($episode->created_at));
@endphp
</td>
<td rowspan="4">
<?php
$gender=$episode->gender;
if ($gender == 1):
echo 'M';
elseif ($gender == 2):
echo 'F';
endif;
?>
</td>
<td rowspan="4">
@php
$triage_symptoms = !empty($episode->symptoms)? explode(',', $episode->symptoms):[];
$consultation_symptoms = !empty($episode->symps)? explode(',', $episode->symps):[];
$rdt = $bs = $tb = $bs_result = $tb_result = [];$inv_result='';
$symptoms = [];
foreach ($triage_symptoms as $triage_symptom) if (!empty($triage_symptom)) $symptoms[] =$triage_symptom;
foreach ($consultation_symptoms as $consultation_symptom) if (!empty($consultation_symptom)) $symptoms[] =$consultation_symptom;
@endphp
@if (array_intersect($symptoms, $fever_symptom_ids))
Y
@else
No
@endif
</td> {{-- Malaria Test ->fever --}}
<td rowspan="4">
@if (!empty($episode->investigation_ids))
@php
$investigation_ids = explode(',', $episode->investigation_ids);
foreach ($investigation_ids as $investigation_id) {
if (in_array($investigation_id, array_keys($investigations))) {
if($investigations[$investigation_id] == 1) array_push($tb, $investigation_id);
elseif($investigations[$investigation_id] == 2) array_push($rdt, $investigation_id);
elseif($investigations[$investigation_id] == 3) array_push($bs, $investigation_id);
$results = Streamline\Models\InvestigationResults::whereRaw('FIND_IN_SET(' . $investigation_id . ',investigation_id)')->where([['episode_id', $episode->id], ['patient_id', $episode->patient_id]])->orderBy('id', 'DESC')->first(['id','investigation_id','value']);
if (!empty($results)) {
$ids = explode(',', $results->investigation_id);
$values = explode(',', $results->value);
$id = array_search($investigation_id, $ids);
$inv_result = strtolower($values[$id]);
}
}
}
@endphp
@endif
@if (!empty($rdt) || !is_null($episode->rdt))
RDT
@elseif(!empty($bs))
B/S
@else
ND
@endif
</td>{{-- Malaria Test ->Tests Done --}}
<td rowspan="4">
@if (!is_null($episode->rdt) || !empty($rdt))
@if (!empty($episode->rdt) || ((!empty($rdt) && !empty($inv_result)) && (preg_match('/pos/i', $inv_result) || $inv_result == '+'|| $inv_result == '++'|| $inv_result == '+++')))
POS
@elseif($episode->rdt == 0 || (!empty($inv_result) && (str_contains($inv_result, 'neg') || $inv_result == '-')))
NEG
@endif
@elseif (!empty($bs) && !empty($inv_result))
{{ $inv_result }}
@else
N/A
@endif
</td>{{-- Malaria Test ->Results --}}
<td>
@if (!empty($episode->tb_status_assessment) && ($episode->tb_status_assessment == '1' || $episode->tb_status_assessment == '2'))
Y
@else
N
@endif
</td>{{-- TB-> Presumed TB Case--}}
<td rowspan="4">
@if (!empty($tb))
Y
@else
N
@endif
</td> {{-- Patient Sent To The Lab For TB testing --}}
<td rowspan="4">
@if (!empty(!empty($tb) && !empty($inv_result)))
{{ $inv_result }}
@else
N/A
@endif
</td>{{-- Lab. TB Result --}}
<td rowspan="2">
{{ (!empty($episode->clinic_id) && in_array($episode->clinic_id, $tb_clinic_ids))? 'Yes':'No' }}
</td>{{-- TB->Linked To TB Clinic --}}
<td rowspan="4">
@if ($episode->new_attendance == 1 || $episode->attendance == 1)
<span class="glyphicon glyphicon-ok"></span>
@else
<span class='glyphicon glyphicon-remove'></span>
@endif
</td>
<td rowspan="4">
@if ($episode->re_attendance == 1 || $episode->attendance == 2)
<span class="glyphicon glyphicon-ok"></span>
@else
<span class='glyphicon glyphicon-remove'></span>
@endif
</td>
@php
$drug_names= $diagnoses = [];
if(!empty($episode->primary_diagnosis)) $diagnoses[] = get_name($episode->primary_diagnosis, 'id', 'name', 'diagnoses');
if(!empty($episode->other_diagnoses)) {
$other_diagnoses = unserialize($episode->other_diagnoses);
foreach ($other_diagnoses as $diagnosis) $diagnoses[] = get_name($diagnosis, 'id', 'name', 'diagnoses');
}
if (!empty($episode->right_eye_diagnosis)) {
$right_eye_diagnoses = explode(',', $episode->right_eye_diagnosis);
foreach ($right_eye_diagnoses as $diagnosis) $diagnoses[] = get_name($diagnosis, 'id', 'name', 'diagnoses');
}
if (!empty($episode->left_eye_diagnosis)) {
$left_eye_diagnoses = explode(',', $episode->left_eye_diagnosis);
foreach ($left_eye_diagnoses as $diagnosis) $diagnoses[] = get_name($diagnosis, 'id', 'name', 'diagnoses');
}
if(!empty($episode->drugs)) {
$drugs =explode(',', $episode->drugs);
$frequencies = explode(',', $episode->frequencies);
$durations = explode(',', $episode->durations);
$dose_explode = explode(",", $episode->doses);
for($i=0; $i < count($drugs); $i++) {
$unit_id = get_name($drugs[$i], 'id', 'unit_id', 'drugs');
$unit_name = get_name($unit_id, 'id', 'name', 'drug_units');
$drug_names[]= ucwords(strtolower(get_name($drugs[$i], 'id' , 'name' , 'drugs'))) .' ( ' . $dose_explode[$i] . $unit_name . ' To be taken '.get_name($frequencies[$i], 'id' , 'name' , 'dosage_frequencies').' for '.$durations[$i] . ')';
}
}
$episode_counter++;
@endphp
<td rowspan="4">
@if (!empty($diagnoses))
{{ ucwords(strtolower(implode(', ', $diagnoses))) }}.
@else
ND
@endif
</td>{{-- Diagnosis --}}
<td rowspan="4">
@if (!empty($drug_names))
{!! implode('<br><br> ', $drug_names) !!}.
@else
N/A
@endif
</td> {{-- Prescription --}}
<td rowspan="4"></td> {{-- Disability (Write code of disability) --}}
<td rowspan="4"></td>{{-- Ref. In No. --}}
<td rowspan="4">
@if (!empty($episode->referred_to))
{{ $episode->number }}
@endif
</td>{{-- Ref. Out No. --}}
</tr>
<tr>
<td class="dashed-td">{{ ucwords(strtolower($episode->first_name)) }}</td>
<td class="dashed-td"></td> {{-- Screened For HIV (Y/N) --}}
{{-- <td class="dashed-td"></td> Linked To TB Clinic ->(Yes/No) --}}
</tr>
<tr>
<td rowspan="2">{{ $episode->phone }}</td>
<td class="dashed-td" rowspan="2"></td> {{-- Eligible For HIV Testing (Y/N) --}}
<td class="dashed-td"></td>{{-- Linked To TB Clinic ->(Where) --}}
</tr>
<tr>
{{-- <td class="dashed-td"></td> TB empty space --}}
<td class="dashed-td"></td>{{-- TB-> Unit TB No. --}}
</tr>
@endif
@endforeach
@if ($episode_counter == 0)
<tr>
<td style="color: maroon; font-weight: bold; text-align: center;" colspan="14">No records available</td>
</tr>
@endif
@else
<tr>
<td style="color: maroon; font-weight: bold; text-align: center;" colspan="14">No records available</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/sheetjs/xlsx.full.min.js') }}"></script>
<script type="text/javascript">
$('#search_date_by').change(function() {
if($(this).val() === "custom_date"){
$("#end_date_div").hide();
$("#start_date_div").show();
} else if($(this).val() === "custom_date_range") {
$("#start_date_div").show();
$("#end_date_div").show();
} else {
$("#end_date_div").hide();
$("#start_date_div").hide();
}
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy',
endDate: new Date(),
orientation: 'bottom'
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy',
endDate: new Date(),
orientation: 'bottom'
});
function export_to_excel(type, fn, dl) {
var elt = document.getElementById('csv');
var wb = XLSX.utils.table_to_book(elt, { sheet: "Outpatient Register Page-2", raw:true });
return dl ?
XLSX.write(wb, { bookType: type, bookSST: true, type: 'binary' }):
XLSX.writeFile(wb, fn || ('{{ __('hmis_reports.hmis_002') }}.' + (type || 'xlsx')));
}
let text = '{{ $search_text }}' +'- No of patients:' + '{{ $episode_counter }}';
$('#text_params').text(text);
</script>
@endpush
@@ -0,0 +1,749 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<style>
.heading {
background-color: rgba(0, 0, 0, 0.075) !important;
font-weight: bold;
pointer-events: none;
text-align: center;
}
.heading2 {
background-color: rgba(0, 0, 0, 0.075) !important;
font-weight: bold;
pointer-events: none;
/* text-align: center; */
}
#test>td {
writing-mode: vertical-lr;
}
.rowspan {
pointer-events: none;
}
</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">{{ __('hmis_reports.hmis_033_report') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list/hmis-reports') }}"> {{ __('hmis_reports.hmis_reports') }}</a></li>
<li><a href="#" class="active">{{ __('hmis_reports.hmis_033_report') }}</a></li>
</ol>
</div>
</div>
@include('flash::message')
<div class="white-box">
<h3 class="heading" style="text-align: center; text-decoration: underline;">{{ __('hmis_reports.hmis_033b_title') }}</h3>
<div class="row col" style="display: inline-table">
{{ Form::open(['url' => Request::url(), 'method' => 'ANY', 'role' => 'search', 'id' => 'search_form']) }}
<div class="input-daterange input-group col-md-6" id="date-range">
<span class="input-group-addon bg-inverse b-0 text-white">{{ __('hmis_reports.from') }}</span>
<input type="text" class="form-control required" name="date_from" id="date-from" value="<?php echo !empty($dates['start'])? date('Y-m-d', strtotime($dates['start'])):''; ?>" readonly required />
<span class="input-group-addon bg-inverse b-0 text-white">{{ __('hmis_reports.to') }}</span>
<input type="text" class="form-control required" name="date_to" id="date-to" value="<?php echo !empty($dates['end'])? date('Y-m-d', strtotime($dates['end'])):''; ?>" readonly required />
</div>
<div class="col-md-2">
<button class="btn btn-success waves-effect waves-light" type="submit" style="border-radius: 5px;" disabled="disabled">
<span class="glyphicon glyphicon-search"></span> {{ __('hmis_reports.search') }}</button>
</div>
{{ Form::close() }}
<div class="col-md-2">
<a href="#" onclick="export_to_excel();" title="Download {{ __('hmis_reports.hmis_033_report') }} CSV"
style="border-radius: 5px;" class="btn btn-inverse waves-effect waves-light">
<span class="glyphicon glyphicon-download"></span> Download CSV
</a>
</div>
{{ Form::open(['method' => 'POST', 'route' => 'print_hmis_033b', 'target' => "_blank"]) }}
<input type="hidden" name="diagnoses_data" id="diagnoses_data" value='{{ serialize($diagnoses_data) }}' />
<input type="hidden" name="other_diagnoses_data" id="other_diagnoses_data" value='{{ serialize($other_diagnoses_data) }}' />
<input type="hidden" name="week_number" id="week_number" value='{{ $week_number }}' />
<input type="hidden" name="start" id="start" value='{{ $start }}' />
<input type="hidden" name="end" id="end" value='{{ $end }}' />
<div class="col-md-2">
<button class="btn btn-inverse waves-effect waves-light float-right" type="submit" style="border-radius: 5px;">
<span class="glyphicon glyphicon-print"></span> {{ __('hmis_reports.print') }}</button>
</div>
{{ Form::close() }}
</div>
<br /><br />
<div class="row col">
<div class="col-md-4">
<table class="table table-condensed table-borderless">
<tr>
<td>{{ __('hmis_reports.health_unit') }} : {{ $hospital_information->name }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.subcounty') }} : {{ get_name($hospital_information->sub_county,'id', 'name', 'subcounties') }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.parish') }} : {{ get_name($hospital_information->parish,'id', 'name', 'parishes') }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.district') }} : {{ get_name($hospital_information->district,'id', 'name', 'districts') }}</td>
</tr>
</table>
</div>
<div class="col-md-4">
<table class="table table-condensed table-borderless">
<tr>
<td>{{ __('hmis_reports.code') }} : {{ $hospital_information->code }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.level') }} : {{ $hospital_information->level }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.health_sub_district') }} : {{ $hospital_information->sub_district }}</td>
</tr>
</table>
</div>
<div class="col-md-4">
<table class="table table-condensed table-borderless">
<tr>
<td>{{ __('hmis_reports.date_of_report') }}: <?php echo streamline_date(date('Y-m-d'));?></td>
</tr>
@if (!empty($week_number))
<tr>
<td>Week Number:&nbsp;{{ $week_number }}</td>
</tr>
@endif
<tr>
<td>From:&nbsp; {{ $start }}</td>
</tr>
<tr>
<td>To:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ $end }}</td>
</tr>
</table>
</div>
</div>
<hr>
<div id="csv">
<div class="row">
<div class="col" id="cases-and-deaths">
<table class="table table-condensed table-bordered table-hover">
<tbody>
<thead>
<tr class="heading">
<td colspan="7">CASES AND DEATHS THIS WEEK</td>
</tr>
<tr class="heading">
<td rowspan="2" colspan="2">1. Cases</td>
<td rowspan="2">Code</td>
<td rowspan="2">Total Cases this week</td>
<td>2. Death</td>
<td rowspan="2">Tested Cases</td>
<td rowspan="2">Pos (+ve) Cases</td>
</tr>
<tr class="heading">
<td>Total Death This Week</td>
</tr>
</thead>
@php
$counter = 0;
@endphp
@foreach ($diagnoses_data as $diagnosis)
<tr>
<td>{{ ++$counter }}.</td>
<td style="width: 40%">{{ $diagnosis['name'] }}</td>
<td>{{ $diagnosis['code'] }}</td>
<td>
@if (!empty($diagnosis['cases']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>$diagnosis['code'].'_cases_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($diagnosis['cases']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $diagnosis['code'].'_cases'}} >{{ commas(count($diagnosis['cases'])) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($diagnosis['deaths']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>$diagnosis['code'].'_deaths_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($diagnosis['deaths']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $diagnosis['code'].'_deaths'}} >{{ commas(count($diagnosis['deaths'])) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>N/A</td>
<td>N/A</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@if (!empty($other_diagnoses_data))
<div class="row">
<div class="col">
<table class="table table-condensed table-bordered table-hover" id="other_diagnoses_data">
<tbody>
<thead>
<tr class="heading">
<td colspan="7">Other conditions</td>
</tr>
<tr class="heading">
<td rowspan="2" colspan="2">Cases (EPC)</td>
<td rowspan="2">Code</td>
<td rowspan="2">Total Cases this week</td>
<td>Death (EPD)</td>
<td rowspan="2">Tested Cases</td>
<td rowspan="2">Pos (+ve) Cases</td>
</tr>
<tr class="heading">
<td>Total Death This Week</td>
</tr>
</thead>
@php
$counter = 0;
@endphp
@foreach ($other_diagnoses_data as $diagnosis)
<tr>
<td>{{ ++$counter }}.</td>
<td style="width: 40%">{{ $diagnosis['name'] }}</td>
<td>{{ $diagnosis['code'] }}</td>
<td>
@if (!empty($diagnosis['cases']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>$diagnosis['code'].'_cases_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($diagnosis['cases']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $diagnosis['code'].'_cases'}} >{{ commas(count($diagnosis['cases'])) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($diagnosis['deaths']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>$diagnosis['code'].'_deaths_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($diagnosis['deaths']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $diagnosis['code'].'_deaths'}} >{{ commas(count($diagnosis['deaths'])) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>N/A</td>
<td>N/A</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endif
<div class="row">
<div class="col">
<table class="table table-condensed table-bordered table-hover">
<tbody>
<tr class="heading">
<td colspan="2">OPD AND EMTCT SUMMARY</td>
</tr>
<tr class="heading">
<td>Metric</td>
<td>APT</td>
</tr>
<tr>
<td>OPD New Attendance</td>
<td>
@if (!empty($new_attendance))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>'new_attendance_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($new_attendance) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ 'new_attendance'}} >{{ commas(count($new_attendance)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
<tr>
<td>Total OPD Attendance</td>
<td>
@if (!empty($all_attendances))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>'all_attendances_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($all_attendances) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ 'all_attendances'}} >{{ commas(count($all_attendances)) }}</a>
{{ Form::close() }}
@else
0
@endif
{{-- {{ count($all_attendances) }} --}}
</td>
</tr>
<tr>
<td>Expected eMTCT Mothers on appt</td>
<td>0</td>
</tr>
<tr>
<td>eMTCT Missed appointments</td>
<td>0</td>
</tr>
<tr class="heading">
<td colspan="2">SUMMARY OF MALARIA CASES TESTED AND TREATED</td>
</tr>
<tr class="heading">
<td style="width:80%">Metric</td>
<td style="width:20%">MAT</td>
</tr>
<tr>
<td>Suspected malaria (fever)</td>
<td>0</td>
</tr>
<tr>
<td>Cases tested with RDT</td>
<td>
@if (!empty($rdt_data['rdt_cases']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>'rdt_cases_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($rdt_data['rdt_cases']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id='rdt_cases' >{{ commas(count($rdt_data['rdt_cases'])) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
<tr>
<td>RDT Positive Cases</td>
<td>
@if (!empty($rdt_data['positive_rdt']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>'positive_rdt_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($rdt_data['positive_rdt']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id='positive_rdt' >{{ commas(count($rdt_data['positive_rdt'])) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
<tr>
<td>Cases tested with Microscopy</td>
<td>0</td>
</tr>
<tr>
<td>Microscopy Positive Cases</td>
<td>0</td>
</tr>
<tr>
<td>Not tested cases treated</td>
<td>0</td>
</tr>
<tr>
<td>RDT Negative Cases Treated</td>
<td>
@if (!empty($rdt_data['negative_rdt_treated']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>'negative_rdt_treated_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($rdt_data['negative_rdt_treated']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id='negative_rdt_treated' >{{ commas(count($rdt_data['negative_rdt_treated'])) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
<tr>
<td>RDT Positive Cases Treated</td>
<td>
@if (!empty($rdt_data['positive_rdt_treated']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>'positive_rdt_treated_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($rdt_data['positive_rdt_treated']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id='positive_rdt_treated' >{{ commas(count($rdt_data['positive_rdt_treated'])) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
<tr>
<td>Microscopy Negative Cases Treated</td>
<td>0</td>
</tr>
<tr>
<td>Microscopy Positive Cases Treated</td>
<td>0</td>
</tr>
<tr class="heading">
<td colspan="2">SUMMARY OF TUBERCULOSIS CASES TESTED AND TREATED DURING THE WEEK</td>
</tr>
<tr class="heading">
<td style="width:80%">Metric</td>
<td style="width:20%">TB</td>
</tr>
<tr><td>Clients screened for TB in OPD</td>
<td>
@if (!empty($tb_data['tb_cases']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>'tb_cases_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($tb_data['tb_cases']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id='tb_cases' >{{ commas(count($tb_data['tb_cases'])) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
<tr><td>Presumptive TB Cases Identified</td>
<td>
@if (!empty($tb_data['tb_presumptive']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>'tb_presumptive_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($tb_data['tb_presumptive']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id='tb_presumptive' >{{ commas(count($tb_data['tb_presumptive'])) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
<tr><td>New and Relapse diagnosed and registered</td>
<td>
@if (!empty($tb_data['def_tb']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>'def_tb_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($tb_data['def_tb']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id='def_tb' >{{ commas(count($tb_data['def_tb'])) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
<tr><td>New and Relapse TB cases started on treatment</td>
<td>
@if (!empty($tb_data['tb_treated']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>'tb_treated_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($tb_data['tb_treated']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id='tb_treated' >{{ commas(count($tb_data['tb_treated'])) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
<tr><td>Bacteriologically TB cases registered</td><td>0</td></tr>
<tr><td>Bacteriologically confirmed TB cases Tested with Genexpert</td><td>0</td></tr>
<tr><td>Number of TB contacts traced and screened</td><td>0</td></tr>
<tr class="heading">
<td colspan="2">TRACER MEDICINES - STOCK BALANCE</td>
</tr>
<tr class="heading">
<td style="width:80%">Metric</td>
<td style="width:20%">TRA</td>
</tr>
<tr><td>ACT (Tablets) </td><td>0</td></tr>
<tr><td>ORS (Sackets)</td><td>0</td></tr>
<tr><td>Measles Vaccine Doses</td><td>0</td></tr>
<tr><td>Amoxicillin Dispersible 250mg Tablets</td><td>0</td></tr>
<tr><td>Depot medroxy progesterone acetate (DMPA) injectable</td><td>0</td></tr>
<tr><td>IV artesunate 60 mg vials</td><td>0</td></tr>
<tr><td>Fansidar Tablets</td><td>0</td></tr>
<tr><td>RDT (Malaria) Tests</td><td>0</td></tr>
<tr class="heading">
<td colspan="2">HIV TESTING KITS, TB, & eMTCT Drugs - STOCK BALANCE</td>
</tr>
<tr class="heading">
<td style="width:80%">Metric</td>
<td style="width:20%">ARV</td>
</tr>
<tr><td>Determine HIV 1 & 2 screening test</td><td>0</td></tr>
<tr><td>ARVs (Fixed DC eMTCT)</td><td>0</td></tr>
<tr><td>Lopinavir / Ritonavir pellets-Pack of 120 capsules</td><td>0</td></tr>
<tr><td>Nevirapine suspension-bottle of 10 Ml/l(100ml)</td><td>0</td></tr>
<tr><td>Tenofovir / Lamivudine / Dolutegravir Packs of 30 tabs</td><td>0</td></tr>
<tr><td>RHZE Blister of 28 tablets</td><td>0</td></tr>
<tr><td>RH Blisters of 28 tablets</td><td>0</td></tr>
<tr><td>R(75) H(50) Z(150) Blisters of 28 tablets</td><td>0</td></tr>
<tr><td>INH 300mg Blisters of 28 tablets</td><td>0</td></tr>
<tr><td>NH 100mg blisters of 10 tablets</td><td>0</td></tr>
<tr class="heading">
<td colspan="2">SUMMARY OF GENEXPERT REPORT FOR GENEXPERT SITES ONLY</td>
</tr>
<tr class="heading">
<td style="width:80%">Metric</td>
<td style="width:20%">GP</td>
</tr>
<tr><td>No of samples tested</td><td>0</td></tr>
<tr><td>No of samples rejected</td><td>0</td></tr>
<tr><td>Total MTB detected</td><td>0</td></tr>
<tr><td>Total No. Rif R</td><td>0</td></tr>
<tr><td>No. of errors/invalid results</td><td>0</td></tr>
<tr><td>No. GeneXpert modules working</td><td>0</td></tr>
<tr><td>No of cartridges remaining</td><td>0</td></tr>
<tr class="heading">
<td colspan="5">SUMMARY OF TPT INITIATION</td>
</tr>
<tr class="heading">
<td style="width:80%">Metric</td>
<td style="width:20%">TPT</td>
</tr>
<tr><td>Number of Adult ART clients initiated TPT</td><td>0</td></tr>
<tr><td>Number of children and adolescents on ART who started TPT</td><td>0</td></tr>
<tr><td>Number of children 0 4 yrs who are contacts of TB patients eligible for TPT</td><td>0</td></tr>
<tr><td>Number of children 0 4 yrs who are contacts of TB patients initiated on TPT</td><td>0</td></tr>
</tbody>
</table>
</div>
</div>
<br>
{{-- <div class="row">
<div class="col">
<table class ='table table-condensed table-bordered table-hover'>
<thead>
<tr class="heading">
<td colspan="11">SUMMARY OF MALARIA CASES TESTED AND TREATED</td>
</tr>
<tr class="heading">
<td style="width:30%"></td>
<td>Suspected malaria (fever)</td>
<td>Cases tested with RDT</td>
<td>RDT Positive Cases</td>
<td>Cases tested with Microscopy</td>
<td>Microscopy Positive Cases</td>
<td>Not tested cases treated</td>
<td>RDT Negative Cases Treated</td>
<td>RDT Positive Cases Treated</td>
<td>Microscopy Negative Cases Treated</td>
<td>Microscopy Positive Cases Treated</td>
</tr>
</thead>
<tbody>
<tr>
<td>MAT</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
</tbody>
</table>
</div>
</div> --}}
{{-- <div class="row">
<div class="col">
<table class="table table-condensed table-bordered table-hover">
<thead>
<tr class="heading">
<td colspan="8">SUMMARY OF TUBERCULOSIS CASES TESTED AND TREATED DURING THE WEEK</td>
</tr>
<tr class="heading">
<td style="width:30%"></td>
<td>Clients screened for TB in OPD</td>
<td>Presumptive TB Cases Identified</td>
<td>New and Relapse diagnosed and registered</td>
<td>New and Relapse TB cases started on treatment</td>
<td>Bacteriologically TB cases registered</td>
<td>Bacteriologically confirmed TB cases Tested with Genexpert</td>
<td>Number of TB contacts traced and screened</td>
</tr>
</thead>
<tbody>
<tr>
<td>TB</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
</tbody>
</table>
</div>
</div> --}}
{{-- <div class="row">
<div class="col">
<table class="table table-condensed table-bordered table-hover">
<thead>
<tr class="heading">
<td colspan="9">TRACER MEDICINES - STOCK BALANCE</td>
</tr>
<tr class="heading">
<td style="width:30%"></td>
<td>ACT (Tablets) </td>
<td>ORS (Sackets)</td>
<td>Measles Vaccine Doses</td>
<td>Amoxicillin Dispersible 250mg Tablets</td>
<td>Depot medroxy progesterone acetate (DMPA) injectable</td>
<td>IV artesunate 60 mg vials</td>
<td>Fansidar Tablets</td>
<td>RDT (Malaria) Tests</td>
</tr>
</thead>
<tbody>
<tr>
<td>TRA</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
</tbody>
</table>
</div>
</div> --}}
{{-- <div class="row">
<div class="col">
<table class="table table-condensed table-bordered table-hover">
<thead>
<tr class="heading">
<td colspan="11">HIV TESTING KITS, TB, & eMTCT Drugs - STOCK BALANCE</td>
</tr>
<tr class="heading">
<td style="width:30%"></td>
<td>Determine HIV 1 & 2 screening test</td>
<td>ARVs (Fixed DC eMTCT)</td>
<td>Lopinavir / Ritonavir pellets-Pack of 120 capsules</td>
<td>Nevirapine suspension-bottle of 10 Ml/l(100ml)</td>
<td>Tenofovir / Lamivudine / Dolutegravir Packs of 30 tabs</td>
<td>RHZE Blister of 28 tablets</td>
<td>RH Blisters of 28 tablets</td>
<td>R(75) H(50) Z(150) Blisters of 28 tablets</td>
<td>INH 300mg Blisters of 28 tablets</td>
<td>NH 100mg blisters of 10 tablets</td>
</tr>
</thead>
<tbody>
<tr>
<td>ARV</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
</tbody>
</table>
</div>
</div> --}}
{{-- <div class="row">
<div class="col">
<table class="table table-condensed table-bordered table-hover">
<thead>
<tr class="heading">
<td colspan="8">SUMMARY OF GENEXPERT REPORT FOR GENEXPERT SITES ONLY</td>
</tr>
<tr class="heading">
<td style="width:30%"></td>
<td>No of samples tested</td>
<td>No of samples rejected</td>
<td>Total MTB detected</td>
<td>Total No. Rif R</td>
<td>No. of errors/invalid results</td>
<td>No. GeneXpert modules working</td>
<td>No of cartridges remaining</td>
</tr>
</thead>
<tbody>
<tr>
<td>GP</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
</tbody>
</table>
</div>
</div> --}}
{{-- <div class="row">
<div class="col">
<table class="table table-condensed table-bordered table-hover">
<thead>
<tr class="heading">
<td colspan="5">SUMMARY OF TPT INITIATION</td>
</tr>
<tr class="heading">
<td style="width:30%"></td>
<td>Number of Adult ART clients initiated TPT</td>
<td>Number of children and adolescents on ART who started TPT</td>
<td>Number of children 0 4 yrs who are contacts of TB patients eligible for TPT</td>
<td>Number of children 0 4 yrs who are contacts of TB patients initiated on TPT</td>
</tr>
</thead>
<tbody>
<tr>
<td>TPT</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
</tbody>
</table>
</div>
</div> --}}
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/sheetjs/xlsx.full.min.js') }}"></script>
<script type="text/javascript">
$('#date-from, #date-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'yyyy-mm-dd',
});
// $('#type').select2({ minimumResultsForSearch: -1});
$('#date-range input').on('change', function() {
let empty = false;
$('#date-range input').each(function() {
empty = $(this).val().length == 0;
});
if (empty) $('.btn-success[type="submit"]').attr('disabled', 'disabled');
else $('.btn-success[type="submit"]').attr('disabled', false);
});
$('#type').change(function(){
$('#search_form').submit();
});
function drill_down(data) {
var id = data.getAttribute('data-id');
$("#"+id+"_drill").submit();
}
function export_to_excel(type, fn, dl) {
var elt = document.getElementById('csv');
var wb = XLSX.utils.table_to_book(elt, { sheet: "{{ __('hmis_reports.hmis_033_report') }}", raw:true });
return dl ?
XLSX.write(wb, { bookType: type, bookSST: true, type: 'binary' }):
XLSX.writeFile(wb, fn || ('{{ __('hmis_reports.hmis_033_report') }}.' + (type || 'xlsx')));
}
</script>
@endpush
@@ -0,0 +1,211 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" sizes="16x16"
href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
<title>{{ config('app.name', 'Streamline') }}</title>
<!-- Bootstrap Core CSS -->
<link href="{{ asset('elite/bootstrap/dist/css/bootstrap.min.css') }}" rel="stylesheet">
<!-- Custom CSS -->
<link href="{{ asset('elite/css/style.css') }}" rel="stylesheet">
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
font-size: 14px;
/* line-height: 1.2; */
}
thead {
display: table-header-group;
}
tfoot {
display: table-row-group;
}
strong {
font-weight: bold;
}
tr {
page-break-before: always;
page-break-after: always;
page-break-inside: avoid;
}
.heading {
background-color: rgba(0, 0, 0, 0.075) !important;
font-weight: bold;
}
#test>td {
writing-mode: vertical-lr;
}
</style>
</head>
<body>
<div class="white-box">
@php
$hospital_information = \Streamline\Models\HospitalInformation::find(1);
@endphp
@if(is_null($hospital_information->pdf_print_header))
<img style="max-width: 300px; max-height: 100px;" src="{{ asset($hospital_information->logo) }}" class="mx-auto d-block mx-3" alt="Responsive image">
<p class="h6 text-center mt-0 font-weight-bold">
{{ $hospital_information->name . ' | ' . $hospital_information->phone_number . ' | ' .
$hospital_information->email . ' | ' . $hospital_information->address . ' ' .
$hospital_information->country }}
</p>
@else
<img style="max-height: 150px;" src="{{ asset($hospital_information->pdf_print_header) }}" class="mx-auto d-block mx-3" alt="Responsive image">
@endif
<div class="text-center">
<p><h3><strong>{{ __('hmis_reports.hmis_033b_title') }}</strong></h3></p>
</div>
<div class="row col">
<table class="table table-condensed table-borderless">
<tr>
<td><strong>{{ __('hmis_reports.date_of_report') }}:</strong> <?php echo streamline_date(date('Y-m-d'));?></td>
@if (!empty($week_number))
<td><strong>Week Number:</strong>&nbsp;{{ $week_number }}</td>
@endif
<td><strong>From:</strong>&nbsp; {{ $start }}</td>
<td><strong>To:</strong>&nbsp; {{ $end }}</td>
</tr>
</table>
</div>
<div class="row">
<div class="col">
<table class="table table-condensed table-bordered table-hover" id="cases-and-deaths">
<tbody>
<thead>
<tr class="heading">
<td colspan="7">CASES AND DEATHS THIS WEEK</td>
</tr>
<tr class="heading">
<td rowspan="2" colspan="2">1. Cases</td>
<td rowspan="2">Code</td>
<td rowspan="2">Total Cases this week</td>
<td>2. Death</td>
<td rowspan="2">Tested Cases</td>
<td rowspan="2">Pos (+ve) Cases</td>
</tr>
<tr class="heading">
<td>Total Death This Week</td>
</tr>
</thead>
@php
$counter = 0;
@endphp
@foreach ($diagnoses_data as $diagnosis)
<tr>
<td>{{ ++$counter }}.</td>
<td style="width: 30%">{{ $diagnosis['name'] }}</td>
<td>{{ $diagnosis['code'] }}</td>
<td>
@if (!empty($diagnosis['cases']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>$diagnosis['code'].'_cases_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($diagnosis['cases']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $diagnosis['code'].'_cases'}} >{{ commas(count($diagnosis['cases'])) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($diagnosis['deaths']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>$diagnosis['code'].'_deaths_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($diagnosis['deaths']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $diagnosis['code'].'_deaths'}} >{{ commas(count($diagnosis['deaths'])) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>0</td>
<td>0</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@if (!empty($other_diagnoses_data))
<div class="row">
<div class="col">
<table class="table table-condensed table-bordered table-hover" id="cases-and-deaths">
<tbody>
<thead>
<tr class="heading">
<td colspan="7">Other conditions</td>
</tr>
<tr class="heading">
<td rowspan="2" colspan="2">Cases (EPC)</td>
<td rowspan="2">Code</td>
<td rowspan="2">Total Cases this week</td>
<td>Death (EPD)</td>
<td rowspan="2">Tested Cases</td>
<td rowspan="2">Pos (+ve) Cases</td>
</tr>
<tr class="heading">
<td>Total Death This Week</td>
</tr>
</thead>
@php
$counter = 0;
@endphp
@foreach ($other_diagnoses_data as $diagnosis)
<tr>
<td>{{ ++$counter }}.</td>
<td style="width: 30%">{{ $diagnosis['name'] }}</td>
<td>{{ $diagnosis['code'] }}</td>
<td>
@if (!empty($diagnosis['cases']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>$diagnosis['code'].'_cases_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($diagnosis['cases']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $diagnosis['code'].'_cases'}} >{{ commas(count($diagnosis['cases'])) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($diagnosis['deaths']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>$diagnosis['code'].'_deaths_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($diagnosis['deaths']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $diagnosis['code'].'_deaths'}} >{{ commas(count($diagnosis['deaths'])) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>0</td>
<td>0</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endif
</div>
<!-- /#wrapper -->
<!-- jQuery -->
<script src="{{ asset('elite/bower_components/jquery/dist/jquery.min.js') }}"></script>
<!-- Bootstrap Core JavaScript -->
<script src="{{ asset('elite/bootstrap/dist/js/tether.min.js') }}"></script>
<script src="{{ asset('elite/bootstrap/dist/js/bootstrap.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/sidebar-nav/src/metisMenu.js') }}"></script>
<!--slimscroll JavaScript -->
<script src="{{ asset('elite/js/jquery.slimscroll.js') }}"></script>
<!-- Custom Theme JavaScript -->
<script src="{{ asset('elite/js/custom.min.js') }}"></script>
</body>
</html>
@@ -0,0 +1,437 @@
<div class="col">
<table class="table table-sm table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th colspan="8"><strong>2.7 CHILD HEALTH SERVICES</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2"></td>
<td colspan="2"><strong>6 11 Months</strong></td>
<td colspan="2"><strong>12 59 Months</strong></td>
<td colspan="2"><strong>5 14 Years</strong></td>
</tr>
<tr>
<td colspan="2"></td>
<td><strong>Male</strong></td>
<td><strong>Female</strong></td>
<td><strong>Male</strong></td>
<td><strong>Female</strong></td>
<td><strong>Male</strong></td>
<td><strong>Female</strong></td>
</tr>
<tr>
<td rowspan="3">CH01- Vit A supplement (1st dose)</td>
<td>Static</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Outreach</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>In school</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td rowspan="3">CH02- Vit A supplement (2nd dose)</td>
<td>Static</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Outreach</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>In school</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td rowspan="3">CH03- Dewormed (1st dose)</td>
<td>Static</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Outreach</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>In school</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td rowspan="3">CH04- Dewormed (2nd dose)</td>
<td>Static</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Outreach</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>In school</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th colspan="5"><strong>2.7.1 HPV VACCINATION</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td style="background-color: #e8e4e4"><strong>Vaccination of only 10 years OLD girls</strong></td>
<td><strong>Facility(F)</strong></td>
<td><strong>School(S)</strong></td>
<td colspan="2"><strong>Community(C)</strong></td>
</tr>
<tr>
<td>VP01. HPV1-Dose 1</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>VP02.HPV2-Dose 2</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th colspan="6"><strong>2.7.2 TETANUS VACCINATION (Td VACCINE)</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" style="background-color: #e8e4e4"><strong>Doses</strong></td>
<td colspan="2"><strong>Pregnant women</strong></td>
<td colspan="3"><strong>Non-pregnant women</strong></td>
</tr>
<tr>
<td><strong>Static</strong></td>
<td><strong>Outreach</strong></td>
<td><strong>Static</strong></td>
<td><strong>Outreach</strong></td>
<td><strong>Immunization In School</strong></td>
</tr>
<tr>
<td>TD01. Td1-Dose 1</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>TD02. Td2-Dose 2</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>TD03. Td3-Dose 3</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>TD04. Td4-Dose 4</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>TD05. Td5-Dose 5</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th colspan="7"><strong>2.7.3 CHILD IMMUNISATION</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2" style="background-color: #e8e4e4"><strong>Doses</strong></td>
<td colspan="2"><strong>Under 1</strong></td>
<td colspan="2"><strong>1-4 Years</strong></td>
<td colspan="2"><strong>5 14 Years</strong></td>
</tr>
<tr>
<td><strong>Static</strong></td>
<td><strong>Outreach</strong></td>
<td><strong>Static</strong></td>
<td><strong>Outreach</strong></td>
<td><strong>Static</strong></td>
<td><strong>Outreach</strong></td>
</tr>
<tr>
<td>CL01. BCG</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>CL02. Protection At Birth for Td(PAB)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>CL03. Polio 0</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>CL04. Polio 1</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>CL05. Polio 2</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>CL06. Polio 3</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>CL07. IPV</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>CL08. DPT-HepB+Hib 1</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>CL09. DPT-HepB+Hib 2</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>CL10. DPT-HepB+Hib 3</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>CL11. PCV 1</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>CL12. PCV 2</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>CL13. PCV 3</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>CL14. Rotavirus 1 Vaccine</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>CL15. Rotavirus 2 Vaccine</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>CL16. Measles (MR1)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>CL17. Measles 2 (MR2)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>CL18. Fully immunized by 1 year</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>CL19. Number received LLIN</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th colspan="6"><strong>2.7.4 VACCINE AVAILABILITY AND WASTAGE</strong></th>
</tr>
</thead>
<tbody>
<tr>
</tr>
</tbody>
</table>
</div>
@@ -0,0 +1,282 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<style>
#test>td {
writing-mode: vertical-lr;
}
.heading {
background-color: rgba(0, 0, 0, 0.075) !important;
font-weight: bold;
pointer-events: none;
text-align: center;
}
.heading2 {
background-color: rgba(0, 0, 0, 0.075) !important;
font-weight: bold;
pointer-events: none;
/* text-align: center; */
}
.rowspan {
pointer-events: none;
}
</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">{{ __('hmis_reports.hmis_105_report') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list/hmis-reports') }}">{{ __('hmis_reports.hmis_reports') }}</a></li>
<li class="active">105
@if (!empty($page))
- {{ __('hmis_reports.outpatient_diagnoses') }}
@endif
</li>
</ol>
</div>
</div>
<div class="row">
<div class="col">
<div class="float-right" style="display: inline-flex">
@if (!empty($page))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_105.print_Hmis_105_information', 'target' => "_blank"]) }}
@if ($page == 'Outpatient Diagnoses')
<input type="hidden" name="table_options" id="table_options" value='{{ serialize($table_options) }}' />
<input type="hidden" name="diagnoses_data" id="diagnoses_data" value='{{ serialize($diagnoses_data) }}' />
<input type="hidden" name="ordered_investigation_results" id="ordered_investigation_results" value='{{ serialize($ordered_investigation_results) }}' />
<input type="hidden" name="ordered_investigations" id="ordered_investigations" value='{{ serialize($ordered_investigations) }}' />
<input type="hidden" name="prescribed_treatments" id="prescribed_treatments" value='{{ serialize($prescribed_treatments) }}' />
@endif
<input type="hidden" name="dates" id="dates" value='{{ serialize($dates) }}' />
<input type="hidden" name="page" id="page" value='{{ $page }}' />
<div class="col-md-2">
<button class="btn btn-success waves-effect waves-light" type="submit" style="border-radius: 5px;"><span class="glyphicon glyphicon-print"></span> {{ __('hmis_reports.print') }}</button>
</div>
{{ Form::close() }}
@else
<a class="btn btn-inverse" style="background-color: #03C03C; color: white; border-radius: 5px;" href="/hmis/105/print/{{$attendance_from}}/{{$attendance_to}}" target="_blank"><i class="fa fa-print"></i> {{ __('hmis_reports.print') }}</a>
@endif
<a href="#" onclick="export_to_excel();" style="border-radius: 5px;" title="Download {{ __('hmis_reports.hmis_105_report') }} CSV" class="btn btn-inverse waves-effect waves-light"><span class="glyphicon glyphicon-download"></span> Download CSV</a>
</div>
</div>
</div><br>
<div class="white-box">
<form action="{{ Request::url() }}" method="post" autocomplete="OFF" class="form-vertical" id="search_form">
<div class="row">
<div class="col-md-1"></div>
<div class="col-md-7">
@csrf()
<div class="input-daterange input-group" id="date-range">
<span class="input-group-addon bg-inverse b-0 text-white">{{ __('hmis_reports.from') }}</span>
<input type="text" class="form-control" name="date_from" id="date-from" value="<?php echo !empty($dates['start'])? $dates['start']:''; ?>" readonly required />
<span class="input-group-addon bg-inverse b-0 text-white">{{ __('hmis_reports.to') }}</span>
<input type="text" class="form-control" name="date_to" id="date-to" value="<?php echo !empty($dates['end'])? $dates['end']:''; ?>" readonly required />
<span class="input-group-addon bg-inverse b-0 text-white">{{ __('hmis_reports.report_type') }}</span>
<select class="form-control required" id="type" name="type" required>
<option value="" disabled>{{ __('hmis_reports.select_report_type') }}</option>
<option value="1" <?php echo (!empty($dates['citizenship']) && $dates['citizenship'] == '1')? 'selected':''; ?>>National</option>
<option value="" disabled>Refugee</option>
<option value="0" <?php echo (!empty($dates['citizenship']) && $dates['citizenship'] == '0')? 'selected':''; ?>>Foreigner / Non Ugandan</option>
</select>
</div>
</div>
<div class="col-md-1">
<button class="btn btn-block btn-success mt-1" name="searchButton" style="margin-top: 15px;">{{ __('hmis_reports.search') }}</button>
</div>
<div class="col-md-2"></div>
<div class="col-md-1">
<?php if ($printing): ?>
<a target="_blank" class="btn btn-primary" href='{{ url("/hmis/105/print/{$dateRange}") }}'> <i class="fa fa-print"></i> <span>{{ __('hmis_reports.print') }}</span></a>
<?php endif; ?>
</div>
</div>
</form>
<hr>
@include('flash::message')
<h3 class="heading" style="text-align: center;">{{ __('hmis_reports.hmis_105') }}</h3>
<div class="row" id="hospital_info">
<div class="col">
<table class="table table-sm table-borderless">
<tr>
<th>{{ __('hmis_reports.health_unit') }}</th>
<td>{{ $hospital_information->name }}</td>
</tr>
<tr>
<th>{{ __('hmis_reports.district') }}</th>
<td>{{ get_name($hospital_information->district, 'id','name','districts') }}</td>
</tr>
<tr>
<th>{{ __('hmis_reports.subcounty') }}</th>
<td>{{ get_name($hospital_information->sub_county,'id','name','subcounties') }}</td>
</tr>
<tr>
<th>{{ __('hmis_reports.code') }}</th>
<td>{{ $hospital_information->code }}</td>
</tr>
</table>
</div>
<div class="col">
<table class="table table-sm table-borderless">
<tr>
<th>{{ __('hmis_reports.level') }}</th>
<td>{{ $hospital_information->level }}</td>
</tr>
<tr>
<th>{{ __('hmis_reports.health_sub_district') }}</th>
<td>{{ $hospital_information->sub_district }}</td>
</tr>
<tr>
<th>{{ __('hmis_reports.reporting_period') }}</th>
<td>
<code>{{ streamline_date($attendance_from) }}</code> {{ __('hmis_reports.to') }} <code>{{ streamline_date($attendance_to) }}</code>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="white-box" id="table">
@if (!empty($page))
<div class="row" id="diagnoses">
{{-- <h5 align="left">1.3 {{ __('hmis_reports.outpatient_diagnoses') }}</h5> --}}
{{-- @include('reports::hmis_reports.105.opd_diagnoses') --}}
@include('reports::hmis_reports.105.monthly_diagnoses')
</div>
@else
<div class="row" id="new_re_attendance">
<div class="col">
<h5 align="left">1.1 {{ __('hmis_reports.outpatient_attendance') }}</h5>
@include('reports::hmis_reports.105.opd_attendance')
</div>
<div class="col">
<h5 align="left">1.2 {{ __('hmis_reports.outpatient_referrals') }}</h5>
@include('reports::hmis_reports.105.opd_referrals')
</div>
</div>
<div class="row" id="tb_leprosy">
@include('reports::hmis_reports.105.tuberclosis_and_leprosy_services')
</div>
<div class="row" id="nutrition">
@include('reports::hmis_reports.105.nutrition_services')
</div>
<div class="row">
<div class="col-md-12">
<h5 align="left">2.0 {{ __('hmis_reports.maternal_and_child_health_services') }}</h5>
</div>
</div>
<div class="row" id="ant_natal">
@include('reports::hmis_reports.105.maternal_and_child_health_services')
</div>
<div class="row" id="maternity">
@include('reports::hmis_reports.105.maternity')
</div>
<div class="row" id="post_natal">
@include('reports::hmis_reports.105.post_natal')
</div>
<div class="row" id="exposed_infants_and_family_planning">
@include('reports::hmis_reports.105.exposed_infants_and_family_planning')
</div>
<div class="row" id="child_health_services_and_vaccination">
@include('reports::hmis_reports.105.child_health_services_and_vaccination')
</div>
<div class="row" id="lab_routine_tests">
@include('reports::hmis_reports.105.lab-routine-tests')
</div>
@endif
</div>
@endsection
@push('scripts')
<!-- Typehead Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
<!-- Typehead Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/sheetjs/xlsx.full.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/sheetjs/FileSaver.min.js') }}"></script>
<script type="text/javascript">
jQuery('#date-from, #date-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy',
});
function export_to_excel1(type, fn, dl) {
var elt = document.getElementById('table');
var wb = XLSX.utils.table_to_book(elt, { sheet: "Book 1", raw:true });
return dl ?
XLSX.write(wb, { bookType: type, bookSST: true, type: 'binary' }):
XLSX.writeFile(wb, fn || ('{{ __('hmis_reports.hmis_105_report') }}.' + (type || 'xlsx')));
}
function export_to_excel() {
var row_ids = ['hospital_info','new_re_attendance','diagnoses','ant_natal','maternity','post_natal','exposed_infants_and_family_planning','child_health_services_and_vaccination','lab_routine_tests'];
var sheet_names = ['Hospital Information', 'New and Re attendances', 'Diagnoses', 'Antenatal Care','Maternity', 'Postnatal Care', 'Family Planning', 'Child health and Vaccination', 'Routine Lab Tests'];
var sheet_data =[];
for (let i = 0; i < row_ids.length; i++) {
sheet_data.push(XLSX.utils.table_to_sheet(document.getElementById(row_ids[i])));
}
/* create a new blank workbook */
var wb = XLSX.utils.book_new();
for (let index = 0; index < sheet_data.length; index++) {
XLSX.utils.book_append_sheet(wb, sheet_data[index], sheet_names[index]);
}
var wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'binary' });
saveAs(new Blob([s2ab(wbout)], { type: "application/octet-stream" }), '{{ __('hmis_reports.hmis_105_report') }}.xlsx');
}
function s2ab(s) {
var buf = new ArrayBuffer(s.length);
var view = new Uint8Array(buf);
for (var i = 0; i < s.length; i++) view[i] = s.charCodeAt(i) & 0xFF;
return buf;
}
$('#type').change(function(){
$('#search_form').submit();
});
function drill_down(data) {
var id = data.getAttribute('data-id');
$("#"+id+"_drill").submit();
}
</script>
@endpush
@@ -0,0 +1,176 @@
<div class="row">
<div class="col-md-12">
<h5 align="left">10.2 LABORATORY ROUTINE TESTS</h5>
</div>
</div>
<div class="row">
<div class="col-12">
<table class="table table-bordered" >
<thead>
<tr style="background-color: #e8e4e4">
<th colspan="7">10.2.1 Number of Routine Tests Done in Facility Laboratory</th>
</tr>
</thead>
</table>
</div>
</div>
<div class="row">
<div class="col-6">
<table class="table table-sm table-bordered table-hover" >
<thead class="thead-light">
<tr style="background-color: #e8e4e4">
<th class="center" width="55%">Lab Test</th>
<th class="center">Number Done</th>
<th class="center">Number Positive</th>
</tr>
</thead>
<tbody>
<?php
$invCategories = DB::table('hmis_categories')->get();
foreach ($invCategories AS $invCategory):
if ($invCategory->id > 7):
continue;
endif;
?>
<tr>
<td style="text-transform: uppercase; background-color: #e8e4e4;" colspan="3"><?php echo $invCategory->title; ?></td>
</tr>
<?php
$investigations = DB::table('investigations')
->where('hmis_category', $invCategory->id)
->select('id', 'name', 'hmis_no_outpatient')
->orderBy('hmis_no_outpatient')->get();
foreach ($investigations as $investigation):
// Get the number of done tests
$investigation_results = DB::table('investigation_results')
->whereRaw("CONCAT(',', investigation_id, ',') LIKE '%,{$investigation->id},%'")
->whereBetween('created_at', [$attendance_from, $attendance_to])
->select('investigation_id', 'value');
?>
<tr>
<td><?php echo $investigation->hmis_no_outpatient . '. ' . $investigation->name; ?></td>
<td><?php echo $investigation_results->count(); ?></td>
<td>
<?php
$countPositive = 0;
foreach ($investigation_results->get() as $result):
$ids = explode(',', $result->investigation_id);
$findings = explode(',', $result->value);
$countPositive = 0;
foreach ($ids as $key => $id):
if ($id == $investigation->id): // Only this lab ID
$value = strtolower($findings[$key]);
if (
strpos($value, 'positive') !== false || strpos($value, '+') !== false ||
strpos($value, 'seen') != false
):
$countPositive++;
endif;
break;
endif;
endforeach;
endforeach;
echo $countPositive;
?>
</td>
</tr>
<?php
endforeach;
endforeach;
?>
</tbody>
</table>
</div>
<div class="col-6">
<table class="table table-sm table-bordered" >
<thead class="thead-light">
<tr style="background-color: #e8e4e4">
<th class="center" width="55%">Lab Test</th>
<th class="center">Number Done</th>
<th class="center">Number Positive</th>
</tr>
</thead>
<tbody>
<?php
foreach ($invCategories AS $invCategory):
if ($invCategory->id < 8):
continue;
endif;
?>
<tr>
<td style="background-color: #e8e4e4;" colspan="3"><?php echo $invCategory->title; ?></td>
</tr>
<?php
$investigations = DB::table('investigations')
->where('hmis_category', $invCategory->id)
->select('id', 'name', 'hmis_no_outpatient')
->orderBy('hmis_no_outpatient')->get();
foreach ($investigations as $investigation):
// Get the number of done tests
$investigation_results = DB::table('investigation_results')
->whereRaw("CONCAT(',', investigation_id, ',') LIKE '%,{$investigation->id},%'")
->whereBetween('created_at', [$attendance_from, $attendance_to])
->select('investigation_id', 'value');
?>
<tr>
<td><?php echo $investigation->hmis_no_outpatient . '. ' . $investigation->name; ?></td>
<td><?php echo $investigation_results->count(); ?></td>
<td>
<?php
$countPositive = 0;
foreach ($investigation_results->get() as $result):
$ids = explode(',', $result->investigation_id);
$findings = explode(',', $result->value);
$countPositive = 0;
foreach ($ids as $key => $id):
if ($id == $investigation->id): // Only this lab ID
$value = strtolower($findings[$key]);
if (
strpos($value, 'positive') !== false || strpos($value, '+') !== false ||
strpos($value, 'seen') != false
):
$countPositive++;
endif;
break;
endif;
endforeach;
endforeach;
echo $countPositive;
?>
</td>
</tr>
<?php
endforeach;
endforeach;
?>
</tbody>
</table>
</div>
</div>
@@ -0,0 +1,632 @@
<?php
$delivery_records_for_below_15_years = [];
$delivery_records_for_between_15_to_19_years = [];
$delivery_records_for_between_20_to_24_years = [];
$delivery_records_for_between_25_to_49_years = [];
$delivery_records_for_above_50_years = [];
$referrals_to_maternity = 0;
$referrals_out_of_maternity = 0;
$alive_condition_babies_array = [];
$fresh_sb_condition_babies_array = [];
$macerated_sb_condition_babies_array = [];
$alive_condition_babies_under_2_point_5_array = [];
$fresh_sb_condition_babies_under_2_point_5_array = [];
$macerated_sb_condition_babies_under_2_point_5_array = [];
$maternity_ward_ids_array = [];
$wards = \Streamline\Models\Ward::where('slug', 'maternity')->get();
foreach ($wards as $ward) {
$maternity_ward_ids_array[] = $ward->id;
}
$maternity_ward_admissions = DB::table('inpatient_info')->whereIn('ward_id', $maternity_ward_ids_array)->whereBetween('created_at', [$attendance_from, $attendance_to])->get();
if (!empty($attendance_from) && !empty($attendance_to)){
$maternity_admissions_records = DB::table('maternity_inpatients')
->join('patients', 'maternity_inpatients.patient_id', '=', 'patients.id')
->whereBetween('maternity_inpatients.created_at', [$attendance_from, $attendance_to])
->select('patients.id as patient_id', 'patients.gender',
'patients.date_of_birth', 'maternity_inpatients.*')->get();
//dd($maternity_inpatients);
foreach ($maternity_admissions_records as $maternity_admission) {
$dateOfBirth = \Carbon\Carbon::parse($maternity_admission->date_of_birth);
$diffYears = \Carbon\Carbon::now()->diffInYears($dateOfBirth);
$patientId = $maternity_admission->patient_id;
$gender = $maternity_admission->gender;
if ($maternity_admission->referral_from != 1 && !is_null($maternity_admission->referral_from)){ // make sure its not a self referral
$referrals_to_maternity++;
}
$inpatient_details = DB::table('inpatient_info')->where(['episode_id' => $maternity_admission->episode_id, 'patient_id' => $maternity_admission->patient_id])->first();
if ($inpatient_details) {
if ($inpatient_details->outcome_id == 4) { // outcome id for referred
$referrals_out_of_maternity++;
}
}
}
$delivery_records = DB::table('maternity_delivery_records')
->join('patients', 'maternity_delivery_records.patient_id', '=', 'patients.id')
->whereBetween('maternity_delivery_records.created_at', [$attendance_from, $attendance_to])
->select('patients.id as patient_id', 'patients.gender',
'patients.date_of_birth as mother_date_of_birth', 'maternity_delivery_records.*')->get();
foreach ($delivery_records as $delivery) {
$dateOfBirth = \Carbon\Carbon::parse($delivery->mother_date_of_birth);
$diffYears = \Carbon\Carbon::now()->diffInYears($dateOfBirth);
$patientId = $delivery->patient_id;
$gender = $delivery->gender;
$baby_condition_array = explode(",", $delivery->baby_condition);
$babies_delivered_weights_array = explode(",", $delivery->weight);
//dd($babies_delivered_weights_array);
for ($i=0; $i < $delivery->foetal_number ; $i++) {
if ($baby_condition_array[$i] == 1) { //alive
$alive_condition_babies_array[] = $delivery->patient_id;
if ($babies_delivered_weights_array[$i] < 2.5) {
$alive_condition_babies_under_2_point_5_array[] = $delivery->patient_id;
}
}
if ($baby_condition_array[$i] == 2) { //fresh SB
$fresh_sb_condition_babies_array[] = $delivery->patient_id;
if ($babies_delivered_weights_array[$i] < 2.5) {
$fresh_sb_condition_babies_under_2_point_5_array[] = $delivery->patient_id;
}
}
if ($baby_condition_array[$i] == 3) { //macerated SB
$macerated_sb_condition_babies_array[] = $delivery->patient_id;
if ($babies_delivered_weights_array[$i] < 2.5) {
$macerated_sb_condition_babies_under_2_point_5_array[] = $delivery->patient_id;
}
}
}
if ($diffYears < 15): #below 15 years
$delivery_records_for_below_15_years[] = $delivery->patient_id;
endif;
if ($diffYears >= 15 && $diffYears <= 19):
$delivery_records_for_between_15_to_19_years[] = $delivery->patient_id;
endif;
if ($diffYears >= 20 && $diffYears <= 24):
$delivery_records_for_between_20_to_24_years[] = $delivery->patient_id;
endif;
if ($diffYears >= 25 && $diffYears <= 49):
$delivery_records_for_between_25_to_49_years[] = $delivery->patient_id;
endif;
if ($diffYears > 50):
$delivery_records_for_above_50_years[] = $delivery->patient_id;
endif;
}
}
?>
<div class="col">
<table class="table table-sm table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th colspan="2"><strong>2.2 MATERNITY</strong></th>
<th><strong>NUMBER</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2">
MA01: Admissions
</td>
<td><a href="">{{ count($maternity_ward_admissions) }}</a></td>
</tr>
<tr>
<td>
MA02: Referrals to maternity unit
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Total</td>
<td><a href="#">{{ $referrals_to_maternity }}</a></td>
</tr>
<tr>
<td>From community services</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td colspan="2">
MA03: Maternity referrals out
</td>
<td><a href="">{{ $referrals_out_of_maternity }}</a></td>
</tr>
<tr>
<td>
MA04: Deliveries in unit
</td>
<td colspan="2" style="width: 50%">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td rowspan="5">MA04a. Total</td>
<td>Below 15 years</td>
<td><a href="#">{{ count($delivery_records_for_below_15_years) }}</a></td>
</tr>
<tr>
<td>15-19 years</td>
<td><a href="#">{{ count($delivery_records_for_between_15_to_19_years) }}</a></td>
</tr>
<tr>
<td>20-24 years</td>
<td><a href="#">{{ count($delivery_records_for_between_20_to_24_years) }}</a></td>
</tr>
<tr>
<td>25-49 years</td>
<td><a href="#">{{ count($delivery_records_for_between_25_to_49_years) }}</a></td>
</tr>
<tr>
<td>50+ years</td>
<td><a href="#">{{ count($delivery_records_for_above_50_years) }}</a></td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td rowspan="2">MA04b. Live births</td>
<td>Total</td>
<td><a href="#">{{ count($alive_condition_babies_array) }}</a></td>
</tr>
<tr>
<td>< 2.5 Kg</td>
<td><a href="#">{{ count($alive_condition_babies_under_2_point_5_array) }}</a></td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td rowspan="2">MA04c. Fresh still Total birth</td>
<td>Total</td>
<td><a href="#">{{ count($fresh_sb_condition_babies_array) }}</a></td>
</tr>
<tr>
<td>< 2.5 Kg</td>
<td><a href="#">{{ count($fresh_sb_condition_babies_under_2_point_5_array) }}</a></td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td rowspan="2">MA04d. Macerated still birth</td>
<td>Total</td>
<td><a href="#">{{ count($macerated_sb_condition_babies_array) }}</a></td>
</tr>
<tr>
<td>< 2.5 Kg</td>
<td><a href="#">{{ count($macerated_sb_condition_babies_under_2_point_5_array) }}</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
MA05. Pre-Term births
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Total</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>Alive</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>< 2.5 Kg</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
MA06. Born Before Arrival
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Total</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>Alive</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>< 2.5 Kg</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td colspan="2">
MA07. No. of low birth weight babies (<2.5 Kg) initiated on kangaroo (KMC)
</td>
<td><a href="">0</a></td>
</tr>
<tr>
<td colspan="2">
MA08. Live babies at discharge
</td>
<td><a href="">0</a></td>
</tr>
<tr>
<td colspan="2">
MA09. No. of Babies born with defect
</td>
<td><a href="">0</a></td>
</tr>
<tr>
<td colspan="2">
MA10. No. of Babies received LLIN
</td>
<td><a href="">0</a></td>
</tr>
<tr>
<td colspan="2">
MA11. Newborn deaths (0-7 days)
</td>
<td><a href="">0</a></td>
</tr>
<tr>
<td colspan="2">
MA12. Neonatal Death 8-28 days
</td>
<td><a href="">0</a></td>
</tr>
<tr>
<td>
MA13. Maternal deaths
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Below 15 years</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>15-19 years</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>20-24 years</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>25-49 years</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>50+ years</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col">
<table class="table table-sm table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th colspan="2"><strong>2.2 MATERNITY</strong></th>
<th><strong>NUMBER</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>
MA14. No. of mothers who initiated breastfeeding within the 1st hour after delivery
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Total</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>No. HIV +</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
MA15. Women tested for HIV in labour 1st time this Pregnancy
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Total (TR & TRR)</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>HIV+ (TRR)</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
MA16. Women re-tested for HIV in labour
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Total (TR+ & TRR+)</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>HIV+ (TRR+)</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td colspan="2">
MA17. HIV+ women initiating ART in maternity
</td>
<td><a href="">0</a></td>
</tr>
<tr>
<td>
MA18. Male partners received HIV test results in the maternity setting
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Total (TR+ & TRR+)</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>HIV+ (TRR+)</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td colspan="2">
MA19. HIV+ male partners initiated on ART in the maternity setting
</td>
<td><a href="">0</a></td>
</tr>
<tr>
<td colspan="2">
MA20. Number of discordant couples identified in maternity
</td>
<td><a href="">0</a></td>
</tr>
<tr>
<td>
MA21. Mothers Received nutrition Counselling
</td>
<td colspan="2" style="width: 50%">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td rowspan="2">Maternal Nutritional</td>
<td>Total</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>HIV+</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td rowspan="2">Infant Feeding</td>
<td>Total</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>HIV+</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
MA22. Deliveries to HIV+ women in unit
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Total</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>Live Birth</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
MA23. HIV Exposed infants given ARVs
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Total number</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>Number of high-risk infants 12 weeks</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td colspan="2">
MA24. No. of babies with Birth asphyxia
</td>
<td><a href="">0</a></td>
</tr>
<tr>
<td colspan="2">
MA25: No. of Live babies Successfully Resuscitated
</td>
<td><a href="">0</a></td>
</tr>
<tr>
<td>
MA26. Number received PNC check at 6 hours after birth
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Baby</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>Mother</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
MA27. Number received PNC within 24 hours after birth
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Baby</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>Mother</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
MA28. Uterotonics used in management of 3rd stage of labour
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Oxytocin</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>Misoprostol</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>Egometrine</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
@@ -0,0 +1,632 @@
<div class="col">
<table class="table table-condensed table-bordered table-hover">
<tbody>
<tr class="heading">
<td colspan="12">1.3 OUTPATIENT DIAGNOSES FOR THE MONTH</td>
</tr>
<tr class="heading">
<td colspan="2" rowspan="3">Diagnosis</td>
</tr>
<tr class="heading">
<td colspan="2">0-28 days</td>
<td colspan="2">29 days - 4Yrs</td>
<td colspan="2">5 - 9Yrs</td>
<td colspan="2">10 - 19Yrs</td>
<td colspan="2">20Yrs & above</td>
</tr>
<tr class="heading">
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
</tr>
@php
//Malaria Data
$option_ids = [400, 401, 399, 402]; $data= $malaria_options = [];
foreach ($option_ids as $option) {
$data_count = array_filter($diagnoses_data, function ($item) use ($option) {
return $item['dependent_option'] == $option;
});
if(!empty($data_count)) $data[] = $data_count;
}
foreach($data as $values) foreach ($values as $key => $value) $malaria_options[] = $value;
@endphp
@for ($i=0;$i<count($table_options);$i++)
<tr class="heading2">
<td colspan="12">{{ $table_options[$i]['category_number'].'. '.$table_options[$i]['category_name'] }}</td>
</tr>
@if ($i == 22)
@include('reports::hmis_reports.105.opd-risky-behaviours')
@else
@foreach ($table_options[$i]['category_options'] as $category_option)
@if (!empty($category_option['dependent_options']))
<tr>
<td rowspan="{{ count($category_option['dependent_options']) + 1 }}" class="rowspan">{{ $category_option['number'].'. '.$category_option['name'] }}</td>
</tr>
@foreach ($category_option['dependent_options'] as $key => $dependent_option)
<tr>
@php
$option_id =$dependent_option['id'];
if (in_array($option_id, $option_ids)){
if($option_id == 402) { //Malaria cases treated
$option_count = [];
if (!empty($malaria_options)) {
$keys = array_key_first($malaria_options);
$option_count[0] = ["id" => $malaria_options[$keys]['id'], "name" => $malaria_options[$keys]['name'], "hmis_category" => $malaria_options[$keys]['hmis_category'], "hmis_category_option" => $malaria_options[$keys]['hmis_category_option'], "dependent_option" => $malaria_options[$keys]['dependent_option'], "primary"=>$prescribed_treatments, "other"=>[]];
}
}elseif($option_id == 399){ //Suspected Fever
$option_count = [];
if(!empty($malaria_options)){
$keys = array_key_first($malaria_options);
$option_count[] = ["id" => $malaria_options[$keys]['id'], "name" => $malaria_options[$keys]['name'], "hmis_category" => $malaria_options[$keys]['hmis_category'], "hmis_category_option" => $malaria_options[$keys]['hmis_category_option'], "dependent_option" => $malaria_options[$keys]['dependent_option'], "primary"=>$ordered_investigations, "other"=>[]];
}
// else {
// $option_count[] = ["id" => $malaria_diagnoses->id, "name" => $malaria_diagnoses->name, "hmis_category" => $malaria_diagnoses->outpatient_hmis_category, "hmis_category_option" => $malaria_diagnoses->outpatient_hmis_category_option, "dependent_option" => 399, "primary"=>$ordered_investigations, "other"=>[]];
// }
} elseif($option_id == 400){ //Malaria Total
$option_count = $malaria_options;
}elseif($option_id == 401){ //Malaria confirmed (B/s and RDT Positive)
$option_count = [];
if(!empty($malaria_options)){
$keys = array_key_first($malaria_options);
$option_count[] = ["id" => $malaria_options[$keys]['id'], "name" => $malaria_options[$keys]['name'], "hmis_category" => $malaria_options[$keys]['hmis_category'], "hmis_category_option" => $malaria_options[$keys]['hmis_category_option'], "dependent_option" => $malaria_options[$keys]['dependent_option'], "primary"=>$ordered_investigation_results, "other"=>[]];
} // else $option_count[] = ["id" => $malaria_diagnoses->id, "name" => $malaria_diagnoses->name, "hmis_category" => $malaria_diagnoses->outpatient_hmis_category, "hmis_category_option" => $malaria_diagnoses->outpatient_hmis_category_option, "dependent_option" => 401, "primary"=>$ordered_investigation_results, "other"=>[]];
}
} else $option_count = array_filter($diagnoses_data, function ($item) use ($option_id) {
return $item['dependent_option'] == $option_id;
});
$case_male_0_28_days = $case_female_0_28_days = $case_male_29_4_years = $case_female_29_4_years = [];
$case_male_5_9_years = $case_female_5_9_years = $case_male_10_19_years = $case_female_10_19_years = $case_male_over_20_years = $case_female_over_20_years =[];
$case_male_0_28_days_diagnoses = $case_female_0_28_days_diagnoses = $case_male_29_4_years_diagnoses = $case_female_29_4_years_diagnoses = [];
$case_male_5_9_years_diagnoses = $case_female_5_9_years_diagnoses = $case_male_10_19_years_diagnoses = $case_female_10_19_years_diagnoses = $case_male_over_20_years_diagnoses = $case_female_over_20_years_diagnoses =[];
foreach ($option_count as $options){
foreach ($options['primary'] as $option) {
$days = Carbon\Carbon::parse($option['age'])->diffInDays(Carbon\Carbon::now());
$diagnoses = [];
if($days < 29) {
if($option['gender'] == '1') {
$case_male_0_28_days[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_male_0_28_days_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
elseif($option['gender'] == '2') {
$case_female_0_28_days[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_female_0_28_days_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
} else {
$age = Carbon\Carbon::parse($option['age'])->age;
if($age < 5){
if($option['gender'] == '1') {
$case_male_29_4_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_male_29_4_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
elseif($option['gender'] == '2') {
$case_female_29_4_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_female_29_4_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
}elseif ($age > 4 && $age < 10) {
if($option['gender'] == '1') {
$case_male_5_9_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_male_5_9_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
elseif($option['gender'] == '2') {
$case_female_5_9_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_female_5_9_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
}elseif ($age > 9 && $age < 20) {
if($option['gender'] == '1'){
$case_male_10_19_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_male_10_19_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
elseif($option['gender'] == '2') {
$case_female_10_19_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_female_10_19_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
}else {
if($option['gender'] == '1') {
$case_male_over_20_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_male_over_20_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
elseif($option['gender'] == '2') {
$case_female_over_20_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_female_over_20_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
}
}
}
foreach ($options['other'] as $option){
$days = Carbon\Carbon::parse($option['age'])->diffInDays(Carbon\Carbon::now());
$diagnoses = [];
if($days < 29) {
if($option['gender'] == '1') {
$case_male_0_28_days[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_male_0_28_days_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
elseif($option['gender'] == '2') {
$case_female_0_28_days[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_female_0_28_days_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
} else {
$age = Carbon\Carbon::parse($option['age'])->age;
if($age < 5){
if($option['gender'] == '1') {
$case_male_29_4_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_male_29_4_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
elseif($option['gender'] == '2') {
$case_female_29_4_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_female_29_4_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
}elseif ($age > 4 && $age < 10) {
if($option['gender'] == '1') {
$case_male_5_9_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_male_5_9_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
elseif($option['gender'] == '2') {
$case_female_5_9_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_female_5_9_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
}elseif ($age > 9 && $age < 20) {
if($option['gender'] == '1'){
$case_male_10_19_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_male_10_19_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
elseif($option['gender'] == '2') {
$case_female_10_19_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_female_10_19_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
}else {
if($option['gender'] == '1') {
$case_male_over_20_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_male_over_20_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
elseif($option['gender'] == '2') {
$case_female_over_20_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_female_over_20_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
}
}
}
}
@endphp
<td>{{ $dependent_option['number'].'. '.$dependent_option['name'] }}</td>
<td>
@if (!empty($case_male_0_28_days))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_case_male_0_28_days_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_0_28_days) }}' />
<input type="hidden" name="diagnoses" id="diagnoses" value='{{ serialize($case_male_0_28_days_diagnoses) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_case_male_0_28_days' }}>{{ commas(count(array_unique($case_male_0_28_days))) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_0_28_days))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'case_female_0_28_days'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_0_28_days) }}' />
<input type="hidden" name="diagnoses" id="diagnoses" value='{{ serialize($case_female_0_28_days_diagnoses) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'case_female_0_28_days' }}>{{ commas(count(array_unique($case_female_0_28_days))) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_male_29_4_years))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'case_male_29_4_years'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_29_4_years) }}' />
<input type="hidden" name="diagnoses" id="diagnoses" value='{{ serialize($case_male_29_4_years_diagnoses) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'case_male_29_4_years' }}>{{ commas(count(array_unique($case_male_29_4_years))) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_29_4_years))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'case_female_29_4_years'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_29_4_years) }}' />
<input type="hidden" name="diagnoses" id="diagnoses" value='{{ serialize($case_female_29_4_years_diagnoses) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'case_female_29_4_years' }}>{{ commas(count(array_unique($case_female_29_4_years))) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_male_5_9_years))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'case_male_5_9_years'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_5_9_years) }}' />
<input type="hidden" name="diagnoses" id="diagnoses" value='{{ serialize($case_male_5_9_years_diagnoses) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'case_male_5_9_years' }}>{{ commas(count(array_unique($case_male_5_9_years))) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_5_9_years))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'case_female_5_9_years'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_5_9_years) }}' />
<input type="hidden" name="diagnoses" id="diagnoses" value='{{ serialize($case_female_5_9_years_diagnoses) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'case_female_5_9_years' }}>{{ commas(count(array_unique($case_female_5_9_years))) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_male_10_19_years))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'case_male_10_19_years'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_10_19_years) }}' />
<input type="hidden" name="diagnoses" id="diagnoses" value='{{ serialize($case_male_10_19_years_diagnoses) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'case_male_10_19_years' }}>{{ commas(count(array_unique($case_male_10_19_years))) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_10_19_years))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'case_female_10_19_years'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_10_19_years) }}' />
<input type="hidden" name="diagnoses" id="diagnoses" value='{{ serialize($case_female_10_19_years_diagnoses) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'case_female_10_19_years' }}>{{ commas(count(array_unique($case_female_10_19_years))) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_male_over_20_years))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'case_male_over_20_years'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_over_20_years) }}' />
<input type="hidden" name="diagnoses" id="diagnoses" value='{{ serialize($case_male_over_20_years_diagnoses) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'case_male_over_20_years' }}>{{ commas(count(array_unique($case_male_over_20_years))) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_over_20_years))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'case_female_over_20_years'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_over_20_years) }}' />
<input type="hidden" name="diagnoses" id="diagnoses" value='{{ serialize($case_female_over_20_years_diagnoses) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'case_female_over_20_years' }}>{{ commas(count(array_unique($case_female_over_20_years))) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
@endforeach
@else
<tr>
@php
$option_id =$category_option['id'];
$option_count =array_filter($diagnoses_data, function ($item) use ($option_id) {
return $item['hmis_category_option'] == $option_id;
});
$case_male_0_28_days = $case_female_0_28_days = $case_male_29_4_years = $case_female_29_4_years = [];
$case_male_5_9_years = $case_female_5_9_years = $case_male_10_19_years = $case_female_10_19_years = $case_male_over_20_years = $case_female_over_20_years =[];
$case_male_0_28_days_diagnoses = $case_female_0_28_days_diagnoses = $case_male_29_4_years_diagnoses = $case_female_29_4_years_diagnoses = [];
$case_male_5_9_years_diagnoses = $case_female_5_9_years_diagnoses = $case_male_10_19_years_diagnoses = $case_female_10_19_years_diagnoses = $case_male_over_20_years_diagnoses = $case_female_over_20_years_diagnoses =[];
foreach ($option_count as $options){
foreach ($options['primary'] as $option) {
$days = Carbon\Carbon::parse($option['age'])->diffInDays(Carbon\Carbon::now());
$diagnoses = [];
if($days < 29) {
if($option['gender'] == '1') {
$case_male_0_28_days[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_male_0_28_days_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
elseif($option['gender'] == '2') {
$case_female_0_28_days[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_female_0_28_days_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
} else {
$age = Carbon\Carbon::parse($option['age'])->age;
if($age < 5){
if($option['gender'] == '1') {
$case_male_29_4_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_male_29_4_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
elseif($option['gender'] == '2') {
$case_female_29_4_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_female_29_4_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
}elseif ($age > 4 && $age < 10) {
if($option['gender'] == '1') {
$case_male_5_9_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_male_5_9_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
elseif($option['gender'] == '2') {
$case_female_5_9_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_female_5_9_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
}elseif ($age > 9 && $age < 20) {
if($option['gender'] == '1'){
$case_male_10_19_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_male_10_19_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
elseif($option['gender'] == '2') {
$case_female_10_19_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_female_10_19_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
}else {
if($option['gender'] == '1') {
$case_male_over_20_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_male_over_20_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
elseif($option['gender'] == '2') {
$case_female_over_20_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_female_over_20_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
}
}
}
foreach ($options['other'] as $option){
$days = Carbon\Carbon::parse($option['age'])->diffInDays(Carbon\Carbon::now());
$diagnoses = [];
if($days < 29) {
if($option['gender'] == '1') {
$case_male_0_28_days[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_male_0_28_days_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
elseif($option['gender'] == '2') {
$case_female_0_28_days[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_female_0_28_days_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
} else {
$age = Carbon\Carbon::parse($option['age'])->age;
if($age < 5){
if($option['gender'] == '1') {
$case_male_29_4_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_male_29_4_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
elseif($option['gender'] == '2') {
$case_female_29_4_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_female_29_4_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
}elseif ($age > 4 && $age < 10) {
if($option['gender'] == '1') {
$case_male_5_9_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_male_5_9_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
elseif($option['gender'] == '2') {
$case_female_5_9_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_female_5_9_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
}elseif ($age > 9 && $age < 20) {
if($option['gender'] == '1'){
$case_male_10_19_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_male_10_19_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
elseif($option['gender'] == '2') {
$case_female_10_19_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_female_10_19_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
}else {
if($option['gender'] == '1') {
$case_male_over_20_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_male_over_20_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
elseif($option['gender'] == '2') {
$case_female_over_20_years[] = $option['patient_id'];
$diagnoses[]= $option['primary_diagnosis'];
foreach ($option['other_diagnoses'] as $value) $diagnoses[]= $value;
$case_female_over_20_years_diagnoses[] = ['patient_id'=>$option['patient_id'], 'diagnoses'=>$diagnoses];
}
}
}
}
}
@endphp
<td colspan="2">{{ $category_option['number'].'. '.$category_option['name'] }}</td>
<td>
@if (!empty($case_male_0_28_days))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_case_male_0_28_days_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_0_28_days) }}' />
<input type="hidden" name="diagnoses" id="diagnoses" value='{{ serialize($case_male_0_28_days_diagnoses) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_case_male_0_28_days' }}>{{ commas(count(array_unique($case_male_0_28_days))) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_0_28_days))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_0_28_days'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_0_28_days) }}' />
<input type="hidden" name="diagnoses" id="diagnoses" value='{{ serialize($case_female_0_28_days_diagnoses) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_0_28_days' }}>{{ commas(count(array_unique($case_female_0_28_days))) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_male_29_4_years))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_male_29_4_years'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_29_4_years) }}' />
<input type="hidden" name="diagnoses" id="diagnoses" value='{{ serialize($case_male_29_4_years_diagnoses) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_male_29_4_years' }}>{{ commas(count(array_unique($case_male_29_4_years))) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_29_4_years))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_29_4_years'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_29_4_years) }}' />
<input type="hidden" name="diagnoses" id="diagnoses" value='{{ serialize($case_female_29_4_years_diagnoses) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_29_4_years' }}>{{ commas(count(array_unique($case_female_29_4_years))) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_male_5_9_years))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_male_5_9_years'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_5_9_years) }}' />
<input type="hidden" name="diagnoses" id="diagnoses" value='{{ serialize($case_male_5_9_years_diagnoses) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_male_5_9_years' }}>{{ commas(count(array_unique($case_male_5_9_years))) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_5_9_years))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_5_9_years'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_5_9_years) }}' />
<input type="hidden" name="diagnoses" id="diagnoses" value='{{ serialize($case_female_5_9_years_diagnoses) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_5_9_years' }}>{{ commas(count(array_unique($case_female_5_9_years))) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_male_10_19_years))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_male_10_19_years'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_10_19_years) }}' />
<input type="hidden" name="diagnoses" id="diagnoses" value='{{ serialize($case_male_10_19_years_diagnoses) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_male_10_19_years' }}>{{ commas(count(array_unique($case_male_10_19_years))) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_10_19_years))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_10_19_years'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_10_19_years) }}' />
<input type="hidden" name="diagnoses" id="diagnoses" value='{{ serialize($case_female_10_19_years_diagnoses) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_10_19_years' }}>{{ commas(count(array_unique($case_female_10_19_years))) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_male_over_20_years))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_male_over_20_years'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_over_20_years) }}' />
<input type="hidden" name="diagnoses" id="diagnoses" value='{{ serialize($case_male_over_20_years_diagnoses) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_male_over_20_years' }}>{{ commas(count(array_unique($case_male_over_20_years))) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_over_20_years))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_over_20_years'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_over_20_years) }}' />
<input type="hidden" name="diagnoses" id="diagnoses" value='{{ serialize($case_female_over_20_years_diagnoses) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_over_20_years' }}>{{ commas(count(array_unique($case_female_over_20_years))) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
@endif
@endforeach
@endif
@endfor
</tbody>
</table>
</div>
@@ -0,0 +1,769 @@
<div class="col" style="padding: 5px;">
<table class="table table-sm table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th colspan="19"><strong>1.5 Nutrition Services</strong></th>
</tr>
</thead>
<tbody>
<tr style="background-color: #e8e4e4">
<td rowspan="3" colspan="2"><strong>Data Elements</strong></td>
<td colspan="2"><strong>0-5 Months</strong></td>
<td colspan="2"><strong>6-23 Months</strong></td>
<td colspan="2"><strong>24-59 Months</strong></td>
<td colspan="2"><strong>5-9 Years</strong></td>
<td colspan="3"><strong>10-19 Years</strong></td>
<td colspan="3"><strong>20-24 Years</strong></td>
<td colspan="3"><strong>25+ Years</strong></td>
</tr>
<tr id="test">
<td rowspan="2"><strong>Male</strong></td>
<td rowspan="2"><strong>Female</strong></td>
<td rowspan="2"><strong>Male</strong></td>
<td rowspan="2"><strong>Female</strong></td>
<td rowspan="2"><strong>Male</strong></td>
<td rowspan="2"><strong>Female</strong></td>
<td rowspan="2"><strong>Male</strong></td>
<td rowspan="2"><strong>Female</strong></td>
<td rowspan="2"><strong>Male</strong></td>
<td colspan="2"><strong>Female</strong></td>
<td rowspan="2"><strong>Male</strong></td>
<td colspan="2"><strong>Female</strong></td>
<td rowspan="2"><strong>Male</strong></td>
<td colspan="2"><strong>Female</strong></td>
</tr>
<tr id="test">
<td>Non pregnant</td>
<td>Pregnant / Lactating</td>
<td>Non pregnant</td>
<td>Pregnant / Lactating</td>
<td>Non pregnant</td>
<td>Pregnant / Lactating</td>
</tr>
<tr>
<td rowspan="4">
NA01. No. of clients who received nutrition assessment in this month using;
</td>
<td>NA01a. MUAC Tape</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NA01b. W/H or L Z-Score</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NA01c. BMI for Age Z-Score</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NA01e. Body Mass Index (BMI)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="2">NA02. No. of children that are underweight (W/A -2 SD)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td rowspan="11">
NA03. No. of identified malnourished clients this month;
</td>
<td>NA03a. MAM using MUAC: MUAC: 11.5cm & < 12.5cm (children 0-59 mths) MUAC: 19.0cm & <23.0cm (PLW 10-25+ yrs) </td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NA03b. MAM using W/H or L W/H or L: -3 SD & < -2 SD</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NA03c. SAM using MUAC MUAC: < 11.5cm (children 0-59 mths) MUAC: <19.0cm (PLW 10-25+ yrs)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NA03d. SAM using W/H or L W/H or L: < -3 SD</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NA03e. SAM With Oedema</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NA03f. Moderately Malnourished</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>(5-9yrs & 10-19yrs: <- 2SD & -3SD;</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>>19yrs: ≥16.0 & ≤16.9)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NA03g. Severely Malnourished (5-9yr & 10-19 yrs: <-3SD;>19yrs: < 16.0)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NA03h. Overweight (5-9yrs:>+1SD & +3SD; >19yrs:≥25.0 & ≤29.9)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NA03i. Obese (5-9yrs & 10-19yrs: <+ 2SD; >19yrs: 30.0)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td rowspan="2">
NA04. No. of SAM admissions in OTC this month;
</td>
<td>NA04a. Total</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NA04b. New Admissions</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td rowspan="2">
NA05. No. of Readmissions into OTC this month;
</td>
<td>NA05a. Relapses</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NA05b. Defaulters</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td rowspan="2">
NA06. No. of MAM admissions in Supplementary Feeding Care (SFC)
</td>
<td>NA06a. Total</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NA06b. New Admissions</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td rowspan="2">
NA07. No. ofReadmissions in SFC this Month
</td>
<td>NA07a. Relapses</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NA07b. Defaulters</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td rowspan="4">
NA08. No. of clients with SAM admitted into treatment and
</td>
<td>NA08a. Discharged as cured within this month</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NA08b. Did not respond to care in OTC (non-response) after 3 months of treatment</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NA08c. Defaulted from care within this month (absent for 2 consecutive visits)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NA08d. Died during treatment within this month</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="2">NA09. Total number of days spent in OTC for all clients discharged as cured this month</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td rowspan="4">
NA10. No.of clients with MAM admitted into treatment
</td>
<td>NA10a.Discharged as cured within this month</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NA10b. Did not respond to care in SFC (non-response) after 3 months of treatment</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NA10c. Defaulted from care within this month (absent for 2 consecutive visits)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>NA10d. Died during treatment within this month</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="2">NA11. Total number of days spent in SFC for all clients discharged as cured this month</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="2">NA12. No. of malnourished clients who are positive for TB</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
@@ -0,0 +1,116 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">Memorized reports</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">Dashboard</a></li>
<li><a href="{{ url('list_memorised_reports') }}">Memorised stre@mline reports</a></li>
<li class="active">OPD attendance, referrals and diagnosis totals</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
<h3 class="heading" style="text-align: center; text-decoration: underline;"><font style="color: #0088cc">OPD ATTENDANCES, REFERRALS AND DIAGNOSES TOTALS FOR THE MONTH</font></h3>
<div class="row">
<div class="col-sm-3">
Showing results from {{streamline_date($attendance_from)}} to {{streamline_date($attendance_to)}}
</div>
<div class="col-sm-1"></div>
<div class="col-sm-8">
{{-- change the url to point to the same form --}}
<form action="{{ url('opd_attendance_referrals_diagnosis_totals')}}" method="post" class="form-vertical">
@csrf()
<div class="row">
<div class="form-group">
{{ Form::label('date_from','Date From') }}
<div class="input-group">
{{ Form::text('date_from','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-from']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
<div class="help-block with-errors"></div>
</div>
&nbsp;&nbsp;
<div class="form-group">
{{ Form::label('date_to','Date To') }}
<div class="input-group">
{{ Form::text('date_to','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-to']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
<div class="help-block with-errors"></div>
</div>
&nbsp;&nbsp;
<div class="form-group">
{{ Form::label('.','.') }}
<div class="input-group">
<input type="submit" name="filterBtn" class="btn btn-icon btn-success btn-sm" value="Search">
</div>
</div>
</div>
</form>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-6">
<h5 align="left">1.1 OUTPATIENT ATTENDANCE</h5>
@include('reports::hmis_reports.opd_attendance_totals')
</div>
<div class="col-md-6">
<h5 align="left">1.2 OUTPATIENT REFERRALS</h5>
@include('reports::hmis_reports.105.opd_referrals')
</div>
<div class="col-md-12">
<h5 align="left">1.3 OUTPATIENT DIAGNOSES</h5>
@include('reports::hmis_reports.opd_diagnoses_totals')
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
</div>
</div>
@endsection
@push('scripts')
<!-- Typehead Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
<!-- Data table javascript -->
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
jQuery('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy',
});
</script>
@endpush
@@ -0,0 +1,188 @@
<?php
if (!empty($attendance_from) && !empty($attendance_to)):
// Getting the number of children btn 0 - 28days
$num_male_0_28_days_new_attendance = 0;
$num_male_0_28_days_re_attendance = 0;
$num_female_0_28_days_new_attendance = 0;
$num_female_0_28_days_re_attendance = 0;
// Getting the number of children btn 29days to 4years
$num_male_29days_4yrs_new_attendance = 0;
$num_male_29days_4yrs_re_attendance = 0;
$num_female_29days_4yrs_new_attendance = 0;
$num_female_29days_4yrs_re_attendance = 0;
// Getting the number of people between 5 to 59 years
$num_male_5_59yrs_new_attendance = 0;
$num_male_5_59yrs_re_attendance = 0;
$num_female_5_59yrs_new_attendance = 0;
$num_female_5_59yrs_re_attendance = 0;
// Getting the number of people aged above 6-years
$num_male_60yrs_new_attendance = 0;
$num_male_60yrs_re_attendance = 0;
$num_female_60yrs_new_attendance = 0;
$num_female_60yrs_re_attendance = 0;
$patient_query_opd_attendance_sql = "SELECT e.patient_id,d.date_of_birth, d.gender from patient_episodes e, patients d WHERE e.patient_id = d.id AND e.created_at BETWEEN '{$attendance_from}' AND '{$attendance_to}'";
$patient_query_opd_attendance_results = DB::select($patient_query_opd_attendance_sql);
foreach($patient_query_opd_attendance_results as $patient_query_opd_attendance){
$age_array = days_months_years($patient_query_opd_attendance->date_of_birth, $attendance_to);
$age_days = $age_array[0];
$age_months = $age_array[1];
$age_years = $age_array[2];
$patient_id = $patient_query_opd_attendance->patient_id;
if(is_add_attendance_to_consultation_enabled()) $attendance_query_sql = "SELECT id, attendance FROM consultations WHERE patient_id = $patient_id";
else $attendance_query_sql = "SELECT id, new_attendance, re_attendance FROM triage WHERE patient_id = $patient_id";
$attendance_query_sql_results = DB::select($attendance_query_sql);
foreach($attendance_query_sql_results as $attendance_result) {
$new_attendance = (!empty($attendance_result->attendance) && $attendance_result->attendance == 1 )? $attendance_result->attendance : $attendance_result->new_attendance;
$re_attendance = (!empty($attendance_result->attendance) && $attendance_result->attendance == 2 )? $attendance_result->attendance :$attendance_result->re_attendance;
// 0 - 28 days --------------------------------------------------------------------
// For males (New Attendance)
if (between($age_days, 0, 28) && $age_months == 0 && $age_years == 0 && $patient_query_opd_attendance->gender == 1 && !is_null($new_attendance)):
$num_male_0_28_days_new_attendance++;
endif;
// For males (Re-Attendance)
if (between($age_days, 0, 28) && $age_months == 0 && $age_years == 0 && $patient_query_opd_attendance->gender == 1 && !is_null($re_attendance)):
$num_male_0_28_days_re_attendance++;
endif;
// For females (New Attendance)
if (between($age_days, 0, 28) && $age_months == 0 && $age_years == 0 && $patient_query_opd_attendance->gender == 2 && !is_null($new_attendance)):
$num_female_0_28_days_new_attendance++;
endif;
// For females (Re-Attendance)
if (between($age_days, 0, 28) && $age_months == 0 && $age_years == 0 && $patient_query_opd_attendance->gender == 2 && !is_null($re_attendance)):
$num_female_0_28_days_re_attendance++;
endif;
// 29 days to 4 years ---------------------------------------------------------------
// For males (New Attendance)
if ($age_months > 0 && $age_years < 5 && $patient_query_opd_attendance->gender == 1 && !is_null($new_attendance)):
$num_male_29days_4yrs_new_attendance++;
endif;
// For males (Re-Attendance)
if ($age_months > 0 && $age_years < 5 && $patient_query_opd_attendance->gender == 1 && !is_null($re_attendance)):
$num_male_29days_4yrs_re_attendance++;
endif;
// For females (New Attendance)
if ($age_months > 0 && $age_years < 5 && $patient_query_opd_attendance->gender == 2 && !is_null($new_attendance)):
$num_female_29days_4yrs_new_attendance++;
endif;
// For females (Re-Attendance)
if ($age_months > 0 && $age_years < 5 && $patient_query_opd_attendance->gender == 2 && !is_null($re_attendance)):
$num_female_29days_4yrs_re_attendance++;
endif;
// 5 to 59 years ------------------------------------------------------------
// For males (New Attendance)
if (between($age_years, 5, 60) && $patient_query_opd_attendance->gender == 1 && !is_null($new_attendance)):
$num_male_5_59yrs_new_attendance++;
endif;
// For males (Re-Attendance)
if (between($age_years, 5, 60) && $patient_query_opd_attendance->gender == 1 && !is_null($re_attendance)):
$num_male_5_59yrs_re_attendance++;
endif;
// For females (New Attendance)
if (between($age_years, 5, 60) && $patient_query_opd_attendance->gender == 2 && !is_null($new_attendance)):
$num_female_5_59yrs_new_attendance++;
endif;
// For females (Re-Attendance)
if (between($age_years, 5, 60) && $patient_query_opd_attendance->gender == 2 && !is_null($re_attendance)):
$num_female_5_59yrs_re_attendance++;
endif;
// For patients aged above 60 years ------------------------------------------------------
// For males (New Attendance)
if ($age_years > 60 && $patient_query_opd_attendance->gender == 1 && !is_null($new_attendance)):
$num_male_60yrs_new_attendance++;
endif;
// For males (Re-Attendance)
if ($age_years > 60 && $patient_query_opd_attendance->gender == 1 && !is_null($re_attendance)):
$num_male_60yrs_re_attendance++;
endif;
// For females (New Attendance)
if ($age_years > 60 && $patient_query_opd_attendance->gender == 2 && !is_null($new_attendance)):
$num_female_60yrs_new_attendance++;
endif;
// For females (Re-Attendance)
if ($age_years > 60 && $patient_query_opd_attendance->gender == 2 && !is_null($re_attendance)):
$num_female_60yrs_re_attendance++;
endif;
}
}
endif;
?>
<table class="table table-condensed table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th rowspan="2">Category</th>
<th colspan="2">0 - 28 Days</th>
<th colspan="2">29 Days - 4 Years</th>
<th colspan="2">5 - 59 Years</th>
<th colspan="2">60 Years & Above</th>
</tr>
<tr>
<th>M</th>
<th>F</th>
<th>M</th>
<th>F</th>
<th>M</th>
<th>F</th>
<th>M</th>
<th>F</th>
</tr>
</thead>
<tbody>
<tr>
<td>New Attendance</td>
<td><?php echo $num_male_0_28_days_new_attendance; ?></td>
<td><?php echo $num_female_0_28_days_new_attendance; ?></td>
<td><?php echo $num_male_29days_4yrs_new_attendance; ?></td>
<td><?php echo $num_female_29days_4yrs_new_attendance; ?></td>
<td><?php echo $num_male_5_59yrs_new_attendance; ?></td>
<td><?php echo $num_female_5_59yrs_new_attendance; ?></td>
<td><?php echo $num_male_60yrs_new_attendance; ?></td>
<td><?php echo $num_female_60yrs_new_attendance; ?></td>
</tr>
<tr>
<td>Re-attendance</td>
<td><?php echo $num_male_0_28_days_re_attendance ?></td>
<td><?php echo $num_female_0_28_days_re_attendance ?></td>
<td><?php echo $num_male_29days_4yrs_re_attendance ?></td>
<td><?php echo $num_female_29days_4yrs_re_attendance ?></td>
<td><?php echo $num_male_5_59yrs_re_attendance ?></td>
<td><?php echo $num_female_5_59yrs_re_attendance ?></td>
<td><?php echo $num_male_60yrs_re_attendance ?></td>
<td><?php echo $num_female_60yrs_re_attendance ?></td>
</tr>
<tr>
<td>Total Attendance</td>
<td><?php echo $num_male_0_28_days_new_attendance + $num_male_0_28_days_re_attendance; ?></td>
<td><?php echo $num_female_0_28_days_new_attendance + $num_female_0_28_days_re_attendance ?></td>
<td><?php echo $num_male_29days_4yrs_new_attendance + $num_male_29days_4yrs_re_attendance; ?></td>
<td><?php echo $num_female_29days_4yrs_new_attendance + $num_female_29days_4yrs_re_attendance ?></td>
<td><?php echo $num_male_5_59yrs_new_attendance + $num_male_5_59yrs_re_attendance; ?></td>
<td><?php echo $num_female_5_59yrs_new_attendance + $num_female_5_59yrs_re_attendance ?></td>
<td><?php echo $num_male_60yrs_new_attendance + $num_male_60yrs_re_attendance; ?></td>
<td><?php echo $num_female_60yrs_new_attendance + $num_female_60yrs_re_attendance ?></td>
</tr>
</tbody>
</table>
@@ -0,0 +1,162 @@
<?php
$diagnosis_query = "SELECT id, name, hmis_category FROM diagnoses";
$diagnosis_query_results = DB::select($diagnosis_query);
?>
<table class="table table-condensed table-bordered table-striped table-hover">
<thead>
<tr style="background-color: #e8e4e4">
<th class="center" colspan="2" rowspan="2" style="width: 50%;">Diagnosis Name</th>
<th class="center" colspan="2">0 - 28 Days</th>
<th class="center" colspan="2">29 Days - 4 Years</th>
<th class="center" colspan="2">5 - 59 Years</th>
<th class="center" colspan="2">60 Years & Above</th>
</tr>
<tr>
<th class="center">M</th>
<th class="center">F</th>
<th class="center">M</th>
<th class="center">F</th>
<th class="center">M</th>
<th class="center">F</th>
<th class="center">M</th>
<th class="center">F</th>
</tr>
</thead>
<tbody>
<?php
$count = 1;
foreach($diagnosis_query_results as $diagnosis_result){
$diagnosis_id = $diagnosis_result->id;
$male_0_28_days = 0;
$female_0_28_days = 0;
$male_29days_4years = 0;
$female_29days_4years = 0;
$male_5_59_years = 0;
$female_5_59_years = 0;
$male_60_years = 0;
$female_60_years = 0;
if (!empty($attendance_from) && !empty($attendance_to)):
$patient_query_diagnosis_sql = "SELECT d.id, d.gender, TIMESTAMPDIFF(DAY,d.date_of_birth,'{$attendance_to}') AS age FROM patients d, consultations c WHERE d.id = c.patient_id AND c.primary_diagnosis = {$diagnosis_id} AND c.created_at BETWEEN '{$attendance_from}' AND '{$attendance_to}'";
$patient_query_diagnosis_result = DB::select($patient_query_diagnosis_sql);
foreach($patient_query_diagnosis_result as $patient_query_diagnosis){
$gender = $patient_query_diagnosis->gender;
$age_years = round($patient_query_diagnosis->age / 365);
// $age_months = round($patient_row_diagnosis['age'] / 30);
$age_days = $patient_query_diagnosis->age;
// 0 - 28 Days ===========================================================================================
// Male
if (between($age_days, 0, 28) && $gender == 1):
$male_0_28_days++;
endif;
// Female
if (between($age_days, 0, 28) && $gender == 2):
$female_0_28_days++;
endif;
// 29 - 4 Years ===========================================================================================
// Male
if (between($age_days, 29, 1825) && $gender == 1):
$male_29days_4years++;
endif;
// Female
if (between($age_days, 29, 1825) && $gender == 2):
$female_29days_4years++;
endif;
// 5 - 59 Years ===========================================================================================
// Male
if (between($age_years, 5, 60) && $gender == 1):
$male_5_59_years++;
endif;
// Female
if (between($age_years, 5, 60) && $gender == 2):
$female_5_59_years++;
endif;
// 60 Years and above ===========================================================================================
// Male
if ($age_years > 60 && $gender == 1):
$male_60_years++;
endif;
// Female
if ($age_years > 60 && $gender == 2):
$female_60_years++;
endif;
}
endif;
?>
<tr>
<td><?php echo $count; ?></td>
<td><?php echo $diagnosis_result->name; ?></td>
<td class="center">
<?php
echo ($male_0_28_days > 0) ? "<a href=''>{$male_0_28_days}</a>" : $male_0_28_days;
?>
</td>
<td class="center">
<?php
echo ($female_0_28_days > 0) ? "<a href=''>{$female_0_28_days}</a>" : $female_0_28_days;
?>
</td>
<td class="center">
<?php
echo ($male_29days_4years > 0) ? "<a href=''>{$male_29days_4years}</a>" : $male_29days_4years;
?>
</td>
<td class="center">
<?php
echo ($female_29days_4years > 0) ? "<a href=''>{$female_29days_4years}</a>" : $female_29days_4years;
?>
</td>
<td class="center">
<?php
echo ($male_5_59_years > 0) ? "<a href=''>{$male_5_59_years}</a>" : $male_5_59_years;
?>
</td>
<td class="center">
<?php
echo ($female_5_59_years > 0) ? "<a href=''>{$female_5_59_years}</a>" : $female_5_59_years;
?>
</td>
<td class="center">
<?php
echo ($male_60_years > 0) ? "<a href=''>{$male_60_years}</a>" : $male_60_years;
?>
</td>
<td class="center">
<?php
echo ($female_60_years > 0) ? "<a href=''>{$female_60_years}</a>" : $female_60_years;
?>
</td>
</tr>
<?php
if ($count % 50 == 0):
?>
<thead>
<tr style="background-color: #e8e4e4">
<th class="center" colspan="2" rowspan="2" style="width: 50%;">Diagnosis Name</th>
<th class="center" colspan="2">0 - 28 Days</th>
<th class="center" colspan="2">29 Days - 4 Years</th>
<th class="center" colspan="2">5 - 59 Years</th>
<th class="center" colspan="2">60 Years & Above</th>
</tr>
<tr>
<th class="center">M</th>
<th class="center">F</th>
<th class="center">M</th>
<th class="center">F</th>
<th class="center">M</th>
<th class="center">F</th>
<th class="center">M</th>
<th class="center">F</th>
</tr>
</thead>
<?php
endif;
$count++;
}
?>
</tbody>
</table>
@@ -0,0 +1,83 @@
@extends('layouts.main')
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('hmis_reports.hmis_105_report') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.hmis_reports') }}</a></li>
<li><a href="#">105</a></li>
<li><a href="#">{{ __('hmis_reports.opd_attendance') }}</a></li>
<li class="active">{{ __('hmis_reports.details') }}</li>
</ol>
</div>
</div>
<div class='white-box'>
<!-- Widget -->
<div class="widget">
<!-- Widget heading -->
<div class="widget-head">
<h4 class="heading float-left">{{ __('hmis_reports.patient_details') }}</h4>
<a href="#" class="btn btn-inverse btn-sm float-right">{{ __('hmis_reports.print') }}</a>
</div>
<!-- Widget heading END -->
<!-- Widget Body -->
<div class="widget-body table-responsive">
{{ $patients->links() }}
<!-- Table -->
<table class="table color-table success-table table-sm">
<!-- Table heading -->
<thead>
<tr>
<th>#</th>
<th>{{ __('hmis_reports.patient_number') }}</th>
<th>{{ __('hmis_reports.names') }}</th>
<th>{{ __('hmis_reports.date_of_birth') }}</th>
<th>{{ __('hmis_reports.gender') }}</th>
<th>{{ __('hmis_reports.phone') }}</th>
<th>{{ __('hmis_reports.category') }}</th>
<th>{{ __('hmis_reports.select') }}</th>
</tr>
</thead>
<tbody>
<?php
$numbering = 1;
foreach ($patients AS $patient):
?>
<tr class="gradeX">
<td>{{ $numbering }}</td>
<td>{{ $patient->number }}</td>
<td>{{ $patient->first_name . ' ' . $patient->last_name }}</td>
<td>{{ Carbon\Carbon::parse($patient->date_of_birth)->format('jS M Y') }}</td>
<td>{{ $patient->gender == 1 ? 'Male' : 'Female' }}</td>
<td>{{ $patient->phone }}</td>
<td>{{ isset($categories[$patient->category_id]) ? $categories[$patient->category_id] : 'NA' }}</td>
<td>
<form action="{{ url('/patient_episodes/set_patient_id/'.$patient->id)}}" method="POST">
@csrf()
<button class="btn btn-success btn-sm" style="display: inline;">{{ __('hmis_reports.select') }}</button>
</form>
</td>
</tr>
<?php
$numbering++;
endforeach;
?>
</tbody>
<!-- // Table body END -->
</table>
{{ $patients->links() }}
</div>
<!-- Widget Body END -->
</div>
<!-- // Widget END -->
</div>
@endsection
@@ -0,0 +1,88 @@
@extends('layouts.main')
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('hmis_reports.hmis_105_report') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.hmis_reports') }}</a></li>
<li><a href="#">105</a></li>
<li><a href="#">{{ __('hmis_reports.outpatient_diagnoses') }}</a></li>
<li class="active">{{ __('hmis_reports.details') }}</li>
</ol>
</div>
</div>
<div class='white-box'>
<!-- Widget -->
<div class="widget">
<!-- Widget heading -->
<div class="widget-head">
<h4 class="heading float-left">{{ __('hmis_reports.patient_details') }}</h4>
<a href="#" class="btn btn-inverse btn-sm float-right">{{ __('hmis_reports.print') }}</a>
</div>
<!-- Widget heading END -->
<!-- Widget Body -->
<div class="widget-body table-responsive">
{{ $patients->links() }}
<!-- Table -->
<table class="table color-table success-table table-sm">
<!-- Table heading -->
<thead>
<tr>
<th>#</th>
<th>{{ __('hmis_reports.patient_names') }}</th>
<th>{{ __('hmis_reports.names') }}</th>
<th>{{ __('hmis_reports.date_of_birth') }}</th>
<th>{{ __('hmis_reports.gender') }}</th>
<th>{{ __('hmis_reports.phone') }}</th>
<th>{{ __('hmis_reports.category') }}</th>
<th>{{ __('hmis_reports.select') }}</th>
</tr>
</thead>
<tbody>
<?php
$numbering = 1;
foreach ($patients AS $patient):
?>
<tr class="gradeX">
<td>{{ $numbering }}</td>
<td>{{ $patient->number }}</td>
<td>{{ $patient->first_name . ' ' . $patient->last_name }}</td>
<td>{{ Carbon\Carbon::parse($patient->date_of_birth)->format('jS M Y') }}</td>
<td>{{ $patient->gender == 1 ? __('hmis_reports.male') : __('hmis_reports.female') }}</td>
<td>{{ $patient->phone }}</td>
<td>{{ isset($categories[$patient->category_id]) ? $categories[$patient->category_id] : 'NA' }}</td>
<td>
<form action="{{ url('/patient_episodes/set_patient_id/'.$patient->id)}}" method="POST">
@csrf()
<button class="btn btn-success btn-sm" style="display: inline;">{{ __('hmis_reports.select') }}</button>
</form>
</td>
</tr>
<?php
$numbering++;
endforeach;
if ($numbering == 1):
?>
<tr class="gradeX">
<td colspan="8" style="color: maroon; font-weight: bold;">{{ __('hmis_reports.no_records_found') }}</td>
</tr>
<?php endif; ?>
</tbody>
<!-- // Table body END -->
</table>
{{ $patients->links() }}
</div>
<!-- Widget Body END -->
</div>
<!-- // Widget END -->
</div>
@endsection
@@ -0,0 +1,88 @@
@extends('layouts.main')
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('hmis_reports.hmis_105_report') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.hmis_reports') }}</a></li>
<li><a href="#">105</a></li>
<li><a href="#">{{ __('hmis_reports.outpatient_referrals') }}</a></li>
<li class="active">{{ __('hmis_reports.details') }}</li>
</ol>
</div>
</div>
<div class='white-box'>
<!-- Widget -->
<div class="widget">
<!-- Widget heading -->
<div class="widget-head">
<h4 class="heading float-left">{{ __('hmis_reports.patient_details') }}</h4>
<a href="#" class="btn btn-inverse btn-sm float-right">{{ __('hmis_reports.print') }}</a>
</div>
<!-- Widget heading END -->
<!-- Widget Body -->
<div class="widget-body table-responsive">
{{ $patients->links() }}
<!-- Table -->
<table class="table color-table success-table table-sm">
<!-- Table heading -->
<thead>
<tr>
<th>#</th>
<th>{{ __('hmis_reports.patient_names') }}</th>
<th>{{ __('hmis_reports.names') }}</th>
<th>{{ __('hmis_reports.date_of_birth') }}</th>
<th>{{ __('hmis_reports.gender') }}</th>
<th>{{ __('hmis_reports.phone') }}</th>
<th>{{ __('hmis_reports.category') }}</th>
<th>{{ __('hmis_reports.select') }}</th>
</tr>
</thead>
<tbody>
<?php
$numbering = 1;
foreach ($patients AS $patient):
?>
<tr class="gradeX">
<td>{{ $numbering }}</td>
<td>{{ $patient->number }}</td>
<td>{{ $patient->last_name . ' ' . $patient->first_name }}</td>
<td>{{ Carbon\Carbon::parse($patient->date_of_birth)->format('jS M Y') }}</td>
<td>{{ $patient->gender == 1 ? __('hmis_reports.male') : __('hmis_reports.female') }}</td>
<td>{{ $patient->phone }}</td>
<td>{{ isset($categories[$patient->category_id]) ? $categories[$patient->category_id] : 'NA' }}</td>
<td>
<form action="{{ url('/patient_episodes/set_patient_id/'.$patient->id)}}" method="POST">
@csrf()
<button class="btn btn-success btn-sm" style="display: inline;">{{ __('hmis_reports.select') }}</button>
</form>
</td>
</tr>
<?php
$numbering++;
endforeach;
if ($numbering == 1):
?>
<tr class="gradeX">
<td colspan="8" style="color: maroon; font-weight: bold;">{{ __('hmis_reports.no_records_found') }}</td>
</tr>
<?php endif; ?>
</tbody>
<!-- // Table body END -->
</table>
{{ $patients->links() }}
</div>
<!-- Widget Body END -->
</div>
<!-- // Widget END -->
</div>
@endsection
@@ -0,0 +1,279 @@
<?php
//if (isset($request->date_from) && isset($request->date_to)) {
//
// $attendance_from = Carbon::createFromFormat('d/m/Y', $request->date_from)->toDateString();
// $attendance_to = Carbon::createFromFormat('d/m/Y', $request->date_to)->toDateString();
//
// $search_button = $request->filterBtn;
//} else {
// $attendance_from = \Carbon\Carbon::today()->subDays(30)->format('Y-m-d');
// $attendance_to = date("Y-m-d");
//}
$alcohol_male_5to9 = [];
$alcohol_male_10to19 = [];
$alcohol_male_20plus = [];
$tobacco_male_5to9 = [];
$tobacco_male_10to19 = [];
$tobacco_male_20plus = [];
$alcohol_female_5to9 = [];
$alcohol_female_10to19 = [];
$alcohol_female_20plus = [];
$tobacco_female_5to9 = [];
$tobacco_female_10to19 = [];
$tobacco_female_20plus = [];
$query_behavior = "SELECT t.patient_id as patient_id, t.id as triage_id, t.observations as observations, t.created_at as create_date,"
. "d.date_of_birth as dob, d.gender as gender FROM triage t, patients d "
. "WHERE (t.created_at BETWEEN '{$attendance_from}' AND '{$attendance_to}')"
. " AND (patient_id = d.id) AND ((t.observations LIKE '%Alcohol use=High%') "
. "OR (t.observations LIKE '%Alcohol use=Moderate%') "
. "OR (t.observations LIKE '%Alcohol use=Low%') "
. "OR (t.observations LIKE '%Tobacco use=High%') "
. "OR (t.observations LIKE '%Tobacco use=Moderate%') "
. "OR (t.observations LIKE '%Tobacco use=Low%')) GROUP BY patient_id ORDER BY patient_id DESC";
$triage_results = DB::select($query_behavior);
if (count($triage_results) > 0) {
foreach ($triage_results as $triage_result) {
$dob = new \Carbon\Carbon($triage_result->dob);
$age = $dob->diffInYears($triage_result->create_date);
$age = intval($age);
$sex = $triage_result->gender;
$observation_explode = explode(",", $triage_result->observations);
if ($age > 5 && $age < 10) {
if ($sex == 1 && (in_array('Alcohol use=High', $observation_explode) || in_array('Alcohol use=Moderate', $observation_explode) || in_array('Alcohol use=Low', $observation_explode))) {
array_push($alcohol_male_5to9, $triage_result->patient_id);
}
if ($sex == 1 && (in_array('Tobacco use=High', $observation_explode) || in_array('Tobacco use=Moderate', $observation_explode) || in_array('Tobacco use=Low', $observation_explode))) {
array_push($tobacco_male_5to9, $triage_result->patient_id);
}
if ($sex == 2 && (in_array('Alcohol use=High', $observation_explode) || in_array('Alcohol use=Moderate', $observation_explode) || in_array('Alcohol use=Low', $observation_explode))) {
array_push($alcohol_female_5to9, $triage_result->patient_id);
}
if ($sex == 2 && (in_array('Tobacco use=High', $observation_explode) || in_array('Tobacco use=Moderate', $observation_explode) || in_array('Tobacco use=Low', $observation_explode))) {
array_push($tobacco_female_5to9, $triage_result->patient_id);
}
} elseif ($age > 10 && $age < 20) {
if ($sex == 1 && (in_array('Alcohol use=High', $observation_explode) || in_array('Alcohol use=Moderate', $observation_explode) || in_array('Alcohol use=Low', $observation_explode))) {
array_push($alcohol_male_10to19, $triage_result->patient_id);
}
if ($sex == 1 && (in_array('Tobacco use=High', $observation_explode) || in_array('Tobacco use=Moderate', $observation_explode) || in_array('Tobacco use=Low', $observation_explode))) {
array_push($tobacco_male_10to19, $triage_result->patient_id);
}
if ($sex == 2 && (in_array('Alcohol use=High', $observation_explode) || in_array('Alcohol use=Moderate', $observation_explode) || in_array('Alcohol use=Low', $observation_explode))) {
array_push($alcohol_female_10to19, $triage_result->patient_id);
}
if ($sex == 2 && (in_array('Tobacco use=High', $observation_explode) || in_array('Tobacco use=Moderate', $observation_explode) || in_array('Tobacco use=Low', $observation_explode))) {
array_push($tobacco_female_10to19, $triage_result->patient_id);
}
} elseif ($age > 20) {
if ($sex == 1 && (in_array('Alcohol use=High', $observation_explode) || in_array('Alcohol use=Moderate', $observation_explode) || in_array('Alcohol use=Low', $observation_explode))) {
array_push($alcohol_male_20plus, $triage_result->patient_id);
}
if ($sex == 1 && (in_array('Tobacco use=High', $observation_explode) || in_array('Tobacco use=Moderate', $observation_explode) || in_array('Tobacco use=Low', $observation_explode))) {
array_push($tobacco_male_20plus, $triage_result->patient_id);
}
if ($sex == 2 && (in_array('Alcohol use=High', $observation_explode) || in_array('Alcohol use=Moderate', $observation_explode) || in_array('Alcohol use=Low', $observation_explode))) {
array_push($alcohol_female_20plus, $triage_result->patient_id);
}
if ($sex == 2 && (in_array('Tobacco use=High', $observation_explode) || in_array('Tobacco use=Moderate', $observation_explode) || in_array('Tobacco use=Low', $observation_explode))) {
array_push($tobacco_female_20plus, $triage_result->patient_id);
}
}
}
}
?>
{{-- <tr style='background-color: #e8e4e4'>
<td class='center' style='font-weight: bold;'>1.3.9</td>
<td colspan='11'>RISKY BEHAVIOURS</td>
</tr> --}}
<tr>
<td colspan="2">RB01 - Alcohol use</td>
<td style='background-color: #e8e4e4'></td>
<td style='background-color: #e8e4e4'></td>
<td style='background-color: #e8e4e4'></td>
<td style='background-color: #e8e4e4'></td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Alcohol"/>
<input hidden name="sex" value="Males"/>
<input hidden name="age" value="20 to 24 years"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($alcohol_male_5to9) }}</textarea>
@if(count($alcohol_male_5to9) > 0)
<button class="btn btn-link">{{ count($alcohol_male_5to9) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($alcohol_male_5to9) !!}
@endif
</form>
</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Alcohol"/>
<input hidden name="sex" value="Females"/>
<input hidden name="age" value="20 to 24 years"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($alcohol_female_5to9) }}</textarea>
@if(count($alcohol_female_5to9) > 0)
<button class="btn btn-link">{{ count($alcohol_female_5to9) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($alcohol_female_5to9) !!}
@endif
</form>
</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Alcohol"/>
<input hidden name="sex" value="Males"/>
<input hidden name="age" value="10 to 19 years"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($alcohol_male_10to19) }}</textarea>
@if(count($alcohol_male_10to19) > 0)
<button class="btn btn-link">{{ count($alcohol_male_10to19) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($alcohol_male_10to19) !!}
@endif
</form>
</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Alcohol"/>
<input hidden name="sex" value="Females"/>
<input hidden name="age" value="10 to 19 years"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($alcohol_female_10to19) }}</textarea>
@if(count($alcohol_female_10to19) > 0)
<button class="btn btn-link">{{ count($alcohol_female_10to19) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($alcohol_female_10to19) !!}
@endif
</form>
</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Alcohol"/>
<input hidden name="sex" value="Males"/>
<input hidden name="age" value="25 years and above"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($alcohol_male_20plus) }}</textarea>
@if(count($alcohol_male_20plus) > 0)
<button class="btn btn-link">{{ count($alcohol_male_20plus) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($alcohol_male_20plus) !!}
@endif
</form>
</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Alcohol"/>
<input hidden name="sex" value="Females"/>
<input hidden name="age" value="25 years and above"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($alcohol_female_20plus) }}</textarea>
@if(count($alcohol_female_20plus) > 0)
<button class="btn btn-link">{{ count($alcohol_female_20plus) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($alcohol_female_20plus) !!}
@endif
</form>
</td>
</tr>
<tr>
<td colspan="2" >RB02 - Tobacco use</td>
<td style='background-color: #e8e4e4'></td>
<td style='background-color: #e8e4e4'></td>
<td style='background-color: #e8e4e4'></td>
<td style='background-color: #e8e4e4'></td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Tobacco"/>
<input hidden name="sex" value="Males"/>
<input hidden name="age" value="20 to 24 years"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($tobacco_male_5to9) }}</textarea>
@if(count($tobacco_male_5to9) > 0)
<button class="btn btn-link"> {{ count($tobacco_male_5to9) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($tobacco_male_5to9) !!}
@endif
</form>
</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Tobacco"/>
<input hidden name="sex" value="Females"/>
<input hidden name="age" value="20 to 24 years"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($tobacco_female_5to9) }}</textarea>
@if (count($tobacco_female_5to9) > 0)
<button class="btn btn-link">{{ count($tobacco_female_5to9) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($tobacco_female_5to9) !!}
@endif
</form>
</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Tobacco"/>
<input hidden name="sex" value="Males"/>
<input hidden name="age" value="10 to 19 years"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($tobacco_male_10to19) }}</textarea>
@if(count($tobacco_male_10to19) > 0)
<button class="btn btn-link">{{ count($tobacco_male_10to19) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($tobacco_male_10to19) !!}
@endif
</form>
</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Tobacco"/>
<input hidden name="sex" value="Females"/>
<input hidden name="age" value="10 to 19 years"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($tobacco_female_10to19) }}</textarea>
@if(count($tobacco_female_10to19) > 0)
<button class="btn btn-link">{{ count($tobacco_female_10to19) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($tobacco_female_10to19) !!}
@endif
</form>
</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Tobacco"/>
<input hidden name="sex" value="Males"/>
<input hidden name="age" value="25 years and above"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($tobacco_male_20plus) }}</textarea>
@if(count($tobacco_male_20plus) > 0)
<button class="btn btn-link">{{ count($tobacco_male_20plus) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($tobacco_male_20plus) !!}
@endif
</form>
</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Tobacco"/>
<input hidden name="sex" value="Females"/>
<input hidden name="age" value="25 years and above"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($tobacco_female_20plus) }}</textarea>
@if(count($tobacco_female_20plus) > 0)
<button class="btn btn-link">{{ count($tobacco_female_20plus) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($tobacco_female_20plus) !!}
@endif
</form>
</td>
</tr>
@@ -0,0 +1,175 @@
<table class="table table-sm table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th style="padding: 0px;" rowspan="2"><strong>Category</strong></th>
<th style="padding: 0px;" colspan="2" width="15%"><strong>0 - 28 Days</strong></th>
<th style="padding: 0px;" style="padding: 0px;" colspan="2" width="17%"><strong>29 Days - 4 Years</strong></th>
<th style="padding: 0px;" colspan="2" width="15%"><strong>5 - 9 Years</strong></th>
<th style="padding: 0px;" colspan="2" width="15%"><strong>10 - 19 Years</strong></th>
<th style="padding: 0px;" colspan="2" width="17%"><strong>20 Years & Above</strong></th>
</tr>
<tr>
<th>M</th>
<th>F</th>
<th>M</th>
<th>F</th>
<th>M</th>
<th>F</th>
<th>M</th>
<th>F</th>
<th>M</th>
<th>F</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>OA01</strong> New attendance</td>
<td>
<?php $serial_1 = serialize($patient_ids_male_0_28_days_new_attendance); ?>
<a href="<?php echo url("opd_attendance_details/{$serial_1}") ?>">
<?php echo count($patient_ids_male_0_28_days_new_attendance); ?>
</a>
</td>
<td>
<?php $serial_2 = serialize($patient_ids_female_0_28_days_new_attendance); ?>
<a href="<?php echo url("opd_attendance_details/{$serial_2}") ?>">
<?php echo count($patient_ids_female_0_28_days_new_attendance); ?>
</a>
</td>
<td>
<?php $serial_3 = serialize($patient_ids_male_29days_4yrs_new_attendance); ?>
<a href="<?php echo url("opd_attendance_details/{$serial_3}") ?>">
<?php echo count($patient_ids_male_29days_4yrs_new_attendance); ?>
</a>
</td>
<td>
<?php $serial_4 = serialize($patient_ids_female_29days_4yrs_new_attendance); ?>
<a href="<?php echo url("opd_attendance_details/{$serial_4}") ?>">
<?php echo count($patient_ids_female_29days_4yrs_new_attendance); ?>
</a>
</td>
<td>
<?php $serial_5 = serialize($patient_ids_male_5_9yrs_new_attendance); ?>
<a href="<?php echo url("opd_attendance_details/{$serial_5}") ?>">
<?php echo count($patient_ids_male_5_9yrs_new_attendance); ?>
</a>
</td>
<td>
<?php $serial_6 = serialize($patient_ids_female_5_9yrs_new_attendance); ?>
<a href="<?php echo url("opd_attendance_details/{$serial_6}") ?>">
<?php echo count($patient_ids_female_5_9yrs_new_attendance); ?>
</a>
</td>
<td>
<?php $serial_7 = serialize($patient_ids_male_10_19yrs_new_attendance); ?>
<a href="<?php echo url("opd_attendance_details/{$serial_7}") ?>">
<?php echo count($patient_ids_male_10_19yrs_new_attendance); ?>
</a>
</td>
<td>
<?php $serial_8 = serialize($patient_ids_female_10_19yrs_new_attendance); ?>
<a href="<?php echo url("opd_attendance_details/{$serial_8}") ?>">
<?php echo count($patient_ids_female_10_19yrs_new_attendance); ?>
</a>
</td>
<td>
<?php $serial_9 = serialize($patient_ids_male_20yrs_new_attendance); ?>
<a href="<?php echo url("opd_attendance_details/{$serial_9}") ?>">
<?php echo count($patient_ids_male_20yrs_new_attendance); ?>
</a>
</td>
<td>
<?php $serial_10 = serialize($patient_ids_female_20yrs_new_attendance); ?>
<a href="<?php echo url("opd_attendance_details/{$serial_10}") ?>">
<?php echo count($patient_ids_female_20yrs_new_attendance); ?>
</a>
</td>
</tr>
<tr>
<td><strong>OA02</strong> Reattendance</td>
<td>
<?php $serial_11 = serialize($patient_ids_male_0_28_days_re_attendance); ?>
<a href="<?php echo url("opd_attendance_details/{$serial_11}") ?>">
<?php echo count($patient_ids_male_0_28_days_re_attendance); ?>
</a>
</td>
<td>
<?php $serial_12 = serialize($patient_ids_female_0_28_days_re_attendance); ?>
<a href="<?php echo url("opd_attendance_details/{$serial_12}") ?>">
<?php echo count($patient_ids_female_0_28_days_re_attendance); ?>
</a>
</td>
<td>
<?php $serial_13 = serialize($patient_ids_male_29days_4yrs_re_attendance); ?>
<a href="<?php echo url("opd_attendance_details/{$serial_13}") ?>">
<?php echo count($patient_ids_male_29days_4yrs_re_attendance); ?>
</a>
</td>
<td>
<?php $serial_14 = serialize($patient_ids_female_29days_4yrs_re_attendance); ?>
<a href="<?php echo url("opd_attendance_details/{$serial_14}") ?>">
<?php echo count($patient_ids_female_29days_4yrs_re_attendance); ?>
</a>
</td>
<td>
<?php $serial_15 = serialize($patient_ids_male_5_9yrs_re_attendance); ?>
<a href="<?php echo url("opd_attendance_details/{$serial_15}") ?>">
<?php echo count($patient_ids_male_5_9yrs_re_attendance); ?>
</a>
</td>
<td>
<?php $serial_16 = serialize($patient_ids_female_5_9yrs_re_attendance); ?>
<a href="<?php echo url("opd_attendance_details/{$serial_16}") ?>">
<?php echo count($patient_ids_female_5_9yrs_re_attendance); ?>
</a>
</td>
<td>
<?php $serial_17 = serialize($patient_ids_male_10_19yrs_re_attendance); ?>
<a href="<?php echo url("opd_attendance_details/{$serial_17}") ?>">
<?php echo count($patient_ids_male_10_19yrs_re_attendance); ?>
</a>
</td>
<td>
<?php $serial_18 = serialize($patient_ids_female_10_19yrs_re_attendance); ?>
<a href="<?php echo url("opd_attendance_details/{$serial_18}") ?>">
<?php echo count($patient_ids_female_10_19yrs_re_attendance); ?>
</a>
</td>
<td>
<?php $serial_19 = serialize($patient_ids_male_20yrs_re_attendance); ?>
<a href="<?php echo url("opd_attendance_details/{$serial_19}") ?>">
<?php echo count($patient_ids_male_20yrs_re_attendance); ?>
</a>
</td>
<td>
<?php $serial_20 = serialize($patient_ids_female_20yrs_re_attendance); ?>
<a href="<?php echo url("opd_attendance_details/{$serial_20}") ?>">
<?php echo count($patient_ids_female_20yrs_re_attendance); ?>
</a>
</td>
</tr>
</tbody>
</table>
@@ -0,0 +1,343 @@
<table class="table table-condensed table-sm table-bordered table-hover" >
<thead>
<tr style="background-color: #e8e4e4">
<th class="center" colspan="2" rowspan="2" style="width: 50%;"><strong>Diagnosis Name</strong></th>
<th class="center" colspan="2"><strong>0 - 28 Days</strong></th>
<th class="center" colspan="2"><strong>29 Days - 4 Years</strong></th>
<th class="center" colspan="2"><strong>5 - 9 Years</strong></th>
<th class="center" colspan="2"><strong>10 - 19 Years</strong></th>
<th class="center" colspan="2"><strong>20 Years & Above</strong></th>
</tr>
<tr>
<th class="center"><strong>Male</strong></th>
<th class="center"><strong>Female</strong></th>
<th class="center"><strong>Male</strong></th>
<th class="center"><strong>Female</strong></th>
<th class="center"><strong>Male</strong></th>
<th class="center"><strong>Female</strong></th>
<th class="center"><strong>Male</strong></th>
<th class="center"><strong>Female</strong></th>
<th class="center"><strong>Male</strong></th>
<th class="center"><strong>Female</strong></th>
</tr>
</thead>
<tbody>
<?php
$hmis_categories_query = DB::table('hmis_categories')->select('id', 'number', 'title')->get();
$count = 1;
foreach ($hmis_categories_query as $hmis_category_row) {
echo "<tr style='background-color: #e8e4e4'><td class='center' style='font-weight: bold;'>"
. "" . $hmis_category_row->number . "</td><td colspan='11'>" . $hmis_category_row->title . "</td></tr>";
$diagnosis_query = DB::table('diagnoses')->select('id', 'name', 'hmis_no_outpatient', 'hmis_category')->where('hmis_category', $hmis_category_row->id)->orderBy('hmis_no_outpatient', 'desc')->get();
foreach ($diagnosis_query as $diagnosis_row) {
$OPDNo = $diagnosis_row->hmis_no_outpatient;
if (empty($OPDNo) || is_null($OPDNo) ||
trim($OPDNo) == '-' || ctype_digit(trim($OPDNo)) ||
trim($OPDNo) == '.' || trim($OPDNo) == '`'):
//continue;
endif;
$male_0_28_days = [];
$female_0_28_days = [];
$male_29days_4years = [];
$female_29days_4years = [];
$male_5_9years = [];
$female_5_9years = [];
$male_10_19years = [];
$female_10_19years = [];
$male_20years = [];
$female_20years = [];
if (!empty($attendance_from) && !empty($attendance_to)):
$consultations = DB::table('consultations')
->join('patients', 'consultations.patient_id', '=', 'patients.id')
->whereBetween('consultations.created_at', [$attendance_from, $attendance_to])
->select('patients.id as patient_id', 'patients.gender',
'patients.date_of_birth', 'consultations.primary_diagnosis',
'consultations.other_diagnoses', 'consultations.created_at')->get();
foreach ($consultations as $consultation) {
$dateOfBirth = \Carbon\Carbon::parse($consultation->date_of_birth);
//$dateCreated = \Carbon\Carbon::parse($consultation->created_at);
$currentDateTimeStamp = \Carbon\Carbon::now();
$diffInDays = $dateOfBirth->diffInDays($currentDateTimeStamp);
$patientId = $consultation->patient_id;
$gender = $consultation->gender;
$primaryDiaganosis = $consultation->primary_diagnosis;
$otherDiagnosis = is_null($consultation->other_diagnoses) ? [] : unserialize($consultation->other_diagnoses);
// 0 - 29 Days ===========================================================================================
// Male
if ($diffInDays >= 0 && $diffInDays <= 29 && $gender == 1): #1 means Male, 2 means a female, 3 others
if ($primaryDiaganosis == $diagnosis_row->id):
$male_0_28_days[] = $patientId;
endif;
if (in_array($diagnosis_row->id, $otherDiagnosis)):
$male_0_28_days[] = $patientId;
endif;
endif;
// Female
if ($diffInDays >= 0 && $diffInDays <= 29 && $gender == 2):
if ($primaryDiaganosis == $diagnosis_row->id):
$female_0_28_days[] = $patientId;
endif;
if (in_array($diagnosis_row->id, $otherDiagnosis)):
$female_0_28_days[] = $patientId;
endif;
endif;
// 29 - 4 Years ===========================================================================================
// Male
if ($diffInDays >= 28 && $diffInDays <= 1825 && $gender == 1):
if ($primaryDiaganosis == $diagnosis_row->id):
$male_29days_4years[] = $patientId;
endif;
if (in_array($diagnosis_row->id, $otherDiagnosis)):
$male_29days_4years[] = $patientId;
endif;
endif;
// Female
if ($diffInDays >= 28 && $diffInDays <= 1825 && $gender == 2):
if ($primaryDiaganosis == $diagnosis_row->id):
$female_29days_4years[] = $patientId;
endif;
if (in_array($diagnosis_row->id, $otherDiagnosis)):
$female_29days_4years[] = $patientId;
endif;
endif;
// 5 - 9 Years ===========================================================================================
// Male
if ($diffInDays >= 1826 && $diffInDays <= 3650 && $gender == 1):
if ($primaryDiaganosis == $diagnosis_row->id):
$male_5_9years[] = $patientId;
endif;
if (in_array($diagnosis_row->id, $otherDiagnosis)):
$male_5_9years[] = $patientId;
endif;
endif;
// Female
if ($diffInDays >= 1826 && $diffInDays <= 3650 && $gender == 2):
if ($primaryDiaganosis == $diagnosis_row->id):
$female_5_9years[] = $patientId;
endif;
if (in_array($diagnosis_row->id, $otherDiagnosis)):
$female_5_9years[] = $patientId;
endif;
endif;
// 10 - 19 Years ===========================================================================================
// Male
if ($diffInDays >= 3651 && $diffInDays <= 7300 && $gender == 1):
if ($primaryDiaganosis == $diagnosis_row->id):
$male_10_19years[] = $patientId;
endif;
if (in_array($diagnosis_row->id, $otherDiagnosis)):
$male_10_19years[] = $patientId;
endif;
endif;
// Female
if ($diffInDays >= 3651 && $diffInDays <= 7300 && $gender == 2):
if ($primaryDiaganosis == $diagnosis_row->id):
$female_10_19years[] = $patientId;
endif;
if (in_array($diagnosis_row->id, $otherDiagnosis)):
$female_10_19years[] = $patientId;
endif;
endif;
// 20 Years and above ===========================================================================================
// Male
if ($diffInDays >= 7301 && $gender == 1):
if ($primaryDiaganosis == $diagnosis_row->id):
$male_20years[] = $patientId;
endif;
if (in_array($diagnosis_row->id, $otherDiagnosis)):
$male_20years[] = $patientId;
endif;
endif;
// Female
if ($diffInDays >= 7301 && $gender == 2):
if ($primaryDiaganosis == $diagnosis_row->id):
$female_20years[] = $patientId;
endif;
if (in_array($diagnosis_row->id, $otherDiagnosis)):
$female_20years[] = $patientId;
endif;
endif;
}
endif;
?>
<tr>
@if(substr($OPDNo, 0, 3) == 'EP01')
<td class="center">{{ $OPDNo }}</td>
@else
<td class="center">{{ $OPDNo }}</td>
@endif
<td>{{ $diagnosis_row->name }}</td>
<td class="center">
<?php
$serial_41 = encrypt($male_0_28_days);
if (count($male_0_28_days) > 0):
?>
<a href='{{ url("opd-diagnosis-details/{$serial_41}") }}'>{{ count($male_0_28_days) }}</a>
<?php
else:
echo '0';
endif;
?>
</td>
<td class="center">
<?php
$serial_42 = encrypt($male_0_28_days);
if (count($female_0_28_days) > 0):
?>
<a href='{{ url("opd-diagnosis-details/{$serial_42}") }}'>{{ count($female_0_28_days) }}</a>
<?php
else:
echo '0';
endif;
?>
</td>
<td class="center">
<?php
$serial_43 = encrypt($male_29days_4years);
if (count($male_29days_4years) > 0):
?>
<a href='{{ url("opd-diagnosis-details/{$serial_43}") }}'>{{ count($male_29days_4years) }}</a>
<?php
else:
echo '0';
endif;
?>
</td>
<td class="center">
<?php
$serial_44 = encrypt($female_29days_4years);
if (count($female_29days_4years) > 0):
?>
<a href='{{ url("opd-diagnosis-details/{$serial_44}") }}'>{{ count($female_29days_4years) }}</a>
<?php
else:
echo '0';
endif;
?>
</td>
<td class="center">
<?php
$serial_45 = encrypt($male_5_9years);
if (count($male_5_9years) > 0):
?>
<a href='{{ url("opd-diagnosis-details/{$serial_45}") }}'>{{ count($male_5_9years) }}</a>
<?php
else:
echo '0';
endif;
?>
</td>
<td class="center">
<?php
$serial_46 = encrypt($female_5_9years);
if (count($female_5_9years) > 0):
?>
<a href='{{ url("opd-diagnosis-details/{$serial_46}") }}'>{{ count($female_5_9years) }}</a>
<?php
else:
echo '0';
endif;
?>
</td>
<td class="center text-center">
<?php
$serial_47 = encrypt($male_10_19years);
if (count($male_10_19years) > 0):
?>
<a href='{{ url("opd-diagnosis-details/{$serial_47}") }}'>{{ count($male_10_19years) }}</a>
<?php
else:
echo '0';
endif;
?>
</td>
<td class="center text-center">
<?php
$serial_48 = encrypt($female_10_19years);
if (count($female_10_19years) > 0):
?>
<a href='{{ url("opd-diagnosis-details/{$serial_48}") }}'>{{ count($female_10_19years) }}</a>
<?php
else:
echo '0';
endif;
?>
</td>
<td class="center">
<?php
$serial_49 = encrypt($male_20years);
if (count($male_20years) > 0):
?>
<a href='{{ url("opd-diagnosis-details/{$serial_49}") }}'>{{ count($male_20years) }}</a>
<?php
else:
echo '0';
endif;
?>
</td>
<td class="center">
<?php
$serial_50 = encrypt($female_20years);
if (count($female_20years) > 0):
?>
<a href='{{ url("opd-diagnosis-details/{$serial_50}") }}'>{{ count($female_20years) }}</a>
<?php
else:
echo '0';
endif;
?>
</td>
</tr>
<?php
$count++;
}
}
?>
@include('reports::hmis_reports.105.opd-risky-behaviours')
</tbody>
</table>
@@ -0,0 +1,366 @@
<?php
// 0 - 28 Days
$male_0_28_days_to = [];
$female_0_28_days_to = [];
$male_0_28_days_from = [];
$female_0_28_days_from = [];
//29days to 4 years
$male_29_4_years_to = [];
$female_29_4_years_to = [];
$male_29_4_years_from = [];
$female_29_4_years_from = [];
//5 - 9 Years
$male_5_9_years_to = [];
$female_5_9_years_to = [];
$male_5_9_years_from = [];
$female_5_9_years_from = [];
//10 - 19 Years
$male_10_19_years_to = [];
$female_10_19_years_to = [];
$male_10_19_years_from = [];
$female_10_19_years_from = [];
//> 20 Years
$male_20_years_to = [];
$female_20_years_to = [];
$male_20_years_from = [];
$female_20_years_from = [];
$episodes = DB::table('patient_episodes')->whereBetween('created_at', [$attendance_from, $attendance_to])->select('patient_id', 'triage_id', 'consultation_id', 'created_at')->get();
foreach ($episodes as $episode):
$patient = DB::table('patients')->select('id', 'date_of_birth', 'gender')->find($episode->patient_id);
if (!$patient):
continue;
endif;
$dateOfBirth = \Carbon\Carbon::parse($patient->date_of_birth);
$dateCreated = \Carbon\Carbon::parse($episode->created_at);
$diffInDays = $dateOfBirth->diffInDays($dateCreated);
$triageId = $episode->triage_id;
$consultationId = $episode->consultation_id;
// Referrals to UNIT
$triage = DB::table('triage')->select('referral')->find($triageId);
if ($triage):
if ($triage->referral != 1): // make sure its not a self referral
switch ($diffInDays) {
case ($diffInDays >= 0 && $diffInDays <= 29): // 0 - 28 days olds
if ($patient->gender == 1): // Males
$male_0_28_days_to[] = $patient->id;
endif;
if ($patient->gender == 2): // Females
$female_0_28_days_to[] = $patient->id;
endif;
break;
case ($diffInDays >= 28 && $diffInDays <= 1825): // 29 Days - 4 Years
if ($patient->gender == 1): // Males
$male_29_4_years_to[] = $patient->id;
endif;
if ($patient->gender == 2): // Females
$female_29_4_years_to[] = $patient->id;
endif;
break;
case ($diffInDays >= 1826 && $diffInDays <= 3650): // 5 - 9 Years
if ($patient->gender == 1): // Males
$male_5_9_years_to[] = $patient->id;
endif;
if ($patient->gender == 2): // Females
$female_5_9_years_to[] = $patient->id;
endif;
break;
case ($diffInDays >= 3651 && $diffInDays <= 7300): // 10 - 19 Years
if ($patient->gender == 1): // Males
$male_10_19_years_to[] = $patient->id;
endif;
if ($patient->gender == 2): // Females
$female_10_19_years_to[] = $patient->id;
endif;
break;
case ($diffInDays >= 7301): // 20 Years & Above
if ($patient->gender == 1): // Males
$male_20_years_to[] = $patient->id;
endif;
if ($patient->gender == 2): // Females
$female_20_years_to[] = $patient->id;
endif;
break;
default:
break;
}
endif;
endif;
// Referrals from UNIT
$consultation = DB::table('consultations')->select('outcome_id')->find($consultationId);
if ($consultation):
if (!empty($consultation) && $consultation->outcome_id == 4): // make sure the outcome if a referral outside the same hostpital
switch ($diffInDays) {
case ($diffInDays >= 0 && $diffInDays <= 29): // 0 - 28 days olds
if ($patient->gender == 1): // Males
$male_0_28_days_from[] = $patient->id;
endif;
if ($patient->gender == 2): // Females
$female_0_28_days_from[] = $patient->id;
endif;
break;
case ($diffInDays >= 28 && $diffInDays <= 1825): // 29 Days - 4 Years
if ($patient->gender == 1): // Males
$male_29_4_years_from[] = $patient->id;
endif;
if ($patient->gender == 2): // Females
$female_29_4_years_from[] = $patient->id;
endif;
break;
case ($diffInDays >= 1826 && $diffInDays <= 3650): // 5 - 9 Years
if ($patient->gender == 1): // Males
$male_5_9_years_from[] = $patient->id;
endif;
if ($patient->gender == 2): // Females
$female_5_9_years_from[] = $patient->id;
endif;
break;
case ($diffInDays >= 3651 && $diffInDays <= 7300): // 10 - 19 Years
if ($patient->gender == 1): // Males
$male_10_19_years_from[] = $patient->id;
endif;
if ($patient->gender == 2): // Females
$female_10_19_years_from[] = $patient->id;
endif;
break;
case ($diffInDays >= 7301): // 20 Years & Above
if ($patient->gender == 1): // Males
$male_20_years_from[] = $patient->id;
endif;
if ($patient->gender == 2): // Females
$female_20_years_from[] = $patient->id;
endif;
break;
default:
break;
}
endif;
endif;
endforeach;
?>
<table class="table table-sm table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th style="padding: 0px;" rowspan="2"><strong>Category</strong></th>
<th style="padding: 0px;" colspan="2" width="15%"><strong>0 - 28 Days</strong></th>
<th style="padding: 0px;" colspan="2" width="17%"><strong>29 Days - 4 Years</strong></th>
<th style="padding: 0px;" colspan="2" width="15%"><strong>5 - 9 Years</strong></th>
<th style="padding: 0px;" colspan="2" width="15%"><strong>10 - 19 Years</strong></th>
<th style="padding: 0px;" colspan="2" width="17%"><strong>20 Years & Above</strong></th>
</tr>
<tr>
<th>M</th>
<th>F</th>
<th>M</th>
<th>F</th>
<th>M</th>
<th>F</th>
<th>M</th>
<th>F</th>
<th>M</th>
<th>F</th>
</tr>
</thead>
<tbody>
<tr>
<td><span style="font-weight: bold">OR01</span> Referrals to unit</td>
<td>
<?php $serial_21 = encrypt($male_0_28_days_to); ?>
<a href="<?php echo url("opd_referral_details/{$serial_21}") ?>">
<?php echo count($male_0_28_days_to); ?>
</a>
</td>
<td>
<?php $serial_22 = encrypt($female_0_28_days_to); ?>
<a href="<?php echo url("opd_referral_details/{$serial_22}") ?>">
<?php echo count($female_0_28_days_to); ?>
</a>
</td>
<td>
<?php $serial_23 = encrypt($male_29_4_years_to); ?>
<a href="<?php echo url("opd_referral_details/{$serial_23}") ?>">
<?php echo count($male_29_4_years_to); ?>
</a>
</td>
<td>
<?php $serial_24 = encrypt($female_29_4_years_to); ?>
<a href="<?php echo url("opd_referral_details/{$serial_24}") ?>">
<?php echo count($female_29_4_years_to); ?>
</a>
</td>
<td>
<?php $serial_25 = encrypt($male_5_9_years_to); ?>
<a href="<?php echo url("opd_referral_details/{$serial_25}") ?>">
<?php echo count($male_5_9_years_to); ?>
</a>
</td>
<td>
<?php $serial_26 = encrypt($female_5_9_years_to); ?>
<a href="<?php echo url("opd_referral_details/{$serial_26}") ?>">
<?php echo count($female_5_9_years_to); ?>
</a>
</td>
<td>
<?php $serial_27 = encrypt($male_5_9_years_to); ?>
<a href="<?php echo url("opd_referral_details/{$serial_27}") ?>">
<?php echo count($male_5_9_years_to); ?>
</a>
</td>
<td>
<?php $serial_28 = encrypt($female_5_9_years_to); ?>
<a href="<?php echo url("opd_referral_details/{$serial_28}") ?>">
<?php echo count($female_5_9_years_to); ?>
</a>
</td>
<td>
<?php $serial_29 = encrypt($male_20_years_to); ?>
<a href="<?php echo url("opd_referral_details/{$serial_29}") ?>">
<?php echo count($male_20_years_to); ?>
</a>
</td>
<td>
<?php $serial_30 = encrypt($female_20_years_to); ?>
<a href="<?php echo url("opd_referral_details/{$serial_30}") ?>">
<?php echo count($female_20_years_to); ?>
</a>
</td>
</tr>
<tr>
<td><strong>OR02</strong> Referrals from unit</td>
<td>
<?php $serial_31 = encrypt($male_0_28_days_from); ?>
<a href="<?php echo url("opd_referral_details/{$serial_31}") ?>">
<?php echo count($male_0_28_days_from); ?>
</a>
</td>
<td>
<?php $serial_32 = encrypt($female_0_28_days_from); ?>
<a href="<?php echo url("opd_referral_details/{$serial_32}") ?>">
<?php echo count($female_0_28_days_from); ?>
</a>
</td>
<td>
<?php $serial_33 = encrypt($male_29_4_years_from); ?>
<a href="<?php echo url("opd_referral_details/{$serial_33}") ?>">
<?php echo count($male_29_4_years_from); ?>
</a>
</td>
<td>
<?php $serial_34 = encrypt($female_29_4_years_from); ?>
<a href="<?php echo url("opd_referral_details/{$serial_34}") ?>">
<?php echo count($female_29_4_years_from); ?>
</a>
</td>
<td>
<?php $serial_35 = encrypt($male_5_9_years_from); ?>
<a href="<?php echo url("opd_referral_details/{$serial_35}") ?>">
<?php echo count($male_5_9_years_from); ?>
</a>
</td>
<td>
<?php $serial_36 = encrypt($female_5_9_years_from); ?>
<a href="<?php echo url("opd_referral_details/{$serial_36}") ?>">
<?php echo count($female_5_9_years_from); ?>
</a>
</td>
<td>
<?php $serial_37 = encrypt($male_10_19_years_from); ?>
<a href="<?php echo url("opd_referral_details/{$serial_37}") ?>">
<?php echo count($male_10_19_years_from); ?>
</a>
</td>
<td>
<?php $serial_38 = encrypt($female_10_19_years_from); ?>
<a href="<?php echo url("opd_referral_details/{$serial_38}") ?>">
<?php echo count($female_10_19_years_from); ?>
</a>
</td>
<td>
<?php $serial_39 = encrypt($male_20_years_from); ?>
<a href="<?php echo url("opd_referral_details/{$serial_39}") ?>">
<?php echo count($male_20_years_from); ?>
</a>
</td>
<td>
<?php $serial_40 = encrypt($female_20_years_from); ?>
<a href="<?php echo url("opd_referral_details/{$serial_40}") ?>">
<?php echo count($female_20_years_from); ?>
</a>
</td>
</tr>
</tbody>
</table>
@@ -0,0 +1,333 @@
<div class="col">
<table class="table table-sm table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th colspan="2"><strong>2.3 POSTNATAL</strong></th>
<th><strong>NUMBER</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>
PN01.Post Natal Attendances
</td>
<td colspan="2" style="width: 50%">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td rowspan="5">Age group</td>
<td>Below 15 years</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>15-19 years</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>20-24 years</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>25-49 years</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>50+ years</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td rowspan="4">Timing</td>
<td>24 Hours</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>6 Days</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>6 Weeks</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>6 Months</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
PN02. Referrals to PNC unit
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Total referrals</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>From community services</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
PN03. Breast feeding mothers tested for HIV 1st time during Postnatal
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Total (TR & TRR)</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>HIV+ (TRR)</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
PN04.Breastfeeding mothers re-tested for HIV during Postnatal
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Total (TR+ & TRR+)</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>TRR+</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
PN05. HIV+ women initiating ART in Postnatal
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Total HIV+</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>New Positives (TRR)</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>Positive on re-test (TRR+)</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>Positives but never initiated in ANC, Labour and Delivery (TRRK)</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col">
<table class="table table-sm table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th colspan="2"><strong>2.3 POSTNATAL</strong></th>
<th><strong>NUMBER</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2">
PN06.HIV+ breastfeeding mothers newly enrolled in MCH groups
</td>
<td><a href="">0</a></td>
</tr>
<tr>
<td colspan="2">
PN07: Mother-baby pairs enrolled at Mother-Baby care point
</td>
<td><a href="">0</a></td>
</tr>
<tr>
<td>
PN08. Male partners received HIV test results in the postnatal setting
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Total (TR & TRR)</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>HIV+ (TRR)</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td colspan="2">
PN09. HIV+ male partners initiated on ART in the postnatal setting
</td>
<td><a href="">0</a></td>
</tr>
<tr>
<td>
PN10.Breast feeding mothers given self-testing kits for their male partners
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Total</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>Tests returned HIV+</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>Tests returned HIV negative</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td colspan="2">
PN11. Number of discordant couples identified in PNC
</td>
<td><a href="">0</a></td>
</tr>
<tr>
<td>
PN12. Cancer of the breast
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Clients screened for Cancer of the breast</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>Clients with pre-malignant conditions of breast</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
PN13. Cancer of the Cervix
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Clients screened for Cancer of the Cervix</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>Clients with pre-malignant conditions of cervix</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
PN14. Lactating mothers who received Nutritional assessment
</td>
<td colspan="2">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td>Total</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>HIV+</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
PN15. Post-natal mothers who received Counselling
</td>
<td colspan="2" style="width: 50%">
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td rowspan="2">Maternal Nutritional</td>
<td>Total</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>HIV+</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td rowspan="2">Infant Feeding</td>
<td>Total</td>
<td><a href="#">0</a></td>
</tr>
<tr>
<td>HIV+</td>
<td><a href="#">0</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
@@ -0,0 +1,124 @@
<!DOCTYPE html>
<html lang = "{{ app()->getLocale() }}">
<head>
<meta charset = "utf-8">
<meta http-equiv = "X-UA-Compatible" content = "IE=edge">
<meta name = "viewport" content = "width=device-width, initial-scale=1">
<meta name = "description" content = "">
<meta name = "author" content = "">
<link rel = "icon" type = "image/png" sizes = "16x16" href = "{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
<title>{{ config('app.name', 'HMIS Report 105 - Stre@mline') }}</title>
<!-- Bootstrap Core CSS -->
<link href = "{{ asset('bootstrap/css/bootstrap.min.css') }}" rel = "stylesheet">
<style type = "text-css">
body {
/*font-size: 1.2em;*/
}
thead {
display: table-header-group;
}
tfoot {
display: table-row-group;
}
tr {
page-break-inside: avoid;
}
</style>
</head>
<body>
<div class = "container-fluid">
<img style = "max-width: 100px; max-height: 150px;" src = "{{ asset('uploads/streamline_images/coat_of_arms.png') }}" class = "mx-auto d-block mx-3" alt = "Responsive image">
<h2 class = "heading" style = "text-align: center;">HMIS FORM 105: HEALTH UNIT OUTPATIENT MONTHLY REPORT</h2>
<div class = "row">
<div class = "col">
<table class = "" width = "100%">
<tbody>
<tr>
<th>Health Unit</th>
<td colspan = "2">{{ $hospital_information->name }}</td>
</tr>
<tr>
<th>District</th>
<td colspan = "2">{{ get_name($hospital_information->district, 'id','name','districts') }}</td>
</tr>
<tr>
<th>Subcounty</th>
<td colspan = "2">{{ get_name($hospital_information->sub_county,'id','name','subcounties') }}</td>
</tr>
<tr>
<th>Report Type</th>
<td width = "23%">
National &nbsp;<input type = "checkbox">
</td>
<td width = "23%">
Refugee &nbsp;<input type = "checkbox">
</td>
<td width = "23%">
Foreigner &nbsp;<input type = "checkbox">
</td>
</tr>
</tbody>
</table>
</div>
<div class = "col-xs-5">
<table class = "" width = "100%">
<tr>
<th>Level</th>
<td>{{ $hospital_information->level }}</td>
</tr>
<tr>
<th>Health Sub-District</th>
<td>{{ $hospital_information->sub_district }}</td>
</tr>
<tr>
<th>Reporting Period</th>
<td>
<code>{{ \Carbon\Carbon::createFromFormat('Y-m-d',$attendance_from)->format('d m Y') }}</code>
to <code>{{ \Carbon\Carbon::createFromFormat('Y-m-d',$attendance_to)->format('d m Y') }}</code>
</td>
</tr>
</table>
</div>
<div class = "col-xs-2">
<table class = "table table-borderless">
<tr>
<th>Code</th>
<td>{{ $hospital_information->code }}</td>
</tr>
</table>
</div>
</div>
<div class = "row mt-3">
<div class = "col">
<h5 align = "left">1.1 OUTPATIENT ATTENDANCE</h5>
@include('reports::hmis_reports.105.opd_attendance')
</div>
<div class = "col">
<h5 align = "left">1.2 OUTPATIENT REFERRALS</h5>
@include('reports::hmis_reports.105.opd_referrals')
</div>
</div>
<div class = "row my-3">
<div class = "col-auto">
<h5 align = "left">1.3 OUTPATIENT DIAGNOSES</h5>
@include('reports::hmis_reports.105.opd_diagnoses')
</div>
</div>
@include('reports::hmis_reports.105.lab-routine-tests')
</div>
</body>
</html>
@@ -0,0 +1,123 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" sizes="16x16"
href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
<title>{{ config('app.name', 'Streamline') }}</title>
<!-- Bootstrap Core CSS -->
<link href="{{ asset('elite/bootstrap/dist/css/bootstrap.min.css') }}" rel="stylesheet">
<!-- Custom CSS -->
<link href="{{ asset('elite/css/style.css') }}" rel="stylesheet">
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
font-size: 14px;
/* line-height: 1.2; */
}
thead {
display: table-header-group;
}
tfoot {
display: table-row-group;
}
strong {
font-weight: bold;
}
tr {
page-break-before: always;
page-break-after: always;
page-break-inside: avoid;
}
.heading {
background-color: rgba(0, 0, 0, 0.075) !important;
font-weight: bold;
}
#test>td {
writing-mode: vertical-lr;
}
.heading2 {
background-color: rgba(0, 0, 0, 0.075) !important;
font-weight: bold;
pointer-events: none;
/* text-align: center; */
}
</style>
</head>
<body>
<div class="white-box">
@php
$hospital_information = \Streamline\Models\HospitalInformation::find(1);
$attendance_to = !empty($dates['end'])? $dates['end']:$dates['days'].'-'.$dates['last_month'].'-'.$dates['last_year'];
$attendance_from = !empty($dates['start'])? $dates['start']:'01-'.$dates['last_month'].'-'.$dates['last_year'];
@endphp
<img style="max-width: 300px; max-height: 100px;" src="{{ asset('uploads/streamline_images/coat_of_arms.png') }}" class="mx-auto d-block mx-3" alt="Responsive image">
<p class="h6 text-center mt-0 font-weight-bold">Ministry of Health</p>
<h3 class="heading" style="text-align: center; text-decoration: underline;">{{ __('hmis_reports.hmis_105') }}</h3>
<div class="row" id="hospital_info">
<div class="col">
<table class="table table-sm table-borderless">
<tr>
<th>{{ __('hmis_reports.health_unit') }}</th>
<td>{{ $hospital_information->name }}</td>
</tr>
<tr>
<th>{{ strtoupper(__('hmis_reports.district')) }}</th>
<td>{{ get_name($hospital_information->district, 'id','name','districts') }}</td>
</tr>
<tr>
<th>{{ strtoupper(__('hmis_reports.subcounty')) }}</th>
<td>{{ get_name($hospital_information->sub_county,'id','name','subcounties') }}</td>
</tr>
<tr>
<th>{{strtoupper( __('hmis_reports.code')) }}</th>
<td>{{ $hospital_information->code }}</td>
</tr>
</table>
</div>
<div class="col">
<table class="table table-sm table-borderless">
<tr>
<th>{{ __('hmis_reports.level') }}</th>
<td>{{ $hospital_information->level }}</td>
</tr>
<tr>
<th>{{ __('hmis_reports.health_sub_district') }}</th>
<td>{{ $hospital_information->sub_district }}</td>
</tr>
<tr>
<th>{{ __('hmis_reports.reporting_period') }}</th>
<td>
<code>{{ streamline_date($attendance_from) }}</code> {{ __('hmis_reports.to') }} <code>{{ streamline_date($attendance_to) }}</code>
</td>
</tr>
<tr>
<th>{{ strtoupper( __('hmis_reports.selected_report_type')) }}</th>
<td>{{ (!empty($dates['citizenship']) && $dates['citizenship'] == '1')? 'National':'Foreigner / Non Ugandan' }}</td>
</tr>
</table>
</div>
</div>
@if ($page == 'Outpatient Diagnoses')
{{-- <div class="text-center">
<p><h3><strong>{{ __('hmis_reports.hmis_108_report_admissions_deaths') }}</strong></h3></p>
</div> --}}
<div class="row">
@include('reports::hmis_reports.105.monthly_diagnoses')
</div>
@endif
</div>
</body>
</html>
@@ -0,0 +1,126 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h5 class="page-title">RISKY BEHAVIOUR DETAILS</h5>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">Dashboard</a></li>
<li><a href="{{ url('risky_behaviour') }}">Risky behaviour</a></li>
<li class="active">Risky behavior details</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
<h3 class="heading" style="text-align: center; text-decoration: underline;">RISKY BEHAVIOUR DETAILS</h3>
<div class="row">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th></th>
<th>Patient Number</th>
<th>Full Names</th>
<th>Gender</th>
<th>Age</th>
<th>Phone</th>
<th></th>
</tr>
</thead>
<tbody>
@php $counter = 1; @endphp
@if(count($patients_results) > 0)
@foreach($patients_results as $patient)
@php $dob = new Carbon\Carbon($patient->date_of_birth); @endphp
<tr>
<td>{{ $counter }}.</td>
<td>{{ $patient->number }}</td>
<td>{!! insurance_flag($patient->id) !!}</td>
<td>{{ $patient->gender == 1 ? "Male" : "Female" }}</td>
<td>{{ $dob->diffInYears(Carbon\Carbon::now()) }}yrs</td>
<td>{{ $patient->phone }}</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $patient->id }}" class="btn btn-success btn-xs">Select</a>
</td>
</tr>
@php $counter++; @endphp
@endforeach
@else
<tr class="warning"><td class="center" colspan="10">No records found</td></tr>
@endif
</tbody>
</table>
</div>
{{-- <strong>Total number of patients: <span id="total" style=" color:blue;">{{ count($patients_results) }}</span></strong> --}}
</div>
</div>
@endsection
@push('scripts')
<!-- Typehead Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
<!-- Data table javascript -->
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
jQuery('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy',
});
$('.table').DataTable({
dom: 'Bfrtip',
order:[],
buttons: [{
extend: 'copy',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5]
},
title: 'Risky Behaviour Details'
},
{
extend: 'csv',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5]
},
title: 'Risky Behaviour Details'
},
{
extend: 'pdf',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5]
},
title: 'Risky Behaviour Details'
},
{
extend: 'print',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5]
},
title: 'Risky Behaviour Details'
}
]
});
</script>
@endpush
@@ -0,0 +1,281 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h5 class="page-title">RISKY BEHAVIOUR</h5>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">Dashboard</a></li>
<li><a href="{{ url('list_memorised_reports') }}">Memorised stre@mline reports</a></li>
<li class="active">Risky behaviours</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
<h3 class="heading" style="text-align: center; text-decoration: underline;">RISKY BEHAVIOUR</h3>
<div class="row">
<div class="col-sm-4">
Showing results from <span class="label label-info">{{ streamline_date($attendance_from) }}</span> to <span class="label label-info">{{ streamline_date($attendance_to) }}</span>
</div>
<div class="col-sm-1">
{{ Form::open(['url' => '/hmis/105/risky-behaviours','data-toggle'=>'validator']) }}
{{ Form::label('date_from','Date From') }}
</div>
<div class="col-sm-2">
<div class="input-group">
{{ Form::text('date_from','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-from']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
<div class="col-sm-1">
{{ Form::label('date_to','Date To') }}
</div>
<div class="col-sm-2">
<div class="input-group">
{{ Form::text('date_to','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-to']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
<div class="col-sm-2">
{{ Form::submit('Search',['name' => 'filterBtn','class' => 'btn btn-success']) }}
{{ Form::close() }}
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-12">
<h5 align="left">RISKY BEHAVIOUR</h5>
<table class="table table-condensed table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th rowspan="2" colspan="2"><h5 align="left">1.3.9 RISKY BEHAVIOURS</h5></th>
<th class="center" colspan="3">MALE</th>
<th class="center" colspan="3">FEMALE</th>
</tr>
<tr>
<th>5 - 9 Years</th>
<th>10 - 19 Years</th>
<th> >=20 Years</th>
<th>5 - 9 Years</th>
<th>10 - 19 Years</th>
<th> >=20 Years</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2" style="width: 50%;">R1 - Alcohol use</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Alcohol"/>
<input hidden name="sex" value="Males"/>
<input hidden name="age" value="20 to 24 years"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($alcohol_male_5to9) }}</textarea>
@if(count($alcohol_male_5to9) > 0)
<button class="btn btn-link">{{ count($alcohol_male_5to9) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($alcohol_male_5to9) !!}
@endif
</form>
</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Alcohol"/>
<input hidden name="sex" value="Males"/>
<input hidden name="age" value="10 to 19 years"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($alcohol_male_10to19) }}</textarea>
@if(count($alcohol_male_10to19) > 0)
<button class="btn btn-link">{{ count($alcohol_male_10to19) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($alcohol_male_10to19) !!}
@endif
</form>
</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Alcohol"/>
<input hidden name="sex" value="Males"/>
<input hidden name="age" value="25 years and above"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($alcohol_male_20plus) }}</textarea>
@if(count($alcohol_male_20plus) > 0)
<button class="btn btn-link">{{ count($alcohol_male_20plus) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($alcohol_male_20plus) !!}
@endif
</form>
</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Alcohol"/>
<input hidden name="sex" value="Females"/>
<input hidden name="age" value="20 to 24 years"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($alcohol_female_5to9) }}</textarea>
@if(count($alcohol_female_5to9) > 0)
<button class="btn btn-link">{{ count($alcohol_female_5to9) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($alcohol_female_5to9) !!}
@endif
</form>
</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Alcohol"/>
<input hidden name="sex" value="Females"/>
<input hidden name="age" value="10 to 19 years"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($alcohol_female_10to19) }}</textarea>
@if(count($alcohol_female_10to19) > 0)
<button class="btn btn-link">{{ count($alcohol_female_10to19) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($alcohol_female_10to19) !!}
@endif
</form>
</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Alcohol"/>
<input hidden name="sex" value="Females"/>
<input hidden name="age" value="25 years and above"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($alcohol_female_20plus) }}</textarea>
@if(count($alcohol_female_20plus) > 0)
<button class="btn btn-link">{{ count($alcohol_female_20plus) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($alcohol_female_20plus) !!}
@endif
</form>
</td>
</tr>
<tr>
<td colspan="2" style="width: 50%;">R2 - Tobacco use</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Tobacco"/>
<input hidden name="sex" value="Males"/>
<input hidden name="age" value="20 to 24 years"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($tobacco_male_5to9) }}</textarea>
@if(count($tobacco_male_5to9) > 0)
<button class="btn btn-link"> {{ count($tobacco_male_5to9) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($tobacco_male_5to9) !!}
@endif
</form>
</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Tobacco"/>
<input hidden name="sex" value="Males"/>
<input hidden name="age" value="10 to 19 years"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($tobacco_male_10to19) }}</textarea>
@if(count($tobacco_male_10to19) > 0)
<button class="btn btn-link">{{ count($tobacco_male_10to19) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($tobacco_male_10to19) !!}
@endif
</form>
</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Tobacco"/>
<input hidden name="sex" value="Males"/>
<input hidden name="age" value="25 years and above"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($tobacco_male_20plus) }}</textarea>
@if(count($tobacco_male_20plus) > 0)
<button class="btn btn-link">{{ count($tobacco_male_20plus) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($tobacco_male_20plus) !!}
@endif
</form>
</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Tobacco"/>
<input hidden name="sex" value="Females"/>
<input hidden name="age" value="20 to 24 years"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($tobacco_female_5to9) }}</textarea>
@if (count($tobacco_female_5to9) > 0)
<button class="btn btn-link">{{ count($tobacco_female_5to9) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($tobacco_female_5to9) !!}
@endif
</form>
</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Tobacco"/>
<input hidden name="sex" value="Females"/>
<input hidden name="age" value="10 to 19 years"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($tobacco_female_10to19) }}</textarea>
@if(count($tobacco_female_10to19) > 0)
<button class="btn btn-link">{{ count($tobacco_female_10to19) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($tobacco_female_10to19) !!}
@endif
</form>
</td>
<td>
<form action="{{ url('/hmis/105/risky-behaviours/drill-down') }}" method="POST">
@csrf
<input hidden name="behaviour" value="Tobacco"/>
<input hidden name="sex" value="Females"/>
<input hidden name="age" value="25 years and above"/>
<textarea name="patient_ids" style="display: none;">{{ serialize($tobacco_female_20plus) }}</textarea>
@if(count($tobacco_female_20plus) > 0)
<button class="btn btn-link">{{ count($tobacco_female_20plus) }}</button>
@else
{!! '&nbsp;&nbsp;&nbsp;' . count($tobacco_female_20plus) !!}
@endif
</form>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<!-- Typehead Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
<!-- Data table javascript -->
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
jQuery('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy',
});
</script>
@endpush
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,182 @@
<div class="col" style="padding: 5px;">
<table class="table table-sm table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th colspan="12"><strong>1.4 Tuberculosis and Leprosy services</strong></th>
</tr>
</thead>
<tbody>
<tr style="background-color: #e8e4e4">
<td rowspan="2" colspan="2"></td>
<td colspan="2">< 5 years</td>
<td colspan="2">5-9 years</td>
<td colspan="2">10-14 years</td>
<td colspan="2">15-19 years</td>
<td colspan="2">20+ years</td>
</tr>
<tr>
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
</tr>
<tr>
<td colspan="2"><strong>TB Screening in OPD</strong></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="2">TP01. Number screened for TB in OPD</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="2">TP02. Number of presumptive TB cases identified from OPD</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="2">TP03. Number of presumptive cases diagnosed with TB from OPD</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background-color: #e8e4e4;">
<td colspan="2"><strong>Registration in TB Treatment Unit</strong></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="2">TP04. Total New and relapse TB cases registered in TB treatment unit</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background-color: #e8e4e4;">
<td colspan="2"><strong>TB Preventive Therapy (TPT)</strong></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="2">TP05. Number of contacts of TB patients started on TPT</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="2">TP06. Number of ART clients started on TPT</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background-color: #e8e4e4;">
<td colspan="12"><strong>Leprosy services</strong></td>
</tr>
<tr>
<td rowspan="2">
TP07. New and relapse leprosy cases registered
</td>
<td>
PB (Paucibacillary)
</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>MB (MultiBacillary)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
@@ -0,0 +1,953 @@
<div class="col">
<table class="table table-condensed table-bordered table-hover">
<table class="table table-condensed table-bordered table-hover">
<tbody>
<tr class="heading">
<td colspan="10">6. NUMBER OF ADMISSIONS AND DEATHS BY DIAGNOSIS</td>
</tr>
<tr class="heading">
<td colspan="2" rowspan="4">Diagnosis</td>
</tr>
<tr class="heading">
<td colspan="4">Cases</td>
<td colspan="4">Deaths</td>
</tr>
<tr class="heading">
<td colspan="2">Under five years</td>
<td colspan="2">Five years and above</td>
<td colspan="2">Under five years</td>
<td colspan="2">Five years and above</td>
</tr>
<tr class="heading">
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
</tr>
<tr class="heading2">
<td colspan="10">6.1 Communicable Diseases</td>
</tr>
@for ($i=0;$i<7;$i++)
<tr class="heading2">
<td colspan="10">{{ $table_options[$i]['category_number'].'. '.$table_options[$i]['category_name'] }}</td>
</tr>
@foreach ($table_options[$i]['category_options'] as $category_option)
@if (!empty($category_option['dependent_options']))
<tr>
<td rowspan="{{ count($category_option['dependent_options']) + 1 }}" class="rowspan">{{ $category_option['number'].'. '.$category_option['name'] }}</td>
</tr>
@foreach ($category_option['dependent_options'] as $dependent_option)
<tr>
@php
$option_id =$dependent_option['id'];
$option_count =array_filter($diagnoses_data, function ($item) use ($option_id) {
return $item['dependent_option'] == $option_id;
});
$case_male_under_five = $case_female_under_five = $case_male_over_five = $case_female_over_five = [];
$deaths_male_under_five = $deaths_female_under_five = $deaths_male_over_five = $deaths_female_over_five = [];
foreach ($option_count as $options){
foreach ($options['primary'] as $option) {
if($option['gender'] == '1'){
if ($option['age'] < 5) {
if ($option['outcome_id'] == '5') $deaths_male_under_five[] = $option['patient_id'];
else $case_male_under_five[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_male_over_five[] = $option['patient_id'];
else $case_male_over_five[] = $option['patient_id'];
}
}elseif ($option['gender'] == '2') {
if ($option['age'] < 5) {
if ($option['outcome_id'] == '5') $deaths_female_under_five[] = $option['patient_id'];
else $case_female_under_five[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_female_over_five[] = $option['patient_id'];
else $case_female_over_five[] = $option['patient_id'];
}
}
}
foreach ($options['other'] as $option){
if($option['gender'] == '1'){
if ($option['age'] < 5) {
if ($option['outcome_id'] == '5') $deaths_male_under_five[] = $option['patient_id'];
else $case_male_under_five[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_male_over_five[] = $option['patient_id'];
else $case_male_over_five[] = $option['patient_id'];
}
}elseif ($option['gender'] == '2') {
if ($option['age'] < 5) {
if ($option['outcome_id'] == '5') $deaths_female_under_five[] = $option['patient_id'];
else $case_female_under_five[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_female_over_five[] = $option['patient_id'];
else $case_female_over_five[] = $option['patient_id'];
}
}
}
}
@endphp
<td>{{ $dependent_option['number'].'. '.$dependent_option['name'] }}</td>
<td>
@if (!empty($case_male_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_case_male_under_five_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_case_male_under_five' }}>{{ commas(count($case_male_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
{{-- {{ count($case_male_under_five) }} --}}
</td>
<td>
@if (!empty($case_female_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'case_female_under_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'case_female_under_five' }}>{{ commas(count($case_female_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
{{-- {{ count($case_female_under_five) }} --}}
</td>
<td>
@if (!empty($case_male_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'case_male_over_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_over_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'case_male_over_five' }}>{{ commas(count($case_male_over_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
{{-- {{ count($case_male_over_five) }} --}}
</td>
<td>
@if (!empty($case_female_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'case_female_over_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_over_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'case_female_over_five' }}>{{ commas(count($case_female_over_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
{{-- {{ count($case_female_over_five) }} --}}
</td>
<td>
@if (!empty($deaths_male_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'deaths_male_under_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_male_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'deaths_male_under_five' }}>{{ commas(count($deaths_male_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
{{-- {{ count($deaths_male_under_five) }} --}}
</td>
<td>
@if (!empty($deaths_female_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'deaths_female_under_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_female_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'deaths_female_under_five' }}>{{ commas(count($deaths_female_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
{{-- {{ count($deaths_female_under_five) }} --}}
</td>
<td>
@if (!empty($deaths_male_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'deaths_male_over_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_male_over_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'deaths_male_over_five' }}>{{ commas(count($deaths_male_over_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
{{-- {{ count($deaths_male_over_five) }} --}}
</td>
<td>
@if (!empty($deaths_female_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'deaths_female_over_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_female_over_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'deaths_female_over_five' }}>{{ commas(count($deaths_female_over_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
{{-- {{ count($deaths_female_over_five) }} --}}
</td>
</tr>
@endforeach
@else
<tr>
@php
$option_id =$category_option['id'];
$option_count =array_filter($diagnoses_data, function ($item) use ($option_id) {
return $item['hmis_category_option'] == $option_id;
});
$case_male_under_five = $case_female_under_five = $case_male_over_five = $case_female_over_five = [];
$deaths_male_under_five = $deaths_female_under_five = $deaths_male_over_five = $deaths_female_over_five = [];
foreach ($option_count as $options){
foreach ($options['primary'] as $option) {
if($option['gender'] == '1'){
if ($option['age'] < 5) {
if ($option['outcome_id'] == '5') $deaths_male_under_five[] = $option['patient_id'];
else $case_male_under_five[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_male_over_five[] = $option['patient_id'];
else $case_male_over_five[] = $option['patient_id'];
}
}elseif ($option['gender'] == '2') {
if ($option['age'] < 5) {
if ($option['outcome_id'] == '5') $deaths_female_under_five[] = $option['patient_id'];
else $case_female_under_five[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_female_over_five[] = $option['patient_id'];
else $case_female_over_five[] = $option['patient_id'];
}
}
}
foreach ($options['other'] as $option){
if($option['gender'] == '1'){
if ($option['age'] < 5) {
if ($option['outcome_id'] == '5') $deaths_male_under_five[] = $option['patient_id'];
else $case_male_under_five[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_male_over_five[] = $option['patient_id'];
else $case_male_over_five[] = $option['patient_id'];
}
}elseif ($option['gender'] == '2') {
if ($option['age'] < 5) {
if ($option['outcome_id'] == '5') $deaths_female_under_five[] = $option['patient_id'];
else $case_female_under_five[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_female_over_five[] = $option['patient_id'];
else $case_female_over_five[] = $option['patient_id'];
}
}
}
}
@endphp
<td colspan="2">{{ $category_option['number'].'. '.$category_option['name'] }}</td>
<td>
@if (!empty($case_male_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_case_male_under_five_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_case_male_under_five' }}>{{ commas(count($case_male_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_under_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_under_five' }}>{{ commas(count($case_female_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_male_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_male_over_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_over_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_male_over_five' }}>{{ commas(count($case_male_over_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_over_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_over_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_over_five' }}>{{ commas(count($case_female_over_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($deaths_male_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'deaths_male_under_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_male_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'deaths_male_under_five' }}>{{ commas(count($deaths_male_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($deaths_female_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'deaths_female_under_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_female_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'deaths_female_under_five' }}>{{ commas(count($deaths_female_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($deaths_male_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'deaths_male_over_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_male_over_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'deaths_male_over_five' }}>{{ commas(count($deaths_male_over_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($deaths_female_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'deaths_female_over_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_female_over_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'deaths_female_over_five' }}>{{ commas(count($deaths_female_over_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
@endif
@endforeach
@endfor
<tr class="heading2">
<td colspan="10">6.2 Non communicable diseases</td>
</tr>
@for ($i=7;$i<22;$i++)
<tr class="heading2">
<td colspan="10">{{ $table_options[$i]['category_number'].'. '.$table_options[$i]['category_name'] }}</td>
</tr>
@foreach ($table_options[$i]['category_options'] as $category_option)
@if (!empty($category_option['dependent_options']))
<tr>
@php
$rowspan = count($category_option['dependent_options']) + 1;
@endphp
<td rowspan="{{ count($category_option['dependent_options']) + 1 }}" class="rowspan">{{ $category_option['number'].'. '.$category_option['name'] }}</td>
</tr>
@foreach ( $category_option['dependent_options'] as $dependent_option)
<tr>
@php
$option_id =$dependent_option['id'];
$option_count =array_filter($diagnoses_data, function ($item) use ($option_id) {
return $item['dependent_option'] == $option_id;
});//dd($diagnoses_data);
$case_male_under_five = $case_female_under_five = $case_male_over_five = $case_female_over_five = [];
$deaths_male_under_five = $deaths_female_under_five = $deaths_male_over_five = $deaths_female_over_five = [];
foreach ($option_count as $options){
foreach ($options['primary'] as $option) {
if($option['gender'] == '1'){
if ($option['age'] < 5) {
if ($option['outcome_id'] == '5') $deaths_male_under_five[] = $option['patient_id'];
else $case_male_under_five[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_male_over_five[] = $option['patient_id'];
else $case_male_over_five[] = $option['patient_id'];
}
}elseif ($option['gender'] == '2') {
if ($option['age'] < 5) {
if ($option['outcome_id'] == '5') $deaths_female_under_five[] = $option['patient_id'];
else $case_female_under_five[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_female_over_five[] = $option['patient_id'];
else $case_female_over_five[] = $option['patient_id'];
}
}
}
foreach ($options['other'] as $option){
if($option['gender'] == '1'){
if ($option['age'] < 5) {
if ($option['outcome_id'] == '5') $deaths_male_under_five[] = $option['patient_id'];
else $case_male_under_five[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_male_over_five[] = $option['patient_id'];
else $case_male_over_five[] = $option['patient_id'];
}
}elseif ($option['gender'] == '2') {
if ($option['age'] < 5) {
if ($option['outcome_id'] == '5') $deaths_female_under_five[] = $option['patient_id'];
else $case_female_under_five[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_female_over_five[] = $option['patient_id'];
else $case_female_over_five[] = $option['patient_id'];
}
}
}
}
@endphp
<td>{{ $dependent_option['number'].'. '.$dependent_option['name'] }}</td>
<td>
@if (!empty($case_male_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_case_male_under_five_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_case_male_under_five' }}>{{ commas(count($case_male_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'case_female_under_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'case_female_under_five' }}>{{ commas(count($case_female_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_male_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'case_male_over_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_over_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'case_male_over_five' }}>{{ commas(count($case_male_over_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'case_female_over_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_over_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'case_female_over_five' }}>{{ commas(count($case_female_over_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($deaths_male_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'deaths_male_under_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_male_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'deaths_male_under_five' }}>{{ commas(count($deaths_male_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($deaths_female_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'deaths_female_under_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_female_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'deaths_female_under_five' }}>{{ commas(count($deaths_female_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($deaths_male_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'deaths_male_over_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_male_over_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'deaths_male_over_five' }}>{{ commas(count($deaths_male_over_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($deaths_female_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $dependent_option['number'].'_'.'deaths_female_over_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_female_over_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $dependent_option['number'].'_'.'deaths_female_over_five' }}>{{ commas(count($deaths_female_over_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
@endforeach
@else
<tr>
@php
$option_id =$category_option['id'];
$option_count =array_filter($diagnoses_data, function ($item) use ($option_id) {
return $item['hmis_category_option'] == $option_id;
});
$case_male_under_five = $case_female_under_five = $case_male_over_five = $case_female_over_five = [];
$deaths_male_under_five = $deaths_female_under_five = $deaths_male_over_five = $deaths_female_over_five = [];
foreach ($option_count as $options){
foreach ($options['primary'] as $option) {
if($option['gender'] == '1'){
if ($option['age'] < 5) {
if ($option['outcome_id'] == '5') $deaths_male_under_five[] = $option['patient_id'];
else $case_male_under_five[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_male_over_five[] = $option['patient_id'];
else $case_male_over_five[] = $option['patient_id'];
}
}elseif ($option['gender'] == '2') {
if ($option['age'] < 5) {
if ($option['outcome_id'] == '5') $deaths_female_under_five[] = $option['patient_id'];
else $case_female_under_five[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_female_over_five[] = $option['patient_id'];
else $case_female_over_five[] = $option['patient_id'];
}
}
}
foreach ($options['other'] as $option){
if($option['gender'] == '1'){
if ($option['age'] < 5) {
if ($option['outcome_id'] == '5') $deaths_male_under_five[] = $option['patient_id'];
else $case_male_under_five[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_male_over_five[] = $option['patient_id'];
else $case_male_over_five[] = $option['patient_id'];
}
}elseif ($option['gender'] == '2') {
if ($option['age'] < 5) {
if ($option['outcome_id'] == '5') $deaths_female_under_five[] = $option['patient_id'];
else $case_female_under_five[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_female_over_five[] = $option['patient_id'];
else $case_female_over_five[] = $option['patient_id'];
}
}
}
}
@endphp
<td colspan="2">{{ $category_option['number'].'. '.$category_option['name'] }}</td>
<td>
@if (!empty($case_male_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_case_male_under_five_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_case_male_under_five' }}>{{ commas(count($case_male_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_under_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_under_five' }}>{{ commas(count($case_female_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_male_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_male_over_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_over_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_male_over_five' }}>{{ commas(count($case_male_over_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_over_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_over_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_over_five' }}>{{ commas(count($case_female_over_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($deaths_male_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'deaths_male_under_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_male_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'deaths_male_under_five' }}>{{ commas(count($deaths_male_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($deaths_female_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'deaths_female_under_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_female_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'deaths_female_under_five' }}>{{ commas(count($deaths_female_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($deaths_male_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'deaths_male_over_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_male_over_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'deaths_male_over_five' }}>{{ commas(count($deaths_male_over_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($deaths_female_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'deaths_female_over_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_female_over_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'deaths_female_over_five' }}>{{ commas(count($deaths_female_over_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
@endif
@endforeach
@endfor
</tbody>
</table>
<table class="table table-condensed table-bordered table-hover">
<tbody>
<tr class="heading">
<td rowspan="3" class="rowspan"></td>
</tr>
<tr class="heading">
<td colspan="5">Cases</td>
<td colspan="5">Deaths</td>
</tr>
<tr id='test' class="heading">
<td>Below 15 Years</td>
<td>15-19 Years</td>
<td>20-24 Years</td>
<td>25-49 Years</td>
<td>50+ Years</td>
<td>Below 15 Years</td>
<td>15-19 Years</td>
<td>20-24 Years</td>
<td>25-49 Years</td>
<td>50+ Years</td>
</tr>
@for ($i=22;$i<24;$i++)
<tr class="heading2">
<td colspan="11">{{ $table_options[$i]['category_number'].'. '.$table_options[$i]['category_name'] }}</td>
</tr>
@foreach ($table_options[$i]['category_options'] as $category_option)
@php
$option_id =$category_option['id'];
$option_count =array_filter($diagnoses_data, function ($item) use ($option_id) {
return $item['hmis_category_option'] == $option_id;
});
$case_female_under_15 = $case_female_15_19 = $case_female_20_24 = $case_female_25_49 = $case_female_50 = [];
$deaths_female_under_15 = $deaths_female_15_19 = $deaths_female_20_24 = $deaths_female_25_49 = $deaths_female_50 = [];
foreach ($option_count as $options){
foreach ($options['primary'] as $option) {
if ($option['age'] < 15) {
if ($option['outcome_id'] == '5') $deaths_female_under_15[] = $option['patient_id'];
else $case_female_under_15[] = $option['patient_id'];
} elseif ($option['age'] > 14 && $option['age'] < 20 ) {
if ($option['outcome_id'] == '5') $deaths_female_15_19[] = $option['patient_id'];
else $case_female_15_19[] = $option['patient_id'];
} elseif ($option['age'] > 19 && $option['age'] < 25) {
if ($option['outcome_id'] == '5') $deaths_female_20_24[] = $option['patient_id'];
else $case_female_20_24[] = $option['patient_id'];
} elseif ($option['age'] > 24 && $option['age'] < 50) {
if ($option['outcome_id'] == '5') $deaths_female_25_49[] = $option['patient_id'];
else $case_female_25_49[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_female_50[] = $option['patient_id'];
else $case_female_50[] = $option['patient_id'];
}
}
foreach ($options['other'] as $option){
if ($option['age'] < 15) {
if ($option['outcome_id'] == '5') $deaths_female_under_15[] = $option['patient_id'];
else $case_female_under_15[] = $option['patient_id'];
} elseif ($option['age'] > 14 && $option['age'] < 20 ) {
if ($option['outcome_id'] == '5') $deaths_female_15_19[] = $option['patient_id'];
else $case_female_15_19[] = $option['patient_id'];
} elseif ($option['age'] > 19 && $option['age'] < 25) {
if ($option['outcome_id'] == '5') $deaths_female_20_24[] = $option['patient_id'];
else $case_female_20_24[] = $option['patient_id'];
} elseif ($option['age'] > 24 && $option['age'] < 50) {
if ($option['outcome_id'] == '5') $deaths_female_25_49[] = $option['patient_id'];
else $case_female_25_49[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_female_50[] = $option['patient_id'];
else $case_female_50[] = $option['patient_id'];
}
}
}
@endphp
<tr>
<td style="width: 50%">{{ $category_option['number'].'. '.$category_option['name'] }}</td>
<td>
@if (!empty($case_female_under_15))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_under_15'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_under_15) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_under_15' }}>{{ commas(count($case_female_under_15)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_15_19))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_15_19'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_15_19) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_15_19' }}>{{ commas(count($case_female_15_19)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_20_24))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_20_24'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_20_24) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_20_24' }}>{{ commas(count($case_female_20_24)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_25_49))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_25_49'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_25_49) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_25_49' }}>{{ commas(count($case_female_25_49)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_50))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_50'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_50) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_50' }}>{{ commas(count($case_female_50)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($deaths_female_under_15))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'deaths_female_under_15'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_female_under_15) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'deaths_female_under_15' }}>{{ commas(count($deaths_female_under_15)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($deaths_female_15_19))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'deaths_female_15_19'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_female_15_19) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'deaths_female_15_19' }}>{{ commas(count($deaths_female_15_19)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($deaths_female_20_24))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'deaths_female_20_24'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_female_20_24) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'deaths_female_20_24' }}>{{ commas(count($deaths_female_20_24)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($deaths_female_25_49))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'deaths_female_25_49'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_female_25_49) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'deaths_female_25_49' }}>{{ commas(count($deaths_female_25_49)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($deaths_female_50))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'deaths_female_50'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_female_50) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'deaths_female_50' }}>{{ commas(count($deaths_female_50)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
@endforeach
@endfor
</tbody>
</table>
<table class="table table-condensed table-bordered table-hover">
<tbody>
<tr class="heading">
<td rowspan="4">Diagnosis</td>
</tr>
<tr class="heading">
<td colspan="4">Cases</td>
<td colspan="4">Deaths</td>
</tr>
<tr class="heading">
<td colspan="2">Under five years</td>
<td colspan="2">Five years and above</td>
<td colspan="2">Under five years</td>
<td colspan="2">Five years and above</td>
</tr>
<tr class="heading">
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
</tr>
<tr class="heading2">
<td colspan="9">{{ $table_options[count($table_options)-1]['category_number'].'. '.$table_options[count($table_options)-1]['category_name'] }}</td>
</tr>
@foreach ($table_options[count($table_options)-1]['category_options'] as $category_option)
<tr>
@php
$option_id =$category_option['id'];
$option_count =array_filter($diagnoses_data, function ($item) use ($option_id) {
return $item['hmis_category_option'] == $option_id;
});
$case_male_under_five = $case_female_under_five = $case_male_over_five = $case_female_over_five = [];
$deaths_male_under_five = $deaths_female_under_five = $deaths_male_over_five = $deaths_female_over_five = [];
foreach ($option_count as $options){
foreach ($options['primary'] as $option) {
if($option['gender'] == '1'){
if ($option['age'] < 5) {
if ($option['outcome_id'] == '5') $deaths_male_under_five[] = $option['patient_id'];
else $case_male_under_five[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_male_over_five[] = $option['patient_id'];
else $case_male_over_five[] = $option['patient_id'];
}
}elseif ($option['gender'] == '2') {
if ($option['age'] < 5) {
if ($option['outcome_id'] == '5') $deaths_female_under_five[] = $option['patient_id'];
else $case_female_under_five[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_female_over_five[] = $option['patient_id'];
else $case_female_over_five[] = $option['patient_id'];
}
}
}
foreach ($options['other'] as $option){
if($option['gender'] == '1'){
if ($option['age'] < 5) {
if ($option['outcome_id'] == '5') $deaths_male_under_five[] = $option['patient_id'];
else $case_male_under_five[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_male_over_five[] = $option['patient_id'];
else $case_male_over_five[] = $option['patient_id'];
}
}elseif ($option['gender'] == '2') {
if ($option['age'] < 5) {
if ($option['outcome_id'] == '5') $deaths_female_under_five[] = $option['patient_id'];
else $case_female_under_five[] = $option['patient_id'];
} else {
if ($option['outcome_id'] == '5') $deaths_female_over_five[] = $option['patient_id'];
else $case_female_over_five[] = $option['patient_id'];
}
}
}
}
@endphp
<td>{{ $category_option['number'].'. '.$category_option['name'] }}</td>
<td>
@if (!empty($case_male_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_case_male_under_five_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_case_male_under_five' }}>{{ commas(count($case_male_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_under_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_under_five' }}>{{ commas(count($case_female_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_male_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_male_over_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_over_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_male_over_five' }}>{{ commas(count($case_male_over_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_over_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_over_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_over_five' }}>{{ commas(count($case_female_over_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($deaths_male_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'deaths_male_under_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_male_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'deaths_male_under_five' }}>{{ commas(count($deaths_male_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($deaths_female_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'deaths_female_under_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_female_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'deaths_female_under_five' }}>{{ commas(count($deaths_female_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($deaths_male_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'deaths_male_over_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_male_over_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'deaths_male_over_five' }}>{{ commas(count($deaths_male_over_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($deaths_female_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'deaths_female_over_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($deaths_female_over_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'deaths_female_over_five' }}>{{ commas(count($deaths_female_over_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@@ -0,0 +1,180 @@
<div class="col">
<table class="table table-condensed table-bordered table-hover">
<thead>
<tr style="background-color: #e8e4e4"><td colspan="8">1. {{ __('hmis_reports.census_info') }}</td></tr>
<tr style="background-color: #e8e4e4">
<th class="center" style="width: 50%;">(A)</th>
<th class="center">(B)</th>
<th class="center">(C)</th>
<th class="center">(D)</th>
<th class="center">(E)</th>
<th class="center">(F)</th>
<th class="center">(G)</th>
<th class="center">(H)</th>
</tr>
<tr style="background-color: #e8e4e4">
<th style="width: 50%;">List of wards</th>
<th>No. of Beds</th>
<th>Admissions</th>
<th>Deaths</th>
<th>Patient days</th>
<th>Average length of stay = E / C</th>
<th>Average Occupancy = E / No. of days in month</th>
<th>Bed Occupancy = G x 100 / B</th>
</tr>
</thead>
<tbody>
@php
$count = $total_beds = $total_admissions = $total_deaths = $total_days = 0;
$total_patient_ids = $total_dead_ids = [];
@endphp
@foreach ($ward_data as $ward)
<tr>
@php
$g = round($ward['days_count'] / $dates['days'],3);
$f = ($ward['admissions'] > 0)? round($ward['days_count'] / $ward['admissions'],3):0;
$bed_occupancy = ($ward['ward_beds'] > 0)? round(($g * 100) / $ward['ward_beds'],3):0;
$total_beds += $ward['ward_beds'];
$total_admissions += $ward['admissions'];
$total_deaths +=$ward['deaths'];
$total_days += $ward['days_count'];
$patient_ids = serialize($ward['patient_ids']);
$dead_ids = serialize($ward['dead_ids']);
if(!empty( $ward['patient_ids'])) foreach( $ward['patient_ids'] as $id) $total_patient_ids[] = $id;
if(!empty( $ward['dead_ids'])) foreach($ward['dead_ids'] as $dead_id) $total_dead_ids[] = $dead_id;
$admission_form_id = $ward['id'].'_drill';
$deaths_form_id = 'deaths_'.$ward['id'].'_drill';
@endphp
<td style="width: 40%;">{{ $ward['ward_name'] }} </td>
<td>{{ commas($ward['ward_beds']) }}</td>
<td>
@if (!empty($ward['admissions']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"$admission_form_id"]) }}
<input type="hidden" name="patients" id="patients" value='{{ $patient_ids }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="{{ $ward['id'] }}">{{ commas($ward['admissions']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($ward['deaths']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"$deaths_form_id"]) }}
<input type="hidden" name="patients" id="patients" value='{{ $dead_ids }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="{{ 'deaths_'.$ward['id'] }}">{{ commas($ward['deaths']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>{{ commas($ward['days_count']) }}</td>
<td>{{ $f }}</td>
<td>{{ $g }}</td>
<td>{{ $bed_occupancy }}</td>
</tr>
@endforeach
<tr>
@php
$total_g = round($total_days / $dates['days'],3);
$total_f = ($total_admissions > 0)? round($total_days / $total_admissions, 3):0;
$total_bed_occupancy = ($total_beds > 0)? round(($total_g * 100) / $total_beds,3):0;
$self_referred_ids = serialize($referral_data['self_referred_ids']);
$referred_from_ids = serialize($referral_data['referred_from_ids']);
$ran_away_ids = serialize($referral_data['ran_away_ids']);
$referred_to_ids = serialize($referral_data['referred_to_ids']);
$total_ids = serialize($total_patient_ids);
@endphp
<td style="width: 40%; font-weight: bold;" class="float-right">Totals </td>
<td>{{ commas($total_beds) }}</td>
<td>
@if (!empty($total_admissions))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>'total_admissions_drill']) }}
<input type="hidden" name="patients" id="patients" value='{{ $total_ids }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="total_admissions">{{ commas($total_admissions) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($total_deaths))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>'total_deaths_drill']) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($total_dead_ids) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="total_deaths">{{ commas($total_deaths) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>{{ commas($total_days) }}</td>
<td>{{ $total_f }}</td>
<td>{{ $total_g }}</td>
<td>{{ $total_bed_occupancy }}</td>
</tr>
</tbody>
</table>
<table class="table table-condensed table-bordered table-hover">
<tbody>
<tr class="heading">
<td >2. REFERRALS</td>
<td>NUMBERS</td>
</tr>
<tr>
<td>RF01. No. of Inpatients referred from this health unit</td>
<td>
@if (!empty($referral_data['referred_from']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>'referred_from_drill']) }}
<input type="hidden" name="patients" id="patients" value='{{ $referred_from_ids }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="referred_from">{{ commas($referral_data['referred_from']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
<tr>
<td>RF02. No. of Inpatients referred to the health unit</td>
<td>
@if (!empty($referral_data['referred_to']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>'referred_to_drill']) }}
<input type="hidden" name="patients" id="patients" value='{{ $referred_to_ids }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="referred_to">{{ commas($referral_data['referred_to']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
<tr>
<td>RF03. No. of inpatients who have self-referred</td>
<td>
@if (!empty($referral_data['self_referred']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>'self_referred_drill']) }}
<input type="hidden" name="patients" id="patients" value='{{ $self_referred_ids }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="self_referred">{{ commas($referral_data['self_referred']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
<tr>
<td>RF04. No. of inpatients who have run-away</td>
<td>
@if (!empty($referral_data['ran_away']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>'ran_away_drill']) }}
<input type="hidden" name="patients" id="patients" value='{{ $ran_away_ids }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="ran_away">{{ commas($referral_data['ran_away']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
</tbody>
</table>
</div>
@@ -0,0 +1,141 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@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">{{ __('hmis_reports.patient_details') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list/hmis-reports') }}"> {{ __('hmis_reports.hmis_reports') }}</a></li>
<li><a href="{{ url()->previous() }}">Report</a></li>
<li class="active">{{ __('hmis_reports.details') }}</li>
</ol>
</div>
</div>
<div class='white-box'>
<!-- Widget -->
<div class="widget">
<!-- Widget heading END -->
<!-- Widget Body -->
<div class="widget-body table-responsive">
<!-- Table -->
<table id="table" class="table color-table success-table table-sm">
<!-- Table heading -->
<thead>
<tr>
<th>#</th>
<th>{{ __('hmis_reports.patient_number') }}</th>
<th>{{ !empty($diagnoses)? __('hmis_reports.diagnoses'): __('hmis_reports.names') }}</th>
<th>{{ __('hmis_reports.date_of_birth') }}</th>
<th>{{ __('hmis_reports.gender') }}</th>
<th>{{ __('hmis_reports.phone') }}</th>
<th>{{ __('hmis_reports.category') }}</th>
<th>{{ __('hmis_reports.select') }}</th>
</tr>
</thead>
<tbody>
<?php
$numbering = 1;
foreach ($patients AS $patient):
$id = $patient->id; $diag_ids = $diagnosis_names = [];
if(!empty($diagnoses)){
$diagnosis =array_filter($diagnoses, function ($item) use ($id) {
return $item['patient_id'] == $id;
});
foreach ($diagnosis as $diag) foreach ($diag['diagnoses'] as $value)$diag_ids[] = $value;
$patient_diagnoses = \Streamline\Models\Diagnosis::whereIn('id', $diag_ids)->get(['id','name']);
foreach ($patient_diagnoses as $name) $diagnosis_names[] = $name->name;
}
?>
<tr class="gradeX">
<td>{{ $numbering }}</td>
<td>{{ $patient->number }}</td>
<td>
@if (!empty($diagnoses))
{{ implode(', ', $diagnosis_names) }}
@else
{{ ucwords(strtolower($patient->first_name . ' ' . $patient->last_name)) }}
@endif
</td>
<td>{{ Carbon\Carbon::parse($patient->date_of_birth)->format('jS M Y') }}</td>
<td>{{ $patient->gender == 1 ? 'Male' : 'Female' }}</td>
<td>{{ $patient->phone }}</td>
<td>{{ isset($categories[$patient->category_id]) ? $categories[$patient->category_id] : 'NA' }}</td>
<td>
@if (Auth::user()->can('view-patients-home'))
<a href="/patient_episodes/set_patient_id/{{ $patient->id }}" class="btn btn-success btn-sm">{{ __('hmis_reports.select') }}</a>
@endif
</td>
</tr>
<?php $numbering++; endforeach; ?>
</tbody>
<!-- // Table body END -->
</table>
</div>
<!-- Widget Body END -->
</div>
<!-- // Widget END -->
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script type="text/javascript">
$('#table').DataTable({
dom: 'Bfrtip',
pageLength:20,
aaSorting: [],
columnDefs: [ {
targets: [7, 6, 0, 5], /* column index */
orderable: false, /* true or false */
}],
buttons: [
{
extend: 'csv',
exportOptions: {
columns: [0,1,2,3,4,5,6]
},
title: 'HMIS 108 - Health Unit Inpatient Monthly Report -Patient details'
},
{
extend: 'pdf',
exportOptions: {
columns: [0,1,2,3,4,5,6]
},
title: 'HMIS 108 - Health Unit Inpatient Monthly Report -Patient details'
},
{
extend: 'print',
exportOptions: {
columns: [0,1,2,3,4,5,6]
},
title: 'HMIS 108 - Health Unit Inpatient Monthly Report -Patient details'
}
]
});
</script>
@endpush
@@ -0,0 +1,242 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<style>
.heading {
background-color: rgba(0, 0, 0, 0.075) !important;
font-weight: bold;
pointer-events: none;
text-align: center;
}
.heading2 {
background-color: rgba(0, 0, 0, 0.075) !important;
font-weight: bold;
pointer-events: none;
/* text-align: center; */
}
#test>td {
writing-mode: vertical-lr;
}
.rowspan {
pointer-events: none;
}
</style>
@endpush
@php
$hospital_info = \Streamline\Models\HospitalInformation::find(1);
@endphp
@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">{{ __('hmis_reports.hmis_108_report') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list/hmis-reports') }}"> {{ __('hmis_reports.hmis_reports') }}</a></li>
<li><a href="#" class="active">HMIS 108 - {{ ucfirst($page) }}</a></li>
</ol>
</div>
</div>
@include('flash::message')
<div class="white-box">
<h3 class="heading" style="text-align: center; text-decoration: underline;">{{ __('hmis_reports.hmis_108') }}</h3>
<div class="row" style="display: inline-table">
{{ Form::open(['url' => Request::url(), 'method' => 'ANY', 'role' => 'search', 'id' => 'search_form']) }}
<div class="input-daterange input-group col-md-6" id="date-range">
<span class="input-group-addon bg-inverse b-0 text-white">{{ __('hmis_reports.from') }}</span>
<input type="text" class="form-control required" name="date_from" id="date-from" value="<?php echo !empty($dates['start'])? date('Y-m-d', strtotime($dates['start'])):''; ?>" readonly required />
<span class="input-group-addon bg-inverse b-0 text-white">{{ __('hmis_reports.to') }}</span>
<input type="text" class="form-control required" name="date_to" id="date-to" value="<?php echo !empty($dates['end'])? date('Y-m-d', strtotime($dates['end'])):''; ?>" readonly required />
<span class="input-group-addon bg-inverse b-0 text-white"> Report type</span>
<select class="form-control required" id="type" name="type" required>
<option value="" disabled>{{ __('hmis_reports.select_report_type') }}</option>
<option value="1" <?php echo ($dates['citizenship'] == '1')? 'selected':''; ?>>National</option>
<option value="" disabled>Refugee</option>
<option value="0" <?php echo ($dates['citizenship'] == '0')? 'selected':''; ?>>Foreigner / Non Ugandan</option>
</select>
</div>
<div class="col-md-2">
<button class="btn btn-success waves-effect waves-light" type="submit" style="border-radius: 5px;" disabled="disabled">
<span class="glyphicon glyphicon-search"></span> {{ __('hmis_reports.search') }}</button>
</div>
{{ Form::close() }}
<div class="col-md-2">
<a href="#" onclick="export_to_excel();" title="Download {{ __('hmis_reports.hmis_108_report') }} CSV"
style="border-radius: 5px;" class="btn btn-inverse waves-effect waves-light">
<span class="glyphicon glyphicon-download"></span> Download CSV
</a>
</div>
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.print_Hmis_108_information', 'target' => "_blank"]) }}
@if ($page == 'census')
<input type="hidden" name="ward_data" id="ward_data" value='{{ serialize($ward_data) }}' />
<input type="hidden" name="referral_data" id="referral_data" value='{{ serialize($referral_data) }}' />
@elseif ($page == 'procedures')
<input type="hidden" name="table_options" id="table_options" value='{{ serialize($table_options) }}' />
<input type="hidden" name="counted_procedures" id="counted_procedures" value='{{ serialize($counted_procedures) }}' />
@elseif ($page == 'Utilization of Special Services')
<input type="hidden" name="table_options" id="table_options" value='{{ serialize($table_options) }}' />
<input type="hidden" name="counted_investigations" id="counted_investigations" value='{{ serialize($counted_investigations) }}' />
@elseif ($page == 'radiology and Imaging')
<input type="hidden" name="table_options" id="table_options" value='{{ serialize($table_options) }}' />
<input type="hidden" name="counted_investigations" id="counted_investigations" value='{{ serialize($counted_investigations) }}' />
@elseif ($page == 'Admissions and Deaths by Diagnosis')
<input type="hidden" name="table_options" id="table_options" value='{{ serialize($table_options) }}' />
<input type="hidden" name="diagnoses_data" id="diagnoses_data" value='{{ serialize($diagnoses_data) }}' />
@elseif ($page == 'Mental Health')
<input type="hidden" name="table_options" id="table_options" value='{{ serialize($table_options) }}' />
<input type="hidden" name="diagnoses_data" id="diagnoses_data" value='{{ serialize($diagnoses_data) }}' />
@elseif ($page == 'others')
<input type="hidden" name="table_options" id="table_options" value='{{ serialize($table_options) }}' />
@endif
<input type="hidden" name="dates" id="dates" value='{{ serialize($dates) }}' />
<input type="hidden" name="page" id="page" value='{{ $page }}' />
<div class="col-md-2">
<button class="btn btn-inverse waves-effect waves-light float-right" type="submit" style="border-radius: 5px;">
<span class="glyphicon glyphicon-print"></span> {{ __('hmis_reports.print') }}</button>
</div>
{{ Form::close() }}
</div>
<br /><br />
<div class="row">
<div class="col-md-4">
<table class="table table-condensed table-borderless">
<tr>
<td>{{ __('hmis_reports.health_unit') }} : {{ $hospital_info->name }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.subcounty') }} : {{ get_name($hospital_info->sub_county,'id', 'name', 'subcounties') }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.parish') }} : {{ get_name($hospital_info->parish,'id', 'name', 'parishes') }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.district') }} : {{ get_name($hospital_info->district,'id', 'name', 'districts') }}</td>
</tr>
</table>
</div>
<div class="col-md-4">
<table class="table table-condensed table-borderless">
<tr>
<td>{{ __('hmis_reports.code') }} : {{ $hospital_info->code }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.level') }} : {{ $hospital_info->level }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.health_sub_district') }} : {{ $hospital_info->sub_district }}</td>
</tr>
</table>
</div>
<div class="col-md-4">
<table class="table table-condensed table-borderless">
<tr>
<td>{{ __('hmis_reports.reporting_period') }}</td>
</tr>
@if (!empty($dates['last_month']))
<tr>
<td>{{ __('hmis_reports.month') }}:&nbsp; {{ $dates['last_month'] }}</td>
</tr>
<tr>
<td>{{ __('hmis_reports.year') }}:&nbsp;&nbsp;&nbsp;&nbsp;{{ $dates['last_year'] }}</td>
</tr>
@else
<tr>
<td>From:&nbsp; {{ $dates['start'] }}</td>
</tr>
<tr>
<td>To:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ $dates['end'] }}</td>
</tr>
@endif
</table>
</div>
</div>
{{-- <hr> --}}
<div id="csv">
@if ($page == 'census')
<div class="row">
@include('reports::hmis_reports.108.census-information')
</div>
@elseif ($page == 'procedures')
<div class="row">
@include('reports::hmis_reports.108.surgical')
</div>
@elseif ($page == 'Utilization of Special Services')
<div class="row">
@include('reports::hmis_reports.108.special-services')
</div>
@elseif ($page == 'radiology and Imaging')
<div class="row">
@include('reports::hmis_reports.108.radiology-imaging')
</div>
@elseif ($page == 'Admissions and Deaths by Diagnosis')
<div class="row">
@include('reports::hmis_reports.108.admissions-and-deaths')
</div>
@elseif ($page == 'Mental Health')
<div class="row">
@include('reports::hmis_reports.108.mental-health')
</div>
@elseif ($page == 'others')
<div class="row">
@include('reports::hmis_reports.108.other-sections')
</div>
@endif
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/sheetjs/xlsx.full.min.js') }}"></script>
<script type="text/javascript">
$('#date-from, #date-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'yyyy-mm-dd',
});
// $('#type').select2({ minimumResultsForSearch: -1});
$('#date-range input').on('change', function() {
let empty = false;
$('#date-range input').each(function() {
empty = $(this).val().length == 0;
});
if (empty) $('.btn-success[type="submit"]').attr('disabled', 'disabled');
else $('.btn-success[type="submit"]').attr('disabled', false);
});
$('#type').change(function(){
$('#search_form').submit();
});
function drill_down(data) {
var id = data.getAttribute('data-id');
$("#"+id+"_drill").submit();
}
function export_to_excel(type, fn, dl) {
var elt = document.getElementById('csv');
var wb = XLSX.utils.table_to_book(elt, { sheet: "{{ ucfirst($page) }}", raw:true });
return dl ?
XLSX.write(wb, { bookType: type, bookSST: true, type: 'binary' }):
XLSX.writeFile(wb, fn || ('HMIS 108 - {{ ucfirst($page) }}.' + (type || 'xlsx')));
}
</script>
@endpush
@@ -0,0 +1,205 @@
<div class="col">
<table class="table table-condensed table-bordered table-hover">
<tbody>
<tr class="heading">
<td colspan="13">7. Mental Health</td>
</tr>
<tr class="heading">
<td rowspan="3">Diagnosis</td>
</tr>
<tr class="heading">
<td colspan="2">{{ '<5 Yrs' }}</td>
<td colspan="2">5-9 Yrs</td>
<td colspan="2">10-19 Yrs</td>
<td colspan="2">20-34 Yrs</td>
<td colspan="2">35-59 Yrs</td>
<td colspan="2">60+ Yrs</td>
</tr>
<tr class="heading">
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
</tr>
@if (!empty($table_options))
@foreach ($table_options[count($table_options)-1]['category_options'] as $category_option)
<tr>
@php
$option_id =$category_option['id'];
$option_count =array_filter($diagnoses_data, function ($item) use ($option_id) {
return $item['hmis_category_option'] == $option_id;
});
$case_male_under_five = $case_female_under_five = $case_male_5_9 = $case_female_5_9 = $case_male_10_19 = $case_female_10_19 = $case_male_20_34 = $case_female_20_34 = $case_male_35_59 = $case_female_35_59 = $case_male_60 = $case_female_60 =[];
foreach ($option_count as $options){
foreach ($options['primary'] as $option) {
if($option['gender'] == '1'){
if ($option['age'] < 5) $case_male_under_five[] = $option['patient_id'];
elseif ($option['age'] > 4 && $option['age'] < 10) $case_male_5_9[] = $option['patient_id'];
elseif ($option['age'] > 9 && $option['age'] < 20) $case_male_10_19[] = $option['patient_id'];
elseif ($option['age'] > 19 && $option['age'] < 35) $case_male_20_34[] = $option['patient_id'];
elseif ($option['age'] > 34 && $option['age'] < 60) $case_male_35_59[] = $option['patient_id'];
else $case_male_60[] = $option['patient_id'];
}elseif ($option['gender'] == '2') {
if ($option['age'] < 5) $case_female_under_five[] = $option['patient_id'];
elseif ($option['age'] > 4 && $option['age'] < 10) $case_female_5_9[] = $option['patient_id'];
elseif ($option['age'] > 9 && $option['age'] < 20) $case_female_10_19[] = $option['patient_id'];
elseif ($option['age'] > 19 && $option['age'] < 35) $case_female_20_34[] = $option['patient_id'];
elseif ($option['age'] > 34 && $option['age'] < 60) $case_female_35_59[] = $option['patient_id'];
else $case_female_60[] = $option['patient_id'];
}
}
foreach ($options['other'] as $option){
if($option['gender'] == '1'){
if ($option['age'] < 5) $case_male_under_five[] = $option['patient_id'];
elseif ($option['age'] > 4 && $option['age'] < 10) $case_male_5_9[] = $option['patient_id'];
elseif ($option['age'] > 9 && $option['age'] < 20) $case_male_10_19[] = $option['patient_id'];
elseif ($option['age'] > 19 && $option['age'] < 35) $case_male_20_34[] = $option['patient_id'];
elseif ($option['age'] > 34 && $option['age'] < 60) $case_male_35_59[] = $option['patient_id'];
else $case_male_60[] = $option['patient_id'];
}elseif ($option['gender'] == '2') {
if ($option['age'] < 5) $case_female_under_five[] = $option['patient_id'];
elseif ($option['age'] > 4 && $option['age'] < 10) $case_female_5_9[] = $option['patient_id'];
elseif ($option['age'] > 9 && $option['age'] < 20) $case_female_10_19[] = $option['patient_id'];
elseif ($option['age'] > 19 && $option['age'] < 35) $case_female_20_34[] = $option['patient_id'];
elseif ($option['age'] > 34 && $option['age'] < 60) $case_female_35_59[] = $option['patient_id'];
else $case_female_60[] = $option['patient_id'];
}
}
}
@endphp
<td>{{ $category_option['number'].'. '.$category_option['name'] }}</td>
<td>
@if (!empty($case_male_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_case_male_under_five_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_case_male_under_five' }}>{{ commas(count($case_male_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_under_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_under_five'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_under_five) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_under_five' }}>{{ commas(count($case_female_under_five)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_male_5_9))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_case_male_5_9_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_5_9) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_case_male_5_9' }}>{{ commas(count($case_male_5_9)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_5_9))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_5_9'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_5_9) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_5_9' }}>{{ commas(count($case_female_5_9)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_male_10_19))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_case_male_10_19_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_10_19) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_case_male_10_19' }}>{{ commas(count($case_male_10_19)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_10_19))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_10_19'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_10_19) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_10_19' }}>{{ commas(count($case_female_10_19)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_male_20_34))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_case_male_20_34_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_20_34) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_case_male_20_34' }}>{{ commas(count($case_male_20_34)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_20_34))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_20_34'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_20_34) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_20_34' }}>{{ commas(count($case_female_20_34)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_male_35_59))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_case_male_35_59_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_35_59) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_case_male_35_59' }}>{{ commas(count($case_male_35_59)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_35_59))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_35_59'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_35_59) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_35_59' }}>{{ commas(count($case_female_35_59)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_male_60))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_case_male_60_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_male_60) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_case_male_60' }}>{{ commas(count($case_male_60)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($case_female_60))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=> $category_option['number'].'_'.'case_female_60'.'_drill' ]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($case_female_60) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $category_option['number'].'_'.'case_female_60' }}>{{ commas(count($case_female_60)) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
@@ -0,0 +1,662 @@
<div class="col">
<table class="table table-condensed table-bordered table-hover">
<tbody>
<tr class="heading">
<td colspan="7">8. Risk Behaviour</td>
</tr>
<tr class="heading">
<td rowspan="2" class="rowspan" style="width:40%">Risk Behaviour</td>
<td colspan="3">Male</td>
<td colspan="3">Female</td>
</tr>
<tr class="heading">
<td>10-19yrs</td>
<td>20-24yrs</td>
<td>>=25yrs</td>
<td>10-19yrs</td>
<td>20-24yrs</td>
<td>>=25yrs</td>
</tr>
<tr>
<td>RB01. Alcohol use</td>
<td>
@if (!empty($table_options[0]['alc_male_10_to_19']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"alc_male_10_to_19_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[0]['alc_male_10_to_19']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="alc_male_10_to_19">{{ count($table_options[0]['alc_male_10_to_19']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[0]['alc_male_20_to_24']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"alc_male_20_to_24_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[0]['alc_male_20_to_24']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="alc_male_20_to_24">{{ count($table_options[0]['alc_male_20_to_24']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[0]['alc_male_over_25']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"alc_male_over_25_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[0]['alc_male_over_25']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="alc_male_over_25">{{ count($table_options[0]['alc_male_over_25']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[0]['alc_female_10_to_19']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"alc_female_10_to_19_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[0]['alc_female_10_to_19']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="alc_female_10_to_19">{{ count($table_options[0]['alc_female_10_to_19']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[0]['alc_female_20_to_24']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"alc_female_20_to_24_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[0]['alc_female_20_to_24']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="alc_female_20_to_24">{{ count($table_options[0]['alc_female_20_to_24']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[0]['alc_female_over_25']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"alc_female_over_25_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[0]['alc_female_over_25']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="alc_female_over_25">{{ count($table_options[0]['alc_female_over_25']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
<tr>
<td>RB02. Tobacco use</td>
<td>
@if (!empty($table_options[0]['tob_male_10_to_19']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"tob_male_10_to_19_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[0]['tob_male_10_to_19']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="tob_male_10_to_19">{{ count($table_options[0]['tob_male_10_to_19']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[0]['tob_male_20_to_24']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"tob_male_20_to_24_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[0]['tob_male_20_to_24']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="tob_male_20_to_24">{{ count($table_options[0]['tob_male_20_to_24']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[0]['tob_male_over_25']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"tob_male_over_25_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[0]['tob_male_over_25']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="tob_male_over_25">{{ count($table_options[0]['tob_male_over_25']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[0]['tob_female_10_to_19']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"tob_female_10_to_19_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[0]['tob_female_10_to_19']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="tob_female_10_to_19">{{ count($table_options[0]['tob_female_10_to_19']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[0]['tob_female_20_to_24']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"tob_female_20_to_24_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[0]['tob_female_20_to_24']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="tob_female_20_to_24">{{ count($table_options[0]['tob_female_20_to_24']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[0]['tob_female_over_25']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"tob_female_over_25_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[0]['tob_female_over_25']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="tob_female_over_25">{{ count($table_options[0]['tob_female_over_25']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
</tbody>
</table>
<table class="table table-condensed table-bordered table-hover">
<tbody>
<tr class="heading">
<td colspan="10">9. Tuberculosis (TB) Services</td>
</tr>
<tr class="heading">
<td rowspan="2" class="rowspan">TB Screening</td>
<td colspan="2">0-9 Years</td>
<td colspan="2">10-14 Years</td>
<td colspan="2">15-19 Years</td>
<td colspan="2">20+ Years</td>
<td rowspan="2" class="rowspan">Total</td>
</tr>
<tr class="heading">
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
</tr>
<tr>
<td>TB01. No. screened for TB in IPD</td>
<td>
@if (!empty($table_options[1]['screened']['male_screened_0_9']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"screened_male_screened_0_9_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['screened']['male_screened_0_9']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="screened_male_screened_0_9">{{ count($table_options[1]['screened']['male_screened_0_9']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['screened']['female_screened_0_9']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"screened_female_screened_0_9_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['screened']['female_screened_0_9']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="screened_female_screened_0_9">{{ count($table_options[1]['screened']['female_screened_0_9']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['screened']['male_screened_10_14']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"screened_male_screened_10_14_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['screened']['male_screened_10_14']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="screened_male_screened_10_14">{{ count($table_options[1]['screened']['male_screened_10_14']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['screened']['female_screened_10_14']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"screened_female_screened_10_14_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['screened']['female_screened_10_14']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="screened_female_screened_10_14">{{ count($table_options[1]['screened']['female_screened_10_14']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['screened']['male_screened_15_19']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"screened_male_screened_15_19_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['screened']['male_screened_15_19']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="screened_male_screened_15_19">{{ count($table_options[1]['screened']['male_screened_15_19']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['screened']['female_screened_15_19']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"screened_female_screened_15_19_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['screened']['female_screened_15_19']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="screened_female_screened_15_19">{{ count($table_options[1]['screened']['female_screened_15_19']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['screened']['male_screened_over_20']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"screened_male_screened_over_20_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['screened']['male_screened_over_20']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="screened_male_screened_over_20">{{ count($table_options[1]['screened']['male_screened_over_20']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['screened']['female_screened_over_20']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"screened_female_screened_over_20_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['screened']['female_screened_over_20']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="screened_female_screened_over_20">{{ count($table_options[1]['screened']['female_screened_over_20']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['totals']['total_tb_screened']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"total_tb_screened_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['totals']['total_tb_screened']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="total_tb_screened">{{ count($table_options[1]['totals']['total_tb_screened']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
<tr>
<td>TB02. No. of presumptive TB cases identified</td>
<td>
@if (!empty($table_options[1]['presumptive']['male_presumptive_0_9']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"presumptive_male_presumptive_0_9_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['presumptive']['male_presumptive_0_9']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="presumptive_male_presumptive_0_9">{{ count($table_options[1]['presumptive']['male_presumptive_0_9']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['presumptive']['female_presumptive_0_9']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"presumptive_female_presumptive_0_9_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['presumptive']['female_presumptive_0_9']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="presumptive_female_presumptive_0_9">{{ count($table_options[1]['presumptive']['female_presumptive_0_9']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['presumptive']['male_presumptive_10_14']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"presumptive_male_presumptive_10_14_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['presumptive']['male_presumptive_10_14']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="presumptive_male_presumptive_10_14">{{ count($table_options[1]['presumptive']['male_presumptive_10_14']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['presumptive']['female_presumptive_10_14']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"presumptive_female_presumptive_10_14_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['presumptive']['female_presumptive_10_14']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="presumptive_female_presumptive_10_14">{{ count($table_options[1]['presumptive']['female_presumptive_10_14']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['presumptive']['male_presumptive_15_19']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"presumptive_male_presumptive_15_19_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['presumptive']['male_presumptive_15_19']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="presumptive_male_presumptive_15_19">{{ count($table_options[1]['presumptive']['male_presumptive_15_19']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['presumptive']['female_presumptive_15_19']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"presumptive_female_presumptive_15_19_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['presumptive']['female_presumptive_15_19']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="presumptive_female_presumptive_15_19">{{ count($table_options[1]['presumptive']['female_presumptive_15_19']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['presumptive']['male_presumptive_over_20']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"presumptive_male_presumptive_over_20_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['presumptive']['male_presumptive_over_20']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="presumptive_male_presumptive_over_20">{{ count($table_options[1]['presumptive']['male_presumptive_over_20']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['presumptive']['female_presumptive_over_20']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"presumptive_female_presumptive_over_20_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['presumptive']['female_presumptive_over_20']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="presumptive_female_presumptive_over_20">{{ count($table_options[1]['presumptive']['female_presumptive_over_20']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['totals']['total_tb_presumptive']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"total_tb_presumptive_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['totals']['total_tb_presumptive']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="total_tb_presumptive">{{ count($table_options[1]['totals']['total_tb_presumptive']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
<tr>
<td>TB03. No. of presumptive cases diagnosed with TB</td>
<td>
@if (!empty($table_options[1]['diagnosed']['male_diagnosed_0_9']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"diagnosed_male_diagnosed_0_9_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['diagnosed']['male_diagnosed_0_9']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="diagnosed_male_diagnosed_0_9">{{ count($table_options[1]['diagnosed']['male_diagnosed_0_9']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['diagnosed']['female_diagnosed_0_9']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"diagnosed_female_diagnosed_0_9_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['diagnosed']['female_diagnosed_0_9']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="diagnosed_female_diagnosed_0_9">{{ count($table_options[1]['diagnosed']['female_diagnosed_0_9']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['diagnosed']['male_diagnosed_10_14']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"diagnosed_male_diagnosed_10_14_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['diagnosed']['male_diagnosed_10_14']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="diagnosed_male_diagnosed_10_14">{{ count($table_options[1]['diagnosed']['male_diagnosed_10_14']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['diagnosed']['female_diagnosed_10_14']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"diagnosed_female_diagnosed_10_14_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['diagnosed']['female_diagnosed_10_14']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="diagnosed_female_diagnosed_10_14">{{ count($table_options[1]['diagnosed']['female_diagnosed_10_14']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['diagnosed']['male_diagnosed_15_19']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"diagnosed_male_diagnosed_15_19_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['diagnosed']['male_diagnosed_15_19']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="diagnosed_male_diagnosed_15_19">{{ count($table_options[1]['diagnosed']['male_diagnosed_15_19']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['diagnosed']['female_diagnosed_15_19']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"diagnosed_female_diagnosed_15_19_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['diagnosed']['female_diagnosed_15_19']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="diagnosed_female_diagnosed_15_19">{{ count($table_options[1]['diagnosed']['female_diagnosed_15_19']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['diagnosed']['male_diagnosed_over_20']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"diagnosed_male_diagnosed_over_20_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['diagnosed']['male_diagnosed_over_20']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="diagnosed_male_diagnosed_over_20">{{ count($table_options[1]['diagnosed']['male_diagnosed_over_20']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['diagnosed']['female_diagnosed_over_20']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"diagnosed_female_diagnosed_over_20_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['diagnosed']['female_diagnosed_over_20']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="diagnosed_female_diagnosed_over_20">{{ count($table_options[1]['diagnosed']['female_diagnosed_over_20']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($table_options[1]['totals']['total_tb_diagnosed']))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"total_tb_diagnosed_drill"]) }}
<input type="hidden" name="patients" id="patients" value='{{ serialize($table_options[1]['totals']['total_tb_diagnosed']) }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="total_tb_diagnosed">{{ count($table_options[1]['totals']['total_tb_diagnosed']) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
</tbody>
</table>
<table class="table table-condensed table-bordered table-hover">
<tbody>
<tr class="heading">
<td colspan="19">10. Nutrition Inpatient Services</td>
</tr>
<tr class="heading">
<td rowspan="3" colspan="2">Data Elements</td>
<td colspan="2">0-5 Months</td>
<td colspan="2">6-23 Months</td>
<td colspan="2">24-59 Months</td>
<td colspan="2">5-9 Years</td>
<td colspan="3">10-19 Years</td>
<td colspan="3">20-24 Years</td>
<td colspan="3">25+ Years</td>
</tr>
<tr class="heading">
<td rowspan="2">M</td>
<td rowspan="2">F</td>
<td rowspan="2">M</td>
<td rowspan="2">F</td>
<td rowspan="2">M</td>
<td rowspan="2">F</td>
<td rowspan="2">M</td>
<td rowspan="2">F</td>
<td rowspan="2">M</td>
<td colspan="2">F</td>
<td rowspan="2">M</td>
<td colspan="2">F</td>
<td rowspan="2">M</td>
<td colspan="2">F</td>
</tr>
<tr id='test' class="heading">
<td>Non Pregnant</td>
<td>Pregnant / Lactating</td>
<td>Non Pregnant</td>
<td>Pregnant / Lactating</td>
<td>Non Pregnant</td>
<td>Pregnant / Lactating</td>
</tr>
<tr>
<td rowspan="3" class="rowspan">NA01. No. of SAM admissions In ITC this month;</td>
</tr>
<tr>
<td>NA01a. Total</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>NA01ab. New Admissions</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td rowspan="4" class="rowspan">NA02. No. of clients with SAM (with complications) admitted into treatment and discharged as;</td>
</tr>
<tr>
<td>NA02a. Successfully Treated this month</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>NA02b. Defaulted from care within this month (absent for 2 days)</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>NA02c. Died during treatment within this month</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td rowspan="3" class="rowspan">NA03. No. of re-admissions into ITC this month;</td>
</tr>
<tr>
<td>NA03a. Relapses</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>NA03b. Defaulters</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td colspan="2">NA04. Total number of days spent in ITC for all clients discharged as cured this month</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
</tbody>
</table>
</div>
@@ -0,0 +1,258 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" sizes="16x16"
href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
<title>{{ config('app.name', 'Streamline') }}</title>
<!-- Bootstrap Core CSS -->
<link href="{{ asset('elite/bootstrap/dist/css/bootstrap.min.css') }}" rel="stylesheet">
<!-- Custom CSS -->
<link href="{{ asset('elite/css/style.css') }}" rel="stylesheet">
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
font-size: 14px;
/* line-height: 1.2; */
}
thead {
display: table-header-group;
}
tfoot {
display: table-row-group;
}
strong {
font-weight: bold;
}
tr {
page-break-before: always;
page-break-after: always;
page-break-inside: avoid;
}
.heading {
background-color: rgba(0, 0, 0, 0.075) !important;
font-weight: bold;
}
#test>td {
writing-mode: vertical-lr;
}
</style>
</head>
<body>
<div class="white-box">
@php
$hospital_info = \Streamline\Models\HospitalInformation::find(1);
@endphp
<img style="max-width: 300px; max-height: 100px;" src="{{ asset('uploads/streamline_images/coat_of_arms.png') }}" class="mx-auto d-block mx-3" alt="Responsive image">
<p class="h6 text-center mt-0 font-weight-bold">Ministry of Health</p>
<h3 class="heading" style="text-align: center; text-decoration: underline;">{{ __('hmis_reports.hmis_108') }}</h3>
<div class="row">
<div class="col-md-4">
<table class="table table-condensed table-borderless">
<tr>
<td>{{ __('hmis_reports.health_unit') }} : {{ $hospital_info->name }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.subcounty') }} : {{ get_name($hospital_info->sub_county,'id', 'name', 'subcounties') }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.parish') }} : {{ get_name($hospital_info->parish,'id', 'name', 'parishes') }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.district') }} : {{ get_name($hospital_info->district,'id', 'name', 'districts') }}</td>
</tr>
</table>
</div>
<div class="col-md-4">
<table class="table table-condensed table-borderless">
<tr>
<td>{{ __('hmis_reports.code') }} : {{ $hospital_info->code }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.level') }} : {{ $hospital_info->level }} </td>
</tr>
<tr>
<td>{{ __('hmis_reports.health_sub_district') }} : {{ $hospital_info->sub_district }}</td>
</tr>
</table>
</div>
<div class="col-md-4">
<table class="table table-condensed table-borderless">
<tr>
<td>{{ __('hmis_reports.reporting_period') }}</td>
</tr>
@if (!empty($dates['last_month']))
<tr>
<td>{{ __('hmis_reports.month') }}:&nbsp; {{ $dates['last_month'] }}</td>
</tr>
<tr>
<td>{{ __('hmis_reports.year') }}:&nbsp;&nbsp;&nbsp;&nbsp;{{ $dates['last_year'] }}</td>
</tr>
@else
<tr>
<td>From:&nbsp; {{ $dates['start'] }}</td>
</tr>
<tr>
<td>To:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ $dates['end'] }}</td>
</tr>
@endif
</table>
</div>
</div>
@if ($page == 'census')
<div class="text-center">
<p><h3><strong>{{ __('hmis_reports.hmis_108_report_census') }}</strong></h3></p>
</div>
<table class="table table-condensed table-bordered table-hover">
<thead>
<tr style="background-color: #e8e4e4"><td colspan="8">1. {{ __('hmis_reports.census_info') }}</td></tr>
<tr style="background-color: #e8e4e4">
<th class="center" style="width: 50%;">(A)</th>
<th class="center">(B)</th>
<th class="center">(C)</th>
<th class="center">(D)</th>
<th class="center">(E)</th>
<th class="center">(F)</th>
<th class="center">(G)</th>
<th class="center">(H)</th>
</tr>
<tr style="background-color: #e8e4e4">
<th style="width: 50%;">List of wards</th>
<th>No. of Beds</th>
<th>Admissions</th>
<th>Deaths</th>
<th>Patient days</th>
<th>Average length of stay = E / C</th>
<th>Average Occupancy = E / No. of days in month</th>
<th>Bed Occupancy = G x 100 / B</th>
</tr>
</thead>
<tbody>
@php
$count = $total_beds = $total_admissions = $total_deaths = $total_days = 0;
@endphp
@foreach ($ward_data as $ward)
<tr>
@php
$g = round($ward['days_count'] / $dates['days'],3);
$f = ($ward['admissions'] > 0)? round($ward['days_count'] / $ward['admissions'],3):0;
$bed_occupancy = ($ward['ward_beds'] > 0)? round(($g * 100) / $ward['ward_beds'],3):0;
$total_beds += $ward['ward_beds'];
$total_admissions += $ward['admissions'];
$total_deaths +=$ward['deaths'];
$total_days += $ward['days_count'];
@endphp
<td style="width: 40%;">{{ $ward['ward_name'] }} </td>
<td>{{ commas($ward['ward_beds']) }}</td>
<td>{{ commas($ward['admissions']) }}</td>
<td>{{ commas($ward['deaths']) }}</td>
<td>{{ commas($ward['days_count']) }}</td>
<td>{{ $f }}</td>
<td>{{ $g }}</td>
<td>{{ $bed_occupancy }}</td>
</tr>
@endforeach
<tr>
@php
$total_g = round($total_days / $dates['days'],3);
$total_f = ($total_admissions > 0)? round($total_days / $total_admissions, 3):0;
$total_bed_occupancy = ($total_beds > 0)? round(($total_g * 100) / $total_beds,3):0;
@endphp
<td style="width: 40%; font-weight: bold;" class="float-right">Totals </td>
<td>{{ commas($total_beds) }}</td>
<td>{{ commas($total_admissions) }}</td>
<td>{{ commas($total_deaths) }}</td>
<td>{{ commas($total_days) }}</td>
<td>{{ $total_f }}</td>
<td>{{ $total_g }}</td>
<td>{{ $total_bed_occupancy }}</td>
</tr>
</tbody>
</table>
<table class="table table-condensed table-bordered table-hover">
<tbody>
<tr class="heading">
<td >2. REFERRALS</td>
<td>NUMBERS</td>
</tr>
<tr>
<td>RF01. No. of Inpatients referred from this health unit</td>
<td>{{ commas($referral_data['referred_from']) }}</td>
</tr>
<tr>
<td>RF02. No. of Inpatients referred to the health unit</td>
<td>{{ commas($referral_data['referred_to']) }}</td>
</tr>
<tr>
<td>RF03. No. of inpatients who have self-referred</td>
<td>{{ commas($referral_data['self_referred']) }}</td>
</tr>
<tr>
<td>RF04. No. of inpatients who have run-away</td>
<td>{{ commas($referral_data['ran_away']) }}</td>
</tr>
</tbody>
</table>
@elseif ($page == 'procedures')
<div class="text-center">
<p><h3><strong>{{ __('hmis_reports.hmis_108_report_surgical_procedures') }}</strong></h3></p>
</div>
@include('reports::hmis_reports.108.surgical')
@elseif ($page == 'Utilization of Special Services')
<div class="text-center">
<p><h3><strong>{{ __('hmis_reports.hmis_108_report_special_services') }}</strong></h3></p>
</div>
@include('reports::hmis_reports.108.special-services')
@elseif ($page == 'radiology and Imaging')
<div class="text-center">
<p><h3><strong>{{ __('hmis_reports.hmis_108_report_radiology') }}</strong></h3></p>
</div>
@include('reports::hmis_reports.108.radiology-imaging')
@elseif ($page == 'Admissions and Deaths by Diagnosis')
<div class="text-center">
<p><h3><strong>{{ __('hmis_reports.hmis_108_report_admissions_deaths') }}</strong></h3></p>
</div>
@include('reports::hmis_reports.108.admissions-and-deaths')
@elseif ($page == 'Mental Health')
<div class="text-center">
<p><h3><strong>{{ __('hmis_reports.hmis_108_report_mental_health') }}</strong></h3></p>
</div>
@include('reports::hmis_reports.108.mental-health')
@elseif ($page == 'others')
<div class="text-center">
<p><h3><strong>{{ __('hmis_reports.hmis_108_report_other_sections') }}</strong></h3></p>
</div>
@include('reports::hmis_reports.108.other-sections')
@endif
</div>
<!-- /#wrapper -->
<!-- jQuery -->
<script src="{{ asset('elite/bower_components/jquery/dist/jquery.min.js') }}"></script>
<!-- Bootstrap Core JavaScript -->
<script src="{{ asset('elite/bootstrap/dist/js/tether.min.js') }}"></script>
<script src="{{ asset('elite/bootstrap/dist/js/bootstrap.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/sidebar-nav/src/metisMenu.js') }}"></script>
<!--slimscroll JavaScript -->
<script src="{{ asset('elite/js/jquery.slimscroll.js') }}"></script>
<!-- Custom Theme JavaScript -->
<script src="{{ asset('elite/js/custom.min.js') }}"></script>
</body>
</html>
@@ -0,0 +1,105 @@
<div class="col">
<table class="table table-condensed table-bordered table-hover">
<tbody>
<tr class="heading">
<td rowspan="3" style="width:60%">5. RADIOLOGY AND IMAGING SECTION</td>
</tr>
<tr class="heading">
<td colspan="2">0-4 years</td>
<td colspan="2">5 and over</td>
</tr>
<tr class="heading">
<td>Male</td>
<td>Female</td>
<td>Male</td>
<td>Female</td>
</tr>
@foreach ($table_options as $option)
<tr class="heading">
<td colspan="5">{{ $option['category_number'] .'. '.$option['category_name'] }}</td>
</tr>
@foreach ($option['category_options'] as $category_option)
<tr>
<td>{{ $category_option['number'].'. '.$category_option['name'] }}</td>
@php
$option_id =$category_option['id'];
$option_count =array_filter($counted_investigations, function ($item) use ($option_id) {
return $item['option_id'] == $option_id;
});
$option_counter = $male_under_four = $female_under_four = $male_over_five = $female_over_five = 0;
$patient_ids = $male_under_four_ids = $female_under_four_ids = $male_over_five_ids = $female_over_five_ids = [];
foreach ($option_count as $options) {
$option_counter += $options['count'];
if (!empty($options['male_under_four'])) {
$male_under_four += $options['male_under_four'];
$male_under_four_ids[] = $options['male_under_four_ids'];
}
if (!empty($options['female_under_four'])) {
$female_under_four += $options['female_under_four'];
$female_under_four_ids[] = $options['female_under_four_ids'];
}
if (!empty($options['male_over_five'])) {
$male_over_five += $options['male_over_five'];
$male_over_five_ids[] = $options['male_over_five_ids'];
}
if (!empty($options['female_over_five'])) {
$female_over_five +=$options['female_over_five'];
$female_over_five_ids[] = $options['female_over_five_ids'];
}
foreach ($options['patient_ids'] as $id) $patient_ids[]=$id['patient_id'];
}
$male_under_four_id = serialize($male_under_four_ids);
$female_under_four_id = serialize($female_under_four_ids);
$female_over_five_id = serialize($female_over_five_ids);
$male_over_five_id = serialize($male_over_five_ids);
$male_under_four_form_id = $option_id.'_male_under_four_drill';
$female_under_four_form_id = $option_id.'_female_under_four_drill';
$male_over_five_form_id = $option_id.'_male_over_five_drill';
$female_over_five_form_id = $option_id.'_female_over_five_drill';
@endphp
<td>
@if (!empty($male_under_four))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"$male_under_four_form_id"]) }}
<input type="hidden" name="patients" id="patients" value='{{ $male_under_four_id }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $option_id."_male_under_four" }}>{{ commas($male_under_four) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($female_under_four))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"$female_under_four_form_id"]) }}
<input type="hidden" name="patients" id="patients" value='{{ $female_under_four_id }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $option_id."_female_under_four" }}>{{ commas($female_under_four) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($male_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"$male_over_five_form_id"]) }}
<input type="hidden" name="patients" id="patients" value='{{ $male_over_five_id }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $option_id."_male_over_five" }}>{{ commas($male_over_five) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
<td>
@if (!empty($female_over_five))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"$female_over_five_form_id"]) }}
<input type="hidden" name="patients" id="patients" value='{{ $female_over_five_id }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id={{ $option_id."_female_over_five" }}>{{ commas($female_over_five) }}</a>
{{ Form::close() }}
@else
0
@endif
</td>
</tr>
@endforeach
@endforeach
</tbody>
</table>
</div>
@@ -0,0 +1,323 @@
<div class="col">
<table class="table table-condensed table-bordered table-hover">
<tbody>
<tr class="heading">
<td colspan="21">4. UTILIZATION OF SPECIAL SERVICES:</td>
</tr>
<tr class="heading">
<td>4a. Blood Transfusion Services </td>
<td colspan="4">Whole blood</td>
<td colspan="4">Packed cells</td>
<td colspan="4">Platelets </td>
<td colspan="4">Fresh Frozen Plasma </td>
<td colspan="4">Cryoprecipitates </td>
</tr>
<tr>
<td>UT01. No of units requested </td>
<td colspan="4">0</td>
<td colspan="4">0</td>
<td colspan="4">0</td>
<td colspan="4">0</td>
<td colspan="4">0</td>
</tr>
<tr>
<td>UT02. No. of units received</td>
<td colspan="4">0</td>
<td colspan="4">0</td>
<td colspan="4">0</td>
<td colspan="4">0</td>
<td colspan="4">0</td>
</tr>
<tr>
<td>UT03. No. of units transfused</td>
<td colspan="4">0</td>
<td colspan="4">0</td>
<td colspan="4">0</td>
<td colspan="4">0</td>
<td colspan="4">0</td>
</tr>
<tr>
<td>UT04. No. of adverse Blood reactions in the facility</td>
<td colspan="4">0</td>
<td colspan="4">0</td>
<td colspan="4">0</td>
<td colspan="4">0</td>
<td colspan="4">0</td>
</tr>
<tr class="heading">
<td rowspan="4">4b. Reasons for transfusion</td>
</tr>
<tr class="heading">
<td colspan="4">Whole blood</td>
<td colspan="4">Packed cells</td>
<td colspan="4">Platelets </td>
<td colspan="4">Fresh Frozen Plasma </td>
<td colspan="4">Cryoprecipitates </td>
</tr>
<tr class="heading">
<td colspan="2">0-4 yrs</td>
<td colspan="2">5+ yrs</td>
<td colspan="2">0-4 yrs</td>
<td colspan="2">5+ yrs</td>
<td colspan="2">0-4 yrs</td>
<td colspan="2">5+ yrs</td>
<td colspan="2">0-4 yrs</td>
<td colspan="2">5+ yrs</td>
<td colspan="2">0-4 yrs</td>
<td colspan="2">5+ yrs</td>
</tr>
<tr class="heading">
<td>M</td>
<td>F</td>
<td>M</td>
<td>F</td>
<td>M</td>
<td>F</td>
<td>M</td>
<td>F</td>
<td>M</td>
<td>F</td>
<td>M</td>
<td>F</td>
<td>M</td>
<td>F</td>
<td>M</td>
<td>F</td>
<td>M</td>
<td>F</td>
<td>M</td>
<td>F</td>
</tr>
<tr>
<td>RT01. Severe malaria </td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>RT02. Obstetrics </td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>RT03. Gynaecology </td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>RT04. Accidents </td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>RT05. Cancer cases </td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>RT06. Sickle cell Anaemia </td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>RT07. Iron Deficiency Anaemia (IDA)</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>RT08. Other Coagulopathies </td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>RT09. Other surgeries </td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td style="font-weight: bold">Total units of blood Transfused </td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
</tbody>
</table>
</div>
@@ -0,0 +1,255 @@
<div class="col">
<table class="table table-condensed table-bordered table-hover">
<tbody>
<tr class="heading">
<td colspan="3">3. SURGICAL PROCEDURES</td>
</tr>
<tr class="heading">
<td colspan="2">3.1 Obstetrics/Gynaecology</td>
<td>NUMBERS</td>
</tr>
@foreach ($table_options[0]['category_options'] as $option)
@if ($option['id'] != '5')
<tr>
<td colspan="2">{{ $option['number'].'. '.$option['name'] }}</td>
<td>
@php
$option_id =$option['id'];
$option_count =array_filter($counted_procedures, function ($item) use ($option_id) {
return $item['option_id'] == $option_id;
});
$option_counter = 0; $patient_ids = [];
foreach ($option_count as $options) {
$option_counter += $options['count'];
foreach ($options['patient_ids'] as $id) $patient_ids[]=$id;
}
$ids = serialize($patient_ids);
$form_id = $option_id.'_drill';
@endphp
@if (!empty($option_counter))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"$form_id"]) }}
<input type="hidden" name="patients" id="patients" value='{{ $ids }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="{{ $option_id }}">{{ $option_counter }}</a>
{{ Form::close() }}
@else
{{ $option_counter }}
@endif
</td>
</tr>
@else
<tr>
<td rowspan="3" class="rowspan">SP05. Hysterectomy</td>
</tr>
<tr>
<td>Total Hysterectomy</td>
<td>
@php
$option_id ="SP05a";
$option_count =array_filter($counted_procedures, function ($item) use ($option_id) {
return $item['chosen_option'] == $option_id;
});
$option_counter = 0; $patient_ids = [];
foreach ($option_count as $options) {
$option_counter += $options['count'];
foreach ($options['patient_ids'] as $id) $patient_ids[]=$id;
}
$ids = serialize($patient_ids);
$form_id = $option_id.'_drill';
@endphp
@if (!empty($option_counter))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"$form_id"]) }}
<input type="hidden" name="patients" id="patients" value='{{ $ids }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="{{ $option_id }}">{{ $option_counter }}</a>
{{ Form::close() }}
@else
{{ $option_counter }}
@endif
</td>
</tr>
<tr>
<td>Sub-Total Hysterectomy</td>
<td>
@php
$option_id ="SP05a";
$option_count =array_filter($counted_procedures, function ($item) use ($option_id) {
return $item['chosen_option'] == $option_id;
});
$option_counter = 0; $patient_ids = [];
foreach ($option_count as $options) {
$option_counter += $options['count'];
foreach ($options['patient_ids'] as $id) $patient_ids[]=$id;
}
$ids = serialize($patient_ids);
$form_id = $option_id.'_drill';
@endphp
@if (!empty($option_counter))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"$form_id"]) }}
<input type="hidden" name="patients" id="patients" value='{{ $ids }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="{{ $option_id }}">{{ $option_counter }}</a>
{{ Form::close() }}
@else
{{ $option_counter }}
@endif
</td>
</tr>
@endif
@endforeach
@for ($i=1; $i<3;$i++)
<tr class="heading">
<td colspan="3">{{ $table_options[$i]['category_number'] .'. '.$table_options[$i]['category_name'] }}</td>
</tr>
@foreach ($table_options[$i]['category_options'] as $option)
<tr>
<td colspan="2">{{ $option['number'].'. '.$option['name'] }}</td>
<td>
@php
$option_id =$option['id'];
$option_count =array_filter($counted_procedures, function ($item) use ($option_id) {
return $item['option_id'] == $option_id;
});
$option_counter = 0; $patient_ids = [];
foreach ($option_count as $options) {
$option_counter += $options['count'];
foreach ($options['patient_ids'] as $id) $patient_ids[]=$id;
}
$ids = serialize($patient_ids);
$form_id = $option_id.'_drill';
@endphp
@if (!empty($option_counter))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"$form_id"]) }}
<input type="hidden" name="patients" id="patients" value='{{ $ids }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="{{ $option_id }}">{{ $option_counter }}</a>
{{ Form::close() }}
@else
{{ $option_counter }}
@endif
</td>
</tr>
@endforeach
@endfor
</tbody>
</table>
</div>
<div class="col">
<table class="table table-condensed table-bordered table-hover">
<tbody>
<tr class="heading">
<td>{{ $table_options[3]['category_number'] .'. '.$table_options[3]['category_name'] }}</td>
<td>NUMBERS</td>
</tr>
@foreach ($table_options[3]['category_options'] as $option)
<tr>
<td>{{ $option['number'].'. '.$option['name'] }}</td>
<td>
@php
$option_id =$option['id'];
$option_count =array_filter($counted_procedures, function ($item) use ($option_id) {
return $item['option_id'] == $option_id;
});
$option_counter = 0; $patient_ids = [];
foreach ($option_count as $options) {
$option_counter += $options['count'];
foreach ($options['patient_ids'] as $id) $patient_ids[]=$id;
}
$form_id = $option_id.'_drill';
$ids = serialize($patient_ids);
$form_id = $option_id.'_drill';
@endphp
@if (!empty($option_counter))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"$form_id"]) }}
<input type="hidden" name="patients" id="patients" value='{{ $ids }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="{{ $option_id }}">{{ $option_counter }}</a>
{{ Form::close() }}
@else
{{ $option_counter }}
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="w-100"></div>
<div class="col">
<table class="table table-condensed table-bordered table-hover">
<tbody>
@for ($i=4; $i<9;$i++)
<tr class="heading">
<td>{{ $table_options[$i]['category_number'] .'. '.$table_options[$i]['category_name'] }}</td>
<td>NUMBERS</td>
</tr>
@foreach ($table_options[$i]['category_options'] as $option)
<tr>
<td>{{ $option['number'].'. '.$option['name'] }}</td>
<td>
@php
$option_id =$option['id'];
$option_count =array_filter($counted_procedures, function ($item) use ($option_id) {
return $item['option_id'] == $option_id;
});
$option_counter = 0; $patient_ids = [];
foreach ($option_count as $options) {
$option_counter += $options['count'];
foreach ($options['patient_ids'] as $id) $patient_ids[]=$id;
}
$ids = serialize($patient_ids);
$form_id = $option_id.'_drill';
@endphp
@if (!empty($option_counter))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"$form_id"]) }}
<input type="hidden" name="patients" id="patients" value='{{ $ids }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="{{ $option_id }}">{{ $option_counter }}</a>
{{ Form::close() }}
@else
{{ $option_counter }}
@endif
</td>
</tr>
@endforeach
@endfor
</tbody>
</table>
</div>
<div class="col">
<table class="table table-condensed table-bordered table-hover">
<tbody>
@for ($i=9; $i< count($table_options);$i++)
<tr class="heading">
<td>{{ $table_options[$i]['category_number'] .'. '.$table_options[$i]['category_name'] }}</td>
<td>NUMBERS</td>
</tr>
@foreach ($table_options[$i]['category_options'] as $option)
<tr>
<td>{{ $option['number'].'. '.$option['name'] }}</td>
<td>
@php
$option_id =$option['id'];
$option_count =array_filter($counted_procedures, function ($item) use ($option_id) {
return $item['option_id'] == $option_id;
});
$option_counter = 0; $patient_ids = [];
foreach ($option_count as $options) {
$option_counter += $options['count'];
foreach ($options['patient_ids'] as $id) $patient_ids[]=$id;
}
$form_id = $option_id.'_drill';
$ids = serialize($patient_ids);
@endphp
@if (!empty($option_counter))
{{ Form::open(['method' => 'POST', 'route' => 'hmis_108.drill_down', 'target' => "_blank", 'id'=>"$form_id"]) }}
<input type="hidden" name="patients" id="patients" value='{{ $ids }}' />
<a href="javascript:void(0)" onclick="drill_down(this)" data-id="{{ $option_id }}">{{ $option_counter }}</a>
{{ Form::close() }}
@else
{{ $option_counter }}
@endif
</td>
</tr>
@endforeach
@endfor
</tbody>
</table>
</div>
@@ -0,0 +1,201 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('hmis_reports.anaesthesia_report') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
@if(URL::previous() == url("list_memorised_reports"))
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
@endif
<li class="active">{{ __('hmis_reports.anaesthesia_report') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
<h3 class="heading" style="text-align: center; text-decoration: underline;">{{ __('hmis_reports.anaesthesia_report') }}</h3>
<div class="row">
<div class="col-sm-2">
{{ Form::open(['url' => 'anaesthesia_report','data-toggle'=>'validator']) }}
<div class="form-group" id="searchby">
{{ Form::label('search_by', __('hmis_reports.date')) }}
{{ Form::select('search_by', ['0'=>__('hmis_reports.last_24_hours'),'1'=>__('hmis_reports.custom_date'),'2'=>__('hmis_reports.custom_range')], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-sm-2" style="display: none;" id="date_search">
<div class="form-group" id="reg_date" style="padding-top: 23px;">
<div class="input-group">
{{ Form::text('reg_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-autoclose']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-sm-2" style="display: none;" id="date_range_search">
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('start_date', __('hmis_reports.from')) }}
<div class="input-group">
{{ Form::text('start_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-1']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="reg_date">
{{ Form::label('end_date', __('hmis_reports.to')) }}
<div class="input-group">
{{ Form::text('end_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-2']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-2">
{{ Form::label('diagnosis',__('hmis_reports.diagnosis')) }}
{{ Form::select('diagnosis',$diagnoses, '',['class' => 'form-control','id' => 'diagnosis']) }}
</div>
<div class="col-sm-2">
{{ Form::label('surgical_operation',__('hmis_reports.surgical_operation')) }}
{{ Form::select('surgical_operation',$procedures,'',['class' => 'form-control', 'id' => 'surgical_operation']) }}
</div>
<div class="col-sm-2">
{{ Form::label('anaesthetist',__('hmis_reports.anaesthetist')) }}
{{ Form::select('anaesthetist', $all_users, '',['class' => 'form-control', 'id' => 'anaesthetist']) }}
</div>
<div class="col-sm-2">
{{ Form::label('anaesthesia_type',__('hmis_reports.type_of_anaesthesia')) }}
{{ Form::select('anaesthesia_type', $anaesthesia_types, '', ['class' => 'form-control', 'id'=>'anaesthesia_type']) }}
</div>
<div class="col-sm-2"><br>
{{ Form::submit(__('hmis_reports.search'),['name' => 'filterBtn','class' => 'btn btn-success']) }}
{{ Form::close() }}
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('hmis_reports.number') }}</th>
<th>{{ __('hmis_reports.names') }}</th>
<th>{{ __('hmis_reports.diagnoses') }}</th>
<th>{{ __('hmis_reports.date') }}</th>
<th>{{ __('hmis_reports.operation') }}</th>
<th>{{ __('hmis_reports.surgeon') }}</th>
<th>{{ __('hmis_reports.anaesthetist') }}</th>
<th>{{ __('hmis_reports.type_of_anaesthesia') }}</th>
<th>{{ __('hmis_reports.ventilated') }}</th>
<th>{{ __('hmis_reports.transfusion') }}</th>
<th>{{ __('hmis_reports.alert_comment') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($anaesthesia_records as $anaesthesia)
<tr>
<th>{{ get_name($anaesthesia->patient_id, 'id', 'number', 'patients') }}</th>
<th>{{ get_name($anaesthesia->patient_id, 'id', 'first_name', 'patients') }} {{ get_name($anaesthesia->patient_id, 'id', 'last_name', 'patients') }}</th>
<th>{{ isset($diagnoses[get_name($anaesthesia->episode_id, 'episode_id', 'primary_diagnosis', 'consultations')]) ? $diagnoses[get_name($anaesthesia->episode_id, 'episode_id', 'primary_diagnosis', 'consultations')] : "" }}</th>
<th>{{ streamline_date($anaesthesia->created_at) }}</th>
<th>{{ isset($procedures[$anaesthesia->procedure_id]) ? $procedures[$anaesthesia->procedure_id] : "" }}</th>
@php $surgeon_id = get_name($anaesthesia->surgery_id, 'id', 'surgeon', 'surgeries'); @endphp
<th>{{ get_name($surgeon_id, 'id', 'first_name', 'users') }} {{ get_name($surgeon_id, 'id', 'last_name', 'users') }}</th>
<th>{{ get_name($anaesthesia->anaesthetist, 'id', 'first_name', 'users') }} {{ get_name($anaesthesia->anaesthetist, 'id', 'last_name', 'users') }}</th>
<th>{{ isset($anaesthesia_types[$anaesthesia->anaesthesia_type]) ? $anaesthesia_types[$anaesthesia->anaesthesia_type] : "" }}</th>
<th>{{ $anaesthesia->blood_given }}</th>
<th></th>
<th>{{ $anaesthesia->comments }}</th>
<th><a href="/anaesthetics/view_history/{{$anaesthesia->id}}" class="btn btn-sm btn-info">{{ __('hmis_reports.view_details') }}</a></th>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/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/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/datatables-plugins/sorting/date-euro.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
order: [[ 3, "desc" ]],
columnDefs : [{"targets":3, "type":"date-eu"}],
pageLength: 100,
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
$('#anaesthetist,#surgical_operation,#diagnosis,#anaesthesia_type').select2({
placeholder: "-- select --"
});
$('#search_by').change(function () {
if ($(this).val() == 1) {
$('#date_search').show();
$('#date_range_search').hide();
}
else if ($(this).val() == 2) {
$('#date_range_search').show();
$('#date_search').hide();
}
else {
$('#date_search,#date_range_search').hide();
}
});
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy'
});
</script>
<script type="text/javascript">
jQuery('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy',
});
</script>
@endpush
@@ -0,0 +1,632 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h5 class="page-title">{{ __('hmis_reports.bmi_report') }}</h5>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
<li class="active">{{ __('hmis_reports.bmi_report') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
<h3 class="heading" style="text-align: center; text-decoration: underline;">{{ __('hmis_reports.bmi_report') }}</h3>
<div class="row">
<div class="col-sm-4">
{{ __('hmis_reports.showing_results_from') }} <span class="label label-info">{{ streamline_date($attendance_from) }}</span> {{ __('hmis_reports.to') }} <span class="label label-info">{{ streamline_date($attendance_to) }}</span>
</div>
<div class="col-sm-1">
{{ Form::open(['url' => 'bmi_report','data-toggle'=>'validator']) }}
{{ Form::label('date_from',__('hmis_reports.from')) }}
</div>
<div class="col-sm-2">
<div class="input-group">
{{ Form::text('date_from','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-from']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
<div class="col-sm-1">
{{ Form::label('date_to',__('hmis_reports.to')) }}
</div>
<div class="col-sm-2">
<div class="input-group">
{{ Form::text('date_to','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-to']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
<div class="col-sm-2">
{{ Form::submit(__('hmis_reports.search'),['name' => 'filterBtn','class' => 'btn btn-success']) }}
{{ Form::close() }}
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-12">
<table class="table table-condensed table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th rowspan="2" colspan="2"><h5 align="left">1.3.10 {{ __('hmis_reports.bmi') }}</h5></th>
<th class="center" colspan="3">{{ __('hmis_reports.male') }}</th>
<th class="center" colspan="3">{{ __('hmis_reports.female') }}</th>
</tr>
<tr>
<th>5 - 10 {{ __('hmis_reports.years') }}</th>
<th>11 - 18 {{ __('hmis_reports.years') }}</th>
<th> >=18 {{ __('hmis_reports.years') }}</th>
<th>5 - 10 {{ __('hmis_reports.years') }}</th>
<th>11 - 18 {{ __('hmis_reports.years') }}</th>
<th> >=18 {{ __('hmis_reports.years') }}</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2" style="width: 50%;">B1 - {{ __('hmis_reports.severely_underweight') }} (BMI<16)</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B1-Severely Underweight (BMI < 16) Male">
<input type="hidden" name="age_range" value="5-10yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($severely_underweight_5_10yrs_male_array); ?></textarea>
<?php if (count($severely_underweight_5_10yrs_male_array) > 0): ?>
<button class="btn btn-link"><?php echo count($severely_underweight_5_10yrs_male_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($severely_underweight_5_10yrs_male_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B1-Severely Underweight (BMI < 16) Male">
<input type="hidden" name="age_range" value="11-18yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($severely_underweight_11_18yrs_male_array); ?></textarea>
<?php if (count($severely_underweight_11_18yrs_male_array) > 0): ?>
<button class="btn btn-link"><?php echo count($severely_underweight_11_18yrs_male_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($severely_underweight_11_18yrs_male_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B1-Severely Underweight (BMI < 16) Male">
<input type="hidden" name="age_range" value=">=18yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($severely_underweight_18yrs_male_array); ?></textarea>
<?php if (count($severely_underweight_18yrs_male_array) > 0): ?>
<button class="btn btn-link"><?php echo count($severely_underweight_18yrs_male_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($severely_underweight_18yrs_male_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B1-Severely Underweight (BMI < 16) Female ">
<input type="hidden" name="age_range" value="5-10yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($severely_underweight_5_10yrs_female_array); ?></textarea>
<?php if (count($severely_underweight_5_10yrs_female_array) > 0): ?>
<button class="btn btn-link"><?php echo count($severely_underweight_5_10yrs_female_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($severely_underweight_5_10yrs_female_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B1-Severely Underweight (BMI < 16) Female">
<input type="hidden" name="age_range" value="11-18yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($severely_underweight_11_18yrs_female_array); ?></textarea>
<?php if (count($severely_underweight_11_18yrs_female_array) > 0): ?>
<button class="btn btn-link"><?php echo count($severely_underweight_11_18yrs_female_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($severely_underweight_11_18yrs_female_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B1-Severely Underweight (BMI < 16) Female">
<input type="hidden" name="age_range" value=">=18yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($severely_underweight_18yrs_female_array); ?></textarea>
<?php if (count($severely_underweight_18yrs_female_array) > 0): ?>
<button class="btn btn-link"><?php echo count($severely_underweight_18yrs_female_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($severely_underweight_18yrs_female_array);
endif;
?>
</form>
</td>
</tr>
<tr>
<td colspan="2" style="width: 50%;">B2 - {{ __('hmis_reports.underweight') }} (16<=BMI<18.5)</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B2-Underweight (16<=BMI<18.5) Male ">
<input type="hidden" name="age_range" value="5-10yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($underweight_5_10yrs_male_array); ?></textarea>
<?php if (count($underweight_5_10yrs_male_array) > 0): ?>
<button class="btn btn-link"><?php echo count($underweight_5_10yrs_male_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($underweight_5_10yrs_male_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B1-Severely Underweight (BMI < 16) Male">
<input type="hidden" name="age_range" value="11-18yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($underweight_11_18yrs_male_array); ?></textarea>
<?php if (count($underweight_11_18yrs_male_array) > 0): ?>
<button class="btn btn-link"><?php echo count($underweight_11_18yrs_male_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($underweight_11_18yrs_male_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B1-Severely Underweight (BMI < 16) Male">
<input type="hidden" name="age_range" value=">=18yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($underweight_18yrs_male_array); ?></textarea>
<?php if (count($underweight_18yrs_male_array) > 0): ?>
<button class="btn btn-link"><?php echo count($underweight_18yrs_male_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($underweight_18yrs_male_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B2-Underweight (16<=BMI<18.5) Female ">
<input type="hidden" name="age_range" value="5-10yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($underweight_5_10yrs_female_array); ?></textarea>
<?php if (count($underweight_5_10yrs_female_array) > 0): ?>
<button class="btn btn-link"><?php echo count($underweight_5_10yrs_female_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($underweight_5_10yrs_female_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B2-Underweight (16<=BMI<18.5) Female">
<input type="hidden" name="age_range" value="11-18yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($underweight_11_18yrs_female_array); ?></textarea>
<?php if (count($underweight_11_18yrs_female_array) > 0): ?>
<button class="btn btn-link"><?php echo count($underweight_11_18yrs_female_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($underweight_11_18yrs_female_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B1-Severely Underweight (BMI < 16) Female">
<input type="hidden" name="age_range" value=">=18yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($underweight_18yrs_female_array); ?></textarea>
<?php if (count($underweight_18yrs_female_array) > 0): ?>
<button class="btn btn-link"><?php echo count($underweight_18yrs_female_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($underweight_18yrs_female_array);
endif;
?>
</form>
</td>
</tr>
<tr>
<td colspan="2" style="width: 50%;">B3 - {{ __('hmis_reports.normal') }} (18.5<=BMI<25)</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B3-Normal (18.5<= BMI <25) Male ">
<input type="hidden" name="age_range" value="5-10yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($normal_5_10yrs_male_array); ?></textarea>
<?php if (count($normal_5_10yrs_male_array) > 0): ?>
<button class="btn btn-link"><?php echo count($normal_5_10yrs_male_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($normal_5_10yrs_male_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B3-Normal (18.5<= BMI <25) Male ">
<input type="hidden" name="age_range" value="5-10yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($normal_11_18yrs_male_array); ?></textarea>
<?php if (count($normal_11_18yrs_male_array) > 0): ?>
<button class="btn btn-link"><?php echo count($normal_11_18yrs_male_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($normal_11_18yrs_male_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B3-Normal (18.5<= BMI <25) Male ">
<input type="hidden" name="age_range" value=">=18yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($normal_18yrs_male_array); ?></textarea>
<?php if (count($normal_18yrs_male_array) > 0): ?>
<button class="btn btn-link"><?php echo count($normal_18yrs_male_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($normal_18yrs_male_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B3-Normal (18.5<= BMI <25) Female">
<input type="hidden" name="age_range" value="5-10yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($normal_5_10yrs_female_array); ?></textarea>
<?php if (count($normal_5_10yrs_female_array) > 0): ?>
<button class="btn btn-link"><?php echo count($normal_5_10yrs_female_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($normal_5_10yrs_female_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B3-Normal (18.5<= BMI <25) Female">
<input type="hidden" name="age_range" value="11-18yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($normal_11_18yrs_female_array); ?></textarea>
<?php if (count($normal_11_18yrs_female_array) > 0): ?>
<button class="btn btn-link"><?php echo count($normal_11_18yrs_female_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($normal_11_18yrs_female_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B3-Normal (18.5<= BMI <25) Female ">
<input type="hidden" name="age_range" value=">=18yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($normal_18yrs_female_array); ?></textarea>
<?php if (count($normal_18yrs_female_array) > 0): ?>
<button class="btn btn-link"><?php echo count($normal_18yrs_female_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($normal_18yrs_female_array);
endif;
?>
</form>
</td>
</tr>
<tr>
<td colspan="2" style="width: 50%;">B4 - {{ __('hmis_reports.overweight') }} (25<=BMI<30)</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B4-Over weight (25< BMI <=30) Male">
<input type="hidden" name="age_range" value="5-10yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($overweight_5_10yrs_male_array); ?></textarea>
<?php if (count($overweight_5_10yrs_male_array) > 0): ?>
<button class="btn btn-link"><?php echo count($overweight_5_10yrs_male_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($overweight_5_10yrs_male_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B4-Over weight (25< BMI <=30) Male">
<input type="hidden" name="age_range" value="11-18yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($overweight_11_18yrs_male_array); ?></textarea>
<?php if (count($overweight_11_18yrs_male_array) > 0): ?>
<button class="btn btn-link"><?php echo count($overweight_11_18yrs_male_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($overweight_11_18yrs_male_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B4-Over weight (25< BMI <=30) Male">
<input type="hidden" name="age_range" value=">=18yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($overweight_18yrs_male_array); ?></textarea>
<?php if (count($overweight_18yrs_male_array) > 0): ?>
<button class="btn btn-link"><?php echo count($overweight_18yrs_male_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($overweight_18yrs_male_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B4-Over weight (25< BMI <=30) Female">
<input type="hidden" name="age_range" value="5-10yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($overweight_5_10yrs_female_array); ?></textarea>
<?php if (count($overweight_5_10yrs_female_array) > 0): ?>
<button class="btn btn-link"><?php echo count($overweight_5_10yrs_female_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($overweight_5_10yrs_female_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B4-Over weight (25< BMI <=30) Female">
<input type="hidden" name="age_range" value="11-18yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($overweight_11_18yrs_female_array); ?></textarea>
<?php if (count($overweight_11_18yrs_female_array) > 0): ?>
<button class="btn btn-link"><?php echo count($overweight_11_18yrs_female_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($overweight_11_18yrs_female_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B4-Over weight (25< BMI <=30) Female">
<input type="hidden" name="age_range" value=">=18yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($overweight_18yrs_female_array); ?></textarea>
<?php if (count($overweight_18yrs_female_array) > 0): ?>
<button class="btn btn-link"><?php echo count($overweight_18yrs_female_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($overweight_18yrs_female_array);
endif;
?>
</form>
</td>
</tr>
<tr>
<td colspan="2" style="width: 50%;">B5 - {{ __('hmis_reports.obese') }} (BMI>30)</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B5-Obese ( BMI>30) Male">
<input type="hidden" name="age_range" value="5-10yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($obese_5_10yrs_male_array); ?></textarea>
<?php if (count($obese_5_10yrs_male_array) > 0): ?>
<button class="btn btn-link"><?php echo count($obese_5_10yrs_male_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($obese_5_10yrs_male_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B5-Obese ( BMI>30) Male">
<input type="hidden" name="age_range" value="11-18yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($obese_11_18yrs_male_array); ?></textarea>
<?php if (count($obese_11_18yrs_male_array) > 0): ?>
<button class="btn btn-link"><?php echo count($obese_11_18yrs_male_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($obese_11_18yrs_male_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B5-Obese ( BMI>30) Male">
<input type="hidden" name="age_range" value=">=18yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($obese_18yrs_male_array); ?></textarea>
<?php if (count($obese_18yrs_male_array) > 0): ?>
<button class="btn btn-link"><?php echo count($obese_18yrs_male_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($obese_18yrs_male_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B5-Obese ( BMI>30) Female">
<input type="hidden" name="age_range" value="5-10yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($obese_5_10yrs_female_array); ?></textarea>
<?php if (count($obese_5_10yrs_female_array) > 0): ?>
<button class="btn btn-link"><?php echo count($obese_5_10yrs_female_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($obese_5_10yrs_female_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B5-Obese ( BMI>30) Female">
<input type="hidden" name="age_range" value="11-18yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($obese_11_18yrs_female_array); ?></textarea>
<?php if (count($obese_11_18yrs_female_array) > 0): ?>
<button class="btn btn-link"><?php echo count($obese_11_18yrs_female_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($obese_11_18yrs_female_array);
endif;
?>
</form>
</td>
<td>
<form action="{{ url('bmi_report_details') }}" method="POST">
@csrf()
<input type="hidden" name="from" value="{{ $attendance_from }}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<input type="hidden" name="search_criteria" value="B5-Obese ( BMI>30) Male">
<input type="hidden" name="age_range" value=">=18yrs">
<textarea name="patient_ids" style="display: none;"><?php echo serialize($obese_18yrs_female_array); ?></textarea>
<?php if (count($obese_18yrs_female_array) > 0): ?>
<button class="btn btn-link"><?php echo count($obese_18yrs_female_array); ?></button>
<?php
else:
echo '&nbsp;&nbsp;&nbsp;' . count($obese_18yrs_female_array);
endif;
?>
</form>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<!-- Typehead Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
<!-- Data table javascript -->
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
jQuery('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy',
});
</script>
@endpush
@@ -0,0 +1,125 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h5 class="page-title">{{ __('hmis_reports.bmi_report_details') }}</h5>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('bmi_report') }}">{{ __('hmis_reports.bmi_report') }}</a></li>
<li class="active">{{ __('hmis_reports.bmi_report_details') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
<h4 class="heading" style="color: #0088CC; text-align: center; text-decoration: underline;"> {{ $search_criteria }} {{ __('hmis_reports.patients') }} ({{ $age_range }}) <i>{{ __('hmis_reports.from') }}</i> {{ streamline_date($from) }} <i>{{ __('hmis_reports.to') }}</i> {{ streamline_date($to) }}</h4>
<div class="row">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th></th>
<th>{{ __('hmis_reports.patient_number') }}</th>
<th>{{ __('hmis_reports.full_names') }}</th>
<th>{{ __('hmis_reports.gender') }}</th>
<th>{{ __('hmis_reports.age') }}</th>
<th>{{ __('hmis_reports.phone') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@php $counter = 1; @endphp
@if(count($patients_results) > 0)
@foreach($patients_results as $patient)
@php $dob = new Carbon\Carbon($patient->date_of_birth); @endphp
<tr>
<td>{{ $counter }}.</td>
<td>{{ $patient->number }}</td>
<td>{!! insurance_flag($patient->id) !!}</td>
<td>{{ $patient->gender == 1 ? "Male" : "Female" }}</td>
<td>{{ $dob->diffInYears(Carbon\Carbon::now()) }}yrs</td>
<td>{{ $patient->phone }}</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $patient->id }}" class="btn btn-success btn-xs">{{ __('hmis_reports.select') }}</a>
</td>
</tr>
@php $counter++; @endphp
@endforeach
@else
<tr class="warning"><td class="center" colspan="10">{{ __('hmis_reports.no_records_found') }}</td></tr>
@endif
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<!-- Typehead Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
<!-- Data table javascript -->
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
jQuery('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy',
});
$('.table').DataTable({
dom: 'Bfrtip',
order:[],
buttons: [{
extend: 'copy',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6]
},
title: 'BMI Report Details'
},
{
extend: 'csv',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6]
},
title: 'BMI Report Details'
},
{
extend: 'pdf',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6]
},
title: 'BMI Report Details'
},
{
extend: 'print',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6]
},
title: 'BMI Report Details'
}
]
});
</script>
@endpush
@@ -0,0 +1,193 @@
@php
$cma_id = get_name("Malaria - proven", "name", "id", "diagnoses");
$cdy_id = get_name("4", "hmis_no_inpatient", "id", "diagnoses");
$csa_id = get_name("13", "hmis_no_inpatient", "id", "diagnoses");
$caf_id = get_name("Acute flaccid paralysis (polio)", "name", "id", "diagnoses");
$cae_id = get_name("14", "hmis_no_inpatient", "id", "diagnoses");
$cab_id = get_name("2", "hmis_no_inpatient", "id", "diagnoses");
$cmg_id = get_name("08", "hmis_no_inpatient", "id", "diagnoses");
$cch_id = get_name("3", "hmis_no_inpatient", "id", "diagnoses");
$cgw_id = get_name("5", "hmis_no_inpatient", "id", "diagnoses");
$cme_id = get_name("Measles", "name", "id", "diagnoses");
$cnt_id = get_name("Tetanus (neonatal 0-28 days age)", "name", "id", "diagnoses");
$cvf_id = get_name("Viral Haemorrhagic Fever (e.g. Ebola)", "name", "id", "diagnoses");
$cpl_id = get_name("10", "hmis_no_inpatient", "id", "diagnoses");
$ctf_id = get_name("15", "hmis_no_inpatient", "id", "diagnoses");
$cyf_id = get_name("11", "hmis_no_inpatient", "id", "diagnoses");
$ctb_id = get_name("16", "hmis_no_inpatient", "id", "diagnoses");
$cma_query = "SELECT * FROM consultations WHERE primary_diagnosis = '{$cma_id}' AND created_at BETWEEN '{$attendance_from}' AND '{$attendance_to}'";
$cdy_query = "SELECT * FROM consultations WHERE primary_diagnosis = '{$cdy_id}' AND created_at BETWEEN '{$attendance_from}' AND '{$attendance_to}'";
$csa_query = "SELECT * FROM consultations WHERE primary_diagnosis = '{$csa_id}' AND created_at BETWEEN '{$attendance_from}' AND '{$attendance_to}'";
$caf_query = "SELECT * FROM consultations WHERE primary_diagnosis = '{$caf_id}' AND created_at BETWEEN '{$attendance_from}' AND '{$attendance_to}'";
$cae_query = "SELECT * FROM consultations WHERE primary_diagnosis = '{$cae_id}' AND created_at BETWEEN '{$attendance_from}' AND '{$attendance_to}'";
$cab_query = "SELECT * FROM consultations WHERE primary_diagnosis = '{$cab_id}' AND created_at BETWEEN '{$attendance_from}' AND '{$attendance_to}'";
$cmg_query = "SELECT * FROM consultations WHERE primary_diagnosis = '{$cmg_id}' AND created_at BETWEEN '{$attendance_from}' AND '{$attendance_to}'";
$cch_query = "SELECT * FROM consultations WHERE primary_diagnosis = '{$cch_id}' AND created_at BETWEEN '{$attendance_from}' AND '{$attendance_to}'";
$cgw_query = "SELECT * FROM consultations WHERE primary_diagnosis = '{$cgw_id}' AND created_at BETWEEN '{$attendance_from}' AND '{$attendance_to}'";
$cme_query = "SELECT * FROM consultations WHERE primary_diagnosis = '{$cme_id}' AND created_at BETWEEN '{$attendance_from}' AND '{$attendance_to}'";
$cnt_query = "SELECT * FROM consultations WHERE primary_diagnosis = '{$cnt_id}' AND created_at BETWEEN '{$attendance_from}' AND '{$attendance_to}'";
$cvf_query = "SELECT * FROM consultations WHERE primary_diagnosis = '{$cvf_id}' AND created_at BETWEEN '{$attendance_from}' AND '{$attendance_to}'";
$cpl_query = "SELECT * FROM consultations WHERE primary_diagnosis = '{$cpl_id}' AND created_at BETWEEN '{$attendance_from}' AND '{$attendance_to}'";
$ctf_query = "SELECT * FROM consultations WHERE primary_diagnosis = '{$ctf_id}' AND created_at BETWEEN '{$attendance_from}' AND '{$attendance_to}'";
$cyf_query = "SELECT * FROM consultations WHERE primary_diagnosis = '{$cyf_id}' AND created_at BETWEEN '{$attendance_from}' AND '{$attendance_to}'";
$ctb_query = "SELECT * FROM consultations WHERE primary_diagnosis = '{$ctb_id}' AND created_at BETWEEN '{$attendance_from}' AND '{$attendance_to}'";
$cma = DB::select($cma_query);
$cma_row_count = count($cma);
$cdy = DB::select($cdy_query);
$cdy_row_count = count($cdy);
$csa = DB::select($csa_query);
$csa_row_count = count($csa);
$caf = DB::select($caf_query);
$caf_row_count = count($caf);
$cae = DB::select($cae_query);
$cae_row_count = count($cae);
$cab = DB::select($cab_query);
$cab_row_count = count($cab);
$cmg = DB::select($cmg_query);
$cmg_row_count = count($cmg);
$cch = DB::select($cch_query);
$cch_row_count = count($cch);
$cgw = DB::select($cgw_query);
$cgw_row_count = count($cgw);
$cme = DB::select($cme_query);
$cme_row_count = count($cme);
$cnt = DB::select($cnt_query);
$cnt_row_count = count($cnt);
$cvf = DB::select($cvf_query);
$cvf_row_count = count($cvf);
$cpl = DB::select($cpl_query);
$cpl_row_count=count($cpl);
$ctf = DB::select($ctf_query);
$ctf_row_count = count($ctf);
$cyf = DB::select($cyf_query);
$cyf_row_count = count($cyf);
$ctb = DB::select($ctb_query);
$ctb_row_count = count($ctb);
session()->put(['attendance_from' => $attendance_from]);
session()->put(['attendance_to' => $attendance_to]);
@endphp
<table class="table table-condensed table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th colspan="2"><strong>{{ __('hmis_reports.cases') }}</strong></th>
<th><strong>{{ __('hmis_reports.code') }}</strong></th>
<th><strong>{{ __('hmis_reports.cases_this_week') }}</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 1%">1</td>
<td>{{ __('hmis_reports.malaria') }}</td>
<td style="width: 5%"><strong>MA</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_cases_details/{{ $cma_id }}"><?php echo $cma_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">2</td>
<td>{{ __('hmis_reports.dysentery') }}</td>
<td style="width: 5%"><strong>DY</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_cases_details/{{ $cdy_id }}"><?php echo $cdy_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">3</td>
<td>{{ __('hmis_reports.sari') }}</td>
<td style="width: 5%"><strong>SA</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_cases_details/{{ $csa_id }}"><?php echo $csa_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">4</td>
<td>{{ __('hmis_reports.acute_flaccid') }}</td>
<td style="width: 5%"><strong>AF</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_cases_details/{{ $caf_id }}"><?php echo $caf_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">5</td>
<td>{{ __('hmis_reports.adverse_immun') }}</td>
<td style="width: 5%"><strong>AE</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_cases_details/{{ $cae_id }}"><?php echo $cae_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">6</td>
<td>{{ __('hmis_reports.animal_bites') }}</td>
<td style="width: 5%"><strong>AB</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_cases_details/{{ $cab_id }}"><?php echo $cab_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">7</td>
<td>{{ __('hmis_reports.bacteria_meningitis') }}</td>
<td style="width: 5%"><strong>MG</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_cases_details/{{ $cmg_id }}"><?php echo $cmg_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">8</td>
<td>{{ __('hmis_reports.cholera') }}</td>
<td style="width: 5%"><strong>CH</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_cases_details/{{ $cch_id }}"><?php echo $cch_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">9</td>
<td>{{ __('hmis_reports.guinea_worm') }}</td>
<td style="width: 5%"><strong>GW</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_cases_details/{{ $cgw_id }}"><?php echo $cgw_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">10</td>
<td>{{ __('hmis_reports.measles') }}</td>
<td style="width: 5%"><strong>ME</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_cases_details/{{ $cme_id }}"><?php echo $cme_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">11</td>
<td>{{ __('hmis_reports.neonatal_tetanus') }}</td>
<td style="width: 5%"><strong>NT</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_cases_details/{{ $cnt_id }}"><?php echo $cnt_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">12</td>
<td>{{ __('hmis_reports.other_viral_fevers') }}</td>
<td style="width: 5%"><strong>VF</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_cases_details/{{ $cvf_id }}"><?php echo $cvf_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">13</td>
<td>{{ __('hmis_reports.plague') }}</td>
<td style="width: 5%"><strong>PL</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_cases_details/{{ $cpl_id }}"><?php echo $cpl_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">14</td>
<td>{{ __('hmis_reports.typhoid_fever') }}</td>
<td style="width: 5%"><strong>TF</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_cases_details/{{ $ctf_id }}"><?php echo $ctf_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">15</td>
<td>{{ __('hmis_reports.yellow_fever') }}</td>
<td style="width: 5%"><strong>YF</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_cases_details/{{ $cyf_id }}"><?php echo $cyf_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">16</td>
<td>{{ __('hmis_reports.presumptive_tb') }}</td>
<td style="width: 5%"><strong>TB</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_cases_details/{{ $ctb_id }}"><?php echo $ctb_row_count?></a></td>
</tr>
</tbody>
</table>
@@ -0,0 +1,93 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-6">
<h4 class="page-title">{{ __('hmis_reports.days_drugs_outta_stock') }}</h4>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
<li class="active">{{ __('hmis_reports.drugs_outta_stock_report') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['route' => 'memorised_reports.days_drugs_out_of_stock' , 'data-toggle' => 'validator']) }}
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-3">
<div class="form-group">
{{ Form::label('start_date',__('hmis_reports.from')) }}
{{ Form::text('start_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'start_date']) }}
</div>
</div>
<div class="col-md-3">
<div class="form-group">
{{ Form::label('end_date',__('hmis_reports.to')) }}
{{ Form::text('end_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'end_date']) }}
</div>
</div>
<div class="col-md-2">
<br>
{{ Form::button(__('hmis_reports.search'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
</div>
</div>
{{ Form::close() }}
<hr>
<h4 style="color: #0060BF; font-weight: bolder;">{{ __('hmis_reports.showing_results_from') }} {{ streamline_date($start_date) }} {{ __('hmis_reports.to') }} {{ streamline_date($end_date) }}</h4>
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('hmis_reports.drug_name') }}</th>
<th>{{ __('hmis_reports.num_days') }}</th>
</tr>
</thead>
<tbody>
@if(count($selected_drugs) > 0)
@foreach($selected_drugs as $drug_id => $days)
<tr>
<td>{{ get_name($drug_id, 'id', 'name', 'drugs') }} </td>
<td>{{ $days }}</td>
</tr>
@endforeach
@else
<tr>
<td colspan="2">
<h4 class='text-center'>{{ __('hmis_reports.no_drugs_outta_period') }}</h4>
</td>
</tr>
@endif
</tbody>
</table>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy'
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy'
});
</script>
@endpush
@@ -0,0 +1,162 @@
@php
$dma_id = get_name("Malaria - proven", "name", "id", "diagnoses");
$ddy_id = get_name("4", "hmis_no_inpatient", "id", "diagnoses");
$dsa_id = get_name("13", "hmis_no_inpatient", "id", "diagnoses");
$daf_id = get_name("Acute flaccid paralysis (polio)", "name", "id", "diagnoses");
$dae_id = get_name("14", "hmis_no_inpatient", "id", "diagnoses");
$dab_id = get_name("2", "hmis_no_inpatient", "id", "diagnoses");
$dmg_id = get_name("08", "hmis_no_inpatient", "id", "diagnoses");
$dch_id = get_name("3", "hmis_no_inpatient", "id", "diagnoses");
$dgw_id = get_name("5", "hmis_no_inpatient", "id", "diagnoses");
$dme_id = get_name("Measles", "name", "id", "diagnoses");
$dnt_id = get_name("Tetanus (neonatal 0-28 days age)", "name", "id", "diagnoses");
$dvf_id = get_name("Viral Haemorrhagic Fever (e.g. Ebola)", "name", "id", "diagnoses");
$dpl_id = get_name("10", "hmis_no_inpatient", "id", "diagnoses");
$dtf_id = get_name("15", "hmis_no_inpatient", "id", "diagnoses");
$dyf_id = get_name("11", "hmis_no_inpatient", "id", "diagnoses");
$dtb_id = get_name("16", "hmis_no_inpatient", "id", "diagnoses");
$dmd = 0; //_id = get_name("Maternal", "name", "id", "diagnosis");
$dpd = 0; //_id = get_name("Perinatal", "name", "id", "diagnosis");
// outcome_id = 5 means died
$dma_row_count = DB::table('consultations')->where('primary_diagnosis', $dma_id)->where('outcome_id', 5)->whereBetween('created_at', [$attendance_from, $attendance_to])->count();
$ddy_row_count = DB::table('consultations')->where('primary_diagnosis', $ddy_id)->where('outcome_id', 5)->whereBetween('created_at', [$attendance_from, $attendance_to])->count();
$dsa_row_count = DB::table('consultations')->where('primary_diagnosis', $dsa_id)->where('outcome_id', 5)->whereBetween('created_at', [$attendance_from, $attendance_to])->count();
$daf_row_count = DB::table('consultations')->where('primary_diagnosis', $daf_id)->where('outcome_id', 5)->whereBetween('created_at', [$attendance_from, $attendance_to])->count();
$dae_row_count = DB::table('consultations')->where('primary_diagnosis', $dae_id)->where('outcome_id', 5)->whereBetween('created_at', [$attendance_from, $attendance_to])->count();
$dab_row_count = DB::table('consultations')->where('primary_diagnosis', $dab_id)->where('outcome_id', 5)->whereBetween('created_at', [$attendance_from, $attendance_to])->count();
$dmg_row_count = DB::table('consultations')->where('primary_diagnosis', $dmg_id)->where('outcome_id', 5)->whereBetween('created_at', [$attendance_from, $attendance_to])->count();
$dch_row_count = DB::table('consultations')->where('primary_diagnosis', $dch_id)->where('outcome_id', 5)->whereBetween('created_at', [$attendance_from, $attendance_to])->count();
$dgw_row_count = DB::table('consultations')->where('primary_diagnosis', $dgw_id)->where('outcome_id', 5)->whereBetween('created_at', [$attendance_from, $attendance_to])->count();
$dme_row_count = DB::table('consultations')->where('primary_diagnosis', $dme_id)->where('outcome_id', 5)->whereBetween('created_at', [$attendance_from, $attendance_to])->count();
$dnt_row_count = DB::table('consultations')->where('primary_diagnosis', $dnt_id)->where('outcome_id', 5)->whereBetween('created_at', [$attendance_from, $attendance_to])->count();
$dvf_row_count = DB::table('consultations')->where('primary_diagnosis', $dvf_id)->where('outcome_id', 5)->whereBetween('created_at', [$attendance_from, $attendance_to])->count();
$dpl_row_count = DB::table('consultations')->where('primary_diagnosis', $dpl_id)->where('outcome_id', 5)->whereBetween('created_at', [$attendance_from, $attendance_to])->count();
$dtf_row_count = DB::table('consultations')->where('primary_diagnosis', $dtf_id)->where('outcome_id', 5)->whereBetween('created_at', [$attendance_from, $attendance_to])->count();
$dyf_row_count = DB::table('consultations')->where('primary_diagnosis', $dyf_id)->where('outcome_id', 5)->whereBetween('created_at', [$attendance_from, $attendance_to])->count();
$dtb_row_count = DB::table('consultations')->where('primary_diagnosis', $dtb_id)->where('outcome_id', 5)->whereBetween('created_at', [$attendance_from, $attendance_to])->count();
@endphp
<table class="table table-condensed table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th colspan="2"><strong>{{ __('hmis_reports.deaths') }}</strong></th>
<th><strong>{{ __('hmis_reports.code') }}</strong></th>
<th><strong>{{ __('hmis_reports.deaths_this_week') }}</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td style="width: 1%">1</td>
<td>{{ __('hmis_reports.malaria') }}</td>
<td style="width: 5%"><strong>MA</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_deaths_details/{{ $dma_id }}"><?php echo $dma_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">2</td>
<td>{{ __('hmis_reports.dysentery') }}</td>
<td style="width: 5%"><strong>DY</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_deaths_details/{{ $ddy_id }}"><?php echo $ddy_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">3</td>
<td>{{ __('hmis_reports.sari') }}</td>
<td style="width: 5%"><strong>SA</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_deaths_details/{{ $dsa_id }}"><?php echo $dsa_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">4</td>
<td>{{ __('hmis_reports.acute_flaccid') }}</td>
<td style="width: 5%"><strong>AF</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_deaths_details/{{ $daf_id }}"><?php echo $daf_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">5</td>
<td>{{ __('hmis_reports.adverse_immun') }}</td>
<td style="width: 5%"><strong>AE</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_deaths_details/{{ $dae_id }}"><?php echo $dae_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">6</td>
<td>{{ __('hmis_reports.animal_bites') }}</td>
<td style="width: 5%"><strong>AB</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_deaths_details/{{ $dab_id }}"><?php echo $dab_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">7</td>
<td>{{ __('hmis_reports.bacteria_meningitis') }}</td>
<td style="width: 5%"><strong>MG</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_deaths_details/{{ $dmg_id }}"><?php echo $dmg_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">8</td>
<td>{{ __('hmis_reports.cholera') }}</td>
<td style="width: 5%"><strong>CH</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_deaths_details/{{ $dch_id }}"><?php echo $dch_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">9</td>
<td>{{ __('hmis_reports.guinea_worm') }}</td>
<td style="width: 5%"><strong>GW</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_deaths_details/{{ $dgw_id }}"><?php echo $dgw_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">10</td>
<td>{{ __('hmis_reports.measles') }}</td>
<td style="width: 5%"><strong>ME</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_deaths_details/{{ $dme_id }}"><?php echo $dme_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">11</td>
<td>{{ __('hmis_reports.neonatal_tetanus') }}</td>
<td style="width: 5%"><strong>NT</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_deaths_details/{{ $dnt_id }}"><?php echo $dnt_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">12</td>
<td>{{ __('hmis_reports.other_viral_fevers') }}</td>
<td style="width: 5%"><strong>VF</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_deaths_details/{{ $dvf_id }}"><?php echo $dvf_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">13</td>
<td>{{ __('hmis_reports.plague') }}</td>
<td style="width: 5%"><strong>PL</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_deaths_details/{{ $dpl_id }}"><?php echo $dpl_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">14</td>
<td>{{ __('hmis_reports.typhoid_fever') }}</td>
<td style="width: 5%"><strong>TF</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_deaths_details/{{ $dtf_id }}"><?php echo $dtf_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">15</td>
<td>{{ __('hmis_reports.yellow_fever') }}</td>
<td style="width: 5%"><strong>YF</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_deaths_details/{{ $dyf_id }}"><?php echo $dyf_row_count?></a></td>
</tr>
<tr>
<td style="width: 1%">16</td>
<td>{{ __('hmis_reports.presumptive_tb') }}</td>
<td style="width: 5%"><strong>TB</strong></td>
<td style="width: 5%"><a style="color: #0088cc;" href="weekly_epidemiological_surveillance_deaths_details/{{ $dtb_id }}"><?php echo $dtb_row_count?></a></td>
</tr>
</tbody>
</table>
@@ -0,0 +1,123 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-6">
<h4 class="page-title">{{ __('hmis_reports.diagnosis_report_details') }}</h4>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="/reports">{{ __('hmis_reports.streamline_reports') }}</a></li>
<li class="active">{{ __('hmis_reports.diagnosis_report_details') }}</li>
</ol>
</div>
</div>
<div class="white-box">
<h3>Diagnosis: {{ get_name($diagnosis_id, 'id', 'name', 'diagnoses') }}</h3>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('hmis_reports.patient_number') }}</th>
<th>{{ __('hmis_reports.full_names') }}</th>
<th>{{ __('hmis_reports.gender') }}</th>
<th>{{ __('hmis_reports.age') }}</th>
<th>{{ __('patients.phone_number') }}</th>
<th>{{ __('hmis_reports.next_of_kin') }}</th>
<th>{{ __('hmis_reports.custom_field') }}</th>
<th>{{ __('hmis_reports.date') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($patients as $value)
<tr>
<td>
{{ $value["patient_number"] }}
</td>
<td>
{!! $value["patient_name"] !!}
</td>
<td>
{{ $value["gender"] }}
</td>
<td>
{{ get_patients_age($value["date_of_birth"]) }}
</td>
<td> {{ $value["phone"] }}</td>
<td>{{ $value["next_of_kin"] }} ({{ $value["phone_of_next_of_kin"] }})</td>
<td>{{ $custom_field?? '' }}</td>
<td>
{{ streamline_date_time($value["created_at"]) }}
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $value["patient_id"] }}" class="btn btn-rounded btn-sm btn-success" target="_blank"><i class="fa fa-hand-pointer-o"></i> {{ __('hmis_reports.select') }}</a>
</td>
<td><a href="/patients/{{ $value["patient_id"] }}/" class="btn btn-rounded btn-info btn-sm" target="_blank"><i class="fa fa-info-circle"></i> {{ __('patients.details') }}</a></td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 100,
aaSorting: [],
columnDefs: [{
targets: [4,5,6,8,9], /* column index */
orderable: false, /* true or false */
}],
buttons: [
{
extend: 'copy',
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5, 6 ]
}
},
{
extend: 'csv',
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5, 6 ]
}
},
{
extend: 'pdf',
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5, 6 ]
}
},
{
extend: 'print',
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5, 6 ]
}
}
]
});
</script>
@endpush
@@ -0,0 +1,101 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@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">{{ __('hmis_reports.diagnosis_report') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="/reports">{{ __('hmis_reports.streamline_reports') }}</a></li>
<li class="active">{{ __('hmis_reports.diagnosis_report') }}</li>
</ol>
</div>
</div>
<div class="white-box">
<p>{{ __('hmis_reports.search_criteria') }} : <code>{{ $criteria }}</code> &nbsp;&nbsp;&nbsp;<a href="/reports">{{ __('hmis_reports.clear_search') }}</a></p>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table" id="diagnosis_table">
<thead>
<tr>
<th>{{ __('hmis_reports.diagnosis_name') }}</th>
<th>{{ __('hmis_reports.female') }}</th>
<th>{{ __('hmis_reports.male') }}</th>
<th>{{ __('hmis_reports.totals') }}</th>
</tr>
</thead>
<tbody>
@for($i = 0; $i < count($diagnosis_array); $i++)
<tr>
<td>{{ get_name($diagnosis_array[$i], 'id', 'name', 'diagnoses') }}</td>
<td>
<a href="/streamline_reports/diagnosis_drill_down/{{ $diagnosis_array[$i] }}/2">{{ isset($female_totals_array[$i]) ? $female_totals_array[$i] : 0 }}</a>
@php $femalesArray = isset($female_totals_array[$i]) ? $female_totals_array[$i] : 0; @endphp
</td>
<td>
<a href="/streamline_reports/diagnosis_drill_down/{{ $diagnosis_array[$i] }}/1">{{ isset($male_totals_array[$i]) ? $male_totals_array[$i] : 0 }}</a>
@php $malesArray = isset($male_totals_array[$i]) ? $male_totals_array[$i] : 0; @endphp
</td>
<td>
<a href="/streamline_reports/diagnosis_drill_down/{{ $diagnosis_array[$i] }}/3">{{ $femalesArray + $malesArray }}</a>
</td>
</tr>
@endfor
</tbody>
</table>
</div>
<hr>
<table class="table color-bordered-table success-bordered-table">
<tr>
<th></th>
<th><b>{{ __('hmis_reports.female') }}</b></th>
<th><b>{{ __('hmis_reports.male') }}</b></th>
<th><b>{{ __('hmis_reports.totals') }}</b></th>
</tr>
<tr>
<td><b>{{ __('hmis_reports.totals') }}</b></td>
<td>{{ $female_totals }}</td>
<td>{{ $male_totals }}</td>
<td>{{ $male_totals + $female_totals }}</td>
</tr>
</table>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('#diagnosis_table').DataTable({
dom: 'Bfrtip',
pageLength: 100,
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
],
"aoColumnDefs": [{
"aTargets": [2,3],
"defaultContent": "",
}]
});
</script>
@endpush
@@ -0,0 +1,126 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('hmis_reports.disease_prevalence') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
<li class="active">{{ __('hmis_reports.disease_prevalence') }}</li>
</ol>
</div>
</div>
<div class="white-box">
<div class="row">
{{ Form::open(['route' => 'disease_prevalence_charts']) }}
<div class="col-md-3">
<div class="form-group" id="diagnosis_div">
{{ Form::label('diagnosis_id',__('hmis_reports.select_diagnosis')) }}
{{ Form::select('diagnosis_id',$diagnoses,'',['class'=>'form-control compulsory', 'id' => 'diagnosis']) }}
</div>
</div>
<div class="col-md-3">
<div class="form-group">
{{ Form::label('start_date',__('hmis_reports.from')) }}
<div class="input-group">
{{ Form::text('start_date','',['class' => 'form-control', 'required','readonly','id'=>'datepicker-from']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
{{ Form::label('end_date',__('hmis_reports.to')) }}
<div class="input-group">
{{ Form::text('end_date','',['class' => 'form-control', 'required','readonly','id'=>'datepicker-to']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-3" style="margin-top: 20px">
{{ Form::button(__('hmis_reports.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('hmis_reports.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
</div>
{{ Form::close() }}
</div>
</div>
<div class="white-box">
@include('flash::message')
<h3 class="heading" style="text-align: center; text-decoration: underline;">{{ __('hmis_reports.disease_prevalence_time') }}</h3>
<hr>
<div class="row">
<div class="col-md-12">
@if(count($month_array) > 0)
<canvas id="canvas"></canvas>
@else
<p style="color: red" class="text-center">{{ __('hmis_reports.no_records_found') }}</p>
@endif
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('js/chartjs/chart.bundle.js') }}"></script>
<script src="{{ asset('js/chartjs/utils.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script>
// apply searchable dropdown
$('#diagnosis').select2({
//
});
$('.select2-selection.select2-selection--single').css('height','calc(3.85rem)');
$('.select2-selection.select2-selection--single').css('padding-top','5px');
$('.select2-selection__arrow').css('top','3px');
$('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
let chartdata = {
type: 'bar',
data: {
labels: <?php echo json_encode($month_array); ?>,
datasets: [
{
label: <?php echo json_encode($label); ?>,
backgroundColor: '#26B99A',
borderWidth: 1,
data: <?php echo json_encode($data_array); ?>
}
]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero:true
}
}]
}
}
};
let ctx = document.getElementById('canvas').getContext('2d');
new Chart(ctx, chartdata);
</script>
@endpush
@@ -0,0 +1,120 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@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">Stre@mline Reports</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">Dashboard</a></li>
<li class="active">Doctors' Performance Report</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
<p>Search criteria : <code>{{ $criteria }}</code> &nbsp;&nbsp;&nbsp;<a href="{{ route('streamline_reports.index') }}">Clear search</a></p>
<hr>
<h3>Doctors' Performance Report</h3>
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>Doctor Name</th>
<th>Patients Seen</th>
<th>Investigation Requests Made</th>
<th>Prescriptions Made</th>
<th>Admissions Made</th>
</tr>
</thead>
<form action="/streamline_reports/doctors_performance_report_details" method="POST" target="_blank" id="report_details">
{{ csrf_field() }}
{{ Form::hidden('doctor_id', 0, ['id' => 'doctor_id']) }}
{{ Form::hidden('report_type', 0, ['id' => 'report_type']) }}
{{ Form::hidden('start_date', $start_date) }}
{{ Form::hidden('end_date', $end_date) }}
</form>
<tbody>
@foreach($doctors as $doctor)
<tr>
<td>{{ $doctor['name'] }}</td>
<td>
@if($doctor['patients_seen'] > 0)
<a href="#" onclick="generate_report({{ $doctor['id'] }}, 1)">{{ $doctor['patients_seen'] }}</a>
@else
{{ $doctor['patients_seen'] }}
@endif
</td>
<td>
@if($doctor['investigations'] > 0)
<a href="#" onclick="generate_report({{ $doctor['id'] }}, 2)">{{ $doctor['investigations'] }}</a>
@else
{{ $doctor['investigations'] }}
@endif
</td>
<td>
@if($doctor['prescriptions'] > 0)
<a href="#" onclick="generate_report({{ $doctor['id'] }}, 3)">{{ $doctor['prescriptions'] }}</a>
@else
{{ $doctor['prescriptions'] }}
@endif
</td>
<td>
@if($doctor['admissions'] > 0)
<a href="#" onclick="generate_report({{ $doctor['id'] }}, 4)">{{ $doctor['admissions'] }}</a>
@else
{{ $doctor['admissions'] }}
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script type="text/javascript">
$('.table').DataTable({
dom: 'Bfrtip',
pageLength : 100,
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
function generate_report(doctor_id, report_type) {
$('#doctor_id').val(doctor_id);
$('#report_type').val(report_type);
$('#report_details').submit();
}
</script>
@endpush
@@ -0,0 +1,199 @@
@extends('layouts.main')
@push('styles')
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">Stre@mline Reports</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">Dashboard</a></li>
<li class="active">Doctors' Performance Report Details</li>
</ol>
</div>
</div>
<div class="white-box">
<p>Search criteria : <code>{{ $criteria }}</code></p>
<hr>
<h3>Doctors' Performance Report Details For {{ get_full_name($doctor_id, 'id', 'first_name', 'last_name', 'users') }}</h3>
@php $counter = 1; @endphp
@if($report_type == 1)
<h3><b>Patients Seen</b></h3>
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>#</th>
<th>Patient Name</th>
<th>Clinic Name</th>
@if(Auth::user()->can('view-patient-episode-primary-diagnoses'))<th>Diagnosis</th>@endif
<th>Consultation Date</th>
@if(Auth::user()->can('view-patients-home'))<th>Patient Details</th>@endif
</tr>
</thead>
<tbody>
@foreach($patients as $patient)
<tr>
<td>{{ $counter }} @php $counter++; @endphp</td>
<td>{{ $patient['name'] }} ({{ $patient['number'] }} - {{ $patient['patient_category'] }})</td>
<td>{{ $patient['clinic'] }}</td>
@if(Auth::user()->can('view-patient-episode-primary-diagnoses'))<td>{{ $patient['diagnosis'] }}</td>@endif
<td>{{ $patient['date'] }}</td>
@if(Auth::user()->can('view-patients-home'))<td><a class="btn btn-success" href="/patient_episodes/set_patient_id/{{ $patient['id'] }}">Patient Details</a></td>@endif
</tr>
@endforeach
</tbody>
</table>
</div>
@elseif($report_type == 2)
<h3><b>Investigation Requests Made</b></h3>
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>#</th>
<th>Patient Name</th>
<th>Clinic Name</th>
@if(Auth::user()->can('view-patient-episode-primary-diagnoses'))<th>Diagnosis</th>@endif
<th>Consultation Date</th>
<th>Investigations Ordered</th>
@if(Auth::user()->can('view-patients-home'))<th>Patient Details</th>@endif
</tr>
</thead>
<tbody>
@foreach($investigation_orders as $patient)
<tr>
<td>{{ $counter }} @php $counter++; @endphp</td>
<td>{{ $patient['name'] }} ({{ $patient['number'] }} - {{ $patient['patient_category'] }})</td>
<td>{{ $patient['clinic'] }}</td>
@if(Auth::user()->can('view-patient-episode-primary-diagnoses'))<td>{{ $patient['diagnosis'] }}</td>@endif
<td>{{ $patient['date'] }}</td>
<td>
<table class="table table-striped">
<tr>
<td><b>Investigation</b></td>
<td><b>Date Ordered</b></td>
<td></td>
</tr>
@foreach($patient['investigations'] as $pat_inv)
<tr>
<td>
<ol>
@foreach(explode(',', $pat_inv->investigation_id) as $investigation)
<li>{{ $investigations[$investigation] }}</li>
@endforeach
</ol>
</td>
<td>{{ streamline_date_time($pat_inv->created_at) }}</td>
<td>
@if($pat_inv->investigation_status == 1)
Results Available
@endif
</td>
</tr>
@endforeach
</table>
</td>
@if(Auth::user()->can('view-patients-home'))<td><a class="btn btn-success" href="/patient_episodes/set_patient_id/{{ $patient['id'] }}">Patient Details</a></td>@endif
</tr>
@endforeach
</tbody>
</table>
</div>
@elseif($report_type == 3)
<h3><b>Prescriptions Made</b></h3>
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>#</th>
<th>Patient Name</th>
<th>Clinic Name</th>
@if(Auth::user()->can('view-patient-episode-primary-diagnoses'))<th>Diagnosis</th>@endif
<th>Consultation Date</th>
<th>Drugs Prescribed</th>
@if(Auth::user()->can('view-patients-home'))<th>Patient Details</th>@endif
</tr>
</thead>
<tbody>
@foreach($prescriptions as $patient)
<tr>
<td>{{ $counter }} @php $counter++; @endphp</td>
<td>{{ $patient['name'] }} ({{ $patient['number'] }} - {{ $patient['patient_category'] }})</td>
<td>{{ $patient['clinic'] }}</td>
@if(Auth::user()->can('view-patient-episode-primary-diagnoses'))<td>{{ $patient['diagnosis'] }}</td>@endif
<td>{{ $patient['date'] }}</td>
<td>
<table class="table table-striped">
<tr>
<td><b>Drugs</b></td>
<td><b>Date Prescribed</b></td>
</tr>
@foreach($patient['treatments'] as $prescription)
<tr>
<td>
<ol>
@foreach(explode(',', $prescription->drugs) as $drug)
<li>{{ $drugs[$drug] }}</li>
@endforeach
</ol>
</td>
<td>{{ streamline_date_time($prescription->created_at) }}</td>
</tr>
@endforeach
</table>
</td>
@if(Auth::user()->can('view-patients-home'))<td><a class="btn btn-success" href="/patient_episodes/set_patient_id/{{ $patient['id'] }}">Patient Details</a></td>@endif
</tr>
@endforeach
</tbody>
</table>
</div>
@elseif($report_type == 4)
<h3><b>Admissions Made</b></h3>
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
<thead>
<tr>
<th>#</th>
<th>Patient Name</th>
<th>Clinic Name</th>
@if(Auth::user()->can('view-patient-episode-primary-diagnoses'))<th>Diagnosis</th>@endif
<th>Consultation Date</th>
<th>Ward</th>
@if(Auth::user()->can('view-patients-home'))<th>Patient Details</th>@endif
</tr>
</thead>
<tbody>
@foreach($admitted_patients as $patient)
<tr>
<td>{{ $counter }} @php $counter++; @endphp</td>
<td>{{ $patient['name'] }} ({{ $patient['number'] }} - {{ $patient['patient_category'] }})</td>
<td>{{ $patient['clinic'] }}</td>
@if(Auth::user()->can('view-patient-episode-primary-diagnoses'))<td>{{ $patient['diagnosis'] }}</td>@endif
<td>{{ $patient['date'] }}</td>
<td>{{ $patient['ward'] }}</td>
@if(Auth::user()->can('view-patients-home'))<td><a class="btn btn-success" href="/patient_episodes/set_patient_id/{{ $patient['id'] }}">Patient Details</a></td>@endif
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
</div>
@endsection
@push('scripts')
<script type="text/javascript"></script>
@endpush
@@ -0,0 +1,103 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('hmis_reports.drug_consumption_analysis') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
<li class="active">{{ __('hmis_reports.drug_consumption_analysis') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
<h3 class="heading" style="text-align: center; text-decoration: underline;">{{ __('hmis_reports.drug_consumption_analysis') }}</h3>
<hr>
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('hmis_reports.drug_name') }}</th>
<th>Jan</th>
<th>Feb</th>
<th>Mar</th>
<th>Apr</th>
<th>May</th>
<th>June</th>
<th>July</th>
<th>Aug</th>
<th>Sept</th>
<th>Oct</th>
<th>Nov</th>
<th>Dec</th>
<th>{{ __('hmis_reports.total') }}</th>
</tr>
</thead>
<tbody>
@for($i = 0; $i < count($drugs_array); $i++)
@php
$total_consumption = $january[$i] + $february[$i] + $march[$i] + $april[$i] +
$may[$i] + $june[$i] + $july[$i] + $august[$i] + $september[$i] +
$october[$i] + $november[$i] + $december[$i];
@endphp
<tr>
<td>{{ get_name($drugs_array[$i], 'id', 'name', 'drugs') }}</td>
<td>{{ $january[$i] }}</td>
<td>{{ $february[$i] }}</td>
<td>{{ $march[$i] }}</td>
<td>{{ $april[$i] }}</td>
<td>{{ $may[$i] }}</td>
<td>{{ $june[$i] }}</td>
<td>{{ $july[$i] }}</td>
<td>{{ $august[$i] }}</td>
<td>{{ $september[$i] }}</td>
<td>{{ $october[$i] }}</td>
<td>{{ $november[$i] }}</td>
<td>{{ $december[$i] }}</td>
<td>{{ $total_consumption }}</td>
</tr>
@endfor
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
</script>
@endpush
@@ -0,0 +1,153 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('hmis_reports.drug_consumption_report') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
<li class="active">{{ __('hmis_reports.drug_consumption_report') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
<h3 class="heading" style="text-align: center; text-decoration: underline;">{{ __('hmis_reports.drug_consumption_report') }}</h3>
<div class="row">
<div class="col-sm-3">
{{ __('hmis_reports.showing_results_from') }} <span class="label label-info">{{ streamline_date($start_date) }}</span> {{ __('hmis_reports.to') }} <span class="label label-info">{{ streamline_date($end_date) }}</span>
</div>
<div class="col-sm-1">
{{ Form::open(['url' => 'drug_consumption_report','data-toggle'=>'validator']) }}
{{ Form::label('start_date',__('hmis_reports.from')) }}
</div>
<div class="col-sm-3">
<div class="input-group">
{{ Form::text('start_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-from']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
<div class="col-sm-1">
{{ Form::label('end_date',__('hmis_reports.to')) }}
</div>
<div class="col-sm-3">
<div class="input-group">
{{ Form::text('end_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-to']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
<div class="col-sm-1">
{{ Form::submit(__('hmis_reports.search'),['name' => 'filterBtn','class' => 'btn btn-success']) }}
{{ Form::close() }}
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('hmis_reports.drug_name') }}</th>
<th>{{ __('hmis_reports.consumption') }}</th>
<th>{{ __('hmis_reports.cost_value') }}</th>
<th>{{ __('hmis_reports.sell_value') }}</th>
<th>{{ __('hmis_reports.profit') }}</th>
<th>{{ __('hmis_reports.profit_margin') }}</th>
</tr>
</thead>
<tbody>
@php
$total_cost_value = 0;
$total_sell_value = 0;
$total_profit = 0;
@endphp
@for($i = 0; $i < count($drugs_array); $i++)
@php
$clean_qty = (isset($dispensed_array[$i]) && is_numeric($dispensed_array[$i])) ? $dispensed_array[$i] : 0;
$cost_value = get_name($drugs_array[$i], 'id', 'cost_price', 'drugs') *$clean_qty;
$sell_value = get_name($drugs_array[$i], 'id', 'non_insured_price', 'drugs') *$clean_qty;
$profit = $sell_value - $cost_value;
$profit_margin = ($sell_value == 0) ? 0 : floor(($profit / $sell_value) * 100);
$total_cost_value += $cost_value;
$total_sell_value += $sell_value;
$total_profit += $profit;
@endphp
<tr>
<td>{{ get_name($drugs_array[$i], 'id', 'name', 'drugs') }}</td>
<td>{{$clean_qty }}</td>
<td>{{ ugandan_shillings($cost_value) }}</td>
<td>{{ ugandan_shillings($sell_value) }}</td>
<td>{{ ugandan_shillings($profit) }}</td>
<td>{{ $profit_margin }} %</td>
</tr>
@endfor
</tbody>
</table>
</div>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<tr>
<th><b>{{ __('hmis_reports.total_cost_value') }}</b></th>
<td>{{ ugandan_shillings($total_cost_value) }}</td>
</tr>
<tr>
<th><b>{{ __('hmis_reports.total_sell_value') }}</b></th>
<td>{{ ugandan_shillings($total_sell_value) }}</td>
</tr>
<tr>
<th><b>{{ __('hmis_reports.total_profit_value') }}</b></th>
<td>{{ ugandan_shillings($total_profit) }}</td>
</tr>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
</script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
jQuery('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
</script>
@endpush
@@ -0,0 +1,120 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<style>
th, td { white-space: nowrap; }
</style>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('hmis_reports.drug_stock_levels_report') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
<li class="active">{{ __('hmis_reports.drug_stock_levels_report') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="white-box">
<h4 class="text-center">{{ __('hmis_reports.drug_stock_levels_report') }}</h4>
<br>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('hmis_reports.drug_name') }}</th>
<th>{{ __('hmis_reports.pharmacy_stock') }}</th>
<th>{{ __('hmis_reports.store_stock') }}</th>
<th>{{ __('hmis_reports.total_stock') }}</th>
<th>{{ __('hmis_reports.cost_value') }}</th>
<th>{{ __('hmis_reports.stock_value') }}</th>
</tr>
</thead>
<tbody>
@php
$total_buying_price = 0;
$total_stock_value = 0;
@endphp
@foreach($drugs as $drug)
@php
$stock_value = ($drug->store_stock + $drug->pharmacy_stock) * $drug->cost_price;
$total_buying_price += $drug->cost_price;
$total_stock_value += $stock_value;
@endphp
<tr>
<td style="color: {{ ($drug->insurance_coverage == 1) ? 'green' : 'orange' }}">
{{ $drug->name }}
</td>
<td>
{{ $drug->pharmacy_stock }}
</td>
<td>
{{ $drug->store_stock }}
</td>
<td>
{{ $drug->pharmacy_stock + $drug->store_stock }}
</td>
<td>
{{ ugandan_shillings($drug->cost_price) }}
</td>
<td>
{{ ugandan_shillings($stock_value) }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<table class="table table-striped table-bordered">
<tr>
<th><b>{{ __('hmis_reports.total_buying_price') }}</b></th>
<td>{{ ugandan_shillings($total_buying_price) }}</td>
</tr>
<tr>
<th><b>{{ __('hmis_reports.total_stock_value') }}</b></th>
<td>{{ ugandan_shillings($total_stock_value) }}</td>
</tr>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
],
"aoColumnDefs": [{
"aTargets": [2,3],
"defaultContent": "",
}]
});
</script>
@endpush
@@ -0,0 +1,297 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('hmis_reports.essential_medicines_report') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
<li class="active">{{ __('hmis_reports.essential_medicines_report') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div style="float: right;">
<button class="btn btn-primary" id="printEssentialMedicinesReport">{{ __('hmis_reports.print') }}</button><br>
</div>
</div>
</div><br>
<div class="white-box">
@include('flash::message')
<h3 class="heading" style="text-align: center; text-decoration: underline;">{{ __('hmis_reports.hmis_105') }}</h3>
<div class="row">
<div class="col-sm-3">
<table class="table">
<tr>
<th>{{ __('hmis_reports.health_unit') }}:</th>
<td>{{ $hospital_information->name }}</td>
</tr>
<tr>
<th>{{ __('hmis_reports.subcounty') }}:</th>
<td>{{ get_name($hospital_information->sub_country,'id','name','subcounties') }}</td>
</tr>
<tr>
<th>{{ __('hmis_reports.parish') }}:</th>
<td>{{ get_name($hospital_information->parish,'id','name','parishes') }}</td>
</tr>
<tr>
<th>{{ __('hmis_reports.district') }}:</th>
<td>{{ get_name($hospital_information->district, 'id','name','districts') }}</td>
</tr>
</table>
</div>
<div class="col-sm-3">
<table class="table">
<tr>
<th>{{ __('hmis_reports.code') }}:</th>
<td>{{ $hospital_information->code }}</td>
</tr>
<tr>
<th>{{ __('hmis_reports.level') }}:</th>
<td>{{ $hospital_information->level }}</td>
</tr>
<tr>
<th>{{ __('hmis_reports.health_sub_district') }}:</th>
<td>{{ $hospital_information->sub_district }}</td>
</tr>
</table>
</div>
<div class="col-sm-3">
<table class="table">
<tr>
<th><b>{{ __('hmis_reports.reporting_period') }}:</b></th>
</tr>
<tr>
<td>{{ __('hmis_reports.from') }}: {{ streamline_date($from_date) }}</td>
</tr>
<tr>
<td>T{{ __('hmis_reports.to') }}: {{ streamline_date($to_date) }}</td>
</tr>
<tr>
<td>{{ __('hmis_reports.date_of_report') }}: {{ streamline_date(date('Y-m-d')) }}</td>
</tr>
</table>
</div>
<div class="col-sm-3">
<table class="table">
{{ Form::open(['url' => 'essential_medicines_report','data-toggle'=>'validator']) }}
<tr>
<span class="badge badge-info">{{ __('hmis_reports.search_to_view_results') }}</span>
<td>{{ __('hmis_reports.from') }}:</td>
</tr>
<tr>
<td>
{{ Form::text('date_from','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-from']) }}
</td>
</tr>
<tr>
<td>{{ __('hmis_reports.to') }}:</td>
</tr>
<tr>
<td>
{{ Form::text('date_to','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-to']) }}
</td>
</tr>
<tr>
<td>
{{ Form::submit(__('hmis_reports.search'),['class' => 'btn btn-success btn-sm','name' => 'date_filter']) }}
</td>
</tr>
{{ Form::close() }}
</table>
</div>
</div>
<hr>
<div id="printableContent">
<div class="row">
<div class="col-md-12">
<table id="table1" class="table table-condensed table-bordered table-hover">
<thead>
<tr style="background-color: #e8e4e4">
<th colspan="6"><h5>6. {{ __('hmis_reports.essential_meds_supplies') }}</h5></th>
</tr>
<tr>
<th colspan="6"><h6>6.1 {{ __('hmis_reports.stock_status') }}</h6></th>
</tr>
<tr>
<th colspan="6">{{ __('hmis_reports.primary_data_sources') }}</th>
</tr>
</thead>
</table>
<table id="table2" class="table table-condensed table-bordered table-hover">
<thead>
<tr style="background-color: #e8e4e4">
<th style="width: 5%;">SN.</th>
<th style="width: 33%;">{{ __('hmis_reports.name_of_drug_items') }}:</th>
<th style="width: 17%;">{{ __('hmis_reports.unit') }}</th>
<th style="width: 15%;">{{ __('hmis_reports.quantity_consumed_units') }}</th>
<th style="width: 15%;">{{ __('hmis_reports.days_outta_stock') }}</th>
<th style="width: 15%;">{{ __('hmis_reports.stock_on_hand') }}</th>
</tr>
</thead>
</table>
<table id="table3" class="table table-condensed table-bordered table-hover">
<tr hidden><th colspan="6"></th></tr>
<tr><th colspan="6">{{ __('hmis_reports.hssip_indicator_items') }}:</th></tr>
</table>
</div>
</div>
<div class="row">
<div class="col-md-12">
<table id="table4" class="table table-condensed table-bordered table-hover">
<tr><th colspan="6"></th></tr>
@if(count($hssip_indicator_results) > 0)
@foreach($hssip_indicator_results as $hssip_indicator)
<tr>
<td style="width: 5%;">{{ str_replace("S0", "S", $hssip_indicator->hssip) }}</td>
<td style="width: 33%;">{{ $hssip_indicator->name }}</td>
@php $form_name = get_name($hssip_indicator->form_id, "id", "name","unit_of_measure"); @endphp
<td style="width: 17%;">{{ ucwords($form_name) }}</td>
<td style="width: 15%;">{{ isset($drug_data_array[$hssip_indicator->id]) ? $drug_data_array[$hssip_indicator->id] : 0 }}</td>
<td style="width: 15%;">{{ days_out_of_stock($hssip_indicator->id, $from_date, $to_date) }}</td>
<td style="width: 15%;">{{ $hssip_indicator->store_stock + $hssip_indicator->pharmacy_stock }}</td>
</tr>
@endforeach
@endif
</table>
</div>
</div>
<div class="row">
<div class="col-md-12">
<table id="table5" class="table table-condensed table-bordered table-hover">
<tr><th colspan="6"></th></tr>
<tr>
<th colspan="6">{{ __('hmis_reports.other_programmatic_items') }}:</th>
</tr>
</table>
<table id="table6" class="table table-condensed table-bordered table-hover">
<tr hidden><th></th><th></th><th></th><th></th><th></th><th></th></tr>
@if(count($other_programmatic_results))
@foreach($other_programmatic_results as $programmatic_result)
<tr>
<td style="width: 5%;">{{ str_replace("S0", "S", $programmatic_result->hssip) }}</td>
<td style="width: 33%;">{{ $programmatic_result->name }}</td>
@php
$form_name = get_name($programmatic_result->form_id, "id", "name","unit_of_measure");
@endphp
<td style="width: 17%;">{{ ucwords($form_name) }}</td>
<td style="width: 15%;">{{ isset($drug_data_array[$programmatic_result->id]) ? $drug_data_array[$programmatic_result->id] : 0 }}</td>
<td style="width: 15%;">{{ days_out_of_stock($programmatic_result->id, $from_date, $to_date) }}</td>
<td style="width: 15%;">{{ $programmatic_result->store_stock + $programmatic_result->pharmacy_stock }}</td>
</tr>
@endforeach
@endif
</table>
</div>
</div>
<div class="row">
<div class="col-md-12">
<table id="table7" class="table table-condensed table-bordered table-hover">
<tr hidden><th></th><th></th><th></th><th></th><th></th><th></th></tr>
<tr>
<th colspan="6">{{ __('hmis_reports.drugs_suffered_stock_out') }}:</th>
</tr>
</table>
<table id="table8" class="table table-condensed table-bordered table-hover">
<tr style="background-color: #e8e4e4">
<th style="width: 5%;">{{ __('hmis_reports.number') }}.</th>
<th style="width: 33%;">{{ __('hmis_reports.name_of_drug_items') }}:</th>
<th style="width: 12%;">{{ __('hmis_reports.days_outta_stock') }}</th>
<th style="width: 5%;">{{ __('hmis_reports.number') }}.</th>
<th style="width: 33%;">{{ __('hmis_reports.name_of_drug_items') }}:</th>
<th style="width: 12%;">{{ __('hmis_reports.days_outta_stock') }}</th>
</tr>
@for ($i = 0, $j = $half_count; $i < $half_count, $j < $drug_count; $i++, $j++)
<tr>
<td style="width: 5%;">{{ $i + 1 }}.</td>
<td style="width: 33%;">{{ $drug_row_array[$i]["item_name"] }}</td>
<td style="width: 12%;">{{ days_out_of_stock($drug_row_array[$i]["item_id"], $from_date, $to_date) }}</td>
<td style="width: 5%;">{{ $j + 1 }}.</td>
<td style="width: 33%;">{{ $drug_row_array[$j]["item_name"] }}</td>
<td style="width: 12%;">{{ days_out_of_stock($drug_row_array[$j]["item_id"], $from_date, $to_date) }}</td>
</tr>
@endfor
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<!-- Typehead Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
<!-- Data table javascript -->
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
jQuery('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy',
});
function printElementContent(elem,title){
var mywindow = window.open('', 'PRINT', 'height=400,width=600');
var css = '<link href="elite/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">';
mywindow.document.write('<html><head><title></title>');
mywindow.document.write('</head><body >');
mywindow.document.write(css);
mywindow.document.write('<center><h3>' + title + '</h3></center>');
mywindow.document.write(document.getElementById(elem).innerHTML);
mywindow.document.write('</body></html>');
mywindow.document.close(); // necessary for IE >= 10
//mywindow.focus(); // necessary for IE >= 10*/
setTimeout(function () {
mywindow.focus();
mywindow.print();
mywindow.remove();
}, 500);
return true;
}
$("#printEssentialMedicinesReport").click(function(e){
printElementContent('printableContent','Essential Medicines Report');
});
</script>
@endpush
@@ -0,0 +1,120 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<style>
th, td { white-space: nowrap; }
</style>
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('hmis_reports.expired_drugs_report') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
<li class="active">{{ __('hmis_reports.expired_drugs_report') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="white-box">
<h4 class="text-center">{{ __('hmis_reports.expired_drugs_report') }}</h4>
<br>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('hmis_reports.drug_name') }}</th>
<th>{{ __('hmis_reports.pharmacy_stock') }}</th>
<th>{{ __('hmis_reports.store_stock') }}</th>
<th>{{ __('hmis_reports.total_stock') }}</th>
<th>{{ __('hmis_reports.cost_value') }}</th>
<th>{{ __('hmis_reports.stock_value') }}</th>
</tr>
</thead>
<tbody>
@php
$total_buying_price = 0;
$total_stock_value = 0;
@endphp
@foreach($drugs as $drug)
@php
$stock_value = ($drug->store_stock + $drug->pharmacy_stock) * $drug->cost_price;
$total_buying_price += $drug->cost_price;
$total_stock_value += $stock_value;
@endphp
<tr>
<td style="color: {{ ($drug->insurance_coverage == 1) ? 'green' : 'orange' }}">
{{ $drug->name }}
</td>
<td>
{{ $drug->pharmacy_stock }}
</td>
<td>
{{ $drug->store_stock }}
</td>
<td>
{{ ugandan_shillings($drug->cost_price) }}
</td>
<td>
{{ ugandan_shillings($stock_value) }}
</td>
<td>
{{ streamline_date_time($drug->expiry_date) }}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<table class="table table-striped table-bordered">
<tr>
<th><b>{{ __('hmis_reports.total_buying_price') }}</b></th>
<td>{{ ugandan_shillings($total_buying_price) }}</td>
</tr>
<tr>
<th><b>{{ __('hmis_reports.total_stock_value') }}</b></th>
<td>{{ ugandan_shillings($total_stock_value) }}</td>
</tr>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
],
"aoColumnDefs": [{
"aTargets": [2,3],
"defaultContent": "",
}]
});
</script>
@endpush
@@ -0,0 +1,157 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h5 class="page-title">{{ __('hmis_reports.family_planning_report') }}</h5>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
<li class="active">{{ __('hmis_reports.family_planning_report') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
<h3 class="heading" style="text-align: center; text-decoration: underline;">{{ __('hmis_reports.family_planning_report') }}</h3>
<div class="row">
<div class="col-sm-4">
{{ __('hmis_reports.showing_results_from') }} <span class="label label-info">{{ streamline_date($attendance_from) }}</span> {{ __('hmis_reports.to') }} <span class="label label-info">{{ streamline_date($attendance_to) }}</span>
</div>
<div class="col-sm-1">
{{ Form::open(['url' => 'family_planning_report','data-toggle'=>'validator']) }}
{{ Form::label('date_from',__('hmis_reports.from')) }}
</div>
<div class="col-sm-2">
<div class="input-group">
{{ Form::text('date_from','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-from']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
<div class="col-sm-1">
{{ Form::label('date_to',__('hmis_reports.to')) }}
</div>
<div class="col-sm-2">
<div class="input-group">
{{ Form::text('date_to','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-to']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
<div class="col-sm-2">
{{ Form::submit(__('hmis_reports.search'),['name' => 'filterBtn','class' => 'btn btn-success']) }}
{{ Form::close() }}
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-12">
<table class="table table-condensed table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th>&nbsp;</th>
<th>{{ __('hmis_reports.counseling') }}</th>
<th>{{ __('hmis_reports.fp_clinic') }}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ __('hmis_reports.male') }}</td>
<td>
<form action="{{ url('family_planning_report_details') }}" method="POST">
@csrf()
<input hidden name="sex" value="Males"/>
<input type="hidden" name="from" value="{{ $attendance_from}}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<textarea name="patient_ids" style="display: none;"><?php
$counseling_male = array_unique($counseling_male);
echo serialize($counseling_male);
?>
</textarea>
<button class="btn btn-link"><?php echo count($counseling_male); ?></button>
</form>
</td>
<td>
<form action="{{ url('family_planning_report_details') }}" method="POST">
@csrf()
<input hidden name="sex" value="Males"/>
<input type="hidden" name="from" value="{{ $attendance_from}}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<textarea name="patient_ids" style="display: none;"><?php
$fp_clinic_male = array_unique($fp_clinic_male);
echo serialize($fp_clinic_male);
?></textarea>
<button class="btn btn-link"><?php echo count($fp_clinic_male); ?></button>
</form>
</td>
</tr>
<tr>
<td>{{ __('hmis_reports.female') }}</td>
<td>
<form action="{{ url('family_planning_report_details') }}" method="POST">
@csrf()
<input hidden name="sex" value="Females"/>
<input type="hidden" name="from" value="{{ $attendance_from}}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<textarea name="patient_ids" style="display: none;"><?php
$counseling_female = array_unique($counseling_female);
echo serialize($counseling_female);
?></textarea>
<button class="btn btn-link"><?php echo count($counseling_female); ?></button>
</form>
</td>
<td>
<form action="{{ url('family_planning_report_details') }}" method="POST">
@csrf()
<input hidden name="sex" value="Females"/>
<input type="hidden" name="from" value="{{ $attendance_from}}">
<input type="hidden" name="to" value="{{ $attendance_to }}">
<textarea name="patient_ids" style="display: none;"><?php
$fp_clinic_female = array_unique($fp_clinic_female);
echo serialize($fp_clinic_female);
?></textarea>
<button class="btn btn-link"><?php echo count($fp_clinic_female); ?></button>
</form>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<!-- Typehead Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
<!-- Data table javascript -->
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
jQuery('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy',
});
</script>
@endpush
@@ -0,0 +1,92 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h5 class="page-title">{{ __('hmis_reports.family_planning_report_details') }}</h5>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('family_planning_report') }}">{{ __('hmis_reports.family_planning_report') }}</a></li>
<li class="active">{{ __('hmis_reports.family_planning_report_details') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
<h4 class="heading" style="color: #0088CC; text-align: center; text-decoration: underline;"> {{ __('hmis_reports.showing_results_from') }} ({{ $gender }}) <i>{{ __('hmis_reports.from') }}</i> {{ streamline_date($from) }} <i>{{ __('hmis_reports.to') }}</i> {{ streamline_date($to) }}</h4>
<div class="row">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th></th>
<th>{{ __('hmis_reports.patient_number') }}</th>
<th>{{ __('hmis_reports.full_names') }}</th>
<th>{{ __('hmis_reports.gender') }}</th>
<th>{{ __('hmis_reports.age') }}</th>
<th>{{ __('hmis_reports.phone') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@php $counter = 1; @endphp
@if(count($patients_results) > 0)
@foreach($patients_results as $patient)
@php $dob = new Carbon\Carbon($patient->date_of_birth); @endphp
<tr>
<td>{{ $counter }}.</td>
<td>{{ $patient->number }}</td>
<td>{!! insurance_flag($patient->id) !!}</td>
<td>{{ $patient->gender == 1 ? __('hmis_reports.male') : __('hmis_reports.female') }}</td>
<td>{{ $dob->diffInYears(Carbon\Carbon::now()) }} {{ __('hmis_reports.years') }}</td>
<td>{{ $patient->phone }}</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $patient->id }}" class="btn btn-success btn-xs">{{ __('hmis_reports.select') }}</a>
</td>
</tr>
@php $counter++; @endphp
@endforeach
@else
<tr class="warning"><td class="center" colspan="10">{{ __('hmis_reports.no_records_found') }}</td></tr>
@endif
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<!-- Typehead Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
<!-- Data table javascript -->
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
jQuery('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy',
});
</script>
@endpush
@@ -0,0 +1,100 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@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">{{ __('hmis_reports.investigations_report') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="/reports">{{ __('hmis_reports.streamline_reports') }}</a></li>
<li class="active">{{ __('hmis_reports.investigations_report') }}</li>
</ol>
</div>
</div>
<div class="white-box">
<p>{{ __('hmis_reports.search_criteria') }} : <code>{{ $criteria }}</code> &nbsp;&nbsp;&nbsp;<a href="/reports">{{ __('hmis_reports.clear_search') }}</a></p>
<table class="table color-bordered-table success-bordered-table table-bordered table-striped">
<thead>
<tr>
<th>{{ __('hmis_reports.investigation_super_category') }}</th>
<th>{{ __('hmis_reports.investigation_category') }}</th>
<th>{{ __('hmis_reports.investigation_name') }}</th>
<th>{{ __('hmis_reports.number_test_performed') }}</th>
</tr>
</thead>
<tbody>
@php $total = 0; @endphp
@foreach($investigation_super_categories as $super_id => $super_content)
<tr>
<td rowspan="{{ count($super_content['sub_categories']) + $super_content['inv_count'] + 1 }}"><b>{{ $super_categories_names[$super_id] }} ({{ $super_content['count'] }})</b></td>
{{-- <td colspan="3"></td> --}}
</tr>
@foreach($super_content['sub_categories'] as $category_id => $category_content)
<tr>
<td rowspan="{{ count($investigations[$category_id]) + 1 }}"><b>{{ $categories_names[$category_id] }} ({{ $category_content['count'] }})</b></td>
{{-- <td colspan="2"></td> --}}
</tr>
@foreach($investigations[$category_id] as $investigation_id => $count)
<tr>
<td>{{ $investigation_names[$investigation_id] }}</td>
<td><a href="/streamline_reports/investigations_drill_down/{{ $investigation_id }}">{{ $count }}</a></td>
</tr>
@endforeach
@endforeach
@endforeach
{{--@foreach($investigations as $investigation_id => $investigation_count)
@php $total += $investigation_count; @endphp
<tr>
<td>{{ get_name($investigation_id, 'id', 'name', 'investigations') }}</td>
<td>
<a href="/streamline_reports/investigations_drill_down/{{ $investigation_id }}">{{ $investigation_count }}</a>
</td>
</tr>
@endforeach--}}
</tbody>
</table>
<tr>
<td><b>{{ __('hmis_reports.totals') }}</b></td>
<td>{{ $total }}</td>
<td></td>
<td></td>
</tr>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
],
"aoColumnDefs": [{
"aTargets": [2,3],
"defaultContent": "",
}]
});
</script>
@endpush
@@ -0,0 +1,180 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-6">
<h4 class="page-title">{{ __('hmis_reports.investigations_report_details') }} ({{ get_name($investigation_id, 'id', 'name', 'investigations') }})</h4>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="/reports">{{ __('hmis_reports.streamline_reports') }}</a></li>
<li class="active">{{ __('hmis_reports.investigations_report_details') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@if(count($result_templates_array) > 0)
<h4>Results Template Breakdown</h4>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>Result</th>
<th>No. Of Tests</th>
</tr>
</thead>
<tbody>
@php $results_counter = 1; @endphp
@foreach($result_templates_array as $key => $record)
<tr>
<td>{{ $key }}</td>
<td><a href="javascript:void(0);" onclick="show_patients('{{ $results_counter }}')">{{ $record['counter'] }}</a></td>
</tr>
@php $results_counter++; @endphp
@endforeach
</tbody>
</table>
</div>
<hr>
@php $results_counter = 1; @endphp
@foreach($result_templates_array as $key => $patient_records)
<div class="table-responsive results_table_div" id="table_{{ $results_counter }}" style="display: none">
<table class="table color-bordered-table success-bordered-table results_table">
<thead>
<tr>
<th>{{ __('hmis_reports.full_names') }}</th>
<th>{{ __('hmis_reports.gender') }} / {{ __('hmis_reports.age') }}</th>
<th>{{ __('hmis_reports.investigation_performed_at') }}</th>
<th>{{ __('hmis_reports.results') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@if(isset($patient_records['patients']) && count($patient_records['patients']) > 0)
@foreach($patient_records['patients'] as $record)
@php $patient = \Streamline\Models\Patient::withTrashed()->find($record['patient_id']); @endphp
<tr>
<td>
{!! insurance_flag($record['patient_id']) !!} ({{ $record['patient_number'] }})
</td>
<td>
{{ $patient->gender == 1 ? __('hmis_reports.male') : __('hmis_reports.female') }} / {{ get_patients_age($patient->date_of_birth) }}
</td>
<td>
{{ streamline_date_time($record['created_at']) }}
</td>
<td>{{ $record['value'] }}</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $record['patient_id'] }}" class="btn btn-success">{{ __('hmis_reports.select') }}</a>
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
@php $results_counter++; @endphp
@endforeach
@else
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('hmis_reports.full_names') }}</th>
<th>{{ __('hmis_reports.gender') }} / {{ __('hmis_reports.age') }}</th>
<th>{{ __('hmis_reports.investigation_performed_at') }}</th>
<th>{{ __('hmis_reports.results') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($patient_records as $record)
@php $patient = \Streamline\Models\Patient::withTrashed()->find($record['patient_id']); @endphp
<tr>
<td>
{!! insurance_flag($record['patient_id']) !!} ({{ $record['patient_number'] }})
</td>
<td>
{{ $patient->gender == 1 ? __('hmis_reports.male') : __('hmis_reports.female') }} / {{ get_patients_age($patient->date_of_birth) }}
</td>
<td>
{{ streamline_date_time($record['created_at']) }}
</td>
<td>{{ $record['value'] }}</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $record['patient_id'] }}" class="btn btn-success">{{ __('hmis_reports.select') }}</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.results_table').DataTable({
dom: 'Bfrtip',
pageLength: 100,
buttons: [
{
extend: 'copy',
exportOptions: {
columns: [ 0, 1, 2]
}
},
{
extend: 'csv',
exportOptions: {
columns: [ 0, 1, 2]
}
},
{
extend: 'pdf',
exportOptions: {
columns: [ 0, 1, 2]
}
},
{
extend: 'print',
exportOptions: {
columns: [ 0, 1, 2]
}
}
],
"aoColumnDefs": [{
"aTargets": [0, 1, 2],
"defaultContent": "",
}]
});
function show_patients(id) {
$('.results_table_div').hide();
$('#table_' + id).show();
}
</script>
@endpush
@@ -0,0 +1,123 @@
@extends('layouts.main')
@section('content')
<div class = "row bg-title">
<div class = "col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h5 class = "page-title">{{ __('hmis_reports.hmis_reports') }}</h5>
</div>
<div class = "col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class = "breadcrumb">
<li><a href = "{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href = "{{ url('streamline_reports') }}"> {{ __('hmis_reports.streamline_reports') }}</a></li>
<li class = "active">{{ __('hmis_reports.hmis_reports') }}</li>
</ol>
</div>
</div>
@include('flash::message')
<div class = "white-box">
<div class = "row">
<div class = "col-lg-6 col-sm-6 col-xs-12 m-t-0">
<ul class = "list-icons">
<li><i class = "fa fa-chevron-right text-success"></i>
@if(Auth::user()->can('view-tb-screening-report'))
<a href = "{{ url('hmis/105') }}"> {{ __('hmis_reports.hmis_105') }}</a>
<ul class = "list-icons m-l-20">
<li><i class = "fa fa-caret-right text-danger"></i>
<a href = "{{ url('/hmis/105/risky-behaviours') }}">
{{ __('hmis_reports.risky_behaviors') }}
</a>
</li>
<li><i class = "fa fa-caret-right text-danger"></i>
<a href = "{{ url('bmi_report') }}">
{{ __('hmis_reports.bmi') }}
</a>
</li>
<li><i class = "fa fa-caret-right text-danger"></i>
<a href = "{{ url('hmis/105/monthly-outpatient-diagnoses') }}">{{ __('hmis_reports.monthly_outpatient_diagnoses') }}</a>
</li>
</ul>
@endif
</li>
@if(Auth::user()->can('view-hmis-form-031-outpatient-register'))
<li><i class = "fa fa-chevron-right text-success"></i>
<a href = "{{ url('out_patient_register_report') }}">
{{ __('hmis_reports.hmis_031') }}
</a>
</li>
@endif
@if(Auth::user()->can('view-hmis-form-002-opd-outpatient-register'))
<li><i class = "fa fa-chevron-right text-success"></i>
<a href = "{{ url('hmis/002/page-1') }}">
{{ __('hmis_reports.hmis_002') }} <span class = "label label-rouded label-primary">{{ __('hmis_reports.new') }}</span>
</a>
</li>
@endif
@if(Auth::user()->can('view-hmis-form-106a-health-unit-quarterly-report'))
<li><i class = "fa fa-chevron-right text-success"></i>
<a href = "{{ url('health_unit_quarterly_report') }}">
{{ __('hmis_reports.hmis_106a') }}
</a>
</li>
@endif
@if(Auth::user()->can('view-hmis-form-weekly-epidimeological-surveillance'))
<li><i class = "fa fa-chevron-right text-success"></i>
<a href = "{{ url('weekly_epidemiological_surveillance_form') }}">
{{ __('hmis_reports.hmis_weekly') }}
</a>
</li>
@endif
@if(Auth::user()->can('view-hmis-form-essential-medicines-and-health-supplies'))
<li><i class = "fa fa-chevron-right text-success"></i>
<a href = "{{ url('essential_medicines_report') }}">
{{ __('hmis_reports.hmis_essential') }}
</a>
</li>
@endif
@if(Auth::user()->can('view-hmis-form-033b'))
<li><i class = "fa fa-chevron-right text-success"></i>
<a href = "{{ url('hmis/033b/weekly_cases_and_deaths') }}">
{{ __('hmis_reports.hmis_033b_title') }}
</a>
</li>
@endif
</ul>
</div>
<div class = "col-lg-6 col-sm-6 col-xs-12 m-t-0">
<ul class = "list-icons">
<li><i class = "fa fa-chevron-right text-success"></i>
@if(Auth::user()->can('view-form-108-inpatient-monthly-report'))
<a href = "{{ url('/hmis/108') }}">{{ __('hmis_reports.hmis_108') }}</a>
<ul class = "list-icons m-l-20">
<li><i class = "fa fa-caret-right text-danger"></i>
<a href = "{{ url('hmis/108/surgical-procedures') }}">{{ __('hmis_reports.surgical_procedures') }}</a>
</li>
<li><i class = "fa fa-caret-right text-danger"></i>
<a href = "{{ url('hmis/108/special-services') }}">{{ __('hmis_reports.special_services') }}</a>
</li>
<li><i class = "fa fa-caret-right text-danger"></i>
<a href = "{{ url('hmis/108/radiology-and-imaging') }}">{{ __('hmis_reports.radiology') }}</a>
</li>
<li><i class = "fa fa-caret-right text-danger"></i>
<a href = "{{ url('hmis/108/admissions-and-deaths') }}">{{ __('hmis_reports.admissions_deaths') }}</a>
</li>
<li><i class = "fa fa-caret-right text-danger"></i>
<a href = "{{ url('hmis/108/mental-health') }}">{{ __('hmis_reports.mental_health') }}</a>
</li>
<li><i class = "fa fa-caret-right text-danger"></i>
<a href = "{{ url('hmis/108/other-sections') }}">{{ __('hmis_reports.other_sections') }}</a>
</li>
</ul>
@endif
</li>
</ul>
</div>
</div>
</div>
@endsection
@@ -0,0 +1,279 @@
@extends('layouts.main')
@section('content')
<div class = "row bg-title">
<div class = "col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h5 class = "page-title">{{ __('hmis_reports.memorised_streamline_reports') }}</h5>
</div>
<div class = "col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class = "breadcrumb">
<li><a href = "{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href = "{{ url('streamline_reports') }}"> {{ __('hmis_reports.streamline_reports') }}</a></li>
<li class = "active">{{ __('hmis_reports.memorised_streamline_reports') }}</li>
</ol>
</div>
</div>
<div class = "white-box">
<ul class = "feeds">
@if(Auth::user()->can('view-disease-prevalence-over-a-period-of-time-report'))
<a href = "{{ url('disease_prevalence_charts') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.disease_prevalence_time') }}
<i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-tb-screening-report'))
<a href = "{{ url('tb_screening_report') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.tb_screening_report') }} <i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-family-planning-report'))
<a href = "{{ url('family_planning_report') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.family_planning_report') }} <i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-streamline-outpatient-report'))
<a href = "{{ url('streamline_outpatient_report') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.streamline_outpatient_report') }}
<i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-procedures-report'))
<a href = "{{ url('procedures_report') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.procedures_report') }}
<i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-performed-services-report'))
<a href = "{{ url('performed_services_report') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.performed_services_report') }}
<i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-charge-book'))
<a href = "{{ route('reports.charge-book') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.charge_book') }} <i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-rdt-report'))
<a href = "{{ url('rdt_report') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.rdt_report') }} <i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-drug-stock-levels-report'))
<a href = "{{ url('drug_stock_level') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.drug_stock_levels_report') }} <i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-drug-consumption-report'))
<a href = "{{ url('drug_consumption_report') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.drug_consumption_report') }}
<i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-expired-drugs-report'))
<a href = "{{ url('expired_drugs_report') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.expired_drugs_report') }} <i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
{{-- @if(Auth::user()->can('view-drug-consumption-analysis-report'))
<a href = "{{ url('drug_consumption_analysis') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.drug_consumption_analysis') }}
<i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif --}}
@if(Auth::user()->can('view-anaesthesia-report'))
<a href = "{{ url('anaesthesia_report') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.anaesthesia_report') }} <i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-surgeries-report'))
<a href = "{{ url('surgery_report') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.surgeries_report') }} <i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-ward-deposits-report'))
<a href = "{{ url('ward_deposits_report') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.ward_deposits_report') }} <i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-ward-re-admittance-report'))
<a href = "{{ url('ward_re_admittance_report') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.ward_readmittance_report') }}
<i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-patients-lost-to-follow-up-report'))
<a href = "{{ url('/memorised_reports/patients_lost_to_follow_up') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.patients_lost_follow_up') }}
<i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-maternity-report'))
<a href = "{{ url('/memorised_reports/maternity_report') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.maternity_report') }}
<i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('days-when-drugs-were-out-of-stock-report'))
<a href = "{{ url('/memorised_reports/days_drugs_out_of_stock') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.days_drugs_outta_stock') }}
<i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-investigation-specimen-reports'))
<a href = "{{ url('/memorised_reports/view_investigation_specimen_report') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.view_investigation_specimen_report') }}
<i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-eye-clinic-report'))
<a href = "{{ url('/memorised_reports/view_eye_clinic_report') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
View Eye Clinic Report
<i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
</ul>
<br>
<h4>{{ __('hmis_reports.mental_health_reports') }}</h4>
<ul class = "feeds">
@if(Auth::user()->can('view-patients-diagnosed-with-severe-mental-disorders'))
<a href = "{{ url('/mental_health_reports/diagnosed_patients') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.severe_mental_patients') }}
<i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-persons-taking-psychotropic-drugs'))
<a href = "{{ url('/mental_health_reports/persons_taking_psychotropic_drugs') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.persons_taking_psych_drugs') }}
<i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-diagnosed-patients-who-received-treatment'))
<a href = "{{ url('/mental_health_reports/diagnosed_persons_who_received_treatment') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.diagnosed_patients_treated') }}
<i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-patients-receiving-mental-health-care-lost-to-follow-up'))
<a href = "{{ url('/mental_health_reports/patients_lost_to_follow_up') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.mental_health_patients_lost_follow') }}
<i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if(Auth::user()->can('view-number-of-days-psychotropic-drugs-were-out-of-stock'))
<a href = "{{ url('/mental_health_reports/days_drugs_out_of_stock') }}">
<li>
<div class = "bg-info"><i class = "fa fa-eye text-white"></i></div>
{{ __('hmis_reports.days_psych_drugs_outta_stock') }}
<i class = "fa fa-angle-right float-right" style = "padding-top: 12.5px;"></i>
</li>
</a>
@endif
</ul>
</div>
@endsection
@@ -0,0 +1,190 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('hmis_reports.maternity_report') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
@if(URL::previous() == url("list_memorised_reports"))
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
@endif
<li class="active">{{ __('hmis_reports.maternity_report') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
<h3 class="heading" style="text-align: center; text-decoration: underline;">{{ __('hmis_reports.maternity_report') }}</h3>
<br><br>
<div class="col-sm-3"></div>
<div class="row">
<div class="col-sm-2">
{{ Form::open(['url' => 'memorised_reports/maternity_report','data-toggle'=>'validator']) }}
<div class="form-group" id="searchby">
{{ Form::label('search_by', __('hmis_reports.date')) }}
{{ Form::select('search_by', ['0'=>__('hmis_reports.last_24_hours'),'1'=>__('hmis_reports.custom_date'),'2'=>__('hmis_reports.custom_range')], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-sm-2" style="display: none;" id="date_search">
<div class="form-group" id="reg_date" style="padding-top: 23px;">
<div class="input-group">
{{ Form::text('reg_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-autoclose']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-sm-2" style="display: none;" id="date_range_search">
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('start_date', __('hmis_reports.from')) }}
<div class="input-group">
{{ Form::text('start_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-1']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="reg_date">
{{ Form::label('end_date', __('hmis_reports.to')) }}
<div class="input-group">
{{ Form::text('end_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-2']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
</div>
</div>
&nbsp;
<div class="col-sm-3">
{{ Form::label('mode_of_delivery',__('hmis_reports.modes_of_delivery')) }}
{{ Form::select('mode_of_delivery',$modes_of_delivery,'',['class' => 'form-control', 'id' => 'mode_of_delivery']) }}
</div>
&nbsp;
<div class="col-sm-2"><br>
{{ Form::submit(__('hmis_reports.search'),['name' => 'filterBtn','class' => 'btn btn-success']) }}
{{ Form::close() }}
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('hmis_reports.modes_of_delivery') }}</th>
<th>{{ __('hmis_reports.number') }}</th>
</tr>
</thead>
<tbody>
@if (count($delivery_records_numbers_array))
@foreach($delivery_records_numbers_array as $mode_of_delivery => $numbers)
<tr>
<td>
{{ $modes_of_delivery[$mode_of_delivery] }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.maternity_report_details']) }}
{{ Form::hidden('mode_of_delivery', $mode_of_delivery) }}
{{ Form::hidden('search_by', $search_by) }}
{{ Form::hidden('reg_date', $reg_date) }}
{{ Form::hidden('start_date', $start_date) }}
{{ Form::hidden('end_date', $end_date) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ $numbers }}
</button>
{{ Form::close() }}
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/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>
$('#mode_of_delivery,#performed_by').select2({
placeholder: "-- All modes --"
});
$('#performed_by').select2({
placeholder: "-- All staff --"
});
$('#search_by').change(function () {
if ($(this).val() == 1) {
$('#date_search').show();
$('#date_range_search').hide();
}
else if ($(this).val() == 2) {
$('#date_range_search').show();
$('#date_search').hide();
}
else {
$('#date_search,#date_range_search').hide();
}
});
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy'
});
$('.table').DataTable({
dom: 'Bfrtip',
order: [[ 1, "desc" ]],
columnDefs : [{"targets":1, "type":"date-eu"}],
//columnDefs: [ { type: 'date', 'targets': [3] } ],
//order: [[ 3, 'desc' ]]
pageLength: 100,
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
</script>
<script type="text/javascript">
jQuery('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy'
});
</script>
@endpush
@@ -0,0 +1,160 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-6">
<h4 class="page-title">{{ __('hmis_reports.maternity_report_details') }}</h4>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
<li><a href="{{ url('maternity_report') }}">{{ __('hmis_reports.maternity_report') }}</a></li>
<li class="active">{{ __('hmis_reports.maternity_report_details') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
{{-- fetched data here --}}
<div class="row">
<div class="col">
<table class="table table-sm table-hover color-table success-table table-bordered">
<thead>
<tr>
<th>#</th>
<th><strong>Mother's Name</strong></th>
<th><strong>Mode of delivery</strong></th>
<th><strong>Baby gender</strong></th>
<th><strong>Baby birth date</strong></th>
<th><strong>Delivered by</strong></th>
<th></th>
</tr>
</thead>
<tbody>
@php $counter = 1; @endphp
@if (count($maternity_records))
@foreach ($maternity_records as $record)
@php
$foetal_number = $record->foetal_number;
$modes_of_delivery_array = explode(",", $record->mode_of_delivery);
$gender_array = explode(",", $record->gender);
$date_of_birth_array = explode(",", $record->date_of_birth);
$delivered_by_name_array = explode(",", $record->delivered_by_name);
$patient_id = $record->patient_id;
@endphp
@for ($i=0; $i < count($modes_of_delivery_array) ; $i++)
@if (!is_null($selected_modes_of_delivery))
@if (($i < $foetal_number) && ($selected_modes_of_delivery == $modes_of_delivery_array[$i]) && ($modes_of_delivery_array[$i] != ""))
<tr>
<td>
{{ $counter }}
</td>
<td>
<a href="patients/{{ $patient_id}}" target="_blank"> {{ get_full_name($patient_id, "id", "first_name", "last_name", "patients") }} ({{ get_name($patient_id, "id", "number", "patients")}}) </a>
</td>
<td>
{{ $modes_of_delivery[$modes_of_delivery_array[$i]] }}
</td>
<td>
{{ $gender_array[$i] == 1 ? "Female" : "Male"}}
</td>
<td>
{{ $date_of_birth_array[$i] }}
</td>
<td>
{{ get_full_name($delivered_by_name_array[$i], "id", "first_name", "last_name", "users") }}
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $patient_id }}" class="btn btn-rounded btn-primary btn-sm"><i class="fa fa-hand-pointer-o"></i> <strong>{{ __('patients.select') }}</strong></a>
</td>
</tr>
@php $counter++; @endphp
@endif
@endif
@endfor
@endforeach
@endif
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.colVis.min.js') }}"></script>
<script type="text/javascript">
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#search_by').change(function () {
if ($(this).val() == 1) {
$('#date_search').show();
$('#date_range_search').hide();
}
else if ($(this).val() == 2) {
$('#date_range_search').show();
$('#date_search').hide();
}
else {
$('#date_search,#date_range_search').hide();
}
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
orientation: 'bottom',
format: 'dd-mm-yyyy'
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
orientation: 'bottom',
format: 'dd-mm-yyyy'
});
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 50,
buttons: [
{ extend: 'excel',
message: 'TB Screening Report',
sheetName: 'TB Screening Report'
},
{ extend: 'pdf',
message: 'TB Screening Report',
sheetName: 'TB Screening Report'
},
{ extend: 'print',
message: 'TB Screening Report',
sheetName: 'TB Screening Report'
}
]
});
</script>
@endpush
@@ -0,0 +1,112 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-6">
<h4 class="page-title">{{ $title }}</h4>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="/reports">{{ __('hmis_reports.streamline_reports') }}</a></li>
<li class="active">Details</li>
</ol>
</div>
</div>
<div class="white-box">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('hmis_reports.patient_number') }}</th>
<th>{{ __('hmis_reports.full_names') }}</th>
<th>{{ __('hmis_reports.gender') }}</th>
<th>{{ __('hmis_reports.age') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($patients as $patient)
<tr>
<td>
{{ $patient->number }}
</td>
<td>
{!! insurance_flag($patient->id) !!}
</td>
<td>
{{ $patient->gender == 1 ? __('hmis_reports.male') : __('hmis_reports.female') }}
</td>
<td>
{{ get_patients_age($patient->date_of_birth) }}
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $patient->id }}" class="btn btn-success">{{ __('hmis_reports.select') }}</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 100,
buttons: [
{
extend: 'copy',
exportOptions: {
columns: [0, 1, 2, 3]
},
title: '<?php echo $title; ?>'
},
{
extend: 'csv',
exportOptions: {
columns: [0, 1, 2, 3]
},
title: '<?php echo $title; ?>'
},
{
extend: 'pdf',
exportOptions: {
columns: [0, 1, 2, 3]
},
title: '<?php echo $title; ?>'
},
{
extend: 'print',
exportOptions: {
columns: [0, 1, 2, 3]
},
title: '<?php echo $title; ?>'
}
],
"aoColumnDefs": [{
"aTargets": [2,3],
"defaultContent": "",
}]
});
</script>
@endpush
@@ -0,0 +1,314 @@
@extends('layouts.main')
@push('styles')
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">Stre@mline Reports</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">Dashboard</a></li>
<li class="active">Patient Visits Report</li>
</ol>
</div>
</div>
<div class="white-box">
<form action="/streamline_reports/print_patient_visits_report" method="POST" target="_blank">
{{ csrf_field() }}
{{ Form::hidden('criteria', $criteria) }} {{ Form::hidden('is_outpatient_queried', $is_outpatient_queried) }} {{ Form::hidden('age_group_data', serialize($age_group_data)) }}
{{ Form::hidden('returning_patients', $returning_patients) }} {{ Form::hidden('new_patients', $new_patients) }} {{ Form::hidden('total_male_patients', $total_male_patients) }}
{{ Form::hidden('total_re_attendance', $total_re_attendance) }} {{ Form::hidden('total_discharges', $total_discharges) }} {{ Form::hidden('total_admissions', $total_admissions) }}
{{ Form::hidden('end_date', $end_date) }} {{ Form::hidden('total_patients', $total_patients) }} {{ Form::hidden('total_female_patients', $total_female_patients) }}
{{ Form::hidden('patient_wards', serialize($patient_wards)) }} {{ Form::hidden('start_date', $start_date) }}
{{ Form::hidden('total_ward_deaths', $total_ward_deaths) }} {{ Form::hidden('total_opd_deaths', $total_opd_deaths) }} {{ Form::hidden('patient_clinics', serialize($patient_clinics)) }}
{{ Form::hidden('is_inpatient_queried', $is_inpatient_queried) }} {{ Form::hidden('number_of_episodes', $number_of_episodes) }} {{ Form::hidden('total_patients_in_clinics', $total_patients_in_clinics) }}
{{ Form::hidden('patient_categories', serialize($patient_categories)) }} {{ Form::hidden('all_discharges', $all_discharges) }} {{ Form::hidden('still_admitted', $still_admitted) }} {{ Form::hidden('number_of_days', $number_of_days) }}
<button type="submit" class="btn btn-inverse float-right">{{ __('reports.print_pdf') }}</button>
</form>
@include('flash::message')
<h2 class="text-center"><u>Patient Visits Report between {{ streamline_date($start_date) }} and {{ streamline_date($end_date) }}</u></h2>
<br><br>
<p>Search criteria : <code>{{ $criteria }}</code> &nbsp;&nbsp;&nbsp;<a href="{{ route('streamline_reports.index') }}">Clear search</a></p>
<hr>
<h3>Patient Visits summary Report</h3>
<div class="table-responsive">
<table class="table table-condensed table-bordered">
<tr>
<td><b>Total Number of patients</b></td>
<td><a style="color: #0088cc;" href="/streamline_reports/patient_visits_breakdown/Total Number of patients/{{ implode(",", $total_patients_arr) }}">{{ $total_patients }}</a></td>
<td><b>Average No. of patients per day</b></td>
<td>{{ ceil($total_patients / $number_of_days) }}</td>
</tr>
<tr>
<td width="20%"><b>Female</b></td>
<td>
<a style="color: #0088cc;" href="/streamline_reports/patient_visits_breakdown/Total Females/{{ implode(",", $total_female_patients_arr) }}">
{{ $total_female_patients }} ({{ round(($total_female_patients / $total_patients) * 100) }}%)
</a>
</td>
<td width="20%"><b>Male</b></td>
<td>
<a style="color: #0088cc;" href="/streamline_reports/patient_visits_breakdown/Total Males/{{ implode(",", $total_male_patients_arr) }}">
{{ $total_male_patients }} ({{ round(($total_male_patients / $total_patients) * 100) }}%)
</a>
</td>
</tr>
<tr>
<td><b>New patients</b></td>
<td>{{ $new_patients }} ({{ round(($new_patients / $total_patients) * 100) }}%)</td>
<td><b>Returning patients</b></td>
<td>{{ $returning_patients }} ({{ round(($returning_patients / $total_patients) * 100) }}%)</td>
</tr>
@if($is_outpatient_queried)
<tr>
<td><b>Number of episodes created</b></td>
<td>{{ $number_of_episodes }}</td>
<td><b>Number of deaths at OPD</b></td>
<td><a style="color: #0088cc;" href="/streamline_reports/patient_visits_breakdown/Number of deaths at OPD/{{ implode(",", $total_opd_deaths_arr) }}">{{ $total_opd_deaths }}</a></td>
</tr>
@endif
@if($is_inpatient_queried)
<tr>
<td><b>Number of admissions</b></td>
<td>{{ $total_admissions }} ({{ round(($total_admissions / $total_patients) * 100) }}%)</td>
<td><b>Number of deaths at wards</b></td>
<td>{{ $total_ward_deaths }}</td>
</tr>
<tr>
<td><b>Number of patients discharged</b><a href="#" data-toggle="tooltip" rel="tooltip" data-placement="top" title="(Those admitted in the selected time period and have been discharged)"> <i class="fa fa-info-circle"></i></a> </td>
<td>{{ $total_discharges }}</td>
<td><b>Number of patients still admitted</b><a href="#" data-toggle="tooltip" rel="tooltip" data-placement="top" title="(Those admitted in the selected time period and are still admitted up to-date)"> <i class="fa fa-info-circle"></i></a> </td>
<td>{{ $total_admissions - $total_discharges }}</td>
</tr>
<tr>
<td><b>General Number of patients discharged</b><a href="#" data-toggle="tooltip" rel="tooltip" data-placement="top" title="(All those that have been discharged between {{ streamline_date($start_date) }} and {{ streamline_date($end_date) }})"> <i class="fa fa-info-circle"></i></a> </td>
<td>{{ $all_discharges }}</td>
<td><b>General Number of patients still admitted</b><a href="#" data-toggle="tooltip" rel="tooltip" data-placement="top" title="(All those still admitted as of {{ streamline_date($end_date) }})"> <i class="fa fa-info-circle"></i></a> </td>
<td><a style="color: #0088cc;" href="/streamline_reports/patient_visits_breakdown/General Number of patients still admitted/{{ implode(",", $still_admitted_arr) }}">{{ $still_admitted }}</a></td>
</tr>
@endif
@if($is_outpatient_queried)
<tr>
<td><b>OPD New Attendance</b></td>
<td>{{ $total_patients - $total_re_attendance }}</td>
<td><b>OPD Re-attendance</b></td>
<td>{{ $total_re_attendance }}</td>
</tr>
@endif
<tr>
<td><b>Number of Triaged Episodes</b></td>
<td>{{ $triaged_patients }} ({{ round(($triaged_patients / $number_of_episodes) * 100) }}%)</td>
<td><b>Number of Procedures Ordered</b></td>
<td>
<table class="table">
<tr>
<td><b>OPD</b></td>
<td>{{ $opd_procedures }}</td>
</tr>
<tr>
<td><b>IPD</b></td>
<td>{{ $ipd_procedures }}</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
@if (!empty($age_group_data))
@php
$age_group_header_code = '';
$age_group_gender_header_code = '';
$age_group_attendance_code = '';
$age_group_total_attendance_code = '';
foreach ($age_group_data as $age_group){
$age_group_header_code .= "<th class='text-center' colspan='2'><b>" . $age_group['name'] . "</b></th>";
$age_group_gender_header_code .= "<th class='text-center'><b>M</b></th><th class='text-center'><b>F</b></th>";
if (!empty($age_group['male'])) {
$male_count = count($age_group['male']);
$age_group_attendance_code .= '<td><a style="color: #0088cc;" href="/streamline_reports/patient_visits_breakdown/Total Attendance - Male ' . $age_group['name'] . '/' . implode(",", $age_group['male']) . '" target="_blank">' . $male_count . '</a></td>';
} else {
$male_count = 0;
$age_group_attendance_code .= '<td>0</td>';
}
if (!empty($age_group['female'])) {
$female_count = count($age_group['female']);
$age_group_attendance_code .= '<td><a style="color: #0088cc;" href="/streamline_reports/patient_visits_breakdown/Total Attendance - Female ' . $age_group['name'] . '/' . implode(",", $age_group['female']) . '" target="_blank">' . $female_count . '</a></td>';
} else {
$female_count = 0;
$age_group_attendance_code .= '<td>0</td>';
}
$age_group_total_attendance_code .= '<td class="text-center" colspan="2">' . ($male_count + $female_count) . '</td>';
}
@endphp
<hr>
<h3>Patients per age group</h3>
<div class="table-responsive">
<table class="table table-condensed table-bordered text-center">
<thead>
<tr>
<th class="text-center"><b>Age Group</b></th>
{!! $age_group_header_code !!}
</tr>
<tr>
<th class="text-center"><b>Gender</b></th>
{!! $age_group_gender_header_code !!}
</tr>
</thead>
<tbody>
<tr>
<td><b>Attendance</b></td>
{!! $age_group_attendance_code !!}
</tr>
<tr>
<td><b>Total Attendance</b></td>
{!! $age_group_total_attendance_code !!}
</tr>
</tbody>
</table>
</div>
@endif
@if(count($patient_clinics) > 0 && $is_outpatient_queried)
<hr>
<h3>Visits per clinic</h3>
<div class="table-responsive">
<table class="table table-condensed table-bordered text-center">
<thead>
<tr>
<th><b>Clinic Name</b></th>
<th><b>Number of Patients</b></th>
<th><b>Male</b></th>
<th><b>Female</b></th>
<th><b>New</b></th>
<th><b>Returning</b></th>
<th><b>Number of Episodes created</b></th>
</tr>
</thead>
<tbody>
@foreach($patient_clinics as $patient_clinic)
<tr>
<td>{{ $patient_clinic["name"] }}</td>
<td>{{ $patient_clinic["total_patients"] }} ({{ round(($patient_clinic["total_patients"] / $total_patients_in_clinics) * 100) }}% of the total patients)</td>
<td>{{ $patient_clinic["male"] }}</td>
<td>{{ $patient_clinic["total_patients"] - $patient_clinic["male"] }}</td>
<td>{{ $patient_clinic["new"] }}</td>
<td>{{ $patient_clinic["total_patients"] - $patient_clinic["new"] }}</td>
<td>{{ $patient_clinic["total_episodes"] }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
@if(count($patient_categories) > 0 && $is_outpatient_queried)
<hr>
<h3>OPD Visits Per Patient Category</h3>
<div class="table-responsive">
<table class="table table-condensed table-bordered text-center">
<thead>
<tr>
<th><b>Patient Category Name</b></th>
<th><b>Number of Patients</b></th>
<th><b>Male</b></th>
<th><b>Female</b></th>
<th><b>New</b></th>
<th><b>Returning</b></th>
<th><b>Patients Admitted</b></th>
<th><b>Number of Episodes created</b></th>
</tr>
</thead>
<tbody>
@foreach($patient_categories as $patient_category)
<tr>
<td>{{ $patient_category["name"] }}</td>
<td>{{ $patient_category["total_patients"] }} ({{ round(($patient_category["total_patients"] / $total_patients) * 100) }}% of the total patients)</td>
<td>{{ $patient_category["male"] }}</td>
<td>{{ $patient_category["total_patients"] - $patient_category["male"] }}</td>
<td>{{ $patient_category["new"] }}</td>
<td>{{ $patient_category["total_patients"] - $patient_category["new"] }}</td>
<td>{{ $patient_category["admissions"] }} ({{ round(($patient_category["admissions"] / $patient_category["total_patients"]) * 100) }}% of the total patients in category)</td>
<td>{{ $patient_category["total_episodes"] }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
@if(count($patient_wards) > 0 && $is_inpatient_queried)
<hr>
<h3>Admissions per ward</h3>
<div class="table-responsive">
<table class="table table-condensed table-bordered text-center">
<thead>
<tr>
<th><b>Ward Name</b></th>
<th><b>Number of Patients</b></th>
<th><b>Male</b></th>
<th><b>Female</b></th>
<th><b>New Admissions</b></th>
<th><b>Re-Admissions</b></th>
<th><b>Discharged</b></th>
<th><b>Still Admitted</b></th>
<th><b>Still Admitted As Of {{ streamline_date($end_date) }}</b></th>
<th><b>Deaths</b></th>
<th><b>Number of episodes created</b></th>
</tr>
</thead>
<tbody>
@foreach($patient_wards as $patient_ward)
<tr>
<td>{{ $patient_ward["name"] }}</td>
<td>{{ $patient_ward["total_patients"] }} ({{ round(($patient_ward["total_patients"] / $total_admissions) * 100) }}% of the total admissions)</td>
<td><a style="color: #0088cc;" href="/streamline_reports/patient_visits_breakdown/{{ $patient_ward["name"] }} - Male/{{ implode(",", $patient_ward["male_arr"]) }}">{{ $patient_ward["male"] }}</a></td>
<td><a style="color: #0088cc;" href="/streamline_reports/patient_visits_breakdown/{{ $patient_ward["name"] }} - Female/{{ implode(",", $patient_ward["female_arr"]) }}">{{ $patient_ward["female"] }}</a></td>
<td>{{ $patient_ward["new"] }}</td>
<td>{{ $patient_ward["total_patients"] - $patient_ward["new"] }}</td>
<td><a style="color: #0088cc;" href="/streamline_reports/patient_visits_breakdown/{{ $patient_ward["name"] }} - Discharged/{{ implode(",", $patient_ward["discharged_arr"]) }}">{{ $patient_ward["discharged"] }}</a></td>
<td>{{ $patient_ward["total_patients"] - $patient_ward["discharged"] }}</td>
<td><a style="color: #0088cc;" href="/streamline_reports/patient_visits_breakdown/{{ $patient_ward["name"] }} - Still Admitted/{{ implode(",", $patient_ward["admitted_as_of_arr"]) }}">{{ $patient_ward["admitted_as_of"] }}</a></td>
<td><a style="color: #0088cc;" href="/streamline_reports/patient_visits_breakdown/{{ $patient_ward["name"] }} - Deaths/{{ implode(",", $patient_ward["deaths_arr"]) }}">{{ $patient_ward["deaths"] }}</a></td>
<td>{{ $patient_ward["total_episodes"] }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
@endif
</div>
@endsection
@push('scripts')
<script type="text/javascript"></script>
@endpush
@@ -0,0 +1,274 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
<title>{{ config('app.name', 'Inpatient Bill - Stre@mline') }}</title>
<!-- Bootstrap Core CSS -->
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<style>
body{
/*font-size: 1.2em;*/
}
/*thead, tfoot { display: table-row-group }*/
thead {
display: table-header-group;
}
tfoot {
display: table-row-group;
}
tr {
page-break-before: always;
page-break-after: always;
page-break-inside: avoid;
}
</style>
</head>
<body>
<div class="container-fluid">
@include('layouts.header_pdf_print')
<h2 class="text-center"><u>Patient Visits Report between {{ streamline_date($start_date) }} and {{ streamline_date($end_date) }}</u></h2>
<hr>
<h3>Patient Visits summary Report</h3>
<table class="table table-condensed table-bordered">
<tr>
<td><b>Total Number of patients</b></td>
<td>{{ $total_patients }}</td>
<td><b>Average No. of patients per day</b></td>
<td>{{ ceil($total_patients / $number_of_days) }}</td>
</tr>
<tr>
<td width="20%"><b>Female</b></td>
<td>{{ $total_female_patients }} ({{ round(($total_female_patients / $total_patients) * 100) }}%)</td>
<td width="20%"><b>Male</b></td>
<td>{{ $total_male_patients }} ({{ round(($total_male_patients / $total_patients) * 100) }}%)</td>
</tr>
<tr>
<td><b>New patients</b></td>
<td>{{ $new_patients }} ({{ round(($new_patients / $total_patients) * 100) }}%)</td>
<td><b>Returning patients</b></td>
<td>{{ $returning_patients }} ({{ round(($returning_patients / $total_patients) * 100) }}%)</td>
</tr>
@if($is_outpatient_queried)
<tr>
<td><b>Number of episodes created</b></td>
<td>{{ $number_of_episodes }}</td>
<td><b>Number of deaths at OPD</b></td>
<td>{{ $total_opd_deaths }}</td>
</tr>
@endif
@if($is_inpatient_queried)
<tr>
<td><b>Number of admissions</b></td>
<td>{{ $total_admissions }} ({{ round(($total_admissions / $total_patients) * 100) }}%)</td>
<td><b>Number of deaths at wards</b></td>
<td>{{ $total_ward_deaths }}</td>
</tr>
<tr>
<td><b>Number of patients discharged</b> <i>(Those admitted in the selected time period and have been discharged)</i></td>
<td>{{ $total_discharges }}</td>
<td><b>Number of patients still admitted</b> <i>(Those admitted in the selected time period and are still admitted up to-date)</i></td>
<td>{{ $total_admissions - $total_discharges }}</td>
</tr>
<tr>
<td><b>General Number of patients discharged</b><a href="#" data-toggle="tooltip" rel="tooltip" data-placement="top" title="(All those that have been discharged)"> <i class="fa fa-info-circle"></i></a> </td>
<td>{{ $all_discharges }}</td>
<td><b>General Number of patients still admitted</b><a href="#" data-toggle="tooltip" rel="tooltip" data-placement="top" title="(All those still admitted up to-date)"> <i class="fa fa-info-circle"></i></a> </td>
<td>{{ $still_admitted }}</td>
</tr>
@endif
@if($is_outpatient_queried)
<tr>
<td><b>OPD New Attendance</b></td>
<td>{{ $total_patients - $total_re_attendance }}</td>
<td><b>OPD Re-attendance</b></td>
<td>{{ $total_re_attendance }}</td>
</tr>
@endif
</table>
<hr>
@if (!empty($age_group_data))
@php
$age_group_header_code = '';
$age_group_gender_header_code = '';
$age_group_attendance_code = '';
$age_group_total_attendance_code = '';
foreach ($age_group_data as $age_group){
$age_group_header_code .= "<th class='text-center' colspan='2'><b>" . $age_group['name'] . "</b></th>";
$age_group_gender_header_code .= "<th class='text-center'><b>M</b></th><th class='text-center'><b>F</b></th>";
if (!empty($age_group['male'])) {
$male_count = count($age_group['male']);
$age_group_attendance_code .= '<td>' . $male_count . '</td>';
} else {
$male_count = 0;
$age_group_attendance_code .= '<td>0</td>';
}
if (!empty($age_group['female'])) {
$female_count = count($age_group['female']);
$age_group_attendance_code .= '<td>' . $female_count . '</td>';
} else {
$female_count = 0;
$age_group_attendance_code .= '<td>0</td>';
}
$age_group_total_attendance_code .= '<td class="text-center" colspan="2">' . ($male_count + $female_count) . '</td>';
}
@endphp
<hr>
<h3>Patients per age group</h3>
<div class="table-responsive">
<table class="table table-condensed table-bordered text-center">
<thead>
<tr>
<th class="text-center"><b>Age Group</b></th>
{!! $age_group_header_code !!}
</tr>
<tr>
<th class="text-center"><b>Gender</b></th>
{!! $age_group_gender_header_code !!}
</tr>
</thead>
<tbody>
<tr>
<td><b>Attendance</b></td>
{!! $age_group_attendance_code !!}
</tr>
<tr>
<td><b>Total Attendance</b></td>
{!! $age_group_total_attendance_code !!}
</tr>
</tbody>
</table>
</div>
@endif
@if(count($patient_clinics) > 0 && $is_outpatient_queried)
<hr>
<h3>Visits per clinic</h3>
<table class="table table-condensed table-bordered text-center">
<thead>
<tr>
<th><b>Clinic Name</b></th>
<th><b>Number of Patients</b></th>
<th><b>Male</b></th>
<th><b>Female</b></th>
<th><b>New</b></th>
<th><b>Returning</b></th>
<th><b>Number of Episodes created</b></th>
</tr>
</thead>
<tbody>
@foreach($patient_clinics as $patient_clinic)
<tr>
<td>{{ $patient_clinic["name"] }}</td>
<td>{{ $patient_clinic["total_patients"] }} ({{ round(($patient_clinic["total_patients"] / $total_patients_in_clinics) * 100) }}% of the total patients)</td>
<td>{{ $patient_clinic["male"] }}</td>
<td>{{ $patient_clinic["total_patients"] - $patient_clinic["male"] }}</td>
<td>{{ $patient_clinic["new"] }}</td>
<td>{{ $patient_clinic["total_patients"] - $patient_clinic["new"] }}</td>
<td>{{ $patient_clinic["total_episodes"] }}</td>
</tr>
@endforeach
</tbody>
</table>
@endif
@if(count($patient_categories) > 0 && $is_outpatient_queried)
<hr>
<h3>OPD Visits Per Patient Category</h3>
<table class="table table-condensed table-bordered text-center">
<thead>
<tr>
<th><b>Patient Category Name</b></th>
<th><b>Number of Patients</b></th>
<th><b>Male</b></th>
<th><b>Female</b></th>
<th><b>New</b></th>
<th><b>Returning</b></th>
<th><b>Number of Episodes created</b></th>
</tr>
</thead>
<tbody>
@foreach($patient_categories as $patient_category)
<tr>
<td>{{ $patient_category["name"] }}</td>
<td>{{ $patient_category["total_patients"] }} ({{ round(($patient_category["total_patients"] / $total_patients) * 100) }}% of the total patients)</td>
<td>{{ $patient_category["male"] }}</td>
<td>{{ $patient_category["total_patients"] - $patient_category["male"] }}</td>
<td>{{ $patient_category["new"] }}</td>
<td>{{ $patient_category["total_patients"] - $patient_category["new"] }}</td>
<td>{{ $patient_category["total_episodes"] }}</td>
</tr>
@endforeach
</tbody>
</table>
@endif
@if(count($patient_wards) > 0 && $is_inpatient_queried)
<hr>
<h3>Admissions per ward</h3>
<table class="table table-condensed table-bordered text-center">
<thead>
<tr>
<th><b>Ward Name</b></th>
<th><b>Number of Patients</b></th>
<th><b>Male</b></th>
<th><b>Female</b></th>
<th><b>New Admissions</b></th>
<th><b>Re-Admissions</b></th>
<th><b>Discharged</b></th>
<th><b>Still Admitted</b></th>
<th><b>Still Admitted As Of {{ streamline_date($end_date) }}</b></th>
<th><b>Deaths</b></th>
<th><b>Number of episodes created</b></th>
</tr>
</thead>
<tbody>
@foreach($patient_wards as $patient_ward)
<tr>
<td>{{ $patient_ward["name"] }}</td>
<td>{{ $patient_ward["total_patients"] }} ({{ round(($patient_ward["total_patients"] / $total_admissions) * 100) }}% of the total admissions)</td>
<td>{{ $patient_ward["male"] }}</td>
<td>{{ $patient_ward["female"] }}</td>
<td>{{ $patient_ward["new"] }}</td>
<td>{{ $patient_ward["total_patients"] - $patient_ward["new"] }}</td>
<td>{{ $patient_ward["discharged"] }}</td>
<td>{{ $patient_ward["total_patients"] - $patient_ward["discharged"] }}</td>
<td>{{ $patient_ward["admitted_as_of"] }}</td>
<td>{{ $patient_ward["deaths"] }}</td>
<td>{{ $patient_ward["total_episodes"] }}</td>
</tr>
@endforeach
</tbody>
</table>
@endif
</div>
</body>
</html>
@@ -0,0 +1,120 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-6">
<h4 class="page-title">{{ __('hmis_reports.follow_up_drop_out_report') }}</h4>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
<li class="active">{{ __('hmis_reports.follow_up_reports') }}</li>
</ol>
</div>
</div>
<div class="white-box">
{{ Form::open(['route' => 'memorised_reports.patients_lost_to_follow_up' , 'data-toggle' => 'validator']) }}
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-3">
<div class="form-group">
{{ Form::label('start_date',__('hmis_reports.from')) }}
{{ Form::text('start_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'start_date']) }}
</div>
</div>
<div class="col-md-3">
<div class="form-group">
{{ Form::label('end_date',__('hmis_reports.to')) }}
{{ Form::text('end_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'end_date']) }}
</div>
</div>
<div class="col-md-2">
<br>
{{ Form::button(__('hmis_reports.search'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
</div>
</div>
{{ Form::close() }}
<hr>
<h4 style="color: #0060BF; font-weight: bolder;">{{ __('hmis_reports.showing_results_from') }} {{ streamline_date($start_date) }} {{ __('hmis_reports.to') }} {{ streamline_date($end_date) }}</h4>
<div class="table-responsive">
<table class="table table-striped color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('hmis_reports.patient_name') }}</th>
<th>{{ __('hmis_reports.date_created') }}</th>
<th>{{ __('hmis_reports.follow_up_date') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@if(count($lost_follow_ups) > 0)
@foreach($lost_follow_ups as $record)
<tr>
<td>{{ get_full_name($record->patient_id, 'id', 'first_name', 'last_name', 'patients') }} ({{ get_name($record->patient_id, 'id', 'number', 'patients') }}) </td>
<td>{{ streamline_date($record->created_at) }}</td>
<td>{{ streamline_date($record->appointment_date) }}</td>
<td>
<a class="btn btn-success" href="{{ url('/patient_episodes/set_patient_id/' . $record->patient_id) }}">{{ __('hmis_reports.select') }}</a>
</td>
</tr>
@endforeach
@else
<tr>
<td colspan="4">
<h4 class='text-center'>{{ __('hmis_reports.no_records_found') }}</h4>
</td>
</tr>
@endif
</tbody>
</table>
<hr>
<table class="table table-striped table-bordered">
<tr>
<th style="color: black">{{ __('hmis_reports.patients_to_follow_up') }}</th>
<td>{{ $total_follow_ups }}</td>
</tr>
<tr>
<th style="color: black">{{ __('hmis_reports.patients_lost') }}</th>
<td>{{ $number_of_patients_lost }}</td>
</tr>
<tr>
<th style="color: black">{{ __('hmis_reports.patients_followed_up') }}</th>
<td>{{ $number_of_patients_followed_up }}</td>
</tr>
<tr>
<th style="color: black">{{ __('hmis_reports.drop_out_rate') }}</th>
<td>{{ $drop_out_rate }} %</td>
</tr>
</table>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy'
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy'
});
</script>
@endpush
@@ -0,0 +1,248 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('hmis_reports.procedures_report') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
@if(URL::previous() == url("list_memorised_reports"))
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
@endif
<li class="active">{{ __('hmis_reports.procedures_report') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
<h3 class="heading" style="text-align: center; text-decoration: underline;">{{ __('hmis_reports.procedures_report') }}</h3>
<br><br>
<div class="col-sm-3"></div>
<div class="row">
<div class="col-sm-2">
{{ Form::open(['url' => 'procedures_report','data-toggle'=>'validator']) }}
<div class="form-group" id="searchby">
{{ Form::label('search_by', __('hmis_reports.date')) }}
{{ Form::select('search_by', ['0'=>__('hmis_reports.last_24_hours'),'1'=>__('hmis_reports.custom_date'),'2'=>__('hmis_reports.custom_range')], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-sm-2" style="display: none;" id="date_search">
<div class="form-group" id="reg_date" style="padding-top: 23px;">
<div class="input-group">
{{ Form::text('reg_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-autoclose']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-sm-2" style="display: none;" id="date_range_search">
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('start_date', __('hmis_reports.from')) }}
<div class="input-group">
{{ Form::text('start_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-1']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="reg_date">
{{ Form::label('end_date', __('hmis_reports.to')) }}
<div class="input-group">
{{ Form::text('end_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-2']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
</div>
</div>
&nbsp;
{{-- <div class="col-sm-3">
{{ Form::label('diagnosis',__('hmis_reports.diagnosis')) }}
{{ Form::select('diagnosis',$diagnoses, '',['class' => 'form-control','id' => 'diagnosis']) }}
</div> --}}
<div class="col-sm-2">
{{ Form::label('procedures',__('hmis_reports.procedures')) }}
{{ Form::select('procedure_id',$procedures,'',['class' => 'form-control', 'id' => 'procedure_id']) }}
</div>
&nbsp;
<div class="col-sm-3">
{{ Form::label('performed_by',__('hmis_reports.performed_by')) }}
{{ Form::select('performed_by',$all_users,'',['class' => 'form-control', 'id' => 'performed_by']) }}
</div>
&nbsp;
<div class="col-sm-2"><br>
{{ Form::submit(__('hmis_reports.search'),['name' => 'filterBtn','class' => 'btn btn-success']) }}
{{ Form::close() }}
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
{!! $search_string ?? $search_string !!}
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('hmis_reports.number') }}</th>
<th>{{ __('hmis_reports.names') }}</th>
{{-- <th>{{ __('hmis_reports.diagnoses') }}</th> --}}
<th style="display: none;">{{ __('hmis_reports.hidden_date') }}</th>
<th>{{ __('hmis_reports.date') }}</th>
<th>{{ __('hmis_reports.procedures') }}</th>
<th>{{ __('hmis_reports.performed_by') }}</th>
<th>{{ __('hmis_reports.done_from') }}</th>
<th>{{ __('hmis_reports.done_status') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($procedure_ipd as $procedure)
@php
$procedures = explode(",", $procedure->procedure_id);
$done_by = explode(",", $procedure->performed_by);
@endphp
<tr>
<td>{{ get_name($procedure->patient_id, 'id', 'number', 'patients') }}</td>
<td>{{ get_name($procedure->patient_id, 'id', 'first_name', 'patients') }} {{ get_name($procedure->patient_id, 'id', 'last_name', 'patients') }}</td>
{{-- <td>{{ isset($diagnoses[get_name($procedure->episode_id, 'episode_id', 'primary_diagnosis', 'consultations')]) ? $diagnoses[get_name($procedure->episode_id, 'episode_id', 'primary_diagnosis', 'consultations')] : "" }}</td> --}}
<td style="display: none;">{{ $procedure->procedure_date }}</td>
<td>{{ !empty($procedure->procedure_date)? streamline_date($procedure->procedure_date) : streamline_date(Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $procedure->created_at)->format('Y-m-d')) }}</td>
<td>
@foreach ($procedures as $procedure_selected)
<li>{{ get_name($procedure_selected, 'id', 'name', 'procedures')}}</li>
@endforeach
</td>
<td>
@foreach ($done_by as $performed_by)
<li>{{ get_full_name($performed_by, 'id', 'first_name', 'last_name', 'users')}}</li>
@endforeach
</td>
<td>
IPD: {{ get_name($procedure->ward_id, 'id', 'name', 'wards') }}
</td>
<td>
{{-- Perfomred status in IPD --}}
@foreach ($done_by as $performed_by)
<li>{!! $performed_by !== 0 ? '<font style="color:Green">'.__("consultations.performed").'</font>' : '<font style="color:red">'.__("consultations.not_performed").'</font>' !!}</li>
@endforeach
</td>
<td><a href="/patient_episodes/set_patient_id/{{ $procedure->patient_id }}" class="btn btn-sm btn-info">{{ __('hmis_reports.view_patient') }}</a></td>
</tr>
@endforeach
@foreach($procedure_opd as $procedure_op)
@php
$procedures = explode(",", $procedure_op->procedure_id);
$done_by = explode(",", $procedure_op->performed_id);
$done_status = explode(",", $procedure_op->performed);
@endphp
<tr>
<td>{{ get_name($procedure_op->patient_id, 'id', 'number', 'patients') }}</td>
<td>{{ get_name($procedure_op->patient_id, 'id', 'first_name', 'patients') }} {{ get_name($procedure_op->patient_id, 'id', 'last_name', 'patients') }}</td>
<td style="display: none;">{{ $procedure_op->procedure_date }}</td>
<td>{{ !empty($procedure_op->procedure_date)? streamline_date($procedure_op->procedure_date) : streamline_date(Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $procedure_op->created_at)->format('Y-m-d')) }}</td>
<td>
@foreach ($procedures as $procedure_selected)
<li>{{ get_name($procedure_selected, 'id', 'name', 'procedures')}}</li>
@endforeach
</td>
<td>
@foreach ($done_by as $performed_by)
<li>{{ get_full_name(get_name($performed_by, 'id', 'performed_by', 'staff_performed_services'), 'id', 'first_name', 'last_name', 'users')}}</li>
@endforeach
</td>
<td>
OPD
</td>
<td>
@foreach ($done_status as $performed)
<li>{!! $performed == 1 ? '<font style="color:Green">'.__("consultations.performed").'</font>' : '<font style="color:Orange">'.__("consultations.pending").'</font>' !!}</li>
@endforeach
</td>
<td><a href="/patient_episodes/set_patient_id/{{ $procedure_op->patient_id }}" class="btn btn-sm btn-info">{{ __('hmis_reports.view_patient') }}</a></td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
order: [[ 3, "desc" ]],
columnDefs : [{"targets":3, "type":"date-eu"}],
//columnDefs: [ { type: 'date', 'targets': [3] } ],
//order: [[ 3, 'desc' ]]
pageLength: 100,
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
$('#procedure_id,#performed_by').select2({
placeholder: "-- select --"
});
$('#search_by').change(function () {
if ($(this).val() == 1) {
$('#date_search').show();
$('#date_range_search').hide();
}
else if ($(this).val() == 2) {
$('#date_range_search').show();
$('#date_search').hide();
}
else {
$('#date_search,#date_range_search').hide();
}
});
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy'
});
</script>
<script type="text/javascript">
jQuery('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy'
});
</script>
@endpush
@@ -0,0 +1,122 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h5 class="page-title">{{ __('hmis_reports.rdt_report') }}</h5>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
<li class="active">{{ __('hmis_reports.rdt_report') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
<h3 class="heading" style="text-align: center; text-decoration: underline;">{{ __('hmis_reports.rdt_report') }}</h3>
<div class="row">
<div class="col-sm-4">
{{ __('hmis_reports.showing_results_from') }} <span class="label label-info">{{ streamline_date($attendance_from) }}</span> {{ __('hmis_reports.to') }} <span class="label label-info">{{ streamline_date($attendance_to) }}</span>
</div>
<div class="col-sm-1">
{{ Form::open(['url' => 'rdt_report','data-toggle'=>'validator']) }}
{{ Form::label('date_from',__('hmis_reports.from')) }}
</div>
<div class="col-sm-2">
<div class="input-group">
{{ Form::text('date_from','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-from']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
<div class="col-sm-1">
{{ Form::label('date_to',__('hmis_reports.to')) }}
</div>
<div class="col-sm-2">
<div class="input-group">
{{ Form::text('date_to','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-to']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
<div class="col-sm-2">
{{ Form::submit(__('hmis_reports.search'),['name' => 'filterBtn','class' => 'btn btn-success']) }}
{{ Form::close() }}
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-12">
<table class="table table-condensed table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th class="center">RDT</th>
<th class="center" colspan="2">{{ __('hmis_reports.male') }}</th>
<th class="center" colspan="2">{{ __('hmis_reports.female') }}</th>
</tr>
</thead>
<tbody>
<tr>
<td class="center"></td>
<td class="center">{{ __('hmis_reports.children') }}</td>
<td class="center">{{ __('hmis_reports.adults') }}</td>
<td class="center">{{ __('hmis_reports.children') }}</td>
<td class="center">{{ __('hmis_reports.adults') }}</td>
</tr>
<tr>
<td class="center" style="background-color: #e8e4e4">
{{ __('hmis_reports.positive') }}
</td>
<td class="center">{{ $pos_male_child }}</td>
<td class="center">{{ $pos_male_adult }}</td>
<td class="center">{{ $pos_female_child }}</td>
<td class="center">{{ $pos_female_adult }}</td>
</tr>
<tr>
<td class="center" style="background-color: #e8e4e4">
{{ __('hmis_reports.negative') }}
</td>
<td class="center">{{ $neg_male_child }}</td>
<td class="center">{{ $neg_male_adult }}</td>
<td class="center">{{ $neg_female_child }}</td>
<td class="center">{{ $neg_female_adult }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<!-- Typehead Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
<!-- Data table javascript -->
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
jQuery('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy',
});
</script>
@endpush
@@ -0,0 +1,242 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('hmis_reports.performed_services_report') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
<li class="active">{{ __('hmis_reports.performed_services_report') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
<h3 class="heading" style="text-align: center; text-decoration: underline;">{{ __('hmis_reports.performed_services_report') }}</h3>
<br><br>
<div class="col-sm-3"></div>
<div class="row">
<div class="col-sm-2">
{{ Form::open(['url' => 'performed_services_report','data-toggle'=>'validator']) }}
<div class="form-group" id="searchby">
{{ Form::label('search_by', __('hmis_reports.date')) }}
{{ Form::select('search_by', ['0'=>__('hmis_reports.last_24_hours'),'1'=>__('hmis_reports.custom_date'),'2'=>__('hmis_reports.custom_range')], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-sm-2" style="display: none;" id="date_search">
<div class="form-group" id="reg_date" style="padding-top: 23px;">
<div class="input-group">
{{ Form::text('reg_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-autoclose']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-sm-2" style="display: none;" id="date_range_search">
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('start_date', __('hmis_reports.from')) }}
<div class="input-group">
{{ Form::text('start_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-1']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="reg_date">
{{ Form::label('end_date', __('hmis_reports.to')) }}
<div class="input-group">
{{ Form::text('end_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-2']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
</div>
</div>
&nbsp;
<div class="col-sm-2">
{{ Form::label('services',__('hmis_reports.services')) }}
{{ Form::select('service_id',$services,'',['class' => 'form-control', 'id' => 'service_id']) }}
</div>
&nbsp;
<div class="col-sm-3">
{{ Form::label('performed_by',__('hmis_reports.performed_by')) }}
{{ Form::select('performed_by',$all_users,'',['class' => 'form-control', 'id' => 'performed_by']) }}
</div>
&nbsp;
<div class="col-sm-2"><br>
{{ Form::submit(__('hmis_reports.search'),['name' => 'filterBtn','class' => 'btn btn-success']) }}
{{ Form::close() }}
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
{!! $search_string ?? $search_string !!}
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('hmis_reports.number') }}</th>
<th>{{ __('hmis_reports.names') }}</th>
<th>{{ __('hmis_reports.date') }}</th>
<th>{{ __('hmis_reports.services') }}</th>
<th>{{ __('hmis_reports.quantity') }}</th>
<th>{{ __('hmis_reports.unit_price') }}</th>
<th>{{ __('hmis_reports.performed_by') }}</th>
<th>{{ __('hmis_reports.done_from') }}</th>
<th>{{ __('hmis_reports.staff_fee') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($services_ipd as $service)
@php
$service_consumed = $service->service_id;
$performed_by = null;
if (str_contains($service_consumed, '__')){
$service_and_performed_by_array = explode("__", $service_consumed);
$service_id = $service_and_performed_by_array[0];
$performed_by = $service_and_performed_by_array[1];
} else{
$service_id = $service_consumed;
}
@endphp
<tr>
<td>{{ get_name($service->patient_id, 'id', 'number', 'patients') }}</td>
<td>{{ get_name($service->patient_id, 'id', 'first_name', 'patients') }} {{ get_name($service->patient_id, 'id', 'last_name', 'patients') }}</td>
<td>{{ !is_null($service->dispensation_date) ? streamline_date($service->dispensation_date) : "" }}</td>
<td>
{{ get_name($service_id, 'id', 'name', 'services')}}
</td>
<td>{{ $service->quantity_given }}</td>
<td>{{ ugandan_shillings($service->unit_price) }}</td>
<td>
{{ $performed_by ? get_full_name($performed_by, 'id', 'first_name', 'last_name', 'users') : ""}}
</td>
<td>
IPD: {{ get_name($service->ward_id, 'id', 'name', 'wards') }}
</td>
{{-- Perfomred status in IPD for future development --}}
<td>
{{ ugandan_shillings($service->staff_fee) }}
</td>
<td><a href="/patient_episodes/set_patient_id/{{ $service->patient_id }}" class="btn btn-info btn-rounded btn-sm">{{ __('investigations.select_patient') }}</a></td>
</tr>
@endforeach
@foreach($services_opd as $service_op)
@php
$service_id = $service_op->service_id;
@endphp
<tr>
<td>{{ get_name($service_op->patient_id, 'id', 'number', 'patients') }}</td>
<td>{{ get_name($service_op->patient_id, 'id', 'first_name', 'patients') }} {{ get_name($service_op->patient_id, 'id', 'last_name', 'patients') }}</td>
<td>{{ !is_null($service_op->date_performed) ? streamline_date($service_op->date_performed) : "" }}</td>
<td>
{{ get_name($service_op->item_id, 'id', 'name', 'services')}}
</td>
<td>1</td>
<td>{{ ugandan_shillings($service_op->item_price) }}</td>
<td>
{{ get_full_name($service_op->performed_by, 'id', 'first_name', 'last_name', 'users') }}
</td>
<td>
OPD
</td>
{{-- Perfomred status in IPD for future development --}}
<td>
{{ ugandan_shillings($service_op->performance_fee) }}
</td>
<td><a href="/patient_episodes/set_patient_id/{{ $service_op->patient_id }}" class="btn btn-info btn-rounded btn-sm">{{ __('investigations.select_patient') }}</a></td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
order: [[ 3, "desc" ]],
columnDefs : [{"targets":3, "type":"date-eu"}],
//columnDefs: [ { type: 'date', 'targets': [3] } ],
//order: [[ 3, 'desc' ]]
pageLength: 100,
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
$('#service_id,#performed_by').select2({
placeholder: "-- All services --"
});
$('#performed_by').select2({
placeholder: "-- All staff --"
});
$('#search_by').change(function () {
if ($(this).val() == 1) {
$('#date_search').show();
$('#date_range_search').hide();
}
else if ($(this).val() == 2) {
$('#date_range_search').show();
$('#date_search').hide();
}
else {
$('#date_search,#date_range_search').hide();
}
});
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy'
});
</script>
<script type="text/javascript">
jQuery('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy'
});
</script>
@endpush
@@ -0,0 +1,95 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h5 class="page-title">{{ __('hmis_reports.streamline_outpatient_report_details') }}</h5>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('streamline_outpatient_report') }}">{{ __('hmis_reports.streamline_outpatient_report') }}</a></li>
<li class="active">{{ __('hmis_reports.streamline_outpatient_report_details') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
<h4 class="heading" style="color: #0088CC; text-align: center; text-decoration: underline;">{{ __('hmis_reports.patient_details') }} <i>{{ __('hmis_reports.from') }}</i> {{ streamline_date($date_from) }} <i>{{ __('hmis_reports.to') }}</i> {{ streamline_date($date_to) }}</h4>
<div class="row">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th></th>
<th>{{ __('hmis_reports.patient_number') }}</th>
<th>{{ __('hmis_reports.full_names') }}</th>
<th>{{ __('hmis_reports.gender') }}</th>
<th>{{ __('hmis_reports.age') }}</th>
<th>{{ __('hmis_reports.phone') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@php $counter = 1; @endphp
@if(count($patient_array) > 0)
@for($i = 0; $i < count($patient_array); $i++)
@php
$patient = Streamline\Models\Patient::find($patient_array[$i]);
$dob = new Carbon\Carbon($patient->date_of_birth);
@endphp
<tr>
<td>{{ $counter }}.</td>
<td>{{ $patient->number }}</td>
<td>{!! insurance_flag($patient->id) !!}</td>
<td>{{ $patient->gender == 1 ? __('hmis_reports.male') : __('hmis_reports.female') }}</td>
<td>{{ $dob->diffInYears(Carbon\Carbon::now()) }} {{ __('hmis_reports.years') }}</td>
<td>{{ $patient->phone }}</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $patient->id }}" class="btn btn-success btn-xs">{{ __('hmis_reports.select') }}</a>
</td>
</tr>
@php $counter++; @endphp
@endfor
@else
<tr class="warning"><td class="center" colspan="10">{{ __('hmis_reports.no_records_found') }}</td></tr>
@endif
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<!-- Typehead Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
<!-- Data table javascript -->
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
jQuery('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy',
});
</script>
@endpush
@@ -0,0 +1,255 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h5 class="page-title">{{ __('hmis_reports.streamline_outpatient_report_details') }}</h5>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('streamline_outpatient_report') }}">{{ __('hmis_reports.streamline_outpatient_report') }}</a></li>
<li class="active">{{ __('hmis_reports.streamline_outpatient_report_details') }}</li>
</ol>
</div>
</div>
<div class="white-box">
<h4 class="heading"> {{ __('hmis_reports.income_received_from') }} <strong>{{ get_name($department, 'id', 'name', 'clinics') }}</strong> <i>{{ __('hmis_reports.from') }}</i> <font style="color: #0088CC; text-align: center; text-decoration: underline;">{{ streamline_date($date_from) }}</font> <i>{{ __('hmis_reports.to') }}</i> <font style="color: #0088CC; text-align: center; text-decoration: underline;">{{ streamline_date($date_to) }}</font></h4>
<div class="row">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th></th>
<th>{{ __('hmis_reports.receipt_number') }}</th>
<th>{{ __('hmis_reports.item_name') }}</th>
<th>{{ __('hmis_reports.amount') }}</th>
<th>{{ __('hmis_reports.discount_if_any') }}</th>
<th>{{ __('hmis_reports.staff') }}</th>
<th>{{ __('hmis_reports.patient') }}</th>
<th>{{ __('hmis_reports.date') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@php $counter = 1; $discount_total = 0; @endphp
@if($tag_id == 6)
@if(count($consultation_deposits) > 0)
@foreach($consultation_deposits as $deposit)
<tr>
<td>{{ $counter }}.</td>
<td>{{ $deposit->receipt_number }}</td>
@php
$item_ids_array = explode(',', $deposit->items_ids);
$item_amounts_array = explode(',', $deposit->items_amounts);
@endphp
<td>
<ol>
@for($i = 0; $i < count($item_ids_array); $i++)
<li>{{ get_name($item_ids_array[$i], 'id', 'name', 'services') }}</li>
@endfor
</ol>
</td>
<td>
<ol>
@for($i = 0; $i < count($item_amounts_array); $i++)
<li>{{ $item_amounts_array[$i] }}</li>
@endfor
</ol>
</td>
<td>
{{ $discount = is_int(get_name($deposit->receipt_number, 'receipt_number', 'discount_amount', 'discounts')) ? get_name($deposit->receipt_number, 'receipt_number', 'discount_amount', 'discounts') : "" }}
@php $discount_total += is_int($discount) ? $discount : 0; @endphp
</td>
<td>{{ get_full_name($deposit->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
<td>{!! insurance_flag($deposit->patient_id) !!}</td>
<td>{{ streamline_date($deposit->created_at) }}</td>
@php $receipt_id = (int)$deposit->receipt_number; @endphp
<td>
<a href="/patient_finance/print_service_receipt{{ $receipt_id }}" class="btn btn-info btn-sm">{{ __('hmis_reports.print_receipt') }}</a>
</td>
</tr>
@php $counter++; @endphp
@endforeach
@endif
@elseif($tag_id == 2)
@if(count($deposits) > 0)
@foreach($deposits as $deposit)
<tr>
<td>{{ $counter }}.</td>
<td>{{ $deposit->receipt_number }}</td>
@php
$item_ids_array = explode(',', $deposit->investigation_items);
$item_amounts_array = explode(',', $deposit->investigation_amounts);
@endphp
<td>
<ol>
@for($i = 0; $i < count($item_ids_array); $i++)
<li>{{ get_name($item_ids_array[$i], 'id', 'name', 'investigations') }}</li>
@endfor
</ol>
</td>
<td>
<ol>
@for($i = 0; $i < count($item_amounts_array); $i++)
<li>{{ $item_amounts_array[$i] }}</li>
@endfor
</ol>
</td>
<td>
{{ $discount = is_int(get_name($deposit->receipt_number, 'receipt_number', 'discount_amount', 'discounts')) ? get_name($deposit->receipt_number, 'receipt_number', 'discount_amount', 'discounts') : "" }}
@php $discount_total += is_int($discount) ? $discount : 0; @endphp
</td>
<td>{{ get_full_name($deposit->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
<td>{!! insurance_flag($deposit->patient_id) !!}</td>
<td>{{ streamline_date($deposit->created_at) }}</td>
<td>
<a href="/patient_finance/print_investigation_receipt/{{ $deposit->receipt_number }}" class="btn btn-info btn-sm">{{ __('hmis_reports.print_receipt') }}</a>
</td>
</tr>
@php $counter++; @endphp
@endforeach
@endif
@elseif($tag_id == 3)
@if(count($deposits) > 0)
@foreach($deposits as $deposit)
<tr>
<td>{{ $counter }}.</td>
<td>{{ $deposit->receipt_number }}</td>
@php
$item_ids_array = explode(',', $deposit->treatment_items);
$item_amounts_array = explode(',', $deposit->treatment_subtotals);
@endphp
<td>
<ol>
@for($i = 0; $i < count($item_ids_array); $i++)
<li>{{ get_name($item_ids_array[$i], 'id', 'name', 'drugs') }}</li>
@endfor
</ol>
</td>
<td>
<ol>
@for($i = 0; $i < count($item_amounts_array); $i++)
<li>{{ $item_amounts_array[$i] }}</li>
@endfor
</ol>
</td>
<td>
{{ $discount = is_int(get_name($deposit->receipt_number, 'receipt_number', 'discount_amount', 'discounts')) ? get_name($deposit->receipt_number, 'receipt_number', 'discount_amount', 'discounts') : "" }}
@php $discount_total += is_int($discount) ? $discount : 0; @endphp
</td>
<td>{{ get_full_name($deposit->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
<td>{!! insurance_flag($deposit->patient_id) !!}</td>
<td>{{ streamline_date($deposit->created_at) }}</td>
@php
$treatment_deposit = Streamline\Models\TreatmentDeposits::where(['receipt_number' => $deposit->receipt_number ])->first();
$treatment_deposit_id = $treatment_deposit->id;
@endphp
<td>
<a href="/patient_finance/print_treatment_receipt{{ $treatment_deposit_id }}" class="btn btn-info btn-sm">{{ __('hmis_reports.print_receipt') }}</a>
</td>
</tr>
@php $counter++; @endphp
@endforeach
@endif
@elseif($tag_id == 4)
@if(count($deposits) > 0)
@foreach($deposits as $deposit)
<tr>
<td>{{ $counter }}.</td>
<td>{{ $deposit->receipt_number }}</td>
@php
$item_ids_array = explode(',', $deposit->procedure_items);
$item_amounts_array = explode(',', $deposit->procedure_amounts);
@endphp
<td>
<ol>
@for($i = 0; $i < count($item_ids_array); $i++)
<li>{{ get_name($item_ids_array[$i], 'id', 'name', 'procedures') }}</li>
@endfor
</ol>
</td>
<td>
<ol>
@for($i = 0; $i < count($item_amounts_array); $i++)
<li>{{ $item_amounts_array[$i] }}</li>
@endfor
</ol>
</td>
<td>
{{ $discount = is_int(get_name($deposit->receipt_number, 'receipt_number', 'discount_amount', 'discounts')) ? get_name($deposit->receipt_number, 'receipt_number', 'discount_amount', 'discounts') : "" }}
@php $discount_total += is_int($discount) ? $discount : 0; @endphp
</td>
<td>{{ get_full_name($deposit->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
<td>{!! insurance_flag($deposit->patient_id) !!}</td>
<td>{{ streamline_date($deposit->created_at) }}</td>
@php
$procedure_deposit = Streamline\Models\ProcedureDeposit::where(['receipt_number' => $deposit->receipt_number ])->first();
$procedure_deposit_id = $procedure_deposit->id;
@endphp
<td>
<a href="/patient_finance/print_procedures_receipt{{ $procedure_deposit_id }}" class="btn btn-info btn-sm">{{ __('hmis_reports.print_receipt') }}</a>
</td>
</tr>
@php $counter++; @endphp
@endforeach
@endif
@elseif(count($insurance_expenditure) > 0)
@foreach($insurance_expenditure as $expenditure)
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>{{ get_full_name($expenditure->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
<td>{!! insurance_flag($expenditure->patient_id) !!}</td>
<td>{{ streamline_date($expenditure->created_at) }}</td>
<td>
<a href="#" class="btn btn-info btn-sm">{{ __('hmis_reports.print_receipt') }}</a>
</td>
</tr>
@endforeach
@else
<tr class="warning"><td class="center" colspan="10">{{ __('hmis_reports.no_records_found') }}</td></tr>
@endif
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<!-- Typehead Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
<!-- Data table javascript -->
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
jQuery('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy',
});
</script>
@endpush
@@ -0,0 +1,292 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h5 class="page-title">{{ __('hmis_reports.streamline_outpatient_report_details') }}</h5>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('streamline_outpatient_report') }}">{{ __('hmis_reports.streamline_outpatient_report') }}</a></li>
<li class="active">{{ __('hmis_reports.streamline_outpatient_report_details') }}</li>
</ol>
</div>
</div>
<div class="white-box">
<h4 class="heading"> {{ __('hmis_reports.outpatient_list') }} for {{ $patient_category }} </h4>
<div class="row">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th></th>
<th>{{ __('hmis_reports.patient') }}</th>
<th>Gender</th>
<th>Telephone</th>
<th>Insurance Status</th>
<th></th>
</tr>
</thead>
<tbody>
@php $counter = 1; @endphp
@if(isset($patient_array_adults))
@if(count($patient_array_adults) > 0)
@foreach($patient_data as $patient )
<tr>
<td>{{ $counter }}.</td>
<td>{{ $patient->first_name }} {{ $patient->last_name }}</td>
<td> @if ($patient->gender == 1) Male @else Female @endif</td>
<td>{{ $patient->phone }}</td>
<td> @if($patient->insurance_status == 1) Insured @else Not Insured @endif </td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $patient->id }}" class="btn btn-success">{{ __('hmis_reports.select') }}</a>
</td>
</tr>
@php $counter++; @endphp
@endforeach
@endif
@endif
@if(isset($patient_array_males))
@if(count($patient_array_males) > 0)
@foreach($patient_data as $patient )
<tr>
<td>{{ $counter }}.</td>
<td>{{ $patient->first_name }} {{ $patient->last_name }}</td>
<td> @if ($patient->gender == 1) Male @else Female @endif</td>
<td>{{ $patient->phone }}</td>
<td> @if($patient->insurance_status == 1) Insured @else Not Insured @endif </td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $patient->id }}" class="btn btn-success">{{ __('hmis_reports.select') }}</a>
</td>
</tr>
@php $counter++; @endphp
@endforeach
@endif
@endif
@if(isset($patient_array_females))
@if(count($patient_array_females) > 0)
@foreach($patient_data as $patient )
<tr>
<td>{{ $counter }}.</td>
<td>{{ $patient->first_name }} {{ $patient->last_name }}</td>
<td> @if ($patient->gender == 1) Male @else Female @endif</td>
<td>{{ $patient->phone }}</td>
<td> @if($patient->insurance_status == 1) Insured @else Not Insured @endif </td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $patient->id }}" class="btn btn-success">{{ __('hmis_reports.select') }}</a>
</td>
</tr>
@php $counter++; @endphp
@endforeach
@endif
@endif
@if(isset($patient_array_children))
@if(count($patient_array_children) > 0)
@foreach($patient_data as $patient )
<tr>
<td>{{ $counter }}.</td>
<td>{{ $patient->first_name }} {{ $patient->last_name }}</td>
<td> @if ($patient->gender == 1) Male @else Female @endif</td>
<td>{{ $patient->phone }}</td>
<td> @if($patient->insurance_status == 1) Insured @else Not Insured @endif </td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $patient->id }}" class="btn btn-success">{{ __('hmis_reports.select') }}</a>
</td>
</tr>
@php $counter++; @endphp
@endforeach
@endif
@endif
@if(isset($patient_array_children_males))
@if(count($patient_array_children_males) > 0)
@foreach($patient_data as $patient )
<tr>
<td>{{ $counter }}.</td>
<td>{{ $patient->first_name }} {{ $patient->last_name }}</td>
<td> @if ($patient->gender == 1) Male @else Female @endif</td>
<td>{{ $patient->phone }}</td>
<td> @if($patient->insurance_status == 1) Insured @else Not Insured @endif </td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $patient->id }}" class="btn btn-success">{{ __('hmis_reports.select') }}</a>
</td>
</tr>
@php $counter++; @endphp
@endforeach
@endif
@endif
@if(isset($patient_array_children_females))
@if(count($patient_array_children_females) > 0)
@foreach($patient_data as $patient )
<tr>
<td>{{ $counter }}.</td>
<td>{{ $patient->first_name }} {{ $patient->last_name }}</td>
<td> @if ($patient->gender == 1) Male @else Female @endif</td>
<td>{{ $patient->phone }}</td>
<td> @if($patient->insurance_status == 1) Insured @else Not Insured @endif </td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $patient->id }}" class="btn btn-success">{{ __('hmis_reports.select') }}</a>
</td>
</tr>
@php $counter++; @endphp
@endforeach
@endif
@endif
@if(isset($patient_array))
@if(count($patient_array) > 0)
@foreach($patient_data as $patient )
<tr>
<td>{{ $counter }}.</td>
<td>{{ $patient->first_name }} {{ $patient->last_name }}</td>
<td> @if ($patient->gender == 1) Male @else Female @endif</td>
<td>{{ $patient->phone }}</td>
<td> @if($patient->insurance_status == 1) Insured @else Not Insured @endif </td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $patient->id }}" class="btn btn-success">{{ __('hmis_reports.select') }}</a>
</td>
</tr>
@php $counter++; @endphp
@endforeach
@endif
@endif
@if(isset($patient_array_admitted))
@if(count($patient_array_admitted) > 0)
@foreach($patient_data as $patient )
<tr>
<td>{{ $counter }}.</td>
<td>{{ $patient->first_name }} {{ $patient->last_name }}</td>
<td> @if ($patient->gender == 1) Male @else Female @endif</td>
<td>{{ $patient->phone }}</td>
<td> @if($patient->insurance_status == 1) Insured @else Not Insured @endif </td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $patient->id }}" class="btn btn-success">{{ __('hmis_reports.select') }}</a>
</td>
</tr>
@php $counter++; @endphp
@endforeach
@endif
@endif
@if(isset($patient_array_admitted))
@if(count($patient_array_admitted) > 0)
@foreach($patient_data as $patient )
<tr>
<td>{{ $counter }}.</td>
<td>{{ $patient->first_name }} {{ $patient->last_name }}</td>
<td> @if ($patient->gender == 1) Male @else Female @endif</td>
<td>{{ $patient->phone }}</td>
<td> @if($patient->insurance_status == 1) Insured @else Not Insured @endif </td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $patient->id }}" class="btn btn-success">{{ __('hmis_reports.select') }}</a>
</td>
</tr>
@php $counter++; @endphp
@endforeach
@endif
@endif
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<!-- Typehead Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
<!-- Data table javascript -->
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
jQuery('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy',
});
</script>
<script type="text/javascript">
$('document').ready(function () {
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy',
{extend: 'csv',
message: '<?php echo __('users.list_of_users');?>',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6]
},
},
{extend: 'excel',
message: '<?php echo __('users.list_of_users');?>',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6]
},
sheetName: '<?php echo __('users.list_of_users');?>'
},
{extend: 'pdf',
message: '<?php echo __('users.list_of_users');?>',
orientation: 'portrait',
pageSize: 'LETTER',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6]
},
customize: function (doc) {
doc.defaultStyle.fontSize = 10;
// doc.styles.tableHeader.alignment = 'left';
}
},
{extend: 'print',
message: '<?php echo __('users.list_of_users');?>',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6]
},
customize: function (win) {
$(win.document.body)
.css('font-size', '10pt')
.css('background', '#fff')
.prepend(
'<img src="<?php echo asset('uploads/logo/logo-sm.png'); ?>" style="position:absolute; top:0; right:0;" />'
);
$(win.document.body).find('table')
.addClass('compact')
.css('font-size', 'inherit');
}
}
]
});
$('.sorting').removeClass('sorting');//remove the sorting class
$('.sorting_asc').removeClass('sorting_asc');//remove the sorting class
});
</script>
@endpush
@@ -0,0 +1,429 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet"
type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet"
type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-6">
<h4 class="page-title">{{ __('hmis_reports.streamline_outpatient_report') }}</h4>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
<li class="active">{{ __('hmis_reports.streamline_outpatient_report') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
<div class="row">
<div class="col-md-4">
<p><code>{{ __('hmis_reports.from') }}: {{ streamline_date($attendance_from) }}</code></p>
<p><code>{{ __('hmis_reports.to') }}: {{ streamline_date($attendance_to) }}</code></p>
<p><code>{{ __('hmis_reports.clinic') }}: @if($clinic_id == 0) {{ __('hmis_reports.opd') }} @else {{ get_name($clinic_id, 'id', 'name', 'clinics') }} @endif</code>
</p>
<p><code>@if($patient_type == 2) {{ __('hmis_reports.insured_patients') }} @else {{ __('hmis_reports.all_patients') }} @endif</code>
</p>
</div>
<div class="col-md-8">
<div class="row">
<div class="col-md-1">
{{ Form::open(['url' => 'streamline_outpatient_report','data-toggle'=>'validator']) }}
{{ Form::label('date_from',__('hmis_reports.from')) }}
</div>
<div class="col-md-4">
<div class="input-group">
{{ Form::text('date_from','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-from']) }}
</div>
</div>
<div class="col-md-1">
{{ Form::label('date_to',__('hmis_reports.to')) }}
</div>
<div class="col-md-4">
<div class="input-group">
{{ Form::text('date_to','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-to']) }}
</div>
</div>
<div class="col-md-2"></div>
</div>
<br>
{{-- <div class="row">
<div class="col-md-1">
{{ Form::label('age',__('hmis_reports.age')) }}
</div>
<div class="col-md-4">
{{ Form::select('age',$age,'',['class'=>'form-control', 'onclick' => 'checkAgeGroup(this.value)']) }}
</div>
<div class="col-md-1">
{{ Form::label('gender',__('hmis_reports.gender')) }}
</div>
<div class="col-md-4">
{{ Form::select('gender',['' => __('hmis_reports.select'), '0' => __('hmis_reports.all'), '1' => __('hmis_reports.male'),'2' => __('hmis_reports.female')],'',['class'=>'form-control']) }}
</div>
</div> --}}
<br>
<div class="row">
<div class="col-md-1">
{{ Form::label('clinic_id',__('hmis_reports.clinic')) }}
</div>
<div class="col-md-4">
{{ Form::select('clinic_id',$clinics,'',['class' => 'form-control', 'required']) }}
</div>
<div class="col-md-1">
{{ Form::label('patient_type',__('hmis_reports.patients')) }}
</div>
<div class="col-md-4">
{{ Form::select('patient_type',[0 => __('hmis_reports.select'),1 => __('hmis_reports.all_patients'), 2 => __('hmis_reports.insured_patients')],'',['class' => 'form-control', 'required']) }}
</div>
<div class="col-md-2">
{{ Form::submit('Search',['class' => 'btn btn-success']) }}
{{ Form::close() }}
</div>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-6">
<div class="table-responsive">
<table class="table table-striped table-bordered">
<tr>
<td><b>{{ __('hmis_reports.adults_seen') }}</b></td>
<td>
@if(count($patient_array_adults) > 0)
{{ Form::open(['method'=>'post','route' => 'streamline_outpatient_details']) }}
{{ Form::hidden('to', $attendance_to) }}
{{ Form::hidden('from', $attendance_from) }}
{{ Form::hidden('department', $clinic_id) }}
{{ Form::hidden('patient_array_adults', json_encode($patient_array_adults)) }}
{{ Form::submit(count($patient_array_adults), ['class'=>'btn btn-link']) }}
{{ Form::close() }}
@else
{{ count($patient_array_adults) }}
@endif
</td>
</tr>
<tr>
<td><b>{{ __('hmis_reports.males_seen') }}</b></td>
<td>
@if(count($patient_array_males) > 0)
{{ Form::open(['method'=>'post','route' => 'streamline_outpatient_details']) }}
{{ Form::hidden('to', $attendance_to) }}
{{ Form::hidden('from', $attendance_from) }}
{{ Form::hidden('department', $clinic_id) }}
{{ Form::hidden('patient_array_males', json_encode($patient_array_males)) }}
{{ Form::submit(count($patient_array_males), ['class'=>'btn btn-link']) }}
{{ Form::close() }}
@else
{{ count($patient_array_males) }}
@endif
</td>
</tr>
<tr>
<td><b>{{ __('hmis_reports.females_seen') }}</b></td>
<td>
@if(count($patient_array_females) > 0)
{{ Form::open(['method'=>'post','route' => 'streamline_outpatient_details']) }}
{{ Form::hidden('to', $attendance_to) }}
{{ Form::hidden('from', $attendance_from) }}
{{ Form::hidden('department', $clinic_id) }}
{{ Form::hidden('patient_array_females', json_encode($patient_array_females)) }}
{{ Form::submit(count($patient_array_females), ['class'=>'btn btn-link']) }}
{{ Form::close() }}
@else
{{ count($patient_array_females) }}
@endif
</td>
</tr>
</table>
</div>
</div>
<div class="col-md-6">
<div class="table-responsive">
<table class="table table-striped table-bordered">
<tr>
<td><b>{{ __('hmis_reports.children_seen') }}</b></td>
<td>
@if(count($patient_array_children) > 0)
{{ Form::open(['method'=>'post','route' => 'streamline_outpatient_details']) }}
{{ Form::hidden('to', $attendance_to) }}
{{ Form::hidden('from', $attendance_from) }}
{{ Form::hidden('department', $clinic_id) }}
{{ Form::hidden('patient_array_children', json_encode($patient_array_children)) }}
{{ Form::submit(count($patient_array_children), ['class'=>'btn btn-link']) }}
{{ Form::close() }}
@else
{{ count($patient_array_children) }}
@endif
</td>
</tr>
<tr>
<td><b>{{ __('hmis_reports.male_children_seen') }}</b></td>
<td>
@if(count($patient_array_children_males) > 0)
{{ Form::open(['method'=>'post','route' => 'streamline_outpatient_details']) }}
{{ Form::hidden('to', $attendance_to) }}
{{ Form::hidden('from', $attendance_from) }}
{{ Form::hidden('department', $clinic_id) }}
{{ Form::hidden('patient_array_children_males', json_encode($patient_array_children_males)) }}
{{ Form::submit(count($patient_array_children_males), ['class'=>'btn btn-link']) }}
{{ Form::close() }}
@else
{{ count($patient_array_children_males) }}
@endif
</td>
</tr>
<tr>
<td><b>{{ __('hmis_reports.female_children_seen') }}</b></td>
<td>
@if(count($patient_array_children_females) > 0)
{{ Form::open(['method'=>'post','route' => 'streamline_outpatient_details']) }}
{{ Form::hidden('to', $attendance_to) }}
{{ Form::hidden('from', $attendance_from) }}
{{ Form::hidden('department', $clinic_id) }}
{{ Form::hidden('patient_array_children_females', json_encode($patient_array_children_females)) }}
{{ Form::submit(count($patient_array_children_females), ['class'=>'btn btn-link']) }}
{{ Form::close() }}
@else
{{ count($patient_array_children_females) }}
@endif
</td>
</tr>
</table>
</div>
</div>
<div class="col-md-6">
<div class="table-responsive">
<table class="table table-striped table-bordered">
<tr>
<td><b>{{ __('hmis_reports.total_seen') }}</b></td>
<td>
@if(count($patient_array) > 0)
{{ Form::open(['method'=>'post','route' => 'streamline_outpatient_details']) }}
{{ Form::hidden('to', $attendance_to) }}
{{ Form::hidden('from', $attendance_from) }}
{{ Form::hidden('department', $clinic_id) }}
{{ Form::hidden('patient_array', json_encode($patient_array)) }}
{{ Form::submit(count($patient_array), ['class'=>'btn btn-link']) }}
{{ Form::close() }}
@else
{{ count($patient_array) }}
@endif
</td>
</tr>
<tr>
<td><b>{{ __('hmis_reports.total_admitted') }}</b></td>
<td>
@if(count($patient_array_admitted) > 0)
{{ Form::open(['method'=>'post','route' => 'streamline_outpatient_details']) }}
{{ Form::hidden('to', $attendance_to) }}
{{ Form::hidden('from', $attendance_from) }}
{{ Form::hidden('department', $clinic_id) }}
{{ Form::hidden('patient_array_admitted', json_encode($patient_array_admitted)) }}
{{ Form::submit(count($patient_array_admitted), ['class'=>'btn btn-link']) }}
{{ Form::close() }}
@else
{{ count($patient_array_admitted) }}
@endif
</td>
</tr>
</table>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-6">
<div class="table-responsive">
<table class="table table-striped table-bordered">
<tr>
<td><b>{{ __('hmis_reports.consultation_costs') }}</b></td>
<td>
@if($total_costs_consultation > 0)
{{ Form::open(['method'=>'post','route' => 'streamline_outpatient_income_details']) }}
{{ Form::hidden('dates', ($attendance_from)."/".$attendance_to) }}
{{ Form::hidden('tag_id', 6) }}
{{ Form::hidden('patient_filter', json_encode($patient_array)) }}
{{ Form::hidden('department', $clinic_id) }}
{{ Form::hidden('insured_or_all', $patient_type) }}
{{ Form::submit(ugandan_shillings($total_costs_consultation), ['class'=>'btn btn-link']) }}
{{ Form::close() }}
@else
{{ ugandan_shillings($total_costs_consultation) }}
@endif
</td>
</tr>
<tr>
<td><b>{{ __('hmis_reports.other_services_costs') }}</b></td>
<td>
@if($total_costs_services > 0)
{{ Form::open(['method'=>'post','route' => 'streamline_outpatient_income_details']) }}
{{ Form::hidden('dates', ($attendance_from)."/".$attendance_to) }}
{{ Form::hidden('tag_id', 8) }}
{{ Form::hidden('patient_filter', json_encode($patient_array)) }}
{{ Form::hidden('department', $clinic_id) }}
{{ Form::hidden('insured_or_all', $patient_type) }}
{{ Form::submit(ugandan_shillings($total_costs_services), ['class'=>'btn btn-link']) }}
{{ Form::close() }}
@else
{{ ugandan_shillings($total_costs_services) }}
@endif
</td>
</tr>
<tr>
<td><b>{{ __('hmis_reports.investigation_costs') }}</b></td>
<td>
@if($total_costs_investigations > 0)
{{ Form::open(['method'=>'post','route' => 'streamline_outpatient_income_details']) }}
{{ Form::hidden('dates', ($attendance_from)."/".$attendance_to) }}
{{ Form::hidden('tag_id', 2) }}
{{ Form::hidden('patient_filter', json_encode($patient_array)) }}
{{ Form::hidden('department', $clinic_id) }}
{{ Form::hidden('insured_or_all', $patient_type) }}
{{ Form::submit(ugandan_shillings($total_costs_investigations), ['class'=>'btn btn-link']) }}
{{ Form::close() }}
@else
{{ ugandan_shillings($total_costs_investigations) }}
@endif
</td>
</tr>
</table>
</div>
</div>
<div class="col-md-6">
<div class="table-responsive">
<table class="table table-striped table-bordered">
<tr>
<td><b>{{ __('hmis_reports.treatment_costs') }}</b></td>
<td>
@if($total_costs_drug > 0)
{{ Form::open(['method'=>'post','route' => 'streamline_outpatient_income_details']) }}
{{ Form::hidden('dates', ($attendance_from)."/".$attendance_to) }}
{{ Form::hidden('tag_id', 3) }}
{{ Form::hidden('patient_filter', json_encode($patient_array)) }}
{{ Form::hidden('department', $clinic_id) }}
{{ Form::hidden('insured_or_all', $patient_type) }}
{{ Form::submit(ugandan_shillings($total_costs_drug), ['class'=>'btn btn-link']) }}
{{ Form::close() }}
@else
{{ ugandan_shillings($total_costs_drug) }}
@endif
</td>
</tr>
<tr>
<td><b>{{ __('hmis_reports.procedure_costs') }}</b></td>
<td>
@if($total_costs_procedures > 0)
{{ Form::open(['method'=>'post','route' => 'streamline_outpatient_income_details']) }}
{{ Form::hidden('dates', ($attendance_from)."/".$attendance_to) }}
{{ Form::hidden('tag_id', 4) }}
{{ Form::hidden('patient_filter', json_encode($patient_array)) }}
{{ Form::hidden('department', $clinic_id) }}
{{ Form::hidden('insured_or_all', $patient_type) }}
{{ Form::submit(ugandan_shillings($total_costs_procedures), ['class'=>'btn btn-link']) }}
{{ Form::close() }}
@else
{{ ugandan_shillings($total_costs_procedures) }}
@endif
</td>
</tr>
<tr>
<td><b>{{ __('hmis_reports.sundries_costs') }}</b></td>
<td>
@if($total_costs_sundries > 0)
{{ Form::open(['method'=>'post','route' => 'streamline_outpatient_income_details']) }}
{{ Form::hidden('dates', ($attendance_from)."/".$attendance_to) }}
{{ Form::hidden('tag_id', 5) }}
{{ Form::hidden('patient_filter', json_encode($patient_array)) }}
{{ Form::hidden('department', $clinic_id) }}
{{ Form::hidden('insured_or_all', $patient_type) }}
{{ Form::submit(ugandan_shillings($total_costs_sundries), ['class'=>'btn btn-link']) }}
{{ Form::close() }}
@else
{{ ugandan_shillings($total_costs_sundries) }}
@endif
</td>
</tr>
<tr>
<td><b>{{ __('hmis_reports.total_cost') }}</b></td>
<td>
{{ ugandan_shillings($total_costs) }}
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<!-- Typehead Plugin JavaScript -->
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
<!-- Data table javascript -->
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
jQuery('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'yyyy/mm/dd',
});
</script>
<script type="text/javascript">
function checkAgeGroup(value){
if (value == 44){
$('.custom_age').show();
} else {
$('.custom_age').hide();
}
}
</script>
@endpush
@@ -0,0 +1,394 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('hmis_reports.streamline_reports') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li class="active">{{ __('hmis_reports.reports') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="white-box">
@if( Auth::user()->can('view-hmis-reports'))
<a href="{{ url('list/hmis-reports') }}" class="btn btn-success "> {{ __('hmis_reports.hmis_reports') }}</a>
@endif
@if( Auth::user()->can('view-memorised-reports'))
<a href="{{ url('list_memorised_reports') }}" class="btn btn-success "> {{ __('hmis_reports.memorised_reports') }}</a>
@endif
<hr>
@include('flash::message')
{{ Form::open(['route' => 'streamline_reports.streamline_reports_details']) }}
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('report_category',__('hmis_reports.select_report_category')) }}
{{ Form::select('report_category',[''=> __('hmis_reports.select'), '1'=>'Primary Diagnosis', '2'=>__('hmis_reports.treatment'), '3'=>__('hmis_reports.laboratory_tests'), '4' => 'Patient Visits', '5' => 'Symptoms', '6' => 'Doctors Report'],'',['class'=>'form-control compulsory', 'id'=>'report_category', 'required']) }}
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="diagnosis_div">
{{ Form::label('diagnosis',__('hmis_reports.select_diagnosis')) }}
{{ Form::select('diagnosis',$diagnoses,'',['class'=>'form-control compulsory', 'id' => 'diagnosis']) }}
</div>
<div class="form-group" id="treatments_div">
{{ Form::label('treatment',__('hmis_reports.select_drug_issued')) }}
{{ Form::select('treatment',$treatments,'',['class'=>'form-control compulsory', 'id' => 'treatment']) }}
</div>
<div class="form-group" id="investigations_div">
{{ Form::label('lab_test',__('hmis_reports.select_test_name')) }}
{{ Form::select('lab_test',$investigations,'',['class'=>'form-control compulsory', 'id' => 'lab_test']) }}
</div>
<div class="form-group" id="symptoms_div">
{{ Form::label('symptoms',__('hmis_reports.symptoms')) }}
{{ Form::select('symptoms',$symptoms,'',['class'=>'form-control compulsory', 'id' => 'symptoms']) }}
</div>
</div>
</div>
<div class="row hide_for_doctors">
<div class="col-md-2">
<div class="form-group" id="div_district">
{{ Form::label('district',__('hmis_reports.district')) }}
<select class=" form-control compulsory" style="width:100%;" name="district" id="district"></select>
</div>
</div>
<div class="col-md-2">
<div class="form-group" id="div_county">
{{ Form::label('county',__('hmis_reports.county')) }}
<select class=" form-control compulsory" style="width:100%;" name="county" id="county"></select>
</div>
</div>
<div class="col-md-2">
<div class="form-group" id="div_subcounty">
{{ Form::label('sub_county',__('hmis_reports.subcounty')) }}
<select class=" form-control compulsory" style="width:100%;" name="sub_county" id="sub_county"></select>
</div>
</div>
<div class="col-md-2">
<div class="form-group" id="div_parish">
{{ Form::label('parish',__('hmis_reports.parish')) }}
<select class=" form-control compulsory" style="width:100%;" name="parish" id="parish"></select>
</div>
</div>
<div class="col-md-2">
<div class="form-group" id="div_village">
{{ Form::label('village',__('hmis_reports.village')) }}
<select class="form-control compulsory" style="width:100%;" name="village" id="village"></select>
</div>
</div>
</div>
<div class="row hide_for_doctors">
<div class="col">
<div class="form-group">
{{ Form::label('age',__('hmis_reports.age')) }}
{{ Form::select('age',$age,'',['class'=>'form-control', 'onclick' => 'checkAgeGroup(this.value)']) }}
</div>
</div>
<div class="col">
<div class="form-group">
{{ Form::label('gender',__('hmis_reports.gender')) }}
{{ Form::select('gender',['0' => __('hmis_reports.all'), '1' => __('hmis_reports.male'),'2' => __('hmis_reports.female')],0,['class'=>'form-control']) }}
</div>
</div>
<div class="col">
<div class="form-group">
{{ Form::label('in_out_patient',__('hmis_reports.inpatient_outpatient')) }}
{{ Form::select('in_out_patient',['0' => __('hmis_reports.all'), '1' => __('hmis_reports.inpatient'),'2' => __('hmis_reports.outpatient')],0,['class'=>'form-control']) }}
</div>
</div>
<div class="col">
<div class="form-group" id="patients_category_div">
{{ Form::label('patient_category',__('finance.select_patient_category')) }}
{{ Form::select('patient_category', $patient_categories,'',['class'=>'form-control compulsory', 'id' => 'patient_category']) }}
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group" id="custom_reg_field_div">
{{ Form::label('custom_reg_fields', __('patients.patient_registration_fields')) }}
{{ Form::select('custom_reg_fields', $custom_reg_fields, 0,['class'=>'form-control compulsory', 'id' => 'custom_reg_fields']) }}
</div>
</div>
<div class="col-md-6" id="custom_reg_field_options_div" style="display:none;">
<div class="form-group">
{{ Form::label('custom_reg_field_options', __('patients.patient_registration_field')) }}
{{ Form::select('custom_reg_field_options', $custom_reg_fields, 0,['class'=>'form-control compulsory', 'id' => 'custom_reg_field_options']) }}
</div>
</div>
</div>
<div class="row">
<div class="col-md-2 custom_age" style="display: none">
<div class="form-group">
{{ Form::label('first_age',__('hmis_reports.from_age')) }}
{{ Form::number('first_age','',['class' => 'form-control']) }}
</div>
</div>
<div class="col-md-2 custom_age" style="display: none">
<div class="form-group">
{{ Form::label('second_age',__('hmis_reports.to_age')) }}
{{ Form::number('second_age','',['class' => 'form-control']) }}
</div>
</div>
<div class="col-md-3">
<div class="form-group">
{{ Form::label('start_date',__('hmis_reports.start_date')) }}
<div class="input-group">
{{ Form::text('start_date','',['class' => 'form-control', 'required','readonly','id'=>'datepicker-from']) }}
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
{{ Form::label('end_date',__('hmis_reports.end_date')) }}
<div class="input-group">
{{ Form::text('end_date','',['class' => 'form-control', 'required','readonly','id'=>'datepicker-to']) }}
</div>
</div>
</div>
</div>
{{ Form::button(__('hmis_reports.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('hmis_reports.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
{{ Form::close() }}
</div>
</div>
</div>
@endsection
@push('scripts')
<!-- Data table javascript -->
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script type="text/javascript">
function checkAgeGroup(value){
if (value == -1){
$('.custom_age').show();
} else {
$('.custom_age').hide();
}
}
$(document).ready(function(){
// apply searchable dropdown
$('#diagnosis, #treatment, #lab_test, #symptoms, #patient_category').select2();
$('#district').select2({
placeholder: "<?php echo "Search by district name" ?>",
ajax: {
url: 'patient_residence/search_districts',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.name,
id: item.id
}
})
};
},
cache: true
}
});
$('#county').select2({
placeholder: "<?php echo "Search by county name" ?>",
ajax: {
url: 'patient_residence/search_counties',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.name + " (District: " + item.district_name + ")",
id: item.id
}
})
};
},
cache: true
}
});
$('#sub_county').select2({
placeholder: "<?php echo "Search by sub county name" ?>",
ajax: {
url: '/patient_residence/search_subcounties',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.name + " (County: " + item.county_name + ")",
id: item.id
}
})
};
},
cache: true
}
});
$('#parish').select2({
placeholder: "<?php echo "Search by parish name" ?>",
ajax: {
url: '/patient_residence/search_parishes',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.name + " (Sub-County: " + item.sub_county_name + ")",
id: item.id
}
})
};
},
cache: true
}
});
$('#village').select2({
placeholder: "<?php echo "Search by village name" ?>",
ajax: {
url: '/patient_residence/search_villages',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.name + " (Parish: " + item.parish_name + ")",
id: item.id
}
})
};
},
cache: true
}
});
$('.select2-selection.select2-selection--single').css('height','calc(3.85rem)');
$('.select2-selection.select2-selection--single').css('padding-top','5px');
$('.select2-selection__arrow').css('top','3px');
// hide the divs
$("#diagnosis_div").hide();
$("#treatments_div").hide();
$("#investigations_div").hide();
$("#symptoms_div").hide();
});
$('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy',
});
$("#report_category").change(function(){
if($(this).val() == 1){
//Diagnosis
$('.hide_for_doctors').show();
$("#diagnosis_div").show();
$("#treatments_div").hide();
$("#investigations_div").hide();
$("#symptoms_div").hide();
} else if($(this).val() == 2){
//Treatments
$('.hide_for_doctors').show();
$("#treatments_div").show();
$("#diagnosis_div").hide();
$("#investigations_div").hide();
$("#symptoms_div").hide();
} else if($(this).val() == 3){
//Investigations
$('.hide_for_doctors').show();
$("#investigations_div").show();
$("#diagnosis_div").hide();
$("#treatments_div").hide();
$("#symptoms_div").hide();
} else if($(this).val() == 4){
//Patient Visits
$('.hide_for_doctors').show();
$("#treatments_div").hide();
$("#investigations_div").hide();
$("#diagnosis_div").hide();
$("#symptoms_div").hide();
} else if($(this).val() == 5){
//Symptoms
$('.hide_for_doctors').show();
$("#symptoms_div").show();
$("#diagnosis_div").hide();
$("#treatments_div").hide();
$("#investigations_div").hide();
} else if($(this).val() == 6){
// Doctors
$('.hide_for_doctors').hide();
$("#treatments_div").hide();
$("#investigations_div").hide();
$("#diagnosis_div").hide();
$("#symptoms_div").hide();
}
});
$('#custom_reg_fields').change(function(){
if($('#custom_reg_fields').val() !== 0){
var field_id = $('#custom_reg_fields').val();
$.ajax({
type: "GET",
url: "/get_registration_field_options",
data: {id: field_id},
cache: false,
success: function (response) {
console.log(response);
if(response !== 'false') {
$('#custom_reg_field_options').html(response);
$('#custom_reg_field_options_div').show();
$('#custom_reg_field_options').select2({
placeholder: "- Select Options -",
});
}else {
if($('#custom_reg_field_options_div').is(":visible")) {
$('#custom_reg_field_options').val('');
$('#custom_reg_field_options_div').hide();
}
}
}
});
}else if($('#custom_reg_field_options_div').is(":visible")) {
$('#custom_reg_field_options').val('');
$('#custom_reg_field_options_div').hide();
}
});
</script>
@endpush
@@ -0,0 +1,212 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('hmis_reports.surgery_report') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
@if(URL::previous() == url("list_memorised_reports"))
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
@endif
<li class="active">{{ __('hmis_reports.surgery_report') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
<h3 class="heading" style="text-align: center; text-decoration: underline;">{{ __('hmis_reports.surgery_report') }}</h3>
<div class="row">
<div class="col-sm-2">
{{ Form::open(['url' => 'surgery_report','data-toggle'=>'validator']) }}
<div class="form-group" id="searchby">
{{ Form::label('search_by', __('hmis_reports.date')) }}
{{ Form::select('search_by', ['0'=>__('hmis_reports.today'),'1'=>__('hmis_reports.custom_date'),'2'=>__('hmis_reports.custom_range')], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-sm-2" style="display: none;" id="date_search">
<div class="form-group" id="reg_date" style="padding-top: 23px;">
<div class="input-group">
{{ Form::text('reg_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-autoclose']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-sm-2" style="display: none;" id="date_range_search">
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('start_date', __('hmis_reports.from')) }}
<div class="input-group">
{{ Form::text('start_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-1']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="reg_date">
{{ Form::label('end_date', __('hmis_reports.to')) }}
<div class="input-group">
{{ Form::text('end_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-2']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-3">
{{ Form::label('diagnosis',__('hmis_reports.diagnosis')) }}
{{ Form::select('diagnosis',$diagnoses, '',['class' => 'form-control','id' => 'diagnosis']) }}
</div>
<div class="col-sm-2">
{{ Form::label('surgical_operation',__('hmis_reports.surgical_operation')) }}
{{ Form::select('surgical_operation',$procedures,'',['class' => 'form-control', 'id' => 'surgical_operation']) }}
</div>
<div class="col-sm-3">
{{ Form::label('surgeon',__('hmis_reports.surgeon')) }}
{{ Form::select('surgeon',$all_users,'',['class' => 'form-control', 'id' => 'surgeon']) }}
</div>
<div class="col-sm-3">
{{ Form::label('assistant_surgeon',__('surgery.assistant_surgeon')) }}
{{ Form::select('assistant_surgeon',$all_users,'',['class' => 'form-control', 'id' => 'assistant_surgeon']) }}
</div>
<div class="col-sm-2"><br>
{{ Form::submit(__('hmis_reports.search'),['name' => 'filterBtn','class' => 'btn btn-success']) }}
{{ Form::close() }}
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('hmis_reports.number') }}</th>
<th>{{ __('hmis_reports.names') }}</th>
<th>{{ __('hmis_reports.diagnoses') }}</th>
<th style="display: none;">{{ __('hmis_reports.hidden_date') }}</th>
<th>{{ __('hmis_reports.date') }}</th>
<th>{{ __('hmis_reports.operation') }}</th>
<th>{{ __('hmis_reports.surgeon') }}</th>
<th>{{ __('surgery.assistant_surgeon') }}</th>
<th>{{ __('hmis_reports.theatre') }}</th>
<th>{{ __('hmis_reports.to') }}</th>
<th>{{ __('hmis_reports.wound') }}</th>
<th>{{ __('hmis_reports.outcome') }}</th>
<th>{{ __('hmis_reports.alert_comment_notes') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($surgery_records as $surgery)
<tr>
<td>{{ $surgery->number }}</td>
<td>{{ $surgery->first_name }} {{ $surgery->last_name }}</td>
<td>{{ $diagnoses[$surgery->primary_diagnosis] ?? "" }}</td>
<td style="display: none;">{{ $surgery->date_surgery_completed }}</td>
<td>{{ !is_null($surgery->date_surgery_completed) ? streamline_date($surgery->date_surgery_completed) : "" }}</td>
<td>{{ $procedures[$surgery->procedure_id] ?? "" }}</td>
<td>{{ $all_users[$surgery->surgeon] ?? "" }}</td>
<td>{{ $all_users[$surgery->assistant_surgeon] ?? "" }}</td>
<td>{{ $theatre_locations[$surgery->theatre_location] ?? "" }}</td>
<td></td>
<td></td>
<td>
{{ get_name($surgery->outcome, 'id', 'name', 'outcomes') }}
</td>
<td>
{!! read_more($surgery->comments, 'comments_short' . $surgery->id, 'comments_long' . $surgery->id) !!}
<div id="comments_long{{ $surgery->id }}" style="display: none;">
{!! $surgery->comments !!}<br/>
<a class="read_more" style="color : #0099CC;" onclick= "hide('comments_long{{ $surgery->id }}');show('comments_short{{ $surgery->id }}');">{{ __('patient_episode.read_less') }}</a>
</div>
</td>
<td><a href="/theatre_surgery/details/{{$surgery->id}}" class="btn btn-sm btn-info">{{ __('hmis_reports.view_details') }}</a></td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
order: [[ 3, "desc" ]],
columnDefs : [{"targets":3, "type":"date-eu"}],
pageLength: 100,
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
$('#surgeon,#surgical_operation,#diagnosis,#assistant_surgeon').select2({
placeholder: "-- select --"
});
$('#search_by').change(function () {
if ($(this).val() == 1) {
$('#date_search').show();
$('#date_range_search').hide();
}
else if ($(this).val() == 2) {
$('#date_range_search').show();
$('#date_search').hide();
}
else {
$('#date_search,#date_range_search').hide();
}
});
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
autoclose: true,
todayHighlight: true,
orientation: "bottom",
format: 'dd/mm/yyyy'
});
function show(id) {
$('#' + id).show();
}
function hide(id) {
$('#' + id).hide();
}
</script>
@endpush
@@ -0,0 +1,111 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-6">
<h4 class="page-title">Symptoms report details</h4>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="/reports">{{ __('hmis_reports.streamline_reports') }}</a></li>
<li class="active">Symptoms report details</li>
</ol>
</div>
</div>
<div class="white-box">
<h3>Symptom: {{ get_name($symptom_id, 'id', 'name', 'symptoms') }}</h3>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('hmis_reports.patient_number') }}</th>
<th>{{ __('hmis_reports.full_names') }}</th>
<th>{{ __('hmis_reports.gender') }}</th>
<th>{{ __('hmis_reports.age') }}</th>
<th>{{ __('hmis_reports.next_of_kin') }}</th>
<th>{{ __('hmis_reports.custom_field') }}</th>
<th>{{ __('hmis_reports.date') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($symptoms as $symptom)
<tr>
<td>{{ $symptom->number }}</td>
<td>{!! insurance_flag($symptom->patient_id) !!} ({{ $symptom->phone }})</td>
<td>{{ $symptom->gender == 1 ? __('hmis_reports.male') : __('hmis_reports.female') }}</td>
<td>{{ get_patients_age($symptom->date_of_birth) }}</td>
<td>{{ $symptom->next_of_kin }} ({{ $symptom->phone_of_next_of_kin }})</td>
<td>{{ $custom_field?? '' }}</td>
<td>{{ streamline_date_time($symptom->created_at) }}</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $symptom->patient_id }}" class="btn btn-rounded btn-sm btn-success" target="_blank"><i class="fa fa-hand-pointer-o"></i> {{ __('hmis_reports.select') }}</a>
</td>
<td><a href="/patients/{{ $symptom->patient_id }}/" class="btn btn-rounded btn-info btn-sm" target="_blank"><i class="fa fa-info-circle"></i> {{ __('patients.details') }}</a></td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 15,
aaSorting: [],
columnDefs: [{
targets: [4,5,7,8], /* column index */
orderable: false, /* true or false */
}],
buttons: [
{
extend: 'copy',
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5 ]
}
},
{
extend: 'csv',
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5 ]
}
},
{
extend: 'pdf',
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5 ]
}
},
{
extend: 'print',
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5 ]
}
}
],
});
</script>
@endpush
@@ -0,0 +1,98 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@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">Symptoms report</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="/reports">{{ __('hmis_reports.streamline_reports') }}</a></li>
<li class="active">Symptoms report</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="white-box">
<p>{{ __('hmis_reports.search_criteria') }} : <code>{{ $criteria }}</code> &nbsp;&nbsp;&nbsp;<a href="/reports">{{ __('hmis_reports.clear_search') }}</a></p>
{{-- <div class="table-responsive"> --}}
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('hmis_reports.symptom_name') }}</th>
<th>{{ __('hmis_reports.test_performed') }}</th>
</tr>
</thead>
<tbody>
@php $total = 0; @endphp
@for($i = 0; $i < count($symptoms_id_array); $i++)
@php $total += $values_array[$i]; @endphp
<tr>
<td>{{ ucfirst(get_name($symptoms_id_array[$i], 'id', 'name', 'symptoms')) }}</td>
<td>
<a href="/streamline_reports/symptoms_drill_down/{{ $symptoms_id_array[$i] }}" target="_blank">{{ $values_array[$i] }}</a>
</td>
</tr>
@endfor
<tr>
<td><b>{{ __('hmis_reports.totals') }}</b></td>
<td>{{ $total }}</td>
</tr>
</tbody>
</table>
{{-- </div> --}}
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
pageLength:20,
buttons: [
{
extend: 'copy',
title: 'Symptoms report'
},
{
extend: 'csv',
title: 'Symptoms report'
},
{
extend: 'excel',
title: 'Symptoms report'
},
{
extend: 'pdf',
title: 'Symptoms report'
}
]
// "aoColumnDefs": [{
// "aTargets": [2,3],
// "defaultContent": "",
// }]
});
</script>
@endpush
@@ -0,0 +1,856 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-6">
<h4 class="page-title">{{ __('hmis_reports.tb_screening_report') }}</h4>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
<li class="active">{{ __('hmis_reports.tb_screening_report') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
{{ Form::open(['route' => 'streamline_reports.tb_screening_report' , 'data-toggle' => 'validator']) }}
<div class="row">
<div class="col-md-3">
<div class="form-group" id="searchby">
{{ Form::label('search_by', __('patient_flow_monitoring.date')) }}
{{ Form::select('search_by', ['0'=>'Last 24 hours', '4'=>'TODAY', '3'=>'YESTERDAY', '1'=>'Custom Date', '2'=>'Custom Range'], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-3" style="display: none;" id="date_search">
<div class="form-group" id="custom_date" style="padding-top: 23px;">
<div class="input-group">
{{ Form::text('custom_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-autoclose']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-4" style="display: none;" id="date_range_search">
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('start_date', __('patient_flow_monitoring.from')) }}
<div class="input-group">
{{ Form::text('start_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-1']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="custom_date">
{{ Form::label('end_date', __('patient_flow_monitoring.to')) }}
<div class="input-group">
{{ Form::text('end_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-2']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-2">
<br>
{{ Form::button(__('hmis_reports.search'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
</div>
</div>
{{ Form::close() }}
<div class="row">
<div class="col-sm-12">
<div class="float-right">
<a class="btn btn-inverse" style="background-color: #03C03C; color: white" href="#" onclick="print_div('table')"><i class="fa fa-print"></i> {{ __('hmis_reports.print') }}</a>
<a href="#" onclick="export_to_excel();" title="Download {{ __('hmis_reports.tb_screening_report') }} CSV" class="btn btn-inverse waves-effect waves-light"><span class="glyphicon glyphicon-download"></span> Download CSV</a>
</div>
</div>
</div>
<hr>
{{-- fetched data here --}}
<div class="row">
<div class="col" id="table">
<table class="table table-sm table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th rowspan="2"><strong>TB Screening at OPD</strong></th>
<th colspan="2" width="15%"><strong> < 5 years</strong></th>
<th colspan="2" width="17%"><strong> 6 - 9 years</strong></th>
<th colspan="2" width="15%"><strong> 10 - 14 Years</strong></th>
<th colspan="2" width="15%"><strong> 15 - 19 Years</strong></th>
<th colspan="2" width="17%"><strong> 20+ Years </strong></th>
</tr>
<tr>
<th>M</th>
<th>F</th>
<th>M</th>
<th>F</th>
<th>M</th>
<th>F</th>
<th>M</th>
<th>F</th>
<th>M</th>
<th>F</th>
</tr>
</thead>
<tbody>
<tr>
<td>
TP01. Number screened for TB in OPD
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_triage']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $below_5_males_screened_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($below_5_males_screened_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_triage']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $below_5_females_screened_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($below_5_females_screened_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_triage']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_5_and_9_males_screened_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_5_and_9_males_screened_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_triage']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_5_and_9_females_screened_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_5_and_9_females_screened_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_triage']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_10_and_14_males_screened_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_10_and_14_males_screened_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_triage']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_10_and_14_females_screened_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_10_and_14_females_screened_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_triage']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_15_and_19_males_screened_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_15_and_19_males_screened_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_triage']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_15_and_19_females_screened_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_15_and_19_females_screened_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_triage']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $above_19_males_screened_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($above_19_males_screened_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_triage']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $above_19_females_screened_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($above_19_females_screened_array) }}
</button>
{{ Form::close() }}
</td>
</tr>
<tr>
<td>TP02. Number of presumptive TB cases identified from OPD
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_triage_presumptives']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $below_5_males_presumptives_identified_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($below_5_males_presumptives_identified_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_triage_presumptives']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $below_5_females_presumptives_identified_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($below_5_females_presumptives_identified_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_triage_presumptives']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_5_and_9_males_presumptives_identified_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_5_and_9_males_presumptives_identified_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_triage_presumptives']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_5_and_9_females_presumptives_identified_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_5_and_9_females_presumptives_identified_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_triage_presumptives']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_10_and_14_males_presumptives_identified_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_10_and_14_males_presumptives_identified_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_triage_presumptives']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_10_and_14_females_presumptives_identified_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_10_and_14_females_presumptives_identified_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_triage_presumptives']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_15_and_19_males_presumptives_identified_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_15_and_19_males_presumptives_identified_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_triage_presumptives']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_15_and_19_females_presumptives_identified_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_15_and_19_females_presumptives_identified_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_triage_presumptives']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $above_19_males_presumptives_identified_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($above_19_males_presumptives_identified_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_triage_presumptives']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $above_19_females_presumptives_identified_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($above_19_females_presumptives_identified_array) }}
</button>
{{ Form::close() }}
</td>
</tr>
<tr>
<td>TP03. Number of presumptive cases diagnosed with TB from OPD
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $below_5_males_presumptives_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($below_5_males_presumptives_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $below_5_females_presumptives_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($below_5_females_presumptives_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_5_and_9_males_presumptives_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_5_and_9_males_presumptives_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_5_and_9_females_presumptives_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_5_and_9_females_presumptives_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_10_and_14_males_presumptives_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_10_and_14_males_presumptives_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_10_and_14_females_presumptives_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_10_and_14_females_presumptives_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_15_and_19_males_presumptives_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_15_and_19_males_presumptives_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_15_and_19_females_presumptives_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_15_and_19_females_presumptives_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $above_19_males_presumptives_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($above_19_males_presumptives_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $above_19_females_presumptives_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($above_19_females_presumptives_array) }}
</button>
{{ Form::close() }}
</td>
</tr>
<tr></tr>
<tr>
<td>Number of Possible TB from OPD
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $below_5_males_possible_TB_at_OPD_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($below_5_males_possible_TB_at_OPD_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $below_5_females_possible_TB_at_OPD_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($below_5_females_possible_TB_at_OPD_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_5_and_9_males_possible_TB_at_OPD_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_5_and_9_males_possible_TB_at_OPD_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_5_and_9_females_possible_TB_at_OPD_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_5_and_9_females_possible_TB_at_OPD_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_10_and_14_males_possible_TB_at_OPD_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_10_and_14_males_possible_TB_at_OPD_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_10_and_14_females_possible_TB_at_OPD_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_10_and_14_females_possible_TB_at_OPD_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_15_and_19_males_possible_TB_at_OPD_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_15_and_19_males_possible_TB_at_OPD_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_15_and_19_females_possible_TB_at_OPD_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_15_and_19_females_possible_TB_at_OPD_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $above_19_males_possible_TB_at_OPD_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($above_19_males_possible_TB_at_OPD_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'OPD') }}
{{ Form::hidden('record_ids', implode(",", $above_19_females_possible_TB_at_OPD_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($above_19_females_possible_TB_at_OPD_array) }}
</button>
{{ Form::close() }}
</td>
</tr>
</tbody>
</table>
<table class="table table-sm table-bordered">
<thead>
<tr style="background-color: #e8e4e4">
<th rowspan="2"><strong>TB Screening at IPD</strong></th>
<th colspan="2" width="15%"><strong> < 5 years</strong></th>
<th colspan="2" width="17%"><strong> 6 - 9 years</strong></th>
<th colspan="2" width="15%"><strong> 10 - 14 Years</strong></th>
<th colspan="2" width="15%"><strong> 15 - 19 Years</strong></th>
<th colspan="2" width="17%"><strong> 20+ Years </strong></th>
</tr>
<tr>
<th>M</th>
<th>F</th>
<th>M</th>
<th>F</th>
<th>M</th>
<th>F</th>
<th>M</th>
<th>F</th>
<th>M</th>
<th>F</th>
</tr>
</thead>
<tbody>
<tr>
<td>
TP01. Number screened for TB in IPD
</td>
<td>
0
</td>
<td>
0
</td>
<td>
0
</td>
<td>
0
</td>
<td>
0
</td>
<td>
0
</td>
<td>
0
</td>
<td>
0
</td>
<td>
0
</td>
<td>
0
</td>
</tr>
<tr>
<td>TP02. Number of presumptive TB cases identified from IPD
</td>
<td>
0
</td>
<td>
0
</td>
<td>
0
</td>
<td>
0
</td>
<td>
0
</td>
<td>
0
</td>
<td>
0
</td>
<td>
0
</td>
<td>
0
</td>
<td>
0
</td>
</tr>
<tr>
<td>TP03. Number of presumptive cases diagnosed with TB from IPD
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'IPD') }}
{{ Form::hidden('record_ids', implode(",", $below_5_males_inpatient_presumptives_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($below_5_males_inpatient_presumptives_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'IPD') }}
{{ Form::hidden('record_ids', implode(",", $below_5_females_inpatient_presumptives_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($below_5_females_inpatient_presumptives_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'IPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_5_and_9_males_inpatient_presumptives_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_5_and_9_males_inpatient_presumptives_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'IPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_5_and_9_females_inpatient_presumptives_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_5_and_9_females_inpatient_presumptives_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'IPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_10_and_14_males_inpatient_presumptives_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_10_and_14_males_inpatient_presumptives_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'IPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_10_and_14_females_inpatient_presumptives_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_10_and_14_females_inpatient_presumptives_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'IPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_15_and_19_males_inpatient_presumptives_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_15_and_19_males_inpatient_presumptives_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'IPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_15_and_19_females_inpatient_presumptives_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_15_and_19_females_inpatient_presumptives_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'IPD') }}
{{ Form::hidden('record_ids', implode(",", $above_19_males_inpatient_presumptives_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($above_19_males_inpatient_presumptives_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'IPD') }}
{{ Form::hidden('record_ids', implode(",", $above_19_females_inpatient_presumptives_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($above_19_females_inpatient_presumptives_array) }}
</button>
{{ Form::close() }}
</td>
</tr>
<tr>
<td>Number of Possible TB from IPD
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'IPD') }}
{{ Form::hidden('record_ids', implode(",", $below_5_males_possible_TB_at_IPD_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($below_5_males_possible_TB_at_IPD_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'IPD') }}
{{ Form::hidden('record_ids', implode(",", $below_5_females_possible_TB_at_IPD_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($below_5_females_possible_TB_at_IPD_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'IPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_5_and_9_males_possible_TB_at_IPD_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_5_and_9_males_possible_TB_at_IPD_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'IPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_5_and_9_females_possible_TB_at_IPD_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_5_and_9_females_possible_TB_at_IPD_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'IPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_10_and_14_males_possible_TB_at_IPD_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_10_and_14_males_possible_TB_at_IPD_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'IPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_10_and_14_females_possible_TB_at_IPD_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_10_and_14_females_possible_TB_at_IPD_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'IPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_15_and_19_males_possible_TB_at_IPD_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_15_and_19_males_possible_TB_at_IPD_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'IPD') }}
{{ Form::hidden('record_ids', implode(",", $btn_15_and_19_females_possible_TB_at_IPD_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($btn_15_and_19_females_possible_TB_at_IPD_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'IPD') }}
{{ Form::hidden('record_ids', implode(",", $above_19_males_possible_TB_at_IPD_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($above_19_males_possible_TB_at_IPD_array) }}
</button>
{{ Form::close() }}
</td>
<td>
{{ Form::open(['route' => 'streamline_reports.tb_screening_report_presumptive']) }}
{{ Form::hidden('section', 'IPD') }}
{{ Form::hidden('record_ids', implode(",", $above_19_females_possible_TB_at_IPD_array)) }}
<button class="btn btn-link" role="link" type="submit" name="op">
{{ count($above_19_females_possible_TB_at_IPD_array) }}
</button>
{{ Form::close() }}
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.colVis.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/sheetjs/xlsx.full.min.js') }}"></script>
<script src="{{ asset('js/streamline_functions.js') }}"></script>
<script type="text/javascript">
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#search_by').change(function () {
if ($(this).val() == 1) {
$('#date_search').show();
$('#date_range_search').hide();
}
else if ($(this).val() == 2) {
$('#date_range_search').show();
$('#date_search').hide();
}
else {
$('#date_search,#date_range_search').hide();
}
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
orientation: 'bottom',
format: 'dd-mm-yyyy'
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
orientation: 'bottom',
format: 'dd-mm-yyyy'
});
// $('.table').DataTable({
// dom: 'Bfrtip',
// pageLength: 50,
// buttons: [
// { extend: 'excel',
// message: 'TB Screening Report',
// sheetName: 'TB Screening Report'
// },
// { extend: 'pdf',
// message: 'TB Screening Report',
// sheetName: 'TB Screening Report'
// },
// { extend: 'print',
// message: 'TB Screening Report',
// sheetName: 'TB Screening Report'
// }
// ]
// });
function export_to_excel(type, fn, dl) {
var elt = document.getElementById('table');
var wb = XLSX.utils.table_to_book(elt, { sheet: "TB Screening Report", raw:true });
return dl ?
XLSX.write(wb, { bookType: type, bookSST: true, type: 'binary' }):
XLSX.writeFile(wb, fn || ('{{ __('hmis_reports.tb_screening_report') }}.' + (type || 'xlsx')));
}
</script>
@endpush
@@ -0,0 +1,180 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-6">
<h4 class="page-title">{{ __('hmis_reports.tb_screening_report_details') }}</h4>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
<li><a href="{{ url('tb_screening_report') }}">{{ __('hmis_reports.tb_screening_report') }}</a></li>
<li class="active">{{ __('hmis_reports.tb_screening_report_details') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
{{-- fetched data here --}}
<div class="row">
<div class="col">
<table class="table table-sm table-hover color-table success-table table-bordered">
<thead>
<tr>
<th>#</th>
<th><strong>Patient Name</strong></th>
<th><strong>Patient Age</strong></th>
<th><strong>Assessed On</strong></th>
<th><strong>TB outcome</strong></th>
<th></th>
</tr>
</thead>
<tbody>
@if ($section == "OPD")
@for ($i = 0; $i < count($record_ids); $i++)
@php
$consultation = \Streamline\Models\Consultation::withTrashed()->find($record_ids[$i]);
@endphp
<tr>
<td>{{ $i + 1}}</td>
<td>
<a href="patients/{{ $consultation->patient_id}}" target="_blank"> {{ get_full_name($consultation->patient_id, "id", "first_name", "last_name", "patients") }} ({{ get_name($consultation->patient_id, "id", "number", "patients")}}) </a>
</td>
<td>
@php
$patient = \Streamline\Models\Patient::withTrashed()->find($consultation->patient_id);
$age = get_patients_age($patient->date_of_birth);
@endphp
{{ $age }}
</td>
<td>
{{ streamline_date($consultation->created_at) }} from episode started on {{ streamline_date(get_name($consultation->episode_id, "id", "created_at", "patient_episodes")) }}
</td>
<td>
@if ($consultation->tb_status_assessment == 1)
Definite TB
@elseif($consultation->tb_status_assessment == 2)
Possible TB
@endif
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $consultation->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>
@endfor
@elseif ($section == "IPD")
@for ($i = 0; $i < count($record_ids); $i++)
@php
$inpatient_info = \Streamline\Models\InpatientInfo::find($record_ids[$i]);
@endphp
<tr>
<td>{{ $i + 1}}</td>
<td>
<a href="patients/{{ $inpatient_info->patient_id}}" target="_blank">{{ get_full_name($inpatient_info->patient_id, "id", "first_name", "last_name", "patients") }} ({{ get_name($inpatient_info->patient_id, "id", "number", "patients")}})</a>
</td>
<td>
@php
$patient = \Streamline\Models\Patient::withTrashed()->find($inpatient_info->patient_id);
$age = get_patients_age($patient->date_of_birth);
@endphp
{{ $age }}
</td>
<td>
{{ streamline_date($inpatient_info->created_at) }} from episode started on {{ streamline_date(get_name($inpatient_info->episode_id, "id", "created_at", "patient_episodes")) }}
</td>
<td>
@if ($inpatient_info->tb_status_assessment == 1)
Definite TB
@elseif($inpatient_info->tb_status_assessment == 2)
Possible TB
@endif
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $inpatient_info->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>
@endfor
@endif
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.colVis.min.js') }}"></script>
<script type="text/javascript">
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#search_by').change(function () {
if ($(this).val() == 1) {
$('#date_search').show();
$('#date_range_search').hide();
}
else if ($(this).val() == 2) {
$('#date_range_search').show();
$('#date_search').hide();
}
else {
$('#date_search,#date_range_search').hide();
}
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
orientation: 'bottom',
format: 'dd-mm-yyyy'
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
orientation: 'bottom',
format: 'dd-mm-yyyy'
});
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 50,
buttons: [
{ extend: 'excel',
message: 'TB Screening Report',
sheetName: 'TB Screening Report'
},
{ extend: 'pdf',
message: 'TB Screening Report',
sheetName: 'TB Screening Report'
},
{ extend: 'print',
message: 'TB Screening Report',
sheetName: 'TB Screening Report'
}
]
});
</script>
@endpush
@@ -0,0 +1,180 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-6">
<h4 class="page-title">{{ __('hmis_reports.tb_screening_report_details') }}</h4>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
<li><a href="{{ url('tb_screening_report') }}">{{ __('hmis_reports.tb_screening_report') }}</a></li>
<li class="active">{{ __('hmis_reports.tb_screening_report_details') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
{{-- fetched data here --}}
<div class="row">
<div class="col">
<table class="table table-sm table-hover color-table success-table table-bordered">
<thead>
<tr>
<th>#</th>
<th><strong>Patient Name</strong></th>
<th><strong>Patient Age</strong></th>
<th><strong>Assessed On</strong></th>
<th><strong>TB outcome</strong></th>
<th></th>
</tr>
</thead>
<tbody>
@if ($section == "OPD")
@for ($i = 0; $i < count($record_ids); $i++)
@php
$triage = \Streamline\Models\Triage::withTrashed()->find($record_ids[$i]);
@endphp
<tr>
<td>{{ $i + 1}}</td>
<td>
<a href="patients/{{ $triage->patient_id}}" target="_blank"> {{ get_full_name($triage->patient_id, "id", "first_name", "last_name", "patients") }} ({{ get_name($triage->patient_id, "id", "number", "patients")}}) </a>
</td>
<td>
@php
$patient = \Streamline\Models\Patient::withTrashed()->find($triage->patient_id);
$age = get_patients_age($patient->date_of_birth);
@endphp
{{ $age }}
</td>
<td>
{{ streamline_date($triage->created_at) }} from episode started on {{ streamline_date(get_name($triage->episode_id, "id", "created_at", "patient_episodes")) }}
</td>
<td>
@if ($triage->any_tb_sysmptoms == 0)
No TB Signs
@elseif($triage->any_tb_sysmptoms == 1)
TB Signs
@endif
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $triage->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>
@endfor
@elseif ($section == "IPD")
@for ($i = 0; $i < count($record_ids); $i++)
@php
$triage = \Streamline\Models\Triage::find($record_ids[$i]);
@endphp
<tr>
<td>{{ $i + 1}}</td>
<td>
<a href="patients/{{ $triage->patient_id}}" target="_blank">{{ get_full_name($triage->patient_id, "id", "first_name", "last_name", "patients") }} ({{ get_name($triage->patient_id, "id", "number", "patients")}})</a>
</td>
<td>
@php
$patient = \Streamline\Models\Patient::withTrashed()->find($triage->patient_id);
$age = get_patients_age($patient->date_of_birth);
@endphp
{{ $age }}
</td>
<td>
{{ streamline_date($triage->created_at) }} from episode started on {{ streamline_date(get_name($triage->episode_id, "id", "created_at", "patient_episodes")) }}
</td>
<td>
@if ($triage->any_tb_sysmptoms == 0)
No TB Signs
@elseif($triage->any_tb_sysmptoms == 1)
Has TB Signs
@endif
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $triage->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>
@endfor
@endif
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.colVis.min.js') }}"></script>
<script type="text/javascript">
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#search_by').change(function () {
if ($(this).val() == 1) {
$('#date_search').show();
$('#date_range_search').hide();
}
else if ($(this).val() == 2) {
$('#date_range_search').show();
$('#date_search').hide();
}
else {
$('#date_search,#date_range_search').hide();
}
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
orientation: 'bottom',
format: 'dd-mm-yyyy'
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
orientation: 'bottom',
format: 'dd-mm-yyyy'
});
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 50,
buttons: [
{ extend: 'excel',
message: 'TB Screening Report',
sheetName: 'TB Screening Report'
},
{ extend: 'pdf',
message: 'TB Screening Report',
sheetName: 'TB Screening Report'
},
{ extend: 'print',
message: 'TB Screening Report',
sheetName: 'TB Screening Report'
}
]
});
</script>
@endpush
@@ -0,0 +1,205 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-6">
<h4 class="page-title">{{ __('hmis_reports.tb_screening_report_details') }}</h4>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="{{ url('list_memorised_reports') }}">{{ __('hmis_reports.memorised_reports') }}</a></li>
<li><a href="{{ url('tb_screening_report') }}">{{ __('hmis_reports.tb_screening_report') }}</a></li>
<li class="active">{{ __('hmis_reports.tb_screening_report_details') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
{{-- fetched data here --}}
<div class="row">
<div class="col">
<table class="table table-sm table-hover color-table success-table table-bordered">
<thead>
<tr>
<th>#</th>
<th><strong>Patient Name</strong></th>
<th><strong>Patient Age</strong></th>
<th><strong>Assessed On</strong></th>
<th><strong>TB outcome</strong></th>
<th></th>
</tr>
</thead>
<tbody>
@if ($section == "OPD")
@for ($i = 0; $i < count($record_ids); $i++)
@php
$triage = \Streamline\Models\Triage::withTrashed()->find($record_ids[$i]);
@endphp
<tr>
<td>{{ $i + 1}}</td>
<td>
<a href="patients/{{ $triage->patient_id}}" target="_blank"> {{ get_full_name($triage->patient_id, "id", "first_name", "last_name", "patients") }} ({{ get_name($triage->patient_id, "id", "number", "patients")}}) </a>
</td>
<td>
@php
$patient = \Streamline\Models\Patient::withTrashed()->find($triage->patient_id);
$age = get_patients_age($patient->date_of_birth);
@endphp
{{ $age }}
</td>
<td>
{{ streamline_date($triage->created_at) }} from episode started on {{ streamline_date(get_name($triage->episode_id, "id", "created_at", "patient_episodes")) }}
</td>
<td>
@if ($triage->cough_for_2_weeks == 1)
<li>
A cough for more than two weeks
</li>
@endif
@if($triage->fever_for_2_weeks == 1)
<li>
Persistent fevers for 2 weeks or more
</li>
@endif
@if($triage->tb_weight_loss == 1)
<li>
Noticeable weight loss of more than 3 Kg
</li>
@endif
@if($triage->tb_poor_weight_gain == 1)
<li>
Poor weight gain in the last one month
</li>
@endif
@if($triage->tb_excessive_night_sweats == 1)
<li>
Excessive night sweats for three weeks or more
</li>
@endif
@if($triage->tb_contact_with_tb_person == 1)
<li>
Contact with a person with pulmonary TB or chronic cough
</li>
@endif
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $triage->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>
@endfor
@elseif ($section == "IPD")
@for ($i = 0; $i < count($record_ids); $i++)
@php
$triage = \Streamline\Models\Triage::find($record_ids[$i]);
@endphp
<tr>
<td>{{ $i + 1}}</td>
<td>
<a href="patients/{{ $triage->patient_id}}" target="_blank">{{ get_full_name($triage->patient_id, "id", "first_name", "last_name", "patients") }} ({{ get_name($triage->patient_id, "id", "number", "patients")}})</a>
</td>
<td>
@php
$patient = \Streamline\Models\Patient::withTrashed()->find($triage->patient_id);
$age = get_patients_age($patient->date_of_birth);
@endphp
{{ $age }}
</td>
<td>
{{ streamline_date($triage->created_at) }} from episode started on {{ streamline_date(get_name($triage->episode_id, "id", "created_at", "patient_episodes")) }}
</td>
<td>
@if ($triage->any_tb_sysmptoms == 0)
No TB Signs
@elseif($triage->any_tb_sysmptoms == 1)
Has TB Signs
@endif
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $triage->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>
@endfor
@endif
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.colVis.min.js') }}"></script>
<script type="text/javascript">
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy'
});
$('#search_by').change(function () {
if ($(this).val() == 1) {
$('#date_search').show();
$('#date_range_search').hide();
}
else if ($(this).val() == 2) {
$('#date_range_search').show();
$('#date_search').hide();
}
else {
$('#date_search,#date_range_search').hide();
}
});
$('#start_date').datepicker({
autoclose: true,
todayHighlight: true,
orientation: 'bottom',
format: 'dd-mm-yyyy'
});
$('#end_date').datepicker({
autoclose: true,
todayHighlight: true,
orientation: 'bottom',
format: 'dd-mm-yyyy'
});
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 50,
buttons: [
{ extend: 'excel',
message: 'TB Screening Report',
sheetName: 'TB Screening Report'
},
{ extend: 'pdf',
message: 'TB Screening Report',
sheetName: 'TB Screening Report'
},
{ extend: 'print',
message: 'TB Screening Report',
sheetName: 'TB Screening Report'
}
]
});
</script>
@endpush
@@ -0,0 +1,77 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@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">{{ __('hmis_reports.treatment_report') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="/reports">{{ __('hmis_reports.streamline_reports') }}</a></li>
<li class="active">{{ __('hmis_reports.treatment_report') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="white-box">
<p>{{ __('hmis_reports.search_criteria') }} : <code>{{ $criteria }}</code> &nbsp;&nbsp;&nbsp;<a href="/reports">{{ __('hmis_reports.clear_search') }}</a></p>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('hmis_reports.drug_name') }}</th>
<th>{{ __('hmis_reports.quantity_dispensed') }}</th>
</tr>
</thead>
<tbody>
@for($i = 0; $i < count($drugs_array); $i++)
<tr>
<td>{{ get_name($drugs_array[$i], 'id', 'name', 'drugs') }}</td>
<td>
<a href="/streamline_reports/treatments_drill_down/{{ $drugs_array[$i] }}">{{ $dispensed_array[$i] }}</a>
</td>
</tr>
@endfor
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
],
"aoColumnDefs": [{
"aTargets": [2,3],
"defaultContent": "",
}]
});
</script>
@endpush
@@ -0,0 +1,132 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-md-6">
<h4 class="page-title">{{ __('hmis_reports.treatment_report_details') }}</h4>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('hmis_reports.dashboard') }}</a></li>
<li><a href="/reports">{{ __('hmis_reports.streamline_reports') }}</a></li>
<li class="active">{{ __('hmis_reports.treatment_report_details') }}</li>
</ol>
</div>
</div>
<div class="white-box">
<h3>Drug: {{ get_name($drug_id, 'id', 'name', 'drugs') }}</h3>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('hmis_reports.quantity_dispensed') }}</th>
<th>{{ __('hmis_reports.patient_number') }}</th>
<th>{{ __('hmis_reports.full_names') }}</th>
<th>{{ __('hmis_reports.gender') }}</th>
<th>{{ __('hmis_reports.age') }}</th>
<th>{{ __('hmis_reports.next_of_kin') }}</th>
<th>{{ __('hmis_reports.custom_field') }}</th>
<th>{{ __('hmis_reports.date') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@for($i = 0; $i < count($dispensed_array); $i++)
@php $patient = \Illuminate\Support\Facades\DB::table('patients')->where('id', $patient_id_array[$i])->first(); @endphp
<tr>
<td>
{{ $dispensed_array[$i] }}
</td>
<td>
{{ $patient_number_array[$i] }}
</td>
<td>
{!! insurance_flag($patient_id_array[$i]) !!} ({{ $patient->phone }})
</td>
<td>
{{ $patient->gender == 1 ? __('hmis_reports.male') : __('hmis_reports.female') }}
</td>
<td>
{{ get_patients_age($patient->date_of_birth) }}
</td>
<td>{{ $patient->next_of_kin }} ({{ $patient->phone_of_next_of_kin }})</td>
<td>{{ $custom_field?? '' }}</td>
<td>
{{ streamline_date_time($date_array[$i]) }}
</td>
<td>
<a href="/patient_episodes/set_patient_id/{{ $patient_id_array[$i] }}" class="btn btn-success btn-rounded btn-sm"><i class="fa fa-hand-pointer-o"></i> {{ __('hmis_reports.select') }}</a>
</td>
<td><a href="/patients/{{ $patient_id_array[$i] }}/" class="btn btn-rounded btn-info btn-sm" target="_blank"><i class="fa fa-info-circle"></i> {{ __('patients.details') }}</a></td>
</tr>
@endfor
</tbody>
</table>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 100,
aaSorting: [],
columnDefs: [{
targets: [5,6,8,9], /* column index */
orderable: false, /* true or false */
}],
buttons: [
{
extend: 'copy',
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5, 6 ]
}
},
{
extend: 'csv',
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5, 6 ]
}
},
{
extend: 'csv',
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5, 6 ]
}
},
{
extend: 'pdf',
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5, 6 ]
}
},
{
extend: 'print',
exportOptions: {
columns: [ 0, 1, 2, 3, 4, 5, 6 ]
}
}
],
});
</script>
@endpush

Some files were not shown because too many files have changed in this diff Show More