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

{{ __('inpatient.maternity_admission') }}

@include('patients::allergies.header')
{{-- previous consultations --}} @if (count($previous_consultation_inpatient_info) > 0)
@include('maternity::maternity.includes.previous_admissions')
@endif

{{ __('antenatal.maternity_admission') }}

{{ Form::open(['route' => 'maternity.store']) }}
{{-- primary diagnosis --}}
# {{ __('inpatient.primary_diagnosis') }} {{ __('inpatient.prompt') }} {{ __('inpatient.references') }}
{{-- {{ Form::select('primary_diagnosis', $diagnoses, $latest_existing_anc_clinic_followup->primary_diagnosis ?? '', ['id' => 'primary_diagnosis', 'class' => 'form-control col-sm-12 compulsory', 'required']) }} --}} {{ Form::select('primary_diagnosis', $diagnoses,'', ['id' => 'primary_diagnosis', 'class' => 'form-control col-sm-12 compulsory', 'required']) }}
 
 
{{-- other diagnoses --}} @php $other_diagnoses = explode(',', $latest_existing_anc_clinic_followup->other_diagnoses ?? ''); $counter=2; @endphp
{{-- Pick existing data --}} {{-- @if(empty($other_diagnoses)) @else @foreach($other_diagnoses as $diagnosis) @if($diagnosis != "") @endif @php $counter++; @endphp @endforeach @endif --}} {{--End of Pick existing data --}}
# {{ __('inpatient.other_diagnosis') }} {{ __('inpatient.prompt') }} {{ __('inpatient.references') }}
{{ Form::select('other_diagnosis[]', $diagnoses, '', ['class' => 'form-control col-sm-12 sec_d', 'id' => 'other_diagnosis']) }}
 
 
{{ Form::select('other_diagnosis[]', $diagnoses, '', ['class' => 'form-control col-sm-12 sec_d', 'id' => 'other_diagnosis']) }}
 
 
{{ Form::select('other_diagnosis[]', $diagnoses, $diagnosis, ['class' => '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 : '' }} 
{{ Form::select('other_diagnosis[]', $diagnoses, '', ['class' => 'sec_d form-control col-sm-12']) }}
 
 
{{ __('inpatient.add_row') }} {{ __('inpatient.delete_row') }}
{{-- symptoms sidebar --}}
@if ($triage) @php $symptoms_explode = explode(',', $triage->symptoms) ?? ''; $duration_explode = explode( ',', $triage->symptom_duration ?? '', ); @endphp @for ($i = 0; $i < count($symptoms_explode); $i++) @endfor @else @endif
{{ __('inpatient.symptoms') }} {{ __('inpatient.duration') }}
{{ $symptoms[$symptoms_explode[$i]] ?? '' }} {{ isset($duration_explode[$i]) ? $duration_explode[$i] : '' }}
{{ __('inpatient.no_symptoms_triage') }}
@if (count($opd_investigations) > 0) @for ($i = 0; $i < count($opd_investigations['name']); $i++) @endfor @else @endif
{{ __('inpatient.name') }} {{ __('inpatient.value') }} {{ __('inpatient.comment') }}
{{ $opd_investigations['name'][$i] }} {{ $opd_investigations['value'][$i] }} {{ $opd_investigations['comment'][$i] }}
{{ __('inpatient.no_opd_invs') }}
@if (count($ward_investigations) > 0) @for ($i = 0; $i < count($ward_investigations['name']); $i++) @endfor @else @endif
{{ __('inpatient.name') }} {{ __('inpatient.value') }} {{ __('inpatient.comment') }}
{{ $ward_investigations['name'][$i] }} {{ $ward_investigations['value'][$i] }} {{ $ward_investigations['comment'][$i] }}
{{ __('inpatient.no_ward_invs') }}
> {{ __('inpatient.historical_investigations') }} > {{ __('inpatient.order_investigations') }}

{{-- gravida , para , abortions --}} @include('maternity::maternity.includes.gravida_para_abortions')

{{ __('antenatal.past_obstetric_history') }}

{{-- past obstetrict history --}} @if ($obstetric_history_details->count() > 0)
{{-- --}} @foreach ($obstetric_history_details as $obstetric_history) @php $children = []; if (!empty($obstetric_history->children)) { $children = json_decode( $obstetric_history->children, ); } @endphp @forelse($children as $key => $child) @empty {{-- --}} @endforelse {{-- --}} {{-- --}} {{-- --}} @endforeach
{{ __('antenatal.past_obstetric_history') }}
{{ __('antenatal.date') }} {{ __('antenatal.gestation') }} Weeks {{ __('antenatal.outcome') }} Delivery Type Complications PuerperiumChildren details{{ __('antenatal.name') }} {{ __('antenatal.patient_number') }} {{ __('antenatal.comments') }}
@if (!empty($obstetric_history->obstetric_date)) {{ streamline_date($obstetric_history->obstetric_date) }} @else @endif {{-- {{ streamline_date($obstetric_history->obstetric_date) }} --}} {{ $obstetric_history->gestation ?? '' }} @if (!empty($obstetric_history->outcome)) {{ isset($anc_outcomes[$obstetric_history->outcome]) ? $anc_outcomes[$obstetric_history->outcome] : '' }} @else @endif {{-- {{ $obstetric_history->delivery_type ?? '' }} --}} @if (isset($obstetric_history->delivery_type)) @if ($obstetric_history->delivery_type == 1) {{ __('antenatal.vaginal_delivery') }} @elseif($obstetric_history->delivery_type == 2) {{ __('antenatal.vacuum_delivery') }} @elseif($obstetric_history->delivery_type == 3) {{ __('antenatal.forceps_delivery') }} @elseif($obstetric_history->delivery_type == 4) {{ __('antenatal.c_section') }} @elseif($obstetric_history->delivery_type == 5) {{ __('antenatal.vbac') }} @else @endif @endif @if (isset($obstetric_history->pregnancy_complication)) @if ($obstetric_history->pregnancy_complication == 1) {{ __('antenatal.retained_placenta') }} @elseif($obstetric_history->pregnancy_complication == 2) {{ __('antenatal.eclampsia') }} @elseif($obstetric_history->pregnancy_complication == 3) {{ __('antenatal.pph') }} @else @endif @endif {{ $obstetric_history->puerperium ?? '' }}
{{ $child->name }} {{ $child->patient_number }} {{ $child->health_condition }}
@if (!empty($children))
    @foreach ($children as $child)
  1. {{ $child->name }}
  2. @endforeach
@else @endif
@if (!empty($children))
    @foreach ($children as $child)
  1. @if (!empty($child->patient_number)) {{ $child->patient_number }} @else @endif
  2. @endforeach
@else @endif
@if (!empty($children))
    @foreach ($children as $child)
  1. @if (!empty($child->health_condition)) {{ $child->health_condition }} @else @endif
  2. @endforeach
@else @endif


@else {{-- No obstetric history --}} @endif
{{ Form::label('obstetric_date', __('antenatal.date')) }}
{{ Form::text('pregnancy_1_obstetric_date', '', ['class' => 'form-control obstetric_date', 'id' => 'datepicker-autoclose1']) }}
{{ Form::label('gestation', __('antenatal.gestation')) }}
{{ Form::label('outcome', __('antenatal.outcome')) }}
{{ Form::select('pregnancy_1_obstetric_outcome', $anc_outcomes, '', ['class' => 'form-control col-sm-12 ', 'id' => 'pregnancy_1_obstetric_outcome', 'onchange' => 'abortion_outcome(this.id)']) }}

{{-- delivery plan --}} @include('maternity::maternity.includes.delivery_plan') {{-- mothers history --}} @include('maternity::maternity.includes.mothers_history') {{-- surgical history --}} @include('maternity::maternity.includes.surgical_history') {{-- blood transfusion --}} @include('maternity::maternity.includes.blood_transfusion') {{-- pelvic examination and assesement --}} @include('maternity::maternity.includes.pelvic_examination_and_assessment') {{-- this pregnancy --}} @include('maternity::maternity.includes.this_pregnancy') {{-- This pregnancy --}}
{{ Form::button(__('maternity.save_and_complete'), ['type' => 'submit', 'value' => 'submit_maternity_admission', 'name' => 'submit-btn', 'id' => 'submit-btn', 'class' => 'btn btn-success']) }}
{{ Form::hidden('pregnancy_number', 0, ['id' => 'pregnancy_number']) }} {{ Form::close() }}
@endsection {{-- scrips --}} @push('scripts') {{-- add and delete child row --}} {{-- family planningmethods searchable select2 --}} {{-- family planning methods --}} {{-- additional_text_box_inputs file --}} {{-- previous consultations script with expandable row of details --}} {{-- --}} {{-- pick previous admissions // pick corresponding css --}} {{-- --}} {{-- display alert if hiv_date is greater or equal to 3 months ago --}} {{-- clear puerperium if fresh SB is selected --}} {{-- updated scripts --}} {{-- display section of previous consultation details on button click --}} {{-- other checkbox values --}} {{-- w: add blood transfusion row --}} @endpush