@extends('operations.layout.mainlayout') @php $show_pay_all=0;$pay_all=0;$show_collect_all=0;$show_discount_all=0;$show_sample_merge=0;$show_cancel_all=0;$show_refund_all=0;$show_refund_receipt = 0 @endphp @php $taxService = new \App\Services\TaxService(); $nationalities = $taxService->getNationalities($profile->ID); $global_html = $global_symbol['is_html'] ?? false; $cityMap = \App\Models\CITY::pluck('ENG_NAME', 'CITY_ID'); @endphp @section('content') @if (!empty(session('sample_error')))
{{session('sample_error')}}
@php session()->forget('sample_error'); @endphp @endif {{-- @if($order->HOSPITAL->PROFILE_ID != session('profile_id'))--}} {{-- {{exit("

Unauthorized access

")}}--}} {{-- @endif--}} {{-- @if(session('role') == 15 || session('role') == 17)--}} {{-- {{exit("

Unauthorized access

")}}--}} {{-- @endif--}} @if(empty($order->HOSPITAL->IS_PRIMARY)) @endif {{-- @if((session('role') == 14 && session('org_id') != $order->eNDUSER->ID))--}} {{-- {{exit("

Unauthorized access

")}}--}} {{-- @endif--}} {{-- @if((session('role') == 1 && session('hospital_id') != $order->HOSPITAL_ID) && empty($order->HOSPITAL->PLATFORM_ID))--}} {{-- {{exit("

Unauthorized access - This reservation is on :".$order->HOSPITAL->NAME_EN."

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

Reservation No. {{$order->ID}} {{$order->oRDERSTATU->LAB_DESC_EN}} @if(isset($order->IS_ERP) && $order->IS_ERP) @if(isset($order->HAS_INVOICE_ERP) && $order->HAS_INVOICE_ERP) @if(isset($order->ERP_INVOICE_STATUS) && !empty($order->ERP_INVOICE_STATUS)) @if(isset($order->ERP_INVOICE_STATUS['name']) && isset($order->ERP_INVOICE_STATUS['color'])) @if(isset($order->ERP_INVOICE_STATUS['is_updated']) && $order->ERP_INVOICE_STATUS['is_updated']) @permission('view_erp_report_and_re_sync') @if(!empty($order->eNDUSER->IS_COMPANY) && $order->eNDUSER->IS_COMPANY == 1) @if($order->PAYMENT_METHOD_ID == 3) @php $erp_invoice_type=\App\Services\ERP\ERPService::INVOICE_B2B_SALES_ORDER @endphp @else @php $erp_invoice_type=\App\Services\ERP\ERPService::TYPE_B2B_CASH_INVOICE @endphp @endif @else @php $erp_invoice_type=1 @endphp @endif ERP Invoice {{$order->ERP_INVOICE_STATUS['name']}} @else ERP Invoice {{$order->ERP_INVOICE_STATUS['name']}} @endpermission @else ERP Invoice {{$order->ERP_INVOICE_STATUS['name']}} @endif @endif @endif @endif @if(isset($order->HAS_ERP_REFUND) && $order->HAS_ERP_REFUND) @if(isset($order->REFUND_STATUS) && !empty($order->REFUND_STATUS)) @if(isset($order->REFUND_STATUS['name']) && isset($order->REFUND_STATUS['color'])) @if(isset($order->REFUND_STATUS['is_updated']) && $order->REFUND_STATUS['is_updated']) @permission('view_erp_report_and_re_sync') @if(!empty($order->eNDUSER->IS_COMPANY) && $order->eNDUSER->IS_COMPANY == 1) @php $erp_invoice_type=\App\Services\ERP\ERPService::TYPE_B2B_CASH_REFUND @endphp @else @php $erp_invoice_type=2 @endphp @endif ERP Refund {{$order->REFUND_STATUS['name']}} @else ERP Refund {{$order->REFUND_STATUS['name']}} @endpermission @else ERP Refund {{$order->REFUND_STATUS['name']}} @endif @endif @endif @endif @endif

@if(!empty($order->eNDUSER->IS_COMPANY) && $order->eNDUSER->IS_COMPANY == 1) paid @else gender @endif

{{$order->eNDUSER->FIRST_NAME}} {{$order->eNDUSER->LAST_NAME}} @if(!empty($order->FROM_WEBSITE) && $order->FROM_WEBSITE == 1) From Blazma.com@endif @if(!empty($order->eNDUSER->IS_COMPANY) && $order->eNDUSER->IS_COMPANY == 1) Internal Account@endif @if($order->TYPE_ID == 2) Home Visit Location@endif

Reference Order Id :   {{empty($order->REFERENCE_ORDER_ID) ? "" : $order->REFERENCE_ORDER_ID}}
Date of Birth: {{$order->eNDUSER->DATE_OF_BIRTH}} @if(!empty($order->DELIVERY_ADDRESS)) / Address : {{$order->DELIVERY_ADDRESS}} @endif
Branch : @if(!empty($order->HOSPITAL->NAME_EN)){{$order->HOSPITAL->NAME_EN}}@endif @if($order->HOSPITAL_ID == 920) - @if(!empty($order->LOCATION->NAME_EN)) {{$order->LOCATION->NAME_EN}} @endif @else @if(!empty($order->LOCATION->NAME_EN)) - {{$order->LOCATION->NAME_EN}}@endif @endif
Time : {{$order->SCHEDULE_DATE}} @if(!empty($order->HOMEVISIT_TIME)) {{$order->HOMEVISIT_TIME}} @else {{$order->TYPE_ID != 2 ? date('h:i A',strtotime($order->CREATE_DATE)) : date('h:i A',strtotime($order->lABAVAILABLETIME->FROM_TIME))}} @endif
Mobile #: {{$order->eNDUSER->country->dial_code}} {{$order->eNDUSER->MOBILE_NUMBER}}
Nationality : {{empty($order->eNDUSER->nationality->name) ? "" : $order->eNDUSER->nationality->name}}
Serial Number :   {{empty($order->SERIAL_NUMBER) ? "" : $order->SERIAL_NUMBER}}
paid

Financial Information

@if(isset($has_zatca) && $has_zatca && $order->IS_ZATCA) @if(isset($zatca_status) && !empty($zatca_status)) Zatca : @if($zatca_status['id'] == \App\Services\Zatca\ZatcaService::NOT_SYNC) @else @endif @endif @if($has_refund_zatca) @if(isset($zatca_refund_status) && !empty($zatca_refund_status)) @if($zatca_refund_status['id'] == \App\Services\Zatca\ZatcaService::REFUND_SYNC || $zatca_refund_status['id'] == \App\Services\Zatca\ZatcaService::REFUND_PROCESSING) @else @endif @endif @endif @endif
Order Totals
Subtotal : @if(empty(session('disable_price'))) {{$order->BASE_AMOUNT}} @if($global_html && isset($global_symbol['currency'])) {!! $global_symbol['currency'] !!} @else {!! $global_symbol['currency'] ?? 'SAR' !!} @endif @endif
Discount : @if(empty(session('disable_price'))) {{$order->DISCOUNT_AMOUNT}} @if($global_html && isset($global_symbol['currency'])) {!! $global_symbol['currency'] !!} @else {!! $global_symbol['currency'] ?? 'SAR' !!} @endif @endif
@if(!empty($profile->ENABLE_LOYALTY) && $order->POINT_AMOUNT > 0) @php $reservationLoyaltyService = new \App\Services\LoyaltyService(); $reservationTierSettings = $reservationLoyaltyService->tierSettings($order->END_USER_ID, $profile->ID, 'operations', $order->HOSPITAL_ID); $reservationPointValue = $reservationTierSettings && !empty($reservationTierSettings->valueOfPoint) ? $reservationTierSettings->valueOfPoint : ($profile->VALUE_OF_POINT ?? 0); @endphp
Points : @if(empty(session('disable_price'))) {{($order->POINT_AMOUNT / 100)}} @if($global_html && isset($global_symbol['currency'])) {!! $global_symbol['currency'] !!} @else {!! $global_symbol['currency'] ?? 'SAR' !!} @endif @if(!empty($reservationPointValue)) / ({{round(($order->POINT_AMOUNT / 100 ) / $reservationPointValue, 2)}}) Points @endif @endif
@endif @if(!empty($order->QITAF_AMOUNT) && $order->QITAF_AMOUNT > 0)
Qitaf : @if(empty(session('disable_price'))) {{$order->QITAF_AMOUNT}} @if($global_html && isset($global_symbol['currency'])) {!! $global_symbol['currency'] !!} @else {!! $global_symbol['currency'] ?? 'SAR' !!} @endif @endif
@endif
{{$global_symbol['tax'] ?? 'TAX'}} : @if(empty(session('disable_price'))) {{$order->TAX_AMOUNT}} @if($global_html && isset($global_symbol['currency'])) {!! $global_symbol['currency'] !!} @else {!! $global_symbol['currency'] ?? 'SAR' !!} @endif @endif
Net total : @if(empty(session('disable_price'))) {{$order->TOTAL_AMOUNT}} @if($global_html && isset($global_symbol['currency'])) {!! $global_symbol['currency'] !!} @else {!! $global_symbol['currency'] ?? 'SAR' !!} @endif @endif
@switch($order->PAYMENT_METHOD_ID) @case(1) Cash on delivery @break @case(2) @if(!empty($order->IS_TAMARA)) Online - Tamara - {{$order->FORT_ID}} @elseif(!empty($order->IS_TABBY))Online - Tabby - {{$order->FORT_ID}} @elseif(empty($order->EXTERNAL_INVOICE_ID)) Online - {{ $order->MERCHAT_REFERENCE ?? (!empty($order->onlinePayment) ? $order->onlinePayment->NAME . '-' . $order->FORT_ID : null) }} @else Bank Transfer - {{$order->EXTERNAL_INVOICE_ID}}@endif @break @case(3) Credit @break @endswitch Payment Method
@if(empty(session('disable_price'))) {{empty($order->AMOUNT) ? 0 : $order->AMOUNT / 100}} @endif Paid Amount
@if(empty(session('disable_price'))) {{empty($order->CASH_AMOUNT) ? 0 : $order->CASH_AMOUNT / 100}} @endif Cash Amount
@if(empty(session('disable_price'))) {{empty($order->VISA_AMOUNT) ? 0 : $order->VISA_AMOUNT / 100}} @endif Visa Amount
@if(empty(session('disable_price'))) {{empty($order->REFUND_AMOUNT) ? 0 : $order->REFUND_AMOUNT / 100}} @endif Refund Amount
{{-- --}} @if(!empty(session('enable_sample_generation')) && session('enable_sample_generation')) @endif @foreach($order->Packages as $package) @if($package->pivot->IS_ADDITIONAL && empty($package->pivot->SAMPLE_ID)) @php $show_sample_merge=1; @endphp @endif @php $isGenetic = $package->IS_GENETIC; $packageIdentification = $package->pivot->IDENTIFICATION; $isMemberAlreadyAdded = $orderMembers->contains('IDENTIFICATION', $packageIdentification); @endphp {{--@if(!empty(app('request')->input('identification')) && app('request')->input('identification') != $package->pivot->IDENTIFICATION) @continue @endif--}} {{-- --}} @if(!empty(session('enable_sample_generation')) && session('enable_sample_generation')) @endif @endforeach
+ Test ID Test Type Name Mobile ID Type ID No. Passport Country DOB Gender Email Original Price Address Patient History Net Price ActionInvoicingCancel Questionnaire StatusPostponeSTAT MRN City
@if(!empty($package->IS_PACKAGE)) @endif @permission('view_samples_details') {{$package->pivot->ID}} @else {{$package->pivot->ID}} @endpermission @if(!empty($order->eNDUSER->IS_COMPANY) && $order->eNDUSER->IS_COMPANY == 1 && $order->eNDUSER->IS_CLIENT_TEST_DETAILS) {{!empty($package->CLIENT_TEST_NAME_EN) ? $package->CLIENT_TEST_NAME_EN : $package->NAME_EN}} @else {{$package->NAME_EN}} @endif @if(!empty($package->pivot->SEHA_CERT)) Seha Certificate @endif @if(!empty(session('enable_sample_generation'))) {{$package->pivot->NAME}} ({{$package->pivot->IDENTIFICATION}}) @permission('reservations_edit_info') @endpermission @permission('reservations_work_request') @if(empty(session('enable_ldm_integration')))Work Request@endif @endpermission {{-- Opens this patient's file in the NPHIES clinical portal. --}} @include('operations.nphies.patient-launch-button', [ 'endUserId' => $order->END_USER_ID, 'buttonClass' => 'table-header-btn', ]) @permission('reservations_add_test') @if($package->pivot->IS_PAID == 0 && (!in_array($order->ORDER_STATUS_ID,[-1,-2,-3,-4]) ) && $package->pivot->LAB_ORDER_STATUS_ID != -3 && !($isGenetic && $isMemberAlreadyAdded)) @endif @endpermission {{-- Patient Information modal trigger (beside Edit information / Work Request) --}} @php $patientNationality = !empty($package->pivot->NATIONALITY_ID) ? $countries->firstWhere('id', $package->pivot->NATIONALITY_ID) : null; $patientAge = !empty($package->pivot->DATE_OF_BIRTH) ? \Carbon\Carbon::parse($package->pivot->DATE_OF_BIRTH)->age : null; $patientGender = ''; switch ($package->pivot->GENDER_ID) { case 1: $patientGender = 'Male'; break; case 2: $patientGender = 'Female'; break; } $patientMobile = ''; if (!empty($package->pivot->MOBILE_NUMBER)) { $patientMobile = \Illuminate\Support\Str::startsWith($package->pivot->MOBILE_NUMBER, '+') ? $package->pivot->MOBILE_NUMBER : '+966 '.$package->pivot->MOBILE_NUMBER; } @endphp @else @if(($package->pivot->LAB_ORDER_STATUS_ID < 3) || session('role') == 4 || session('role') == 10) @endif {{$package->pivot->NAME}} @if(($package->pivot->LAB_ORDER_STATUS_ID < 3) || session('role') == 4 || session('role') == 10) @endif @endif @if($editPatientInfo) {{empty($package->pivot->MOBILE_NUMBER) ? "" : $package->pivot->MOBILE_NUMBER}} @else {{empty($package->pivot->MOBILE_NUMBER) ? "" : $package->pivot->MOBILE_NUMBER}} @endif @if($editPatientInfo) {{$package->pivot->IDENTIFICATION_TYPE}} @else {{$package->pivot->IDENTIFICATION_TYPE}} @endif @if($editPatientInfo && $editIdAndNationality) @if(!empty($package->pivot->IDENTIFICATION)) {{$package->pivot->IDENTIFICATION}} @else empty @endif @else @if(!empty($package->pivot->IDENTIFICATION)) {{$package->pivot->IDENTIFICATION}} @else empty @endif @endif @if($editPatientInfo) {{$package->pivot->PASSPORT}} @else {{$package->pivot->PASSPORT}} @endif @if(!empty($package->pivot->NATIONALITY_ID)) @php $nationality = $countries->firstWhere('id', $package->pivot->NATIONALITY_ID); @endphp {{ $nationality->name ?? 'Select Nationality' }} @else Select Nationality @endif @if($editPatientInfo) {{$package->pivot->DATE_OF_BIRTH}} @else {{$package->pivot->DATE_OF_BIRTH}} @endif @if($editPatientInfo) @switch($package->pivot->GENDER_ID) @case(1) Male @break @case(2) Female @break @endswitch @else @switch($package->pivot->GENDER_ID) @case(1) Male @break @case(2) Female @break @endswitch @endif @if($editPatientInfo) @else {{$package->pivot->EMAIL}} @endif @if(empty(session('disable_price'))) @php $originalPrice = null; $priceWithoutTax = null; if ($package->pivot->TAX > 0) { $basePrice = $package->pivot->PRICE / ($package->pivot->TAX + 1); $priceWithoutTax = $basePrice + $package->pivot->DISCOUNT_AMOUNT; $originalPrice = ($priceWithoutTax * $package->pivot->TAX) + $priceWithoutTax; } else { $originalPrice = $package->pivot->PRICE + $package->pivot->DISCOUNT_AMOUNT; $priceWithoutTax = $originalPrice; } @endphp {{round($originalPrice,2)}} @else - @endif @if($editPatientInfo) @if($order->eNDUSER) @if($order->eNDUSER->IDENTIFICATION == $package->pivot->IDENTIFICATION) {{$order->eNDUSER->PATIENT_ADDRESS}} @else @if($order->eNDUSER->member) {{$order->eNDUSER->member()->where(["IDENTIFICATION"=>$package->pivot->IDENTIFICATION,"END_USER_ID"=>$order->eNDUSER->ID])->first()->PATIENT_ADDRESS ?? ''}} @endif @endif @endif @else @if($order->eNDUSER) @if($order->eNDUSER->IDENTIFICATION == $package->pivot->IDENTIFICATION) {{$order->eNDUSER->PATIENT_ADDRESS}} @else @if($order->eNDUSER->member) {{$order->eNDUSER->member()->where(["IDENTIFICATION"=>$package->pivot->IDENTIFICATION,"END_USER_ID"=>$order->eNDUSER->ID])->first()->PATIENT_ADDRESS ?? ''}} @endif @endif @endif @endif @if($editPatientInfo) @if(empty($order->eNDUSER->IS_COMPANY) || $order->eNDUSER->IS_COMPANY == 0) @if($order->eNDUSER) @if($order->eNDUSER->IDENTIFICATION == $package->pivot->IDENTIFICATION) {{$order->eNDUSER->PATIENT_HISTORY}} @else @if($order->eNDUSER->member) {{$order->eNDUSER->member()->where(["IDENTIFICATION"=>$package->pivot->IDENTIFICATION,"END_USER_ID"=>$order->eNDUSER->ID])->first()->PATIENT_HISTORY ?? ''}} @endif @endif @endif @endif @else @if($order->eNDUSER) @if($order->eNDUSER->IDENTIFICATION == $package->pivot->IDENTIFICATION) {{$order->eNDUSER->PATIENT_HISTORY}} @else @if($order->eNDUSER->member) {{$order->eNDUSER->member()->where(["IDENTIFICATION"=>$package->pivot->IDENTIFICATION,"END_USER_ID"=>$order->eNDUSER->ID])->first()->PATIENT_HISTORY ?? ''}} @endif @endif @endif @endif @if(empty(session('disable_price'))) @if($order->END_USER_ID == 225329 || (empty($order->HOSPITAL_ID) && empty($order->eNDUSER->IS_COMPANY))) @if($package->pivot->TAX > 0) {{round($package->pivot->PRICE + ($package->pivot->PRICE * $package->pivot->TAX),2)}} @else {{round($package->pivot->PRICE,2)}} @endif @elseif($order->HOSPITAL_ID != 2) {{round($package->pivot->PRICE,2)}} @if($global_html && isset($global_symbol['currency'])) {!! $global_symbol['currency'] !!} @else {!! $global_symbol['currency'] ?? 'SAR' !!} @endif @else @if($package->pivot->TAX > 0) {{round($package->pivot->PRICE + ($package->pivot->PRICE * $package->pivot->TAX),2)}} @else {{round($package->pivot->PRICE,2)}} @endif @endif @endif {{-- @permission('reservations_refund')--}} {{-- @if(!empty($package->pivot->IS_PAID) && ($order->PAYMENT_METHOD_ID == 1 || ($order->PAYMENT_METHOD_ID == 2 && in_array('reservation_refund_online', session('permissions', []) ?? array())) ) && ($package->pivot->LAB_ORDER_STATUS_ID == 1 || $package->pivot->LAB_ORDER_STATUS_ID == -1) && (!empty($order->HOSPITAL->IS_PRIMARY) || !empty($order->HOSPITAL->IS_BRANCH)))--}} {{-- @php $show_refund_all=1; @endphp--}} {{-- --}} {{-- @endif--}} {{-- @endpermission--}} @if($package->pivot->LAB_ORDER_STATUS_ID == -2) @php $show_refund_receipt = 1 @endphp @endif @if((empty($package->pivot->IS_PAID) && $package->pivot->LAB_ORDER_STATUS_ID != -3 && $order->PAYMENT_METHOD_ID != 2 && empty($order->eNDUSER->IS_COMPANY)) || (empty($package->pivot->IS_PAID) && $order->PAYMENT_METHOD_ID == 1 && !empty($order->eNDUSER->IS_COMPANY) && $package->pivot->LAB_ORDER_STATUS_ID != -3)) @php $show_discount_all = 1; @endphp @permission('reservations_discount') {{-- @if($order->DISCOUNT_AMOUNT==0 and $package->pivot->DISCOUNT_AMOUNT==0)--}} @if(!($package->IS_PACKAGE && empty($systemUser->ALLOW_PACKAGE_DISCOUNT))) @endif @endpermission @endif @permission('reservations_refund') @if(!empty($package->pivot->IS_PAID) && ($order->PAYMENT_METHOD_ID == 1 || ($order->PAYMENT_METHOD_ID == 2 && in_array('reservation_refund_online', session('permissions', []) ?? array())) ) && ($package->pivot->LAB_ORDER_STATUS_ID == 1 || $package->pivot->LAB_ORDER_STATUS_ID == -1) && (!empty($order->HOSPITAL->IS_PRIMARY) || !empty($order->HOSPITAL->IS_BRANCH))) @php $show_refund_all=1; @endphp @endif @endpermission @if((empty($package->IS_PACKAGE) && $package->TEST_CATEGORY != 10 && $package->pivot->LAB_ORDER_STATUS_ID == 1 && ($package->pivot->IS_PAID == 1 || $order->PAYMENT_METHOD_ID == 2 || $order->PAYMENT_METHOD_ID == 3)) && ( $package->pivot->IS_PAID == 1 || $order->PAYMENT_METHOD_ID == 3 || $order->PAYMENT_METHOD_ID == 2) && empty(session('location_id'))) @permission('reservations_collect') @endpermission {{-- @elseif((empty(session('org_id')) && !empty($package->IS_PACKAGE) && $package->pivot->LAB_ORDER_STATUS_ID == 1 && ($package->pivot->IS_PAID == 1 || $order->PAYMENT_METHOD_ID == 2 || $order->PAYMENT_METHOD_ID == 3)) && ( $package->pivot->IS_PAID == 1 || $order->PAYMENT_METHOD_ID == 3 || $order->PAYMENT_METHOD_ID == 2))--}} {{-- --}} @elseif($package->pivot->LAB_ORDER_STATUS_ID == -1 && $package->TEST_CATEGORY != 10 && empty($package->IS_PACKAGE)) @permission('reservations_collect') @endpermission @elseif($package->pivot->LAB_ORDER_STATUS_ID != 1 && empty($package->IS_PACKAGE) && $package->TEST_CATEGORY != 10 && ($package->pivot->IS_PAID == 1 || $order->PAYMENT_METHOD_ID == 3 || $order->PAYMENT_METHOD_ID == 2)) @permission('reservations_print_barcodes') @if(empty($package->pivot->BARCODE_PRINT)) Print @else Printed @endif @endpermission @elseif($package->pivot->LAB_ORDER_STATUS_ID != 1 && !empty($package->IS_PACKAGE) && ($package->pivot->IS_PAID == 1 || $order->PAYMENT_METHOD_ID == 3 || $order->PAYMENT_METHOD_ID == 2)) @elseif($package->pivot->LAB_ORDER_STATUS_ID == 1 && empty($package->pivot->IS_PAID) && $order->PAYMENT_METHOD_ID == 1 && empty(session('location_id'))) @php $pay_all += $package->pivot->PRICE; $show_pay_all = 1; @endphp @permission('reservations_pay') @endpermission @endif @if($package->pivot->LAB_ORDER_STATUS_ID != -3) @endif @permission('reservations_cancel') @if(($package->pivot->LAB_ORDER_STATUS_ID == 1 && $package->pivot->IS_PAID == 0 && $order->PAYMENT_METHOD_ID == 1) || (($package->pivot->LAB_ORDER_STATUS_ID == 2 || ($package->IS_SERVICE && $package->pivot->LAB_ORDER_STATUS_ID == 1)) && $order->PAYMENT_METHOD_ID == 3)) @php $show_cancel_all=1; @endphp @endif @endpermission @if(!empty($lab_category_answers) && in_array($package->ID, $lab_category_answers))   @endif @if($package->pivot->LAB_ORDER_STATUS_ID == -3) Cancelled @elseif($package->pivot->LAB_ORDER_STATUS_ID == 1) Confirmed @elseif($package->pivot->LAB_ORDER_STATUS_ID == 2) Sample Collected @elseif($package->pivot->LAB_ORDER_STATUS_ID == 3) Received @elseif($package->pivot->LAB_ORDER_STATUS_ID == 5) Outsourced @elseif($package->pivot->LAB_ORDER_STATUS_ID == -1) Rejected @elseif($package->pivot->LAB_ORDER_STATUS_ID == -2) Refunded (@if($package->pivot->VISA_REFUND) VISA @elseif($order->IS_TAMARA)Tamara @elseif($order->IS_TABBY)Tabby @else Cash @endif) @elseif($package->pivot->LAB_ORDER_STATUS_ID == 9) Partially Collected @elseif($package->pivot->LAB_ORDER_STATUS_ID == 10) Partially Received @elseif($package->pivot->LAB_ORDER_STATUS_ID == 11) Partially Ready @elseif($package->pivot->LAB_ORDER_STATUS_ID == 13) Pre Analytical @elseif($package->pivot->LAB_ORDER_STATUS_ID == -4) Partially Rejected @elseif($package->pivot->LAB_ORDER_STATUS_ID == 4 && (empty($package->TEST_CATEGORY) || $package->TEST_CATEGORY == 5)) pivot->ID, $encrypt_method, $key, 0, $iv ) ); echo $output; @endphp/pdf">Result @elseif($package->pivot->LAB_ORDER_STATUS_ID == 4 && ($package->TEST_CATEGORY == 10 || !empty($package->IS_PACKAGE))) @if(!$package->DISABLE_REPORT) @if(!$package->HAS_TEMPLATE) IS_CONFIDENTIAL) data-confirm="1" @endif > Medical Report IS_CONFIDENTIAL) data-confirm="1" @endif > Smart Report @php $approvedRecommendation = \App\Models\ENDUSERAIRECOMMENDATION::where('END_USER_LAB_ORDER_ID', $order->ID) ->where('IDENTIFICATION', $package->pivot->IDENTIFICATION) //->where('STATUS_ID', 1) ->first(); @endphp @if($approvedRecommendation && session('role') == 4) AI Report @endif @else Template Report @endif @permission('reservations_release_report') @endpermission @endif @endif @if(empty($package->IS_PACKAGE))
pivot->IS_POSTPONE) && $package->pivot->IS_POSTPONE==1) checked="checked" @endif @if(!in_array('reservations_edit_postpone', session('permissions', []) ?? array()) || !in_array($package->pivot->LAB_ORDER_STATUS_ID,[1,2])) disabled="disabled" @endif class="custom-control-input post-pone" sample-id="{{$package->pivot->ID}}" name="post_pone">
@endif
@if(empty($package->IS_PACKAGE))
pivot->IS_STAT) && $package->pivot->IS_STAT==1) checked="checked" @endif @if(!in_array('reservations_edit_urgent', session('permissions', []) ?? array()) || !in_array($package->pivot->LAB_ORDER_STATUS_ID,[1,2])) disabled="disabled" @endif class="custom-control-input is-stat" sample-id="{{$package->pivot->ID}}" name="is_stat">
@endif
@if($editPatientInfo) {{$package->pivot->MRN}} @else {{$package->pivot->MRN}} @endif @if($editPatientInfo) @if($order->eNDUSER) @if($order->eNDUSER->IDENTIFICATION == $package->pivot->IDENTIFICATION) {{$cityMap[$order->eNDUSER->PATIENT_CITY_ID] ?? ''}} @else @if($order->eNDUSER->member) @php $cityValue = $order->eNDUSER->member()->where(["IDENTIFICATION"=>$package->pivot->IDENTIFICATION,"END_USER_ID"=>$order->eNDUSER->ID])->first()->PATIENT_CITY_ID ?? ''; @endphp @if(!empty($cityValue)) {{$cityMap[$cityValue]}} @endif @endif @endif @endif @else @if($order->eNDUSER) @if($order->eNDUSER->IDENTIFICATION == $package->pivot->IDENTIFICATION) {{$cityMap[$order->eNDUSER->PATIENT_CITY_ID] ?? ''}} @else @if($order->eNDUSER->member) @php $cityValue = $order->eNDUSER->member()->where(["IDENTIFICATION"=>$package->pivot->IDENTIFICATION,"END_USER_ID"=>$order->eNDUSER->ID])->first()->PATIENT_CITY_ID ?? ''; @endphp @if(!empty($cityValue)) {{$cityMap[$cityValue]}} @endif @endif @endif @endif @endif
@endsection @section('footer-scripts') @if(!empty($order->INSURANCE_ID) && !in_array($order->ORDER_STATUS_ID, [-1, -2, -3])) @include('operations.insurance.insurance-scripts') @endif @endsection