mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-11 18:51:31 +00:00
1808 lines
94 KiB
PHP
Executable File
1808 lines
94 KiB
PHP
Executable File
@extends('layouts.main')
|
|
|
|
@push('styles')
|
|
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet"
|
|
type="text/css" />
|
|
|
|
|
|
<style type="text/css">
|
|
#t_header th {
|
|
background-color: #708090;
|
|
color: #000;
|
|
}
|
|
|
|
.color-tr {
|
|
background: #FFFF99;
|
|
}
|
|
|
|
.aTable tr {
|
|
background-color: #DDD;
|
|
}
|
|
|
|
.table_no_padding td {
|
|
padding: 4px;
|
|
}
|
|
|
|
|
|
/* previous consultations */
|
|
table {
|
|
/* border-collapse: collapse;
|
|
width: 100%; */
|
|
}
|
|
|
|
/* th, td {
|
|
border: 1px solid #dddddd;
|
|
text-align: left;
|
|
padding: 8px;
|
|
} */
|
|
/* tr:hover {
|
|
background-color: #f5f5f5;
|
|
} */
|
|
.previous_consultation_details {
|
|
display: none;
|
|
}
|
|
|
|
/* new previous admissions css: pick corresponding js */
|
|
.accordion-content {
|
|
display: none;
|
|
}
|
|
|
|
.accordion-content.active {
|
|
display: table-row;
|
|
}
|
|
</style>
|
|
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
|
@endpush
|
|
|
|
@section('content')
|
|
|
|
|
|
|
|
|
|
<div class="row bg-title">
|
|
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
|
<h4 class="page-title">{{ __('inpatient.maternity_admission') }}</h4>
|
|
</div>
|
|
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
|
<ol class="breadcrumb">
|
|
<li><a href="{{ route('home') }}">{{ __('inpatient.dashboard') }}</a></li>
|
|
<li><a href="{{ route('patients.index') }}">{{ __('inpatient.patients') }}</a></li>
|
|
<li class="active">{{ __('inpatient.maternity_admission') }}</li>
|
|
</ol>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
@include('patients::allergies.header')
|
|
</div>
|
|
</div>
|
|
|
|
{{-- previous consultations --}}
|
|
@if (count($previous_consultation_inpatient_info) > 0)
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<div class="white-box">
|
|
@include('maternity::maternity.includes.previous_admissions')
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<div class="white-box">
|
|
|
|
<h4><b> {{ __('antenatal.maternity_admission') }}
|
|
</b></h4>
|
|
<div class="alert alert-danger alert-dismissible fade show" role="alert" style="width:100%;">
|
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
{{ __('antenatal.consultation_note_history') }}
|
|
</div>
|
|
|
|
|
|
{{ Form::open(['route' => 'maternity.store']) }}
|
|
|
|
|
|
<div class="row">
|
|
{{-- primary diagnosis --}}
|
|
<div class="col-sm-8">
|
|
<div class="table-responsive">
|
|
<table class="table table-hover color-table success-table">
|
|
<thead>
|
|
<tr>
|
|
<th class="text-center">#</th>
|
|
<th>{{ __('inpatient.primary_diagnosis') }}</th>
|
|
<th>{{ __('inpatient.prompt') }}</th>
|
|
<th>{{ __('inpatient.references') }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><input type="checkbox" name="chk" id="chk" /></td>
|
|
<td style="width: 30%;">
|
|
<div class="form-group">
|
|
{{-- {{ 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']) }}
|
|
</div>
|
|
</td>
|
|
<td style="width: 45%; color: #C85F6A;">
|
|
<div class="well well-sm" id="primary_diagnosis_prompt"> </div>
|
|
</td>
|
|
<td style="width: 25%">
|
|
<div class="well well-sm" id="primary_diagnosis_reference"> </div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
{{-- other diagnoses --}}
|
|
@php
|
|
$other_diagnoses = explode(',', $latest_existing_anc_clinic_followup->other_diagnoses ?? '');
|
|
$counter=2;
|
|
@endphp
|
|
|
|
<div class="table-responsive table-condensed">
|
|
<table class="table color-table success-table table-condensed table-borderless"
|
|
id="other_diagnosis_table">
|
|
<thead>
|
|
<tr>
|
|
<th class="text-center">#</th>
|
|
<th>{{ __('inpatient.other_diagnosis') }}</th>
|
|
<th>{{ __('inpatient.prompt') }}</th>
|
|
<th>{{ __('inpatient.references') }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<tr>
|
|
<td><input type="checkbox" name="chk" id="chk"></td>
|
|
<td style="width: 30%;">
|
|
{{ Form::select('other_diagnosis[]', $diagnoses, '', ['class' => 'form-control col-sm-12 sec_d', 'id' => 'other_diagnosis']) }}
|
|
</td>
|
|
<td style="width: 45%">
|
|
<div class="well well-sm" id="secondary_diagnosis_prompt1"> </div>
|
|
</td>
|
|
<td style="width: 25%">
|
|
<div class="well well-sm" id="secondary_diagnosis_reference1"> </div>
|
|
</td>
|
|
</tr>
|
|
|
|
{{-- Pick existing data --}}
|
|
|
|
{{-- @if(empty($other_diagnoses))
|
|
|
|
<tr>
|
|
<td><input type="checkbox" name="chk" id="chk"></td>
|
|
<td style="width: 30%;">
|
|
{{ Form::select('other_diagnosis[]', $diagnoses, '', ['class' => 'form-control col-sm-12 sec_d', 'id' => 'other_diagnosis']) }}
|
|
</td>
|
|
<td style="width: 45%">
|
|
<div class="well well-sm" id="secondary_diagnosis_prompt1"> </div>
|
|
</td>
|
|
<td style="width: 25%">
|
|
<div class="well well-sm" id="secondary_diagnosis_reference1"> </div>
|
|
</td>
|
|
</tr>
|
|
|
|
@else
|
|
@foreach($other_diagnoses as $diagnosis)
|
|
@if($diagnosis != "")
|
|
<tr>
|
|
<td><input type="checkbox" name="chk" id="chk"></td>
|
|
<td style="width: 30%;">
|
|
{{ Form::select('other_diagnosis[]', $diagnoses, $diagnosis, ['class' => 'sec_d form-control col-sm-12']) }}
|
|
</td>
|
|
<td style="width: 45%; color: #C85F6A;"><div class="well well-sm" id={{ 'secondary_diagnosis_prompt'. $counter }}>{{ is_object($diagnoses_all->firstWhere('id',$diagnosis)) ? $diagnoses_all->firstWhere('id',$diagnosis)->prompts : '' }} </div></td>
|
|
<td style="width: 25%"><div class="well well-sm" id={{ "secondary_diagnosis_reference". $counter }}>{{ is_object($diagnoses_all->firstWhere('id',$diagnosis)) ? $diagnoses_all->firstWhere('id',$diagnosis)->reference_names : '' }} </div></td>
|
|
</tr>
|
|
@endif
|
|
@php $counter++; @endphp
|
|
@endforeach
|
|
<tr>
|
|
<td><input type="checkbox" name="chk" id="chk"></td>
|
|
<td style="width: 30%;">
|
|
{{ Form::select('other_diagnosis[]', $diagnoses, '', ['class' => 'sec_d form-control col-sm-12']) }}
|
|
</td>
|
|
<td style="width: 45%"><div class="well well-sm" id='secondary_diagnosis_prompt1'> </div></td>
|
|
<td style="width: 25%"><div class="well well-sm" id='secondary_diagnosis_reference1'> </div></td>
|
|
</tr>
|
|
|
|
|
|
@endif --}}
|
|
|
|
{{--End of Pick existing data --}}
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<a class="btn btn-success btn-sm m-t-10" id="add_row"
|
|
onclick="addRow('other_diagnosis_table')">{{ __('inpatient.add_row') }}</a>
|
|
<a class="btn btn-danger btn-sm m-t-10" id="delete_row"
|
|
onclick="deleteRowData('other_diagnosis_table')">{{ __('inpatient.delete_row') }}</a>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
{{-- symptoms sidebar --}}
|
|
<div class="col-sm-4">
|
|
<div class="panel panel-default">
|
|
<div class="panel-wrapper collapse in">
|
|
<ul class="nav customtab nav-tabs" role="tablist">
|
|
<li role="presentation" class="active nav-item"><a href="#triageSymptoms"
|
|
class="nav-link" aria-controls="home" role="tab" data-toggle="tab"
|
|
aria-expanded="true"><span class="visible-xs"><i
|
|
class="ti-home"></i></span><span class="hidden-xs">
|
|
{{ __('inpatient.symptoms_triage') }}</span></a></li>
|
|
<li role="presentation" class="nav-item"><a href="#opdInvestigations" class="nav-link"
|
|
aria-controls="profile" role="tab" data-toggle="tab"
|
|
aria-expanded="false"><span class="visible-xs"><i class="ti-user"></i></span>
|
|
<span class="hidden-xs">{{ __('inpatient.opd_invs') }}</span></a></li>
|
|
<li role="presentation" class="nav-item"><a href="#wardInvestigations" class="nav-link"
|
|
aria-controls="messages" role="tab" data-toggle="tab"><span
|
|
class="visible-xs"><i class="ti-email"></i></span> <span
|
|
class="hidden-xs">{{ __('inpatient.ward_invs') }}</span></a></li>
|
|
</ul>
|
|
<div class="panel-body">
|
|
<div class="tab-content m-t-0">
|
|
<div role="tabpanel" class="tab-pane fade active in" id="triageSymptoms">
|
|
<div class="col-md-12">
|
|
<table class="table table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th><b>{{ __('inpatient.symptoms') }}</b></th>
|
|
<th><b>{{ __('inpatient.duration') }}</b></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@if ($triage)
|
|
@php
|
|
$symptoms_explode =
|
|
explode(',', $triage->symptoms) ?? '';
|
|
$duration_explode = explode(
|
|
',',
|
|
$triage->symptom_duration ?? '',
|
|
);
|
|
@endphp
|
|
@for ($i = 0; $i < count($symptoms_explode); $i++)
|
|
<tr>
|
|
<td>{{ $symptoms[$symptoms_explode[$i]] ?? '' }}</td>
|
|
<td>{{ isset($duration_explode[$i]) ? $duration_explode[$i] : '' }}
|
|
</td>
|
|
</tr>
|
|
@endfor
|
|
@else
|
|
<tr>
|
|
<td colspan="2">
|
|
{{ __('inpatient.no_symptoms_triage') }}
|
|
</td>
|
|
</tr>
|
|
@endif
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="clearfix"></div>
|
|
</div>
|
|
<div role="tabpanel" class="tab-pane fade" id="opdInvestigations">
|
|
<div class="col-md-12">
|
|
<table class="table table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th><b>{{ __('inpatient.name') }}</b></th>
|
|
<th><b>{{ __('inpatient.value') }}</b></th>
|
|
<th><b>{{ __('inpatient.comment') }}</b></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@if (count($opd_investigations) > 0)
|
|
@for ($i = 0; $i < count($opd_investigations['name']); $i++)
|
|
<tr>
|
|
<td>{{ $opd_investigations['name'][$i] }}</td>
|
|
<td>{{ $opd_investigations['value'][$i] }}</td>
|
|
<td>{{ $opd_investigations['comment'][$i] }}</td>
|
|
</tr>
|
|
@endfor
|
|
@else
|
|
<tr>
|
|
<td colspan="3">{{ __('inpatient.no_opd_invs') }}</td>
|
|
</tr>
|
|
@endif
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="clearfix"></div>
|
|
</div>
|
|
<div role="tabpanel" class="tab-pane fade" id="wardInvestigations">
|
|
<div class="col-md-12">
|
|
<table class="table table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th><b>{{ __('inpatient.name') }}</b></th>
|
|
<th><b>{{ __('inpatient.value') }}</b></th>
|
|
<th><b>{{ __('inpatient.comment') }}</b></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@if (count($ward_investigations) > 0)
|
|
@for ($i = 0; $i < count($ward_investigations['name']); $i++)
|
|
<tr>
|
|
<td>{{ $ward_investigations['name'][$i] }}</td>
|
|
<td>{{ $ward_investigations['value'][$i] }}</td>
|
|
<td>{{ $ward_investigations['comment'][$i] }}</td>
|
|
</tr>
|
|
@endfor
|
|
@else
|
|
<tr>
|
|
<td colspan="3">{{ __('inpatient.no_ward_invs') }}</td>
|
|
</tr>
|
|
@endif
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="clearfix"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<a href="#" class="label label-info"> > {{ __('inpatient.historical_investigations') }}</a>
|
|
<a href="{{ url('investigations/investigations_review') }}" class="label label-info"> >
|
|
{{ __('inpatient.order_investigations') }}</a>
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
|
|
{{-- gravida , para , abortions --}}
|
|
@include('maternity::maternity.includes.gravida_para_abortions')
|
|
|
|
<div class="row">
|
|
<div class="col-md-12 ">
|
|
<h4><span class="label label-primary">{{ __('antenatal.past_obstetric_history') }}</span></h4>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{-- past obstetrict history --}}
|
|
@if ($obstetric_history_details->count() > 0)
|
|
<div class="row">
|
|
<div class="col-md-12 col-lg-12 col-sm-12 col-xs-12">
|
|
<div class="card ">
|
|
|
|
<div class="card-body p-4">
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-sm-12">
|
|
<div class="table-responsive">
|
|
<table
|
|
class="table table-bordered color-bordered-table success-bordered-table"
|
|
id="table_1">
|
|
<thead>
|
|
<tr class="text-center"
|
|
style="background-color: #00c292;color: #fff;">
|
|
<td colspan="9">
|
|
{{ __('antenatal.past_obstetric_history') }}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>{{ __('antenatal.date') }}</th>
|
|
<th>{{ __('antenatal.gestation') }} Weeks </th>
|
|
<th>{{ __('antenatal.outcome') }}</th>
|
|
<th> Delivery Type </th>
|
|
<th>Complications</th>
|
|
<th>Puerperium</th>
|
|
{{-- <th colspan="3" >Children details</th> --}}
|
|
<th>{{ __('antenatal.name') }}</th>
|
|
<th>{{ __('antenatal.patient_number') }}</th>
|
|
<th>{{ __('antenatal.comments') }}</th>
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
@foreach ($obstetric_history_details as $obstetric_history)
|
|
|
|
@php
|
|
$children = [];
|
|
if (!empty($obstetric_history->children)) {
|
|
$children = json_decode(
|
|
$obstetric_history->children,
|
|
);
|
|
}
|
|
@endphp
|
|
|
|
<tr>
|
|
<td rowspan="{{ count($children) + 1 }}">
|
|
@if (!empty($obstetric_history->obstetric_date))
|
|
{{ streamline_date($obstetric_history->obstetric_date) }}
|
|
@else
|
|
@endif
|
|
{{-- {{ streamline_date($obstetric_history->obstetric_date) }} --}}
|
|
|
|
</td>
|
|
<td rowspan="{{ count($children) + 1 }}">
|
|
{{ $obstetric_history->gestation ?? '' }}
|
|
</td>
|
|
<td rowspan="{{ count($children) + 1 }}">
|
|
@if (!empty($obstetric_history->outcome))
|
|
{{ isset($anc_outcomes[$obstetric_history->outcome]) ? $anc_outcomes[$obstetric_history->outcome] : '' }}
|
|
@else
|
|
@endif
|
|
</td>
|
|
|
|
<td rowspan="{{ count($children) + 1 }}">
|
|
{{-- {{ $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
|
|
|
|
|
|
</td>
|
|
<td rowspan="{{ count($children) + 1 }}">
|
|
|
|
@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
|
|
</td>
|
|
<td rowspan="{{ count($children) + 1 }}">
|
|
{{ $obstetric_history->puerperium ?? '' }}
|
|
</td>
|
|
</tr>
|
|
|
|
@forelse($children as $key => $child)
|
|
<tr>
|
|
<td> {{ $child->name }}</td>
|
|
<td> {{ $child->patient_number }}</td>
|
|
<td> {{ $child->health_condition }}</td>
|
|
</tr>
|
|
|
|
@empty
|
|
{{-- <tr>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr> --}}
|
|
@endforelse
|
|
|
|
{{-- <td>
|
|
@if (!empty($children))
|
|
<ol>
|
|
@foreach ($children as $child)
|
|
<li>
|
|
{{ $child->name }}</li>
|
|
@endforeach
|
|
</ol>
|
|
@else
|
|
<span></span>
|
|
@endif
|
|
</td> --}}
|
|
{{-- <td>
|
|
@if (!empty($children))
|
|
<ol>
|
|
@foreach ($children as $child)
|
|
<li>
|
|
@if (!empty($child->patient_number))
|
|
{{ $child->patient_number }}
|
|
@else
|
|
<span></span>
|
|
@endif
|
|
</li>
|
|
@endforeach
|
|
|
|
</ol>
|
|
@else
|
|
<span></span>
|
|
@endif
|
|
</td> --}}
|
|
{{-- <td>
|
|
@if (!empty($children))
|
|
<ol>
|
|
@foreach ($children as $child)
|
|
<li>
|
|
@if (!empty($child->health_condition))
|
|
{{ $child->health_condition }}
|
|
@else
|
|
<span></span>
|
|
@endif
|
|
</li>
|
|
@endforeach
|
|
</ol>
|
|
@else
|
|
<span></span>
|
|
@endif
|
|
</td> --}}
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div> <br>
|
|
</div>
|
|
<br>
|
|
</div>
|
|
@else
|
|
{{-- <code>No obstetric history</code> --}}
|
|
@endif
|
|
|
|
|
|
|
|
|
|
|
|
<div class="pregnancy_div">
|
|
<div id="pregnancy_1" class="pregnacy_details">
|
|
<div class="row">
|
|
<div class="col form-group">
|
|
{{ Form::label('obstetric_date', __('antenatal.date')) }}
|
|
<div class="input-group">
|
|
{{ Form::text('pregnancy_1_obstetric_date', '', ['class' => 'form-control obstetric_date', 'id' => 'datepicker-autoclose1']) }}
|
|
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
|
</div>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
<div class="col form-group">
|
|
{{ Form::label('gestation', __('antenatal.gestation')) }}
|
|
<div class="input-group">
|
|
<input type="number" class="form-control col-sm-12" name="pregnancy_1_gestation"
|
|
placeholder="weeks">
|
|
</div>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
<div class="col form-group">
|
|
{{ Form::label('outcome', __('antenatal.outcome')) }}
|
|
<div class="input-group">
|
|
{{ Form::select('pregnancy_1_obstetric_outcome', $anc_outcomes, '', ['class' => 'form-control col-sm-12 ', 'id' => 'pregnancy_1_obstetric_outcome', 'onchange' => 'abortion_outcome(this.id)']) }}
|
|
</div>
|
|
<div class="help-block with-errors"></div>
|
|
<div class="form-group" style="display: none" id="abortion_outcome_div_1">
|
|
{{ Form::label('pregnancy_1_abortion_outcome', __('antenatal.abortion_date')) }}
|
|
<div class="input-group">
|
|
{{ Form::select('pregnancy_1_abortion_outcome', ['' => __('antenatal.select'), '1' => __('antenatal.below_12'), '2' => __('antenatal.12_and_above')], '', ['class' => 'form-control col-sm-12', 'id' => 'pregnancy_1_abortion_outcome']) }}
|
|
</div>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
<div class="form-group" style="display: none" id="stillbirth_type_div_1">
|
|
{{ Form::label('pregnancy_1_stillbirth_type', __('antenatal.stillbirth_type')) }}
|
|
<div class="input-group">
|
|
{{ Form::select('pregnancy_1_stillbirth_type', ['' => __('antenatal.select'), '1' => __('antenatal.antepartum'), '2' => __('antenatal.intrapartum')], '', ['class' => 'form-control col-sm-12', 'id' => 'pregnancy_1_stillbirth_type']) }}
|
|
</div>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
</div>
|
|
<div class="col form-group birth_show_1" style="display:none;">
|
|
{{ Form::label('delivery_type', __('antenatal.delivery_type')) }}
|
|
<div class="input-group">
|
|
{{ Form::select('pregnancy_1_delivery_type', ['' => __('antenatal.select'), '1' => __('antenatal.vaginal_delivery'), '2' => __('antenatal.vacuum_delivery'), '3' => __('antenatal.forceps_delivery'), '4' => __('antenatal.c_section'), '5' => __('antenatal.vbac')], '', ['class' => 'form-control col-sm-12 clear_input_1', 'id' => 'pregnancy_1_delivery_type']) }}
|
|
</div>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
<div class="col form-group birth_show_1" style="display:none;">
|
|
{{ Form::label('pregnancy_complication', __('antenatal.pregnancy_complications')) }}
|
|
<div class="input-group">
|
|
{{ Form::select('pregnancy_1_pregnancy_complication', ['' => __('antenatal.select'), '1' => __('antenatal.retained_placenta'), '2' => __('antenatal.eclampsia'), '3' => __('antenatal.pph')], '', ['class' => 'form-control col-sm-12 clear_input_1', 'id' => 'pregnancy_1_pregnancy_complication']) }}
|
|
</div>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
<div class="col form-group birth_show_1" style="display:none;">
|
|
{{ Form::label('puerperium', __('antenatal.puerperium')) }}
|
|
<div class="input-group">
|
|
<input type="text" class="form-control col-sm-12 clear_input_1 " name="pregnancy_1_puerperium"
|
|
id="pregnancy_1_puerperium">
|
|
</div>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
</div>
|
|
<div id="child_details_div_1" style="display: none">
|
|
<p>
|
|
<h5 class="text-center"><b>Child's Details</b></h5>
|
|
</p>
|
|
<table class="table color-table inverse-table table-responsive table-borderless"
|
|
id="child_details_table_1">
|
|
<thead>
|
|
<th>{{ __('patients.full_names') }}</th>
|
|
<th>{{ __('patients.gender') }}</th>
|
|
<th>{{ __('patients.patient_number') }}</th>
|
|
<th>{{ __('antenatal.child_birth_weight') }}</th>
|
|
<th>{{ __('antenatal.child_immunisation_status') }}</th>
|
|
<th>{{ __('antenatal.health_condition') }}</th>
|
|
<th>#</th>
|
|
</thead>
|
|
<tbody id="child_data_1">
|
|
<tr>
|
|
<td>
|
|
{{ Form::text('pregnancy_1_child_name[]', '', ['class' => 'form-control compulsory clear_input_1 ', 'id' => 'pregnancy_1_child_name', 'placeholder' => 'Happy Mukisa']) }}
|
|
</td>
|
|
<td style="min-width: 90px;">
|
|
<select style="display: inline-block;" class="form-control clear_input_1 "
|
|
name="pregnancy_1_child_gender[]" id="pregnancy_1_child_gender_1">
|
|
<option value=" " selected>-- Select --</option>
|
|
<option value="1">Male</option>
|
|
<option value="2">Female</option>
|
|
</select>
|
|
</td>
|
|
<td>
|
|
{{ Form::number('pregnancy_1_child_patient_number[]', '', ['class' => 'form-control clear_input_1', 'step' => '1']) }}
|
|
</td>
|
|
<td>
|
|
{{ Form::number('pregnancy_1_child_birth_weight[]', '', ['class' => 'form-control clear_input_1 ', 'step' => '0.1']) }}
|
|
</td>
|
|
<td>
|
|
{{ Form::select('pregnancy_1_child_immunisation_status[]', ['' => __('antenatal.select'), '1' => __('antenatal.not_started'), '2' => __('antenatal.ongoing'), '3' => __('antenatal.completed')], '', ['class' => 'form-control clear_input_1']) }}
|
|
</td>
|
|
<td>
|
|
{{ Form::textarea('pregnancy_1_child_health_condition[]', '', ['class' => 'form-control clear_input_1', 'id' => 'pregnancy_1_health_condition ', 'rows' => '3']) }}
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<a class="add_child_button label label-inverse" style="color: #fff;" id="add_child_1"
|
|
role="button" onclick="add_child_div(this.id)">{{ __('antenatal.add_child_row') }}</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col"><a class="btn btn-rounded btn-info pull-right" onclick="add_pregnancy_row()"
|
|
style="color: #fff;">{{ __('antenatal.add_pregnancy_row') }}</a></div>
|
|
</div>
|
|
<hr>
|
|
|
|
|
|
|
|
|
|
|
|
{{-- 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 --}}
|
|
|
|
<div class="row">
|
|
<div class="col-sm-12" style="padding: 0 10px;">
|
|
<div class="row">
|
|
<div class="col-md-6 col-sm-12 col-xs-12"></div>
|
|
<div class="col-md-6 col-sm-12 col-xs-12 ">
|
|
<div class="text-right">
|
|
<button type="submit" class="btn btn-default" value="save_maternity_admission"
|
|
name="submit-btn"><i class="fas fa-save"></i> Save </button>
|
|
{{ Form::button(__('maternity.save_and_complete'), ['type' => 'submit', 'value' => 'submit_maternity_admission', 'name' => 'submit-btn', 'id' => 'submit-btn', 'class' => 'btn btn-success']) }}
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
{{ Form::hidden('pregnancy_number', 0, ['id' => 'pregnancy_number']) }}
|
|
{{ Form::close() }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- referral modal -->
|
|
<div class="modal fade" id="referralsmodal" tabindex="-1" role="dialog">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
|
|
aria-hidden="true">×</span></button>
|
|
<h4 class="modal-title" id="exampleModalLabel1">{{ __('maternity.add_new_referral') }}</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
{{ Form::text('referral_name', '', ['class' => 'form-control', 'id' => 'referral_name', 'placeholder' => __('maternity.referral_name')]) }}
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default"
|
|
data-dismiss="modal">{{ __('maternity.cancel') }}</button>
|
|
<a class="btn btn-primary" onclick="submitReferral()">{{ __('maternity.add_new_referral') }}</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|
|
{{-- scrips --}}
|
|
@push('scripts')
|
|
<script src="{{ asset('js/streamline_plugins/jquery.session.js') }}"></script>
|
|
<!-- pull in select2 for auto searchanble drop downs -->
|
|
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
|
|
|
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
|
|
|
{{-- add and delete child row --}}
|
|
<script src="{{ asset('js/maternity_admission/add_delete_child_row.js') }}"></script>
|
|
|
|
{{-- family planningmethods searchable select2 --}}
|
|
<script src="{{ asset('js/maternity_admission/family_planning_methods.js') }}"></script>
|
|
|
|
{{-- family planning methods --}}
|
|
<script src="{{ asset('js/maternity_admission/family_planning_methods.js') }}"></script>
|
|
|
|
{{-- additional_text_box_inputs file --}}
|
|
<script src="{{ asset('js/maternity_admission/additional_checkbox_text_inputs.js') }}"></script>
|
|
|
|
{{-- previous consultations script with expandable row of details --}}
|
|
{{-- <script src="{{ asset('js/maternity_admission/previous_consultation_details.js') }}"></script> --}}
|
|
|
|
|
|
{{-- pick previous admissions // pick corresponding css --}}
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('.accordion-header').click(function() {
|
|
// Toggle active class on content row
|
|
$(this).next('.accordion-content').toggleClass('active');
|
|
|
|
// Close other content rows
|
|
$('.accordion-content').not($(this).next('.accordion-content')).removeClass('active');
|
|
});
|
|
});
|
|
</script>
|
|
|
|
|
|
|
|
{{-- <script>
|
|
document.addEventListener("DOMContentLoaded", function() {
|
|
var dataRows = document.querySelectorAll(".data-row");
|
|
|
|
dataRows.forEach(function(row) {
|
|
row.addEventListener("click", function() {
|
|
var detailsRow = row.nextElementSibling;
|
|
detailsRow.classList.toggle("previous_consultation_details");
|
|
});
|
|
});
|
|
});
|
|
|
|
</script> --}}
|
|
|
|
|
|
|
|
|
|
{{-- display alert if hiv_date is greater or equal to 3 months ago --}}
|
|
|
|
<script>
|
|
$(function() {
|
|
console.log("db date in js : ", existingHivDate);
|
|
if (existingHivDate) {
|
|
$('#alertboxx').html(
|
|
"<div class='alert alert-danger'>{{ __('maternity.hiv_past_3_months') }}</div>");
|
|
}
|
|
|
|
// Initialize date picker
|
|
$('.datePicker').datepicker();
|
|
|
|
// Attach event listener for when the date picker value changes
|
|
$('.datePicker').on('change', function() {
|
|
// Get the date value from the input field
|
|
var dateInputValue = $(this).val();
|
|
|
|
// Convert the input date string to a JavaScript Date object
|
|
var inputDate = new Date(dateInputValue);
|
|
|
|
|
|
// Calculate the date 3 months ago from today
|
|
var threeMonthsAgo = new Date();
|
|
console.log("Today date:", threeMonthsAgo);
|
|
threeMonthsAgo.setMonth(threeMonthsAgo.getMonth() - 3);
|
|
|
|
|
|
|
|
if (inputDate <= threeMonthsAgo) {
|
|
|
|
$('#alertboxx').html(
|
|
"<div class='alert alert-danger'>{{ __('maternity.hiv_past_3_months') }} </div>"
|
|
);
|
|
} else {
|
|
$('#alertboxx').html("");
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
jQuery(
|
|
'#datepicker-autoclose3'
|
|
)
|
|
.datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true,
|
|
format: 'dd/mm/yyyy',
|
|
});
|
|
|
|
// vdrl_date
|
|
var min_date_vdrl_date = new Date();
|
|
min_date_vdrl_date.setFullYear(min_date_vdrl_date.getFullYear() - 100);
|
|
$('#datepicker-autoclose3').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true,
|
|
endDate: new Date(),
|
|
startDate: min_date_vdrl_date,
|
|
format: 'dd/mm/yyyy'
|
|
});
|
|
|
|
// hiv_date
|
|
var min_date_hiv_date = new Date();
|
|
min_date_hiv_date.setFullYear(min_date_hiv_date.getFullYear() - 100);
|
|
$('#datepicker-autoclose4').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true,
|
|
endDate: new Date(),
|
|
startDate: min_date_hiv_date,
|
|
format: 'dd/mm/yyyy'
|
|
});
|
|
|
|
// obstetric date to prevent future dates
|
|
var min_date = new Date();
|
|
min_date.setDate(min_date.getDate() - 280);
|
|
$('#datepicker-autoclose1').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true,
|
|
endDate: new Date(),
|
|
// startDate: min_date,
|
|
format: 'dd/mm/yyyy'
|
|
});
|
|
|
|
// discontinued date to prevent future dates
|
|
var min_date_discontinued = new Date();
|
|
min_date_discontinued.setDate(min_date_discontinued.getDate() - 280);
|
|
$('#date_discontinued').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true,
|
|
endDate: new Date(),
|
|
startDate: min_date_discontinued,
|
|
format: 'dd/mm/yyyy'
|
|
});
|
|
|
|
// lmp date to prevent future dates
|
|
var min_date = new Date();
|
|
min_date.setDate(min_date.getDate() - 280);
|
|
$('#lmp').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true,
|
|
endDate: new Date(),
|
|
// startDate: min_date,
|
|
format: 'dd/mm/yyyy'
|
|
});
|
|
|
|
// uteurus operation date
|
|
var min_date = new Date();
|
|
min_date.setDate(min_date.getDate() - 280);
|
|
$('#uterus_operation_date_picker').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true,
|
|
endDate: new Date(),
|
|
// startDate: min_date,
|
|
format: 'dd/mm/yyyy'
|
|
});
|
|
|
|
// other operation dates
|
|
|
|
var min_date = new Date();
|
|
min_date.setDate(min_date.getDate() - 280);
|
|
$('#other_operation_date_picker').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true,
|
|
endDate: new Date(),
|
|
startDate: min_date,
|
|
format: 'dd/mm/yyyy'
|
|
});
|
|
|
|
|
|
// scan edd, prevent previous dates
|
|
// edd
|
|
var min_date = new Date();
|
|
min_date.setDate(min_date.getDate() + 300);
|
|
$('#datepicker-autoclose7').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true,
|
|
// endDate: min_date,
|
|
startDate: new Date(),
|
|
format: 'dd/mm/yyyy'
|
|
});
|
|
|
|
|
|
|
|
// pelvis_date
|
|
var min_date_pelvis = new Date();
|
|
// min_date_pelvis.setDate(min_date_pelvis.getDate() - 280);
|
|
min_date_pelvis.setFullYear(min_date_pelvis.getFullYear() - 100); //substract 100 years
|
|
$('.prevent_future_pelvis_date').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true,
|
|
endDate: new Date(),
|
|
startDate: min_date_pelvis,
|
|
format: 'dd/mm/yyyy'
|
|
});
|
|
|
|
// spine_date
|
|
var min_spine_date = new Date();
|
|
// min_spine_date.setDate(min_spine_date.getDate() - 280);
|
|
min_spine_date.setFullYear(min_spine_date.getFullYear() - 100); //substract 100 years
|
|
$('.prevent_future_spine_date').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true,
|
|
endDate: new Date(),
|
|
startDate: min_spine_date,
|
|
format: 'dd/mm/yyyy'
|
|
});
|
|
|
|
// femur_date
|
|
var min_femur_date = new Date();
|
|
// min_femur_date.setDate(min_femur_date.getDate() - 280);
|
|
min_femur_date.setFullYear(min_femur_date.getFullYear() - 100);
|
|
$('.prevent_future_femur_date').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true,
|
|
endDate: new Date(),
|
|
startDate: min_femur_date,
|
|
format: 'dd/mm/yyyy'
|
|
});
|
|
|
|
// lmp date
|
|
var min_date = new Date();
|
|
min_date.setDate(min_date.getDate() - 280);
|
|
$('#datepicker-autoclose5').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true,
|
|
endDate: new Date(),
|
|
startDate: min_date,
|
|
format: 'dd/mm/yyyy'
|
|
});
|
|
|
|
function submitReferral() {
|
|
var name = $("#referral_name").val();
|
|
$.ajax({
|
|
method: 'POST',
|
|
url: '/triage/add_referral',
|
|
data: {
|
|
'name': name
|
|
},
|
|
success: function(response) {
|
|
if (!isNaN(response)) {
|
|
//response = last inserted id
|
|
$('#referral').append($('<option>', {
|
|
value: response,
|
|
text: name
|
|
}));
|
|
$('#referral').val(response); //preselect the newly added referral
|
|
$('#referralsmodal').modal('hide'); //manually hide the modal
|
|
alert('<?php echo __('maternity.adding_referral_success'); ?>');
|
|
} else {
|
|
alert("<?php echo __('maternity.adding_referral_failed'); ?>");
|
|
}
|
|
},
|
|
error: function(jqXHR, textStatus, errorThrown) {
|
|
alert(JSON.stringify(jqXHR));
|
|
console.log(JSON.stringify(jqXHR));
|
|
}
|
|
});
|
|
}
|
|
|
|
$(document).ready(function() {
|
|
$('#primary_diagnosis').select2({
|
|
placeholder: "-- select --"
|
|
});
|
|
$('.select2-selection.select2-selection--single').css('height', 'calc(3.85rem)');
|
|
$('.select2-selection.select2-selection--single').css('padding-top', '5px');
|
|
$('.select2-selection.select2-selection--single').css('border-left',
|
|
'3px solid #F08080'); /*add compulsory class*/
|
|
$('.select2-selection__arrow').css('top', '3px');
|
|
|
|
$('#primary_diagnosis').on('change', function() {
|
|
var data = 'diagnosis_id=' + $(this).val();
|
|
$.ajax({
|
|
type: "get",
|
|
url: "/diagnoses/get_diagnosis",
|
|
data: data,
|
|
cache: false,
|
|
success: function(result) {
|
|
var prompt_and_references = result.split('&&');
|
|
$('#primary_diagnosis_prompt').html(prompt_and_references[0]);
|
|
$('#primary_diagnosis_reference').html(prompt_and_references[1]);
|
|
}
|
|
});
|
|
});
|
|
|
|
/* other diagnoses */
|
|
$('#other_diagnosis').on('change', function() {
|
|
var data = 'diagnosis_id=' + $(this).val();
|
|
$.ajax({
|
|
type: "get",
|
|
url: "/diagnoses/get_diagnosis",
|
|
data: data,
|
|
cache: false,
|
|
success: function(result) {
|
|
var prompt_and_references = result.split('&&');
|
|
$('#secondary_diagnosis_prompt1').html(prompt_and_references[0]);
|
|
$('#secondary_diagnosis_reference1').html(prompt_and_references[1]);
|
|
}
|
|
});
|
|
});
|
|
|
|
//pph details jquery
|
|
$('#show_pph_details_div').click(function(e) {
|
|
$('#pph_details_div').show();
|
|
});
|
|
$('#hide_pph_details_div').click(function(e) {
|
|
$('#pph_details_div').hide();
|
|
});
|
|
$('#show_scar_no_div').click(function(e) {
|
|
$('#scar_no_div').show();
|
|
});
|
|
$('#hide_scar_no_div').click(function(e) {
|
|
$('#scar_no_div').hide();
|
|
});
|
|
$('#show_fits_details_div').click(function(e) {
|
|
$('#fits_details_div').show();
|
|
});
|
|
$('#hide_fits_details_div').click(function(e) {
|
|
$('#fits_details_div').hide();
|
|
});
|
|
$('#show_aph_details_div').click(function(e) {
|
|
$('#aph_details_div').show();
|
|
});
|
|
$('#hide_aph_details_div').click(function(e) {
|
|
$('#aph_details_div').hide();
|
|
});
|
|
|
|
|
|
$("#lmp").change(function() {
|
|
|
|
var lmp_date = $("#lmp").val();
|
|
|
|
$.ajax({
|
|
method: 'POST',
|
|
url: '/calculate_edd_from_lmp',
|
|
data: {
|
|
'lmp_date': lmp_date
|
|
},
|
|
success: function(response) {
|
|
$('#edd').val(response);
|
|
},
|
|
error: function(jqXHR, textStatus, errorThrown) {
|
|
alert(JSON.stringify(jqXHR));
|
|
console.log(JSON.stringify(jqXHR));
|
|
}
|
|
});
|
|
find_weeks_of_amenorrhoea(lmp_date);
|
|
});
|
|
|
|
function find_weeks_of_amenorrhoea(lmp_date) {
|
|
$.ajax({
|
|
method: 'POST',
|
|
url: '/calculate_weeks_of_amenorrhoea_from_lmp',
|
|
data: {
|
|
'lmp_date': lmp_date
|
|
},
|
|
success: function(response) {
|
|
$('#weeks_of_amenorrhoea_text').html(response);
|
|
$('#weeks_of_amenorrhoea').val(response);
|
|
},
|
|
error: function(jqXHR, textStatus, errorThrown) {
|
|
alert(JSON.stringify(jqXHR));
|
|
console.log(JSON.stringify(jqXHR));
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
|
|
//auto calculate number of weeks pregnant //not using this
|
|
$('#datepicker-autoclose5').on('change', function() {
|
|
var lmpDate = $(this).val();
|
|
|
|
// auto calculate the EDD
|
|
let lmp_date_array = lmpDate.split('/');
|
|
let edd_date = new Date(lmp_date_array[2], lmp_date_array[1], lmp_date_array[0]);
|
|
edd_date.setDate(edd_date.getDate() + 280);
|
|
$('#datepicker-autoclose6').val(format_date(edd_date));
|
|
|
|
var today = new Date();
|
|
var dd = today.getDate();
|
|
var mm = today.getMonth() + 1; //January is 0!
|
|
var yyyy = today.getFullYear();
|
|
if (dd < 10) {
|
|
dd = '0' + dd;
|
|
}
|
|
if (mm < 10) {
|
|
mm = '0' + mm;
|
|
}
|
|
var today = dd + '/' + mm + '/' + yyyy;
|
|
|
|
// Here are the two dates to compare dd/mm/yyyy
|
|
// First we split the values to arrays date1[0] is the year, [1] the month and [2] the day
|
|
date1 = lmpDate.split('/');
|
|
date2 = today.split('/');
|
|
|
|
// Now we convert the array to a Date object, which has several helpful methods
|
|
date1 = new Date(date1[2], date1[1], date1[0]);
|
|
date2 = new Date(date2[2], date2[1], date2[0]);
|
|
|
|
// We use the getTime() method and get the unixtime (in milliseconds, but we want seconds, therefore we divide it through 1000)
|
|
date1_unixtime = parseInt(date1.getTime() / 1000);
|
|
date2_unixtime = parseInt(date2.getTime() / 1000);
|
|
|
|
// This is the calculated difference in seconds
|
|
var timeDifference = date2_unixtime - date1_unixtime;
|
|
|
|
// in Hours
|
|
var timeDifferenceInHours = timeDifference / 60 / 60;
|
|
|
|
// and finaly, in days :)
|
|
var timeDifferenceInDays = timeDifferenceInHours / 24;
|
|
|
|
//and finally divide the days by 7 to get the number of weeks for the pregancy
|
|
var timeDifferenceInWeeks = Math.floor(timeDifferenceInDays / 7);
|
|
|
|
//display the value in the number of weeks pregnant box
|
|
$("#weeks_pregnant").val(timeDifferenceInWeeks);
|
|
});
|
|
});
|
|
|
|
$(document).on("click focus", ".transfusion-date,.obstetric-date", function() {
|
|
//console.log("clicked to add date picker");
|
|
$(this).datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true,
|
|
format: 'dd/mm/yyyy',
|
|
});
|
|
});
|
|
|
|
// add row
|
|
function addRow(tableID) {
|
|
var table = document.getElementById(tableID);
|
|
var rowCount = table.rows.length;
|
|
var row = table.insertRow(rowCount);
|
|
var colCount = table.rows[0].cells.length;
|
|
|
|
for (var i = 0; i < colCount; i++) {
|
|
var newcell = row.insertCell(i);
|
|
newcell.innerHTML = table.rows[1].cells[i].innerHTML;
|
|
/* set new id for the symptom select tag which is found in the first cell of every row
|
|
* this makes the symptom select tag id dynamic and different for each table row
|
|
* the id should be the rowCount +1000 to avoid a similar id with prompt div tag id set below
|
|
*/
|
|
if (i == 1) {
|
|
newcell.childNodes[0].id = (rowCount + 1000);
|
|
}
|
|
/*
|
|
* set new value for the prompt div tag
|
|
*/
|
|
if (i == 2) {
|
|
table.rows[rowCount].cells[2].innerHTML = '';
|
|
table.rows[rowCount].cells[2].innerHTML = '<div class="well well-sm" id="' + rowCount +
|
|
'"> </div>';
|
|
}
|
|
|
|
if (i == 3) {
|
|
// var myid = (rowCount + 100);
|
|
table.rows[rowCount].cells[3].innerHTML = '';
|
|
table.rows[rowCount].cells[3].innerHTML = '<div class="well well-sm" id="' + (rowCount + 100) +
|
|
'"> </div>';
|
|
}
|
|
|
|
switch (newcell.childNodes[0].type) {
|
|
case "text":
|
|
// newcell.childNodes[0].value = "";
|
|
break;
|
|
case "checkbox":
|
|
newcell.childNodes[0].checked = false;
|
|
break;
|
|
case "select-one":
|
|
newcell.childNodes[0].selectedIndex = 0;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
// delete row
|
|
function deleteRowData(tableID) {
|
|
try {
|
|
var table = document.getElementById(tableID);
|
|
var rowCount = table.rows.length;
|
|
for (var i = 0; i < rowCount; i++) {
|
|
var row = table.rows[i];
|
|
var chkbox = row.cells[0].childNodes[0];
|
|
if (null != chkbox && true == chkbox.checked) {
|
|
if (rowCount <= 2) {
|
|
alert("<?php echo __('maternity.cant_delete_rows'); ?>");
|
|
break;
|
|
}
|
|
table.deleteRow(i);
|
|
rowCount--;
|
|
i--;
|
|
}
|
|
}
|
|
} catch (e) {
|
|
alert(e);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// obstetric row
|
|
function addObstetricRow(tableID) {
|
|
var table = document.getElementById(tableID);
|
|
var rowCount = table.rows.length;
|
|
//console.log("row count : " + rowCount);
|
|
var row = table.insertRow(rowCount);
|
|
var colCount = table.rows[0].cells.length;
|
|
|
|
for (var i = 0; i < colCount; i++) {
|
|
var newcell = row.insertCell(i);
|
|
if (rowCount < 3) {
|
|
newcell.innerHTML = table.rows[1].cells[i].innerHTML;
|
|
} else {
|
|
newcell.innerHTML = table.rows[rowCount - 1].cells[i].innerHTML;
|
|
}
|
|
/* set new id for the symptom select tag which is found in the first cell of every row
|
|
* this makes the symptom select tag id dynamic and different for each table row
|
|
* the id should be the rowCount +1000 to avoid a similar id with prompt div tag id set below
|
|
*/
|
|
if (i == 1) {
|
|
newcell.childNodes[0].id = (rowCount + 1000);
|
|
}
|
|
if (i == 2) {
|
|
table.rows[rowCount].cells[2].innerHTML = '';
|
|
table.rows[rowCount].cells[2].innerHTML =
|
|
'<input name="gestation[]" class="form-control well-sm" placeholder="<?php echo __('maternity.weeks'); ?>" id="' +
|
|
rowCount + '"> </div>';
|
|
}
|
|
if (i == 3) {
|
|
table.rows[rowCount].cells[3].innerHTML = '';
|
|
var ancOutcomes = {!! json_encode($anc_outcomes) !!};
|
|
var options = ''; //initialize the options tag
|
|
for (var outcome in ancOutcomes) {
|
|
if (ancOutcomes.hasOwnProperty(outcome)) {
|
|
options += '<option value=' + outcome + '>' + ancOutcomes[outcome] + '</option>';
|
|
}
|
|
}
|
|
table.rows[rowCount].cells[3].innerHTML =
|
|
'<select name="obstetric_outcome[]" class="form-control" id="' + (rowCount + 100) + '"> ' +
|
|
options + '</select>';
|
|
}
|
|
|
|
switch (newcell.childNodes[0].type) {
|
|
case "text":
|
|
// newcell.childNodes[0].value = "";
|
|
break;
|
|
case "checkbox":
|
|
newcell.childNodes[0].checked = false;
|
|
break;
|
|
case "select":
|
|
newcell.childNodes[0].selectedIndex = 0;
|
|
console.log("entered option for select");
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
// additional obstetric date and transfusion date
|
|
$(document).on("click focus", ".obstetric_date,.transfusion_date", function() {
|
|
var min_obstetric_date = new Date();
|
|
min_obstetric_date.setDate(min_obstetric_date.getDate() - 100000000);
|
|
//console.log("clicked to add date picker");
|
|
$(this).datepicker({
|
|
autoclose: true,
|
|
endDate: new Date(),
|
|
startDate: min_obstetric_date,
|
|
todayHighlight: true,
|
|
format: 'dd/mm/yyyy',
|
|
});
|
|
});
|
|
|
|
// blood transfusion
|
|
function addBloodTransfusionRow(tableID) {
|
|
var table = document.getElementById(tableID);
|
|
var rowCount = table.rows.length;
|
|
var row = table.insertRow(rowCount);
|
|
var colCount = table.rows[0].cells.length;
|
|
|
|
for (var i = 0; i < colCount; i++) {
|
|
var newcell = row.insertCell(i);
|
|
if (rowCount < 3) {
|
|
newcell.innerHTML = table.rows[1].cells[i].innerHTML;
|
|
} else {
|
|
newcell.innerHTML = table.rows[rowCount - 1].cells[i].innerHTML;
|
|
}
|
|
/* set new id for the symptom select tag which is found in the first cell of every row
|
|
* this makes the symptom select tag id dynamic and different for each table row
|
|
* the id should be the rowCount +1000 to avoid a similar id with prompt div tag id set below
|
|
*/
|
|
if (i == 1) {
|
|
newcell.childNodes[0].id = (rowCount + 1000);
|
|
}
|
|
/*
|
|
* set new value for the prompt div tag
|
|
*/
|
|
if (i == 2) {
|
|
table.rows[rowCount].cells[2].innerHTML = '';
|
|
table.rows[rowCount].cells[2].innerHTML =
|
|
'<input type="number" name="no_of_units[]" class="form-control" id="' + rowCount + '"> </div>';
|
|
}
|
|
|
|
if (i == 3) {
|
|
table.rows[rowCount].cells[3].innerHTML = '';
|
|
table.rows[rowCount].cells[3].innerHTML =
|
|
'<input name="transfusion_comment[]" class="form-control" id="' + (rowCount + 100) +
|
|
'"> </div>';
|
|
}
|
|
|
|
switch (newcell.childNodes[0].type) {
|
|
case "text":
|
|
// newcell.childNodes[0].value = "";
|
|
break;
|
|
case "checkbox":
|
|
newcell.childNodes[0].checked = false;
|
|
break;
|
|
case "select":
|
|
newcell.childNodes[0].selectedIndex = 0;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
function format_date(date) {
|
|
let d = new Date(date),
|
|
month = '' + (d.getMonth() + 1),
|
|
day = '' + d.getDate(),
|
|
year = d.getFullYear();
|
|
|
|
if (month.length < 2)
|
|
month = '0' + month;
|
|
if (day.length < 2)
|
|
day = '0' + day;
|
|
|
|
return [day, month, year].join('-');
|
|
}
|
|
</script>
|
|
|
|
{{-- clear puerperium if fresh SB is selected --}}
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('.dropdown').change(function() {
|
|
var selectedValue = $(this).val();
|
|
if (selectedValue === '1') {
|
|
// $('.input1').val('');
|
|
$('.input2').val('');
|
|
} else if (selectedValue === '2') {
|
|
// $('.input1').val('');
|
|
// $('.input2').val('');
|
|
} else if (selectedValue === '3') {
|
|
// $('.input1').val('');
|
|
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
|
|
{{-- updated scripts --}}
|
|
<script type="text/javascript">
|
|
// onstetric details outcopme
|
|
function abortion_outcome(data) {
|
|
var id = data.split("_");
|
|
var id_number = id[1];
|
|
|
|
if ($('#pregnancy_' + id_number + '_obstetric_outcome').val() == '1' || $('#pregnancy_' + id_number +
|
|
'_obstetric_outcome').val() == '2') {
|
|
|
|
$('#child_details_div_' + id_number).show();
|
|
$('.birth_show_' + id_number).show();
|
|
$('.child_details_div_' + id_number).prop('required', true);
|
|
$('.child_details_div_' + id_number).addClass('compulsory');
|
|
} else {
|
|
$('.clear_input_' + id_number).val('');
|
|
// $('.clear_input' ).val('');
|
|
|
|
if ($('#child_details_div_' + id_number).is(":visible")) {
|
|
$('#child_details_div_' + id_number).hide();
|
|
$('.child_details_div_' + id_number).prop('required', false);
|
|
}
|
|
if ($('.birth_show_' + id_number).is(":visible")) $('.birth_show_' + id_number).hide();
|
|
|
|
// // w: Add condition to clear input field when value is '3'
|
|
// if ($('#pregnancy_' + id_number + '_obstetric_outcome').val() == '3') {
|
|
// // Assuming the input field has an ID like 'input_field_' + id_number
|
|
// $('.clear_input' + id_number).val(''); // Clear input field
|
|
// }
|
|
|
|
}}
|
|
|
|
// function abortion_outcome(data) {
|
|
// var id = data.split("_");
|
|
// var id_number = id[1];
|
|
// var selectedValue = $('#pregnancy_' + id_number + '_obstetric_outcome').val();
|
|
|
|
// if (selectedValue == '1' || selectedValue == '2') {
|
|
// $('#child_details_div_' + id_number).show();
|
|
// $('.birth_show_' + id_number).show();
|
|
// $('.child_details_div_' + id_number).prop('required', true);
|
|
// $('.child_details_div_' + id_number).addClass('compulsory');
|
|
// } else {
|
|
// if ($('#child_details_div_' + id_number).is(":visible")) {
|
|
// $('#child_details_div_' + id_number).hide();
|
|
// $('.child_details_div_' + id_number).prop('required', false);
|
|
// }
|
|
// if ($('.birth_show_' + id_number).is(":visible")) $('.birth_show_' + id_number).hide();
|
|
|
|
// // Clear input field when value is 3
|
|
// if (selectedValue == '3') {
|
|
// console.log("three is selected " + id_number);
|
|
// $('#clear_input' + id_number).val(''); // Replace 'input_field_' with your actual input field ID
|
|
// // $('.clear_input').val('');
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
function add_pregnancy_row() {
|
|
let countAll = document.querySelectorAll('.pregnacy_details').length;
|
|
let counter = ++countAll;
|
|
$(".pregnancy_div").append(`<br><div id="pregnancy_${counter}" class="pregnacy_details">
|
|
<div class="row">
|
|
<div class="col form-group">
|
|
{{ Form::label('obstetric_date', __('antenatal.date')) }}
|
|
<div class="input-group">
|
|
{{ Form::text('pregnancy_${counter}_obstetric_date', '', ['class' => 'form-control obstetric_date', 'readonly', 'id' => 'datepicker-autoclose1']) }}
|
|
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
|
</div>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
<div class="col form-group">
|
|
{{ Form::label('gestation', __('antenatal.gestation')) }}
|
|
<div class="input-group">
|
|
<input type="number" class="form-control col-sm-12" name="pregnancy_${counter}_gestation" placeholder="weeks">
|
|
</div>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
<div class="col form-group">
|
|
{{ Form::label('outcome', __('antenatal.outcome')) }}
|
|
<div class="input-group">
|
|
{{ Form::select('pregnancy_${counter}_obstetric_outcome', $anc_outcomes, '', ['class' => 'form-control col-sm-12', 'id' => 'pregnancy_${counter}_obstetric_outcome', 'onchange' => 'abortion_outcome(this.id)']) }}
|
|
</div>
|
|
<div class="help-block with-errors"></div>
|
|
<div class="form-group" style="display: none" id="abortion_outcome_div_${counter}">
|
|
{{ Form::label('outcome', __('antenatal.abortion_date')) }}
|
|
<div class="input-group">
|
|
{{ Form::select('pregnancy_${counter}_abortion_outcome', ['' => __('antenatal.select'), '1' => __('antenatal.below_12'), '2' => __('antenatal.12_and_above')], '', ['class' => 'form-control col-sm-12', 'id' => 'pregnancy_${counter}_abortion_outcome']) }}
|
|
</div>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
<div class="form-group" style="display: none" id="stillbirth_type_div_${counter}">
|
|
{{ Form::label('pregnancy_${counter}_stillbirth_type', __('antenatal.stillbirth_type')) }}
|
|
<div class="input-group">
|
|
{{ Form::select('pregnancy_${counter}_stillbirth_type', ['' => __('antenatal.select'), '1' => __('antenatal.antepartum'), '2' => __('antenatal.intrapartum')], '', ['class' => 'form-control col-sm-12', 'id' => 'pregnancy_${counter}_stillbirth_type']) }}
|
|
</div>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
</div>
|
|
<div class="col form-group birth_show_${counter}" style="display:none;">
|
|
{{ Form::label('delivery_type', __('antenatal.delivery_type')) }}
|
|
<div class="input-group">
|
|
{{ Form::select('pregnancy_${counter}_delivery_type', ['' => __('antenatal.select'), '1' => __('antenatal.vaginal_delivery'), '2' => __('antenatal.vacuum_delivery'), '3' => __('antenatal.forceps_delivery'), '4' => __('antenatal.c_section'), '5' => __('antenatal.vbac')], '', ['class' => 'form-control col-sm-12 clear_input_${counter}', 'id' => 'pregnancy_${counter}_delivery_type']) }}
|
|
</div>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
<div class="col form-group birth_show_${counter}" style="display:none;">
|
|
{{ Form::label('pregnancy_complication', __('antenatal.pregnancy_complication')) }}
|
|
<div class="input-group">
|
|
{{ Form::select('pregnancy_${counter}_pregnancy_complication', ['' => __('antenatal.select'), '1' => __('antenatal.retained_placenta'), '2' => __('antenatal.eclampsia'), '3' => __('antenatal.pph')], '', ['class' => 'form-control col-sm-12 clear_input_${counter}', 'id' => 'pregnancy_${counter}_pregnancy_complication']) }}
|
|
</div>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
<div class="col form-group birth_show_${counter}" style="display:none;">
|
|
{{ Form::label('puerperium', __('antenatal.puerperium')) }}
|
|
<div class="input-group">
|
|
<input type="text" class="form-control col-sm-12 clear_input_${counter}" name="pregnancy_${counter}_puerperium" id="pregnancy_${counter}_puerperium">
|
|
</div>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
<div class="col-sm-1"><button class="btn btn-sm btn-rounded btn-danger" title="Delete this Pregnancy" style="color: white; margin-top: 25px;" id='pregnancy_${counter}_delete' onclick='delete_pregnancy(this.id)' type="button"><i class="fa fa-trash"></i></button></div>
|
|
</div>
|
|
<div id="child_details_div_${counter}" style="display: none">
|
|
<p><h5 class="text-center"><b>Child's Details</b></h5></p>
|
|
<table class="table color-table inverse-table table-responsive table-borderless" id="child_details_table_${counter}">
|
|
<thead>
|
|
<th>{{ __('patients.full_names') }}</th>
|
|
<th>{{ __('patients.gender') }}</th>
|
|
<th>{{ __('patients.patient_number') }}</th>
|
|
<th>{{ __('antenatal.child_birth_weight') }}</th>
|
|
<th>{{ __('antenatal.child_immunisation_status') }}</th>
|
|
<th>{{ __('antenatal.health_condition') }}</th>
|
|
<th>#</th>
|
|
</thead>
|
|
<tbody id="child_data_${counter}">
|
|
<tr>
|
|
<td>
|
|
{{ Form::text('pregnancy_${counter}_child_name[]', '', ['class' => 'form-control child_details_div_${counter} clear_input_${counter}', 'id' => 'pregnancy_${counter}_child_name_1', 'placeholder' => 'Happy Mukisa']) }}
|
|
</td>
|
|
<td style="min-width: 90px;">
|
|
<select style="display: inline-block;" class="form-control clear_input_${counter}" name="pregnancy_${counter}_child_gender[]" id="pregnancy_${counter}_child_gender_1"><option value=" " selected>-- Select --</option><option value="1">Male</option><option value="2">Female</option></select>
|
|
</td>
|
|
<td>
|
|
{{ Form::number('pregnancy_${counter}_child_patient_number[]', '', ['class' => 'form-control child_details_div_${counter} clear_input_${counter}', 'step' => '1']) }}
|
|
</td>
|
|
<td>
|
|
{{ Form::number('pregnancy_${counter}_child_birth_weight[]', '', ['class' => 'form-control child_details_div_${counter} clear_input_${counter}', 'step' => '0.1']) }}
|
|
</td>
|
|
<td>
|
|
{{ Form::select('pregnancy_${counter}_child_immunisation_status[]', ['' => __('antenatal.select'), '1' => __('antenatal.not_started'), '2' => __('antenatal.ongoing'), '3' => __('antenatal.completed')], '', ['class' => 'form-control child_details_div_${counter} clear_input_${counter}']) }}
|
|
</td>
|
|
<td>
|
|
{{ Form::textarea('pregnancy_${counter}_child_health_condition[]', '', ['class' => 'form-control clear_input_${counter}', 'id' => 'health_condition', 'rows' => '3']) }}
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<a class="add_child_button label label-inverse" style="color: #fff;" id="add_child_${counter}" role="button" onclick="add_child_div(this.id)">{{ __('antenatal.add_child_row') }}</a>
|
|
</div>
|
|
</div>`);
|
|
}
|
|
|
|
function add_child_div(data) {
|
|
var child = data.split("_");
|
|
var child_div = $("#child_data_" + child[2]);
|
|
var table_id = 'child_details_table_' + child[2];
|
|
var pregnancy = 'pregnancy_' + child[2];
|
|
var count = document.getElementById(table_id).rows.length;
|
|
var row_id = count++;
|
|
$(child_div).append(`<tr><td><input class="form-control" id="child_name_${row_id}" name="${pregnancy}_child_name[]" type="text" "placeholder"="Happy Mukisa" /></td>
|
|
<td style="min-width: 90px;"><select style="display: inline-block;" class="form-control" name="${pregnancy}_child_gender[]" id="${pregnancy}_child_gender_${row_id}"><option value=" " selected>-- Select --</option><option value="1">Male</option><option value="2">Female</option></select></td>
|
|
<td><input type='number' name='${pregnancy}_child_patient_number[]' id='child_patient_number_${row_id}' class='form-control' min='0'></td>
|
|
<td><input type='number' name='${pregnancy}_child_birth_weight[]' id='child_birth_weight_${row_id}' class='form-control' min='0' step='0.1'></td>
|
|
<td><select style="display: inline-block;" class="form-control" name="${pregnancy}_child_immunisation_status[]" id="${pregnancy}_child_immunisation_status_${row_id}"><option value=" " selected>-- Select --</option><option value="1">Not Started</option><option value="2">Ongoing</option><option value="3">Completed</option></select></td>
|
|
<td><textarea class="form-control" name="${pregnancy}_child_health_condition[]" rows="3" "id"="${pregnancy}_child_health_condition_${row_id}"></textarea></td>
|
|
<td><button onclick="deleteRow(this)" class="btn btn-sm btn-rounded btn-danger" title="Delete this row" style="color: white;" type="button"><i class="fa fa-trash"></i></button></td>
|
|
</tr>`);
|
|
}
|
|
/* This method will delete a row */
|
|
function deleteRow(ele) {
|
|
ele.parentNode.parentNode.remove();
|
|
}
|
|
|
|
function delete_pregnancy(id) {
|
|
var pregnancy = id.split("_");
|
|
var pregnancy_div_id = 'pregnancy_' + pregnancy[1];
|
|
$('#' + pregnancy_div_id).remove();
|
|
}
|
|
|
|
|
|
// other scripts
|
|
$('#submit-btn').click(function() {
|
|
let countAll = document.querySelectorAll('.pregnacy_details').length;
|
|
$('#pregnancy_number').val(countAll);
|
|
});
|
|
|
|
function drill_down() {
|
|
$("#previous_visits").submit();
|
|
}
|
|
</script>
|
|
|
|
|
|
|
|
|
|
{{-- display section of previous consultation details on button click --}}
|
|
|
|
|
|
<script>
|
|
function add_uterus_operations_row(table_id, body_id) {
|
|
var id = document.getElementById(table_id).rows.length + 1;
|
|
if (body_id == 'other_operations_data') {
|
|
$('#other_operations_data').append(`
|
|
<tr>
|
|
<td>
|
|
{{ Form::text('other_operations_name[]', '', ['class' => 'form-control', 'id' => 'other_operations_name_${id}']) }}
|
|
</td>
|
|
<td style="min-width: 90px;">
|
|
<div class="input-group">
|
|
{{ Form::text('other_operations_name_date[]', '', ['class' => 'form-control fractures', 'id' => 'other_operations_date_${id}', 'placeholder' => 'When?']) }}<span class="input-group-addon"><i class="icon-calender"></i></span>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
{{ Form::text('other_operations_name_facility_name[]', '', ['class' => 'form-control', 'id' => 'other_operations_facility_name_${id}']) }}
|
|
</td>
|
|
<td><button onclick="deleteRow(this)" class="btn btn-sm btn-rounded btn-danger" title="Delete this row" style="color: white;" type="button"><i class="fa fa-trash"></i></button></td>
|
|
</tr>
|
|
`);
|
|
} else {
|
|
$('#uterus_operations_data').append(`<tr>
|
|
<td>
|
|
{{ Form::text('uterus_operations_name[]', '', ['class' => 'form-control uterus_operations', 'id' => 'uterus_operations_name_${id}']) }}
|
|
|
|
</td>
|
|
<td style="min-width: 90px;">
|
|
<div class="input-group">
|
|
{{ Form::text('uterus_operations_date[]', '', ['class' => 'form-control fractures', 'id' => 'uterus_operations_date_${id}', 'placeholder' => 'When?']) }}<span class="input-group-addon"><i class="icon-calender"></i></span>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
{{ Form::text('uterus_operations_facility_name[]', '', ['class' => 'form-control', 'id' => 'uterus_operations_facility_name_${id}']) }}
|
|
</td>
|
|
<td><button onclick="deleteRow(this)" class="btn btn-sm btn-rounded btn-danger" title="Delete this row" style="color: white;" type="button"><i class="fa fa-trash"></i></button></td>
|
|
</tr>`);
|
|
|
|
}
|
|
|
|
// $('.fractures').datepicker({
|
|
// autoclose: true,
|
|
// todayHighlight: true,
|
|
// format: 'dd/mm/yyyy',
|
|
|
|
// });
|
|
|
|
|
|
var min_date_operation = new Date();
|
|
min_date_operation.setFullYear(min_date_operation.getFullYear() - 100);
|
|
$('.fractures').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true,
|
|
endDate: new Date(),
|
|
// startDate: min_date_operation,
|
|
format: 'dd/mm/yyyy'
|
|
});
|
|
|
|
}
|
|
</script>
|
|
|
|
|
|
|
|
<script>
|
|
// uterus operations and other operations date
|
|
var min_date_uterus_operations = new Date();
|
|
min_date_uterus_operations.setDate(min_date_uterus_operations.getDate() - 280);
|
|
$('.operation_date').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true,
|
|
endDate: new Date(),
|
|
// startDate: min_date_uterus_operations,
|
|
format: 'dd/mm/yyyy'
|
|
});
|
|
</script>
|
|
|
|
{{-- other checkbox values --}}
|
|
<script>
|
|
// teeth physical examinatinon input
|
|
document
|
|
.getElementById('show_teeth_physical_examination_input')
|
|
.addEventListener('change', function() {
|
|
var ptextInputContainer = document.getElementById(
|
|
'teeth_physical_examination_input'
|
|
);
|
|
if (this.checked) {
|
|
ptextInputContainer.style.display = 'block';
|
|
} else {
|
|
ptextInputContainer.style.display = 'none';
|
|
}
|
|
});
|
|
|
|
// add lungs physical examinatinon input
|
|
document
|
|
.getElementById('show_lungs_physical_examination_input')
|
|
.addEventListener('change', function() {
|
|
var ptextInputContainer = document.getElementById(
|
|
'lungs_physical_examination_input'
|
|
);
|
|
if (this.checked) {
|
|
ptextInputContainer.style.display = 'block';
|
|
} else {
|
|
ptextInputContainer.style.display = 'none';
|
|
}
|
|
});
|
|
|
|
// add breasts physical examinatinon input
|
|
document
|
|
.getElementById('show_breasts_physical_examination_input')
|
|
.addEventListener('change', function() {
|
|
var ptextInputContainer = document.getElementById(
|
|
'breasts_physical_examination_input'
|
|
);
|
|
if (this.checked) {
|
|
ptextInputContainer.style.display = 'block';
|
|
} else {
|
|
ptextInputContainer.style.display = 'none';
|
|
}
|
|
});
|
|
|
|
// add legs physical examinatinon input
|
|
document
|
|
.getElementById('show_legs_physical_examination_input')
|
|
.addEventListener('change', function() {
|
|
var ptextInputContainer = document.getElementById(
|
|
'legs_physical_examination_input'
|
|
);
|
|
if (this.checked) {
|
|
ptextInputContainer.style.display = 'block';
|
|
} else {
|
|
ptextInputContainer.style.display = 'none';
|
|
}
|
|
});
|
|
</script>
|
|
|
|
{{-- w: add blood transfusion row --}}
|
|
<script>
|
|
function add_blood_transfusion_row(table_id, body_id) {
|
|
var id = document.getElementById(table_id).rows.length + 1;
|
|
if (body_id == 'blood_transfusion_data') {
|
|
$('#blood_transfusion_data').append(`
|
|
<tr>
|
|
|
|
<td>
|
|
<div class="form-group">
|
|
<div class="input-group">
|
|
{{ Form::text('transfusion_date[]', '', ['class' => 'form-control transfusion-date', 'readonly', 'id' => 'transfusion_date__${id}']) }}
|
|
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
|
</div>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
</td>
|
|
|
|
<td><input type="number" class="form-control col-sm-12" name="no_of_units[]" id="transfusion_unit__${id}">
|
|
<td><input type="text" class="form-control col-sm-12" name="transfusion_comment[]" id="transfusion_comment__${id}"></td>
|
|
|
|
<td>
|
|
<button onclick="deleteBloodTransfusionRow(this)" class="btn btn-sm btn-rounded btn-danger" title="Delete this row" style="color: white;" type="button"><i class="fa fa-trash"></i></button>
|
|
</td>
|
|
</tr>
|
|
|
|
`);
|
|
}
|
|
|
|
}
|
|
|
|
/* delete tour itenary row */
|
|
function deleteBloodTransfusionRow(ele) {
|
|
ele.parentNode.parentNode.remove();
|
|
}
|
|
</script>
|
|
@endpush
|