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

{{ __('consultations.edit_consultation') }}

@php $patient_id = session('patient_id'); $episode_id = session('episode_id'); $episode_created_at = Carbon\Carbon::parse($episode->created_at); $episode_has_grand_parent_episode = false; @endphp
@include('patients::allergies.header')

@if(check_if_episode_is_a_followup($episode->id)) @php $parent_episode_details = \Streamline\Models\PatientEpisode::find($episode->parent_episode_id); $parent_consultations = \Streamline\Models\Consultation::where(['episode_id' => $parent_episode_details->id])->get(); $parent_consultation_details = count($parent_consultations) > 0 ? $parent_consultations->first() : null; $parent_triage_details = \Streamline\Models\Triage::where(['id' => $parent_episode_details->triage_id])->first(); $parent_consultation_notes = \Streamline\Models\WardInpatientDetailedNote::where(['patient_id' => $episode->patient_id, 'episode_id' => $episode->parent_episode_id, 'ward_id' => 0])->get(); if(check_if_episode_is_a_followup($parent_episode_details->id)){ $episode_has_grand_parent_episode = true; $grand_parent_episode_details = \Streamline\Models\PatientEpisode::find($parent_episode_details->parent_episode_id); $grand_parent_episode_treatments = \Streamline\Models\Treatment::where(['patient_id' => $patient_id, 'episode_id' => $grand_parent_episode_details->id, 'tta' => 0])->get(); $grand_parent_episode_ordered_procedures = \Streamline\Models\OrderedProcedure::where(['patient_id' => $patient_id, 'episode_id' => $grand_parent_episode_details->id])->get(); $grand_parent_episode_ordered_investigations = \Streamline\Models\OrderedInvestigation::where(['patient_id' => $patient_id, 'episode_id' => $grand_parent_episode_details->id])->get(); $grand_parent_episode_ordered_sundries = \Streamline\Models\OrderedSundry::where(['patient_id' => $patient_id, 'episode_id' => $grand_parent_episode_details->id])->get(); $grand_parent_episode_investigation_results = \Streamline\Models\InvestigationResults::where(['patient_id' => $patient_id, 'episode_id' => $grand_parent_episode_details->id])->get(); } @endphp @endif {{ Form::model($consultation, ['route' => ['consultation.update',$consultation->id],'method'=>'PUT', 'id'=>'consultation_edit_form']) }} @if(count($past_episodes_info) > 0)

Previous Consultations (Upto latest 5 consultations with a diagnosis)

@foreach($past_episodes_info as $past_episode) @endforeach
Date Clinic Primary Diagnosis Other Diagnoses Consultation By
{{ $past_episode['start_date'] }}
@if(check_if_episode_is_a_followup($past_episode["episode_id"]))
({{ __('patient_episode.review_from') }} {{ streamline_date(get_name(get_name($past_episode["episode_id"], 'id', 'parent_episode_id', 'patient_episodes'), 'id', 'created_at', 'patient_episodes')) }})
@endif
{{ $past_episode['clinic'] }} {{ get_name($past_episode['primary_diagnosis'], 'id', 'name', 'diagnoses') }} @if(count($past_episode['other_diagnoses']) > 0 && !(count($past_episode["other_diagnoses"]) == 1 && $past_episode["other_diagnoses"][0] == null))
    @foreach($past_episode['other_diagnoses'] as $value)
  • {{ get_name($value, 'id', 'name', 'diagnoses') }}
  • @endforeach
@endif
{{ $past_episode['doctor'] }} Details
@endif
{{ __('consultations.triage_grade') }} : @if($triage) @switch($triage->severe_grade) @case (1)
{{ __('consultations.green') }}
@break @case (2)
{{ __('consultations.yellow') }}
@break @case (3)
{{ __('consultations.red') }}
@break @default {{ __('consultations.triage_grade_not_determined') }} @endswitch @endif
{{ __('consultations.symptoms') }} : @if($triage) @php $symptoms_array = explode(",", $triage->symptoms); @endphp @php $symptoms_duration_array = explode(",", $triage->symptom_duration); @endphp
@php $counter = 0; @endphp @for($i = 0; $i < count($symptoms_array); $i++) @endfor
{{ __('consultations.symptom') }} {{ __('consultations.duration') }}
{{ isset($symptoms[$symptoms_array[$i]]) ? $symptoms[$symptoms_array[$i]] : "" }} {{ isset($symptoms_duration_array[$i]) ? $symptoms_duration_array[$i] : "" }}
@else {{ __('consultations.no_symptom_recorded') }} @endif

