ESH/patient_details_form_receptionist.php
2024-10-23 18:28:06 +05:30

1152 lines
40 KiB
PHP

<div class="panel panel-default">
<div class="panel-heading panel-heading1"
id="panel-heading-profile">
<h5 class="panel-title panel-title1" id="panel-title1"
style="display: block; font-size: 12px; color: #337ab7; height: 17px; text-decoration: none; font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;">
<a role="button" data-toggle="collapse"
href="#examinationPanel" aria-expanded="true"
aria-controls="collapseOne">
Examination</a></h5>
</div>
<div id="examinationPanel" class="panel-collapse">
<div class="panel-body">
<form class="form-horizontal" id="medical_examination_form"
name="medical_examination_form" enctype="multipart/form-data"
action="#" method="post">
<div class="box-body" id="medical_examination_form_one">
<div class="row">
<div class="col-sm-12" style="margin-top: -5rem">
<input type="hidden" id="hiddenHighlighter" name="hiddenHighlighter" >
<!-- VITALS START -->
<div class="row">
<div class="col-sm-12">
<div class="table-responsive">
<center>
<b style="font-weight: 800">Vitals</b>
</center>
<table style="width: 100%" class="table-bordered">
<th height="30px"><center>
Height
<p>(in CMS)</p>
</center></th>
<th height="30px"><center>
Weight
<p>(in KGS)</p>
</center></th>
<th height="30px"><center>BMI</center></th>
<th height="30px"><center>Pulse</center></th>
<th height="30px"><center>Blood Pressure</center></th>
<th height="30px"><center>SpO2</center></th>
<tr>
<td><input
style="margin-top: 20px; margin-bottom: 20px; margin-left: 15px; width: 80%"
type="number" name="height" id="height"
onchange="calculateBMI()" value="<?php echo $height ?>"
onchange="colorValidation(this.id, this.value, 100, 250)" ;/>
</td>
<td><input
style="margin-top: 20px; margin-bottom: 20px; margin-left: 15px; width: 80%"
type="number" name="weight" id="weight"
onchange="calculateBMI()" value="<?php echo $weight ?>"
onchange="colorValidation(this.id, this.value, 30, 120)" ;/>
</td>
<td><input readonly
style="margin-top: 20px; margin-bottom: 20px; margin-left: 15px; width: 80%"
type="number" name="bmi" id="bmi" value="<?php echo $bmi ?>"
onchange="colorValidation(this.id, this.value, 19, 25)" ; />
</td>
<td><input
style="margin-top: 20px; margin-bottom: 20px; margin-left: 15px; width: 80%"
type="number" name="pulse" id="pulse" value="<?php echo $pulse ?>"
onchange="colorValidation(this.id, this.value, 65, 80)" ;/>
</td>
<td><input
style="margin-top: 20px; margin-bottom: 20px; margin-left: 15px; width: 80%"
type="text" name="bp" id="bp" value="<?php echo $bp ?>"
onchange="colorBpValidation(this.id, this.value, 82, 122)"
; maxlength="8" /></td>
<td><input
style="margin-top: 20px; margin-bottom: 20px; margin-left: 15px; width: 80%"
type="number" name="SpO2" id="SpO2" value="<?php echo $SpO2?>" /></td>
</tr>
</table>
</div>
</div>
</div>
<!-- VITALS END -->
<!-- VISION STARTS -->
<div class="row">
<div class="col-sm-12">
<div class="table-responsive">
<center>
<b style="font-weight: 800">VISION</b>
</center>
<table style="width: 100%" class="table-bordered">
<th height="30px"><center>
Distant vision
<p>(without glasses)</p>
</center></th>
<th height="30px"><center>
Near vision
<p>(without glasses)</p>
</center></th>
<th height="30px"><center>color vision</center></th>
<tr>
<th style="width: 33%"><span style="margin-left: 65px">LEFT
EYE</span> <span style="margin-left: 230px">RIGHT EYE</span></th>
<th style="width: 33%"><span style="margin-left: 65px">LEFT
EYE</span> <span style="margin-left: 230px">RIGHT EYE</span></th>
<th style="width: 33%"><center>BOTH EYES</center></th>
</tr>
<tr>
<td style="width: 35%"><b style="margin-left: 30px">6/</b><input
style="margin-top: 10px; margin-bottom: 10px; margin-left: 5px; width: 20%"
type="number" name="dis_without_left_eye"
id="dis_without_left_eye"
value="<?php echo $dis_without_left_eye ?>"
onchange="colorValidation(this.id, this.value, 3, 7)"; > <b
style="margin-left: 180px">6/</b><input
style="margin-top: 5px; margin-bottom: 10px; margin-left: 5px; width: 20%"
type="number" name="dis_without_right_eye"
id="dis_without_right_eye"
value="<?php echo $dis_without_right_eye ?>"
onchange="colorValidation(this.id, this.value, 3, 7)"; ></td>
<td style="width: 35%"><b style="margin-left: 30px">N/</b><input
style="margin-top: 10px; margin-bottom: 10px; margin-left: 5px; width: 20%"
type="number" name="near_without_left_eye"
id="near_without_left_eye"
value="<?php echo $near_without_left_eye ?>"
onchange="colorValidation(this.id, this.value, 3, 7)"; > <b
style="margin-left: 180px">N/</b><input
style="margin-top: 10px; margin-bottom: 10px; margin-left: 5px; width: 20%"
type="number" name="near_without_right_eye"
id="near_without_right_eye"
value="<?php echo $near_without_right_eye ?>"
onchange="colorValidation(this.id, this.value, 3, 7)"; ></td>
<td style="width: 30%"><input style="margin-left: 20px"
type="radio" name="color_vision" id="color_vision"
value="Normal"
<?php if(strcmp($color_vision,'Normal') == 0){ echo "checked";} ?>>
<b style="display: inline">Normal</b> <input
style="margin-left: 30px" type="radio" name="color_vision"
id="color_vision" value="Defective"
<?php if(strcmp($color_vision,'Defective') == 0){ echo "checked";} ?> /><b
style="display: inline">Defective</b></td>
</tr>
</table>
</div>
</div>
</div>
<!-- VISION ENDS -->
<!-- clinical examination starts -->
<div class="row">
<div class="col-sm-12">
<div class="table-responsive">
<center>
<b style="font-weight: 800">clinical examination</b>
</center>
<table style="width: 100%" class="table-bordered">
<th height="30px"><center>gate</center></th>
<th height="30px"><center>skin</center></th>
<th height="30px"><center>hair</center></th>
<th height="30px"><center>nails</center></th>
<th height="30px"><center>lung examination</center></th>
<tr>
<td width="20%">
<center>
<select
style="margin-top: 20px; margin-bottom: 20px; width: 90%"
name="gate" id="gate"
><option
disabled selected>Please select option</option>
<option value="Normal"
<?php if(strcmp($gate,'Normal') == 0){ echo "selected";}?>>Normal</option>
<option value="Limping"
<?php if(strcmp($gate,'Limping') == 0){ echo "selected";} ?>>Limping</option>
</select>
</center>
</td>
<td width="20%">
<center>
<select
style="margin-top: 20px; margin-bottom: 20px; width: 90%"
name="skin" id="skin"
><option
disabled selected>Please select option</option>
<option value="Normal"
<?php if(strcmp($skin,'Normal') == 0){ echo "selected";}?>>Normal</option>
<option value="Skin Lesion"
<?php if(strcmp($skin,'Skin Lesion') == 0){ echo "selected";} ?>>Skin
Lesion</option>
</select>
</center>
</td>
<td width="20%">
<center>
<select
style="margin-top: 20px; margin-bottom: 20px; width: 90%"
name="hair" id="hair"><option disabled selected>Please
select option</option>
<option value="Black"
<?php if(strcmp($hair,'Black') == 0){ echo "selected";}?>>Black</option>
<option value="Grey"
<?php if(strcmp($hair,'Grey') == 0){ echo "selected";} ?>>Grey</option>
<option value="Colored"
<?php if(strcmp($hair,'Colored') == 0){ echo "selected";} ?>>Colored</option>
</select>
</center>
</td>
<td width="20%">
<center>
<select
style="margin-top: 20px; margin-bottom: 20px; width: 90%"
name="nails" id="nails"
><option
disabled selected>Please select option</option>
<option value="Normal"
<?php if(strcmp($nails,'Normal') == 0){ echo "selected";}?>>Normal</option>
<option value="Abnormal"
<?php if(strcmp($nails,'Abnormal') == 0){ echo "selected";} ?>>Abnormal</option>
</select>
</center>
</td>
<td width="20%">
<center>
<select
style="margin-top: 20px; margin-bottom: 20px; width: 90%"
name="lung_exam" id="lung_exam"><option disabled selected>Please
select option</option>
<option value="Normal"
<?php if(strcmp($lung_exam,'Normal') == 0){ echo "selected";}?>>Normal</option>
<option value="Added Sound"
<?php if(strcmp($lung_exam,'Added Sound') == 0){ echo "selected";} ?>>Added
sound</option>
<option value="Reduced Air Entry"
<?php if(strcmp($lung_exam,'Reduced Air Entry') == 0){ echo "selected";} ?>>Reduced
air entry</option>
</select>
</center>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="table-responsive">
<table style="width: 100%" class="table-bordered">
<th height="30px"><center>liver</center></th>
<th height="30px"><center>speen</center></th>
<th height="30px"><center>heart sound</center></th>
<th height="30px"><center>hernia</center></th>
<th height="30px"><center>hydrocele</center></th>
<th height="30px"><center>ecg findings</center></th>
<tr>
<td>
<center>
<select
style="margin-top: 20px; margin-bottom: 20px; width: 90%"
name="liver" id="liver"
><option
disabled selected>Please select option</option>
<option value="Palpable"
<?php if(strcmp($liver,'Palpable') == 0){ echo "selected";}?>>Palpable</option>
<option value="Not Palpable"
<?php if(strcmp($liver,'Not Palpable') == 0){ echo "selected";} ?>>Not
Palpable</option>
</select>
</center>
</td>
<td>
<center>
<select
style="margin-top: 20px; margin-bottom: 20px; width: 90%"
name="speen" id="speen"
><option
disabled selected>Please select option</option>
<option value="Palpable"
<?php if(strcmp($speen,'Palpable') == 0){ echo "selected";}?>>Palpable</option>
<option value="Not Palpable"
<?php if(strcmp($speen,'Not Palpable') == 0){ echo "selected";} ?>>Not
Palpable</option>
</select>
</center>
</td>
<td>
<center>
<select
style="margin-top: 20px; margin-bottom: 20px; width: 90%"
name="heart_sound" id="heart_sound"
><option
disabled selected>Please select option</option>
<option value="Normal"
<?php if(strcmp($heart_sound,'Normal') == 0){ echo "selected";}?>>Normal</option>
<option value="Murmur"
<?php if(strcmp($heart_sound,'Murmur') == 0){ echo "selected";} ?>>Murmur</option>
</select>
</center>
</td>
<td >
<center><select style="margin-top:20px;margin-bottom:20px;width:90%" name="hernia" id="hernia" ><option disabled selected>Please select option</option>
<option value="Detected" <?php if(strcmp($hernia,'Detected') == 0){ echo "selected";}?>>Detected</option>
<option value="Not Detected" <?php if(strcmp($hernia,'Not Detected') == 0){ echo "selected";} ?>>Not Detected</option>
</select></center>
</td>
<td>
<center>
<select
style="margin-top: 20px; margin-bottom: 20px; width: 90%"
name="hydrocele" id="hydrocele"
><option
disabled selected>Please select option</option>
<option value="Detected"
<?php if(strcmp($hydrocele,'Detected') == 0){ echo "selected";}?>>Detected</option>
<option value="Not Detected"
<?php if(strcmp($hydrocele,'Not Detected') == 0){ echo "selected";} ?>>Not
Detected</option>
</select>
</center>
</td>
<td>
<center>
<select
style="margin-top: 20px; margin-bottom: 20px; width: 90%"
name="ecg_findings" id="ecg_findings"
><option
disabled selected>Please select option</option>
<option value="WNL"
<?php if(strcmp($ecg_findings,'WNL') == 0){ echo "selected";}?>>WNL</option>
<option value="Abnormal"
<?php if(strcmp($ecg_findings,'Abnormal') == 0){ echo "selected";} ?>>Abnormal</option>
</select>
</center>
</td>
</tr>
</table>
</div>
</div>
</div>
<!-- clinical examination ends -->
<!-- abdomen starts -->
<div class="row">
<div class="col-sm-12">
<div class="table-responsive">
<center>
<b style="font-weight: 800">x-ray</b>
</center>
<table style="width: 100%" class="table-bordered">
<th height="30px"><center>spine</center></th>
<th height="30px"><center>head</center></th>
<th height="30px"><center>chest</center></th>
<tr>
<td>
<center>
<select
style="margin-top: 20px; margin-bottom: 20px; width: 90%"
name="musculo_skeletal" id="musculo_skeletal"
><option
disabled selected>Please select option</option>
<option value="Normal"
<?php if(strcmp($musculo_skeletal,'Normal') == 0){ echo "selected";}?>>Normal</option>
<option value="Abnormal"
<?php if(strcmp($musculo_skeletal,'Abnormal') == 0){ echo "selected";} ?>>Abnormal</option>
</select>
</center>
</td>
<td>
<center>
<select
style="margin-top: 20px; margin-bottom: 20px; width: 90%"
name="cns" id="cns"
><option
disabled selected>Please select option</option>
<option value="Normal"
<?php if(strcmp($cns,'Normal') == 0){ echo "selected";}?>>Normal</option>
<option value="Abnormal"
<?php if(strcmp($cns,'Abnormal') == 0){ echo "selected";} ?>>Abnormal</option>
</select>
</center>
</td>
<td>
<center>
<select
style="margin-top: 20px; margin-bottom: 20px; width: 90%"
name="chest_radiograph" id="chest_radiograph"
><option
disabled selected>Please select option</option>
<option value="Normal"
<?php if(strcmp($chest_radiograph,'Normal') == 0){ echo "selected";}?>>Normal</option>
<option value="Abnormal"
<?php if(strcmp($chest_radiograph,'Abnormal') == 0){ echo "selected";} ?>>Abnormal</option>
</select>
</center>
</td>
</tr>
</table>
</div>
</div>
</div>
<!-- abdomen ends -->
<div class="row">
<div class="col-sm-12">
<div class="table-responsive">
<b style="font-weight: 800; margin-left: 170px">Spirometry</b>
<table width="33%" class="table-bordered">
<tr>
<td>
<center>
<select
style="margin-top: 20px; margin-bottom: 20px; width: 90%"
name="rs" id="rs"
><option
disabled selected>Please select option</option>
<option value="Normal"
<?php if(strcmp($rs,'Normal') == 0){ echo "selected";}?>>Normal</option>
<option value="Abnormal"
<?php if(strcmp($rs,'Abnormal') == 0){ echo "selected";} ?>>Abnormal</option>
</select>
</center>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="box-body" style="display:none;" id="medical_examination_form_two">
<div class="row">
<div class="col-sm-12">
<table class="table table-bordered">
<table class="table table-bordered">
<tr>
<td colspan="3" align="center"><b style="font-weight: 800">INVESTIGATIONS</b></td>
</tr>
<tr>
<?php $new_sql = "select a.blood_group from patient_master a left join medical_examination b on b.patient_id = a.id where b.medical_exam_id = '".$_REQUEST['medical_exam_id']."' ";
$result = mysqli_query($conn,$new_sql);
if(mysqli_num_rows($result) > 0) {
$row = @mysqli_fetch_array($result);
// echo $row['age'];
?>
<td colspan="3" align="center"><b style="">Blood Group:</b>&nbsp;&nbsp;<?php echo $row['blood_group']; ?></td><?php }?>
</tr>
<div class="table-responsive">
<table style="width:100%" class="table-bordered">
<th style="height:30px"><center>tlc</center></th>
<th height="30px"><center>dlc-l</center></th>
<th height="30px"><center>dlc-n</center></th>
<th height="30px"><center>dlc-m</center></th>
<th height="30px"><center>dlc-b</center></th>
<th height="30px"><center>dlc-e</center></th>
<tr><center><b style="font-weight:800">blood examination</b></center></tr>
<tr>
<td>
<input style="margin-top:20px;margin-bottom:20px;margin-left:15px;width:80%" type="number" name="tlc" id="tlc" value="<?php echo $tlc?>" datamax="6" />
</td>
<td>
<input style="margin-top:20px;margin-bottom:20px;margin-left:15px;width:80%" type="number" name="dlc_l" id="dlc_l" value="<?php echo $dlc_l?>" datamax="6" />
</td>
<td >
<input style="margin-top:20px;margin-bottom:20px;margin-left:15px;width:80%" type="number" name="dlc_n" id="dlc_n" value="<?php echo $dlc_n?>" datamax="6" />
</td>
<td>
<input style="margin-top:20px;margin-bottom:20px;margin-left:15px;width:80%" type="number" name="dlc_m" id="dlc_m" value="<?php echo $dlc_m?>" datamax="6" />
</td>
<td>
<input style="margin-top:20px;margin-bottom:20px;margin-left:15px;width:80%" type="number" name="dlc_b" id="dlc_b" value="<?php echo $dlc_b?>" datamax="6" />
</td>
<td >
<input style="margin-top:20px;margin-bottom:20px;margin-left:15px;width:80%" type="number" name="dlc_e" id="dlc_e" value="<?php echo $dlc_e?>" datamax="6" />
</td>
</tr>
</table>
</div>
<div class="row">
<div class="col-sm-12">
<div class="table-responsive">
<table style="width: 100%" class="table-bordered">
<th style="height: 30px"><center>hb</center></th>
<th style="height: 30px"><center>blood glucose</center></th>
<th style="height: 30px"><center>s urea</center></th>
<th height="30px"><center>s creatinine</center></th>
<th height="30px"><center>s cholestrol</center></th>
<th height="30px"><center>SGPT</center></th>
<tr>
<center>
<b style="font-weight: 800">blood examination</b>
</center>
</tr>
<tr>
<td><input
style="margin-top: 20px; margin-bottom: 20px; margin-left: 15px; width: 80%"
type="number" datamax="6" name="hb" id="hb"
value="<?php echo $hb?>" /></td>
<td><input
style="margin-top: 20px; margin-bottom: 20px; margin-left: 15px; width: 80%"
type="number" name="blood_gluose" id="blood_gluose"
value="<?php echo $blood_gluose?>" /></td>
<td><input
style="margin-top: 20px; margin-bottom: 20px; margin-left: 15px; width: 80%"
type="number" name="s_urea" id="s_urea"
value="<?php echo $s_urea?>" /></td>
<td><input
style="margin-top: 20px; margin-bottom: 20px; margin-left: 15px; width: 80%"
type="number" name="s_creatinine" id="s_creatinine"
value="<?php echo $s_creatinine?>" /></td>
<td><input
style="margin-top: 20px; margin-bottom: 20px; margin-left: 15px; width: 80%"
type="number" name="s_cholesterol" id="s_cholesterol"
value="<?php echo $s_cholesterol?>" /></td>
<td><input
style="margin-top: 20px; margin-bottom: 20px; margin-left: 15px; width: 80%"
type="number" name="sgpt" id="sgpt" value="<?php echo $sgpt?>" />
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="table-responsive">
<table style="width: 100%" class="table-bordered">
<th style="height: 30px"><center>albumin</center></th>
<th height="30px"><center>rbcs</center></th>
<th height="30px"><center>urine sugar</center></th>
<th height="30px"><center>epithelial cells</center></th>
<tr>
<center>
<b style="font-weight: 800">urine examination</b>
</center>
</tr>
<tr>
<td><input
style="margin-top: 20px; margin-bottom: 20px; margin-left: 15px; width: 80%"
type="number" name="albumin" id="albumin"
value="<?php echo $albumin?>" /></td>
<td><input
style="margin-top: 20px; margin-bottom: 20px; margin-left: 15px; width: 80%"
type="number" name="rbcs" id="rbcs" value="<?php echo $rbcs?>"
datamax="7" /></td>
<td><input
style="margin-top: 20px; margin-bottom: 20px; margin-left: 15px; width: 80%"
type="number" name="sugar" id="sugar"
value="<?php echo $sugar?>" datamax="4" /></td>
<td><input
style="margin-top: 20px; margin-bottom: 20px; margin-left: 15px; width: 80%"
type="number" name="epithelial_cells"
id="epithelial_cells" value="<?php echo $epithelial_cells?>"
datamax="6" /></td>
</tr>
</table>
</div>
</div>
<input type="hidden" name="history_parameter"
id="history_parameter">
</div>
<br>
<?php include 'support_medical_document.php' ?>
<br>
</table>
</div>
</div>
</div>
<input type="hidden" name="medical_exam_id" id="medical_exam_id" value="<?php echo $_REQUEST['medical_exam_id']; ?>">
<div class="box-footer" style="text-align: center">
<button class="btn btn-primary" type="button" id="save_button"
onclick="save_medical_examination()">
<i class="ace-icon fa fa-save"></i> Save
</button>
<button class="btn btn-warning" id="back_button" style="display: none;" onclick="changeOtherMedicalForm()" >
<i class="ace-icon fa fa-backward"></i> Back
</button>
<button class="btn btn-success" id="next_button" onclick='changeOtherMedicalForm()'>
<i class="ace-icon fa fa-forward"></i> Next
</button>
<button class="btn btn-success" id="forward_button" onclick="save_medical_examination(this.id)">
<i class="ace-icon fa fa-save"></i>Forward
</button>
<button class="btn btn-success" id="generate_pdf">
<i class="ace-icon fa fa-print"></i> Print Pdf
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</table>
</div>
</div>
<form id="medical_exam_form" target="_blank" action="#" method="POST" >
<input type="hidden" name="medical_exam_id" id="medical_exam_id" value="<?php echo $medical_exam_id ?>" />
</form>
<?php include 'image_popup.php'?>
<?php include('techsyn_footer.php'); ?>
<script>
$('#height').change(function(){
if (0 > $(this).val() || $(this).val() > 250){
BootstrapDialog.alert("Enter Valid Height Detail");
$(this).val('');
}
});
$('#weight').change(function(){
if (0 > $(this).val() || $(this).val() > 250){
BootstrapDialog.alert("Enter Valid Weight Detail");
$(this).val('');
}
});
$('#pulse').change(function(){
if (0 > $(this).val() || $(this).val() > 150){
BootstrapDialog.alert("Enter Valid Pulse Detail");
$(this).val('');
}
});
$('#dis_without_left_eye').change(function(){
if (-10 > $(this).val() || $(this).val() > 10 || !$.isNumeric($(this).val())){
BootstrapDialog.alert("Enter Valid Left eye Detail");
$(this).val('');
}
});
$('#dis_without_right_eye').change(function(){
if (-10 > $(this).val() || $(this).val() > 10 || !$.isNumeric($(this).val())){
BootstrapDialog.alert("Enter Valid Right Eye Detail");
$(this).val('');
}
});
$('#SpO2').change(function(){
if (50 > $(this).val() || $(this).val() > 110 || !$.isNumeric($(this).val())){
BootstrapDialog.alert("Enter Valid SPO2 value");
$(this).val('');
}
});
$('#tlc').change(function(){
if (-200 > $(this).val() || $(this).val() > 1000 || !$.isNumeric($(this).val())){
BootstrapDialog.alert("Enter Valid tlc value");
$(this).val('');
}
});
$('#dlc_l').change(function(){
if (-200 > $(this).val() || $(this).val() > 1000 || !$.isNumeric($(this).val())){
BootstrapDialog.alert("Enter Valid dlc-l value");
$(this).val('');
}
});
$('#dlc_n').change(function(){
if (-200 > $(this).val() || $(this).val() > 1000 || !$.isNumeric($(this).val())){
BootstrapDialog.alert("Enter Valid dlc-n value");
$(this).val('');
}
});
$('#dlc_m').change(function(){
if (-200 > $(this).val() || $(this).val() > 1000 || !$.isNumeric($(this).val())){
BootstrapDialog.alert("Enter Valid dlc-m value");
$(this).val('');
}
});
$('#dlc_b').change(function(){
if (-200 > $(this).val() || $(this).val() > 1000 || !$.isNumeric($(this).val())){
BootstrapDialog.alert("Enter Valid dlc-b value");
$(this).val('');
}
});
$('#dlc_e').change(function(){
if (-200 > $(this).val() || $(this).val() > 1000 || !$.isNumeric($(this).val())){
BootstrapDialog.alert("Enter Valid dlc-e value");
$(this).val('');
}
});
$('#hb').change(function(){
if (-200 > $(this).val() || $(this).val() > 1000 || !$.isNumeric($(this).val())){
BootstrapDialog.alert("Enter Valid hb value");
$(this).val('');
}
});
$('#vdrl').change(function(){
if (-200 > $(this).val() || $(this).val() > 1000 || !$.isNumeric($(this).val())){
BootstrapDialog.alert("Enter Valid vdrl value");
$(this).val('');
}
});
$('#blood_gluose').change(function(){
if (-200 > $(this).val() || $(this).val() > 1000 || !$.isNumeric($(this).val())){
BootstrapDialog.alert("Enter Valid blood glucose value");
$(this).val('');
}
});
$('#s_urea').change(function(){
if (-200 > $(this).val() || $(this).val() > 1000 || !$.isNumeric($(this).val())){
BootstrapDialog.alert("Enter Valid s-urea value");
$(this).val('');
}
});
$('#s_creatinine').change(function(){
if (-200 > $(this).val() || $(this).val() > 1000 || !$.isNumeric($(this).val())){
BootstrapDialog.alert("Enter Valid s-creatinine value");
$(this).val('');
}
});
$('#s_cholestrol').change(function(){
if (-200 > $(this).val() || $(this).val() > 1000 || !$.isNumeric($(this).val())){
BootstrapDialog.alert("Enter Valid s-cholestrol value");
$(this).val('');
}
});$('#pus_cells').change(function(){
if (-200 > $(this).val() || $(this).val() > 1000 || !$.isNumeric($(this).val())){
BootstrapDialog.alert("Enter Valid pus cells value");
$(this).val('');
}
});
$('#rbcs').change(function(){
if (-200 > $(this).val() || $(this).val() > 1000 || !$.isNumeric($(this).val())){
BootstrapDialog.alert("Enter Valid rbcs value");
$(this).val('');
}
});
$('#epithelial_cells').change(function(){
if (-200 > $(this).val() || $(this).val() > 1000 || !$.isNumeric($(this).val())){
BootstrapDialog.alert("Enter Valid epithelial cells value");
$(this).val('');
}
});
$('#albumin').change(function(){
if (-200 > $(this).val() || $(this).val() > 1000 || !$.isNumeric($(this).val())){
BootstrapDialog.alert("Enter Valid albumin level value");
$(this).val('');
}
});
$('#blood_sugar').change(function(){
if (-200 > $(this).val() || $(this).val() > 1000 || !$.isNumeric($(this).val())){
BootstrapDialog.alert("Enter Valid blood sugar value");
$(this).val('');
}
});
$("#generate_pdf").on("click", function(){
$("#medical_examination_form").submit(function(e){
e.preventDefault();
});
<?php if($task=='pre_employment'){?>
document.forms['medical_exam_form'].action="pre_exam_form_pdf.php";
<?php }else if($task=='semi_annual'){?>
document.forms['medical_exam_form'].action="semi_annual_exam_pdf.php";
<?php }else {?>
document.forms['medical_exam_form'].action="annual_exam_form_pdf.php";
<?php }?>
document.forms['medical_exam_form'].method="post";
document.forms['medical_exam_form'].submit();
});
/*$("#forward_button").on("click", function(){
$("#save_button").hide();
BootstrapDialog.show({
title: 'Forward',
message: '<select class="form-control" id="forward_status" style="margin-left:100px;width:60%"><option value="" >Please Select Forward Option</option><option value="R" > Receptionist </option></option><option value="M" > Medical Room </option><option value="A" >Approve</option></select>',
buttons: [{
label: 'OK',
action: function() {
save_forward_status();
$(".close").click();
}
}]
});
$("#medical_examination_form").submit(function(e){
e.preventDefault();
});
});*/
function save_forward_status(){
$.ajax({
url:'save_medical_examination.php',
type:'POST',
data:{forward_status:$("#forward_status").val(),medical_exam_id:$("#medical_exam_id").val()},
success:function(data){
BootstrapDialog.alert("Foward Status Saved Successfully");
},
error:function(data){
BootstrapDialog.alert(" Error In Saving Foward Status ");
}
});
$("#medical_examination_form").submit(function(e){
e.preventDefault();
});
}
function colorValidation(id, val, min, max){
// ids = document.getElementById(id);
// if (val<=min || val >=max){
// ids.style.borderColor='tomato';
// ids.style.color='tomato';
// }else if(val<=max){
// ids.style.borderColor='lightgrey';
// ids.style.color='black';
// }if(val=='') {
// ids.style.backgroundColor='white';
// }
}
function colorBpValidation(id, value, min, max){
ids = document.getElementById(id);
regex = /\//;
values = value.split(regex);
if (values[0]>min || values[1]>max){
ids.style.borderColor = 'tomato';
ids.style.color='tomato';
} else if (values[0]<60 || values[1]<90){
ids.style.borderColor = 'tomato';
ids.style.color='tomato';
} else{
ids.style.borderColor='lightgrey';
ids.style.color='black';
}
}
function colorTextValidation(id, val, min, max){
ids = document.getElementById(id);
if (val == min || val == max){
ids.style.borderColor='tomato';
ids.style.color='tomato';
}else{
ids.style.borderColor='lightgrey';
ids.style.color='black';
}
}
// color validation function invoke on double click event
$("input").dblclick(function() {
dblClickcolorValidation(this);
// alert("hello there!"+this.name);
});
$("select").dblclick(function() {
dblClickcolorValidation(this);
// alert("hello there!"+this.name);
});
$("textarea").dblclick(function() {
dblClickcolorValidation(this);
// alert("hello there!"+this.name);
});
// creat new array to store values
ids_value = new Array();
hiddenHighlighter = document.getElementById('hiddenHighlighter');
// double click color validaton array
function dblClickcolorValidation(id){
ids = id;
ids_value = hiddenHighlighter.value.split(",");
// console.log("stored values:"+ids_value);
// get the hidden color validation input tag
hiddenHighlighter = document.getElementById('hiddenHighlighter');
if(ids.style.borderColor=='tomato' || ids.style.color=='tomato'){
ids.style.borderColor='lightgrey';
ids.style.color='black';
removeItemOnce(ids_value, ids.name);
hiddenHighlighter.value = ids_value.join();
// console.log(hiddenHighlighter.value);
}else{
ids.style.borderColor='tomato';
ids.style.color='tomato';
ids_value.push(ids.name);
console.log(ids_value);
hiddenHighlighter.value = ids_value.join();
// console.log(hiddenHighlighter.value);
}
// console.log(ids_value);
}
function removeItemOnce(arr, value) {
var index = arr.indexOf(value);
if (index > -1) {
arr.splice(index, 1);
}
return arr;
}
function calculateBMI(){
var height=$("#height").val();
var weight=$("#weight").val();
$("#bmi").val(getBMI(height,weight));
}
function changeOtherMedicalForm(){
if ( $("#medical_examination_form_two").css('display') == 'none' || $("#medical_examination_form_two").css("visibility") == "hidden"){
$("#medical_examination_form_two").show();
$("#reset_button").hide();
$("#back_button").show();
$("#forward_button").show();
$("#next_button").hide();
}else{
$("#medical_examination_form_two").hide();
$("#reset_button").show();
$("#back_button").hide();
$("#forward_button").hide();
$("#next_button").show();
}
if($("#medical_examination_form_one").css('display') == 'block' || $("#medical_examination_form_one").css("visibility") == "show"){
$("#medical_examination_form_one").hide();
$("#reset_button").hide();
$("#back_button").show();
$("#forward_button").show();
//$("#next_button").show();
}else{
$("#medical_examination_form_one").show();
$("#reset_button").show();
$("#back_button").hide();
$("#forward_button").hide();
//$("#next_button").hide();
}
$("#medical_examination_form").submit(function(e){
e.preventDefault();
});
}
function save_medical_examination(id){
var history_array=[];
$("input:checkbox[name='history_param']:checked").each(function(){
history_array.push($(this).val());
$("input[name='history_parameter']").val(history_array.join(', '));
});
$("#medical_examination_form").submit(function(e){
e.preventDefault();
});
$.ajax({
url:'save_medical_examination.php',
type:'POST',
data:$("#medical_examination_form , #past_illness_form").serialize(),
success:function(data){
/* BootstrapDialog.alert("Medical Examination Form Saved Successfully");*/
BootstrapDialog.show({
title: 'Information',
message: 'Medical Examination Form Saved Successfully',
buttons: [{
label: 'OK',
action: function() {
$(".close").click();
if(id=='forward_button'){
BootstrapDialog.show({
title: 'Forward',
message: '<select class="form-control" id="forward_status" style="margin-left:100px;width:60%"><option value="" >Please Select Forward Option</option><option value="M" > Medical Room </option><option value="D" >Doctor</option></select>',
buttons: [{
label: 'OK',
action: function() {
save_forward_status();
$(".close").click();
}
}]
});
}
}
}]
});
},
error:function(data){
BootstrapDialog.alert(" Error In Saving Medical Examination Form");
}
});
}
$("input:radio[name=signature]"). click(function(){
var signatue=$('input:radio[name=signature]:checked').val();
if(signatue=='add'){
$(".profile-picture").show();
}else{
$(".profile-picture").hide();
}
});
var highlightedFields="<?php echo getFieldFromTable("highlighted_fields", "medical_examination_highlighted", "medical_exam_id", $_REQUEST['medical_exam_id'])?>"
console.log(highlightedFields);
$(document).ready(function(){
$("#hiddenHighlighter").val(highlightedFields);
highlightedFields = highlightedFields.split(",")
console.log(highlightedFields);
// console.log("length"+highlighted_fieldslds.length);
for(var i = 1; i<highlightedFields.length; i++){
ids = document.getElementById(highlightedFields[i]);
ids.style.borderColor ="tomato";
ids.style.color = "tomato";
}
});
</script>