@extends('layouts.main') @push('styles') @endpush @section('content')

{{ __('surgery.theatre_module_surgery') }}

@include('patients::allergies.header')

@if(isset($surgeries) && count($surgeries) > 0)
{{ __('surgery.previous_surgeries_from_episode') }} {{ streamline_date(get_name($episode_id, 'id', 'created_at', 'patient_episodes')) }} @foreach($surgeries as $item) @endforeach
{{ __('surgery.surgery') }} {{ __('surgery.anaesthetist') }} {{ __('surgery.surgeon') }} {{ __('surgery.time_of_commencement') }} {{ __('surgery.date') }}
@php $procedures_array = explode(",", $item->procedure_id); @endphp @for ($i = 0; $i < count($procedures_array); $i++) - {{ get_name($procedures_array[$i],'id','name','procedures') }}
@endfor
{{ get_full_name($item->surgeon, 'id', 'first_name', 'last_name', 'users') }} {{ get_full_name(get_name($item->anaesthesia_id,'id','anaesthetist','anaesthesias'),'id','first_name','last_name','users') }} {{ get_name($item->anaesthesia_id,'id','time_commenced','anaesthesias') }} {{ streamline_date($item->created_at) }} {{ __('surgery.view_details') }} Edit Details
@endif
@include('flash::message') @php $consultation = \Streamline\Models\Consultation::where(['episode_id' => $episode_id, 'patient_id' => $patient_id])->first(); @endphp @foreach ($errors->all() as $error)
{{ $error }}
@endforeach

{{ __('surgery.create_surgery') }}


{{ Form::open(['route' => 'theatre_surgery.store','data-toggle'=>'validator']) }} @if(!is_null($anaesthesia)) {{Form::hidden('anaesthesia_id', $anaesthesia->id)}} @endif {{Form::hidden('anaesthesia_complete', $anaesthesia_complete)}}
{{ __('inpatient.primary_diagnosis') }} {{ __('inpatient.prompt') }} {{ __('inpatient.references') }}
{{ Form::select('primary_diagnosis', $diagnoses, $consultation ? $consultation->primary_diagnosis : "", ['class' => 'form-control select_field col-sm-12 compulsory', 'required', 'id' => 'primary_diagnosis']) }}
{{ (isset($consultation->primary_diagnosis) && $consultation->primary_diagnosis != 0) ? $diagnoses_all->firstWhere('id',$consultation->primary_diagnosis)->prompts : "" }} 
@if(!is_null($consultation) && $consultation->primary_diagnosis != 0) @php $reference_names = explode(",", get_name($consultation->primary_diagnosis, 'id', 'reference_names', 'diagnoses')); $reference_areas = explode(",", get_name($consultation->primary_diagnosis, 'id', 'reference_areas', 'diagnoses')); @endphp @for($i = 0; $i < count($reference_names); $i++) @if(isset($reference_areas[$i]) && isset($reference_names[$i])) {{ $reference_names[$i] }} | @endif @endfor @endif
{{ __('consultations.add_new_diagnosis') }}

@php $other_diagnoses = []; if($consultation){ $other_diagnoses = @unserialize($consultation->other_diagnoses); } @endphp @if(empty($other_diagnoses)) @else @foreach($other_diagnoses as $diagnosis) @endforeach @endif
# {{ __('inpatient.other_diagnosis') }} {{ __('inpatient.prompt') }} {{ __('inpatient.references') }}
{{ Form::select('other_diagnosis[]', $diagnoses, '', ['class' => 'form-control col-sm-12 sec_d']) }}
 
 
{{ Form::select('other_diagnosis[]', $diagnoses, $diagnosis, ['class' => 'form-control col-sm-12 select sec_d']) }}
{{ is_object($diagnoses_all->firstWhere('id',$diagnosis)) ? $diagnoses_all->firstWhere('id',$diagnosis)->prompts : '' }} 
{{ is_object($diagnoses_all->firstWhere('id',$diagnosis)) ? $diagnoses_all->firstWhere('id',$diagnosis)->reference_names : '' }} 
{{ __('inpatient.add_row') }} {{ __('inpatient.delete_row') }}


