@extends('layouts.app') @section('title') {{ __('Edit Laboratory Report') }} @endsection @section('styles') @endsection @section('breadcrumb')

{{ __('Laboratory Reports') }}

@endsection @section('content') @can('view_medical_report')
@if ($test->signatories->where('user_id', null)->count() == 0) {{ __('Print Report') }} @else {{ __('Result Preview') }} @endif {{-- @can('create_group') {{ __('Create Requisition') }} @endcan --}} @can('sign_medical_report') @php $auth_user_desig_id = auth() ->guard('admin') ->user()->designation_model->id; $is_signing = 0; @endphp @foreach ($test->signatories as $sig) @if ($sig->remarks && $sig->designation_id == auth()->guard('admin')->user()->designation_model->id) @endif @if (empty($sig->user_id)) @if ($loop->first && $sig->designation_id == $auth_user_desig_id) {{ __('Sign Report') }} @php $is_signing = 1; @endphp @else @if ($sig->designation_id == $auth_user_desig_id && !empty($test->signatories[$loop->index - 1]->user_id)) {{ __('Sign Report') }} @php $is_signing = 1; @endphp {{ __('Return') }} @endif @endif @endif @endforeach @endcan {{ __('Previous') }} {{ __('Next') }}
@endcan @php $date = strtotime($test->sample->collection_date) - strtotime($test->group->patient->dob); $days = round($date / (60 * 60 * 24)); $act_days = round($date / (60 * 60 * 24)); @endphp {{-- AGE AT COLLECTION --}}

Age at Collection: {{ $test->sample->collection_date ? $days : 'No Collection Date' }} day/s

{{-- SIGNATURE TRAIL --}}
@foreach ($test->signatories as $sig) @if (empty($sig->user_id)) {{ $sig->designation->title . ' (Level ' . $sig->designation->level . ')' }} @else {{ $sig->designation->title . ' (Level ' . $sig->designation->level . ')' }} @endif @if (!$loop->last) @endif @endforeach
{{-- SELECTION OF BARCODE --}}
Selection of Sample
@csrf
@if ($test->tsamples->count() > 0) @endif
{{-- SELECTION OF BARCODE --}} @if ($test->oaa_html)
OAA RESULT
Abundance {!! $test->oaa_html !!}
@endif @if ($test->sample->recollection->where('status', '!=', 'Extracted')->count() > 0) @endif {{-- SUGGESTED TESTS --}} @if ($suggested_tests)

Suggested Tests

@foreach ($suggested_tests as $st)

{{ $st->name }} is suggested. Create Requisition

@endforeach
@endif {{-- IF LAB REP HEADER HAS FIELD THAT IS NOT ON THE SYSTEM --}} @php $has_field_not_on_the_system = false; $fields = ['analyst', 'cli_gen', 'gen_coun', 'verified_by', 'date_analyzed', 'date_reported']; @endphp @for ($i = 1; $i <= 18; $i++) @if (in_array($test['groupHeader']['field' . $i], $fields)) @php $has_field_not_on_the_system = true; @endphp @endif @endfor
@csrf @method('put') @if ($has_field_not_on_the_system)

Selected Header Fields

{{-- --}} {{-- @csrf --}}
@for ($i = 1; $i <= 18; $i++) @switch($test['groupHeader']['field'.$i]) @case('analyst')
@break @case('cli_gen')
@break @case('gen_coun')
@break @case('verified_by')
@break @case('date_analyzed')
@break @case('date_reported')
@break @default @endswitch @endfor
{{-- --}} {{-- --}}
@endif

{{ __('Tests') }}