@if($triage) @php $observations_array = explode(',', $triage->observations); //i.e[temp=44,height=2] $parent_observation_array = isset($parent_triage_details) ? explode(',', $parent_triage_details->observations): []; @endphp
@if(check_if_episode_is_a_followup($episode->id)) @endif @php $counter = 0; @endphp @foreach($observations_array as $observation) @php $item_array = explode('=', $observation); //i.e[temp,44] $counter++; $parent_observation_array = isset($parent_triage_details) ? explode(',', $parent_triage_details->observations): []; @endphp @if($counter < 9) @if(check_if_episode_is_a_followup($episode->id)) @foreach($parent_observation_array as $parent_observation) @php $parent_item_array = isset($parent_triage_details) ? explode('=', $parent_observation) : []; @endphp @if($item_array[0] == $parent_item_array[0]) @endif @endforeach @endif @endif @endforeach
{{ __('consultations.observation') }} {{ __('consultations.value') }} {{ __('consultations.previous_value') }}
{{ isset($item_array[0]) ? $item_array[0] : "" }} {{ isset($item_array[1]) ? $item_array[1] : "" }} {{ $parent_item_array[1] }}
@if(check_if_episode_is_a_followup($episode->id)) @endif @php $counter=0; @endphp @foreach($observations_array as $observation) @php $item_array = explode('=', $observation); //i.e[temp,44] $counter++; @endphp @if($counter >= 9) @if(check_if_episode_is_a_followup($episode->id)) @foreach($parent_observation_array as $parent_observation) @php $parent_item_array = isset($parent_triage_details) ? explode('=', $parent_observation) : []; @endphp @if($item_array[0] == $parent_item_array[0]) @endif @endforeach @endif @endif @endforeach
{{ __('consultations.observation') }} {{ __('consultations.value') }} {{ __('consultations.previous_value') }}
{{ $item_array[0] }} {{ $item_array[1] }} {{ $parent_item_array[1] }}
{{ __('consultations.comment') }}: {{ !is_null($triage) ? $triage->comments : "" }}
@else {{ __('consultations.no_observations_recorded') }} @endif {{ __('consultations.triage_done_by') }} {!! isset($triage) ? ''.\Streamline\Models\User::withTrashed()->find($triage->created_by)->first_name. " ".\Streamline\Models\User::withTrashed()->find($triage->created_by)->last_name.' on '.streamline_date_time($triage->created_at).'' : "" !!}
@if(count($documents) > 0) @foreach($documents as $document)
  • {{ is_null($document->title) ? substr($document->description, 0, 5) : $document->title }} ({{ streamline_date_time($document->created_at) }})
  • @endforeach @else {{ __('consultations.no_patient_documents_available') }} @endif
    {{ __('consultations.add_new') }}
    @php $used_services = \Streamline\Models\OrderedService::where(['patient_id' => $patient_id, 'episode_id' => $episode_id])->get(); $services_counter = 1; $service_performed_counter = 0; @endphp @if(count($used_services) > 0)
    @foreach($used_services as $service) @php $service_ids = explode(",", $service->service_id); $service_quantity = explode(",", $service->quantity); $service_performed = explode(",", $service->performed); @endphp @for($i = 0; $i < count($service_ids); $i++) @endfor @endforeach
    {{ __('consultations.service') }} {{ __('consultations.quantity') }} {{ __('consultations.payment_status') }} Performed By
    {{ get_name($service_ids[$i], "id", "name", "services")}} {{ $service_quantity[$i] }} {!! $service->payment_status == 0 ? "Not Paid" : "Paid" !!} @if($service_performed[$i] == 0) {{ Form::hidden('service_perform[]', $service_ids[$i]) }} {{ Form::hidden('service_order_id[]', $service_ids[$i]) }} {{ Form::hidden('service_order_perform[]', $service->id) }} {{ Form::hidden('service_performed_position[]', $i) }} @php $service_performed_counter++ @endphp @endif
    @else {{ __('consultations.no_used_services') }} @endif
    {{-- Display TB screening takend from triage --}} @if (is_tuberculosis_screening_enabled())
    @if($triage) @if ($triage->any_tb_sysmptoms == 1)
    A cough for more than two weeks ? {{ $triage->cough_for_2_weeks == 1 ? "Yes" : "No" }}
    Persistent fevers for 2 weeks or more ? {{ $triage->fever_for_2_weeks == 1 ? "Yes" : "No" }}
    Noticeable weight loss of more than 3 Kg? {{ $triage->tb_weight_loss == 1 ? "Yes" : "No" }}
    Poor weight gain in the last one month ? {{ $triage->tb_poor_weight_gain == 1 ? "Yes" : "No" }}
    Excessive night sweats for three weeks or more ? {{ $triage->tb_excessive_night_sweats == 1 ? "Yes" : "No" }}
    Contact with a person with pulmonary TB or chronic cough ? {{ $triage->tb_contact_with_tb_person == 1 ? "Yes" : "No" }}
    @endif @endif
    @endif {{-- end of tb details --}}
    @if($is_mental_health_clinic && isset($mental_health_consultation->id)) {{ Form::hidden('mental_health_id', $mental_health_consultation->id) }}
    {{ __('consultations.psychosis_symptom_scores') }}
    {{ __('consultations.hallucinations') }} {{ Form::number('hallucinations', $mental_health_consultation->hallucinations, ['class' => 'form-control']) }}
    {{ __('consultations.delusions') }} {{ Form::number('delusions', $mental_health_consultation->delusions, ['class' => 'form-control']) }}
    {{ __('consultations.disorganised_speech') }} {{ Form::number('disorganised_speech', $mental_health_consultation->disorganised_speech, ['class' => 'form-control']) }}
    {{ __('consultations.abnormal_phychomotor_behaviour') }} {{ Form::number('abnormal_psychomotor_behaviour', $mental_health_consultation->abnormal_psychomotor_behaviour, ['class' => 'form-control']) }}
    {{ __('consultations.negative_symptoms') }}
    {{ __('consultations.impaired_cognition') }} {{ Form::number('impaired_cognition', $mental_health_consultation->impaired_cognition, ['class' => 'form-control']) }}
    {{ __('consultations.depression') }} {{ Form::number('depression', $mental_health_consultation->depression, ['class' => 'form-control']) }}
    {{ __('consultations.mania') }} {{ Form::number('mania', $mental_health_consultation->mania, ['class' => 'form-control']) }}
    {{ __('consultations.hamilton_anxiety_score') }} {{ Form::number('hamilton_anxiety_score', $mental_health_consultation->hamilton_anxiety_score, ['class' => 'form-control']) }}

    {{ __('consultations.hamilton_anxiety_score') }}

    0-17 = no / mild anxiety

    18-24 = mild to moderate anxiety

    25-30 = moderate to severe anxiety

    {{ __('consultations.alcohol_score') }}
    {{ __('consultations.total_score') }} {{ Form::number('alcohol_screening_score', $mental_health_consultation->alcohol_screening_score, ['class' => 'form-control']) }}
    {{ __('consultations.satisfaction_score') }}
    {{ __('consultations.patient') }} {{ Form::number('patient_satisfaction_score', $mental_health_consultation->patient_satisfaction_score, ['class' => 'form-control']) }}
    {{ __('consultations.care_giver') }} {{ Form::number('caregiver_satisfaction_score', $mental_health_consultation->caregiver_satisfaction_score, ['class' => 'form-control']) }}

    {{ __('consultations.alcohol_screening_score') }}

    1-7 = {{ __('consultations.low_risk') }}

    8-19 = {{ __('consultations.harmful_drinking') }}

    20 or above = {{ __('consultations.likely_dependency') }}

    @endif @if($consultation_with_notes)
    @if(Auth::user()->can('edit-consultation-note') || Auth::user()->can('delete-consultation-note')) @endif @forelse ($consultation_notes as $consultation_note) @if (Auth::user()->can('edit-consultation-note') || Auth::user()->can('delete-consultation-note')) @endif {{ Form::hidden('deleted_notes[]', '', ['id' => 'deleted_note_id_'.$consultation_note->id]) }} @empty @endforelse
    {{ __('consultations.previous_notes') }}
    {{ __('consultations.history') }} {{ __('consultations.clinical_examination') }} {{ __('consultations.investigation_and_mgt_plan') }} {{ __('consultations.date') }}{{ __('banking.action') }}
    {{ $consultation_note->history_comments }} {{ $consultation_note->clinic_examination_comments }} {{ $consultation_note->investigation_and_management_plan_comments}} {{ streamline_date_time($consultation_note->created_at) }}
    by {{ $users[$consultation_note->created_by]?? '' }}
    @if(Auth::user()->can('edit-consultation-note')) {{ __('consultations.edit_clinical_note') }} @endif @if(Auth::user()->can('delete-consultation-note')) @endif
    {{ __('consultations.no_previous_notes') }}
    @if (!empty($view_notes)) {{ __('consultations.view_more_notes') }} @endif
    @if(check_if_episode_is_a_followup($episode->id) && !empty($parent_consultation_notes))
    @forelse ($parent_consultation_notes as $consultation_note) @empty @endforelse
    Previously Added Consultation Notes {{ __('consultations.for_episode_of') }} {{ streamline_date($parent_consultation_details->created_at) }}
    {{ __('consultations.history') }} {{ __('consultations.clinical_examination') }} {{ __('consultations.investigation_and_mgt_plan') }} {{ __('consultations.date') }}
    {{ $consultation_note->history_comments }} {{ $consultation_note->clinic_examination_comments }} {{ $consultation_note->investigation_and_management_plan_comments}} {{ streamline_date_time($consultation_note->created_at) }}
    by {{ $users[$consultation_note->created_by]?? '' }}
    No previously added consultation notes {{ __('consultations.for_episode_of') }} {{ streamline_date($parent_consultation_details->created_at) }}.
    @endif

    {{ __('consultations.history') }}

    {{ __('consultations.clinical_examination') }}

    {{ __('consultations.investigation_and_mgt_plan') }}

    @endif @if (is_tuberculosis_screening_enabled()) @include('patients::consultations.tb_screening') @endif @php $option_symptoms = ""; $option_symptoms_periods = ""; $symptom_counter = 1; @endphp @if(are_symptoms_on_consultation())
    @php $symptoms_array = explode(",", $consultation->symptoms); $symptoms_duration_array = explode(",", $consultation->symptom_duration); foreach ($symptoms as $key => $value){ $option_symptoms .= ""; } foreach ($symptoms_periods as $key => $value){ $option_symptoms_periods .= ""; } @endphp @if(empty($symptoms_array) || count($symptoms_array) != count($symptoms_duration_array) || $consultation->symptoms == '') @else @for($i = 0; $i < count($symptoms_array); $i++) @php $duration_array = explode(" ", $symptoms_duration_array[$i]); @endphp @endfor @endif
    {{ __('triage.symptoms') }} {{ __('triage.add_new') }} {{ __('triage.duration') }} {{ __('triage.prompt') }} {{ __('triage.reference_text') }}
    {{ Form::select('symptoms[]', $symptoms, $symptoms_array[$i], ['id' => 'symptoms_' . $symptom_counter, 'class' => 'form-control col-sm-12 compulsory initial_symptoms_select', 'onchange' => 'showPrompt(this.value, ' . $symptom_counter . ')']) }}
    {{ __('triage.add_row') }}
    @endif
    @if(check_if_episode_is_a_followup($episode->id) && !is_null($parent_consultation_details) && $parent_consultation_details->primary_diagnosis != $consultation->primary_diagnosis) @else @endif @if( Auth::user()->can('add-new-diagnosis-from-consultation')) @endif
    {{ __('consultations.PRIMARY_DIAGNOSIS') }} {{ __('consultations.PROMPT') }} {{ __('consultations.REFERENCES') }}
    {{ Form::select('parent_primary_diagnosis', $diagnoses, $parent_consultation_details->primary_diagnosis, ['class' => 'form-control col-sm-12 compulsory', 'readonly']) }}

    (As diagnosed on {{ streamline_date($parent_episode_details->created_at) }})
    {{ isset($parent_consultation_details->primary_diagnosis) ? $diagnoses_all->firstWhere('id',$parent_consultation_details->primary_diagnosis)->prompts : "" }} 
    @if(!is_null($parent_consultation_details->primary_diagnosis)) @php $reference_names = explode(",", get_name($parent_consultation_details->primary_diagnosis, 'id', 'reference_names', 'diagnoses')); $reference_areas = explode(",", get_name($parent_consultation_details->primary_diagnosis, 'id', 'reference_areas', 'diagnoses')); @endphp @for($i = 0; $i < count($reference_areas); $i++) @if(isset($reference_areas[$i]) && isset($reference_names[$i])) {{ $reference_names[$i] }} | @endif @endfor @endif
    {{ Form::select('primary_diagnosis', $diagnoses, $consultation->primary_diagnosis, ['id'=>'primary_diagnosis','class' => 'form-control col-sm-12 compulsory', 'required']) }}
    {{ isset($consultation->primary_diagnosis) ? $diagnoses_all->firstWhere('id',$consultation->primary_diagnosis)->prompts : "" }} 
    @if(!is_null($consultation->primary_diagnosis)) @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_areas); $i++) @if(isset($reference_areas[$i]) && isset($reference_names[$i])) {{ $reference_names[$i] }} | @endif @endfor @endif
    {{ Form::select('primary_diagnosis', $diagnoses, $consultation->primary_diagnosis, ['id'=>'primary_diagnosis','class' => 'form-control col-sm-12 compulsory primaryDiagnosis', 'required']) }}
    {{ isset($consultation->primary_diagnosis) ? $diagnoses_all->firstWhere('id',$consultation->primary_diagnosis)->prompts : "" }} 
    @if(!is_null($consultation->primary_diagnosis)) @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_areas); $i++) @if(isset($reference_areas[$i]) && isset($reference_names[$i])) {{ $reference_names[$i] }} | @endif @endfor @endif
    {{ __('consultations.add_new_diagnosis') }}
    @if(check_if_episode_is_a_followup($episode->id) && !is_null($parent_consultation_details)) @php $parent_consultation_other_diagnoses = unserialize($parent_consultation_details->other_diagnoses); @endphp @if(!empty($parent_consultation_other_diagnoses) && $parent_consultation_other_diagnoses[0] != "") @foreach($parent_consultation_other_diagnoses as $diagnosis) @if($diagnosis != "") @endif @endforeach @endif @endif @php $other_diagnoses = unserialize($consultation->other_diagnoses); @endphp @if(empty($other_diagnoses)) @else @foreach($other_diagnoses as $diagnosis) @if($diagnosis != "") @endif @endforeach @endif
    # {{ __('consultations.OTHER_DIAGNOSIS') }} {{ __('consultations.PROMPT') }} {{ __('consultations.REFERENCES') }}

    {{ $diagnoses[$diagnosis] }}
    (As diagnosed on {{ streamline_date($parent_episode_details->created_at) }})

    {{ is_object($diagnoses_all->firstWhere('id',$diagnosis)) ? $diagnoses_all->firstWhere('id',$diagnosis)->prompts : '' }} 
    @if(!is_null($consultation->primary_diagnosis)) @php $reference_names = explode(",", get_name($parent_consultation_details->primary_diagnosis, 'id', 'reference_names', 'diagnoses')); $reference_areas = explode(",", get_name($parent_consultation_details->primary_diagnosis, 'id', 'reference_areas', 'diagnoses')); @endphp @for($i = 0; $i < count($reference_areas); $i++) @if(isset($reference_areas[$i]) && isset($reference_names[$i])) {{ $reference_names[$i] }} | @endif @endfor @endif
    {{ Form::select('other_diagnosis[]', $diagnoses, '', ['class' => 'sec_d form-control col-sm-12 ']) }}
     
     
    {{ Form::select('other_diagnosis[]', $diagnoses, $diagnosis, ['class' => 'other_diagnosisx sec_d form-control col-sm-12']) }}
    {{ 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 : '' }} 
    {{ __('consultations.add_row') }} {{ __('consultations.delete_row') }}
    RDT RBS
    @if($consultation->rdt === 1) {{ Form::checkbox('rdt', 1, true, ['id'=>'rdt_pos']) }} @else {{ Form::checkbox('rdt', 1, false, ['id'=>'rdt_pos']) }} @endif @if($consultation->rdt === 0) {{ Form::checkbox('rdt', 0, true, ['id'=>'rdt_neg']) }} @else {{ Form::checkbox('rdt', 0, false, ['id'=>'rdt_neg']) }} @endif {{ Form::text('rbs',$consultation->rbs,['class'=>'form-control', 'placeholder'=>'(mm/l)']) }}
    @if (is_add_attendance_to_consultation_enabled())
    {{ Form::label('attendance',__('triage.re_attendance_or_new')) }}
    {{ Form::radio('attendance', 1, ($consultation->attendance == 1)? true :false, ["required"]) }} {{ __('triage.new_attendance') }}    {{ Form::radio('attendance', 2, ($consultation->attendance == 2)? true :false, ["required"]) }} {{ __('triage.re_attendance') }}
    @endif

    {{ __('consultations.ordered_investigations') }}

    @if($episode_has_grand_parent_episode) @if(count($grand_parent_episode_investigation_results) > 0) @foreach($grand_parent_episode_investigation_results as $result) @php $investigation_ids_array = explode(',', $result->investigation_id); // authentication of investigations $per_investigation_array = explode(',', $result->per_investigation); $comments = explode(",", $result->comment); $results_values = explode(",", $result->value); @endphp @for($i = 0 ; $i < count($investigation_ids_array) ; $i++) @php $investigation = \Streamline\Models\Investigation::withTrashed()->find($investigation_ids_array[$i]); if(!$investigation) { continue; } @endphp @endfor @endforeach @elseif(count($grand_parent_episode_ordered_investigations) > 0) @foreach($grand_parent_episode_ordered_investigations as $investigation) @php $investigation_ids_array = explode(',', $investigation->investigation_id); @endphp @for($i = 0 ; $i < count($investigation_ids_array) ; $i++) @php $investigation = \Streamline\Models\Investigation::withTrashed()->find($investigation_ids_array[$i]); if(!$investigation) { continue; } @endphp @endfor @endforeach @endif @endif @if(count($parent_episode_investigation_results) > 0) @foreach($parent_episode_investigation_results as $result) @php $investigation_ids_array = explode(',', $result->investigation_id); // authentication of investigations $per_investigation_array = explode(',', $result->per_investigation); $comments = explode(",", $result->comment); $results_values = explode(",", $result->value); @endphp @for($i = 0 ; $i < count($investigation_ids_array) ; $i++) @php $investigation = \Streamline\Models\Investigation::withTrashed()->find($investigation_ids_array[$i]); if(!$investigation) { continue; } @endphp @endfor @endforeach @elseif(count($parent_episode_ordered_investigations) > 0) @foreach($parent_episode_ordered_investigations as $investigation) @php $investigation_ids_array = explode(',', $investigation->investigation_id); @endphp @for($i = 0 ; $i < count($investigation_ids_array) ; $i++) @php $investigation = \Streamline\Models\Investigation::withTrashed()->find($investigation_ids_array[$i]); if(!$investigation) { continue; } @endphp @endfor @endforeach @endif @if(count($investigation_results) > 0) @if(check_if_episode_is_a_followup($episode->id)) @endif @foreach($investigation_results as $result) @php $investigation_ids_array = explode(',', $result->investigation_id); // authentication of investigations $per_investigation_array = explode(',', $result->per_investigation); $comments = explode(",", $result->comment); $results_values = explode(",", $result->value); @endphp @for($i = 0 ; $i < count($investigation_ids_array) ; $i++) @php $investigation = \Streamline\Models\Investigation::withTrashed()->find($investigation_ids_array[$i]); if(!$investigation) { continue; } @endphp @if($investigation->type == 1 && isset($results_values[$i])) @php $specialised_results = \Streamline\Models\InvestigationSpecialisedResult::where('id', $results_values[$i])->first(); if($specialised_results){ $variable_id_array = explode(',', $specialised_results->specialised_variable_id); $variable_value_array = explode(',', $specialised_results->value); $variable_comment_array = explode(',', $specialised_results->comment); $variable_normal_range_array = explode(',', $specialised_results->normal_ranges); } @endphp @if($specialised_results) @for($x = 0; $x < count($variable_id_array); $x++) @endfor @endif @elseif($investigation->slug == 'echo' && $results_values[$i] == "") @else @endif @endfor @endforeach @elseif(count($ordered_investigations) > 0) @if(check_if_episode_is_a_followup($episode->id)) @endif @foreach($ordered_investigations as $investigation) @php $investigation_ids_array = explode(',', $investigation->investigation_id); @endphp @for($i = 0 ; $i < count($investigation_ids_array) ; $i++) @if(isset($investigation_ids_array[$i]) && $investigation_ids_array[$i] != "") @php $investigation = \Streamline\Models\Investigation::withTrashed()->find($investigation_ids_array[$i]); if(!$investigation) { continue; } @endphp @if($investigation->slug == 'echo') @else @endif @endif @endfor @endforeach @else @endif
    {{ __('investigations.investigation_name') }} {{ __('investigations.results') }} {{ __('investigations.normal_ranges') }} {{ __('investigations.unit') }} {{ __('investigations.comment') }}
    {{ __('consultations.investigation_for_episode_of') }} {{ streamline_date($grand_parent_episode_details->created_at) }}
    @if($investigation->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1) {{ $investigation->name }} @else {{ $investigation->name }} @endif @if($investigation->range_type == 1) {{ get_dynamic_normal_range($investigation->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients')) }} @else {{ $investigation->normal_ranges }} @endif {!! (!isset($results_values[$i]) && $per_investigation_array[$i] == 0) ? '{{ __("consultations.pending") }}' : $results_values[$i] !!} @if(isset($comments[$i]) && ($per_investigation_array[$i] != 0)) {{ $comments[$i] }} @else {{ __("consultations.pending") }} @endif
    {{ __('consultations.authenticated_by') }}{{ get_name($result->authenticated_by, 'id', 'first_name', 'users')}} {{ get_name($result->authenticated_by, 'id', 'last_name', 'users')}}
    {{ __('consultations.investigation_for_episode_of') }} {{ streamline_date($grand_parent_episode_details->created_at) }}
    @if($investigation->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1) {{ $investigation->name }} @else {{ $investigation->name }} @endif @if($investigation->range_type == 1) {{ get_dynamic_normal_range($investigation->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients')) }} @else {{ $investigation->normal_ranges }} @endif {{ __('consultations.pending') }} {{ $investigation->comments }}
    {{ __('consultations.investigation_for_episode_of') }} {{ streamline_date($parent_episode_details->created_at) }}
    @if($investigation->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1) {{ $investigation->name }} @else {{ $investigation->name }} @endif @if($investigation->range_type == 1) {{ get_dynamic_normal_range($investigation->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients')) }} @else {{ $investigation->normal_ranges }} @endif {!! (!isset($results_values[$i]) && $per_investigation_array[$i] == 0) ? '{{ __("consultations.pending") }}' : $results_values[$i] !!} @if(isset($comments[$i]) && isset($per_investigation_array[$i]) && $per_investigation_array[$i] != 0) {{ $comments[$i] }} @else {{ __("consultations.pending") }} @endif
    {{ __('consultations.authenticated_by') }}{{ get_name($result->authenticated_by, 'id', 'first_name', 'users')}} {{ get_name($result->authenticated_by, 'id', 'last_name', 'users')}}
    {{ __('consultations.investigation_for_episode_of') }} {{ streamline_date($parent_episode_details->created_at) }}
    @if($investigation->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1) {{ $investigation->name }} @else {{ $investigation->name }} @endif @if($investigation->range_type == 1) {{ get_dynamic_normal_range($investigation->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients')) }} @else {{ $investigation->normal_ranges }} @endif {{ __('consultations.pending') }} {{ $investigation->comments }}
    {{ __('consultations.investigation_for_review') }} ({{ streamline_date($episode->created_at)}})
    @if($investigation->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1) {{ $investigation->name }} @else {{ $investigation->name }} @endif
    {{ get_name($variable_id_array[$x], 'id', 'name', 'investigation_specialised_variables') }} {{ $variable_value_array[$x] }} @if(get_name($variable_id_array[$x], 'id', 'range_type', 'investigation_specialised_variables') == 1) {{ get_dynamic_normal_range_specialized($variable_id_array[$x], get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients')) }} @else {{ get_name($variable_id_array[$x], 'id', 'normal_ranges', 'investigation_specialised_variables') }} @endif @if(get_name(get_name($variable_id_array[$x], 'id', 'units', 'investigation_specialised_variables'), 'id', 'name', 'unit_of_measure') != "N/A") {{ get_name(get_name($variable_id_array[$x], 'id', 'units', 'investigation_specialised_variables'), 'id', 'name', 'unit_of_measure') }} @endif {{ $variable_comment_array[$x] }}
    @if($investigation->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1) {{ $investigation->name }} @else {{ $investigation->name }} @endif View Results
    @if($investigation->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1) {{ $investigation->name }} @else {{ $investigation->name }} @endif @if(isset($per_investigation_array[$i]) && $per_investigation_array[$i] == 0) {{ __("consultations.pending") }} @else {!! isset($results_values[$i]) ? nl2br(e($results_values[$i])) : "" !!} @endif @if($investigation->range_type == 1) {{ get_dynamic_normal_range($investigation->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients')) }} @else {{ $investigation->normal_ranges }} @endif {{ get_name(get_name($investigation->id, 'id', 'units', 'investigations'),'id', 'name', 'unit_of_measure') }} @if(isset($comments[$i]) && isset($per_investigation_array[$i]) && $per_investigation_array[$i] != 0) {!! nl2br(e($comments[$i])) !!} @else {{ __("consultations.pending") }} @endif
    {{ __('consultations.authenticated_by') }}{{ get_name($result->authenticated_by, 'id', 'first_name', 'users')}} {{ get_name($result->authenticated_by, 'id', 'last_name', 'users')}}
    {{ __('consultations.investigation_for_review') }} ({{ streamline_date($episode->created_at)}})
    @if($investigation->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1) {{ $investigation->name }} @else {{ $investigation->name }} @endif @if(($cardio_echo)) View results @else Pending @endif
    @if($investigation->insurance_coverage == 1 && patient_insurance_status($patient_id) == 1) {{ $investigation->name }} @else {{ $investigation->name }} @endif {{ __('consultations.pending') }} @if($investigation->range_type == 1) {{ get_dynamic_normal_range($investigation->id, get_patient_age_group($patient_id), get_name($patient_id, 'id', 'gender', 'patients')) }} @else {{ $investigation->normal_ranges }} @endif {{ $investigation->comments }}
    {{ __('consultations.investigation_not_ordered') }} {{ check_if_episode_is_a_followup($episode->id) ? 'during current review' : '' }}.

    {{ __('consultations.ordered_sundries') }}

    @if($episode_has_grand_parent_episode) @if(count($grand_parent_episode_ordered_sundries) > 0) @foreach($grand_parent_episode_ordered_sundries as $ordered_sundry) @php $sundry_ids = explode(",", $ordered_sundry->sundries_id); $sundry_quantity = explode(",", $ordered_sundry->quantity); @endphp @for($i = 0; $i < count($sundry_ids); $i++) @endfor @endforeach @endif @endif @if(count($parent_episode_ordered_sundries) > 0) @if(check_if_episode_is_a_followup($episode->id)) @endif @foreach($parent_episode_ordered_sundries as $ordered_sundry) @php $sundry_ids = explode(",", $ordered_sundry->sundries_id); $sundry_quantity = explode(",", $ordered_sundry->quantity); @endphp @for($i = 0; $i < count($sundry_ids); $i++) @endfor @endforeach @endif @if(count($ordered_sundries) > 0) @if(check_if_episode_is_a_followup($episode->id)) @endif @foreach($ordered_sundries as $ordered_sundry) @php $sundry_ids = explode(",", $ordered_sundry->sundries_id); $sundry_quantity = explode(",", $ordered_sundry->quantity); @endphp @for($i = 0; $i < count($sundry_ids); $i++) @endfor @endforeach @else @endif
    {{ __('consultations.SUNDRY') }} {{ __('consultations.QUANTITY') }}
    {{ __('consultations.sundries_for_episode_of') }} {{ streamline_date($grand_parent_episode_details->created_at) }}
    {{ get_name($sundry_ids[$i], 'id', 'name', 'sundries') }} {!! $sundry_quantity[$i] !!}
    {{ __('consultations.sundries_for_episode_of') }} {{ streamline_date($parent_episode_details->created_at) }}
    {{ get_name($sundry_ids[$i], 'id', 'name', 'sundries') }} {!! $sundry_quantity[$i] !!}
    {{ __('consultations.sundries_for_episode_review') }} ({{ streamline_date($episode->created_at)}})
    {{ get_name($sundry_ids[$i], 'id', 'name', 'sundries') }} {!! $sundry_quantity[$i] !!}
    {{ __('consultations.no_sundries_ordered') }} {{ check_if_episode_is_a_followup($episode->id) ? __('consultations.during_current_review') : '' }}.

    {{ __('consultations.treatment_given') }}

    @if($episode_has_grand_parent_episode) @if(count($grand_parent_episode_treatments) > 0) @foreach($grand_parent_episode_treatments as $treatment) @php $drugs_array = explode(",", $treatment->drugs); $dosage_array = explode(",", $treatment->doses); $dosage2_array = explode(",", $treatment->dose2); $frequencies_array = explode(",", $treatment->frequencies); $duration_array = explode(",", $treatment->durations); $quantity_dispensed_array = explode(",", $treatment->quantities_dispensed); $instructions_array = explode(",", $treatment->instruction); $purchased_elsewhere_array = is_null($treatment->purchased_elsewhere) ? [] : explode(",", $treatment->purchased_elsewhere); @endphp @for($x = 0; $x < count($drugs_array); $x++) @php $frequency_name = get_name($frequencies_array[$x], 'id', 'name', 'dosage_frequencies'); $drug_unit_id = get_name($drugs_array[$x], 'id', 'unit_id', 'drugs'); $unit = get_name($drug_unit_id, 'id', 'name', 'drug_units'); $unit = $unit=="N/A"?"":$unit; $drug_unit = "" . $unit . ""; $dose2 = (empty($dosage2_array[$x])) ? "" : " | " . $dosage2_array[$x] . $drug_unit; @endphp @if(isset($purchased_elsewhere_array[$x]) && $purchased_elsewhere_array[$x] == 1) @else @if($treatment->dispense_status == 1) @else @endif @endif @endfor @endforeach @endif @endif @if(count($parent_episode_treatments) > 0) @foreach($parent_episode_treatments as $treatment) @php $drugs_array = explode(",", $treatment->drugs); $dosage_array = explode(",", $treatment->doses); $dosage2_array = explode(",", $treatment->dose2); $frequencies_array = explode(",", $treatment->frequencies); $duration_array = explode(",", $treatment->durations); $quantity_dispensed_array = explode(",", $treatment->quantities_dispensed); $instructions_array = explode(",", $treatment->instruction); $purchased_elsewhere_array = is_null($treatment->purchased_elsewhere) ? [] : explode(",", $treatment->purchased_elsewhere); @endphp @for($x = 0; $x < count($drugs_array); $x++) @php $frequency_name = get_name($frequencies_array[$x], 'id', 'name', 'dosage_frequencies'); $drug_unit_id = get_name($drugs_array[$x], 'id', 'unit_id', 'drugs'); $unit = get_name($drug_unit_id, 'id', 'name', 'drug_units'); $unit = $unit=="N/A"?"":$unit; $drug_unit = "" . $unit . ""; $dose2 = (empty($dosage2_array[$x])) ? "" : " | " . $dosage2_array[$x] . $drug_unit; @endphp @if(isset($purchased_elsewhere_array[$x]) && $purchased_elsewhere_array[$x] == 1) @else @if($treatment->dispense_status == 1) @else @endif @endif @endfor @endforeach @endif @if(count($treatments) > 0) @if(check_if_episode_is_a_followup($episode->id)) @endif @foreach($treatments as $treatment) @php $drugs_array = explode(",", $treatment->drugs); $dosage_array = explode(",", $treatment->doses); $dosage2_array = explode(",", $treatment->dose2); $frequencies_array = explode(",", $treatment->frequencies); $duration_array = explode(",", $treatment->durations); $quantity_dispensed_array = explode(",", $treatment->quantities_dispensed); $instructions_array = explode(",", $treatment->instruction); $purchased_elsewhere_array = is_null($treatment->purchased_elsewhere) ? [] : explode(",", $treatment->purchased_elsewhere); @endphp @for($x = 0; $x < count($drugs_array); $x++) @php $frequency_name = get_name($frequencies_array[$x], 'id', 'name', 'dosage_frequencies'); $drug_unit_id = get_name($drugs_array[$x], 'id', 'unit_id', 'drugs'); $unit = get_name($drug_unit_id, 'id', 'name', 'drug_units'); $unit = $unit=="N/A"?"":$unit; $drug_unit = "" . $unit . ""; $dose2 = (empty($dosage2_array[$x])) ? "" : " | " . $dosage2_array[$x] . $drug_unit; @endphp @if(isset($purchased_elsewhere_array[$x]) && $purchased_elsewhere_array[$x] == 1) @else @if($treatment->dispense_status == 1) @else @endif @endif @endfor @endforeach @else @endif
    {{ __('consultations.DRUG_NAME') }} {{ __('consultations.DOSAGE') }} {{ __('consultations.DURATION') }} {{ __('consultations.QUANTITY') }} {{ __('consultations.STATUS') }} {{ __('consultations.INSTRUCTION') }}
    {{ __('consultations.treatment_for_episode_of') }} {{ streamline_date($grand_parent_episode_details->created_at) }}
    {{ get_name($drugs_array[$x], 'id', "name", 'drugs') }} {{ $dosage_array[$x] }} {!! $drug_unit !!} {{ $dose2 }}    {{ $frequency_name }} {{ isset($duration_array[$x]) ? $duration_array[$x] : "" }} {{ $quantity_dispensed_array[$x] }}Purchased From Elsewhere{{ __('consultations.dispensed') }}{{ __('consultations.pending') }} {{ isset($instructions_array[$x]) ? trim($instructions_array[$x]) : 'N/A' }}
    {{ __('consultations.treatment_for_episode_of') }} {{ streamline_date($parent_episode_details->created_at) }}
    {{ get_name($drugs_array[$x], 'id', "name", 'drugs') }} {{ $dosage_array[$x] }} {!! $drug_unit !!} {{ $dose2 }}    {{ $frequency_name }} {{ isset($duration_array[$x]) ? $duration_array[$x] : "" }} {{ $quantity_dispensed_array[$x] }}Purchased From Elsewhere{{ __('consultations.dispensed') }}{{ __('consultations.pending') }} {{ isset($instructions_array[$x]) ? trim($instructions_array[$x]) : 'N/A' }}
    {{ __('consultations.treatment_for_episode_review') }} ({{ streamline_date($episode->created_at)}})
    {{ get_name($drugs_array[$x], 'id', "name", 'drugs') }} @if($treatment->is_treatment_progressive != 0) (Progressive Treatment) @endif {{ $dosage_array[$x] }} {!! $drug_unit !!} {{ $dose2 }}    {{ $frequency_name }} {{ isset($duration_array[$x]) ? $duration_array[$x] : "" }} {{ $quantity_dispensed_array[$x] }}Purchased From Elsewhere{{ __('consultations.dispensed') }}{{ __('consultations.pending') }} {{ isset($instructions_array[$x]) ? trim($instructions_array[$x]) : 'N/A' }}
    {{ __('consultations.no_prescription_made_yet') }} {{ check_if_episode_is_a_followup($episode->id) ? __('consultations.during_current_review') : '' }}

    {{ __('consultations.ordered_procedures') }}

    @if($episode_has_grand_parent_episode) @if(count($grand_parent_episode_ordered_procedures) > 0) @php $grand_parent_count = 1; @endphp @foreach($grand_parent_episode_ordered_procedures as $ordered_procedure) @php $procedure_id = explode(",", $ordered_procedure->procedure_id); $procedure_performed_array = explode(",", $ordered_procedure->performed); @endphp @for($i = 0; $i < count($procedure_id); $i++) @php $grand_parent_count++; @endphp @endfor @endforeach @endif @endif @if(count($parent_episode_ordered_procedures) > 0) @php $parent_count = 1; @endphp @foreach($parent_episode_ordered_procedures as $ordered_procedure) @php $procedure_id = explode(",", $ordered_procedure->procedure_id); $procedure_performed_array = explode(",", $ordered_procedure->performed); @endphp @for($i = 0; $i < count($procedure_id); $i++) @php $parent_count++; @endphp @endfor @endforeach @endif @if(count($ordered_procedures) > 0) @php $count = 0; $procedure_performed_counter = 0; @endphp @if(check_if_episode_is_a_followup($episode->id)) @endif @foreach($ordered_procedures as $ordered_procedure) @php $procedure_id = explode(",", $ordered_procedure->procedure_id); $procedure_performed_array = explode(",", $ordered_procedure->performed); $procedure_performed_id_array = explode(",", $ordered_procedure->performed_id); @endphp @for($i = 0; $i < count($procedure_id); $i++) @endfor @endforeach @else @endif
    # {{ __('consultations.PROCEDURE') }} {{ __('consultations.STATUS') }} {{ __('consultations.PERFORMED') }}
    {{ __('consultations.procedures_for_episode_of') }} {{ streamline_date($grand_parent_episode_details->created_at) }}
    {{ $grand_parent_count }} {{ get_name($procedure_id[$i], 'id', 'name', 'procedures') }} {!! $procedure_performed_array[$i] == 1 ? ''.__("consultations.performed").'' : ''. __("consultations.pending").'' !!}
    {{ __('consultations.procedures_for_episode_of') }} {{ streamline_date($parent_episode_details->created_at) }}
    {{ $parent_count }} {{ get_name($procedure_id[$i], 'id', 'name', 'procedures') }} {!! $procedure_performed_array[$i] == 1 ? ''.__("consultations.performed").'' : ''. __("consultations.pending").'' !!}
    {{ __('consultations.procedures_for_episode_review') }} ({{ streamline_date($episode->created_at)}})
    {{ ++$count }} {{ get_name($procedure_id[$i], 'id', 'name', 'procedures') }} {!! $procedure_performed_array[$i] == 1 ? ''.__("consultations.performed").'' : ''. __("consultations.pending").'' !!} @if($procedure_performed_array[$i] != 1) {{ Form::hidden('perform[]', $procedure_id[$i]) }} {{ Form::hidden('procedure_order_perform[]', $ordered_procedure->id) }} {{ Form::hidden('procedure_performed_position[]', $i) }} @php $procedure_performed_counter++ @endphp @else By {{ get_full_name(get_name($procedure_performed_id_array[$i], 'id', 'performed_by', 'staff_performed_services'), 'id', 'first_name', 'last_name', 'users') }} @endif
    {{ __('consultations.no_procedure_has_been_ordered') }} {{ check_if_episode_is_a_followup($episode->id) ? __('consultations.during_current_review') : '' }}.
    {{ Form::button(__('consultations.Investigation'),['type'=>'submit','class'=>'btn btn-info btn-block','name'=>'submit-btn','value'=>'investigation']) }}
    {{ Form::button(__('consultations.Treatment'),['type'=>'submit','class'=>'btn btn-default btn-block','name'=>'submit-btn','value'=>'treatment']) }}

    {{ Form::button(__('consultations.Procedures'),['type'=>'submit','class'=>'btn btn-inverse btn-block','name'=>'submit-btn','value'=>'procedures']) }}
    {{ Form::button(__('consultations.Sundries'),['type'=>'submit','class'=>'btn btn-primary btn-block','name'=>'submit-btn','value'=>'sundries']) }}

    {{ Form::button(__('consultations.services'),['type'=>'submit','class'=>'btn btn-default-bluish btn-block','name'=>'submit-btn','value'=>'services']) }}
    @if(isset($grand_parent_episode_details) && !is_null($grand_parent_episode_details->consultation_id)) @php $grand_parent_consultation = \Streamline\Models\Consultation::where('episode_id',$grand_parent_episode_details->id)->first(); @endphp @if($grand_parent_consultation->comments)
    {{ __('consultations.consultation_comments_on') }} {{ streamline_date($grand_parent_consultation->created_at) }}
    {{ $grand_parent_consultation->comments }}
    @endif @endif @if(isset($parent_episode_details) && !is_null($parent_episode_details->consultation_id)) @php $parent_consultation = \Streamline\Models\Consultation::where('episode_id',$parent_episode_details->id)->first(); @endphp @if($parent_consultation->comments)
    {{ __('consultations.consultation_comments_on') }} {{ streamline_date($parent_consultation->created_at) }}
    {{ $parent_consultation->comments }}
    @endif @endif

    {{ __('consultations.comments') }}

    {{ __('consultations.outcome') }}

    {{ Form::select('outcome', $outcomes, is_null($consultation->outcome_id) ? 7 : $consultation->outcome_id, ['id' => 'outcome', 'class' => 'form-control compulsory']) }}
    outcome_id != 1) style="display: none" @endif>
    {{ Form::label('ward_id',__('consultations.select_ward')) }}
    {{ Form::select('ward_id', $wards, $consultation->ward_id, ['class' => 'form-control compulsory']) }}
    {{ Form::label('admitted_on',__('consultations.admitted_on')) }}
    {{ Form::text('admitted_on',Carbon\Carbon::parse($consultation->admitted_on)->format('Y-m-d'),['class' => 'form-control datepicker-autoclose compulsory', 'readonly']) }}
    outcome_id != 3) style="display: none"@endif>
    {{ Form::label('followup_clinic_allocation', 'Assign Clinic') }} {{ Form::select('followup_clinic_allocation', $clinics, 0, ['class' => 'form-control col-sm-12 compulsory']) }}
    {{ Form::label('followup_in_charge', __('consultations.assign_incharge')) }}
    {{ Form::label('followup_when',__('consultations.when')) }}
    {{ Form::text('followup_when',Carbon\Carbon::parse($consultation->followup_when)->format('Y-m-d'),['class' => 'form-control compulsory datepicker-autoclose','readonly']) }}
    {{ Form::label('followup_in_time', __('consultations.appointment_time')) }} {{ Form::time('followup_in_time',$consultation->followup_time,['class' => 'form-control']) }}
    outcome_id != 4) style="display: none" @endif>
    {{ Form::label('referral_id',__('consultations.referred_to')) }}
    {{ Form::select('referral_id', $referrals, $consultation->referred_to, ['class' => 'form-control compulsory', 'id' => 'referral_hospital']) }}
    {{ __('triage.add_new') }}

    {{ Form::label('referral_notes', 'Referral Notes') }}
    outcome_id, "id", "slug", "outcomes") != "internal_transfer") style="display: none" @endif>
    {{ Form::label('current_clinic', __('patient_episode.current_clinic')) }} {{ Form::hidden('internal_transfer_status', 0, ['id' => 'internal_transfer_status']) }} {{ Form::hidden('current_clinic_id', $episode->clinic_id ?: 0, ['id' => 'current_clinic_id']) }} {{ Form::hidden('current_triage_id', $triage ? $triage->id : 0, ['id' => 'current_triage_id']) }} {{ Form::hidden('current_episode_id', $episode->id, ['id' => 'current_episode_id']) }} {{ Form::hidden('current_patient_id', $episode->patient_id, ['id' => 'current_patient_id']) }} {{ Form::text('current_clinic', $episode->clinic_id ? get_name($episode->clinic_id, 'id', 'name', 'clinics') : '', ['class' => 'form-control compulsory', 'readonly', 'id' => 'current_clinic_transfer']) }}
    {{ Form::label('transfer_to_clinic', __('patient_episode.transfer_to')) }} {{ Form::select('transfer_to_clinic', $clinics, null, ['class' => 'form-control compulsory', 'required', 'id' => 'transfer_to']) }}
    @if(isset($consultation) && !is_null($consultation->updated_by)) {{ __('consultations.consultation_done_by') }} {!! isset($consultation) ? ''.\Streamline\Models\User::withTrashed()->find($consultation->updated_by)->first_name. " ".\Streamline\Models\User::withTrashed()->find($consultation->updated_by)->last_name.' on '.streamline_date_time($consultation->created_at).'' : "" !!}

    @else {{ __('consultations.consultation_done_by') }} {!! isset($consultation) ? ''.\Streamline\Models\User::withTrashed()->find($consultation->created_by)->first_name. " ".\Streamline\Models\User::withTrashed()->find($consultation->created_by)->last_name.' on '.streamline_date_time($consultation->created_at).'' : "" !!}

    @endif {{ Form::button(__('consultations.update_and_complete_consultation'),['class'=>'btn btn-success btn-block','value'=>'complete','name'=>'submit-btns', 'onclick'=>'return confirm_outcome()']) }}

    {{ Form::button(__('consultations.save_consultation'),['type'=>'submit','class'=>'btn btn-default btn-block','name'=>'submit-btn','value'=>'save_consultation']) }}
    {{ Form::close() }} @include('patients::consultations.document.add') @include('patients::consultations.add_diagnosis') @endsection @push('scripts') @endpush