2498 lines
113 KiB
PHP
2498 lines
113 KiB
PHP
<link rel="stylesheet" href="assets/font-awesome/4.5.0/css/font-awesome.min.css" />
|
|
|
|
<!-- page specific pl styles -->
|
|
<!-- <link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> -->
|
|
<link href="css/fonts/mulish_fonts.css" rel="stylesheet">
|
|
<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>
|
|
|
|
<link rel="stylesheet" href="custom-opd.css" />
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
$(".glyphicon").css("top", "");
|
|
|
|
|
|
});
|
|
|
|
function open_treatments(appointment_id) {
|
|
$('#modal-add-consultation').modal("show");
|
|
|
|
}
|
|
</script>
|
|
<?php
|
|
include('includes/config/config.php');
|
|
$rolecode = $_SESSION['RoleCode'];
|
|
|
|
if (isset($_REQUEST['appointmentId'])) {
|
|
$sql = "select * from employee_appointment where appointment_id='" . $_REQUEST['appointmentId'] . "'";
|
|
// echo "query:".$sql;
|
|
$result = mysqli_query($conn, $sql);
|
|
$num_rows = @mysqli_num_rows($result);
|
|
$row = null;
|
|
|
|
// echo fhfh;
|
|
if ($num_rows > 0) {
|
|
$row = @mysqli_fetch_array($result);
|
|
}
|
|
$sql_for_treatment = "select * from treatment where appointment_id='" . $_REQUEST['appointmentId'] . "' 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='" . $_REQUEST['appointmentId'] . "'";
|
|
$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")) {
|
|
|
|
$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;
|
|
}
|
|
} else {
|
|
|
|
if ($id == null || $id == '' || empty($id)) {
|
|
$id = $_REQUEST['direct_patient_id'];
|
|
error_log("id is inside if " . $id);
|
|
}
|
|
error_log("id is " . $id);
|
|
$sql = "select * from patient_master where id='" . $id . "'";
|
|
error_log("query:" . $sql);
|
|
$result = mysqli_query($conn, $sql);
|
|
$num_rows = @mysqli_num_rows($result);
|
|
$row = null;
|
|
|
|
// echo fhfh;
|
|
if ($num_rows > 0) {
|
|
$row = @mysqli_fetch_array($result);
|
|
error_log("in side");
|
|
}
|
|
}
|
|
?>
|
|
<script>
|
|
var rolecode = '<?php echo $_SESSION['RoleCode'] ?>';
|
|
var num_rows_treatment = <?php echo $num_rows_treatment > 0 ? $num_rows_treatment : 0 ?>;
|
|
var num_rows_treatment_external = <?php echo $num_rows_treatment_external > 0 ? $num_rows_treatment_external : 0 ?>;
|
|
</script>
|
|
|
|
|
|
|
|
<form id="opd_form" method="post">
|
|
<div class="widget-header" data-action="fullscreen">
|
|
<h5 class="widget-title">Patient OPD > <?php echo $patient_name ?> <a target="_blank"
|
|
href="emp_dashboard.php?flex_patient_id=<?php echo $row['emp_id'] ?>"><i style="font-size: 17px;"
|
|
class="glyphicon glyphicon-user"></i></a>
|
|
</h5>
|
|
|
|
<br>
|
|
|
|
<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"
|
|
style="float: left;" onclick="add_consume();"><i class="fa fa-medkit bigger-110 red"
|
|
onclick="add_consume();"></i>CONSUMABLES</a>
|
|
|
|
<a href="<?php echo $_REQUEST['returnPage'] . '&backButon=back' ?>"
|
|
class="dt-button buttons-csv buttons-html5 btn btn-white btn-primary btn-bold save_button"
|
|
style="float: left;">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 green"></i> <span
|
|
class="hidden">Save</span></span></a>
|
|
|
|
<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>
|
|
|
|
<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') { ?> value="<?php echo $__STATUS_PHARMACY_ATTENDED ?>"
|
|
<?php } ?> />
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="tab-content profile-edit-tab-content">
|
|
<div class="tab-pane fade in active" id="accordion1">
|
|
|
|
|
|
<div id="user-profile-2">
|
|
<div class="box-body">
|
|
<div class="items">
|
|
<label for="appointment_date">In Time</label>
|
|
<div class="input-group">
|
|
<input id="appointment_date" type="text" class="form-control" name="appointment_date" />
|
|
<span class="input-group-addon">
|
|
<i class="fa fa-clock-o bigger-110"></i>
|
|
</span>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label for="case_no">Case No.</label>
|
|
|
|
<input type="text" readonly name="ticket_no" id="ticket_no" class="form-control"
|
|
value=" <?= creatingTicketNoOPD(); ?>">
|
|
</div>
|
|
<div class="items">
|
|
<label for="out_time">Time Out</label>
|
|
<div class="input-group">
|
|
<input id="out_time" type="text" class="form-control" name="out_time" />
|
|
<span class="input-group-addon">
|
|
<i class="fa fa-clock-o bigger-110"></i>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="shift_type">Shift
|
|
</label>
|
|
|
|
<select class="form-control select2" id="shift_type" name="shift_type">
|
|
<option value="A">A</option>
|
|
<option value="B">B</option>
|
|
<option value="C">C</option>
|
|
<option value="G">G</option>
|
|
</select>
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="case_type">Case type</label>
|
|
|
|
|
|
<select class="form-control" id="case_type" name="case_type">
|
|
<option value="">None</option>
|
|
<?php echo generateOption('case_type_master', 'case_type', 'id', '', '') ?>
|
|
</select>
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="referred_by"><strong style="font-size: 11px">Directed
|
|
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>
|
|
<div class="items">
|
|
<label class="control-label" for="referred_by_emp"><strong style="font-size: 11px">Directed
|
|
By Name</strong></label>
|
|
<br>
|
|
|
|
|
|
|
|
<select class="form-control" id="referred_by_emp" name="referred_by_emp"
|
|
onchange="showMobNo(this.value)">
|
|
<option value="" disabled selected>Please select an option
|
|
</option>
|
|
<?php echo generateOption('patient_master', 'patient_name', 'id', $row['referred_by_emp'], '') ?>
|
|
</select>
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="referred_by_contact"><strong style="font-size: 11px">Directed
|
|
By Mobile No.</strong></label>
|
|
<br>
|
|
|
|
|
|
|
|
<input type="tel" class="form-control" id="referred_by_contact" name="referred_by_contact"
|
|
value="<?= $row['referred_by_contact'] ?>" />
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="followup_to_opd">Directed to OHC for reason
|
|
</label>
|
|
|
|
|
|
<select class="form-control" id="referred_reason" name="referred_reason">
|
|
<option value="">None</option>
|
|
<option value="RD" <?php if (strcmp($row['referred_reason'], 'RD') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Routine Disease</option>
|
|
<option value="JFC" <?php if (strcmp($row['referred_reason'], 'JFC') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Joining Fitness Certification</option>
|
|
<option value="SLC" <?php if (strcmp($row['referred_reason'], 'SLC') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Sick Leave Certification</option>
|
|
<option value="IF" <?php if (strcmp($row['referred_reason'], 'IF') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Incidental Finding</option>
|
|
<option value="PI" <?php if (strcmp($row['referred_reason'], 'PI') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Psychological Issues</option>
|
|
<option value="QI" <?php if (strcmp($row['referred_reason'], 'QI') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Quality Issues</option>
|
|
<option value="SC" <?php if (strcmp($row['referred_reason'], 'SC') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Safety Concern</option>
|
|
</select>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="tab-pane fade in " id="accordion2">
|
|
|
|
|
|
<div id="user-profile-2">
|
|
<div class="box-body">
|
|
<?php
|
|
$emp_his = "select * from patient_master where id = '" . $row['emp_id'] . "'";
|
|
$res = mysqli_query($conn, $emp_his);
|
|
$row_his = mysqli_fetch_assoc($res);
|
|
?>
|
|
<div class="emp-details">
|
|
<div class="items">
|
|
<label for="emp_code">Emp No.</label>
|
|
<span><?= $row_his['emp_code'] ?></span>
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label for="case_no">Mobile No.</label>
|
|
<span><?= $row_his['primary_phone'] ?></span>
|
|
</div>
|
|
<div class="items">
|
|
<label for="out_time">Name</label>
|
|
<span><?= $row_his['patient_name'] ?></span>
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="employer_contractor_id">Employment (Employee /
|
|
External
|
|
Agency)
|
|
</label>
|
|
|
|
<span><?= getFieldFromTable('employer_contractor_name', 'employer_contractor', 'id', $row_his['employer_contractor_id']); ?></span>
|
|
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="designation">Designation</label>
|
|
<span><?= getFieldFromTable('designation_name', 'designation', 'designation_id', $row_his['designation_id']); ?></span>
|
|
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="referred_by"><strong
|
|
style="font-size: 11px">Location</strong></label>
|
|
<span><?= getFieldFromTable('branch_name', 'branch', 'branch_id', $row_his['deployment_location']); ?></span>
|
|
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="unit">Unit</label>
|
|
<span><?= getFieldFromTable('bu_name', 'bussiness_unit', 'bu_id', $row['bu_id']); ?></span>
|
|
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="plant">Plant</label>
|
|
<span><?= getFieldFromTable('plant', 'plant_master', 'plant_id', $row_his['plant']); ?></span>
|
|
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="department">Department
|
|
</label>
|
|
<span><?= getFieldFromTable('dept_name', 'department', 'dept_id', $row_his['dept_id']); ?></span>
|
|
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="work_station">Area /Work Station
|
|
</label>
|
|
<span><?= getFieldFromTable('sub_section_name', 'sub_section', 'sub_section_id', $row['sub_section_id']); ?></span>
|
|
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label class="control-label" for="from">From
|
|
</label>
|
|
<span><?= $row_his['doj']; ?></span>
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label class="control-label" for="to">To
|
|
</label>
|
|
<span>Current</span>
|
|
</div>
|
|
|
|
|
|
<div class="items">
|
|
<label class="control-label" for="R/NR/E/M">R/NR/E/M
|
|
</label>
|
|
<span><?= $row[''] ?></span>
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label for="history">Employment History</label>
|
|
<button type="button" class="btn btn-info btn-lg" data-toggle="modal"
|
|
data-target="#empHistory">Show</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="emp-training">
|
|
<table cellspacing="0" border="1" class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Engagement</th>
|
|
<th>EMT</th>
|
|
<th>First Aider</th>
|
|
<th>Height Work</th>
|
|
<th>CS</th>
|
|
<th>Noise</th>
|
|
<th>Respiratory</th>
|
|
<th>Wielding</th>
|
|
<th>HD 1</th>
|
|
<th>HD 2</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
Last Training
|
|
</td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
Next Training Due Date
|
|
</td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
Last Examination
|
|
</td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
Next Due Date - Examination
|
|
</td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="tab-pane fade in" id="accordion3">
|
|
<div id="user-profile-2">
|
|
<div class="box-body">
|
|
|
|
<div class="items">
|
|
<label for="emp_code">Height(Cm)</label>
|
|
|
|
<input id="height" type="number" min="0" max="1000" class="form-control" name="height"
|
|
placeholder="Height" value="<?= $row['height'] ?>" onchange="calculateBMI()" />
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label for="weight">Weight(Kg)</label>
|
|
|
|
<input id="weight" type="number" min="0" max="1000" class="form-control" name="weight"
|
|
placeholder="Weight" value="<?= $row['weight'] ?>" onchange="calculateBMI()" />
|
|
|
|
</div>
|
|
<div class="items">
|
|
<label for="bmi">BMI</label>
|
|
|
|
<input id="bmi" type="number" min="0" max="1000" class="form-control" name="bmi"
|
|
placeholder="Bmi" value="<?= $row['bmi'] ?>" />
|
|
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="heart_rate">Heart Rate/Min
|
|
</label>
|
|
|
|
<input id="heart_rate" type="number" min="0" max="1000" class="form-control" name="heart_rate"
|
|
placeholder="Rate" value="<?= $row['heart_rate'] ?>" />
|
|
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="sbp">SBP (mm of hg)</label>
|
|
<input id="sbp" type="text" class="form-control" name="sbp" placeholder="SBP"
|
|
value="<?= $row['bp_sbp'] ?>" />
|
|
</div>
|
|
|
|
|
|
<div class="items">
|
|
<label class="control-label" for="dbp">DBP (mm of hg)</label>
|
|
<input id="dbp" type="text" class="form-control" name="dbp" placeholder="DBP"
|
|
value="<?= $row['bp_dbp'] ?>" />
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="respiratory_rate">Respiratory Rate
|
|
</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="items">
|
|
<label class="control-label" for="mobility">Mobility</label>
|
|
<input type="number" min="0" max="1000" class="form-control" id="mobility" name="mobility"
|
|
placeholder="Mobility" value="<?php echo $row['mobility'] ?>" maxlength="10">
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="orientation_to_tpp">Orientation to time place
|
|
person</label>
|
|
<select name="orientation_to_tpp" id="orientation_to_tpp" class="form-control">
|
|
<option value="" selected>select any option</option>
|
|
<option value="Y" <?php if (strcmp($row['orientation_to_tpp'], 'Y') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Yes</option>
|
|
<option value="N" <?php if (strcmp($row['orientation_to_tpp'], 'N') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
No</option>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="tep">Temperature(f)
|
|
</label>
|
|
|
|
<input id="temperature" type="text" class="form-control" name="temperature" placeholder="Temp"
|
|
value="<?= $row['temperature'] ?>" />
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="spor">SPO2 (%)</label>
|
|
<input type="number" min="0" max="1000" class="form-control" id="spoc2_percent"
|
|
placeholder="Spo2" value="<?= $row['spo2_percent'] ?>" name="spoc2_percent" maxlength="10">
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="fbs">FBS (mg/dl)</label>
|
|
<input type="number" class="form-control" min="0" max="1000" placeholder="Fbs" id="fbs"
|
|
name="fbs" placeholder="Height" value="<?= $row['blood_sugar_fbs'] ?>">
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="rbs">RBS (mg/dl)</label>
|
|
<input type="number" class="form-control" min="0" max="1000" placeholder="Rbs" id="rbs"
|
|
name="rbs" value="<?= $row['blood_sugar_rbs'] ?>">
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="ppbs">PPBS (mg/dl)</label>
|
|
<input type="number" class="form-control" min="0" max="1000" placeholder="PPBS" id="ppbs"
|
|
name="ppbs" value="<?= $row['blood_sugar_ppbs'] ?>">
|
|
</div>
|
|
|
|
<div class="items">
|
|
|
|
|
|
<label class="control-label" for="c/c">C/C</label>
|
|
|
|
<select class="form-control chosen-select" name="complaints[]" id="complaints" multiple>
|
|
<?php echo generateOption('complaints', 'complaint', 'complaint_id', '', '') ?>
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label class="control-label" for="sen">Systemic Examination Notes</label>
|
|
<textarea name="sen_notes" id="sen_notes" cols="30"
|
|
rows="5"><?= $row['sen_notes'] ?> </textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="tab-pane fade in " id="accordion4">
|
|
<div id="user-profile-2">
|
|
<div class="box-body">
|
|
<div class="items">
|
|
|
|
<label class="control-label" for="hospitalization">Major Hospitalization</label>
|
|
<span><?php echo getCommaSeperatedValuesForInClause("SELECT hospitalization_name FROM major_hospitalization", 'hospitalization_id', $row_his['major_hospitalization']); ?></span>
|
|
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label class="control-label" for="accident_trauma">Accident Trauma</label>
|
|
|
|
<span><?php echo getCommaSeperatedValuesForInClause("SELECT trauma_name FROM accident_trauma", 'trauma_id', $row_his['accident_trauma']); ?></span>
|
|
</div>
|
|
|
|
<div class="items">
|
|
|
|
<label class="control-label" for="ongoing_medication">Ongoing Medication</label>
|
|
|
|
|
|
<span><?php echo getCommaSeperatedValuesForInClause("SELECT medication_name FROM ongoing_medication", 'medication_id', $row_his['ongoing_medication']); ?></span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="items">
|
|
<label class="control-label" for="past_history">Past History</label>
|
|
<!-- <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#pastOhc">Show</button> -->
|
|
<!-- <input type="text" name="work_restriction_reason" id="work_restriction_reason" class="form-control"> -->
|
|
<span></span>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="items">
|
|
<label class="control-label" for="allergies">Allergies</label>
|
|
|
|
<span><?php echo getCommaSeperatedValuesForInClause("SELECT allergy_name FROM allergies", 'allergy_id', $row_his['allergies']); ?></span>
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label class="control-label" for="immunization">Immunization</label>
|
|
|
|
<span><?php echo getCommaSeperatedValuesForInClause("SELECT immunization_name FROM immunization", 'immunization_id', $row_his['immunization']); ?></span>
|
|
</div>
|
|
<div class="items">
|
|
<label class="control-label" for="family_history">Family History</label>
|
|
<button type="button" class="btn btn-info btn-lg" data-toggle="modal"
|
|
data-target="#pastOhc">Show</button>
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label for="history">Past OHC Visits</label>
|
|
<button type="button" class="btn btn-info btn-lg" data-toggle="modal"
|
|
data-target="#pastOhc">Show</button>
|
|
</div>
|
|
<div class="items">
|
|
<label for="sick_leave_history">Sick Leave History</label>
|
|
<button type="button" class="btn btn-info btn-lg" data-toggle="modal"
|
|
data-target="#pastOhc">Show</button>
|
|
</div>
|
|
<div class="items">
|
|
<label for="presenteeism">Presenteeism</label>
|
|
<span><?php echo $row_his['presenteeism'] ?></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="tab-pane fade in" id="accordion5">
|
|
<div id="user-profile-2">
|
|
<div class="box-body">
|
|
|
|
<div class="treatment">
|
|
<div class="treatment-1">
|
|
|
|
<table id="myTable" class="table table-bordered order-list">
|
|
<caption>Provisional Diagnosis</caption>
|
|
<thead>
|
|
<tr>
|
|
<th>Body System</th>
|
|
<th>Provisional Diagnosis</th>
|
|
<th>Associated Hazard</th>
|
|
<th style="text-align: center;"><i class="ace-icon fa fa-plus-square bigger-200"
|
|
id="addrow" style="cursor: pointer;"></i></th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<?php
|
|
$i = 0;
|
|
$row_diagnosis = null;
|
|
if (isset($_REQUEST['appointmentId'])) {
|
|
$sql = "select * from diagnosis_detail where appointment_id='" . $_REQUEST['appointmentId'] . "'";
|
|
$result_diagnosis = mysqli_query($conn, $sql);
|
|
$num_rows = @mysqli_num_rows($result_diagnosis);
|
|
$row_diagnosis = @mysqli_fetch_array($result_diagnosis);
|
|
}
|
|
do {
|
|
?>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td style="width:40%">
|
|
<select class="select2 form-control" id="ailment_system_new<?php echo $i ?>"
|
|
name="ailment_system_new<?php echo $i ?>"
|
|
data-placeholder="Ailment System" onchange="addDiagnosis('<?= $i ?>');">
|
|
|
|
<?php echo generateOptionForMultiple('ailment_system', 'ailment_sys_name', 'ailment_sys_id', $row_diagnosis['ailment_system_id'], ''); ?>
|
|
</select>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
<select class="select2 form-control" id="ailment_new<?php echo $i ?>"
|
|
name="ailment_new<?php echo $i ?>" data-placeholder="Choose a option">
|
|
<?php echo generateOptionForMultiple('ailment', 'ailment_name', 'ailment_id', $row_diagnosis['ailment_id'], ''); ?>
|
|
</td>
|
|
<td>
|
|
<input type="text" name="hazard<?php echo $i ?>" id="hazard<?php echo $i ?>"
|
|
class="form-control" value="<?= $row_diagnosis['associated_hazard'] ?>">
|
|
</td>
|
|
<td style="width:10%" align="center">
|
|
<?php if ($i != 0) { ?>
|
|
<button type="button" class="btn" data-toggle="tooltip" id="deletebtn"
|
|
title="Delete"><span class="fa fa-trash"></span></button>
|
|
<?php
|
|
} ?>
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
$i++;
|
|
} while ($row_diagnosis = @mysqli_fetch_array($result_diagnosis)) //end of while
|
|
?>
|
|
|
|
|
|
</tbody>
|
|
|
|
<tfoot>
|
|
<!-- <tr style="margin-left:10px;">
|
|
<td colspan="10" style="text-align: left;"> -->
|
|
<input type="hidden" name="count_items" id="count_items" value="<?php echo $i ?>" />
|
|
<!--
|
|
</td>
|
|
</tr> -->
|
|
<!-- <tr>
|
|
</tr> -->
|
|
</tfoot>
|
|
|
|
|
|
</table>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="treatment-2">
|
|
<div class="items">
|
|
<label for="sensitization">Sensitization</label>
|
|
<input type="text" name="sensitization" id="sensitization"
|
|
value="<?= $row['sensitization'] ?>" class="form-control">
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label for="safety_concern">Safety Concern</label>
|
|
<input type="text" name="safety_concern" id="safety_concern" class="form-control"
|
|
value="<?= $row['safety_concern'] ?>">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="treatment-work">
|
|
<div class="items">
|
|
<label for="work_restriction_reason">Restrictions in work - Reason</label>
|
|
<input type="text" name="work_restriction_reason" id="work_restriction_reason"
|
|
class="form-control" value="<?= $row['work_restriction_reason'] ?>">
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label for="work_restriction_est_time">Restrictions in work - Estimated
|
|
Time</label>
|
|
<input type="text" name="work_restriction_est_time" id="work_restriction_est_time"
|
|
class="form-control" value="<?= $row['work_restriction_est_time'] ?>">
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label for="work_restriction_req_change">Restrictions in work - Required
|
|
Change</label>
|
|
<input type="text" name="work_restriction_req_change" id="work_restriction_req_change"
|
|
class="form-control" value="<?= $row['work_restriction_req_change'] ?>">
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label for="work_contraindication_reason">Contraindication in work -
|
|
Reason</label>
|
|
<input type="text" name="work_contraindication_reason" id="work_contraindication_reason"
|
|
class="form-control" value="<?= $row['work_contraindication_reason'] ?>">
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label for="work_contraindication_req_change">Contraindication in work -
|
|
Required
|
|
Change</label>
|
|
<input type="text" name="work_contraindication_req_change"
|
|
id="work_contraindication_req_change" class="form-control"
|
|
value="<?= $row['work_contraindication_req_change'] ?>">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="treatment-3">
|
|
<div class="items">
|
|
<label for="disease_type">Disease Classification</label>
|
|
<select class=" form-control" id="disease_type" name="disease_type"
|
|
data-placeholder="Disease classification">
|
|
<option value="" disabled selected>Select Disease Classification</option>
|
|
<option value="OD" <?php if (strcmp($row['disease_type'], 'OD') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Occupational Disease</option>
|
|
<option value="ORD" <?php if (strcmp($row['disease_type'], 'ORD') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Occupation Related Disease</option>
|
|
<option value="NON-COMM" <?php if (strcmp($row['disease_type'], 'NON-COMM') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Non-Occupational : Non-Communicable Disease</option>
|
|
<option value="COMM" <?php if (strcmp($row['disease_type'], 'COMM') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Non-Occupational : Communicable Disease</option>
|
|
|
|
</select>
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label for="case_severity">Case Severity</label>
|
|
<select name="case_severity" id="case_severity" class="form-control">
|
|
<option value="" selected>select option</option>
|
|
<option value="MI" <?php if (strcmp($row['case_severity'], 'MI') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Mild</option>
|
|
<option value="MO" <?php if (strcmp($row['case_severity'], 'MO') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Moderate</option>
|
|
<option value="SEV" <?php if (strcmp($row['case_severity'], 'SEV') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Critical</option>
|
|
|
|
</select>
|
|
</div>
|
|
|
|
|
|
<div class="items">
|
|
<label for="in_comm_to">Internal Communication Directed To</label>
|
|
<select class=" form-control chosen-select" id="in_comm_to" name="in_comm_to[]"
|
|
data-placeholder="Internal Communication Directed To" multiple>
|
|
<option value="DEPT">Department</option>
|
|
<option value="HR">HR</option>
|
|
<option value="SF">Safety</option>
|
|
<option value="SUP">supervisor</option>
|
|
</select>
|
|
|
|
</div>
|
|
<div class="items">
|
|
<label for="directed_to_name">Directed to Name</label>
|
|
<input type="text" name="directed_to_name" id="directed_to_name" class="form-control">
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label for="fmo_opinion">FMO Expert Opinion for directed cases</label>
|
|
<input type="text" name="fmo_opinion" id="fmo_opinion" class="form-control"
|
|
value="<?= $row['fmo_opinion'] ?>">
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label for="management">Management (OHC /External)</label>
|
|
<select name="management" id="management" class="form-control">
|
|
<option value="" selected>select option</option>
|
|
<option value="OPD" <?php if (strcmp($row['management'], 'OPD') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
OPD</option>
|
|
<option value="REF" <?php if (strcmp($row['management'], 'REF') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
OPD Referral</option>
|
|
<option value="DC" <?php if (strcmp($row['management'], 'DC') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Day Care</option>
|
|
|
|
<option value="DCREF" <?php if (strcmp($row['management'], 'DCREF') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Day Care Referral</option>
|
|
|
|
</select>
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label for="reason_for_referral">Reason for Referral</label>
|
|
<select class="form-control" id="referral_reason" name="referral_reason">
|
|
<option value="">Please select an option</option>
|
|
<option value="LOR" <?php if (strcmp($row['referral_reason'], 'LOR') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Lack Of Resources</option>
|
|
<option value="OS" <?php if (strcmp($row['referral_reason'], 'OS') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Out of scope</option>
|
|
<option value="INV" <?php if (strcmp($row['referral_reason'], 'INV') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Investigation</option>
|
|
<option value="SO" <?php if (strcmp($row['referral_reason'], 'SO') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Specialist Opinion</option>
|
|
<option value="ODH" <?php if (strcmp($row['referral_reason'], 'ODH') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Out of Duty Hours</option>
|
|
<option value="PW" <?php if (strcmp($row['referral_reason'], 'PW') == 0) {
|
|
echo "selected";
|
|
} ?>>
|
|
Patients Wish</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label for="referral_notes">Referral Notes</label>
|
|
<textarea name="referral_notes" id="referral_notes" cols="30"
|
|
rows="10"><?= $row['referral_notes'] ?></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="tab-pane fade in" id="accordion6">
|
|
<div id="user-profile-2">
|
|
<div class="box-body">
|
|
|
|
<div class="treatment">
|
|
<div class="treatment-4">
|
|
|
|
<div class="row">
|
|
<?php if ($rolecode == 'DIS') { ?>
|
|
<!--<div class="col-sm-6">
|
|
<label class="control-label " for="medicine_disbursement"><strong
|
|
style="font-size: 11px">Medicine Disbursement</strong> </label>
|
|
<input
|
|
<?php if ($row['medi_disbursement'] == 'Y') {
|
|
echo 'checked="checked"';
|
|
} ?>
|
|
type="radio" name="medicine_disbursement"
|
|
id="medicine_disbursement_yes" value="Y"
|
|
onchange="setFieldDisableOrEnable(this.value)"> Yes
|
|
<input
|
|
<?php if ($row['medi_disbursement'] == 'N') {
|
|
echo 'checked="checked"';
|
|
} ?>
|
|
type="radio" name="medicine_disbursement"
|
|
id="medicine_disbursement_no" value="N"
|
|
onchange="setFieldDisableOrEnable(this.value)"> No
|
|
</div>-->
|
|
<?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 == 'DIS') {
|
|
?>
|
|
<div class="col-sm-6">
|
|
<label class=" control-label " for="doctor_discussed"><strong
|
|
style="font-size: 11px">Doctor Discussed?</strong> </label>
|
|
<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
|
|
<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>
|
|
|
|
<?php } ?>
|
|
</div>
|
|
<br>
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<button type="button" class="btn" data-toggle="modal" data-target="#medDetails"
|
|
onclick="loadMedData();"><i class="fa fa-info-circle"></i></button>
|
|
<button type="button" class="btn" id="load-treatment-btn"
|
|
onclick="loadTreatment();">Load Treatment</button>
|
|
<div class="loader"></div>
|
|
</div>
|
|
<div class="col-sm-12 table-responsive">
|
|
<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="text-align: center;">Medicine
|
|
</th>
|
|
<th style="text-align: center;">
|
|
Frequency</th>
|
|
<th style="text-align: center;">Timing
|
|
</th>
|
|
<th style="text-align: center;">Admin.
|
|
Route</th>
|
|
<th style="text-align: center;">Duration
|
|
</th>
|
|
<th style="text-align: center;">Dose Qty
|
|
</th>
|
|
<th style="text-align: center;">Total
|
|
Qty</th>
|
|
<th style="text-align: center;">
|
|
Available
|
|
Qty</th>
|
|
<th style="text-align: center;">Qty
|
|
Issued</th>
|
|
<th style="text-align: center;"></th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="tab-pane fade in" id="accordion7">
|
|
<div id="user-profile-2">
|
|
<div class="box-body">
|
|
<div class="treatment-5">
|
|
<div class="items">
|
|
<label class="control-label" for="additional_advices">
|
|
Reason for ongoing</label>
|
|
|
|
<input type="text" name="reason_ongoing" id="reason_ongoing" class="form-control"
|
|
value="<?php echo $row['reason_ongoing'] ?>">
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label class="control-label" for="followup_date">
|
|
Next F/U Date</label>
|
|
|
|
<input type="text" name="followup" id="followup" class="form-control">
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label for="ongoing_notes">Ongoing Notes</label>
|
|
<textarea name="ongoing_notes" id="ongoing_notes" cols="30"
|
|
rows="4"><?= $row['ongoing_notes'] ?></textarea>
|
|
</div>
|
|
|
|
<div class="items">
|
|
<label for="flaging_in_task">Flaging Remark</label>
|
|
<input type="text" name="flaging_in_task" id="flaging_in_task" class="form-control">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="treatment-6">
|
|
<div class="items">
|
|
<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="items">
|
|
<label for="health_program_enrolment">Health Program Enrolment</label>
|
|
<select class="form-control chosen-select" name="health_program_enrolment[]" multiple
|
|
id="health_program_enrolment" data-placeholder="Select Name">
|
|
<?php echo generateOption('training_master', 'training_name', 'training_master_id', '', '') ?>;
|
|
</select>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<!-- hidden fields -->
|
|
<div>
|
|
<input type="hidden" name="patient_name" id="patient_name" value="<?php echo $patient_name ?>">
|
|
|
|
<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 } ?> />
|
|
|
|
<?php if (!empty($row['ticket_no']) && $row['ticket_no'] != '' && $row['ticket_no'] != null && $row['ticket_no'] != 0) { ?>
|
|
<input id="ticket_no" type="hidden" name="ticket_no" value="<?php echo $row['ticket_no']; ?>">
|
|
<?php } else { ?>
|
|
<input id="ticket_no" type="hidden" name="ticket_no" value="<?= creatingTicketNoOPD(); ?>">
|
|
|
|
<?php } ?>
|
|
|
|
<input id="appoint" type="hidden" style="height: 30px" class="form-control" name="appoint"
|
|
value="<?php echo $_REQUEST['appointmentId'] ?>" />
|
|
<input id="template_name" name="template_name" type="hidden" />
|
|
|
|
<?php if ($row['emp_id'] != null && $row['emp_id'] != '' && $row['emp_id'] != 0) { ?>
|
|
<input id="emp_id" name="emp_id" type="hidden" value="<?php echo $row['emp_id'] ?>" />
|
|
<?php } else { ?>
|
|
<input id="emp_id" name="emp_id" type="hidden"
|
|
value="<?php echo ($_REQUEST['flex_opd_id'] != '' ? $_REQUEST['flex_opd_id'] : ($_REQUEST['flex_patient_id'] != '' ? $_REQUEST['flex_patient_id'] : $_REQUEST['direct_patient_id'])) ?>" />
|
|
<?php } ?>
|
|
|
|
<input id="appointment_id" name="appointment_id" value="<?php echo $row_history['appointment_id'] ?>"
|
|
type="hidden" />
|
|
<input id="appointment_type" name="appointment_type" type="hidden" value="O" />
|
|
<input type="hidden" name="shift_type" id="shift_type" value="<?php echo $row['shift_type']; ?>">
|
|
|
|
|
|
<?php if ($rolecode == 'DIS') { ?>
|
|
<input type="hidden" name="medical_disbursement_flag" id="medical_disbursement_flag" value="Y"> <input
|
|
type="hidden" name="medicine_disbursement" id="medicine_disbursement" value="Y">
|
|
<?php } ?>
|
|
|
|
<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 name="health_advice_name[]" type="hidden" data-placeholder="Ailments"
|
|
value="<?php echo $row['health_advices'] ?>">
|
|
|
|
</div>
|
|
</form>
|
|
<!-- Modal start-->
|
|
<div class="modal fade" id="empHistory" role="dialog">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
<h4 class="modal-title">Employment History</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<table id="emp-detail-table" class="table" cellspacing="0" width="100%" border="1">
|
|
<thead>
|
|
<tr>
|
|
<th>Employment (Employee / External Agency)</th>
|
|
<th>Designation</th>
|
|
<th>Location</th>
|
|
<th>Unit</th>
|
|
<th>Plant</th>
|
|
<th>Department</th>
|
|
<th>Area /Work Station</th>
|
|
<th>From</th>
|
|
<th>To</th>
|
|
<th>R/NR/E/M</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
$emp_his = "select * from employee_history where patient_id = '" . $row['emp_id'] . "'";
|
|
$res = mysqli_query($conn, $emp_his);
|
|
while ($row_his = mysqli_fetch_assoc($res)) {
|
|
|
|
?>
|
|
<tr>
|
|
<td><?= getFieldFromTable('employer_contractor_name', 'employer_contractor', 'id', $row_his['employment'], ''); ?>
|
|
</td>
|
|
|
|
<td><?= getFieldFromTable('designation_name', 'designation', 'designation_id', $row_his['designation']); ?>
|
|
</td>
|
|
|
|
<td><?= getFieldFromTable('branch_name', 'branch', 'branch_id', $row_his['location'], ''); ?>
|
|
</td>
|
|
|
|
<td> <?= getFieldFromTable('bu_name', 'bussiness_unit', 'bu_id', $row['unit'], ''); ?></td>
|
|
|
|
<td><?= getFieldFromTable('plant', 'plant_master', 'plant_id', $row_his['plant'], ''); ?>
|
|
</td>
|
|
|
|
<td> <?= getFieldFromTable('dept_name', 'department', 'dept_id', $row_his['department'], ""); ?>
|
|
</td>
|
|
|
|
<td> <?= getFieldFromTable('sub_section', 'sub_section_name', 'sub_section_id', $row['work_station'], ''); ?>
|
|
</td>
|
|
|
|
<td><?= $row_his['from_date'] ?></td>
|
|
<td><?= $row_his['to_date'] ?></td>
|
|
<td><?= $row_his['unknown_col'] ?></td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal fade" id="pastOhc" role="dialog">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
<h4 class="modal-title">Past OHC Visits</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<table id="history-table" class="table" cellspacing="0" border="1">
|
|
<thead>
|
|
<tr>
|
|
<th>Sr</th>
|
|
<th>Date</th>
|
|
<th>Emp No</th>
|
|
<th>Name</th>
|
|
<th>Case No</th>
|
|
<th>Emergency</th>
|
|
<th>Injury</th>
|
|
<th>Doctor Consulted</th>
|
|
<th>
|
|
C/C
|
|
</th>
|
|
<th>Diagnosis</th>
|
|
<th>Treatment</th>
|
|
</tr>
|
|
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
$sql_employee_appointment = "select patient_name,emp_code ,e.id,appointment_id,ticket_no, appointment_date,ailments_new, injury_types_new, complaints,examination_remarks,ailment_ids,hospital_treatment, referral,followup,remarks, appointment_type,injury_types,bp_sbp,bp_dbp,blood_sugar_fbs,blood_sugar_rbs,temperature,spo2_percent from employee_appointment ep inner join patient_master e on e.id=ep.emp_id where emp_id = '" . $row['emp_id'] . "' ";
|
|
|
|
$results_employee_appointment = mysqli_query($conn, $sql_employee_appointment);
|
|
$count = 0;
|
|
while ($row_employee_appointment = mysqli_fetch_assoc($results_employee_appointment)) {
|
|
|
|
extract($row_employee_appointment);
|
|
|
|
$diagnosis = $row_employee_appointment['appointment_type'];
|
|
$appointment_type = $row_employee_appointment['appointment_type'];
|
|
|
|
$employee_appointment = $row_employee_appointment['appointment_id'];
|
|
if ($appointment_type == 'O') {
|
|
$diagnosis = $row_employee_appointment['ailments_new'];
|
|
} else if ($appointment_type == 'I') {
|
|
$diagnosis = $row_employee_appointment['injury_types_new'];
|
|
}
|
|
|
|
$emp_id = $row_employee_appointment['id'];
|
|
|
|
|
|
$isEmergency = "";
|
|
$isInjury = "";
|
|
if ($appointment_type == 'I') {
|
|
$isInjury = "<span class='red'>Yes</i></span>";
|
|
} else {
|
|
$isInjury = "<span class='green'>No</i></span>";
|
|
}
|
|
if ($row_employee_appointment['IsEmergency'] == 1) {
|
|
$isEmergency = "<span class=' lighter red'>Yes</i></span>";
|
|
} else {
|
|
$isEmergency = "<span class='green'>No</i></span>";
|
|
}
|
|
|
|
$doctor_attended_flag = "No";
|
|
if ($row_employee_appointment['doctor_attended_flag'] == 'Y') {
|
|
$doctor_attended_flag = "<span class=' lighter red'>Yes</i></span>";
|
|
} else {
|
|
$doctor_attended_flag = "<span class='green'>No</i></span>";
|
|
}
|
|
|
|
?>
|
|
<tr>
|
|
<td><?= ++$count ?></td>
|
|
<td><?= date_format(date_create($row_employee_appointment['appointment_date']), "d-M-Y H:i A") ?>
|
|
</td>
|
|
<td><?= $row_employee_appointment['ticket_no']; ?></td>
|
|
<td><?= $row_employee_appointment['emp_code']; ?></td>
|
|
<td><?= $row_employee_appointment['patient_name'] ?>;</td>
|
|
<td><?= $isEmergency ?></td>
|
|
<td><?= $isInjury ?></td>
|
|
<td><?= $doctor_attended_flag ?></td>
|
|
<td><?= $row_employee_appointment['complaints']; ?></td>
|
|
<td><?= $diagnosis; ?></td>
|
|
<td><?= getTreatmentText($row_employee_appointment['appointment_id']); ?></td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal fade" id="medDetails" role="dialog">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal">×</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="1">
|
|
<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>
|
|
</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 End -->
|
|
|
|
<form id="pdfform" target="_blank">
|
|
<input type="hidden" id="appointment_id_pdf" value="<?php echo $row['appointment_id'] ?>" name="appointment_id_pdf">
|
|
</form>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
// using datatable plugin for two modal tables start
|
|
let table = new DataTable('#history-table', {
|
|
responsive: true
|
|
});
|
|
|
|
let table2 = new DataTable('#emp-detail-table', {
|
|
responsive: true
|
|
});
|
|
|
|
// end
|
|
|
|
// adding medicine details in modal
|
|
var activated = false;
|
|
|
|
function loadMedData() {
|
|
let med_tab_count = $("#count_treatment_item").val();
|
|
let current_row_count = $('#treatmentTable tbody tr').length;
|
|
let med_arr = [];
|
|
for (var i = 0; i <= (med_tab_count + current_row_count); i++) {
|
|
if (document.getElementById("treatment_item_" + i)) {
|
|
med_arr.push($("#treatment_item_" + i).val());
|
|
}
|
|
}
|
|
|
|
$("#med-detail-table tbody").html("");
|
|
|
|
$.ajax({
|
|
type: 'post',
|
|
url: 'get_med_data.php',
|
|
data: {
|
|
med_arr: med_arr
|
|
},
|
|
success: function(data) {
|
|
try {
|
|
data = JSON.parse(data);
|
|
|
|
var rowData = "";
|
|
|
|
for (medId in data) {
|
|
if (data.hasOwnProperty(medId)) {
|
|
var med_detail = data[medId];
|
|
var item_name = med_detail['item_name'];
|
|
var precaution = med_detail['item_precaution'];
|
|
var alternate = med_detail['item_alternate'];
|
|
var prescription = med_detail['is_prescription'];
|
|
var composition = med_detail['composition'];
|
|
var indication = med_detail['indication'];
|
|
var contraIndication = med_detail['contraIndication'];
|
|
var effect = med_detail['effect'];
|
|
|
|
rowData +=
|
|
`<tr><td>${item_name}</td><td>${precaution}</td><td>${composition}</td><td>${indication}</td><td>${contraIndication}</td><td>${effect}</td><td>${alternate}</td><td>${prescription}</td></tr>`;
|
|
}
|
|
}
|
|
|
|
$("#med-detail-table").append(rowData);
|
|
if (activated == false) {
|
|
let table3 = new DataTable('#med-detail-table', {
|
|
responsive: true
|
|
});
|
|
activated = true;
|
|
}
|
|
|
|
console.log(rowData);
|
|
} catch (err) {
|
|
console.log("some error in load med function");
|
|
}
|
|
|
|
},
|
|
error: function(data) {
|
|
console.log("something went wrong");
|
|
}
|
|
});
|
|
}
|
|
|
|
// loading treatment dynamically acc to already present prescription
|
|
function loadTreatment() {
|
|
document.getElementById("load-treatment-btn").style.display = 'none';
|
|
document.getElementsByClassName("loader")[0].style.display = 'block';
|
|
|
|
var diagnosis_counts = $("#count_items").val();
|
|
|
|
var diag_arr = [];
|
|
|
|
for (let i = 0; i < diagnosis_counts; i++) {
|
|
diag_arr[i] = $("#ailment_new" + i).val();
|
|
}
|
|
console.log(diag_arr);
|
|
|
|
$.ajax({
|
|
type: 'post',
|
|
url: 'show_prescription.php',
|
|
data: {
|
|
diagnosis: diag_arr
|
|
},
|
|
success: function(data) {
|
|
|
|
try {
|
|
data = JSON.parse(data);
|
|
} catch (err) {
|
|
console.log("some error in loading med function " + err.name);
|
|
}
|
|
|
|
let tab_count = 0;
|
|
var health_advice_arr = [];
|
|
var med_info = [];
|
|
var drug_count = 0;
|
|
|
|
try {
|
|
for (medId in data) {
|
|
if (data.hasOwnProperty(medId)) {
|
|
var drugArr = data[medId];
|
|
med_info.push({
|
|
'drug': '',
|
|
'name': '',
|
|
'freq': '',
|
|
'freq_val': '',
|
|
'timing': '',
|
|
'admin_route': '',
|
|
'duration': '',
|
|
'dose': '',
|
|
'drug_count': '',
|
|
'is_prescription': ''
|
|
});
|
|
// console.log(drug + typeof drug);
|
|
med_info[tab_count]['drug'] = medId;
|
|
med_info[tab_count]['name'] = drugArr['name'];
|
|
med_info[tab_count]['freq'] = drugArr['frequency'];
|
|
med_info[tab_count]['freq_val'] = drugArr['freq_val'];
|
|
med_info[tab_count]['timing'] = drugArr['timing'];
|
|
med_info[tab_count]['admin_route'] = drugArr['admin_route'];
|
|
|
|
med_info[tab_count]['duration'] = drugArr['duration'];
|
|
med_info[tab_count]['dose'] = drugArr['dose'];
|
|
|
|
med_info[tab_count]['drug_count'] = drugArr['count'];
|
|
med_info[tab_count]['is_prescription'] = drugArr['is_prescription'];
|
|
|
|
drug_count = drugArr['count'];
|
|
// console.log(drugArr['health_advices']);
|
|
var health_advices = drugArr['health_advices'].split(",");
|
|
for (let y of health_advices) {
|
|
health_advice_arr.push(y);
|
|
}
|
|
}
|
|
tab_count++;
|
|
}
|
|
|
|
console.log(med_info);
|
|
|
|
var actual_rowCount = $('#treatmentTable tbody tr').length;
|
|
console.log("actual row present this moment " + actual_rowCount);
|
|
|
|
let added_row_count = $("#count_treatment_item").val();
|
|
|
|
console.log("actual row added by plus button " + added_row_count);
|
|
|
|
console.log("drug count " + drug_count);
|
|
|
|
let new_added_row_count = 0;
|
|
|
|
if (actual_rowCount < drug_count) {
|
|
while (drug_count > actual_rowCount) {
|
|
addRow(<?= $_REQUEST['appointmentId'] ?>);
|
|
actual_rowCount++;
|
|
new_added_row_count++;
|
|
}
|
|
} else if (actual_rowCount > drug_count) {
|
|
while (actual_rowCount > drug_count) {
|
|
$('#treatmentTable tbody tr:nth-last-child(1)').remove();
|
|
actual_rowCount--;
|
|
}
|
|
}
|
|
|
|
var index = 0;
|
|
for (let i = 0; i <= (added_row_count + new_added_row_count); i++) {
|
|
|
|
if (document.getElementById('treatment_item_td_' + i)) {
|
|
console.log('treatment_item_td_' + i);
|
|
console.log("got here with index " + index);
|
|
var drug = med_info[index]['drug'];
|
|
var name = med_info[index]['name'];
|
|
var freq = med_info[index]['freq'];
|
|
var freq_qty = med_info[index]['freq_val'];
|
|
var timing = med_info[index]['timing'];
|
|
var admin_route = med_info[index]['admin_route'];
|
|
var duration = med_info[index]['duration'];
|
|
var dose = med_info[index]['dose'];
|
|
var is_prescription = med_info[index]['is_prescription'];
|
|
if (is_prescription == 1) {
|
|
$('#treatment_item_td_' + i).html('');
|
|
var itemOptions =
|
|
"<?php echo generate_options("SELECT item_id,trim(concat(ifnull(form_name,''),' ',item_name)) item_name FROM tbl_items i left join medicine_form f on i.item_form_id=f.form_id where status='1' order by item_name", '', 'item_id', 'item_name', '', ''); ?>";
|
|
var select_treatment = "";
|
|
select_treatment +=
|
|
"<select onchange=\"getItemDetails(this.value,'current_stock" + "_" + i +
|
|
"','current_stock_div" + i + "','" + appointment_id + "', '" + i +
|
|
"');\" class='chosen-select form-control'";
|
|
select_treatment += "id=\"treatment_item" + "_" + i +
|
|
"\"name=\"treatment_item" + i +
|
|
"\"data-placeholder=\"Treatment...\"";
|
|
//select_treatment+="style=\"display: none;\"";
|
|
select_treatment += ">";
|
|
|
|
select_treatment += "<option value=\"\"> </option>";
|
|
select_treatment += itemOptions
|
|
select_treatment += "</select>";
|
|
$('#treatment_item_td_' + i).html(select_treatment);
|
|
$('#treatment_item_' + i).chosen({
|
|
allow_single_deselect: true
|
|
});
|
|
$('#treatment_item_' + i).next().css({
|
|
'width': '200px',
|
|
'border': '1px solid red',
|
|
'border-radius': '5px'
|
|
});
|
|
// $("#treatmentTable tbody tr:nth-child(" + (i) + ")").css('border', '1px solid red');
|
|
|
|
}
|
|
|
|
document.getElementById('treatment_item_' + i).value = drug;
|
|
$('#treatment_item_' + i).trigger('chosen:updated');
|
|
document.getElementById('treatment_item_dosage_' + i).value = freq;
|
|
document.getElementById('timings_' + i).value = timing;
|
|
document.getElementById('treatment_item_dosage_category_' + i).value = admin_route;
|
|
document.getElementById('treatment_item_days_' + i).value = duration;
|
|
document.getElementById('dose_qty_' + i).value = dose;
|
|
|
|
getItemDetails(drug, "current_stock_" + i, "current_stock_div" + i,
|
|
'<?= $_REQUEST['appointmentId'] ?>', i);
|
|
|
|
|
|
if (duration == null || duration == '' || duration == 0) {
|
|
duration = 1;
|
|
}
|
|
$("#treatment_item_total_" + i).val(parseInt(duration) * parseInt(freq_qty) *
|
|
parseInt(dose));
|
|
$("#treatment_item_total_div" + i).html(parseInt(duration) * parseInt(freq_qty) *
|
|
parseInt(dose));
|
|
console.log("total qty " + duration + " " + freq_qty + " " + dose);
|
|
|
|
|
|
$('.select2').select2();
|
|
// $("#count_treatment_item").val(drug_count);
|
|
index++;
|
|
}
|
|
}
|
|
|
|
|
|
if ($('#health_advice_name_new')) {
|
|
setTimeout(function() {
|
|
var tag_input_advices = $('#health_advice_name_new');
|
|
try {
|
|
tag_input_advices.tag({
|
|
placeholder: tag_input_advices.attr('placeholder'),
|
|
|
|
source: healthAdvices,
|
|
tagClass: 'bigTag',
|
|
trimValue: true,
|
|
allowDuplicates: false,
|
|
|
|
})
|
|
|
|
//programmatically add/remove a tag
|
|
var $tag_obj = $('#health_advice_name_new').data('tag');
|
|
var existingHealthAdvicesArr = health_advice_arr;
|
|
// if (existingHealthAdvices != undefined && existingHealthAdvices != null &&
|
|
// existingHealthAdvices != '') {
|
|
// var existingHealthAdvicesArr = existingHealthAdvices.split(",");
|
|
jQuery.each(existingHealthAdvicesArr, function(i, val) {
|
|
$tag_obj.add(val.toUpperCase());
|
|
});
|
|
// }
|
|
|
|
} catch (e) {
|
|
|
|
tag_input_advices.after('<textarea id="' + tag_input_advices.attr(
|
|
'id') + '" name="' +
|
|
tag_input_advices.attr('name') + '" rows="3">' +
|
|
tag_input_advices.val() +
|
|
'</textarea>').remove();
|
|
//autosize($('#form-field-tags'));
|
|
}
|
|
}, 500);
|
|
} //end health advices
|
|
} catch (err) {
|
|
console.log("Got some error in loading treatment function " + err.name);
|
|
} finally {
|
|
document.getElementById("load-treatment-btn").style.display = 'block';
|
|
document.getElementsByClassName("loader")[0].style.display = 'none';
|
|
}
|
|
},
|
|
error: function(data) {
|
|
document.getElementById("load-treatment-btn").style.display = 'block';
|
|
document.getElementsByClassName("loader")[0].style.display = 'none';
|
|
BootstrapDialog.alert("something went wrong while loading the treatment.");
|
|
}
|
|
})
|
|
|
|
}
|
|
|
|
// end
|
|
|
|
// adding diagnosis acc to body system
|
|
function addDiagnosis(count) {
|
|
$("#ailment_new" + count).empty();
|
|
$("#ailment_new" + count).append(`<option value="">Select Option</option>`);
|
|
let body_system_id = $("#ailment_system_new" + count).val();
|
|
$.ajax({
|
|
type: 'post',
|
|
url: 'get_diagnosis.php',
|
|
data: {
|
|
body_system: body_system_id
|
|
},
|
|
success: function(data) {
|
|
data = JSON.parse(data);
|
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
console.log(data[i].ailment_id);
|
|
$("#ailment_new" + count).append(`<option value="${data[i].ailment_id}">
|
|
${data[i].ailment_name}
|
|
</option>`);
|
|
|
|
}
|
|
|
|
},
|
|
error: function(data) {
|
|
console.log("Something went wrong while fetching diagnosis");
|
|
}
|
|
|
|
});
|
|
}
|
|
// end
|
|
|
|
|
|
|
|
// getting tag field to calculate ailment body system
|
|
let tag = $('#ailment_new').data('tag');
|
|
|
|
// $(document).on('change', tag, function() {
|
|
// let body_system_val = $("#ailment_system_new").val();
|
|
// let tag_val = $("#ailment_new").val();
|
|
// $.ajax({
|
|
// type: 'post',
|
|
// url: 'append_bodysystem.php',
|
|
// data: {
|
|
// tag: tag_val,
|
|
// body_system: body_system_val
|
|
// },
|
|
// success: function(data) {
|
|
// if (data != undefined || data != null) {
|
|
// dataarray = JSON.parse(data);
|
|
// console.log(dataarray);
|
|
// $("#ailment_system_new").val(dataarray);
|
|
// $('#ailment_system_new').trigger('chosen:updated');
|
|
// }
|
|
|
|
// },
|
|
// error: function(data) {
|
|
// console.log("something went wrong in updating body system");
|
|
// }
|
|
// });
|
|
// });
|
|
// 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 examination 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(",");
|
|
console.log(dataarray);
|
|
$("#examination_remarks").val(dataarray);
|
|
$('#examination_remarks').trigger('chosen:updated');
|
|
<?php } ?>
|
|
|
|
// to update complaints value if config is false
|
|
|
|
var complaint_names = '<?= $row['complaints'] ?>';
|
|
dataarray = complaint_names.split(",");
|
|
$("#complaints").val(dataarray);
|
|
$('#complaints').trigger('chosen:updated');
|
|
|
|
var in_comm_to = '<?= $row['in_comm_to'] ?>';
|
|
dataarray = in_comm_to.split(",");
|
|
$("#in_comm_to").val(dataarray);
|
|
$('#in_comm_to').trigger('chosen:updated');
|
|
|
|
var health_program_enrolment = '<?= $row['health_program_enrolment'] ?>';
|
|
dataarray = health_program_enrolment.split(",");
|
|
$("#health_program_enrolment").val(dataarray);
|
|
$("#health_program_enrolment").trigger('chosen:updated');
|
|
|
|
//$('#ailment_new').trigger('chosen:updated');
|
|
// $('#complaints').trigger('chosen:updated');
|
|
// $('#examination_remarks').trigger('chosen:updated');
|
|
// $('#referral').trigger('chosen:updated');
|
|
$('#ailment_system_new').trigger('chosen:updated');
|
|
|
|
function showMobNo(id) {
|
|
|
|
$.ajax({
|
|
url: 'select_mobile_no.php',
|
|
type: "POST",
|
|
data: {
|
|
id: id
|
|
},
|
|
success: function(data) {
|
|
$("#referred_by_contact").val(data.primary_phone);
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error!!');
|
|
return;
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
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 exporttopdf() {
|
|
|
|
|
|
document.forms['pdfform'].action = "opd_form_pdf.php";
|
|
document.forms['pdfform'].method = "post";
|
|
document.forms['pdfform'].submit();
|
|
}
|
|
|
|
|
|
function showDetail(value) {
|
|
if (value == 'Y') {
|
|
$("#is_admitted").hide();
|
|
$("#discharge").show();
|
|
} else {
|
|
$("#is_admitted").show();
|
|
$("#discharge").hide();
|
|
}
|
|
}
|
|
|
|
|
|
function send_email() {
|
|
$("#message").val($("#fmo_opinion").val());
|
|
$.ajax({
|
|
url: 'send_email.php',
|
|
type: 'POST',
|
|
data: $("#email_form").serialize(),
|
|
success: function(data) {
|
|
BootstrapDialog.alert('Mail sent Successfully');
|
|
setTimeout(() => {
|
|
window.location.reload()
|
|
}, 2000);
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error in sending mail');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
}
|
|
|
|
jQuery(function($) {
|
|
var appointmentId = $("#appointment_id").val();
|
|
$("#forwardButton").on("click", function() {
|
|
<?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 To Dipensary</option>' +
|
|
'<option value="MRP">Forward To Lab</option>' +
|
|
'<option value="DET">Forward To dispensary for IPD</option>' +
|
|
'<option value="CLS">Save & Close</option>',
|
|
|
|
buttons: [
|
|
|
|
{
|
|
label: 'Send Email',
|
|
action: function() {
|
|
open_item(<?php echo $row['appointment_id'] ?>);
|
|
}
|
|
},
|
|
|
|
{
|
|
label: 'OK',
|
|
action: function() {
|
|
$("#attendedStatus").val($("#forward_status").val());
|
|
validate_update('opd_form',
|
|
'<?php echo $row['appointment_id'] ?>')
|
|
|
|
}
|
|
}, {
|
|
label: 'Cancel',
|
|
action: function() {
|
|
$(".modal-header .close").click();
|
|
}
|
|
}
|
|
]
|
|
});
|
|
<?php } else if ($rolecode == $__ROLE_DISPENSARY) { ?>
|
|
BootstrapDialog.show({
|
|
title: 'Forward',
|
|
|
|
message: '<select class="form-control" id="forward_status" style="margin-left:100px;width:60%">' +
|
|
'<option value="CLS">Save & Close</option>' +
|
|
'<option value="DRP">Forward To Doctor</option>',
|
|
|
|
buttons: [{
|
|
label: 'OK',
|
|
action: function() {
|
|
$("#attendedStatus").val($("#forward_status").val());
|
|
validate_update('opd_form',
|
|
'<?php echo $row['appointment_id'] ?>')
|
|
|
|
}
|
|
}, {
|
|
label: 'Cancel',
|
|
action: function() {
|
|
$(".modal-header .close").click();
|
|
}
|
|
}]
|
|
});
|
|
<?php } else { ?>
|
|
BootstrapDialog.show({
|
|
title: 'Forward',
|
|
|
|
message: '<select class="form-control" id="forward_status" >' +
|
|
'<option value="<?php echo $__STATUS_PHARMACY_PENDING ?>">Forward To Dispensary</option>' +
|
|
'<option value="<?php echo $__STATUS_DOCTOR_PENDING ?>">Forward To Doctor</option>' +
|
|
'</select>',
|
|
buttons: [{
|
|
label: 'OK',
|
|
action: function() {
|
|
$("#attendedStatus").val($("#forward_status").val());
|
|
validate_update('opd_form',
|
|
'<?php echo $row['appointment_id'] ?>')
|
|
|
|
}
|
|
}, {
|
|
label: 'Cancel',
|
|
action: function() {
|
|
$(".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');
|
|
});
|
|
}
|
|
|
|
|
|
|
|
|
|
autosize($('textarea[class*=autosize]'));
|
|
|
|
$('textarea.limited').inputlimiter({
|
|
remText: '%n character%s remaining...',
|
|
limitText: 'max allowed : %n.'
|
|
});
|
|
|
|
|
|
|
|
|
|
$('.date-picker').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true
|
|
})
|
|
//show datepicker when clicking on the icon
|
|
.next().on(ace.click_event, function() {
|
|
$(this).prev().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') { ?>
|
|
defaultDate: new Date("<?php echo $row['appointment_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']) $('#followup').datetimepicker({
|
|
format: 'DD/MM/YYYY h:mm A', //use this option to display seconds
|
|
<?php if (isset($row['followup']) && $row['followup'] != '0000-00-00 00:00:00') { ?>
|
|
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();
|
|
});
|
|
|
|
|
|
if (!ace.vars['old_ie']) $('#out_time').datetimepicker({
|
|
format: 'DD/MM/YYYY h:mm A', //use this option to display seconds
|
|
<?php if (isset($row['clearance_time']) && $row['clearance_time'] != '0000-00-00 00:00:00') { ?>
|
|
defaultDate: new Date("<?php echo $row['clearance_time'] ?>"),
|
|
<?php } else { ?>
|
|
defaultDate: new Date(),
|
|
<?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']) $('#discharge_time').datetimepicker({
|
|
format: 'DD/MM/YYYY h:mm A', //use this option to display seconds
|
|
<?php if (isset($row['discharge_time']) && $row['discharge_time'] != '0000-00-00 00:00:00') { ?>
|
|
defaultDate: new Date("<?php echo $row['discharge_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();
|
|
});
|
|
|
|
|
|
$('#colorpicker1').colorpicker();
|
|
//$('.colorpicker').last().css('z-index', 2000);//if colorpicker is inside a modal, its z-index should be higher than modal'safe
|
|
|
|
$('#simple-colorpicker-1').ace_colorpicker();
|
|
//$('#simple-colorpicker-1').ace_colorpicker('pick', 2);//select 2nd color
|
|
//$('#simple-colorpicker-1').ace_colorpicker('pick', '#fbe983');//select #fbe983 color
|
|
//var picker = $('#simple-colorpicker-1').data('ace_colorpicker')
|
|
//picker.pick('red', true);//insert the color if it doesn't exist
|
|
|
|
|
|
$(".knob").knob();
|
|
|
|
|
|
|
|
|
|
|
|
/////////
|
|
$('#modal-form input[type=file]').ace_file_input({
|
|
style: 'well',
|
|
btn_choose: 'Drop files here or click to choose',
|
|
btn_change: null,
|
|
no_icon: 'ace-icon fa fa-cloud-upload',
|
|
droppable: true,
|
|
thumbnail: 'large'
|
|
})
|
|
|
|
//chosen plugin inside a modal will have a zero width because the select element is originally hidden
|
|
//and its width cannot be determined.
|
|
//so we set the width after modal is show
|
|
$('#modal-form').on('shown.bs.modal', function() {
|
|
if (!ace.vars['touch']) {
|
|
$(this).find('.chosen-container').each(function() {
|
|
// $(this).find('a:first-child').css('width' , '210px');
|
|
// $(this).find('.chosen-drop').css('width' , '210px');
|
|
// $(this).find('.chosen-search input').css('width' , '200px');
|
|
});
|
|
}
|
|
})
|
|
/**
|
|
//or you can activate the chosen plugin after modal is shown
|
|
//this way select element becomes visible with dimensions and chosen works as expected
|
|
$('#modal-form').on('shown', function () {
|
|
$(this).find('.modal-chosen').chosen();
|
|
})
|
|
*/
|
|
|
|
|
|
|
|
$(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();
|
|
});
|
|
|
|
});
|
|
|
|
jQuery(function($) {
|
|
$("#prescripstionButton").on("click", function() {
|
|
var template_content = $("#template_content").html()
|
|
BootstrapDialog.show({
|
|
title: 'Template',
|
|
|
|
message: template_content,
|
|
|
|
|
|
buttons: [{
|
|
label: 'OK',
|
|
action: function() {
|
|
$("#template_name").val($("#myInput").val());
|
|
validate_template();
|
|
$(".close").click();
|
|
}
|
|
}, {
|
|
label: 'Cancel',
|
|
action: function() {
|
|
$(".modal-header .close").click();
|
|
}
|
|
}]
|
|
});
|
|
});
|
|
});
|
|
|
|
function open_item(appointmentId) {
|
|
|
|
var fmo_opinion = $("#fmo_opinion").val();
|
|
var appointment_date = $("#appointment_date").val();
|
|
var patient_name = $("#patient_name").val();
|
|
|
|
$.ajax({
|
|
url: 'get_encode_data.php',
|
|
type: "POST",
|
|
data: {
|
|
'id': appointmentId,
|
|
'action': 'e'
|
|
},
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
var app_id = data.id;
|
|
// alert(app_id);
|
|
// $("#appointmentId").val("");
|
|
// $("#appointment_type").val("");
|
|
// $("#email_form").find("#ref_identifier").val(appointmentId);
|
|
|
|
// var to = dept_id;
|
|
|
|
var emailContent = "";
|
|
|
|
|
|
var app_root = '<?php echo getConfigKey('APP_ROOT') ?>';
|
|
var to_list = ",<?php echo getConfigKey('GENERAL_EMAIL_LIST_TO_OPD') ?>";
|
|
$("#email_form").find("#ref_type").val("OPD");
|
|
$("#email_form").find("#to").val(to_list);
|
|
$("#email_form").find("#cc").val('<?php echo getConfigKey('GENERAL_EMAIL_LIST_CC_OPD') ?>');
|
|
$("#email_form").find("#subject").val(
|
|
'<?php echo getConfigKey('GENERAL_EMAIL_SUBJECT_OPD') ?>');
|
|
$("#email_form").find("#email_content").text(
|
|
'<div style=\"style="text-transform: none; !important"\"><?php echo getConfigKey('GENERAL_EMAIL_TEXT_OPD') ?></div>'
|
|
);
|
|
emailContent +=
|
|
"<table class='table-bordered' width='100%'><thead><tr><th>Date</th><th>Patient Name</th><th>FMO Opinion</th></tr><thead><tbody>";
|
|
emailContent += "<tr><td>" + appointment_date + "</td><td>" + patient_name + "</td><td>" +
|
|
fmo_opinion + "</td></tr>";
|
|
emailContent += "</tbody></table>";
|
|
|
|
$("#email_form").find("#email_content").html(emailContent);
|
|
$("#email_form").find("#message").val($("#fmo_opinion").val());
|
|
|
|
|
|
|
|
//resizeChosen();
|
|
//jQuery(window).on('resize', resizeChosen);
|
|
$('#modal-add-email').modal("show");
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error In Pulling Id');
|
|
return id;
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
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));
|
|
}
|
|
|
|
function getPrescription(prescription_id) {
|
|
//id ='<?php $_REQUEST['prescription_id']; ?>';
|
|
//alert(prescription_id);
|
|
$.ajax({
|
|
method: "POST",
|
|
url: "prescription_details.php",
|
|
data: {
|
|
prescription_id: prescription_id
|
|
},
|
|
dataType: "json",
|
|
success: function(data) {
|
|
for (var z = 0; z < data.length; z++) {
|
|
// $('#Ailments').val(data[z].ailments_new);
|
|
var element = document.getElementById('ailment_new');
|
|
var element2 = document.getElementById('ailment_system_new');
|
|
|
|
dataarray = data[z].ailments_new.split(",");
|
|
dataarray2 = data[z].ailment_systems_new.split(",");
|
|
// dataarray3=data[z].external_treatments.split(",");
|
|
|
|
for (var i = 0; i < element.options.length; i++) {
|
|
|
|
element.options[i].selected = dataarray.indexOf(element.options[i].value) >= 0;
|
|
|
|
}
|
|
|
|
for (var i = 0; i < element2.options.length; i++) {
|
|
|
|
element2.options[i].selected = dataarray2.indexOf(element2.options[i].value) >= 0;
|
|
|
|
}
|
|
|
|
$('#external_treatments').val(data[z].external_treatments);
|
|
$('#referral_point').val(data[z].referral);
|
|
$('#followup').val(data[z].follow_up);
|
|
|
|
|
|
|
|
$('#ailment_new').trigger('chosen:updated');
|
|
$('#ailment_system_new').trigger('chosen:updated');
|
|
$('#external_treatments').trigger('chosen:updated');
|
|
|
|
|
|
|
|
|
|
//ontact1').val(data.contact1);
|
|
|
|
|
|
|
|
}
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Update Details');
|
|
//return;
|
|
}
|
|
});
|
|
getTreatmentDetail(prescription_id);
|
|
}
|
|
|
|
function getTreatmentDetail(prescription_id) {
|
|
$.ajax({
|
|
method: "POST",
|
|
url: "treatment_details.php",
|
|
data: {
|
|
prescription_id: prescription_id
|
|
},
|
|
dataType: "json",
|
|
success: function(data) {
|
|
$("#treatmentTable tr:gt(0)").remove();
|
|
$("#treatmentTable tfoot").append(
|
|
'<input type="hidden" name="count_treatment_item" id="count_treatment_item" >');
|
|
var count = 0;
|
|
var treatment_item_dosage =
|
|
"<?php echo generateOption('medicine_frequency', 'medicine_frequency', 'frequency_id', $row_treatment['frequency_id'], ''); ?>"
|
|
var treatment_item =
|
|
"<?php echo generate_options("SELECT item_id,trim(concat(ifnull(form_name,''),' ',item_name)) item_name FROM tbl_items i left join medicine_form f on i.item_form_id=f.form_id where status='1' and is_prescription!='1' order by item_name", $row_treatment['item_id'], 'item_id', 'item_name', '', ''); ?>"
|
|
var dosage_category =
|
|
"<?php echo generateOption("dosage_category", "dosage_category", "dosage_category_id", $row_treatment['dosage_category_id'], ''); ?>"
|
|
for (var z = 0; z < data.length; z++) {
|
|
var content = "";
|
|
|
|
content +=
|
|
"<tr><td><select style=\"width:100%\" class=\"select2 form-control\" id=\"treatment_item" +
|
|
'_' + count + "\" name=\"treatment_item" + count +
|
|
"\" onchange=\"getItemDetails(this.value,'current_stock" + "_" + count +
|
|
"','current_stock_div" + count + "','" + appointment_id + "', '" + count +
|
|
"');\" data-placeholder=\"Treatment...\">"
|
|
content += "" + treatment_item + "</select></td>"
|
|
content += "<td class=\"col-sm-2\">"
|
|
content +=
|
|
"<select style=\"width:100%\" class=\"select2 form-control\" id=\"treatment_item_dosage" +
|
|
'_' + count + "\" name=\"treatment_item_dosage" + count +
|
|
"\" data-placeholder=\"Dosages...\" onchange=\"getFrequenceyQty(this.value,'frequency_qty" +
|
|
"_" + count + "','dosage" + "_" + count + "','" + appointment_id + "', '" + count +
|
|
"');\">"
|
|
content += "<option value=''>N/A</option>";
|
|
content += "" + treatment_item_dosage + ""
|
|
content += "</select>"
|
|
content += "<td class=\"col-sm-2\">"
|
|
content += "<select class=\"select2 form-control\" id=\"treatment_item_dosage_category" +
|
|
'_' + count +
|
|
"\" class=\"form-control chosen-select\" name=\"treatment_item_dosage_category" +
|
|
count + "\" value='<?php echo $row_treatment['dosage_category_id'] ?>'>"
|
|
content += "<option value=''>N/A</option>";
|
|
|
|
content += "" + dosage_category + "</td>"
|
|
content += "</select>"
|
|
content += "<input type=\"hidden\" name=\"treatment_id" + count + "\" id=\"treatment_id" +
|
|
'_' + count + "\" value=\"<?php echo $row_treatment['treatment_id'] ?>\"></td>"
|
|
content += "<td class=\"col-sm-1\"style='width:5%'>"
|
|
content +=
|
|
"<input type=\"number\" style=\"height:25px;font-size:11px;width;45px\" class=\"form-control\" name=\"treatment_item_days" +
|
|
count + "\" id=\"treatment_item_days" + '_' + count +
|
|
"\" value=\"<?php echo $row_treatment['for_days'] ?>\" onchange=\"updateTotalMedicineQtyNew('frequency_qty" +
|
|
"_" + count + "','treatment_item_days" + '_' + count + "'," + count + ");\"/></td>"
|
|
content += "<td class=\"col-sm-1\" style=\"width:5%;\">"
|
|
content +=
|
|
"<input class=\"form-control\" type=\"text\" value=\"<?php echo $row_treatment['item_qty'] ?>\" name=\"frequency_qty" +
|
|
count + "\" id=\"frequency_qty" + '_' + count + "\" />"
|
|
content += "<input type=\"hidden\" name=\"dosage" + count + "\" id=\"dosage" + '_' + count +
|
|
"\" />"
|
|
content += "<input type=\"hidden\" name=\"treatment_item_total" + count +
|
|
"\" value=\"<?php echo $row_treatment['item_qty'] ?>\" id=\"treatment_item_total" +
|
|
'_' + count + "\" />"
|
|
content += "</td>"
|
|
|
|
|
|
content += "<td class=\"col-sm-1\" style=\"width:5%\">"
|
|
content += "<div style=\"text-align:right\" id=\"current_stock_div" + count + "\">"
|
|
content += "<?php echo $current_stock ?> <?php echo $unitMap[$unit_id] ?>"
|
|
content += "</div>"
|
|
content += "<input type=\"hidden\" name=\"current_stock" + count + "\" id=\"current_stock" +
|
|
'_' + count + "\" />"
|
|
|
|
content += "</td>"
|
|
content +=
|
|
"<td style=\"width:5%\"><label><i class=\"ace-icon fa fa-trash-o bigger-130\"></i></label></td></tr>"
|
|
//$("#treatmentTable tbody").append(content);
|
|
$("#treatmentTable tbody").append(content);
|
|
getItemDetails(data[z].item_id, "current_stock_" + count, "current_stock_div" + count, '',
|
|
count);
|
|
$("#treatment_item" + '_' + count).val(data[z].item_id)
|
|
$("#treatment_item_dosage" + '_' + count).val(data[z].frequency_id)
|
|
$("#treatment_item_dosage_category" + '_' + count).val(data[z].dosage_category_id)
|
|
$('.select2').select2();
|
|
$("#count_treatment_item").val(count);
|
|
|
|
// $("#treatment_item"+'_'+count).trigger('chosen:updated');
|
|
count++;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Update Details');
|
|
//return;
|
|
}
|
|
});
|
|
}
|
|
|
|
function add_consume() {
|
|
$('#consumables').modal("show");
|
|
|
|
}
|
|
</script>
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
var counter = $("#count_items").val();
|
|
|
|
var body_systems_option =
|
|
"<?php echo generateOptionForMultiple('ailment_system', 'ailment_sys_name', 'ailment_sys_id', '', ''); ?>";
|
|
|
|
// var ailment_new_option = "<?php echo generateOption('ailment', 'ailment_name', 'ailment_id', '', '') ?>";
|
|
|
|
$("#addrow").on("click", function() {
|
|
var newRow = $("<tr>");
|
|
var cols = "";
|
|
var select_body = "";
|
|
var select_diag = "";
|
|
select_body += "<select ";
|
|
select_body += "id=\"ailment_system_new" + counter + "\"name=\"ailment_system_new" + counter +
|
|
"\" class=\"form-control select2\" onchange=\"addDiagnosis('" + counter +
|
|
"')\" data-placeholder=\"Choose a option...\"";
|
|
|
|
select_body += ">";
|
|
|
|
select_body += "<option value=\"\"> </option>";
|
|
select_body += body_systems_option
|
|
select_body += "</select>";
|
|
cols += '<td>' + select_body + '</td>';
|
|
|
|
|
|
|
|
select_diag += "<select ";
|
|
select_diag += "id=\"ailment_new" + counter + "\"name=\"ailment_new" + counter +
|
|
"\" class=\"form-control select2\" data-placeholder=\"Choose a option...\"";
|
|
|
|
select_diag += ">";
|
|
|
|
select_diag += "<option value=\"\"> </option>";
|
|
// select_diag += ailment_new_option
|
|
select_diag += "</select>";
|
|
cols += '<td>' + select_diag + '</td>';
|
|
|
|
cols += '<td><input name="hazard' + counter + '" class="form-control" id="hazard' + counter +
|
|
'"></td>'
|
|
|
|
cols +=
|
|
'<td align="center"><button type="button" class="btn" data-toggle="tooltip" id="deletebtn" title="Delete"><span class="fa fa-trash"></span></button></td>';
|
|
|
|
newRow.append(cols);
|
|
$("#myTable.order-list").append(newRow);
|
|
var item_id = $("#item_id" + (counter - 1)).val();
|
|
/*$('#item_id'+counter).chosen({allow_single_deselect:true});
|
|
$('#item_id'+counter).next().css({'width': $('#item_id'+counter).parent().width()});*/
|
|
counter++;
|
|
$('.select2').select2()
|
|
$("#count_items").val(counter);
|
|
$('.date-picker').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true
|
|
})
|
|
});
|
|
|
|
|
|
|
|
$("#myTable.order-list").on("click", "#deletebtn", function(event) {
|
|
// selected_items = jQuery.grep(selected_items, function(value) {
|
|
// return value != $("#item_id" + (counter - 1)).val();
|
|
// });
|
|
$(this).closest("tr").remove();
|
|
});
|
|
|
|
|
|
});
|
|
</script>
|
|
|
|
<?php include_once('form/send_mail.php'); ?>
|
|
<?php include('opd_injury_common_code.php'); ?>
|
|
<?php include('consumables.php'); ?>
|