@extends('layouts.master') @section('title', 'Patient record') @php $db_settings = \App\Models\Setting::get(); $settings = []; foreach ($db_settings as $row) { $settings[$row->name] = $row->value; } @endphp @section('content')
{{-- --}}
{{-- {{ Form::close() }} --}}
@if (isset($patient))
@if (isset($settings['icon']) && is_file('storage/settings/' . $settings['icon']))
ICON
@endif

{{ $settings['website_name'] ?? '' }}

{{ $settings['address'] ?? '' }}
{{ $settings['number_1'] ?? '' }}, {{ $settings['number_2'] ?? '' }}
@if (isset($settings['icon']) && is_file('storage/settings/' . $settings['icon']))
ICON
@endif

{{-- --}}
Patient Name : {{ $patient?->name }} Patient ID : {{ $patient?->patient_id }}
Gender : {{ $patient?->gender }} Age : {{ \Carbon\Carbon::parse($patient?->dob)->diff(now())->format('%y years') }}
Prescription date : {{ \Carbon\Carbon::parse($app?->date)->format('d M, Y') }} Prescription ID : {{ $app?->name }}
Start date : {{ \Carbon\Carbon::parse($filter['startDateRange'])->format('d M, Y') }} end date : {{ \Carbon\Carbon::parse($filter['endDateRange'])->format('d M, Y') }}
Patient record
@foreach ($appointments as $app)
Vital signs
@php $weight = $app?->VitalSings?->weight; $height = $app?->VitalSings?->height; $bmi = 0; $bmi_text = ''; if ($weight && $height) { if ($app?->VitalSings?->height_type == 'centimeter') { $height = $app?->VitalSings?->height / 100; } if ($app?->VitalSings?->weight_type == 'pounds') { $weight = $app?->VitalSings?->weight / 2.205; } $bmi = number_format($weight / ($height * $height), 2); $bmi = number_format($weight / ($height * $height), 2); if ($bmi < 16) { $bmi_text = 'Severe Thinness'; } elseif ($bmi > 16 && $bmi < 17) { $bmi_text = 'Moderate Thinness'; } elseif ($bmi > 17 && $bmi < 18.5) { $bmi_text = 'Mild Thinness'; } elseif ($bmi > 18.5 && $bmi < 25) { $bmi_text = 'Normal'; } elseif ($bmi > 25 && $bmi < 30) { $bmi_text = 'Overweight'; } elseif ($bmi > 30 && $bmi < 35) { $bmi_text = 'Obese Class 1'; } elseif ($bmi > 35 && $bmi < 40) { $bmi_text = 'Obese Class 11'; } elseif ($bmi > 40) { $bmi_text = 'Obese Class 111'; } } @endphp
Body Temperature: {{ $app?->VitalSings?->body_temperature }}
Oxygen concentration: {{ $app?->VitalSings?->oxygen_concentration }}
Heart Rate / Pulse: {{ $app?->VitalSings?->heart_rate }}
Blood Pressure: {{ $app?->VitalSings?->blood_pressure_systolic }}/{{ $app?->VitalSings?->blood_pressure_diastolic }} mmHg
Reflexes: {{ $app?->VitalSings?->VtReflexes?->name }}
Respiratory rate: {{ $app?->VitalSings?->respiratory_rate }}
Height: {{ $app?->VitalSings?->height }} {{ $app?->VitalSings?->height_type }}
Weight: {{ $app?->VitalSings?->weight }} {{ $app?->VitalSings?->weight_type }}
BMI: {{ $bmi }} {{ $bmi_text ? '(' . $bmi_text . ')' : '' }}
Consultation
{{ $app?->Consult?->chief_complaint }}
{{ $app?->Consult?->physical_examination }}
{{ $app?->Consult?->present_illness }}
{{ $app?->Consult?->past_medical_history }}
{{ $app?->Consult?->past_surgical_history }}
{{ $app?->Consult?->drug_history }}
{{ $app?->Consult?->social_history }}
{{ $app?->Consult?->family_history }}
{{ $app?->Consult?->differntial_diagnosis }}
{{--

Gynecological

--}} @if(isset($app?->Consult?->lmp))
{{ $app?->Consult?->lmp }}
@endif @if(isset($app?->Consult?->parity))
{{ $app?->Consult?->parity }}
@endif @if(isset($app?->Consult?->gravidity))
{{ $app?->Consult?->gravidity }}
@endif @if(isset($app?->Consult?->abortion))
{{ $app?->Consult?->abortion }}
@endif @if(isset($app?->Consult?->still_birth ))
{{ $app?->Consult?->still_birth }}
@endif @if(isset($app?->Consult?->alive_birth))
{{ $app?->Consult?->alive_birth }}
@endif @if(isset($app?->Consult?->ante_natal))
{{ $app?->Consult?->ante_natal }}
@endif @if(isset($app?->Consult?->natal))
{{ $app?->Consult?->natal }}
@endif @if(isset($app?->Consult?->post_natal))
{{ $app?->Consult?->post_natal }}
@endif @if(isset($app?->Consult?->developement_history))
{{ $app?->Consult?->developement_history }}
@endif @if(isset($app?->Consult?->developement_history))
{{ $app?->Consult?->nutritional_history }}
@endif @if(isset($app?->Consult?->vaccination_history))
{{ $app?->Consult?->vaccination_history }}
@endif @if(isset($app?->Consult?->head_circumference))
{{ $app?->Consult?->head_circumference }}
@endif @if(isset($app?->Consult?->mid_upper_circumference))
{{ $app?->Consult?->mid_upper_circumference }}
@endif
{{--

Visual Acuity

--}}
{{--

Right eye

--}} @if(isset($app?->Consult?->right_va))
{{ $app?->Consult?->right_va }}
@endif @if(isset($app?->Consult?->right_pin_hole))
{{ $app?->Consult?->right_pin_hole }}
@endif @if(isset($app?->Consult?->right_with_glass))
{{ $app?->Consult?->right_with_glass }}
@endif
{{--

Left eye

--}} @if(isset($app?->Consult?->left_va))
{{ $app?->Consult?->left_va }}
@endif @if(isset($app?->Consult?->left_pin_hole))
{{ $app?->Consult?->left_pin_hole }}
@endif @if(isset($app?->Consult?->left_with_glass))
{{ $app?->Consult?->left_with_glass }}
@endif
{{--

IOP

--}} @if(isset($app?->Consult?->right_eye))
{{ $app?->Consult?->right_eye }}
@endif @if(isset($app?->Consult?->left_eye))
{{ $app?->Consult?->left_eye }}
@endif @if(isset($app?->Consult?->eye_examination))
{{ $app?->Consult?->eye_examination }}
@endif @if(isset($app?->Consult?->eye_treatment))
{{ $app?->Consult?->eye_treatment }}
@endif @if(isset($app?->Consult?->eye_notes))
{{ $app?->Consult?->eye_notes }}
@endif
{{--
--}}
{{ $app?->Consult?->note }}
@if(isset($app?->lab))
Laboratory @php $result = []; $result = \App\Models\LabLabType::with([ "routine.measurement", "routine.resultcomponent.routine" => function ($sql) use ($app) { $sql->wherein("id", \App\Models\LabRequestRoutine::where("lab_request_id", $app?->lab->id)->pluck("routine_id")->toArray()); }, "routine.resultcomponent.routine.measurement" ])->find($app?->lab->lab_type); $request_result = \App\Models\LabRequestResult::where("lab_request_id", $app?->lab->id)->get(); $result = $result; @endphp

