{{-- DTHospital - patient chart, shown under the patient's details. Everything recorded against one patient, newest first, each read from the module that owns it: history notes, OPD visits with vitals, prescriptions, lab results, ward stays and billing. Each section links to that module for adding or editing. Copyright (c) ICT Innovations Part of DTHospital Licensed under the GNU General Public License v3.0. --}} @php($imaging = \App\Models\RadiologyOrder::where('patient_id', $patient->id)->orderByDesc('created_at')->get()) @if ($imaging->isNotEmpty() && \App\Support\Permissions::allows('diagnostic_report_view'))

Radiology

@foreach ($imaging as $im) @endforeach
OrderedExamStatusImpression
{{ \Illuminate\Support\Str::of($im->created_at)->substr(0, 10) }}{{ $im->name }}{{ \App\Models\RadiologyOrder::STATUSES[$im->status] ?? $im->status }} {{ \Illuminate\Support\Str::limit($im->impression, 60) }}Open
@endif @php($consults = \App\Models\Consultation::where('patient_id', $patient->id)->orderByDesc('date')->orderByDesc('id')->get()) @if ($consults->isNotEmpty() && \App\Support\Permissions::allows('consultation_view'))

Consultations

@foreach ($consults as $cn) @endforeach
DateDoctorComplaintDiagnosisFollow-up
{{ $cn->date }}{{ $doctorNames[$cn->doctor_id] ?? '' }}{{ \Illuminate\Support\Str::limit($cn->presenting_complaint, 50) }} {{ \Illuminate\Support\Str::limit($cn->diagnosis ?: $cn->provisional_diagnosis, 50) }}{{ $cn->follow_up_date }} View
@endif @php($onWard = $admissions->firstWhere('d_time', null)) @php($pid = $patient->id) @php($may = fn ($p) => \App\Support\Permissions::allows($p))
OPD visits

{{ $appointments->count() }}

Ward status

{{ $onWard ? 'Admitted' : 'Not admitted' }}

Billed / paid

{{ number_format($billed, 2) }} / {{ number_format($paid, 2) }}

Outstanding

{{ number_format($outstanding, 2) }}

{{-- Medical history --}}

Medical history @if ($may('patient_medical_history'))Add note@endif

@if ($history->isEmpty())

No history notes yet.

@else @foreach ($history as $note) @endforeach
DateTitleNotes
{{ $note->date ?: '-' }} {{ $note->title }} {{ \Illuminate\Support\Str::limit($note->description, 160) }} Open
@endif
{{-- OPD visits --}}

OPD visits and vitals @if ($may('appointment_add'))Book appointment@endif

@if ($appointments->isEmpty())

No appointments yet. Vitals are recorded on each visit, so they appear here once an appointment is booked.

@else @foreach ($appointments as $visit) @endforeach
DateTimeDoctorStatusBPPulseTempWeightRemarks
{{ $visit->date }} {{ $visit->s_time ? substr((string) $visit->s_time, 11, 5) : '-' }} {{ $doctorNames[$visit->doctor] ?? '-' }} {{ ucfirst((string) $visit->status) }} {{ $visit->b_p ?: '-' }} {{ $visit->pulse ?: '-' }} {{ $visit->temprature ?: '-' }} {{ $visit->weight ?: '-' }} {{ \Illuminate\Support\Str::limit((string) $visit->remarks, 80) }} @if ($may('appointment_update')){{ $visit->b_p || $visit->pulse || $visit->temprature || $visit->weight ? 'Edit vitals' : 'Record vitals' }} · @endif Open
@endif
{{-- Prescriptions --}}

Prescriptions @if ($may('prescription_add'))New prescription@endif

@if ($prescriptions->isEmpty())

No prescriptions yet.

@else @foreach ($prescriptions as $rx) @endforeach
DateDoctorSymptomsMedicines
{{ $rx->date }} {{ $doctorNames[$rx->doctor] ?? '-' }} {{ \Illuminate\Support\Str::limit((string) $rx->symptom, 80) ?: '-' }} @forelse ($rx->items as $item)
{{ $item->name }}{{ $item->dosage ? ', ' . $item->dosage : '' }}{{ $item->duration ? ' for ' . $item->duration : '' }}
@empty {{ $rx->medicine ?: '-' }} @endforelse
Open
@endif
{{-- Laboratory --}}

Lab results @if ($may('lab_test_add'))Request tests@endif

@if ($labs->isEmpty())

No lab requests yet.

@else @foreach ($labs as $lab) @foreach ($lab->tests as $i => $test) @endforeach @endforeach
DateDoctorTestResultReference
{{ $i === 0 ? $lab->date : '' }} {{ $i === 0 ? ($doctorNames[$lab->doctor] ?? '-') : '' }} {{ $test->name }} @if ($test->result !== null && $test->result !== ''){{ $test->result }}@elsePending@endif {{ $test->reference_value ?: '-' }} @if ($i === 0)Open@endif
@endif
{{-- IPD --}}

Admissions (IPD) @if (! $onWard && $may('admission_add')) Admit @endif

@if ($admissions->isEmpty())

No admissions yet.

@else @foreach ($admissions as $stay) @php($from = $stay->a_time ? \Illuminate\Support\Carbon::parse($stay->a_time) : null) @php($to = $stay->d_time ? \Illuminate\Support\Carbon::parse($stay->d_time) : now()) @endforeach
WardBedAdmittedDischargedDays
{{ $bedCategories[$stay->category] ?? '-' }} {{ optional($beds->get($stay->bed_id))->number ?? $stay->number }} {{ $stay->a_time ?: '-' }} @if ($stay->d_time){{ $stay->d_time }}@elseOn the ward@endif {{ $from ? max(1, (int) ceil($from->diffInHours($to) / 24)) : '-' }} Open
@endif
{{-- Billing --}}

Billing and payments @if ($may('payment_add'))New invoice@endif

@if ($invoices->isEmpty())

No invoices yet.

@else @foreach ($invoices as $invoice) @php($invoicePaid = $invoice->paid()) @php($invoiceBalance = $invoice->balance()) @php($state = $invoice->settlement()) @endforeach
InvoiceDateTotalPaidBalanceStatus
#{{ $invoice->id }} {{ $invoice->date }} {{ number_format((float) $invoice->gross_total, 2) }} {{ number_format($invoicePaid, 2) }} {{ number_format($invoiceBalance, 2) }} {{ ucfirst($state) }} Open
@endif