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

{{ __('investigations.edit_investigation') }}

@include('investigations::investigations.menu')
@include('flash::message') @if ($errors->any())
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif
{{ Form::model($investigation, ['method' => 'PUT', 'route' => ['investigations.update',$investigation], 'data-toggle' => 'validator']) }}
{{ Form::label('name', __('investigations.investigation_name')) }} {{ Form::text('name', $investigation->name, ['class' => 'form-control compulsory', 'required']) }}
{{ Form::label('category', __('investigations.category')) }} {{ Form::select('category',$investigation_categories,$investigation->category,['class' => 'form-control compulsory', 'required']) }}
{{ Form::label('units', __('investigations.unit')) }} {{ Form::select('units',$unit_of_measure,$investigation->units,['class' => 'form-control']) }}
{{ Form::label('range_type', __('investigations.is_the_reference_range')) }} {{ Form::select('range_type', [null => '--select--', 1 => 'Dynamic', 2 => 'Constant'], $investigation->range_type, ['class' => 'form-control']) }}
range_type == 1) style="display: none;" @endif id="constant_div"> {{ Form::label('normal_ranges', __('investigations.normal_ranges')) }} {{ Form::text('normal_ranges', $investigation->normal_ranges, ['class' => 'form-control']) }}
range_type != 1) style="display: none;" @endif id="dynamic_div"> @php $age_groups = \Streamline\Models\AgeGroup::get(); @endphp
{{ __('investigations.male') }}

@foreach($age_groups as $age) {{ Form::label('dynamic_range', $age->name) }} {{ Form::text('dynamic_range_male[]', get_dynamic_normal_range($investigation->id, $age->id, 1), ['class' => 'form-control']) }} {{ Form::hidden('age_id[]', $age->id) }}
@endforeach
{{ __('investigations.female') }}

@foreach($age_groups as $age) {{ Form::label('dynamic_range', $age->name) }} {{ Form::text('dynamic_range_female[]', get_dynamic_normal_range($investigation->id, $age->id, 2), ['class' => 'form-control']) }}
@endforeach