@if (!$test->sample->collection_date)
@endif
@if (session('branch_id') == 6)
{{-- --}}
@endif @php $colspan = 3; $test->test->hasComponentStatus->count() > 0 ? $colspan++ : $colspan; $test->test->hasComponentRemark->count() > 0 ? $colspan++ : $colspan; @endphp @foreach ($test['results'] as $key => $result) @if (isset($result['component_group'])) @if ($result['component_group']['title']) @if ($result['component_group']['name'] == 'SHOW_HEMOGRAM') @if (session('branch_id') == 6) @if ($test->groupHeader->show_hemogram) @endif @endif @else @endif @elseif((!isset($result['component_group']['write_up']) && (!isset($result['component_group']['name']) && $result['component_group']['image'] != '0')) || isset($result['component_group']['write_up'])) @if ($result['component_group']['image']) @else @endif @else {{-- @if ($test->test->hasComponentStatus->count() > 0) @endif --}} @if ($result['component_group']['remarks']) @elseif($test->test->hasComponentRemark->count() > 0) @endif @endif @endif @endforeach
{{ __('Name') }} {{ __('Unit') }} {{ __('Reference Range') }} {{ __('Result') }} {{ __('Status') }} {{ __('Remarks') }}
@if ($test->groupHeader->show_baby_only)
Hemogram Remarks
HGB HCT RBC MCV MCH MCHC RDW
@else
HEMOGRAM
@if ($test->groupHeader->show_mother) @endif @if ($test->groupHeader->show_father) @endif @if ($test->groupHeader->show_mother) @endif @if ($test->groupHeader->show_father) @endif @if ($test->groupHeader->show_mother) @endif @if ($test->groupHeader->show_father) @endif @if ($test->groupHeader->show_mother) @endif @if ($test->groupHeader->show_father) @endif @if ($test->groupHeader->show_mother) @endif @if ($test->groupHeader->show_father) @endif @if ($test->groupHeader->show_mother) @endif @if ($test->groupHeader->show_father) @endif @if ($test->groupHeader->show_mother) @endif @if ($test->groupHeader->show_father) @endif
Parameters PatientMotherFather Remarks: Hemogram Done on:
RBC Count x10 /L
HEMOGLOBIN g/dl
HEMATOCRIT %
MCV fL
MCH pg
MCHC g/L
@endif
{{ $result['component_group']['name'] }}

{{-- --}} {{-- --}} {{-- --}}
{{ $result['component_group']['name'] }} {{ $result->component_group->unit_name($result->component_group->unit) }} @if (isset($result['component_group']) && count($result['component_group']['reference_ranges']))
{{ __('Reference ranges') }}
{{-- --}} {{-- --}} {{-- @dump($result['component_group']->reference_ranges->sortBy('age_from_days')) --}} @foreach ($result['component_group']->reference_ranges->sortBy('age_from_days') as $reference_range) @if ($reference_range->age_unit != 'all') @if ($act_days >= $reference_range->age_from_days && $act_days <= $reference_range->age_to_days) {{-- --}} {{-- --}} @endif @else {{-- --}} {{-- --}} @endif @endforeach
{{ __('Gender') }} {{ __('Age') }}{{ __('Critical low') }}{{ __('Normal') }}{{ __('Critical high') }}
{{ __($reference_range['gender']) }} @if ($reference_range['age_unit'] == 'all') All @else {{ __($reference_range['age_from']) }} {{ __($reference_range['age_unit']) }} : {{ $reference_range['age_to'] }} {{ __($reference_range['age_unit_to']) }} @endif {{ $reference_range['critical_low_from'] }} @if ($reference_range['normal_from'] && $reference_range['normal_to'] == '') > {{ $reference_range['normal_from'] }} @elseif($reference_range['normal_from'] == '' && $reference_range['normal_to']) < {{ $reference_range['normal_to'] }} @else {{ $reference_range['normal_from'] }} - {{ $reference_range['normal_to'] }} @endif {{ $reference_range['critical_high_from'] }}
{{ __($reference_range['gender']) }} @if ($reference_range['age_unit'] == 'all') All @else {{ __($reference_range['age_from']) }} {{ __($reference_range['age_unit']) }} : {{ $reference_range['age_to'] }} {{ __($reference_range['age_unit_to']) }} @endif {{ $reference_range['critical_low_from'] }} @if ($reference_range['normal_from'] && $reference_range['normal_to'] == '') > {{ $reference_range['normal_from'] }} @elseif($reference_range['normal_from'] == '' && $reference_range['normal_to']) < {{ $reference_range['normal_to'] }} @else {{ $reference_range['normal_from'] }} - {{ $reference_range['normal_to'] }} @endif {{ $reference_range['critical_high_from'] }}
@endif {!! $result['component_group']['reference_range'] !!}
@php $date = strtotime($test->sample->collection_date) - strtotime($test->group->patient->dob); $days = round($date / (60 * 60 * 24)); @endphp @if ($result['component_group']['type'] == 'text') done ? 'readonly' : ($is_signing ?: 'readonly') }} name="result[{{ $result['id'] }}][result]" class="form-control test_result" value="{{ $result['result'] }}" @if (!empty($result->reference_range_mod($days))) normal_from="{{ $result->reference_range_mod($days)->normal_from }}" normal_to="{{ $result->reference_range_mod($days)->normal_to }}" @if (empty($result->reference_range_mod($days)->critical_high_from)) critical_high_from="{{ $result->reference_range_mod($days)->critical_high_from }}" critical_low_from="{{ $result->reference_range_mod($days)->critical_low_from }}" @else critical_high_from="{{ $result->reference_range_mod($days)->critical_high_from }}" critical_low_from="{{ $result->reference_range_mod($days)->critical_low_from }}" @endif @endif > @else @endif @php $ans = ''; @endphp @if (!empty($result->reference_range_mod($days)) && $result['result']) @php $component_result = $result['result']; $normal_from = $result->reference_range_mod($days)->normal_from; $normal_to = $result->reference_range_mod($days)->normal_to; @endphp @if ($normal_from && $normal_to) @if ($component_result >= $normal_from && $component_result <= $normal_to) @php $ans = 'Normal'; @endphp @else @php $ans = 'Outside Normal Values'; @endphp @endif @elseif($normal_from && !$normal_to) @if ($component_result > $normal_from) @php $ans = 'Normal'; @endphp @else @php $ans = 'Outside Normal Values'; @endphp @endif @elseif(!$normal_from && $normal_to) @if ($component_result < $normal_to) @php $ans = 'Normal'; @endphp @else @php $ans = 'Outside Normal Values'; @endphp @endif @endif @endif
@php $auth_user_desig_id = auth() ->guard('admin') ->user()->designation_model->id; @endphp @foreach ($test->signatories as $sig) @if (empty($sig->user_id)) @if ($loop->first && $sig->designation_id == $auth_user_desig_id) @else @if ($sig->designation_id == $auth_user_desig_id && !empty($test->signatories[$loop->index - 1]->user_id)) @endif @endif @endif @endforeach @foreach ($test->signatories as $sig) @if (empty($sig->user_id)) @if ($loop->first && $sig->designation_id == $auth_user_desig_id) @else @if ($sig->designation_id == $auth_user_desig_id && !empty($test->signatories[$loop->index - 1]->user_id)) @endif @endif @endif @endforeach @can('update_template')
@csrf
@endcan