@if(isset($result->routine)) @foreach ($result->routine as $rs) @if (count($rs->resultcomponent->routine) > 0) @foreach ($rs->resultcomponent->routine as $rc) @if ($rc->result_component) @php $lab = \App\Models\LabLabType::where('id', $rc->result_component) ->with(['routine.resultcomponent']) ->first(); @endphp @if ($lab->result_format == 'grouped') @foreach ($lab->routine as $_rs) @if (count($_rs->resultcomponent->routine) > 0) @foreach ($_rs->resultcomponent->routine as $_rc) @if ($_rc->result_component) @php $_lab = \App\Models\LabLabType::where('id', $_rc->result_component) ->with(['routine.resultcomponent']) ->first(); @endphp @foreach ($_lab->routine as $_lab_rc) @php $_key = $request_result->search(function ($user) use ($_lab_rc) { return $user->routine_id === $_lab_rc->id; }); @endphp @endforeach @else @php $_key = $request_result->search(function ($user) use ($_rc) { return $user->routine_id === $_rc->id; }); $rs_rs = $_key !== false ? $request_result[$_key]['result'] : 0; $indication = ''; if (Str::contains($_rc->normal_range, '-')) { [$min, $max] = explode('-', $_rc->normal_range); if ($rs_rs > $max) { $indication = 'H'; } elseif ($rs_rs < $min) { $indication = 'L'; } } @endphp @endif @endforeach @endif @endforeach @else @foreach ($lab->routine as $lab_rc) @php $key = $request_result->search(function ($user) use ($lab_rc) { return $user->routine_id === $lab_rc->id; }); $rs_rs = $key !== false ? $request_result[$key]['result'] : 0; // [$min, $max] = explode('-', $lab_rc->normal_range); $indication = ''; if (Str::contains($lab_rc->normal_range, '-')) { [$min, $max] = explode('-', $lab_rc->normal_range); if ($rs_rs > $max) { $indication = 'H'; } elseif ($rs_rs < $min) { $indication = 'L'; } } @endphp @endforeach @endif @else @php $key = $request_result->search(function ($user) use ($rc) { return $user->routine_id === $rc->id; }); @endphp @php $indication = ''; $rs_rs = $key !== false ? $request_result[$key]['result'] : 0; if (Str::contains($rc->normal_range, '-')) { [$min, $max] = explode('-', $rc->normal_range); if ($rs_rs > $max) { $indication = 'H'; } elseif ($rs_rs < $min) { $indication = 'L'; } } @endphp @endif @endforeach @endif @endforeach @endif
Name Result Normal range
{{ $rs->resultcomponent->name }}
{{ $lab?->name }}
{{ $_rs->resultcomponent->name }}
{{ $_lab?->name }}
@if ($_lab_rc->routine_name) {{ $_lab_rc->routine_name }} @else {{ $_lab?->name }} @endif {{ $_key !== false ? $request_result[$_key]['result'] : '' }} {{-- --}} {{ $_lab_rc->normal_range }} {{ $_lab_rc?->measurement?->name }}
{{ $_rc->routine_name }}
{{ $rs_rs }} {{ $indication }}
{{ $_rc->normal_range == 'NO' ? '' : $_rc->normal_range }} {{ $_rc?->measurement?->name == 'Random sample' ? '' : $_rc?->measurement?->name }}
@if ($lab_rc->routine_name) {{ $lab_rc->routine_name }} @else {{ $lab?->name }} @endif {{ $rs_rs }} {{ $indication }} {{ $lab_rc->normal_range == 'NO' ? '' : $lab_rc->normal_range }} {{ $lab_rc?->measurement?->name == 'Random sample' ? '' : $lab_rc?->measurement?->name }}
{{ $rc->routine_name }}
{{ $rs_rs }} {{ $indication }}
{{ $rc->normal_range == 'NO' ? '' : $rc->normal_range }} {{ $rc?->measurement?->name == 'Random sample' ? '' : $rc?->measurement?->name }}
@endif @if(isset($app?->img))
Imaging @php $count = 0; @endphp @foreach ($app?->img as $it_image)
{{ $it_image->img?->name }} @php $result = \App\Models\ImageType::with([ "routine.measurement", "routine.resultcomponent.routine" => function ($sql) use ($it_image) { $sql->wherein("id", \App\Models\ImageRequestRoutine::where("lab_request_id", $it_image?->lab_type)->pluck("routine_id")->toArray()); }, "routine.resultcomponent.routine.measurement" ])->find($it_image->lab_type); $request_result = \App\Models\ImageRequestResult::where("lab_request_id", $it_image?->id)->get(); @endphp @php $counter = 0; @endphp @foreach ($result->routine as $rs) @php $key = $request_result->search(function ($user) use ($rs) { return $user->routine_id === $rs->id; }) ?? ''; @endphp {{ $rs->routine_name }} @if ($rs->type == 'text') @elseif ($rs->type == 'textarea') @else @php $options = explode(',', $rs?->initial_value); @endphp @foreach ($options as $item) 0 && $key !== false && $item == $request_result[$key]['result'] ? 'checked' : '' }}> @php $counter++; @endphp @endforeach @endif @endforeach
@php $count++; @endphp @endforeach
@endif @if(isset($app?->pres))
Prescription
@php $counter = 0; @endphp @foreach ($app?->pres as $item) @foreach ($item->PrescriptionDetails as $detail) @endforeach @endforeach
# Medication Quantity Frequency Dose Route/Instruction
{{ ++$counter }} {{ $detail?->Product?->name }} {{ $detail?->quantity }} {{ $detail?->frq?->name }} {{ $detail?->dose }} {{ $detail?->dsgform?->name }}
@endif @if(isset($app?->operation)) @foreach ($app?->operation as $items) @if(isset($items->preop))
Pre operations
Date: {{ \Carbon\Carbon::parse($items?->preop?->date)->format("d M, Y") }}
Time: {{ \Carbon\Carbon::parse($items?->preop?->time)->format('h:i:s A') }}
Anesthesia type: {{ $items?->preop?->anesthesia_type }}
Informed consent: {{ $items?->preop?->informed_consent }}
Shaving: {{ $items?->preop?->shaving }}
Catheterisation: {{ $items?->preop?->catheterisation }}
Fasting: {{ $items?->preop?->fasting }}
IV Line Fixed: {{ $items?->preop?->iv_line_fixed }}
IV Line Running: {{ $items?->preop?->iv_line_running }}
Blood group: {{ $items?->preop?->blood_group }}
Fasting blood sugar: {{ $items?->preop?->fasting_blood_sugar }}
Random blood sugar: {{ $items?->preop?->random_blood_sugar }}
Others: {{ $items?->preop?->others }}
Allergy: {{ $items?->preop?->allergy }}
Allergies: {{ $items?->preop?->allergy_text }}
Chronic illness: {{ $items?->preop?->chronic_illness }}
Chronic illness: {{ $items?->preop?->chronic_illness_text }}
Anesthetic risk: {{ $items?->preop?->anesthetic_risk }}
Anesthetic risk: {{ $items?->preop?->anesthetic_risk_text }}
Blood pressure: {{ $items?->preop?->blood_pressure }}
Pulse: {{ $items?->preop?->pulse }}
Temperature: {{ $items?->preop?->temperature }}
Respiratory: {{ $items?->preop?->respiratory }}
Weight: {{ $items?->preop?->weight }}
@endif @if(isset($items?->intra))
Intra operations
Date: {{ \Carbon\Carbon::parse($items?->intra?->date)->format('d M, Y') }}
Time: {{ \Carbon\Carbon::parse($items?->intra?->time)->format('h:i:s A') }}
Operating doctor: {{ $items?->intra?->dr?->name }}
Anesthetist: {{ $items?->intra?->anes?->name }}
Assistant: {{ $items?->intra?->assis?->name }}
Assistant: {{ $items?->intra?->assis2?->name }}
Induction drugs: {{ $items?->intra?->induction_drug }}
Maintenance drugs: {{ $items?->intra?->maintenance_drug }}
Intra-Operative drugs/fluids: {{ $items?->intra?->operative_drug }}
End of surgery time: {{ \Carbon\Carbon::parse($items?->intra?->surgery_time)->format('h:i:s A') }}
Estimated blood loss(EBL): {{ $items?->intra?->blood_loss }}
Patient condition: {{ $items?->intra?->patient_condition }}
Special instructions: {{ $items?->intra?->special_instructions }}
@endif @if(isset($items?->postop))
Post operations
Provisional Diagnosis: {{ $items?->postop?->provisional_diagnosis ?? '' }}
Definitive Diagnosis: {{ $items?->postop?->definitive_diagnosis ?? '' }}
Indication for surgical procedure: {{ $items?->postop?->surgical_procedure }}
Procedure report: {{ $items?->postop?->procedure_report }}
Post operative orders: {{ $items?->postop?->post_operative_order }}
Post operative intensive care: {{ $items?->postop?->post_operative_intensive }}
@endif @endforeach @endif @endforeach
@endif
@endsection @section('page_js') {{-- --}} @endsection