resolved conflicts

This commit is contained in:
2025-03-31 03:46:05 +03:00
6454 changed files with 1520539 additions and 9 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,553 @@
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
<title>{{ config('app.name', 'Referral Notes - Stre@mline') }}</title>
<!-- Bootstrap Core CSS -->
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<style>
body{
font-size: 0.8em;
}
/*thead, tfoot { display: table-row-group }*/
thead {
display: table-header-group;
}
tfoot {
display: table-row-group;
}
tr {
page-break-before: always;
page-break-after: always;
page-break-inside: avoid;
}
.card-header{
padding: 5px;
}
</style>
</head>
@php
$total_deposits_paid = 0;
$total_amount_to_pay = 0;
$discount_amount = 0;
$insurance_hospital_stay = 0;
$insurance_investigations = 0;
$insurance_treatments = 0;
$insurance_sundries = 0;
$insurance_procedures = 0;
$insurance_tta = 0;
$insurance_services = 0;
$price_list_id = is_patient_category_attached_to_price_list($patient_id);
$investigation_amount_total = 0;
@endphp
<body>
<div class="container-fluid">
@include('layouts.header_pdf_print')
<h5 class="heading" style="text-align: center;"> OUTPATIENT REFERRAL NOTE</h5>
<div class="row col">
<table class="table table-light table-sm table-borderless">
<tr>
<th scope="row">{{ __('inpatient.patient_number') }}</th>
<td>{{ $patient->number}}</td>
<td width="60" style="border-top: 0px;">&nbsp;</td>
<th>Clinic</th>
<td>
{{ get_name($consultation->clinic_id, 'id', 'name', 'clinics') }} &nbsp;
</td>
</tr>
<tr>
<th scope="row">{{ __('inpatient.patient_names') }}</th>
<td>{{ $patient->first_name}} {{ $patient->last_name}}</td>
<td style="border-top: 0px;">&nbsp;</td>
<th>Consultation Date</th>
<td>
{{ streamline_date($consultation->created_at) }}
</td>
</tr>
<tr>
<th scope="row">{{ __('inpatient.age') }}</th>
<td>{{ get_patients_age($patient->date_of_birth, $consultation->created_at) }}</td>
<td style="border-top: 0px;">&nbsp;</td>
<th>Referral Number</th>
<td>
{{ $patient->number }}
</td>
</td>
</tr>
<tr>
<th scope="row">{{ __('inpatient.gender') }}</th>
<td>{{ $patient->gender == 1 ? __('inpatient.male') : __('inpatient.female') }}</td>
<td style="border-top: 0px;">&nbsp;</td>
<th scope="row">{{ __('inpatient.category') }}</th>
<td>
{{ get_name($patient->category_id, 'id', 'name', 'patient_categories') }}
@if(!is_null($patient_discount))
({{ $patient_discount["discount"] }} % {{ __('inpatient.discount') }})
@endif
</td>
</tr>
</table>
</div>
{{-- Symptoms, Priority and Emergency Signs --}}
<div class="row">
<div class="col">
<div class="card-deck">
<div class="card border-0">
<div class="card-block">
<div class="card-header">
<h5 class="card-title text-center">{{ __('consultations.symptoms') }}</h5>
</div>
@if (!empty($triage->symptoms) || !empty($consultation->symptoms))
@php
$symptoms_explode = !empty($triage->symptoms)? explode(",", $triage->symptoms):explode(",", $consultation->symptoms);
$symptoms_duration = !empty($triage->symptom_duration)? explode(",", $triage->symptom_duration):explode(",", $consultation->symptom_duration);
@endphp
<p class="card-text">
<ul class="list-group list-group-flush">
@foreach ($symptoms_explode as $key => $symptom)
<li class="list-group-item text-center">{{ ucwords($symptoms[$symptom] ?? '') }} for {{ $symptoms_duration[$key]?? '' }}</li>
@endforeach
</ul>
</p>
@else
<p class="card-text">
<ul class="list-group list-group-flush">
<li class='list-group-item text-center font-weight-bold text-danger'>{{ __('consultations.no_symptom_recorded') }}</li>
</ul>
</p>
@endif
</div>
</div>
@if (between($years, 0, 12))
<div class="card border-0">
<div class="card-block">
<div class="card-header">
<h5 class="card-title text-center">{{ __('triage.emergency_signs') }}</h5>
</div>
@if (!empty($emergent_signs))
<p class="card-text">
<ul class="list-group list-group-flush">
@foreach ($emergent_signs as $emergent_sign)
<li class='list-group-item text-center'>{{ ucwords($emergent_sign ?? '') }}</li>
@endforeach
</ul>
</p>
@else
<p class="card-text text-success">
<ul class="list-group list-group-flush">
<li class='list-group-item text-center text-success font-weight-bold'>{{ __('layout.no_emergency_signs') }}</li>
</ul>
</p>
@endif
</div>
</div>
<div class="card border-0">
<div class="card-block">
<div class="card-header">
<h5 class="card-title text-center">{{ __('layout.priority_signs') }}</h5>
</div>
@if (count($priority_signs) > 0)
<p class="card-text">
<ul class="list-group list-group-flush">
@foreach ($priority_signs as $priority_sign)
<li class='list-group-item text-center'>{{ ucwords($priority_sign ?? '') }}</li>
@endforeach
</ul>
</p>
@else
<p class="card-text">
<ul class="list-group list-group-flush">
<li class='list-group-item text-center text-success font-weight-bold'>{{ __('layout.no_priority_signs') }}</li>
</ul>
</p>
@endif
</div>
</div>
@endif
@if (isset($triage->any_tb_sysmptoms) && $triage->any_tb_sysmptoms == 1)
<div class="card border-0">
<div class="card-block">
<div class="card-header">
<h5 class="card-title text-center">{{ __('layout.tb_screening') }}</h5>
</div>
<table class="table table-bordered">
<tr class="cough_tb_question">
<td>A cough for more than two weeks?</td>
<td>{{ $triage->cough_for_2_weeks == 1 ? "Yes" : "No" }}</td>
</tr>
<tr class="fever_tb_question">
<td>Persistent fevers for 2 weeks or more?</td>
<td>{{ $triage->fever_for_2_weeks == 1 ? "Yes" : "No" }}</td>
</tr>
<tr class="weight_loss_tb_question">
<td>Noticeable weight loss of more than 3 Kg?</td>
<td>{{ $triage->tb_weight_loss == 1 ? "Yes" : "No" }}</td>
</tr>
<tr class="weight_loss_tb_question">
<td>Poor weight gain in the last one month?</td>
<td>{{ $triage->tb_poor_weight_gain == 1 ? "Yes" : "No" }}</td>
</tr>
<tr class="excessive_night_sweats_tb_question">
<td>Excessive night sweats for three weeks or more?</td>
<td>{{ $triage->tb_excessive_night_sweats == 1 ? "Yes" : "No" }}</td>
</tr>
<tr class="excessive_night_sweats_tb_question">
<td>Contact with a person with pulmonary TB or chronic cough?</td>
<td>{{ $triage->tb_contact_with_tb_person == 1 ? "Yes" : "No" }}</td>
</tr>
</table>
</div>
</div>
@endif
</div>
</div>
</div> <br>
<div class="row">
<div class="col">
<div class="card-deck">
<div class="card">
<div class="card-header">
<strong>Primary Diagnosis</strong>
</div>
<table class="table table-light table-sm">
<thead>
<tr>
<td>{{ $all_diagnoses[$consultation->primary_diagnosis]?? "" }}</td>
</tr>
</thead>
</table>
</div>
@php
$other_diagnoses = @unserialize($consultation->other_diagnoses);
@endphp
@if(!empty($other_diagnoses))
<div class="card">
<div class="card-header">
<strong>Secondary Diagnosis</strong>
</div>
<table class="table table-light table-sm">
<thead>
@foreach($other_diagnoses as $diagnosis)
<tr>
<td>{{ $all_diagnoses[$diagnosis]?? "" }}</td>
</tr>
@endforeach
</thead>
</table>
</div>
@endif
</div>
</div>
</div> <br>
<div class="row">
@if(!is_null($consultation->comments))
<div class="col">
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr><th>{{ __('patient_episode.comments') }}</th></tr>
</thead>
<tbody>
<tr><td>{!! nl2br(e($consultation->comments)) !!}</td></tr>
</tbody>
</table>
</div>
@endif
@if(!is_null($consultation->history_comments))
<div class="col">
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr><th>{{ __('patient_episode.history_comments') }}</th></tr>
</thead>
<tbody>
<tr><td>{!! nl2br(e($consultation->history_comments)) !!}</td></tr>
</tbody>
</table>
</div>
@endif
@if(!is_null($consultation->clinic_examination_comments))
<div class="col">
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr><th>{{ __('patient_episode.clinic_examination_comments') }}</th></tr>
</thead>
<tbody>
<tr><td>{!! nl2br(e($consultation->clinic_examination_comments)) !!}</td></tr>
</tbody>
</table>
</div>
@endif
</div>
@if (!empty($cons_notes))
<table class="table table-sm table-bordered">
<thead class="thead-light">
<tr><th colspan="4" class="text-center">{{ __('consultations.previous_notes') }}</th></tr>
<tr>
<th>{{ __('consultations.history') }}</th>
<th>{{ __('consultations.clinical_examination') }}</th>
<th>{{ __('consultations.investigation_and_mgt_plan') }}</th>
<th>{{ __('consultations.date') }}</th>
</tr>
</thead>
<tbody>
@forelse ($cons_notes as $consultation_note)
<tr>
<td>{{ $consultation_note->history_comments }}</td>
<td>{{ $consultation_note->clinic_examination_comments }}</td>
<td>{{ $consultation_note->investigation_and_management_plan_comments}}</td>
<td>{{ streamline_date_time($consultation_note->created_at) }}</td>
</tr>
@empty
<tr><td colspan="4"><code>{{ __('consultations.no_previous_notes') }}</code></td></tr>
@endforelse
</tbody>
</table>
@endif
<div class="row">
@if(count($opd_investigations) > 0)
<div class="col">
<table class="table table-light table-sm table-bordered">
<thead class="thead-light">
<tr>
<th>{{ __('patient_file.investigation') }}</th>
<th>{{ __('patient_file.result') }}</th>
<th>{{ __('patient_file.normal_ranges') }}</th>
<th>{{ __('patient_file.comment') }}</th>
</tr>
</thead>
<tbody>
@if(count($opd_investigations) > 0)
@for($i = 0; $i < count($opd_investigations['name']); $i++)
@if(isset($opd_investigations['name'][$i]))
<tr>
<td>{{ $opd_investigations['name'][$i] }}</td>
<td>
@if (!empty($opd_investigations['type'][$i]))
<strong><code>See attached</code></strong>
@else
{!! nl2br(e($opd_investigations['value'][$i])) !!}
@endif
</td>
<td>{{ $opd_investigations['normal_ranges'][$i] }}</td>
<td>{!! nl2br(e($opd_investigations['comment'][$i])) !!}</td>
</tr>
@endif
@endfor
@endif
</tbody>
</table>
</div>
@endif
@if(count($ordered_procedures) > 0)
<div class="col">
<table class="table table-light table-sm table-bordered">
<thead class="thead-light">
<tr><th>{{ __('patient_episode.procedure_name') }}</th></tr>
</thead>
<tbody>
@foreach($ordered_procedures as $procedure)
@php
$procedure_ids = explode(',', $procedure->procedure_id);
@endphp
@foreach ($procedure_ids as $id)
<tr>
<td>{{ $procedures[$id] ?? "" }}</td>
</tr>
@endforeach
@endforeach
</tbody>
</table>
</div>
@endif
</div>
<div class="row">
@if(count($treatments) > 0)
<div class="col">
<table class="table table-bordered table-sm">
<thead class="thead-light">
<tr>
<th>{{ __('patient_file.treatment') }}</th>
<th>{{ __('patient_file.dosage_freq') }}</th>
<th></th>
<th>{{ __('prescriptions.instructions') }}</th>
</tr>
</thead>
<tbody>
@php $progressive_ids = []; @endphp
@foreach($treatments as $treatment)
<?php
$drugs_array = explode(",", $treatment->drugs);
$dosage_array = explode(",", $treatment->doses);
$dosage2_array = explode(",", $treatment->dose2);
$frequencies_array = explode(",", $treatment->frequencies);
$duration_array = explode(",", $treatment->durations);
$quantity_dispensed_array = explode(",", $treatment->quantities_dispensed);
$instructions_array = explode(",", $treatment->instruction);
$purchased_elsewhere_array = explode(",", $treatment->purchased_elsewhere);
// check if treatment is progressive and ignore
if ($treatment->is_treatment_progressive != 0) {
$progressive_ids[] = $treatment->is_treatment_progressive;
continue;
}
?>
@for ($x = 0; $x < count($drugs_array); $x++)
<?php
$drug_details = \Streamline\Models\Drug::find($drugs_array[$x]);
if (!$drug_details) {
continue;
}
$drug_form_name = get_name($drug_details->form_id, "id", "name", "unit_of_measure");
$drug_unit = get_name($drug_details->unit_id, "id", "name", "drug_units");
$drug_strength = $drug_details->strength;
$treatment_dosage = $dosage_array[$x] ?? "";
$treatment_strength = $drug_strength ?? "";
?>
<tr>
<td>
{{ $drug_details->name }}
@if($purchased_elsewhere_array[$x] == 1)
<code>( To Be Purchased elsewhere )</code>
@endif
</td>
<td>
({{ $dosage_array[$x] }} {!! $drug_unit !!} &nbsp;&nbsp; {{ get_name($frequencies_array[$x], 'id', 'name', 'dosage_frequencies') }})
</td>
<td>{{ $duration_array[$x] ?? "" }}</td>
<td>{{ $instructions_array[$x] ?? "" }}</td>
</tr>
@endfor
@endforeach
@if(count($progressive_ids) > 0)
@php
$progressive_treatments = \Illuminate\Support\Facades\DB::table('treatments_opd_progressive')->whereIn('id', $progressive_ids)->get();
@endphp
@foreach($progressive_treatments as $treatment)
<?php
$drugs_array = explode(",", $treatment->drugs);
$dosage_array = explode(",", $treatment->dose);
$frequencies_array = explode(",", $treatment->drug_frequency);
$duration_array = explode(",", $treatment->durations);
$quantity_dispensed_array = explode(",", $treatment->quantities_to_dispense);
$instructions_array = explode(",", $treatment->instruction);
?>
@for ($x = 0; $x < count($drugs_array); $x++)
<?php
$drug_details = \Streamline\Models\Drug::find($drugs_array[$x]);
if (!$drug_details) {
continue;
}
$drug_form_name = get_name($drug_details->form_id, "id", "name", "unit_of_measure");
$drug_unit = get_name($drug_details->unit_id, "id", "name", "drug_units");
$drug_strength = $drug_details->strength;
$treatment_dosage = $dosage_array[$x] ?? "";
$treatment_strength = $drug_strength ?? "";
?>
<tr>
<td>{{ $drug_details->name }}</td>
<td>
({{ $dosage_array[$x] }} {!! $drug_unit !!} &nbsp;&nbsp; {{ get_name($frequencies_array[$x], 'id', 'name', 'dosage_frequencies') }})
</td>
<td>{{ $duration_array[$x] ?? "" }}</td>
<td>{{ $instructions_array[$x] ?? "" }}</td>
</tr>
@endfor
@endforeach
@endif
</tbody>
</table>
</div>
@endif
</div>
<div class="row">
<div class="col">
<div class="card">
<div class="card-header">
<strong>Referral Notes</strong>
</div>
<table class="table table-light table-sm">
<thead>
<tr>
<td>{{ $consultation->referral_notes }}</td>
</tr>
</thead>
</table>
</div>
</div>
</div>
<br>
<div class="row">
<div class="col">
<div class="card">
<table class="table table-light table-sm">
<thead>
<tr>
<td><b>Referred By: </b></td>
<td>{{ !is_null($consultation->consultation_done_by) ? get_full_name($consultation->consultation_done_by, "id", "first_name", "last_name", "users") : get_full_name($consultation->created_by, "id", "first_name", "last_name", "users")}} to {{ get_name($consultation->referred_to, 'id', 'name', 'referral_hospitals') }}</td>
</tr>
</thead>
</table>
</div>
</div>
</div>
<br>
<div class="row">
<div class="col">
<div class="card">
<div class="card-header">
Printed By
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item">
<?php echo Auth::user()->first_name . ' ' . Auth::user()->last_name; ?>
&nbsp;&nbsp;&nbsp;....................................................
&nbsp;&nbsp;&nbsp;({{ streamline_date(date("Y-m-d")) }})
</li>
</ul>
</div>
</div>
</div>
</div>
</body>
</html>
File diff suppressed because it is too large Load Diff