ESH/add_patient_details_short_term.php

514 lines
21 KiB
PHP
Raw Normal View History

2024-10-23 18:28:06 +05:30
<?php
include('techsyn_header.php');
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Main Content Container for side bar and body-->
<style>
b {
margin-left: 40px;
}
</style>
<div class="main-container ace-save-state" id="main-container">
<script type="text/javascript">
try {
ace.settings.loadState('main-container')
} catch (e) {}
</script>
<?php include('techsyn_sidebar.php'); ?>
<div class="main-content">
<div class="main-content-inner">
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
<ul class="breadcrumb">
<li><i class="ace-icon fa fa-home home-icon"></i> <a href="#">Home</a></li>
<li class="#">Patient Visit</li>
<li class="active">PME - Annual Examination</li>
<li class="#">
<?php
$sql = "select patient_name from patient_master WHERE id ='" . $_REQUEST['patient_id'] . "' ";
// echo $_POST ['patient_id'] ;
if (!$result = @mysqli_query($conn,$sql)) {
exit(mysqli_error($conn));
}
if (mysqli_num_rows($result) > 0) {
while ($row = @mysqli_fetch_array($result)) {
echo $row['patient_name'];
}
}
error_log($sql);
?>
</li>
</ul>
</div>
<div class="mainPanel">
<div class="panel-group" id="accordion">
<div class="panel panel-default" style="padding: 10px; margin: 2px 0px 50px 5px; width: 99.5%;">
<div class="panel-body">
<form class="form-horizontal" id="medical_examination_form" name="medical_examination_form" enctype="multipart/form-data" action="#" method="post">
<?php include('patient_profile_panel_receptionist.php'); ?>
<?php include('patient_past_history_panel.php'); ?>
<div class="panel panel-default">
<div class="panel-heading panel-heading1" id="panel-heading-occupational_history">
<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="#occupational_history" aria-expanded="true" aria-controls="collapseOne"> PAST OCCUPATIONAL HISTORY</a>
</h5>
</div>
<div id="occupational_history" class="panel-collapse " aria-expanded="false">
<div class="panel-body" style="padding: 1px; margin: 1px">
<?php
// $medical_examination_id= getFieldFromTable("max(medical_exam_id", "medical_examination", "patient_id", $_POST ['patient_id'] );
// echo "medical_examination_id:".$medical_examination_id;
$query_ohc_history = "select * from past_occupational_history where medical_exam_id =(select max(medical_exam_id) from medical_examination where patient_id='" . $_POST['patient_id'] . "' ) ";
// echo $query_ohc_history;
$result_ohc_history = @mysqli_query($conn,$query_ohc_history);
// echo $result_for_addiction;
$count_ohc_history = 0;
while ($row_ohc_history = mysqli_fetch_assoc($result_ohc_history)) {
if ($count_ohc_history == 0) {
$name_of_organization1 = $row_ohc_history['org_name'];
$trade_designation1 = $row_ohc_history['trade_designation'];
$period_of_service1 = $row_ohc_history['period_services'];
$past_occupational_illness1 = $row_ohc_history['past_occu_illness'];
} else if ($count_ohc_history == 1) {
$name_of_organization2 = $row_ohc_history['org_name'];
$trade_designation2 = $row_ohc_history['trade_designation'];
$period_of_service2 = $row_ohc_history['period_services'];
$past_occupational_illness2 = $row_ohc_history['past_occu_illness'];
}
$count_ohc_history++;
}
?>
<table class="table table-bordered">
<tr>
<td><b style="vertical-align: top; font-weight: 800"> Name
of Organization </b>
<td><b style="vertical-align: top; font-weight: 800">
Trade/Designation </b>
<td><b style="vertical-align: top; font-weight: 800">Period
of Service- in Years</b>
<td><b style="vertical-align: top; font-weight: 800"> Past
Occupational Illness </b>
</tr>
<tr>
<td><b style="vertical-align: top">1.</b> <input type="text" style="width: 80%" name="org_name0" id="org_name0" maxlength="100" value="<?= $name_of_organization1 ?>"></input></td>
<td><input style="width: 80%;margin-left: 20px" type="text" name="trade_designation0" id="trade_designation0" maxlength="100" value="<?php echo $trade_designation1; ?>"></input></td>
<td><input style="width: 40%;margin-left: 50px" type="number" name="period_services0" id="period_services0" value=<?= $period_of_service1 ?>> </input></td>
<td><input style="width: 80%;margin-left: 20px" type="text" name="past_occu_illness0" id="past_occu_illness0" maxlength="100" value="<?php echo $past_occupational_illness1 ?>"></input></td>
</tr>
<tr>
<td><b style="vertical-align: top">2.</b> <input type="text" style="width: 80%" name="org_name1" id="org_name1" value="<?= $name_of_organization2 ?>" maxlength="100"></td>
<td><input style="width: 80%;margin-left: 20px" type="text" name="trade_designation1" id="trade_designation1" maxlength="100" value="<?= $trade_designation2 ?>"></td>
<td><input style="width: 40%;margin-left: 50px" type="number" name="period_services1" id="period_services1" value="<?= $period_of_service2 ?>"> </input></td>
<td><input style="width: 80%;margin-left: 20px" type="text" name="past_occu_illness1" id="past_occu_illness1" maxlength="100" value="<?= $past_occupational_illness2 ?>"></td>
</tr>
</table>
<?php
// $medical_examination_id= getFieldFromTable("max(medical_exam_id", "medical_examination", "patient_id", $_POST ['patient_id'] );
// echo "medical_examination_id:".$medical_examination_id;
$query_for_addiction = "select * from patient_personal_information where medical_exam_id =(select max(medical_exam_id) from medical_examination where patient_id='" . $_POST['patient_id'] . "' and task='peme_short' ) ";
$smoking = 0;
$tobacco = 0;
$alcohol = 0;
// echo $query_for_addiction;
$result_for_addiction = @mysqli_query($conn,$query_for_addiction);
// echo $result_for_addiction;
if ($row_for_addiction = mysqli_fetch_assoc($result_for_addiction)) {
$addiction = $row_for_addiction['addiction'];
}
$ailment_array1 = explode(',', $addiction);
foreach ($ailment_array1 as $ailments) {
if (trim($ailments) == "SMOKING") {
$smoking = 1;
}
if (trim($ailments) == "TOBACCO") {
$tobacco = 1;
}
if (trim($ailments) == "ALCOHOL") {
$alcohol = 1;
}
}
?>
<table class="table table-bordered">
<tr>
<td colspan="4" align="center"><b style="vertical-align: top; font-weight: 800"> PERSONAL
INFORMATION</b></td>
</tr>
<tr>
<td width="40%"><b>Identification Mark</b></td>
<td width="60%"><input type="text" style="width: 90%" name="identi_mark" id="identi_mark" maxlength="100" value="<?= $row_for_addiction['identi_mark'] ?>"></td>
</tr>
<tr>
<td width="40%"><b>Date of Examination</b></td>
<td width="60%">
<div class="input-group date">
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
<input style="width: 120px" class="form-control date-picker" value="<?= date_format(date_create($row['date_of_exam']), "d/m/Y") ?>" name="date_of_exam" id="date_of_exam" type="text" data-date-format="dd/mm/yyyy" />
</div>
</td>
</tr>
<tr>
<td width="40%"><b>Marital Status</b></td>
<td width="60%">
<div class="col-sm-4" style="vertical-align: top">
<label class="inline"> <input name="marital_status" id="marital_status" type="radio" class="ace" value="MARRIED" <?php if ($maritial_status == 1) { ?> checked <?php } ?>> <span class="lbl middle"> MARRIED</span></label>
&nbsp; &nbsp; &nbsp; <label class="inline"> <input name="marital_status" id="marital_status" value="UNMARRIED" type="radio" class="ace" <?php if ($maritial_status != 1) { ?> checked <?php } ?>> <span class="lbl middle"> UNMARRIED</span></label>
</div>
</td>
</tr>
<tr>
<td width="40%"><b> No. of children </b></td>
<td width="60%"><input type="number" name="no_of_child" value="<?= $row_for_addiction['no_of_child'] ?>" id="no_of_child"></td>
</tr>
<tr>
<td width="40%"><b> Whether adopting any method of family
planning </b></td>
<td width="60%">
<div class="col-sm-9" style="vertical-align: top">
<label class="inline"> <input name="adopting_family_planning" id="adopting_family_planning" type="radio" class="ace" value="YES" <?php if ($row_for_addiction['adopting_family_planning'] == 'YES') { ?> checked <?php } ?>> <span class="lbl middle">YES </span>
</label> &nbsp; &nbsp; &nbsp; <label class="inline"> <input name="adopting_family_planning" id="adopting_family_planning" value="NO" type="radio" class="ace" <?php if ($row_for_addiction['adopting_family_planning'] == 'NO') { ?> checked <?php } ?>> <span class="lbl middle"> NO </span>
</label>
</div>
</td>
</tr>
<tr>
<td width="40%"><b> Addiction </b></td>
<td width="60%">
<div class="col-sm-9" style="vertical-align: top">
</label> &nbsp; &nbsp; &nbsp; <label class="inline"> <input name="addiction[]" id="addiction" value="SMOKING" type="checkbox" class="ace" <?php if ($smoking == 1) { ?> checked <?php } ?>> <span class="lbl middle"> SMOKING</span>
</label> &nbsp; &nbsp; &nbsp; <label class="inline"> <input name="addiction[]" id="addiction" value="TOBACCO" type="checkbox" class="ace" <?php if ($tobacco == 1) { ?> checked <?php } ?>> <span class="lbl middle"> TOBACCO</span>
</label> &nbsp; &nbsp; &nbsp; <label class="inline"> <input name="addiction[]" id="addiction" value="ALCOHOL" type="checkbox" class="ace" <?php if ($alcohol == 1) { ?> checked <?php } ?>> <span class="lbl middle"> ALCOHOL</span>
</label> </label>
</div>
</td>
</tr>
<?php
// $medical_examination_id= getFieldFromTable("max(medical_exam_id", "medical_examination", "patient_id", $_POST ['patient_id'] );
// echo "medical_examination_id:".$medical_examination_id;
$query_for_family = "select * from patient_personal_information where medical_exam_id =(select max(medical_exam_id) from medical_examination where patient_id='" . $_POST['patient_id'] . "' and task='peme' ) ";
$asthma = 0;
$diabetes = 0;
$tb = 0;
$hypertension = 0;
$other_disease = 0;
// echo $query_for_addiction;
$result_for_family = @mysqli_query($conn,$query_for_family);
// echo $result_for_addiction;
if ($row_for_family = mysqli_fetch_assoc($result_for_family)) {
$family_history = $row_for_family['family_history'];
}
$ailment_array1 = explode(',', $family_history);
foreach ($ailment_array1 as $ailments) {
if (trim($ailments) == "ASTHMA") {
$asthma = 1;
}
if (trim($ailments) == "DIABETES") {
$diabetes = 1;
}
if (trim($ailments) == "TB") {
$tb = 1;
}
if (trim($ailments) == "HYPERTENSION") {
$hypertension = 1;
}
if (trim($ailments) == "OTHER_DISEASE") {
$other_disease = 1;
}
}
?>
<tr>
<td width="40%"><b> Family History </b></td>
<td width="60%">
<div class="col-sm-10" style="vertical-align: top">
</label> &nbsp; &nbsp; &nbsp; <label class="inline"> <input name="family_history[]" id="family_history" value="ASTHMA" type="checkbox" class="ace" <?php if ($asthma == 1) { ?> checked <?php } ?>> <span class="lbl middle"> ASTHMA</span>
</label> &nbsp; &nbsp; &nbsp; <label class="inline"> <input name="family_history[]" id="family_history" value="DIABETES" type="checkbox" class="ace" <?php if ($diabetes == 1) { ?> checked <?php } ?>> <span class="lbl middle"> DIABETES MELLITUS </span>
</label> &nbsp; &nbsp; &nbsp; <label class="inline"> <input name="family_history[]" id="family_history" value="TB" type="checkbox" class="ace" <?php if ($tb == 1) { ?> checked <?php } ?>> <span class="lbl middle"> TB</span>
</label> </label>
</label> &nbsp; &nbsp; &nbsp; <label class="inline"> <input name="family_history[]" id="family_history" value="HYPERTENSION" type="checkbox" class="ace" <?php if ($hypertension == 1) { ?> checked <?php } ?>> <span class="lbl middle"> HYPERTENSION</span>
</label> </label>
</label> &nbsp; &nbsp; &nbsp; <label class="inline"> <input name="family_history[]" id="family_history" value="OTHER_DISEASE" type="checkbox" class="ace" <?php if ($other_disease == 1) { ?> checked <?php } ?>> <span class="lbl middle"> ANY OTHER DISEASE</span>
</label> </label>
</div>
</td>
</tr>
<tr>
<td width="40%"><b>Drug Allergy</b></td>
<td width="60%">
<div class="col-sm-9" style="vertical-align: top">
<input style="width: 80%" type="text" name="drug_allergy" id="drug_allergy" value="<?= $row_for_addiction['drug_allergy'] ?>">
</div>
</td>
</tr>
<tr>
<td width="40%"><b>Any other medication</b></td>
<td width="60%">
<div class="col-sm-9" style="vertical-align: top">
<input style="width: 80%" type="text" name="any_other_medic" id="any_other_medic" value="<?= $row_for_addiction['any_other_medic'] ?>">
</div>
</td>
</tr>
</table>
</div>
<div class="panel-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-primary" type="button" id="update_button" style="display: none" onclick="save_employee()">
<i class="ace-icon fa fa-floppy"></i> Update
</button>
<button class="btn btn-success" onclick="navigate()" type="button" id="next_button" disabled>
<i class="ace-icon fa fa-forward"></i>Next
</button>
<!--
<button class="btn btn-warning" type="reset">
<i class="ace-icon fa fa-undo"></i> Reset
</button>
<button class="btn btn-warning" type="button"
id="forwardButton">
<i class="ace-icon fa fa-forward"></i> Forward
</button>
-->
</div>
<input type="hidden" id="task" name="task" value="<?= $_REQUEST['task'] ?>"> <input type="hidden" name="history_parameter" id="history_parameter"> <input type="hidden" name="medical_exam_id" id="medical_exam_id" value='<?= $_REQUEST['medical_exam_id'] ?>'> <input type="hidden" name="medical_examination_status" id="medical_examination_status" value="N"> <input type="hidden" name="patient_id" id="patient_id" value="<?php echo $_REQUEST['flex_patient_id']; ?>">
</div>
<!--rnd of occupational_history panel-->
</div>
<!--rnd of panel default panel-->
</form>
</div>
<!--end of panel body at top-->
</div>
<!--end of top panel-->
</div>
<!--end of panel group-->
</div>
</div>
</div>
<?php include('techsyn_footer.php'); ?>
<script>
$('#no_of_child').blur(function() {
if (0 > $(this).val() || $(this).val() > 10) {
BootstrapDialog.alert("Children Should be between 0 to 10");
$(this).val('');
} else {
$('#dob').val('');
}
});
for (var i = 0; i < 2; i++) {
$('#period_services' + i).blur(function() {
if (0 > $(this).val() || $(this).val() > 30) {
BootstrapDialog.alert("Period of service should be maximum 30 years");
$(this).val('');
} else {
$('#dob').val('');
}
});
}
//function populatePopup(){
$("#forwardButton").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="M" > Medical Room </option><option value="D" >Doctor </option></select>',
buttons: [{
label: 'OK',
action: function() {
save_forward_status();
$(".close").click();
}
}]
});
});
function save_forward_status() {
$.ajax({
url: 'save_medical_examination.php',
type: 'POST',
<?php $sql_status = "select forward_status from medical_examination where patient_id = '" . $_REQUEST['patient_id'] . "' ";
error_log("STATUS" . $sql_status);
$result_status = mysqli_query($conn,$sql_status);
$row_status = mysqli_fetch_array($result_status);
if ($row_status['forward_status'] != null) { ?>
data: {
forward_status: <?= $row_status['forward_status'] ?>,
medical_exam_id: $("#medical_exam_id").val()
},
<?php } else { ?>
data: {
forward_status: $("#forward_status").val(),
medical_exam_id: $("#medical_exam_id").val()
},
<?php } ?>
success: function(data) {
BootstrapDialog.alert("Foward Status Saved Successfully");
},
error: function(data) {
BootstrapDialog.alert(" Error In Saving Forward Status ");
}
});
}
function save_medical_examination() {
var history_array = [];
$("input:checkbox[name='history_param']:checked").each(function() {
history_array.push($(this).val());
$("input[name=history_parameter]").val(history_array.join(', '));
});
if ($("#medical_examination_form").find("#patient_id") == null) {
BootstrapDialog.alert("Invalid Patient Details. Please check patiend data.");
return false;
}
<?php $sql_status = "select forward_status from medical_examination where patient_id = '" . $_REQUEST['patient_id'] . "' ";
error_log("STATUS" . $sql_status);
$result_status = mysqli_query($conn,$sql_status);
$row_status = mysqli_fetch_array($result_status);
if ($row_status['forward_status'] != null) { ?>
$("#forward_status").val("<?= $row_status['forward_status'] ?>");
<?php } ?>
$.ajax({
url: 'save_medical_examination.php',
type: 'POST',
data: $("#medical_examination_form").serialize(),
dataType: 'json',
success: function(data) {
BootstrapDialog.alert("Past And Present Illness Saved Successfully");
if (data.medical_exam_id != null && data.medical_exam_id != "") {
$("#medical_exam_id").val(data.medical_exam_id);
}
// location.href='pending_medical_examination_list.php';
document.getElementById("next_button").disabled = false;
},
error: function(data) {
BootstrapDialog.alert(" Error In Saving Past And Present Illness");
}
});
}
function navigate() {
var newForm = jQuery('<form>', {
'action': 'open_patient_physical_parameters_ime_short_term.php',
'target': '_top',
'method': 'POST'
}).append(jQuery('<input>', {
'name': 'patient_id',
'value': '<?= $_REQUEST['flex_patient_id'] ?>',
'type': 'hidden'
})).append(jQuery('<input>', {
'name': 'medical_exam_id',
'value': $("#medical_exam_id").val(),
'type': 'hidden'
}));
newForm.appendTo(document.body)
newForm.submit();
}
$('.date-picker').datepicker({
autoclose: true,
endDate: '+30d',
todayHighlight: true
})
//show datepicker when clicking on the icon
.next().on(ace.click_event, function() {
$(this).prev().focus();
});
</script>