ohctech_p8/employee_injury_form_noprice.php
Dushant Mali 05976fe30b DM
2024-11-28 10:28:59 +05:30

2866 lines
160 KiB
PHP

<link rel="stylesheet" href="assets/font-awesome/4.5.0/css/font-awesome.min.css" />
<!-- page specific plugin styles -->
<link rel="stylesheet" href="assets/css/jquery-ui.custom.min.css" />
<link rel="stylesheet" href="assets/css/chosen.min.css" />
<link rel="stylesheet" href="assets/css/bootstrap-datepicker3.min.css" />
<link rel="stylesheet" href="assets/css/bootstrap-timepicker.min.css" />
<link rel="stylesheet" href="assets/css/daterangepicker.min.css" />
<link rel="stylesheet" href="assets/css/bootstrap-datetimepicker.min.css" />
<link rel="stylesheet" href="assets/css/bootstrap-colorpicker.min.css" />
<link rel="stylesheet" href="adminlte/bower_components/bootstrap/less/type.less" />
<script src="assets/js/jquery-ui.custom.min.js"></script>
<script src="assets/js/jquery.ui.touch-punch.min.js"></script>
<script src="assets/js/chosen.jquery.min.js"></script>
<script src="assets/js/spinbox.min.js"></script>
<script src="assets/js/bootstrap-datepicker.min.js"></script>
<script src="assets/js/bootstrap-timepicker.min.js"></script>
<script src="assets/js/jquery.dataTables.min.js"></script>
<script src="assets/js/jquery.dataTables.bootstrap.min.js"></script>
<script src="assets/js/dataTables.buttons.min.js"></script>
<script src="assets/js/buttons.flash.min.js"></script>
<script src="assets/js/buttons.html5.min.js"></script>
<script src="assets/js/buttons.print.min.js"></script>
<script src="assets/js/buttons.colVis.min.js"></script>
<script src="assets/js/dataTables.select.min.js"></script>
<script src="assets/js/moment.min.js"></script>
<script src="assets/js/daterangepicker.min.js"></script>
<script src="assets/js/bootstrap-datetimepicker.min.js"></script>
<script src="assets/js/bootstrap-colorpicker.min.js"></script>
<script src="assets/js/jquery.knob.min.js"></script>
<script src="assets/js/autosize.min.js"></script>
<script src="assets/js/jquery.inputlimiter.min.js"></script>
<script src="assets/js/jquery.maskedinput.min.js"></script>
<script src="assets/js/bootstrap-tag.min.js"></script>
<script src="assets/js/ace-elements.min.js"></script>
<link rel="stylesheet" href="assets/css/jquery.dataTables.css" />
<script src="assets/js/jquery.dataTables.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$(".glyphicon").css("top", "");
});
function open_treatments(appointment_id) {
$('#modal-add-consultation').modal("show");
}
</script>
<style>
#med-detail-table td {
text-transform: capitalize !important;
width: 12%;
border: 1px solid #ddd;
/* padding: 8px; */
font-size: 11px;
text-align: left;
word-wrap: break-word;
word-break: break-all;
}
.switch {
position: absolute;
display: inline-block;
width: 60px;
height: 31px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 25px;
width: 25px;
left: 4px;
bottom: 3px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked+.slider {
background-color: #2196F3;
}
input:focus+.slider {
box-shadow: 0 0 1px #2196F3;
}
input:checked+.slider:before {
-webkit-transform: translateX(26px);
-ms-transform: translateX(26px);
transform: translateX(26px);
}
/* Rounded sliders */
.slider.round {
border-radius: 34px;
}
.slider.round:before {
border-radius: 50%;
}
#load-treatment-btn,
.loader {
float: right;
}
.loader {
border: 5px solid #f3f3f3;
border-radius: 50%;
border-top: 5px solid #3498db;
width: 25px;
height: 25px;
margin-bottom: 5px;
animation: spin 2s linear infinite;
display: none;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
25% {
transform: rotate(90deg);
border-top: 5px solid greenyellow;
}
50% {
transform: rotate(180deg);
border-top: 5px solid gold;
}
100% {
transform: rotate(360deg);
border-top: 5px solid #3498db;
}
}
.tags .tag {
white-space: normal !important;
font-size: 10px;
}
</style>
<?php
include ('includes/config/config.php');
$rolecode = $_SESSION['RoleCode'];
error_log('ttttt' . $rolecode);
error_log(in_array('DIS', explode(',', ($rolecode))) . " ROLE CODE " . $rolecode);
$saved_ohc_id = $_SESSION['current_ohcttype'];
error_log('followup_to_opd id ' . $_REQUEST['followup_to_opd'] . " is empty " . empty($_REQUEST['followup_to_opd']));
error_log('followup_id ' . $_REQUEST["followup_id"]);
error_log('appointmentId ' . $_REQUEST['appointmentId']);
//to use in treatment table edit disable functionality only
$followup_to_opd_flag = $_REQUEST['followup_to_opd'];
$followup_id = $_REQUEST["followup_id"];
$medicine_issued = 'N';
$saved_ohc_id = $_SESSION['current_ohcttype'];
$num_rows_treatment = 0;
$num_rows_treatment_external = 0;
$_REQUEST['appointmentId'] = $app_id = $_REQUEST['followup_to_opd'] != '' ? $_REQUEST['followup_to_opd'] : $_REQUEST['appointmentId'];
error_log('app_id' . $app_id);
$id = $_REQUEST['appointmentId'];
$num_rows_treatment = 0;
$num_rows_treatment_external = 0;
$chronic_days = 0;
$doctor_discussed_id = 0;
if (isset($app_id)) {
if ($followup_id != '' && $followup_id != null && $followup_id != 0) {
$sql = "select * from followup_details where followup_id='" . $followup_id . "'";
} else {
$sql = "select * from employee_appointment where appointment_id='" . $app_id . "'";
}
// echo "query:".$sql;error_log("APPOINTMENT QUERY::" .$query);
$result = mysqli_query($conn, $sql);
$num_rows = @mysqli_num_rows($result);
$row = null;
// echo fhfh;
if ($num_rows > 0) {
$row = @mysqli_fetch_array($result);
$p_id = $row['emp_id'];
$saved_ohc_id = $row['ohc_type_id'];
if (trim($row['medi_disbursement']) != '') {
if (empty($followup_to_opd_flag) && ($followup_id == null || empty($followup_id) || $followup_id == '0')) {
$medicine_issued = trim($row['medi_disbursement']);
error_log("medicine distributed or not " . $medicine_issued);
} else if (!empty($followup_to_opd_flag) && (!empty($followup_id) && $followup_id != null && $followup_id != '0')) {
$medicine_issued = trim($row['medi_disbursement']);
error_log("medicine distributed or not " . $medicine_issued);
}
}
}
$chronic_days = $row['chronic_day'];
$doctor_discussed_id = $row['doctor_discussed_id'];
if ($_REQUEST['followup_to_opd'] == '' || $_REQUEST['followup_to_opd'] == null || $_REQUEST['followup_to_opd'] == 0) {
$sql_for_treatment = "select * from treatment where appointment_id='" . $app_id . "' and is_display!='N' and followup_id='0' ";
} else {
if ($followup_id == '' || $followup_id == null) {
$sql_for_treatment = "select * from treatment where appointment_id='" . $app_id . "' and is_display!='N' and followup_id!='0' ";
} else {
$sql_for_treatment = "select * from treatment where appointment_id='" . $app_id . "' and is_display!='N' and followup_id='" . $followup_id . "' ";
}
}
error_log('tq' . $sql_for_treatment);
$result_for_treatment = @mysqli_query($conn, $sql_for_treatment);
$num_rows_treatment = @mysqli_num_rows($result_for_treatment);
if ($_REQUEST['followup_to_opd'] == '' || $_REQUEST['followup_to_opd'] == null || $_REQUEST['followup_to_opd'] == 0) {
$sql_for_treatment_external = "select * from treatment_external where appointment_id='" . $app_id . "' and followup_id='0' ";
} else {
if ($followup_id == '' || $followup_id == null) {
$sql_for_treatment_external = "select * from treatment_external where appointment_id='" . $app_id . "' and followup_id!='0' ";
} else {
$sql_for_treatment_external = "select * from treatment_external where appointment_id='" . $app_id . "' and followup_id='" . $followup_id . "' ";
}
}
$result_for_treatment_external = @mysqli_query($conn, $sql_for_treatment_external);
$num_rows_treatment_external = @mysqli_num_rows($result_for_treatment_external);
//If Its a follow up OPD/INJURY case - then add treatment details from the existing
$treatment_followup_picked = false;
if ($num_rows_treatment == 0 && $num_rows_treatment_external == 0 && ($row['followup_to_opd'] != null && $row['followup_to_opd'] != "0")) {
$follow_up_ohc = getFieldFromTable('ohc_type_id', 'employee_appointment', 'appointment_id', $row['followup_to_opd']);
if ($follow_up_ohc == $_SESSION['current_ohcttype']) {
$sql_for_treatment = "select * from treatment where appointment_id='" . $row['followup_to_opd'] . "' and is_display!='N'";
$result_for_treatment = @mysqli_query($conn, $sql_for_treatment);
$num_rows_treatment = @mysqli_num_rows($result_for_treatment);
$sql_for_treatment_external = "select * from treatment_external where appointment_id='" . $row['followup_to_opd'] . "'";
$result_for_treatment_external = @mysqli_query($conn, $sql_for_treatment_external);
$num_rows_treatment_external = @mysqli_num_rows($result_for_treatment_external);
$treatment_followup_picked = true;
}
}
}
?>
<script>
var rolecode = '<?php echo $_SESSION['RoleCode'] ?>';
var num_rows_treatment = <?php echo $num_rows_treatment ?>;
var num_rows_treatment_external = <?php echo $num_rows_treatment_external ?>;
var curr_ohc_id = <?php echo $saved_ohc_id ?>;
</script>
<form id="opd_form" method="post">
<div class="widget-box" id="opd_form_pdf">
<div class="widget-header" data-action="fullscreen">
<h5 class="widget-title">Patient injury > &nbsp;
<?php echo $patient_name . " " . $emp_code ?> &nbsp;<a target="_blank" href="emp_dashboard.php?flex_patient_id=<?php if ($row['emp_id'] != '' || $row['emp_id'] != null) {
echo $row['emp_id'];
} else {
echo $_REQUEST['emp_id'];
} ?>"><i style="font-size: 17px;" class="glyphicon glyphicon-user"></i></a>
&nbsp;<a target="_blank" href="edit_employee_details.php?active=docsTab&emp_id=<?php if ($row['emp_id'] != '' || $row['emp_id'] != null) {
echo $row['emp_id'];
} else {
echo $_REQUEST['emp_id'];
} ?>"><i style="font-size: 17px;" class="glyphicon glyphicon-file"></i></a>
&nbsp;<a target="_blank" href="edit_employee_details.php?active=medicalExaminationHistroyTab&emp_id=<?php if ($row['emp_id'] != '' || $row['emp_id'] != null) {
echo $row['emp_id'];
} else {
echo $_REQUEST['emp_id'];
} ?>"><i style="font-size: 17px;" class="ace-icon fa fa-stethoscope"></i></a>
</h5>
<div class="loader"></div>
<div class="widget-toolbar" style="float: right">
<div class="clearfix">
<div class="pull-right tableTools-container">
<div class="dt-buttons btn-overlap btn-group ">
<a class="dt-button buttons-csv buttons-html5 btn btn-white btn-primary btn-bold save_button"
title="Go To All Opd/Injury Page" style="float: left;"
onclick="location.replace('appointment_list.php')"><i
class="fa fa-arrow-left bigger-110 red"
onclick="location.replace('appointment_list.php')"></i> &nbsp;BACK</a>
<a class="dt-button buttons-csv buttons-html5 btn btn-white btn-primary btn-bold save_button"
id="forwardButton" tabindex="0" aria-controls="dynamic-table" data-original-title=""
title=""><span><i class="fa fa-floppy-o bigger-110 blue"></i>
<span>SAVE</span></span></a>
<!-- <?php if ($rolecode == 'DOC' || $rolecode == $__ROLE_DISPENSARY || in_array('DIS', explode(',', $rolecode))) { ?>
<input class="form-control" value='<?php if ($rolecode == 'DOC') {
echo 'PHP';
} else {
echo 'DRP';
} ?>' id="forward_status" name="forward_status"
style="display:none" />
<?php } ?> -->
<a class="dt-button buttons-csv buttons-html5 btn btn-white btn-primary btn-bold save_button"
id="forwardButton" tabindex="0" aria-controls="dynamic-table" data-toggle="modal"
data-target="#imageUploadModal"><span><i class="fa fa-floppy-o bigger-110 blue"></i>
<span>UPLOAD INJURY PHOTO'S</span></span></a>
<?php if ($rolecode == 'DOC') { ?>
<div class="dt-button buttons-csv buttons-html5 btn btn-white btn-primary btn-bold save_button"
style=" padding-bottom: 3px; padding-top: 4px;">IPD&nbsp;<input type="checkbox" id='ipd'
value="<?php echo $row['ipd'] ?>" style="width: 50%;" <?php if ($row['ipd'] == 1)
echo 'checked'; ?> name="ipd">
</input></div>
<?php } ?>
<a class="dt-button buttons-csv buttons-html5 btn btn-white btn-primary btn-bold save_button"
style="float: left;" onclick="add_consume();"><i class="fa fa-medkit bigger-110 red"
onclick="add_consume();"></i>
CONSUMABLES</a>
<a class="dt-button buttons-csv buttons-html5 btn btn-white btn-primary btn-bold save_button"
style="float: left;" onclick="add_ambulance_stock();"><i class="fa fa-ambulance bigger-110 red"
onclick="add_ambulance_stock();"></i>
AMBULANCE</a>
<a onclick="convertToOPD()"
class="dt-button buttons-csv buttons-html5 btn btn-white btn-primary btn-bold save_button"
style="float: left;">Convert to OPD</a>
<?php if ($row['doctor_attended_flag'] == 'Y' && ($_REQUEST['appointmentId'] != '' || $_REQUEST['appointmentId'] != null)) { ?>
<a class="dt-button buttons-print btn btn-white btn-primary btn-bold"
onclick="exporttopdf();" tabindex="0" aria-controls="dynamic-table"
data-original-title="" title=""><span><i class="fa fa-print bigger-110 grey"></i>
<span class="hidden">Print</span></span></a>
<?php } ?>
<a class="dt-button buttons-csv buttons-html5 btn btn-white btn-primary btn-bold save_button"
style="float: left;" onclick="redirectTo('O');"><i class="fa fa-plus bigger-110 red"
onclick="redirectTo('O');"></i> &nbsp;New Opd</a>
<a class="dt-button buttons-print btn btn-white btn-primary btn-bold"
data-action="fullscreen" tabindex="0" aria-controls="dynamic-table"
data-original-title="" title=""><span><i class="fa fa fa-expand bigger-110 grey"></i>
<span class="hidden">Maximize</span></span></a> <input type="hidden"
name="attendedStatus" id="attendedStatus" <?php if ($rolecode == 'DOC') {
?>
value="<?php echo $__STATUS_DOCTOR_ATTENDED ?>" <?php } ?> <?php if ($rolecode == 'DIS' || in_array('DIS', explode(',', $rolecode))) { ?>
value="<?php echo $__STATUS_PHARMACY_ATTENDED ?>" <?php } ?> /> <input type="hidden"
name="doctor_last_attended" id="doctor_last_attended" <?php if ($rolecode == 'DOC') { ?>
value="<?php echo $_SESSION['user_id'] ?>" <?php } else { ?>
value="<?php echo $row['doctor_last_attended'] ?>" <?php } ?> />
</div>
</div>
</div>
</div>
</div>
<div class="widget-body">
<div class="widget-main">
<div class="row">
<div class="col-xs-12 table-responsive">
<div class="widget-box box box-danger">
<div class="widget-body">
<div class="widget-main">
<div class="row">
<!-- <div class="col-xs-2" style="width:14%">
<label class="control-label" for="isEmergency"><strong style="font-size: 11px">Emergency?</strong></label> <select class="form-control" id="isEmergency" name="isEmergency">
<option value="0" <?php if ($row['IsEmergency'] == 0) { ?> selected <?php } ?>>No</option>
<option value="1" <?php if ($row['IsEmergency'] == 1) { ?> selected <?php } ?>>Yes</option>
</select>
</div> -->
<!-- <div class="col-xs-2" style="width:14%">
<label class="control-label" for="form-field-select-1"><strong style="font-size: 11px">Chargeable?</strong></label> <select class="form-control" id="isChargeable" name="isChargeable">
<option value="1" <?php if ($row['IsChargeable'] == 1) { ?> selected <?php } ?>>Yes</option>
<option value="0" <?php if ($row['IsChargeable'] == 0) { ?> selected <?php } ?>>No</option>
</select>
</div> -->
<div class="col-sm-2">
<label class="control-label" for="form-field-select-1"><strong
style="font-size: 11px">Weight</strong></label>
<input type="number" class="form-control" min="0" max="1000"
placeholder="WEIGHT(kg)" id="weight" name="weight"
onchange="calculateBMI()" value="<?php echo $row['weight'] ?>">
</div>
<div class="col-sm-2">
<label class="control-label" for="form-field-select-1"><strong
style="font-size: 11px">Height</strong></label>
<input type="number" min="0" max="1000" class="form-control" id="height"
name="height" placeholder="HEIGHT (cms)" min="0" max="1000"
onchange="calculateBMI()" value="<?php echo $row['height'] ?>">
</div>
<div class="col-sm-2">
<label class="control-label" for="form-field-select-1"><strong
style="font-size: 11px">BMI</strong></label>
<input type="number" class="form-control" id="bmi" name="bmi"
placeholder="BMI(KG/m2)" min="0" max="200"
value="<?php echo $row['bmi'] ?>">
</div>
<div class="col-sm-2">
<label class="control-label" for="form-field-select-1"><strong
style="font-size: 11px">SBP</strong></label>
<input type="number" class="form-control" min="0" max="1000"
placeholder="SBP" id="sbp" name="sbp"
value="<?php echo $row['bp_sbp'] ?>">
</div>
<div class="col-sm-2">
<label class="control-label" for="form-field-select-1"><strong
style="font-size: 11px">DBP</strong></label>
<input type="number" min="0" max="1000" class="form-control" id="DBP"
name="dbp" placeholder="DBP" min="0" max="1000"
value="<?php echo $row['bp_dbp'] ?>">
</div>
<div class="col-sm-2">
<label class="control-label" for="form-field-select-1"><strong
style="font-size: 11px">Temperature</strong></label>
<input type="number" min="0" max="1000" class="form-control"
placeholder="Temp.(F)" id="temperature" name="temperature"
value="<?php echo $row['temperature'] ?>" maxlength="10">
</div>
<div class="col-sm-2">
<label class="control-label" for="form-field-select-1"><strong
style="font-size: 11px">R Rate</strong></label>
<input type="number" class="form-control" min="0" max="1000"
placeholder="Respiratory rate" id="resp_rate" name="resp_rate"
value="<?php echo $row['respiratory_rate'] ?>">
</div>
<div class="col-sm-2">
<label class="control-label" for="form-field-select-1"><strong
style="font-size: 11px">Heart Rate</strong></label>
<input type="number" class="form-control" id="heart_rate" name="heart_rate"
placeholder="Heart Rate(BPM)" min="0" max="200"
value="<?php echo $row['heart_rate'] ?>">
</div>
<div class="col-sm-2">
<label class="control-label" for="form-field-select-1"><strong
style="font-size: 11px">Pulse</strong></label>
<input type="number" class="form-control" min="0" max="1000"
id="pulse_output" name="pulse_output" placeholder="Pulse"
value="<?php echo $row['pulse_output'] ?>">
</div>
<!-- <div class="col-xs-1">
<label class="control-label" for="form-field-select-1"><strong style="font-size: 11px">FBS</strong></label>
<input type="number" class="form-control" min="0" max="1000" placeholder="FBS" id="fbs" name="fbs" value="<?php echo $row['blood_sugar_fbs'] ?>">
</div> -->
<div class="col-sm-2">
<label class="control-label" for="form-field-select-1"><strong
style="font-size: 11px">SPO2</strong></label>
<input type="number" min="0" max="1000" class="form-control"
id="spo2_percent" name="spoc2_percent" placeholder="SPO2"
value="<?php echo $row['spo2_percent'] ?>" maxlength="10">
</div>
<div class="col-sm-2">
<label class="control-label" for="form-field-select-1"><strong
style="font-size: 11px">GC SCALE</strong></label>
<input type="number" min="0" max="1000" class="form-control"
id="glasgow_coma_scale" name="glasgow_coma_scale"
placeholder="Glasgow coma scale"
value="<?php echo $row['glasgow_coma_scale'] ?>" maxlength="10">
</div>
<div class="col-sm-2">
<label class="control-label" for="form-field-select-1"><strong
style="font-size: 11px">GRBS</strong></label>
<input type="number" min="0" max="1000" class="form-control" id="grbs"
name="grbs" placeholder="GRBS" value="<?php echo $row['grbs'] ?>"
maxlength="10">
</div>
<div class="col-sm-2">
<label class="control-label" for="form-field-select-1"><strong
style="font-size: 11px">BAC Levels</strong></label>
<input type="text" min="0" max="1000" class="form-control" id="bac_level"
name="bac_level" placeholder="BAC Levels"
value="<?php echo $row['bac_level'] ?>" maxlength="10">
</div>
</div>
<div class="space-6"></div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 table-responsive">
<div class="widget-box box box-warning">
<div class="widget-body">
<div class="widget-main">
<div class="row">
<div class="col-xs-12">
<div class="row">
<div class="col-sm-3">
<label class="control-label" for="appoint"><strong
style="font-size: 11px">Medical Record No:</strong></label>
<input id="ticket_no" type="hidden" name="ticket_no" value="<?php if ($row['ticket_no'] != '' || $row['ticket_no'] != null) {
if (($_REQUEST['followup_to_opd'] != '' && $_REQUEST['followup_to_opd'] != null) && ($_REQUEST['followup_id'] == '' || $_REQUEST['followup_id'] == null)) {
echo creatingTicketNoFollowup();
} else if (($_REQUEST['followup_to_opd'] != '' && $_REQUEST['followup_to_opd'] != null) && ($_REQUEST['followup_id'] != '' && $_REQUEST['followup_id'] != null)) {
echo getTableFieldValue('followup_details', 'ticket_no', 'followup_id', $followup_id);
} else {
echo $row['ticket_no'];
}
} else {
if ($_REQUEST['followup_to_opd'] != '' && $_REQUEST['followup_to_opd'] != null) {
echo creatingTicketNoFollowup();
} else {
echo creatingTicketNoInjury();
}
} ?>" />
<div class="input-group">
<?php if ($row['ticket_no'] != '' || $row['ticket_no'] != null) {
if (($_REQUEST['followup_to_opd'] != '' && $_REQUEST['followup_to_opd'] != null) && ($_REQUEST['followup_id'] == '' || $_REQUEST['followup_id'] == null)) {
echo creatingTicketNoFollowup();
} else if (($_REQUEST['followup_to_opd'] != '' && $_REQUEST['followup_to_opd'] != null) && ($_REQUEST['followup_id'] != '' && $_REQUEST['followup_id'] != null)) {
echo getTableFieldValue('followup_details', 'ticket_no', 'followup_id', $followup_id);
} else {
echo $row['ticket_no'];
}
} else {
if ($_REQUEST['followup_to_opd'] != '' && $_REQUEST['followup_to_opd'] != null) {
echo creatingTicketNoFollowup();
} else {
echo creatingTicketNoInjury();
}
} ?>
<input id="dept_mail" type="hidden" style="height: 30px"
class="form-control" name="dept_mail"
value="<?php
if ($row['emp_id'] != '' || $row['emp_id'] != null) {
$em_id = $row['emp_id'];
} else {
$em_id = $_REQUEST['emp_id'];
}
echo getTableFieldValue('department', 'dept_email', 'dept_id', getTableFieldValue('patient_master', 'dept_id', 'id', $em_id)) ?>" />
<input id="appoint" type="hidden" name="appoint"
value="<?php echo $_REQUEST['appointmentId'] ?>" />
<input id="emp_mail" name="emp_mail" type="hidden"
value="<?php
if ($row['emp_id'] != '' || $row['emp_id'] != null) {
$em_id = $row['emp_id'];
} else {
$em_id = $_REQUEST['emp_id'];
}
getTableFieldValue('patient_master', 'offiial_email_id', 'id', $em_id); ?>" />
</div>
</div>
<div class="col-sm-3">
<label class="control-label" for="appointment_date"><strong
style="font-size: 11px">In time</strong></label>
<div class="input-group">
<input id="emp_id" name="emp_id" type="hidden" value="<?php if ($row['emp_id'] != '' || $row['emp_id'] != null) {
$emp_id = $row['emp_id'];
echo $row['emp_id'];
} else {
$emp_id = $_REQUEST['emp_id'];
echo $_REQUEST['emp_id'];
} ?>" /><input id="appointment_id" name="appointment_id"
value="<?php echo $row_history['appointment_id'] ?>"
type="hidden" />
<input id="followup_id" type="hidden" style="height: 30px"
class="form-control" name="followup_id"
value="<?php echo $followup_id ?>" />
<input type="hidden" name="doctor_attended_flag"
id="doctor_attended_flag" <?php if ($rolecode == 'DOC' || $row['doctor_attended_flag'] == 'Y') { ?> value="Y" <?php } else { ?> value="N" <?php } ?>>
<input id="appointment_type" name="appointment_type"
type="hidden" value="I" />
<input id="appointment_date" type="text" class="form-control"
style="height: 30px" name="appointment_date" /> <span
class="input-group-addon"> <i style="height: 5px"
class="fa fa-clock-o bigger-110"></i> </span>
</div>
</div>
<div class="col-sm-3">
<label class="control-label" for="appointment_date"><strong
style="font-size: 11px">Clearance Time</strong></label>
<div class="input-group">
<input id="out_time" type="text" style="height: 30px"
class="form-control" name="out_time" /> <span
class="input-group-addon"> <i
class="fa fa-clock-o bigger-110"
style="height: 5px;"></i>
</span>
</div>
</div>
<!-- <div class=" col-sm-2">
<label class="control-label" for="followup_to_opd"><strong style="font-size: 11px">Case Type</strong></label>
<select class="form-control" id="case_type" name="case_type">
<option value="">None</option>
<?php echo generateOption('case_type', 'case_name', 'case_code', $row['case_type'], 1) ?>
</select>
</div> -->
<div class=" col-sm-3">
<label class="control-label" for="followup_to_opd"><strong
style="font-size: 11px">Followup to(if
Applicable)</strong></label>
<div>
<select id="followup_to_opd" name="followup_to_opd"
class="form-control">
<option value="">None</option>
<?php echo generateOptionWithWhereClause('employee_appointment', "CONCAT(ticket_no,' ',DATE_FORMAT(appointment_date,'%d-%b-%Y %l:%i %p '))", 'appointment_id', ($_REQUEST['followup_to_opd'] != '' ? $_REQUEST['followup_to_opd'] : $_REQUEST['followup_to_opd']), '', 'emp_id', ($_REQUEST['flex_opd_id'] != '' ? $_REQUEST['flex_opd_id'] : $_REQUEST['flex_patient_id'])); ?>
</select>
</div>
</div>
</div>
<div class="space-6"></div>
<div class="row">
<!-- <div class="col-sm-3">
<label class="control-label" for="form-field-8"><strong style="font-size: 11px">Referred By</strong></label>
<br>
<select class="form-control" id="referred_by" name="referred_by">
<option value="" disabled selected>Please select an option
</option>
<?php echo generateOption('referred_by_master', 'referred_by', 'id', $row['referred_by'], '') ?>
</select>
</div> -->
<?php
$complaint_config = getFieldFromTable('value', 'config', 'key_name', 'complaint_tag_switch');
error_log("complaints_config tag switch " . $complaint_config . " compare " . strcmp(strtolower($complaint_config), "false"));
if (!strcmp(strtolower($complaint_config), "false")) {
?>
<div class="col-sm-3">
<label class="control-label" for="complaints"><strong
style="font-size: 11px">Complaints</strong></label>
<br>
<div>
<select class="form-control chosen-select" name="complaints[]"
id="complaints" multiple>
<?php echo generateOptionForMultipleActive('complaints', 'complaint', 'complaint_id', '', '') ?>
</select>
</div>
</div>
<?php
} else { ?>
<div class="col-sm-3">
<label class="control-label" for="form-field-8"><strong
style="font-size: 11px">Complaints</strong></label>
<br>
<div>
<input type="text" class="form-control" id="complaints"
name="complaints" data-placeholder="Complaints" />
</div>
</div>
<?php } ?>
<?php
$examination_remarks_config = getFieldFromTable('value', 'config', 'key_name', 'examination_tag_switch');
error_log("examination_remarks_config tag switch " . $examination_remarks_config . " compare " . strcmp(strtolower($examination_remarks_config), "false"));
if (!strcmp(strtolower($examination_remarks_config), "false")) {
?>
<div class="col-sm-3">
<label class="control-label" for="examination_remarks"><strong
style="font-size: 11px">Examination
Findings</strong></label>
<br>
<div>
<select class="form-control chosen-select"
name="examination_remarks[]" id="examination_remarks"
multiple>
<?php echo generateOption('examination_findings', 'examination_finding', 'id', '', '') ?>
</select>
</div>
</div>
<?php
} else { ?>
<div class="col-sm-3">
<label class="control-label" for="examination_remarks"><strong
style="font-size: 11px">Examination
Findings</strong></label>
<br>
<div>
<input type="text" class="form-control" id="examination_remarks"
name="examination_remarks"
data-placeholder="Examination findings" />
</div>
</div>
<?php } ?>
<?php
$diagnosis_config = getFieldFromTable('value', 'config', 'key_name', 'diagnosis_tag_switch');
error_log("diagnosis tag switch " . $complaint_config . " compare " . strcmp(strtolower($complaint_config), "false"));
if (!strcmp(strtolower($diagnosis_config), "false")) {
?>
<div class="col-sm-3">
<label class="control-label" for="Diagnosis"><strong
style="font-size: 11px">Diagnosis<span
style="color: red">*</span></strong></label>
<br>
<div>
<select class="form-control chosen-select" name="ailment_new[]"
id="ailment_new" multiple>
<?php echo generateOptionForMultipleActive('ailment', 'ailment_name', 'ailment_id', '', '') ?>
</select>
</div>
</div>
<?php
} else { ?>
<div class="col-sm-3">
<label class="control-label" for="ailment"><strong
style="font-size: 11px">Diagnosis<span
style="color: red">*</span></strong></label><br>
<div>
<input type="text" class="form-control" id="ailment_new"
name="ailment_new" data-placeholder="Ailments">
</div>
</div>
<?php } ?>
<div class="col-sm-3">
<label class="control-label" for="ailment_system">
<strong style="font-size: 11px">Body System</strong>
</label>
<select class="chosen-select form-control" id="ailment_system_new"
name="ailment_system_new[]" multiple
data-placeholder="Ailment System">
<?php echo generateOptionForMultiple('ailment_system', 'ailment_sys_name', 'ailment_sys_id', $row['ailment_systems_new'], ''); ?>
</select>
</div>
</div>
<div class="space-6"></div>
<div class="row">
<div class="col-sm-3">
<label class="control-label" for="form-field-8"><strong
style="font-size: 11px">Injury Location</strong></label>
<input type="text" class="form-control" name="incident_location"
id="incident_location"
value="<?php echo $row['incident_location'] ?>"
placeholder="Location where injury happened" maxLength="200">
</div>
<div class="col-sm-3">
<label class="control-label" for="form-field-8"><strong
style="font-size: 11px">OHC Staff Notes</strong></label>
<div>
<input class="form-control" id="remarks_rece"
name="remarks_rece" value="<?= $row["remarks_rece"] ?>"
style="word-wrap: break-word; word-break: break-all; height:40px"
<?php if ($_SESSION["RoleCode"] != 'DOC')
echo "disabled" ?>>
</div>
<!-- <textarea rows="2" cols="6" class="autosize-transition form-control" style="overflow: hidden; overflow-wrap: break-word;" name="remarks_rece" id="remarks_rece" placeholder="Remarks/Follow-up Investigation Details" maxlength="500"><?php echo $row['remarks_rece'] ?></textarea> -->
</div>
<div class="col-sm-3">
<label class="control-label" for="followup"><strong
style="font-size: 11px">Follow-up date</strong></label>
<!-- <div class="input-group"> -->
<input id="followup" type="date" class="form-control"
placeholder="Follow Up" name="followup"
value="<?php echo $row['followup'] ?>" />
<!-- <i
style="height: 5px"
class="fa fa-clock-o bigger-110"></i> -->
<!-- <textarea id="followup" rows="4" cols="8" name="followup"
placeholder="Follow Up" class="autosize-transition form-control"
style="overflow: hidden; overflow-wrap: break-word;"><?php echo $row['followup'] ?></textarea> -->
<!-- </div> -->
</div>
<div class="col-sm-3">
<label class="control-label" for="deu_date"><strong
style="font-size: 11px">Injury Time</strong></label>
<div class="input-group">
<input id="injury_time" type="text" class="form-control"
style="height: 30px" name="injury_time" /> <span
class="input-group-addon"> <i style="height: 5px"
class="fa fa-clock-o bigger-110"></i>
</span>
</div>
</div>
</div>
<br>
<div class="row">
<!-- <div class="col-sm-3">
<label class="control-label" for="form-field-8"><strong style="font-size: 11px">INJURY DEFINE</strong></label>
<br>
<select class="form-control" id="injury_def" name="injury_def">
<option value="" disabled selected>Please select an option
</option>
<option value="init" <?php if (strcmp($row['injury_def'], 'init') == 0) {
echo "selected";
} ?>>
Initiated
</option>
<option value="not-init" <?php if (strcmp($row['injury_def'], 'not-init') == 0) {
echo "selected";
} ?>>
Not Initiated
</option>
</select>
</strong></label>
<br>
</div> -->
</div>
<br>
<div class="row">
<div class="col-sm-12 table-responsive">
<label class="control-label" for="form-field-8"><strong
style="font-size: 11px">Injury</strong></label>
<table class="table table-bordered table-hover simple-table">
<thead>
<tr class="active">
<th><strong style="font-size: 11px">Type</strong></th>
<th><strong style="font-size: 11px">Part </strong></th>
<th><strong
style="font-size: 11px">Classification</strong>
</th>
<th><strong style="font-size: 11px">Mechanism</strong>
</th>
</tr>
</thead>
<tbody>
<tr>
<td class="col-sm-3"><select multiple=""
class="chosen-select form-control"
name="injury_type_new[]" id="injury_type_new"
placeholder="Injury Type">
<?php echo generateOptionForMultiple('injury_type', 'injury_type_name', 'injury_type_id', $row['injury_types_new'], ''); ?>
</select>
</td>
<?php
$injury_part_config = getFieldFromTable('value', 'config', 'key_name', 'injury_part_switch');
error_log("injury_part_switch tag switch " . $injury_part_config . " compare " . strcmp(strtolower($injury_part_config), "false"));
if (!strcmp(strtolower($injury_part_config), "false")) {
?>
<td class="col-sm-3">
<select multiple=""
class="chosen-select form-control"
name="injury_part[]" id="injury_part"
placeholder="Affected Body Parts..">
<?php echo generateOptionForMultiple('injury_part', 'inj_name', 'inj_id', '', ''); ?>
</select>
</td>
<?php } else { ?>
<td class="col-sm-3">
<input type="text" name="injury_part"
id="injury_part" class="form-control">
</td>
<?php } ?>
<td class="col-sm-3"><select multiple=""
class="chosen-select form-control"
name="injury_class_new[]" id="injury_class_new"
class="form-control"
placeholder="Injury Classification..">
<?php echo generateOptionForMultiple('injury_class', 'inj_class_name', 'inj_class_id', $row['injury_classes_new'], ''); ?>
</select>
</td>
<?php
$injury_mech_config = getFieldFromTable('value', 'config', 'key_name', 'injury_mechanism_switch');
error_log("injury_mech_switch tag switch " . $injury_mech_config . " compare " . strcmp(strtolower($injury_mech_config), "false"));
if (!strcmp(strtolower($injury_mech_config), "false")) {
?>
<td class="col-sm-3"><select multiple=""
class="chosen-select form-control"
name="injury_mech_new[]" id="injury_mech_new"
class="form-control"
placeholder="Injury Mechanism..">
<?php echo generateOptionForMultiple('injury_mechanism', 'injury_mech_name', 'injury_mech_id', $row['injury_mech'], ''); ?>
</select>
</td>
<?php } else { ?>
<td class="col-sm-3">
<input type="text" name="injury_mech_new"
id="injury_mech_new" class="form-control">
</td>
<?php } ?>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<label class="control-label" for="remarks"><strong
style="font-size: 11px">Procedures Done(if
Any)</strong></label>
<textarea id="pro_remarks" name="pro_remarks"
placeholder="Procedure.." rows="3" cols="6"
class="autosize-transition form-control"
style="overflow: hidden; overflow-wrap: break-word;"><?php echo $row['injury_procedure'] ?></textarea>
</div>
<div class="col-sm-3">
<label class="control-label" for="additional_advices"><strong
style="font-size: 11px">Patient taking any
Medications</strong></label>
<textarea placeholder="Enter medication details" rows="3" cols="8"
id="any_medication" name="any_medication"
class="autosize-transition form-control"
style="overflow: hidden; overflow-wrap: break-word;"><?php echo $row['any_medication'] ?></textarea>
</div>
<div class="col-sm-3">
<!-- <input type="hidden" class="form-control" name="drug_allergy"
id="drug_allergy" value="" />
<label for="role"><strong style="font-size: 11px">History of Drug
Allergies</strong></label>
<div class="input-group">
<span id="drug_allergy_span"></span>
</div> -->
<label class="control-label" for="additional_advices"><strong
style="font-size: 11px">History of Drug
Allergies:</strong></label>
<select class="chosen-select form-control" name="drug_allergy[]"
id="drug_allergy" multiple value='<?= $row['drug_allergy'] ?>'
data-placeholder="Ailment System">
<?php echo generateOptionForMultiple('salt_master', 'salt_name', 'salt_id', $row['drug_allergy'], ''); ?>
</select>
</div>
<div class="col-sm-3">
<!-- <input type="hidden" class="form-control" name="abnormality"
id="abnormality" value="" required /> -->
<label class="control-label" for="additional_advices"><strong
style="font-size: 11px">Chronic Illness</strong></label>
<!-- <div class="input-group">
<span id="abnormality_span"></span>
</div> -->
<input id="abnormalityIds" name="abnormalityIds" type="hidden">
<select multiple='' class="form-control chosen-select"
name="abnormality[]" id='abnormality'
placeholder="Abnormalities.." rows="3" cols="8"
class="autosize-transition form-control"
style="overflow: hidden; overflow-wrap: break-word;">
<?php echo generateOption("abnormality", "abnormality_name", "abnormality_id", "", ""); ?>
</select>
</div>
</div>
<br>
<div class="row">
<div class="col-sm-3">
<label class="control-label" for="ailment_system"><strong
style="font-size: 11px">Injury Area
category</strong></label>
<select class="form-control select2" id="injury_area_cat"
name="injury_area_cat">
<option value="" disabled selected>Please select an option
</option>
<option value="IN" <?php if (strcmp($row['injury_area_cat'], 'IN') == 0) {
echo "selected";
} ?>>
Work Related</option>
<option value="NIN" <?php if (strcmp($row['injury_area_cat'], 'NIN') == 0) {
echo "selected";
} ?>>
Non Work Related</option>
</select>
</div>
<div class="col-sm-3">
<label class="control-label" for="ailment_system"><strong
style="font-size: 11px">PPE</strong></label><br>
<textarea id="ppe" name="ppe"
class="autosize-transition form-control"
style="overflow: hidden; overflow-wrap: break-word;"
placeholder="Enter PPE" rows="3"
cols="8"><?php echo $row['ppe'] ?></textarea>
</div>
<div class="col-sm-3">
<label class="control-label" for="shift_type">SHIFT
</label>
<select class="form-control select2" id="shift_type"
name="shift_type">
<option value="A1" <?php if (strcmp($row['shift_type'], 'A1') == 0) {
echo "selected";
} ?>>
A1</option>
<option value="A2" <?php if (strcmp($row['shift_type'], 'A2') == 0) {
echo "selected";
} ?>>
A2</option>
<option value="A3" <?php if (strcmp($row['shift_type'], 'A3') == 0) {
echo "selected";
} ?>>
A3</option>
<option value="B" <?php if (strcmp($row['shift_type'], 'B') == 0) {
echo "selected";
} ?>> B</option>
<option value="C" <?php if (strcmp($row['shift_type'], 'C') == 0) {
echo "selected";
} ?>>C</option>
</select>
</div>
</div>
<br>
<div class="row">
<?php if ($rolecode != 'DIS' || in_array('DIS', explode(',', $rolecode)) == 0) { ?>
<input type="hidden" name="medicine_disbursement"
id="medicine_disbursement" value="N" />
<?php } else { ?>
<input type="hidden" name="medicine_disbursement"
id="medicine_disbursement" value="Y" />
<?php } ?>
<?php
// if not doctor already consulted
if ($row['doctor_attended_flag'] != 'Y' && $rolecode != 'DOC') {
?>
<div class="col-sm-4">
<label class=" control-label " for="doctor_discussed"><strong
style="font-size: 11px">Doctor Discussed?</strong>
</label>
&nbsp;&nbsp;&nbsp;&nbsp; <input <?php if ($row['doctor_discussed'] == 'Y') {
echo 'checked="checked"';
} ?>
type="radio" name="doctor_discussed" id="doctor_discussed_yes"
value="Y" onchange="setDoctorDiscussed(this.value)"> Yes
&nbsp;&nbsp; <input <?php if ($row['doctor_discussed'] != 'Y') {
echo 'checked="checked"';
} ?> type="radio" name="doctor_discussed"
id="doctor_discussed_no" value="N"
onchange="setDoctorDiscussed(this.value)"> No
</div>
<div id="doc_discuss_div" style="display: none;">
<div class="col-sm-8" style="display: flex; align-items: center;">
<div class="col-sm-2">
<label for="">Doctor's Name</label>
</div>
<div class="col-sm-3">
<select name="doctor_discuss_id" id="doctor_discuss_id"
class="form-control">
<option value="">--Select Doctor--</option>
<?php
if (trim($doctor_discussed_id) == '' || $doctor_discussed_id == null) { ?>
<?php echo generate_options("select doctor_name,doctor_emp_id from doctors_master where doctor_emp_id != '' ", '', 'doctor_emp_id', 'doctor_name', '', '');
} else { ?>
<?php echo generate_options("select doctor_name,doctor_emp_id from doctors_master where doctor_emp_id != '' ", $doctor_discussed_id, 'doctor_emp_id', 'doctor_name', '', '');
} ?>
</select>
</div>
<div class="col-sm-2">
<label class="control-label" for="form-field-8"><strong
style="font-size: 11px">Remarks</strong></label>
</div>
<div class="col-sm-5">
<textarea rows="2" cols="7"
class="autosize-transition form-control"
style="overflow: hidden; overflow-wrap: break-word;"
name="add_remarks" id="add_remarks"
placeholder="Additional Remarks"
maxlength="500"><?php echo $row['add_remarks'] ?></textarea>
</div>
</div>
</div>
<?php } ?>
</div>
<div class="space-6"></div>
<?php
$p_id = $row['emp_id'] != '' ? $row['emp_id'] : $_REQUEST['emp_id'];
include 'view_patient_taking_any_medicine.php';
?>
<div class="space-6"></div>
<div class="row">
<div class="col-sm-6">
<button type="button" class="btn" data-toggle="modal"
id="load-med-data" data-target="#medDetails"
onclick="loadMedData();"><i
class="fa fa-info-circle"></i></button>
<label class="switch">
<input type="checkbox" checked id="genericSearchCheckbox"
name="genericSearchCheckbox">
<span class="slider round"></span>
</label> &nbsp;&nbsp;
<label style="margin-left: 60px;">Medicine Search By Generic
Name</label>
<button type="button" class="btn"
title="Load Treatment According To Selected Diagnosis Or Chronic Illness"
id="load-treatment-btn" onclick="loadTreatment();">Load
Treatment</button>
<div class="loader"></div>
</div>
<div class="col-sm-6"
style="display: flex; gap:5px;justify-content: end;align-items: center;">
<label for="">Days</label>
<input type="number" id="chronic_day" min="0" name="chronic_day"
class="form-control" style="width: 100px;"
value="<?= $chronic_days ?>">
<button type="button" class="btn"
title="Load Treatment According To Chronic Illness Mapped For This Patient"
id="load-chronic-treatment-btn"
onclick="loadChronicTreatment();">Load Chronic
Treatment</button>
<div class="loader-chronic"></div>
</div>
<div class="col-sm-12 table-responsive">
<?php $treatmentTableEditable = getConfigKey("EDIT_TREATMENT_TABLE_SWITCH");
error_log("key edit allowed " . $treatmentTableEditable);
?>
<input type="hidden" name="edit_table_key" id="edit_table_key"
value="<?= $treatmentTableEditable ?>">
<input type="hidden" name="med_dis_key" id="med_dis_key"
value="<?= $medicine_issued ?>">
<?php if ((strtolower($treatmentTableEditable) == 'false') && ($medicine_issued == 'Y') && ($followup_to_opd_flag == null || empty($followup_to_opd_flag))) {
include ('treatment_view_common_opd_injury.php');
} else if ((strtolower($treatmentTableEditable) == 'false') && ($medicine_issued == 'Y') && ($followup_id != null || !empty($followup_id))) {
include ('treatment_view_common_opd_injury.php');
} else { ?>
<table
id="treatmentTable<?php echo $row_history['appointment_id'] ?>"
class="table table-striped table-bordered"
style="padding: 2px; margin: 2px;">
<thead>
<tr class="success">
<th style="font-size: 9px; text-align: center;">Medicine
</th>
<th style="font-size: 9px; text-align: center;">
Frequency</th>
<th style="font-size: 9px; text-align: center;">Timing
</th>
<th style="font-size: 9px; text-align: center;">Admin.
Route</th>
<th style="font-size: 9px; text-align: center;">Duration
</th>
<th style="font-size: 9px; text-align: center;">Daily
Dose Qty
</th>
<th style="font-size: 9px; text-align: center;">Total
Qty</th>
<th style="font-size: 9px; text-align: center;">
Available
Qty</th>
<th style="font-size: 9px; text-align: center;">Qty
Issued</th>
<th style="font-size: 9px; text-align: center;"></th>
</tr>
</thead>
</table>
<?php } ?>
</div>
</div>
<div class="space-6"></div>
<div class="row">
<!-- <div class="col-sm-3">
<label class="control-label" for="injury_part"><strong style="font-size: 11px">Affected Body
Parts</strong></label>
<br>
<div>
<input type="text" name="injury_part_new" id="injury_part_new" class="form-control" placeholder="Affected Body Parts.." />
</div>
</div> -->
<div class="col-sm-3">
<label class="control-label" for="recommended_test_new"><strong
style="font-size: 11px">Recommended Tests</strong></label>
<br>
<div>
<select name="recommended_test_new[]" id="recommended_test_new"
class="form-control chosen-select" multiple
onchange="loadTestParamData();">
<?php echo generate_options("select section_name, section_id FROM checkup_form_section WHERE FIND_IN_SET(section_id, (select checkup_form_section_ids FROM checkup_type WHERE checkup_type_code = 'LAB_TEST'));", '', 'section_id', 'section_name', '', ''); ?>
</select>
<!-- <input type="text" name="recommended_test_new" id="recommended_test_new" class="form-control" placeholder="Select or Add Lab Tests" /> -->
</div>
</div>
<div class="col-sm-3">
<label class="control-label" for="form-field-8"><strong
style="font-size: 11px">Recommended Test
Parameters</strong></label>
<br>
<div>
<select class="form-control chosen-select"
name="recommended_test_param_new[]"
id="recommended_test_param_new" multiple></select>
</div>
</div>
<div class="col-sm-3">
<label class="control-label" for="additional_advices"><strong
style="font-size: 11px">Advices</strong></label>
<br>
<div>
<input type="text" name="health_advice_name_new"
id="health_advice_name_new" class="form-control"
placeholder="Select or Add Health Advices.." />
</div>
</div>
<div class="col-sm-3">
<label class="control-label" for="additional_treatment"><strong
style="font-size: 11px">Treatment from outside or
self-treatment</strong></label>
<select name="additional_treatment_info"
id="additional_treatment_info" class="form-control">
<option value="">--select--</option>
<option <?php if ($row['additional_treatment_info'] == 'Y') {
echo "selected";
} ?> value="Y">Yes</option>
<option <?php if ($row['additional_treatment_info'] == 'N') {
echo "selected";
} ?> value="N">No</option>
</select>
</div>
</div>
<div class="space-6"></div>
<!-- <div class="row">
<div class="col-sm-3">
<label class="control-label" for="followup"><strong
style="font-size: 11px">Period Of Rest From</strong></label>
<div class="input-group">
<input id="rest_from_time" type="text" class="form-control"
style="height: 30px" name="rest_from_time" /> <span
class="input-group-addon"> <i style="height: 5px"
class="fa fa-clock-o bigger-110"></i>
</span>
</div>
</div>
<div class="col-sm-3">
<label class="control-label" for="followup"><strong
style="font-size: 11px">Period Of Rest To</strong></label>
<div class="input-group">
<input id="rest_to_time" type="text" class="form-control"
style="height: 30px" name="rest_to_time" /> <span
class="input-group-addon"> <i style="height: 5px"
class="fa fa-clock-o bigger-110"></i>
</span>
</div>
</div>
<div class="col-sm-6">
<label class="control-label" for="referral"><strong
style="font-size: 11px">Injury Remarks by Medical
Officer</strong></label>
<textarea name="injury_remarks" rows="4" cols="8"
id="injury_remarks" placeholder="Injury Remarks"
class="autosize-transition form-control"
style="overflow: hidden; overflow-wrap: break-word;"><?php echo $row['injury_remarks'] ?></textarea>
</div>
</div> -->
<?php if ($row['recommended_tests_new'] != "" && $row['recommended_tests_new'] != null) { ?>
<div class="row">
<div class="col-sm-12 table-responsive">
</br>
<label class="control-label" for="additional_advices"><strong
style="font-size: 11px">Doctor Recommended Test Result
:</strong></label>
</div>
<div class="col-sm-12 table-responsive">
<input type="hidden" name="recommended_tests_new"
value="<?php echo $row['recommended_tests_new'] ?>">
<div class="row">
<?php $test_array = explode(",", $row['recommended_tests_new']);
for ($i = 0; $i < count($test_array); $i++) { ?>
<?php if ($i % 2 == 0) { ?>
</div>
<div class="row">
<?php } ?>
<div class="col-sm-6 table-responsive">
<?php echo $i + 1; ?>&nbsp;
<?php echo getFieldFromTable('section_name', 'checkup_form_section', 'section_id', $test_array[$i]) ?>
<?php $test_map_array = getKeyValueMapWithWhere('doctor_recommended_test', 'test_name', 'test_result', 'appointment_id', $_REQUEST['appointmentId']); ?>
<textarea name="test_<?php echo $i ?>" rows="4" cols="4"
id="test_<?php echo $i ?>"
placeholder="<?php echo $test_array[$i] ?> Test Result"
class="autosize-transition form-control"
style="overflow: hidden; overflow-wrap: break-word;"><?php echo $test_map_array[$test_array[$i]] ?></textarea>
</div>
<?php }
?>
</div>
</div>
</div>
<?php } ?>
</div>
<!-- /.col-xs-12 -->
</div>
<!--row end-->
</div>
<!--end of widget-main-->
</div>
<!--end of widget-body-->
</div>
<!--end of widget-box-->
</div>
<!-- sick-leave -->
<?php
$sickness_id = "";
$past_ticket_no = "";
$past_agency = "";
$past_des = "";
$past_from_date = "";
$past_to_date = "";
$past_date_absent = "";
$past_date_absent_to = "";
$past_date_return = "";
$existingAilmentList = "";
$ailment_id = "";
$height = "";
$weight = "";
$bp = "";
$pulse = "";
$chest_ex = "";
$chest_uex = "";
$nose = "";
$throat = "";
$rs = "";
$cvs = "";
$cns = "";
$sickness_status = "";
$blood = '';
$half_day = 0;
$half_day_value = 0;
$is_fit = 0;
$fitness_status = 'APPROVED';
$certificate_type = 'rest';
$des = 'NORMAL';
$comments = '';
if (!empty($app_id) && ($_REQUEST['followup_id'] != '' && $_REQUEST['followup_id'] != null)) {
$query_sick = "select s.*, e.patient_name from sickness s, patient_master e where s.emp_id=e.id and s.followup_to_opd = '" . $_REQUEST['appointmentId'] . "' and s.followup_id = '" . $_REQUEST['followup_id'] . "'";
// echo ('leave='.$query_sick);
error_log($query_sick . "data sick");
if (!$result_sick = @mysqli_query($conn, $query_sick)) {
die(mysqli_error($conn));
} else {
if (mysqli_num_rows($result_sick) > 0) {
$row_sick = mysqli_fetch_array($result_sick);
extract($row_sick);
}
$sickness_id = $row_sick['sickness_id'];
$past_ticket_no = $row_sick['ticket_no'];
$fitness_status = $row_sick['fitness_status'];
$past_agency = $row_sick['agency'];
$past_des = $row_sick['des_future'];
$certificate_type = $row_sick['certificate_type'];
$past_from_date = $row_sick['from_date'];
$past_to_date = $row_sick['to_date'];
$past_date_absent = $row_sick['date_absent'];
$approval_date = $row_sick['approval_date'];
$comments = $row_sick['comments'];
if ($approval_date != '' && $approval_date != null && $approval_date != '0000-00-00') {
$approval_date = '"' . $row_sick['approval_date'] . '"';
$is_fit = 1;
}
$past_date_absent_to = $row_sick['date_absent_to'];
$past_date_return = $row_sick['date_return'];
$existingAilmentList = $row_sick['ailment_name'];
$ailment_id = $row_sick['ailment_system'];
$height = $row_sick['height'];
$weight = $row_sick['weight'];
$bp = $row_sick['bp'];
$pulse = $row_sick['pulse'];
$chest_ex = $row_sick['chest_ex'];
$chest_uex = $row_sick['chest_uex'];
$nose = $row_sick['nose'];
$throat = $row_sick['throat'];
$rs = $row_sick['rs'];
$cvs = $row_sick['cvs'];
$cns = $row_sick['cns'];
$sickness_status = $row_sick['attended_status'];
$blood = $row_sick['blood'];
$half_day = $row_sick['half_day'];
$half_day_value = $row_sick['half_day_value'];
$des = $row_sick['des'];
}
}
?>
<div class="col-xs-12 table-responsive">
<div class="widget-box box box-success">
<div class="widget-body">
<div class="widget-main">
<label for="role">Sickness </label>
<div class="row">
<div class="col-xs-12">
<?php
if (!empty($past_ticket_no)) {
$ticket_no_sick = $past_ticket_no;
} else {
$ticket_no_sick = creatingTicketNoFitness();
}
?>
<input id="past_ticket_no" type="hidden" name="past_ticket_no"
value="<?php echo $ticket_no_sick; ?>" />
<input type="hidden" class="form-control" name="sickness_id"
id="sickness_id" value="<?php echo $sickness_id ?>" required />
<input id="rest_from_time" type="hidden" class="form-control"
style="height: 30px" name="rest_from_time" />
<input id="rest_to_time" type="hidden" class="form-control"
style="height: 30px" name="rest_to_time" />
<input class="form-control" type="hidden" name="sickness_status"
id="sickness_status" value="<?php echo $sickness_status ?>" required />
<!-- <div class="form-group col-sm-3" style=" padding-left: 0px;" align='center'>
<div class="dt-button buttons-csv form-group buttons-html5 btn btn-white btn-primary btn-bold save_button" style="margin-top: 20px;">
Half Day&nbsp;<input type="checkbox" id='half_day' onchange='half_day_select()' value="<?php echo $half_day ?>" style="width: 40%; " <?php if ($half_day == 1)
echo 'checked'; ?> name="half_day">
</input>
</div>
</div> -->
<div class="col-sm-3">
<div
style="margin-top: 15px;padding: 5px;border: 1px solid #3498db;border-radius: 5px;text-align: center;">
<input type="radio" name="define_half_day"
onchange='half_day_select()' value="1"
style="width: 5%;cursor: pointer;" <?php if ($half_day_value == 1)
echo 'checked'; ?>>
&nbsp;First Half &nbsp;
<input type="radio" name="define_half_day"
onchange='half_day_select()' value="2"
style="width: 5%; cursor: pointer;" <?php if ($half_day_value == 2)
echo 'checked'; ?>>
&nbsp;Second Half &nbsp;
<button type="button" id="clearBtn"
class="btn btn-primary">Clear</button>
</div>
</div>
<div class="col-sm-3">
<label for="role">Period Of Rest From</label>
<div class="input-group form-group ">
<input class="form-control" onchange="rest_from(this)"
name="date_absent" id="date_absent" type="text" /> <span
class="input-group-addon">
<i class="fa fa-calendar bigger-110"></i>
</span>
</div>
</div>
<div class="col-sm-3">
<label for="role">Period Of Rest To</label>
<div class="input-group">
<input class="form-control" name="date_absent_to"
id="date_absent_to" type="text" onchange="rest_to(this)" />
<span class="input-group-addon">
<i class="fa fa-calendar bigger-110"></i>
</span>
</div>
</div>
<!--
<div class="col-sm-2">
<label for="role">Certification Type</label>
<div class="input-group ">
<select class=" form-control" name="certificate_type" id="certificate_type" placeholder="Certificate Type" value="">
<option value="" selected disabled>Please Select Certification
Type </option>
<option value="rest" <?php if ($certificate_type == "rest" || $certificate_type == '' || $certificate_type == null) {
echo "selected";
} ?>>Rest Certificate</option>
<option value="duty" <?php if ($certificate_type == "duty") {
echo "selected";
} ?>>Duty Certificate</option>
<option value="fitness" <?php if ($certificate_type == "fitness") {
echo "selected";
} ?>>Fitness Certificate</option>
<option value="experience" <?php if ($certificate_type == "experience") {
echo "selected";
} ?>>Experience Certificate
</option>
</select>
</div>
</div> -->
<input class=" form-control" type='hidden' name="certificate_type"
id="certificate_type" placeholder="Certificate Type"
value="<?= $certificate_type ?>">
<?php
if ($rolecode == 'DOC' && in_array('DOC', explode(',', $rolecode))) {
# code...
?>
<div class="col-sm-3">
<label class="control-label" for="appointment_id"><strong
style="font-size: 11px">Remark By Medical Officer
:</strong></label>
<textarea name="injury_remarks" rows="3" cols="4" id="injury_remarks"
placeholder="Injury Remarks"
class="autosize-transition form-control"
style="overflow: hidden; overflow-wrap: break-word;"><?php echo $comments ?></textarea>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-12 table-responsive">
<div class="widget-box box box-success">
<div class="widget-body">
<div class="widget-main">
<label for="role">Fitness </label>
<div class="row">
<div class="col-xs-12">
<div class="form-group col-sm-3" style=" padding-left: 0px;" align='center'>
<div class="dt-button buttons-csv form-group buttons-html5 btn btn-white btn-primary btn-bold save_button"
style="margin-top: 20px;width: 88px;">
Is Fit &nbsp;<input type="checkbox" id='fit_day'
onchange='openFitDiv()' value="<?php echo $is_fit ?>"
style="width: 50%; " <?php if ($is_fit == 1)
echo 'checked'; ?>
name="fit_day">
</input></div>
<!-- display: <?php if (empty($sickness_id)) {
echo 'none';
} else {
echo 'inline-blockif';
} ?> -->
</div>
<div id='fitness_div'>
<div class="form-group col-sm-3">
<label for="role">Fitness Date</label>
<div class="input-group form-group ">
<input class="form-control" onchange="rest_from(this)"
name="approval_date" id="approval_date" type="text" /> <span
class="input-group-addon">
<i class="fa fa-calendar bigger-110"></i>
</span>
</div>
</div>
<div class="col-sm-3">
<label for="sickness">Health Status</label>
<select class="form-control" name="des" id="des" placeholder=""
required>
<!-- <option value="">Select Status</option> -->
<option value="NORMAL" <?php if (strcmp($des, 'NORMAL') == 0) {
echo "selected";
} ?>>NORMAL</option>
<option value="WEAK" <?php if (strcmp($des, 'WEAK') == 0) {
echo "selected";
} ?>>WEAK</option>
<option value="SICK" <?php if (strcmp($des, 'SICK') == 0) {
echo "selected";
} ?>>SICK</option>
</select>
</div>
<input class=" form-control" type='hidden' name="certificate_type"
id="certificate_type" placeholder="Certificate Type"
value="<?= $certificate_type ?>">
<div class="col-sm-3">
<label for="sickness">Approval Status</label>
<select class="form-control" name="approval_status"
id="approval_status">
<!-- <option value="">Select Status</option> -->
<option value="APPROVED" <?php if ($fitness_status == 'APPROVED') { ?>selected<?php } ?>>
Approved Fit
</option>
<option value="REVIEW" <?php if ($fitness_status == 'REVIEW') { ?>selected<?php } ?>>
Temporary
Unfit-review Later</option>
<option value="REJECTED" <?php if ($fitness_status == 'REJECTED') { ?>selected<?php } ?>>
Unfit
</option>
<option value="ROLE CHANGE SUGGESTED" <?php if ($fitness_status == 'ROLE CHANGE SUGGESTED') { ?>selected<?php } ?>>
Role Change Suggested</option>
<option value="RETURN BACK TO WORK" <?php if ($fitness_status == 'RETURN BACK TO WORK') { ?>selected<?php } ?>>Return Back To Work</option>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-12 table-responsive">
<div class="widget-box box box-success">
<div class="widget-body">
<div class="widget-main">
<div class="row">
<div class="col-xs-12">
<div class="col-sm-3">
<label class="control-label" for="referral_point"><strong
style="font-size: 11px">Referral</strong></label>
<div>
<select class="form-control select2" id="referral_point"
name="referral_point" data-placeholder="Referral">
<option value="" disabled selected>Please select an option
</option>
<!-- <?= generateOption("referral_point", "referral_point_name", "referral_point_id", $row['referral'], "") ?> -->
<?php
$sql_driver = "SELECT CONCAT(referral_point_name ,' - ',city , ' ( ' , hospital_name ,')') AS referral_point_name , referral_point_id from referral_point where ohc_type ='" . $_SESSION['current_ohcttype'] . "' ";
error_log($sql_driver . "get_ref_data");
generate_options($sql_driver, $row['referral'], 'referral_point_id', 'referral_point_name', '', '');
?>
</select>
</div>
</div>
<div class="col-sm-3">
<label class="control-label" for="referral_point"><strong
style="font-size: 11px">Referral Reason</strong></label>
<div>
<input class="form-control" id="referral_doc" name="referral_doc"
data-placeholder="Referral Doctor"
value="<?php echo $row['referral_doc'] ?>">
</input>
</div>
</div>
<div class="col-sm-3">
<label class="control-label" for="additional_advices"><strong
style="font-size: 11px"> Ambulance Out Time:</strong></label>
<div class="input-group" id="discharge">
<input id="ambulance_out_time" type="text" class="form-control"
style="height: 30px" name="ambulance_out_time" /> <span
class="input-group-addon"> <i style="height: 5px"
class="fa fa-clock-o bigger-110"></i>
</span>
</div>
</div>
<div class="col-sm-3">
<label class="control-label" for="additional_advices"><strong
style="font-size: 11px"> Ambulance In Time:</strong></label>
<div class="input-group" id="discharge">
<input id="ambulance_in_time" type="text" class="form-control"
style="height: 30px" name="ambulance_in_time" /> <span
class="input-group-addon"> <i style="height: 5px"
class="fa fa-clock-o bigger-110"></i>
</span>
</div>
</div>
<!-- <div class="col-sm-3">
<label class="control-label" for="additional_advices"><strong style="font-size: 11px">Ambulance Used: Yes/No</strong></label>
<select class="form-control" id="ambulance_used" name="ambulance_used">
<option value="" disabled selected>Please select an option</option>
<option value="Y" <?php if (strcmp($row['ambulance_used'], 'Y') == 0) {
echo "selected";
} ?>>
Yes</option>
<option value="N" <?php if (strcmp($row['ambulance_used'], 'N') == 0) {
echo "selected";
} ?>>
No</option>
</select>
</div> -->
</div>
<div class="col-xs-12">
<div class="col-sm-3">
<label class="control-label" for="referral_point"><strong
style="font-size: 11px">Is
Hospitalized?</strong></label>
<div>
<select name="is_hospitalized" id="is_hospitalized"
class="form-control">
<option value="">--select--</option>
<option <?php if ($row['is_hospitalized'] == 'Y') {
echo "selected";
} ?> value="Y">Yes</option>
<option <?php if ($row['is_hospitalized'] == 'N') {
echo "selected";
} ?> value="N">No</option>
</select>
</div>
</div>
<div class="col-sm-3">
<label class="control-label" for="referral_point"><strong
style="font-size: 11px"> Referral Conclusion </strong></label>
<div>
<textarea class="form-control" rows="3" cols="4"
id="referral_consultation" name="referral_consultation"
placeholder="Please Enter Referral Conclusion"> <?php echo $row['referral_consultation'] ?></textarea>
</div>
</div>
<!-- <div class="col-sm-3">
<label class="control-label" for="referral_point"><strong
style="font-size: 11px">Additional details(If Patient is
Hospitalized)</strong></label>
<div>
<textarea rows="5" class="form-control" id="referral_hospitalized_remark"
name="referral_hospitalized_remark"
> <?php echo $row['referral_doc'] ?></textarea>
</div>
</div> -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="medDetails" role="dialog">
<div class="modal-dialog modal-lg" style="width: -webkit-fill-available;">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Selected Medicine Info</h4>
</div>
<div class="modal-body">
<table id="med-detail-table" class="table" cellspacing="0" width="100%" border="0">
<thead>
<tr>
<th>Medicine</th>
<th>Precaution</th>
<th>Composition</th>
<th>Indication</th>
<th>Contraindication</th>
<th>Side Effects</th>
<th>Alternates</th>
<th>Prescription Medicine</th>
<th>Interactions</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- Modal for alternate medicine -->
<div id="alternative_med" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">This Medicine is not available in stock.</h4>
</div>
<div class="modal-body">
<h4>Alternate Medicines List..</h4>
<div class="med-content"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</form>
<link rel="stylesheet" href="assets/font-awesome/4.5.0/css/font-awesome.min.css" />
<!-- page specific plugin styles -->
<link rel="stylesheet" href="assets/css/jquery-ui.custom.min.css" />
<link rel="stylesheet" href="assets/css/chosen.min.css" />
<link rel="stylesheet" href="assets/css/bootstrap-datepicker3.min.css" />
<link rel="stylesheet" href="assets/css/bootstrap-timepicker.min.css" />
<link rel="stylesheet" href="assets/css/daterangepicker.min.css" />
<link rel="stylesheet" href="assets/css/bootstrap-datetimepicker.min.css" />
<link rel="stylesheet" href="assets/css/bootstrap-colorpicker.min.css" />
<link rel="stylesheet" href="adminlte/bower_components/bootstrap/less/type.less" />
<script src="assets/js/jquery-ui.custom.min.js"></script>
<script src="assets/js/jquery.ui.touch-punch.min.js"></script>
<script src="assets/js/chosen.jquery.min.js"></script>
<script src="assets/js/spinbox.min.js"></script>
<script src="assets/js/bootstrap-datepicker.min.js"></script>
<script src="assets/js/bootstrap-timepicker.min.js"></script>
<script src="assets/js/jquery.dataTables.min.js"></script>
<script src="assets/js/jquery.dataTables.bootstrap.min.js"></script>
<script src="assets/js/dataTables.buttons.min.js"></script>
<script src="assets/js/buttons.flash.min.js"></script>
<script src="assets/js/buttons.html5.min.js"></script>
<script src="assets/js/buttons.print.min.js"></script>
<script src="assets/js/buttons.colVis.min.js"></script>
<script src="assets/js/dataTables.select.min.js"></script>
<script src="assets/js/moment.min.js"></script>
<script src="assets/js/daterangepicker.min.js"></script>
<script src="assets/js/bootstrap-datetimepicker.min.js"></script>
<script src="assets/js/bootstrap-colorpicker.min.js"></script>
<script src="assets/js/jquery.knob.min.js"></script>
<script src="assets/js/autosize.min.js"></script>
<script src="assets/js/jquery.inputlimiter.min.js"></script>
<script src="assets/js/jquery.maskedinput.min.js"></script>
<script src="assets/js/bootstrap-tag.min.js"></script>
<script src="assets/js/ace-elements.min.js"></script>
<script type="text/javascript">
// to update diagnosis value if config is false
<?php if (!strcmp(strtolower($diagnosis_config), "false")) { ?>
var ailment_names = '<?= $row['ailments_new'] ?>';
dataarray = ailment_names.split(",");
$("#ailment_new").val(dataarray);
$('#ailment_new').trigger('chosen:updated');
<?php } ?>
// to update findings value if config is false
<?php if (!strcmp(strtolower($examination_remarks_config), "false")) { ?>
var examination_finding_names = '<?= $row['examination_remarks'] ?>';
dataarray = examination_finding_names.split(",");
$("#examination_remarks").val(dataarray);
$('#examination_remarks').trigger('chosen:updated');
<?php } ?>
<?php if (!strcmp(strtolower($injury_part_config), "false")) { ?>
var injury_part_names = '<?= $row['injury_parts_new'] ?>';
dataarray = injury_part_names.split(",");
$("#injury_part").val(dataarray);
$('#injury_part').trigger('chosen:updated');
<?php } ?>
<?php if (!strcmp(strtolower($injury_mech_config), "false")) { ?>
var injury_mech_names = '<?= $row['injury_mech'] ?>';
dataarray = injury_mech_names.split(",");
$("#injury_mech").val(dataarray);
$('#injury_mech').trigger('chosen:updated');
<?php } ?>
var recommended_test_new_data = '<?= $row['recommended_tests_new'] ?>';
dataarray_recommended_test_new = recommended_test_new_data.split(",");
console.log(dataarray_recommended_test_new);
$("#recommended_test_new").val(dataarray_recommended_test_new);
$('#recommended_test_new').trigger('chosen:updated');
// to update complaints value if config is false
<?php if (!strcmp(strtolower($complaint_config), "false")) { ?>
var complaint_names = '<?= $row['complaints'] ?>';
dataarray = complaint_names.split(",");
$("#complaints").val(dataarray);
$('#complaints').trigger('chosen:updated');
<?php } ?>
var drug_allergy_names = '<?= $row['drug_allergy'] ?>';
dataarray_drug_allergy = drug_allergy_names.split(",");
$("#drug_allergy").val(dataarray_drug_allergy);
$('#drug_allergy').trigger('chosen:updated');
$('#injury_type_new').trigger("chosen:updated");
$('#injury_part_new').trigger("chosen:updated");
$('#injury_class_new').trigger("chosen:updated");
if (!ace.vars['old_ie']) $('#appointment_date').datetimepicker({
format: 'DD/MM/YYYY h:mm A', //use this option to display seconds
<?php if (isset($row['appointment_date']) && $row['appointment_date'] != '0000-00-00 00:00:00' && ($_REQUEST['followup_id'] != '' && $_REQUEST['followup_id'] != null)) { ?>
defaultDate: new Date("<?php echo $row['appointment_date'] ?>") <?php } else { ?>
defaultDate: new Date() <?php } ?>,
maxDate: new Date(),
icons: {
time: 'fa fa-clock-o',
date: 'fa fa-calendar',
up: 'fa fa-chevron-up',
down: 'fa fa-chevron-down',
previous: 'fa fa-chevron-left',
next: 'fa fa-chevron-right',
today: 'fa fa-arrows ',
clear: 'fa fa-trash',
close: 'fa fa-times'
}
}).next().on(ace.click_event, function () {
$(this).prev().focus();
});
if (!ace.vars['old_ie']) $('#injury_time').datetimepicker({
format: 'DD/MM/YYYY h:mm A', //use this option to display seconds
<?php if ($row['injury_time'] != '') { ?> defaultDate: new Date(
"<?php echo $row['injury_time'] ?>") <?php } else { ?>
defaultDate: new Date() <?php } ?>,
maxDate: new Date(),
icons: {
time: 'fa fa-clock-o',
date: 'fa fa-calendar',
up: 'fa fa-chevron-up',
down: 'fa fa-chevron-down',
previous: 'fa fa-chevron-left',
next: 'fa fa-chevron-right',
today: 'fa fa-arrows ',
clear: 'fa fa-trash',
close: 'fa fa-times'
}
}).next().on(ace.click_event, function () {
$(this).prev().focus();
});
$(document).ready(function () {
$(".glyphicon").css("top", "");
});
function open_treatments(appointment_id) {
$('#modal-add-consultation').modal("show");
}
function getBMI(height, weight) {
//var height=$("#"+heightField).val();
//var weight=$("#"+WeightField).val();
if (height != null && height != '' && weight != null && weight != '') {
height = parseFloat(height);
weight = parseFloat(weight);
if (height != 0.0)
var bmi = (weight / (height / 100 * height / 100));
return bmi.toFixed(1);
}
return "";
}
function calculateBMI() {
var height = $("#height").val();
var weight = $("#weight").val();
$("#bmi").val(getBMI(height, weight));
}
</script>
<script type="text/javascript">
function opd_form(id) {
$("#flex_opd_id").val(id);
$("#flex_form_opd_for").attr('method', 'POST');
$("#flex_form_opd_for").attr('action', 'opd_form.php');
$("#flex_form_opd_for").submit();
}
function convertToOPD() {
$.ajax({
url: 'update_appointment.php',
type: "POST",
data: $("#opd_form").serialize(),
success: function (data) {
BootstrapDialog.alert('Case converted to OPD successfully!');
location.href = "appointment_list.php";
return;
},
error: function (data) {
BootstrapDialog.alert('Error in conversion!');
return;
}
});
$('.close').click();
}
jQuery(function ($) {
$("#forwardButton").on("click", function () {
document.getElementById("forwardButton").style.display = 'none';
document.getElementsByClassName("loader")[0].style.display = 'block';
// var forwardButton = document.getElementById("forwardButton");
// forwardButton.removeEventListener("click", arguments.callee); // Remove the click event listener
// forwardButton.style.pointerEvents = "none"; // Disable pointer events on the link
var ButtonFlagDM = true;
<?php if ($rolecode == 'DOC') { ?>
BootstrapDialog.show({
title: 'Forward',
message: '<select class="form-control" id="forward_status" style="margin-left:100px;width:60%">' +
'<option value="PHP">Forward For Dispense Medicine</option>' +
'<option value="CLS">Save & Close</option>',
buttons: [{
label: 'OK',
action: function () {
if (ButtonFlagDM) {
$("#attendedStatus").val($("#forward_status").val());
validate_update('opd_form',
'<?php echo $row['appointment_id'] ?>');
console.log(" ButtonFlagDM TRUE ", ButtonFlagDM);
ButtonFlagDM = false;
} else {
console.log(" ButtonFlagDM FALSE ", ButtonFlagDM);
}
}
}, {
label: 'Cancel',
action: function () {
document.getElementById("forwardButton").style.display = 'block';
document.getElementsByClassName("loader")[0].style.display = 'none';
$(".modal-header .close").click();
}
}]
});
<?php } else if ($rolecode == $__ROLE_DISPENSARY || in_array('DIS', explode(',', $rolecode))) { ?>
BootstrapDialog.show({
title: 'Forward',
message: '<select class="form-control" id="forward_status" style="margin-left:100px;width:60%">' +
'<option value="DRP">Forward To Doctor</option>' +
'<option value="CLS">Save & Close</option>',
buttons: [{
label: 'OK',
action: function () {
if (ButtonFlagDM) {
$("#attendedStatus").val($("#forward_status").val());
validate_update('opd_form',
'<?php echo $row['appointment_id'] ?>')
console.log(" ButtonFlagDM TRUE ", ButtonFlagDM);
ButtonFlagDM = false;
} else {
console.log(" ButtonFlagDM FLASE", ButtonFlagDM);
}
}
}, {
label: 'Cancel',
action: function () {
document.getElementById("forwardButton").style.display = 'block';
document.getElementsByClassName("loader")[0].style.display = 'none';
$(".modal-header .close").click();
}
}]
});
<?php } ?>
});
$('#id-disable-check').on('click', function () {
var inp = $('#form-input-readonly').get(0);
if (inp.hasAttribute('disabled')) {
inp.setAttribute('readonly', 'true');
inp.removeAttribute('disabled');
inp.value = "This text field is readonly!";
} else {
inp.setAttribute('disabled', 'disabled');
inp.removeAttribute('readonly');
inp.value = "This text field is disabled!";
}
});
if (!ace.vars['touch']) {
$('.chosen-select').chosen({
allow_single_deselect: true
});
//resize the chosen on window resize
$(window)
.off('resize.chosen')
.on('resize.chosen', function () {
$('.chosen-select').each(function () {
var $this = $(this);
$this.next().css({
'width': $this.parent().width()
});
})
}).trigger('resize.chosen');
//resize chosen on sidebar collapse/expand
$(document).on('settings.ace.chosen', function (e, event_name, event_val) {
if (event_name != 'sidebar_collapsed') return;
$('.chosen-select').each(function () {
var $this = $(this);
$this.next().css({
'width': $this.parent().width()
});
})
});
$('#chosen-multiple-style .btn').on('click', function (e) {
var target = $(this).find('input[type=radio]');
var which = parseInt(target.val());
if (which == 2) $('#form-field-select-4').addClass('tag-input-style');
else $('#form-field-select-4').removeClass('tag-input-style');
});
}
$('[data-rel=tooltip]').tooltip({
container: 'body'
});
$('[data-rel=popover]').popover({
container: 'body'
});
autosize($('textarea[class*=autosize]'));
$('textarea.limited').inputlimiter({
remText: '%n character%s remaining...',
limitText: 'max allowed : %n.'
});
//datepicker plugin
//link
$('.date-picker').datepicker({
autoclose: true,
todayHighlight: true
})
//show datepicker when clicking on the icon
.next().on(ace.click_event, function () {
$(this).prev().focus();
});
//or change it into a date range picker
$('.input-daterange').datepicker({
autoclose: true
});
//to translate the daterange picker, please copy the "examples/daterange-fr.js" contents here before initialization
$('input[name=date-range-picker]').daterangepicker({
'applyClass': 'btn-sm btn-success',
'cancelClass': 'btn-sm btn-default',
locale: {
applyLabel: 'Apply',
cancelLabel: 'Cancel',
}
})
.prev().on(ace.click_event, function () {
$(this).next().focus();
});
$('#timepicker1').timepicker({
minuteStep: 1,
showSeconds: true,
showMeridian: false,
disableFocus: true,
icons: {
up: 'fa fa-chevron-up',
down: 'fa fa-chevron-down'
}
}).on('focus', function () {
$('#timepicker1').timepicker('showWidget');
}).next().on(ace.click_event, function () {
$(this).prev().focus();
});
if (!ace.vars['old_ie']) $('#appointment_date').datetimepicker({
format: 'DD/MM/YYYY h:mm A', //use this option to display seconds
<?php if (isset($row['appointment_date']) && $row['appointment_date'] != '0000-00-00 00:00:00' && ($_REQUEST['followup_id'] != '' && $_REQUEST['followup_id'] != null)) { ?>
defaultDate : new Date("<?php echo $row['appointment_date'] ?>"),
<?php } else { ?>
defaultDate : new Date(),
<?php } ?>
maxDate : new Date(),
icons: {
time: 'fa fa-clock-o',
date: 'fa fa-calendar',
up: 'fa fa-chevron-up',
down: 'fa fa-chevron-down',
previous: 'fa fa-chevron-left',
next: 'fa fa-chevron-right',
today: 'fa fa-arrows ',
clear: 'fa fa-trash',
close: 'fa fa-times'
}
}).next().on(ace.click_event, function () {
$(this).prev().focus();
});
if (!ace.vars['old_ie']) $('#injury_time').datetimepicker({
format: 'DD/MM/YYYY h:mm A', //use this option to display seconds
defaultDate: new Date(),
maxDate: new Date(),
icons: {
time: 'fa fa-clock-o',
date: 'fa fa-calendar',
up: 'fa fa-chevron-up',
down: 'fa fa-chevron-down',
previous: 'fa fa-chevron-left',
next: 'fa fa-chevron-right',
today: 'fa fa-arrows ',
clear: 'fa fa-trash',
close: 'fa fa-times'
}
}).next().on(ace.click_event, function () {
$(this).prev().focus();
});
if (!ace.vars['old_ie']) $('#out_time').datetimepicker({
format: 'DD/MM/YYYY h:mm A', //use this option to display seconds
// defaultDate: new Date(),
<?php if (isset($row['clearance_time']) && $row['clearance_time'] != '0000-00-00 00:00:00' && ($_REQUEST['followup_id'] != '' && $_REQUEST['followup_id'] != null)) { ?>
defaultDate: new Date("<?php echo $row['clearance_time'] ?>"),
<?php } ?>
maxDate: new Date(new Date().setDate(new Date().getDate() + 30)),
icons: {
time: 'fa fa-clock-o',
date: 'fa fa-calendar',
up: 'fa fa-chevron-up',
down: 'fa fa-chevron-down',
previous: 'fa fa-chevron-left',
next: 'fa fa-chevron-right',
today: 'fa fa-arrows ',
clear: 'fa fa-trash',
close: 'fa fa-times'
}
}).next().on(ace.click_event, function () {
$(this).prev().focus();
});
if (!ace.vars['old_ie']) $('#ambulance_in_time').datetimepicker({
format: 'DD/MM/YYYY h:mm A', //use this option to display seconds
<?php if (isset($row['ambulance_in_time']) && $row['ambulance_in_time'] != '0000-00-00 00:00:00') { ?>
defaultDate: new Date("<?php echo $row['ambulance_in_time'] ?>"),
<?php } ?>
maxDate: new Date(new Date().setDate(new Date().getDate() + 30)),
icons: {
time: 'fa fa-clock-o',
date: 'fa fa-calendar',
up: 'fa fa-chevron-up',
down: 'fa fa-chevron-down',
previous: 'fa fa-chevron-left',
next: 'fa fa-chevron-right',
today: 'fa fa-arrows ',
clear: 'fa fa-trash',
close: 'fa fa-times'
}
}).next().on(ace.click_event, function () {
$(this).prev().focus();
});
if (!ace.vars['old_ie']) $('#ambulance_out_time').datetimepicker({
format: 'DD/MM/YYYY h:mm A', //use this option to display seconds
<?php if (isset($row['ambulance_out_time']) && $row['ambulance_out_time'] != '0000-00-00 00:00:00') { ?>
defaultDate: new Date("<?php echo $row['ambulance_out_time'] ?>"),
<?php } ?>
maxDate: new Date(new Date().setDate(new Date().getDate() + 30)),
icons: {
time: 'fa fa-clock-o',
date: 'fa fa-calendar',
up: 'fa fa-chevron-up',
down: 'fa fa-chevron-down',
previous: 'fa fa-chevron-left',
next: 'fa fa-chevron-right',
today: 'fa fa-arrows ',
clear: 'fa fa-trash',
close: 'fa fa-times'
}
}).next().on(ace.click_event, function () {
$(this).prev().focus();
});
if (!ace.vars['old_ie']) $('#rest_to_time').datetimepicker({
format: 'DD/MM/YYYY h:mm A', //use this option to display seconds
<?php if (isset($row['rest_to_time']) && $row['rest_to_time'] != '0000-00-00 00:00:00') { ?>
defaultDate: new Date("<?php echo $row['rest_to_time'] ?>"),
<?php } ?>
maxDate: new Date(new Date().setDate(new Date().getDate() + 30)),
// endDate: '+30d',
icons: {
time: 'fa fa-clock-o',
date: 'fa fa-calendar',
up: 'fa fa-chevron-up',
down: 'fa fa-chevron-down',
previous: 'fa fa-chevron-left',
next: 'fa fa-chevron-right',
today: 'fa fa-arrows ',
clear: 'fa fa-trash',
close: 'fa fa-times'
}
}).next().on(ace.click_event, function () {
$(this).prev().focus();
});
if (!ace.vars['old_ie']) $('#rest_from_time').datetimepicker({
format: 'DD/MM/YYYY h:mm A', //use this option to display seconds
<?php if (isset($row['rest_from_time']) && $row['rest_from_time'] != '0000-00-00 00:00:00') { ?>
defaultDate: new Date("<?php echo $row['rest_from_time'] ?>"),
<?php } ?>
maxDate: new Date(new Date().setDate(new Date().getDate() + 30)),
// endDate: '+30d',
icons: {
time: 'fa fa-clock-o',
date: 'fa fa-calendar',
up: 'fa fa-chevron-up',
down: 'fa fa-chevron-down',
previous: 'fa fa-chevron-left',
next: 'fa fa-chevron-right',
today: 'fa fa-arrows ',
clear: 'fa fa-trash',
close: 'fa fa-times'
}
}).next().on(ace.click_event, function () {
$(this).prev().focus();
});
// if (!ace.vars['old_ie']) $('#followup').datetimepicker({
// format: 'DD/MM/YYYY', //use this option to display seconds
// <?php if (isset($row['followup']) && $row['followup'] != '0000-00-00' && $row['followup'] != null) { ?>
// defaultDate: new Date("<?php echo $row['followup'] ?>"),
// <?php } ?>
// maxDate: new Date(new Date().setDate(new Date().getDate() + 30)),
// // endDate: '+30d',
// icons: {
// time: 'fa fa-clock-o',
// date: 'fa fa-calendar',
// up: 'fa fa-chevron-up',
// down: 'fa fa-chevron-down',
// previous: 'fa fa-chevron-left',
// next: 'fa fa-chevron-right',
// today: 'fa fa-arrows ',
// clear: 'fa fa-trash',
// close: 'fa fa-times'
// }
// }).next().on(ace.click_event, function() {
// $(this).prev().focus();
// });
$(document).one('ajaxloadstart.page', function (e) {
autosize.destroy('textarea[class*=autosize]')
$('.limiterBox,.autosizejs').remove();
$('.daterangepicker.dropdown-menu,.colorpicker.dropdown-menu,.bootstrap-datetimepicker-widget.dropdown-menu')
.remove();
});
});
function exporttopdf() {
var appointment_id_pdf = $("#appointment_id").val();
//alert(appointment_id_pdf);
window.open('injury_form_pdf.php?appointment_id_pdf=' + appointment_id_pdf + '');
}
function add_consume() {
$('#consumables').modal("show");
}
function add_ambulance_stock(){
$('#miscellaneous_stock').modal("show");
}
function showDetail(value) {
if (value == 'Y') {
$("#is_admitted").hide();
$("#discharge").show();
} else {
$("#is_admitted").show();
$("#discharge").hide();
}
}
function loadTestParamData() {
let recommendedTestData = $("#recommended_test_new").val();
console.log(recommendedTestData);
if (recommendedTestData) {
$.ajax({
async: 'false',
type: 'post',
url: 'get_parameter_based_on_section.php',
data: {
sectionIds: recommendedTestData
},
success: function (data) {
data = JSON.parse(data);
console.log(data);
$('#recommended_test_param_new').empty();
// Create a placeholder option
// $('#recommended_test_param_new').append($('<option>', {
// value: '',
// text: '--select--'
// }));
$.each(data, function (sectionId, parameters) {
$.each(parameters, function (index, parameter) {
// Create an option element
var parameterName = parameter.parameter_name.toLowerCase();
var option = $('<option>', {
value: parameter.checkup_parameter_id,
text: parameterName
});
// Append the option to the select element
$('#recommended_test_param_new').append(option);
});
});
// Update the Chosen plugin to reflect the changes
$('#recommended_test_param_new').trigger('chosen:updated');
<?php if ($row['recommended_test_param_new'] != '' && $row['recommended_test_param_new'] != null) { ?>
var recommended_test_new_param = '<?= $row['recommended_test_param_new'] ?>';
dataarray_recommended_test_new_param = recommended_test_new_param.split(",");
console.log(dataarray_recommended_test_new_param);
$("#recommended_test_param_new").val(dataarray_recommended_test_new_param);
$('#recommended_test_param_new').trigger('chosen:updated');
<?php } ?>
},
error: function (data) {
console.log("error");
}
});
} else {
$('#recommended_test_param_new').empty();
$('#recommended_test_param_new').trigger('chosen:updated');
}
}
// function abnormality_selecter() {
// var data_emp_id = '<?= $row['abnormalitys'] ?>';
// if (data_emp_id != "" || data_emp_id != null)
// emp_ids = data_emp_id.split(",");
// var element = document.getElementById('abnormality');
// for (var i = 0; i < element.options.length; i++) {
// element.options[i].selected = emp_ids.indexOf(element.options[i].value) >= 0;
// }
// $('#abnormality').trigger('chosen:updated');
// }
// function selectAb() {
// $("#abnormalityIds").val($('#abnormality').val());
// }
// window.onload = abnormality_selecter();
</script>
<?php include ('opd_injury_common_code.php'); ?>
<?php include ('consumables.php'); ?>
<?php include ('miscellaneous_stock.php'); ?>
<script>
$(document).ready(function () {
<?php //include('search_template.php');
if ($saved_ohc_id != $_SESSION['current_ohcttype']) {
error_log("saved ohc " . $saved_ohc_id . " curr ohc " . $_SESSION['current_ohcttype']) ?>
disableTreatmentTable();
<?php
}
?>
function disableTreatmentTable() {
console.log("row " + num_rows_treatment);
for (let row_count = 0; row_count < num_rows_treatment; row_count++) {
console.log(row_count);
document.getElementById('treatment_item_' + row_count).disabled = 'true';
document.getElementById('treatment_item_dosage_' + row_count).disabled = 'true';
document.getElementById('timings_' + row_count).disabled = 'true';
document.getElementById('treatment_item_dosage_category_' + row_count).disabled = 'true';
document.getElementById('treatment_item_days_' + row_count).readOnly = true;
document.getElementById('dose_qty_' + row_count).readOnly = true;
document.getElementById('treatment_item_qtygvn_' + row_count).readOnly = true;
}
if (rolecode == 'DIS') {
document.getElementById('doctor_discussed_yes').disabled = 'true';
document.getElementById('doctor_discussed_no').disabled = 'true';
}
}
loadTestParamData();
});
function rest_to(val) {
$('#rest_to_time').val(val);
}
function rest_from(val) {
$('#rest_from_time').val(val);
}
$('#date_absent').datepicker({
format: 'dd/mm/yyyy',
endDate: "+1d"
})
<?php if ($past_date_absent != '' && $past_date_absent != null) { ?>
$('#date_absent').datepicker("setDate", new Date("<?php echo $past_date_absent ?>"))
<?php } ?>;
$('#date_absent_to').datepicker({
format: 'dd/mm/yyyy'
});
<?php if (isset($past_date_absent_to) && $past_date_absent_to != '' && $past_date_absent_to != null) { ?>
$('#date_absent_to').datepicker("setDate", new Date("<?php echo $past_date_absent_to ?>"))
<?php } ?>;
<?php if ($doctor_discussed_id != 0) { ?>
$("#doc_discuss_div").toggle();
<?php } ?>
$('#approval_date').datepicker({
format: 'dd/mm/yyyy', //use this option to display seconds
// endDate: "+1d",
//minDate: new Date()-10,
icons: {
time: 'fa fa-clock-o',
date: 'fa fa-calendar',
up: 'fa fa-chevron-up',
down: 'fa fa-chevron-down',
previous: 'fa fa-chevron-left',
next: 'fa fa-chevron-right',
today: 'fa fa-arrows ',
clear: 'fa fa-trash',
close: 'fa fa-times'
}
});
</script>
<?php
include "upload_injury_photos.php";
?>