@extends('layouts.master') @section('title', $title) @section('content')
{{--
{{ $title }} {{ __('list') }}
@can($access . '-create') {{ $title }} @endcan
--}} {{-- --}}
Sample id:4343Patient : {{ $lab_request?->Appointment?->Patient?->name ?? $lab_request?->Pat?->name }} Gender : {{ $lab_request?->Appointment?->Patient?->gender ?? $lab_request?->Pat?->gender }} Age : {{ \Carbon\Carbon::now()->diffInYears(\Carbon\Carbon::parse($lab_request?->Appointment?->Patient?->dob ?? $lab_request?->Pat?->dob)) }} Status : @if ($lab_request?->status == 'Processed') Processed — visible to the doctor @elseif ($lab_request?->status == 'Draft') Draft — not visible to the doctor yet @else Pending @endif
@csrf {{-- Defaults to completing the result (matches the old, only, behavior); the Draft button below overrides this right before submit. --}}
@if ($result->result_format == 'grouped') @foreach ($result->routine as $rs) @if ($rs->resultcomponent && count($rs->resultcomponent->routine) > 0) @php // A "single" test dropped into a grouped panel (e.g. ESR inside // HEMATOLOGY) has exactly one leaf routine and no nested group — // render it on one line like a normal row instead of a header // row followed by an unnamed input row. $isSingleLeaf = count($rs->resultcomponent->routine) === 1 && empty($rs->resultcomponent->routine->first()->result_component); @endphp @if (!$isSingleLeaf) @endif @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 $inner_rs) @if (count($inner_rs->resultcomponent->routine) > 0) @endif @foreach ($inner_rs->resultcomponent->routine as $inner_l_rc) @if ($inner_l_rc->result_component) @php $inner_l_lab = \App\Models\LabLabType::where('id', $inner_l_rc->result_component) ->with(['routine.resultcomponent']) ->first(); @endphp @foreach ($inner_l_lab->routine as $inner_l_lab_rc) @php $key = $request_result->search(function ($user) use ($inner_l_lab_rc) { return $user->routine_id === $inner_l_lab_rc->id; }); @endphp @endforeach @else @php $key = $request_result->search(function ($user) use ($inner_l_rc) { return $user->routine_id === $inner_l_rc->id; }); @endphp @endif @endforeach @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; }); @endphp @endforeach @endif @else @php $key = $request_result->search(function ($user) use ($rc) { return $user->routine_id === $rc->id; }); @endphp $isSingleLeaf])> @endif @endforeach @else {{-- Not every routine on a request is actually a bridge — the appointment Lab section lets a doctor search and attach any test regardless of which panel it's really from, so this one just has its own result to enter. --}} @php $key = $request_result->search(function ($user) use ($rs) { return $user->routine_id === $rs->id; }); @endphp @endif @endforeach
Name Result Normal range
{{ $rs->resultcomponent->name }}
{{ $lab?->name }}
{{ $inner_rs->resultcomponent->name }}
{{ $inner_l_lab?->name }}
{{ $inner_l_lab_rc->routine_name ?? $inner_l_lab?->name }}
{!! $inner_l_lab_rc->normal_range !!} {{ $inner_l_lab_rc?->measurement?->name }}
{{ $inner_l_rc->routine_name }}
{!! $inner_l_rc->normal_range == 'NO' ? '' : $inner_l_rc->normal_range !!} {{ $inner_l_rc?->measurement?->name == 'Random sample' ? '' : $inner_l_rc?->measurement?->name }}
{{ $lab_rc->routine_name ?? $lab?->name }} {{-- {{ $key !== false ? $request_result[$key]['result'] : '' }} --}}
{!! $lab_rc->normal_range !!} {{ $lab_rc?->measurement?->name }}
{{ $rc->routine_name ?: $rs->resultcomponent->name }}
{!! $rc->normal_range !!} {{ $rc?->measurement?->name }}
{{ $rs->routine_name ?? $rs->labType?->name }}
{!! $rs->normal_range !!} {{ $rs?->measurement?->name }}
@endif @if ($result->result_format == 'descriptive') @foreach ($result->routine as $rs) @php $key = $request_result->search(function ($user) use ($rs) { return $user->routine_id === $rs->id; }); @endphp @endforeach
Name Result
{{ $rs->routine_name ?? $rs->labType?->name ?? $result->name }}
@endif @if ($result->result_format == 'compound') @foreach ($result->routine as $rs) @php $key = $request_result->search(function ($user) use ($rs) { return $user->routine_id === $rs->id; }); @endphp @endforeach
Name Result Normal range
{{ $rs->routine_name ?? $rs->labType?->name ?? $result->name }} {!! $rs->normal_range !!} {{ $rs?->measurement?->name }}
@endif @if ($result->result_format == 'single')
@foreach ($result->routine as $rs) @php $key = $request_result->search(function ($user) use ($rs) { return $user->routine_id === $rs->id; }); @endphp {{-- A combined request can hold several different single-format tests at once (Malaria + Widal, say) — without this, two unlabeled Result/Normal range pairs would be indistinguishable. --}}
{{ $rs->routine_name ?? $rs->labType?->name ?? $result->name }}
@endforeach
@endif
If test has any files please upload to the system.
# Name Image
1
@endsection @section('page_css') @endsection @section('page_js') @endsection