{{ Form::label('minimum', __('investigations.minimum')) }} {{ Form::text('minimum', $investigation->minimum, ['class' => 'form-control']) }}
{{ Form::label('sample_container', __('investigations.sample_container')) }} {{ Form::text('sample_container', $investigation->sample_container, ['class' => 'form-control']) }}
{{ Form::label('non_insured_price', __('investigations.non_insured_price')) }} {{ Form::number('non_insured_price', $investigation->non_insured_price, ['class' => 'form-control']) }}
@if($investigation->price_list_category && $investigation->price_list_category != '') @php $price_list_categories = explode(",", $investigation->price_list_category); $price_list_prices = explode(",", $investigation->price_list_price); @endphp @for($i = 0; $i < count($price_list_categories); $i++)
{{ Form::label('non_insured_price', get_name($price_list_categories[$i], 'id', 'name', 'patient_categories').' Price') }} {{ Form::hidden('price_list_category_id[]', $price_list_categories[$i]) }} {{ Form::number('price_list_price[]', $price_list_prices[$i], ['class'=>'form-control price_list_price']) }}
@endfor @endif
{{ Form::label('comments', __('investigations.comments')) }} {{ Form::textArea('comments', $investigation->comments, ['class'=>'form-control', 'rows' => 2]) }}
{{ Form::label('lab_time', __('investigations.lab_time')) }} {{ Form::text('lab_time', $investigation->lab_time, ['class' => 'form-control']) }}
{{ Form::label('', __('investigations.is_investigation_available'), ["class"=>'col-md-12']) }}  {{ __('investigations.yes') }} {{ Form::radio('available', 1, $investigation->available == 1, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}  {{ __('investigations.no') }} {{ Form::radio('available', 0, $investigation->available == 0, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
{{ Form::label('', __('investigations.is_investigation_chronic'), ["class"=>'col-md-12']) }}  {{ __('investigations.yes') }} {{ Form::radio('is_chronic', 1, $investigation->is_chronic == 1, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}  {{ __('investigations.no') }} {{ Form::radio('is_chronic', 0, $investigation->is_chronic == 0, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
{{ Form::label('account_id',__('investigations.chart_of_account_name')) }} {{ Form::select('account_id',$chart_of_accounts,$investigation->account_id,['class' => 'form-control compulsory', 'required']) }}
{{ Form::label('echo', __('investigations.echo_investigation_template'), ["class"=>'col-md-12']) }}  {{ __('investigations.yes') }} {{ Form::radio('echo', 1, $investigation->slug == 'echo', ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}  {{ __('investigations.no') }} {{ Form::radio('echo', 0, $investigation->slug == null, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
{{ Form::label('code', 'Item Code') }} {{ Form::text('code', $investigation->code, ['class' => 'form-control']) }}
{{ Form::label('reference_areas', __('diagnoses.reference_areas')) }} {{ Form::text('reference_text', $investigation->reference_text, ['class' => 'form-control', 'placeholder' => 'Reference text']) }}
{{ Form::text('reference_link', $investigation->reference_link, ['class' => 'form-control', 'placeholder' => 'Reference link e.g. http://google.com']) }}
hmis_no_outpatient)); $hmis_category_array = array_filter(explode(",", $investigation->hmis_category)); ?> @if(count($hmis_no_outpatient_array) > 0) @for ($x = 0; $x < count($hmis_no_outpatient_array); $x++)
{{ Form::label('hmis_no_outpatient', 'HMIS-out-patient No.') }} {{ Form::text('hmis_no_outpatient[]', $hmis_no_outpatient_array[$x], ['class'=>'form-control']) }}
{{ Form::label('hmis_category', 'HMIS category (Out Patient)') }} {{ Form::select('hmis_category_opd[]', $hmis_categories_opd, isset($hmis_category_array[$x]) ? $hmis_category_array[$x] : "", ['class' => 'form-control']) }}
@endfor @else
{{ Form::label('hmis_no_outpatient', 'HMIS-out-patient No.') }} {{ Form::text('hmis_no_outpatient[]', '', ['class'=>'form-control']) }}
{{ Form::label('hmis_category', 'HMIS category (Out Patient)') }} {{ Form::select('hmis_category_opd[]', $hmis_categories_opd, '', ['class' => 'form-control']) }}
@endif
{{ __('investigations.add_more') }}

@php $inpatient_option =$investigation->hmis_category_inpatient; $inpatient_other = array_filter($inpatient_hmis_categories, function ($item) use ($inpatient_option) { return $item['id'] !== $inpatient_option; }); $inpatient_selected = array_filter($inpatient_hmis_categories, function ($item) use ($inpatient_option) { return $item['id'] == $inpatient_option; }); $categories_option = $investigation->hmis_no_inpatient; $selected_hmis_categories_option=array_filter($inpatient_hmis_category_options, function ($item) use ($categories_option) { return $item['id'] == $categories_option; }); $other_hmis_categories_options= array_filter($inpatient_hmis_category_options, function ($item) use ($categories_option) { return $item['id'] != $categories_option; }); @endphp {{ Form::label('hmis_category_inpatient', __('investigations.hmis_category_in_patient')) }}
{{ Form::label('hmis_no_inpatient', __('investigations.hmis_category_in_patient_number')) }}
{{ Form::label('hmis_002_slug', __('investigations.hmis_002_category')) }} {{ Form::select('hmis_002_slug', ['' => '--select--',1 => 'TB', 2 => 'RDT', 3=>'B/S', 4=>'RBS'], $investigation->hmis_002_slug?? '', ['class' => 'form-control', 'id'=>'hmis_002_slug']) }}
{{ Form::button(__('investigations.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }} {{ Form::button(__('investigations.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }} @php $spec_vars = \DB::table('investigation_specialised_variables')->whereNull('deleted_at')->where('investigation_id', $investigation->id)->get(); @endphp @if(count($spec_vars) > 0)

{{ __('investigations.edit_specialised_variables_ranking') }} @endif
{{ Form::close() }}
@endsection @push('scripts') @endpush