{{ __('Supporting Documents') }}

@if (!$test->done)

@endif
@foreach ($test->reports($test->test_id) as $report) @php $file_arr = explode('/', $report['group_test_report']); $file = end($file_arr); $file_ext_arr = explode('.', $file); $file_ext = end($file_ext_arr); @endphp @endforeach @if(count($test->sync_reports) > 0) @foreach ($test->sync_reports as $report) @php $file_arr = explode('/', $report['group_test_report']); $file = end($file_arr); $file_ext_arr = explode('.', $file); $file_ext = end($file_ext_arr); @endphp @endforeach @endif
@if ($file_ext == 'pdf') @elseif($file_ext == 'doc' || $file_ext == 'docx') @elseif($file_ext == 'jpg' || $file_ext == 'jpeg' || $file_ext == 'png') @elseif($file_ext == 'xls' || $file_ext == 'xlsx') @elseif($file_ext == 'csv') @endif {{ $file }}
@if ($file_ext == 'pdf') @elseif($file_ext == 'doc' || $file_ext == 'docx') @elseif($file_ext == 'jpg' || $file_ext == 'jpeg' || $file_ext == 'png') @elseif($file_ext == 'xls' || $file_ext == 'xlsx') @elseif($file_ext == 'csv') @endif {{ $file }}
@csrf
@can('view_comments')

Comments for

@csrf @can('comment')
@endcan
@foreach ($test->comments as $comment)
Avatar
{{ $comment->user->name }}
{{ $comment->comment }}
{{ date('M d, Y | h:i a', strtotime($comment->created_at)) }}
@endforeach
@endcan @can('view_medical_report')
{{-- @if (!$test->signatories->where('user_id', null)->count()) --}} @if ($test->signatories->where('user_id', null)->count() == 0) {{ __('Print Report') }} @else {{ __('Result Preview') }} @endif {{-- @endif --}} @can('sign_medical_report') @php $auth_user_desig_id = auth() ->guard('admin') ->user()->designation_model->id; @endphp @foreach ($test->signatories as $sig) @if (empty($sig->user_id)) @if ($loop->first && $sig->designation_id == $auth_user_desig_id) {{ __('Sign Report') }} @else @if ($sig->designation_id == $auth_user_desig_id && !empty($test->signatories[$loop->index - 1]->user_id)) {{ __('Sign Report') }} {{ __('Return') }} @endif @endif @endif @endforeach @endcan {{ __('Previous') }} {{ __('Next') }}
@endcan @include('admin.medical_reports._patient_modal') @include('admin.medical_reports._invoice_modal') @include('admin.medical_reports._report_info_modal') @include('admin.medical_reports.modals.create_req') @endsection @section('scripts') @endsection