@php $PostPoneTests=[]; @endphp @extends('operations.layout.mainlayout') @section('content') {{-- @if(session('role') != 1 && session('role') != 19 && session('role') != 2 && session('role') != 3 && session('role') != 4 && session('role') != 5 && session('role') != 9 && session('role') != 6 && session('role') != 10 && session('role') != 7 && session('role') != 14 && session('role') != 17 && session('role') != 8 && session('role') != 5)--}} {{-- {{exit("

Unauthorized access

")}}--}} {{-- @endif--}} {{-- @if($sample->eNDUSERLABORDER->HOSPITAL->PROFILE_ID != session('profile_id'))--}} {{-- {{exit("

Unauthorized access

")}}--}} {{-- @endif--}}

@if(count($package_items) > 0) Package No. @elseif(empty($sample->SAMPLE_ID)) Sample No. @else Test No. @endif {{$sample->ID}} {{$sample->lABORDERSTATU->DESC_EN}} @if(!empty($sample->IS_RESET) && $sample->IS_RESET == 1) Sample was reset @endif @if(!empty($sample->IS_RECOLLECT) && $sample->IS_RECOLLECT == 1) Sample was recollected @endif @if(!empty($sample->STORAGE_RNO) && empty($sample->DISPOSE_ID)) Storage @endif @if(!empty($sample->DISPOSE_ID)) Dispose @endif

@permission('view_sample_log_comment') @endpermission @permission('view_sample_log_comment') @if(!empty($sample->eNDUSERLABORDER->IS_FROM_HIS)) @endif @endpermission @if($hasNphies) @endif @if(empty($sample->IS_SAMPLE) && !empty($sample->LAB_ORDER_STATUS_ID) && (!in_array($sample->LAB_ORDER_STATUS_ID, [4,8,-3,-2])) && (!empty($sample->lABCATEGORYPACKAGE->IS_ANALYSIS) || !empty($sample->lABCATEGORYPACKAGE->IS_RESULT_OPTION)) || !empty($sample->lABCATEGORYPACKAGE->HAS_TEMPLATE)) @endif @permission('reservations_edit_info') @if(empty($sample->IS_SAMPLE) && !empty(session('enable_sample_generation')) && empty($sample->lABCATEGORYPACKAGE->IS_ANALYSIS) && empty($sample->lABCATEGORYPACKAGE->IS_RESULT_OPTION) && empty($sample->lABCATEGORYPACKAGE->HAS_TEMPLATE)) @permission('sample_recalculate_reference') @endpermission @endif @endpermission @permission('split_sample') @if(!empty($sample->IS_SAMPLE) && count($sample_tests) > 1)@endif @endpermission

Patient Information

@if($sample->LAB_ORDER_STATUS_ID == 4 && count($package_items) == 0 && (empty($sample->lABCATEGORYPACKAGE->TEST_CATEGORY) || $sample->lABCATEGORYPACKAGE->TEST_CATEGORY == 2)) ID, $encrypt_method, $key, 0, $iv ) ); echo $output; @endphp/pdf">Print Result @elseif($sample->LAB_ORDER_STATUS_ID == 4 && $sample->lABCATEGORYPACKAGE->TEST_CATEGORY == 10) @if($sample->lABCATEGORYPACKAGE->HAS_TEMPLATE) Template Report @else lABCATEGORYPACKAGE->IS_CONFIDENTIAL) data-confirm="1" @endif> Medical Report lABCATEGORYPACKAGE->IS_CONFIDENTIAL) data-confirm="1" @endif> Smart Report @endif @permission('sample_release_report') @endpermission @endif
@if(!empty($sample->eNDUSERLABORDER->eNDUSER->IS_COMPANY) && $sample->eNDUSERLABORDER->eNDUSER->IS_COMPANY == 1) paid @else gender @endif

{{$sample->NAME}}

Date of Birth: {{$sample->DATE_OF_BIRTH}}
Reservation No : {{$sample->END_USER_LAB_ORDER_ID}}
Time : {{$sample->eNDUSERLABORDER->SCHEDULE_DATE}} {{$sample->eNDUSERLABORDER->TYPE_ID != 2 ? date('h:i A',strtotime($sample->eNDUSERLABORDER->CREATE_DATE)) : date('h:i A',strtotime($sample->eNDUSERLABORDER->lABAVAILABLETIME->FROM_TIME))}}{{--{{date('h:i A',strtotime($sample->eNDUSERLABORDER->lABAVAILABLETIME->FROM_TIME))}}--}}
Mobile #: {{$sample->MOBILE_NUMBER}}
Nationality : {{empty($sample->nationality->name) ? "" : $sample->nationality->name}}

@if(!empty($sample->IS_SAMPLE)) Sample Information @else Test Information @endif@permission('warehouse_storage_manage_units') @if(!empty($sample->STORAGE_ID) && empty($sample->DISPOSE_ID))@endif @endpermission

@if($sample->lABCATEGORYPACKAGE->TEST_CATEGORY == 10) @endif
@if(!empty($sample->IS_SAMPLE)) Sample ID @else Test ID @endif : {{$sample->ID}}
@if(!empty($sample->STORAGE_RNO) && $rank)
Storage Position : {{$sample->STORAGE_RNO}}
@endif @if(!empty($sample->INTEND_NUMBER))
Internal no. : {{$sample->INTEND_NUMBER}}
@endif @if(!empty($sample->ProcessingHospital->NAME_EN))
Processing Branch : {{$sample->ProcessingHospital->NAME_EN}}
@endif @if(empty($sample->IS_SAMPLE))
Test Type : @if(!empty($sample->eNDUSERLABORDER->eNDUSER->IS_COMPANY) &&$sample->eNDUSERLABORDER->eNDUSER->IS_COMPANY == 1 && $sample->eNDUSERLABORDER->eNDUSER->IS_CLIENT_TEST_DETAILS) {{!empty($sample->lABCATEGORYPACKAGE->CLIENT_TEST_NAME_EN) ? $sample->lABCATEGORYPACKAGE->CLIENT_TEST_NAME_EN : $sample->lABCATEGORYPACKAGE->NAME_EN }} @else {{$sample->lABCATEGORYPACKAGE->NAME_EN}} @endif
@if(!empty($sample->NG_CODE_ID) && !empty($sample->lABCATEGORYPACKAGE->IS_GENETIC) && !empty($sample->ngCode))
NG Code : {{$sample->ngCode->CODE}}{{date('y')}}{{str_pad($sample->NG_CODE_SEQUENCE_NUMBER ?? $sample->ngCode->START_NUMBER, 2, '0', STR_PAD_LEFT)}}
@endif @if(empty($sample->lABCATEGORYPACKAGE->TEST_CATEGORY))
Testing Reason : @if(empty($sample->OUTSIDE_CASE)) Diagnoses @elseif($sample->OUTSIDE_CASE == 1) Travelling to Outside KSA @elseif($sample->OUTSIDE_CASE == 2) Umra from outside @elseif($sample->OUTSIDE_CASE == 3) Coming from Outside KSA @endif
Batch No : @if(!empty($sample->Batch->BATCH_NO)) {{$sample->Batch->BATCH_NO}} @endif / Position No : P{{$sample->RNO}}
@endif @endif @if(!empty($sample->profileSendout) && !empty($sample->profileSendout->SENDOUT_NO))
Send Out No. : @if(!empty($sample->profileSendout->SENDOUT_NO)) {{$sample->profileSendout->SENDOUT_NO}} @endif
@endif @if(!empty($sample->Rejection->NAME_EN))
Rejection Reason : {{$sample->Rejection->NAME_EN}}
@endif @if(!empty($sample->SEHA_CERT))
Seha Certificate : @if($sample->LAB_ORDER_STATUS_ID != 4) Pending Result @elseif($sample->LAB_ORDER_STATUS_ID == 4 && empty($sample->SEHA_ISSUED)) Pending Issuance @elseif($sample->LAB_ORDER_STATUS_ID == 4 && !empty($sample->SEHA_ISSUED)) Issued @endif
@endif
@if( !empty($sample->lABCATEGORYPACKAGE->TEST_CATEGORY) && $sample->lABCATEGORYPACKAGE->TEST_CATEGORY != 1 && $sample->lABCATEGORYPACKAGE->TEST_CATEGORY != 5 ) @if(!empty($sample->DECIMAL_RESULT))
Result : {{$sample->DECIMAL_RESULT}}
@endif @if($sample->LAB_ORDER_STATUS_ID == 4) @permission('view_sample_comment')
Comment :
@endpermission @endif @else @if(!empty($sample->RESULT))
Result : {{$sample->RESULT == 1 ? "Negative" : "Positive"}}
@endif @endif @if(!empty($sample->SEHA_CERT) && empty($sample->SEHA_ISSUED) && $sample->LAB_ORDER_STATUS_ID == 4) @permission('sample_seha')
@endpermission @endif
@if(count($sample_tests) > 0)

Sample Tests

@foreach($sample_tests as $sample_test) @endforeach
Test ID Test Type Status Urgent PostPone
{{$sample_test->ID}} @if(!empty($sample->eNDUSERLABORDER->eNDUSER->IS_COMPANY) &&$sample->eNDUSERLABORDER->eNDUSER->IS_COMPANY == 1 && $sample->eNDUSERLABORDER->eNDUSER->IS_CLIENT_TEST_DETAILS) {{!empty($sample_test->lABCATEGORYPACKAGE->CLIENT_TEST_NAME_EN) ? $sample_test->lABCATEGORYPACKAGE->CLIENT_TEST_NAME_EN : $sample_test->PACKAGE_NAME}} @else {{$sample_test->PACKAGE_NAME}} @endif {{$sample_test->STATUS_NAME}} @if($sample_test->IS_STAT) @endif @if($sample_test->IS_POSTPONE) @php array_push($PostPoneTests,$sample_test->PACKAGE_NAME) @endphp @endif
@endif @if(count($package_items) > 0)

@if(!empty($sample->eNDUSERLABORDER->eNDUSER->IS_COMPANY) &&$sample->eNDUSERLABORDER->eNDUSER->IS_COMPANY == 1 && $sample->eNDUSERLABORDER->eNDUSER->IS_CLIENT_TEST_DETAILS) {{!empty($sample->lABCATEGORYPACKAGE->CLIENT_TEST_NAME_EN) ? $sample->lABCATEGORYPACKAGE->CLIENT_TEST_NAME_EN : $sample->lABCATEGORYPACKAGE->NAME_EN }} @else {{$sample->lABCATEGORYPACKAGE->NAME_EN}} @endif - Items

@foreach($package_items as $package_item) @endforeach
Test ID Test Type Status Urgent PostPone
{{$package_item->ID}} {{$package_item->PACKAGE_NAME}} {{$package_item->STATUS_NAME}} @if($package_item->IS_STAT) @endif @if($package_item->IS_POSTPONE) @php array_push($PostPoneTests,$package_item->PACKAGE_NAME) @endphp @endif
@else @if(empty($sample->lABCATEGORYPACKAGE->TEST_CATEGORY))

CT Values

@endif @if(count($package_blocks) > 0)

@if(!empty($sample->eNDUSERLABORDER->eNDUSER->IS_COMPANY) &&$sample->eNDUSERLABORDER->eNDUSER->IS_COMPANY == 1 && $sample->eNDUSERLABORDER->eNDUSER->IS_CLIENT_TEST_DETAILS) {{!empty($sample->lABCATEGORYPACKAGE->CLIENT_TEST_NAME_EN) ? $sample->lABCATEGORYPACKAGE->CLIENT_TEST_NAME_EN : $sample->lABCATEGORYPACKAGE->NAME_EN }} @else {{$sample->lABCATEGORYPACKAGE->NAME_EN}} @endif - Blocks

@foreach($package_blocks as $package_block) {{-- --}} {{-- One block on its own, rather than the whole set from the Print Barcode button above. Hidden without an intend number, for the same reason that button is: there is no code to print yet. --}} @endforeach
# Block Code Status
{{$package_item->ID}} {{$package_block->ID}} {{$package_block->BLOCK_CODE}} {{str_replace('Sample','Block',$package_block->STATUS_NAME)}} @if(!empty($sample->INTEND_NUMBER)) @endif
@endif @if(count($package_internals) > 0)
{{-- --}} @foreach($package_internals as $package_internal) @endforeach {{-- --}} {{-- --}} {{-- --}} {{-- --}} {{-- --}}
# Internal Code Status
{{$package_internal->ID}} {{$package_internal->INTERNAL_CODE}} Print Barcode
--}} {{-- --}} {{-- Print All--}} {{-- --}} {{--
@endif
lABCATEGORYPACKAGE->TEST_CATEGORY) && $sample->lABCATEGORYPACKAGE->TEST_CATEGORY != 1 && $sample->lABCATEGORYPACKAGE->TEST_CATEGORY != 5 ) style="display:none;max-height:100%;" @else style="max-height:100%;" @endif>

HESN+ Integration

HESN Requisition ID : @if((($sample->LAB_ORDER_STATUS_ID == 2 || $sample->LAB_ORDER_STATUS_ID == 1) && !empty($sample->eNDUSERLABORDER->HOSPITAL->MANUAL_HESN)) || (!empty(session('manual_hesn')) && empty($sample->eNDUSERLABORDER->HOSPITAL->MANUAL_HESN))) {{$sample->REQ_ID}} @else {{$sample->REQ_ID}} @endif
@if(!empty($sample->REQ_RES) && empty($sample->REQ_ID))
HESN Requisition Error : {{json_decode($sample->REQ_RES) ? json_decode($sample->REQ_RES)->Description : ""}}
@endif
HESN Synced Receive : @if($sample->HESNR_SYNC == 1)Synced@elseif($sample->HESNR_SYNC == 2) Failed@else Not Yet @endif
HESN Synced Result : @if($sample->HESN_SYNC == 1)Synced@elseif($sample->HESN_SYNC == 2) Failed@else Not Yet @endif
HESN Swab ID : @if(!empty($sample->SWAB_ID)){{ $sample->SWAB_ID }} @endif
@if(!empty($hashSample) && !empty($sample->SWAB_ID) && !empty($sample->RESULT) && $sample->RESULT == 2) @endif
@endif
@if(($sample->LAB_ORDER_STATUS_ID == 13 || $sample->LAB_ORDER_STATUS_ID == 2 || $sample->LAB_ORDER_STATUS_ID == 5 || $sample->LAB_ORDER_STATUS_ID == 6 || $sample->LAB_ORDER_STATUS_ID == 7) ) @if(!empty($sample->IS_SAMPLE) || empty($sample->lABCATEGORYPACKAGE->TEST_CATEGORY) || !empty($sample->lABCATEGORYPACKAGE->HAS_TEMPLATE)) @if($sample->LAB_ORDER_STATUS_ID == 2 && empty($sample->eNDUSERLABORDER->HOSPITAL->IS_PRIMARY) && empty($sample->eNDUSERLABORDER->HOSPITAL->IS_BRANCH))
Medical Complexes samples should be outsourced before receive
@else @permission('receive_sample') @if($showReceive)
@if($PostPoneTests)

Attention: You cannot receive this sample because you have tests in postponement:

    @foreach($PostPoneTests as $PostPoneTest)
  • {{ $PostPoneTest }}
  • @endforeach

Please split the tests to proceed with receiving the sample.

@else
@endif
@endif @if(!empty($sample->sampleGeneration) && !empty($sample->sampleGeneration->IS_REQUIRED_PREANALYTICAL && empty($sample->PREANALYTICAL_TIME)))

Attention: You cannot receive this sample because it requires preanalytical first

@endif @endpermission @endif @endif @elseif($sample->LAB_ORDER_STATUS_ID == 3 && empty(session('disable_pcr')) && empty($sample->IS_SAMPLE) && ( empty($sample->lABCATEGORYPACKAGE->TEST_CATEGORY) || $sample->lABCATEGORYPACKAGE->TEST_CATEGORY == 1 || $sample->lABCATEGORYPACKAGE->TEST_CATEGORY == 5 ) && (session('role') == 3 || session('role') == 4 || (session('role') == 7 && session('profile_id') == 4) || (session('role') == 9 && session('profile_id') == 4) || (session('role') == 7 && !empty(session('enable_validation'))) || (session('role') == 9 && !empty(session('enable_validation'))) )) @permission('sample_add_result')
@endpermission @elseif($sample->LAB_ORDER_STATUS_ID == 4 && empty($sample->IS_SAMPLE) && $Reference == 20 && empty($sample->lABCATEGORYPACKAGE->HAS_TEMPLATE)) @permission('sample_change_result')
@endpermission @permission('sample_draw_test') @endpermission @elseif($sample->LAB_ORDER_STATUS_ID == 4 && empty($sample->IS_SAMPLE))
@permission('sample_change_result') @endpermission @permission('sample_draw_test') @endpermission
@endif @if(!empty($sample->lABCATEGORYPACKAGE->HAS_TEMPLATE))
@if(!empty($sample->temlateSpecimen) && !empty($sample->temlateSpecimen->HAS_BLOCK)) @endif @if(empty($sample->INTEND_NUMBER)) @else Print Barcode @endif
@endif
@if(!empty($sample->lABCATEGORYPACKAGE->IS_GENETIC) && empty($sample->NG_CODE_ID)) @elseif(!empty($sample->NG_CODE_ID)) Print NG Code Barcode @endif
@if(!empty($sample->lABCATEGORYPACKAGE->IS_INTERNAL) && count($package_internals) == 0)
@endif @if(($sample->LAB_ORDER_STATUS_ID == 3 || $sample->LAB_ORDER_STATUS_ID == 2 || $sample->LAB_ORDER_STATUS_ID == 13 || $sample->LAB_ORDER_STATUS_ID == 12) && (!empty($sample->IS_SAMPLE) || empty($sample->lABCATEGORYPACKAGE->TEST_CATEGORY) || $sample->lABCATEGORYPACKAGE->TEST_CATEGORY == 5) && empty($sample->REJECT_REASON_ID) && $sample->LAB_ORDER_STATUS_ID != 4) @permission('reject_sample') @endpermission @endif {{-- On-Hold Sample Button --}} @if($sample->IS_ON_HOLD != 1) @permission('hold_sample') @if(($sample->LAB_ORDER_STATUS_ID == 3 || $sample->LAB_ORDER_STATUS_ID == 12 || $sample->LAB_ORDER_STATUS_ID == 2 || $sample->LAB_ORDER_STATUS_ID == 13) && $sample->LAB_ORDER_STATUS_ID != 4 && empty($sample->REJECT_REASON_ID)) @endif @endpermission @endif {{-- Proceed Sample Button --}} @if($sample->IS_ON_HOLD == 1) @permission('proceed_sample') @endpermission @endif @if(($sample->LAB_ORDER_STATUS_ID == 3 || $sample->LAB_ORDER_STATUS_ID == 12) && (!empty($sample->IS_SAMPLE) || empty($sample->lABCATEGORYPACKAGE->TEST_CATEGORY))) @permission('reset_sample')
@endpermission @endif @if (!empty(session('sample_error')))
{{session('sample_error')}}
@php session()->forget('sample_error'); @endphp @endif
@include('operations.components.sample-time-log')
@permission('sample_table_log')
@foreach($updates as $update) @endforeach
Updated By Updated Field Before Update After Update Time
{{$update->SYSTEM_USER_NAME}} {{$update->UPDATED_COLUMN}} @if(!empty($update->UPDATED_COLUMN == 'Patient Nationality')) @if($countries->filter(function($item) use ($update) { return $item->id == $update->PREUPDATE; })->first()) {{$countries->filter(function($item) use ($update) { return $item->id == $update->PREUPDATE; })->first()->name ?? null}} @endif @elseif(!empty($update->UPDATED_COLUMN == 'Result')) {{isset($update->PREUPDATE) && $update->PREUPDATE == 1 ? 'Negative' : 'Positive'}} @else {{!empty($update->PREUPDATE) ? $update->PREUPDATE : ''}} @endif @if(!empty($update->UPDATED_COLUMN == 'Patient Nationality')) {{$countries->filter(function($item) use ($update) { return $item->id == $update->POSTUPDATE; })->first()->name ?? null}} @elseif(!empty($update->UPDATED_COLUMN == 'Result')) {{$update->POSTUPDATE == 1 ? 'Negative' : 'Positive'}} @else {{$update->POSTUPDATE ?? ''}} @endif {{$update->UPDATE_TIME}}
@endpermission
@if($sample->lABCATEGORYPACKAGE->IS_ANALYSIS != 1 && $sample->lABCATEGORYPACKAGE->IS_RESULT_OPTION != 1 && $sample->lABCATEGORYPACKAGE->HAS_TEMPLATE != 1) {{-- Hold Sample Modal --}} @if($hasNphies) @endif @endsection @section('footer-scripts') @endsection