{{ Form::label('procedure_id', __('surgery.surgical_procedure')) }} {{ Form::select('procedure_id[]',$procedures,$anaesthesia_complete ? $anaesthesia->procedure_id : '',['class' => 'form-control select compulsory', 'required', 'data-error'=>'','id'=>'procedure_id', 'multiple'=>'true']) }}
New procedure
{{ Form::label('surgeon',__('surgery.surgeon')) }} {{ Form::select('surgeon', $doctors, '', ['class' => 'form-control compulsory', 'required', 'data-error'=>'', 'id'=>'surgeon', 'onchange'=>'get_cadre(this.value)']) }}
add new surgeon
{{ Form::label('cadre',__('surgery.cadre')) }} {{ Form::text('cadre','',['class' => 'form-control', 'data-error'=>'','id'=>'cadre','readonly'=>'true']) }}
{{ Form::hidden('procedure_hospital_fee', 0, ['class' => 'form-control performance_fee', 'readonly', 'id' => 'procedure_hospital_fee']) }} {{ Form::label('staff_fee', 'Staff fee (PF: Professional Fee)') }} {{ Form::number('procedure_performance_fee', 0, ['class' => 'form-control performance_fee', 'id' => 'first_procedure_performance_fee']) }}
{{ Form::label('scrub_nurse',__('surgery.scrub_nurse')) }} {{ Form::select('scrub_nurse', $nursing, 0, ['class' => 'form-control compulsory required', 'data-error'=>'','id'=>'scrub_nurse']) }}
add new nurse
{{ Form::label('authorised_swab_check',__('surgery.scrub_check_authorized_by')) }} {{ Form::select('authorised_swab_check', $nursing, 0,['class' => 'form-control compulsory required', 'data-error'=>'','id'=>'authorised_swab_check']) }}
{{ Form::label('date_surgery_completed',__('surgery.date_surgery_completed')) }}
{{ Form::text('date_surgery_completed',date('Y-m-d'),['class' => 'form-control','readonly','id'=>'datepicker-autoclose']) }}
{{ Form::label('time_surgery_completed',__('surgery.time_surgery_completed')) }} {{ Form::time('time_surgery_completed','',['class' => 'form-control', 'data-error'=>'','id'=>'time_surgery_completed']) }}
{{ Form::label('estimated_blood_loss',__('surgery.estimated_blood_loss')) }} {{ Form::number('estimated_blood_loss','',['class' => 'form-control', 'data-error'=>'','id'=>'estimated_blood_loss']) }}
{{ Form::label('comments',__('surgery.comments')) }} {{ Form::textarea('comments','',['class' => 'form-control', 'data-error'=>'','id'=>'comments']) }}
{{ __('surgery.completed_by') }} {{ auth()->user()->first_name }} {{ auth()->user()->last_name }} {{ __('surgery.on') }} {{ streamline_date(date('d-m-Y')) }}


{{ Form::label('surgery_type',__('surgery.surgery_type')) }}
{{ Form::radio('surgery_type', 1, false, ["required"]) }} {{ __('surgery.elective') }}    {{ Form::radio('surgery_type', 2, false, ["required"]) }} {{ __('surgery.emergency') }}
{{ Form::label('assistant_surgeon',__('surgery.assistant_surgeon')) }} {{ Form::select('assistant_surgeon', $doctors, 0, ['class' => 'form-control compulsory', 'data-error'=>'','id'=>'assistant_surgeon','required']) }}
{{ __('surgery.add_new_assistant_surgeon') }}
{{ Form::label('other_scrub_nurse',__('surgery.other_scrub_staff')) }} {{ Form::select('other_scrub_staff', $nursing, 0,['class' => 'form-control', 'data-error'=>'','id'=>'other_scrub_staff','required']) }}
{{ __('surgery.add_new_scrub_staff') }}
{{ Form::label('theatre_location',__('surgery.theatre_location')) }} {{ Form::select('theatre_location',$theatre_locations,'',['class' => 'form-control', 'data-error'=>'','id'=>'theatre_location']) }}
{{ __('surgery.add_new_theatre_location') }}
{{ Form::label('theatre_incharge',__('theatre_surgeries.designated_incharge')) }} {{ Form::select('theatre_incharge', $theatre_in_charge_users, 0,['class' => 'form-control compulsory', 'data-error'=>'','id'=>'theatre_incharge','required']) }}
{{ __('surgery.add_new_nurse') }}
{{ Form::label('outcome',__('surgery.outcome')) }} {{ Form::select('outcome',$outcomes, is_null($episode_consultation_outcome) ? '' : $episode_consultation_outcome ,['class' => 'form-control', 'data-error'=>'','id'=>'outcome','required']) }}
{{ Form::label('sundries_used','Sundries used') }} {{ Form::select('sundries_used[]',$sundries_array,'',['class' => 'form-control sundries_sutures select_field', 'data-error'=>'','id'=>'vicryl_sutures_used']) }}
{{ Form::label('sundries_quantity_used','Quantity used') }} {{ Form::number('sundries_quantity_used[]','',['class' => 'form-control', 'data-error'=>'']) }}
Add other sundries used

{{ Form::label('extras_used','Extras used') }} {{ Form::text('extras_used[]','',['class' => 'form-control', 'data-error'=>'']) }}
{{ Form::label('extras_cost','Cost') }} {{ Form::number('extras_cost[]','',['class' => 'form-control', 'data-error'=>'']) }}
Add other extras used

{{ Form::select('drugs[]', $drugs, '', ['class' => 'form-control select_field other_drug_id','style'=>'margin-bottom: 5px;', 'id' => 'other_drug_id_0']) }}
{{ Form::number('dose[]', '', ['class' => 'form-control other_drug_dose', 'id' => 'other_drug_dose_0']) }}
{{ Form::select("units[]", $units, "", ["class" => "form-control select other_drug_unit", 'id' => 'other_drug_unit_0']) }}
{{ __('anaesthetics.add_more_drugs') }}

{{ __('surgery.if_any_risks_alert') }}.
{{ Form::submit(__('surgery.complete'),['class' => 'btn btn-success', 'onclick'=>'return confirm_outcome()']) }}
{{ Form::close() }}
@include('patients::consultations.add_diagnosis') @endsection @push('scripts') @endpush