970 lines
33 KiB
PHP
970 lines
33 KiB
PHP
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
|
|
<div id="opd_form_div" style="display: none">
|
|
<form id="opd_form" name="opd_form">
|
|
|
|
<?php
|
|
|
|
// include autoloader;
|
|
include ('includes/config/config.php');
|
|
include ('log_entry.php');
|
|
include_once ("includes/functions.php");
|
|
|
|
if (isset($_REQUEST['appointment_id_pdf'])) {
|
|
$appoint_id = $_REQUEST['appointment_id_pdf'];
|
|
} else if (isset($_REQUEST['Encrypted_id'])) {
|
|
$appoint_id = base64_decode($_REQUEST['Encrypted_id']);
|
|
} else if (isset($_REQUEST['appointment_idpdf'])) {
|
|
$appoint_id = $_REQUEST['appointment_idpdf'];
|
|
}
|
|
|
|
error_reporting(E_ERROR | E_PARSE);
|
|
error_log("error" . $appoint_id);
|
|
$unitMap = getKeyValueMap('unit_master', 'unit_id', 'unit_name');
|
|
|
|
$queryc = "select * from company_profile ";
|
|
|
|
// echo $query;
|
|
|
|
error_log("APPOINTMENT ID PDF::" . $$appoint_id);
|
|
|
|
$resultc = mysqli_query($conn, $queryc);
|
|
|
|
$row_company = mysqli_fetch_array($resultc);
|
|
|
|
@extract($row_company);
|
|
|
|
$sql_employee_appointment = "select a.*, p.patient_name, p.dept_id, p.emp_code, p.father_name, p.designation_id,employer_contractor_id, patient_cat_id, gender,blood_group,emp_cadre,dob,p.dept_id,p.bu_id,p.section_id,p.bu_id,p.sub_section_id from employee_appointment a, patient_master p where a.emp_id=p.id and appointment_id='" . $appoint_id . "'";
|
|
error_log("error" . $sql_employee_appointment);
|
|
// echo $sql_employee_appointment;
|
|
|
|
error_log("OPD PDF QUERY:" . $sql_employee_appointment);
|
|
|
|
$res_emp_appoint = mysqli_query($conn, $sql_employee_appointment);
|
|
|
|
$rows_emp_appoint = mysqli_fetch_array($res_emp_appoint);
|
|
|
|
@extract($rows_emp_appoint);
|
|
|
|
$patient_name = $rows_emp_appoint['patient_name'];
|
|
$followup_id = $rows_emp_appoint['followup_id'];
|
|
if ($followup_id == '' || $followup_id == null) {
|
|
$followup_id = 0;
|
|
}
|
|
// echo $query;
|
|
$attended_doc = $rows_emp_appoint['doctor_last_attended'];
|
|
$doc_user_id = ($attended_doc != null && $attended_doc != 0 && $attended_doc != "") ? $attended_doc : $rows_emp_appoint['modified_by'];
|
|
|
|
$doc_emp_id = getTableFieldValue('tbl_users', 'emp_id', 'user_id', $doc_user_id, '');
|
|
|
|
error_log($doc_emp_id);
|
|
|
|
$doc_name = getTableFieldValue('patient_master', 'patient_name', 'id', $doc_emp_id, '');
|
|
|
|
|
|
|
|
$result = mysqli_query($conn, $query);
|
|
|
|
$row = mysqli_fetch_array($result);
|
|
|
|
@extract($row);
|
|
|
|
$sql_doc_details = "select * from employee_signature where emp_id='$doc_emp_id'";
|
|
|
|
$result_doc_details = mysqli_query($conn, $sql_doc_details);
|
|
$row_doc_details = mysqli_fetch_array($result_doc_details);
|
|
|
|
$employee_code = $rows_emp_appoint['emp_code'];
|
|
|
|
$father_name = $rows_emp_appoint['father_name'];
|
|
|
|
if ($rows_emp_appoint['IsEmergency'] == 1) {
|
|
|
|
$ans = "Yes";
|
|
} else {
|
|
|
|
$ans = "No";
|
|
}
|
|
|
|
date_default_timezone_set('Asia/Kolkata');
|
|
$date = date('Y-m-d H:i:s');
|
|
$currentDate = date_format(date_create($date), "d-M-Y h:i:sa ");
|
|
$ailment_names = $rows_emp_appoint['ailments_new'];
|
|
$health_advices = $rows_emp_appoint['health_advices_new']; // getCommaSeperatedValuesForInClause("select health_advice_name from health_advice ","health_advice_id",$rows_emp_appoint['health_advices']);
|
|
$tests = $rows_emp_appoint['recommended_tests_new']; // getCommaSeperatedValuesForInClause("select section_name from checkup_form_section ","section_id",$rows_emp_appoint['tests']);
|
|
|
|
?>
|
|
|
|
|
|
|
|
<style>
|
|
th {
|
|
font-size: 12px;
|
|
vertical-align: top;
|
|
}
|
|
|
|
td {
|
|
text-align: left;
|
|
font-size: 11px;
|
|
vertical-align: top;
|
|
/* white-space: nowrap; */
|
|
/* overflow-wrap: break-word; */
|
|
/* word-break: break-all !important; */
|
|
}
|
|
|
|
td span,
|
|
div span {
|
|
font-weight: bold;
|
|
}
|
|
</style>
|
|
|
|
</head>
|
|
|
|
|
|
<body>
|
|
<div style="display: flex; align-items: center; justify-content: space-between;">
|
|
<div style="flex: 0 0 auto; margin-right: 20px;">
|
|
<?php if (isset($row_company['company_logo']) && $row_company['company_logo'] != null) { ?>
|
|
<img src="data:<?php echo $row_company['image_type'] ?>;base64,<?php echo base64_encode($row_company['company_logo']) ?>"
|
|
style="width: 140px; height: 60px; margin: 0px; padding: 0px;">
|
|
<?php } ?>
|
|
</div>
|
|
<div style="flex: 1; text-align: center;">
|
|
<div style="font-size: 15px;">
|
|
<?php echo $row_company['company_name'] ?>
|
|
</div>
|
|
<div style="font-size: 12px;">Occupational Health Center</div>
|
|
<div style="font-size: 10px;">
|
|
<?php echo $row_company['address'] ?>
|
|
</div>
|
|
<div style="margin-top: 10px;">
|
|
<strong style="text-decoration: underline;">PRESCRIPTION</strong>
|
|
</div>
|
|
</div>
|
|
<?php if (isset($row_company['right_com_logo']) && $row_company['right_com_logo'] != null) { ?>
|
|
<div style="flex: 0 0 auto; margin-left: 20px;">
|
|
<img src="data:<?php echo $row_company['right_image_type'] ?>;base64,<?php echo base64_encode($row_company['right_com_logo']) ?>"
|
|
style="width: 150px; height: 60px; margin: 0px; padding: 0px;">
|
|
</div>
|
|
<?php } ?>
|
|
</div>
|
|
|
|
|
|
<table style="border: 1px solid black;font-size: 11px" width="100%">
|
|
<tr>
|
|
|
|
<td>MRN:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['ticket_no'] ?>
|
|
</span>
|
|
</td>
|
|
|
|
<td width="50%">EMPLOYEE ID:
|
|
<span>
|
|
<?php echo $employee_code ?>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td width="50%">PATIENT NAME:
|
|
<span>
|
|
<?php echo $patient_name ?>
|
|
</span>
|
|
</td>
|
|
|
|
|
|
<td width="50%">FATHER'S NAME:
|
|
<span>
|
|
<?php echo $father_name ?>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td width="50%">AGE:
|
|
<span>
|
|
<?php echo isset($rows_emp_appoint['dob']) ? date_diff(date_create($rows_emp_appoint['dob']), date_create('today'))->y : "Not Available"; ?>
|
|
Years
|
|
</span>
|
|
</td>
|
|
|
|
<td width="50%">GENDER:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['gender'] == 'M' ? "Male" : "Female" ?>
|
|
</span>
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td width="50%">DEPARTMENT:
|
|
<span>
|
|
<?php echo getTableFieldValue('department', 'dept_name', 'dept_id', $rows_emp_appoint['dept_id'], ''); ?>
|
|
</span>
|
|
</td>
|
|
|
|
<td width="50%">
|
|
|
|
SECTION:
|
|
<span>
|
|
<?php echo getTableFieldValue('section', 'section_name', 'section_id', $rows_emp_appoint['section_id'], ''); ?>
|
|
</span>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
<tr>
|
|
<td width="50%">IN TIME:
|
|
<span>
|
|
<?php
|
|
if ($rows_emp_appoint['appointment_date'] != "") {
|
|
echo date_format(date_create($rows_emp_appoint['appointment_date']), "d-M-Y h:i:sa ") ;
|
|
}
|
|
?>
|
|
</span>
|
|
</td>
|
|
|
|
<td width="50%">CLEARANCE TIME:
|
|
<span>
|
|
<?php
|
|
if ($rows_emp_appoint['clearance_time'] != "") {
|
|
echo date_format(date_create($rows_emp_appoint['clearance_time']), "d-M-Y h:i:sa ") ;
|
|
}
|
|
?>
|
|
</span>
|
|
</td>
|
|
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<?php if ($rows_emp_appoint['weight'] != 0 && $rows_emp_appoint['weight'] != '') { ?>
|
|
<div style="width: 10%; display: inline; font-size: 12px; text-transform: capitalize;">
|
|
Weight:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['weight'] ?> kg
|
|
</span>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if ($rows_emp_appoint['height'] != 0 && $rows_emp_appoint['height'] != '') { ?>
|
|
<div style="width: 15%; display: inline; font-size: 12px ; text-transform: capitalize;">
|
|
Height:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['height'] ?> cm
|
|
</span>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if ($rows_emp_appoint['bmi'] != 0 && $rows_emp_appoint['bmi'] != '') { ?>
|
|
<div style="width: 15%; display: inline; font-size: 12px; text-transform: capitalize;">
|
|
BMI:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['bmi'] ?>
|
|
</span>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if (($rows_emp_appoint['bp_sbp'] != 0 || $rows_emp_appoint['bp_sbp'] != '') && ($rows_emp_appoint['bp_dbp'] != 0 || $rows_emp_appoint['bp_dbp'] != '')) { ?>
|
|
<div style="width: 10%; display: inline; font-size: 12px;">
|
|
BP:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['bp_sbp'] ?>/
|
|
<?php echo $rows_emp_appoint['bp_dbp'] ?> mmhg
|
|
</span>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if ($rows_emp_appoint['heart_rate'] != 0 && $rows_emp_appoint['heart_rate'] != '') { ?>
|
|
<div style="width: 15%; display: inline; font-size: 12px; text-transform: capitalize;">
|
|
Pulse:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['heart_rate'] ?>min
|
|
</span>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if ($rows_emp_appoint['temperature'] != 0 || $rows_emp_appoint['temperature'] != '') { ?>
|
|
<div style="width: 15%; display: inline; font-size: 12px; text-transform: capitalize;">
|
|
Temp:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['temperature'] ?>F
|
|
</span>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if ($rows_emp_appoint['spo2_percent'] != 0 || $rows_emp_appoint['spo2_percent'] != '') { ?>
|
|
<div style="width: 15%; display: inline; font-size: 12px; text-transform: capitalize; ">
|
|
SPO2%:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['spo2_percent'] ?>%
|
|
</span>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if ($rows_emp_appoint['blood_sugar_rbs'] != 0 || $rows_emp_appoint['blood_sugar_rbs'] != '') { ?>
|
|
<div style="width: 15%; display: inline; font-size: 12px;">
|
|
RBS:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['blood_sugar_rbs'] ?>mg/dl
|
|
</span>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if ($rows_emp_appoint['blood_sugar_fbs'] != 0 || $rows_emp_appoint['blood_sugar_fbs'] != '') { ?>
|
|
<div style="width: 15%; display: inline; font-size: 12px;">
|
|
FBS:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['blood_sugar_fbs'] ?>mg/dl
|
|
</span>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if ($rows_emp_appoint['blood_sugar_ppbs'] != 0 || $rows_emp_appoint['blood_sugar_ppbs'] != '') { ?>
|
|
<div style="width: 15%; display: inline; font-size: 12px;">
|
|
PPBS:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['blood_sugar_ppbs'] ?> mg/dl
|
|
</span>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if ($rows_emp_appoint['respiratory_rate'] != 0 && $rows_emp_appoint['respiratory_rate'] != '') { ?>
|
|
<div style="width: 15%; display: inline; font-size: 12px; text-transform: capitalize;">
|
|
Respiratory Rate:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['respiratory_rate'] ?>
|
|
</span>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if ($rows_emp_appoint['urine_ouput'] != 0 || $rows_emp_appoint['urine_ouput'] != '') { ?>
|
|
<div style="width: 15%; display: inline; font-size: 12px; text-transform: capitalize;">
|
|
Urine Output:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['urine_ouput'] ?>
|
|
</span>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
|
|
<?php if ($rows_emp_appoint['avpu'] != 0 && $rows_emp_appoint['avpu'] != '') { ?>
|
|
<div style="width: 15%; display: inline; font-size: 12px; text-transform: capitalize;">
|
|
AVPU:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['avpu'] ?>
|
|
</span>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if ($rows_emp_appoint['trama'] != 0 && $rows_emp_appoint['trama'] != '') { ?>
|
|
<div style="width: 15%; display: inline; font-size: 12px; text-transform: capitalize;">
|
|
Trama:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['trama'] ?>
|
|
</span>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if ($rows_emp_appoint['mobility'] != 0 && $rows_emp_appoint['mobility'] != '') { ?>
|
|
<div style="width: 15%; display: inline; font-size: 12px; text-transform: capitalize;">
|
|
Mobility:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['mobility'] ?>
|
|
</span>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if ($rows_emp_appoint['oxygen_supply'] != 0 && $rows_emp_appoint['oxygen_supply'] != '') { ?>
|
|
<div style="width: 15%; display: inline; font-size: 12px; text-transform: capitalize;">
|
|
Oxygen Supplementation:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['oxygen_supply'] ?>
|
|
</span>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if ($rows_emp_appoint['glasgow_coma_scale'] != 0 && $rows_emp_appoint['glasgow_coma_scale'] != '') { ?>
|
|
<div style="width: 15%; display: inline; font-size: 12px; text-transform: capitalize;">
|
|
Glasgow coma scale:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['glasgow_coma_scale'] ?>
|
|
</span>
|
|
</div>
|
|
<?php } ?>
|
|
<?php if ($rows_emp_appoint['grbs'] != 0 && $rows_emp_appoint['grbs'] != '') { ?>
|
|
<div style="width: 15%; display: inline; font-size: 12px; text-transform: capitalize;">
|
|
GRBS:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['grbs'] ?>
|
|
</span>
|
|
</div>
|
|
<?php } ?>
|
|
<?php if ($rows_emp_appoint['bac_level'] != 0 && $rows_emp_appoint['bac_level'] != '') { ?>
|
|
<div style="width: 15%; display: inline; font-size: 12px; text-transform: capitalize;">
|
|
BAC Levels:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['bac_level'] ?>
|
|
</span>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if ($rows_emp_appoint['total_cholesterol'] != 0 && $rows_emp_appoint['total_cholesterol'] != '') { ?>
|
|
<div style="width: 15%; display: inline; font-size: 12px; text-transform: capitalize;">
|
|
Total Cholesterol:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['total_cholesterol'] ?>
|
|
</span>
|
|
</div>
|
|
<?php } ?>
|
|
<br>
|
|
|
|
|
|
<table width="100%">
|
|
|
|
<?php
|
|
|
|
$complaint_ids = $rows_emp_appoint['complaints'];
|
|
$complaint_ids_array = array();
|
|
$complaint_ids_array = explode(",", $complaint_ids);
|
|
$complaints = "";
|
|
for ($i = 0; $i < count($complaint_ids_array); $i++) {
|
|
if ($i == 0) {
|
|
if (is_numeric($complaint_ids_array[$i])) {
|
|
$complaints = getTableFieldValue('complaints', 'complaint', 'complaint_id', $complaint_ids_array[$i]);
|
|
} else {
|
|
$complaints = $complaint_ids_array[$i];
|
|
}
|
|
} else {
|
|
if (is_numeric($complaint_ids_array[$i])) {
|
|
$complaints = $complaints . "," . getTableFieldValue('complaints', 'complaint', 'complaint_id', $complaint_ids_array[$i]);
|
|
} else {
|
|
$complaints = $complaints . "," . $complaint_ids_array[$i];
|
|
}
|
|
}
|
|
}
|
|
|
|
$referral_ids = $rows_emp_appoint['referral'];
|
|
$referral_ids_array = array();
|
|
$referral_ids_array = explode(",", $referral_ids);
|
|
$referral = "";
|
|
for ($i = 0; $i < count($referral_ids_array); $i++) {
|
|
if ($i == 0) {
|
|
$referral = getTableFieldValue('referral_point', 'referral_point_name', 'referral_point_id', $referral_ids_array[$i]);
|
|
} else {
|
|
$referral = $referral . "," . getTableFieldValue('referral_point', 'referral_point_name', 'referral_point_id', $referral_ids_array[$i]);
|
|
}
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
<?php
|
|
$ailment_names_ids = $rows_emp_appoint['ailments_new'];
|
|
$ailment_names_ids_array = array();
|
|
$ailment_names_ids_array = explode(",", $ailment_names_ids);
|
|
$ailment_names = "";
|
|
for ($i = 0; $i < count($ailment_names_ids_array); $i++) {
|
|
if ($i == 0) {
|
|
$ailment_names = getTableFieldValue('ailment', 'ailment_name', 'ailment_id', $ailment_names_ids_array[$i]);
|
|
} else {
|
|
$ailment_names = $ailment_names . "," . getTableFieldValue('ailment', 'ailment_name', 'ailment_id', $ailment_names_ids_array[$i]);
|
|
}
|
|
}
|
|
$ailment_system_ids = $rows_emp_appoint['ailment_systems_new'];
|
|
$ailment_system_ids_array = array();
|
|
$ailment_system_ids_array = explode(",", $ailment_system_ids);
|
|
$ailment_systems = "";
|
|
for ($i = 0; $i < count($ailment_system_ids_array); $i++) {
|
|
if ($i == 0) {
|
|
$ailment_systems = getTableFieldValue('ailment_system', 'ailment_sys_name', 'ailment_sys_id', $ailment_system_ids_array[$i]);
|
|
} else {
|
|
$ailment_systems = $ailment_systems . "," . getTableFieldValue('ailment_system', 'ailment_sys_name', 'ailment_sys_id', $ailment_system_ids_array[$i]);
|
|
}
|
|
}
|
|
|
|
$findings_ids = $rows_emp_appoint['examination_remarks'];
|
|
$findings_ids_array = array();
|
|
$findings_ids_array = explode(",", $findings_ids);
|
|
$findings = "";
|
|
for ($i = 0; $i < count($findings_ids_array); $i++) {
|
|
if ($i == 0) {
|
|
$findings = getTableFieldValue('examination_findings', 'examination_finding', 'id', $findings_ids_array[$i]);
|
|
} else {
|
|
$findings = $findings . "," . getTableFieldValue('examination_findings', 'examination_finding', 'id', $findings_ids_array[$i]);
|
|
}
|
|
}
|
|
|
|
|
|
?>
|
|
|
|
<tr>
|
|
<td width="30%" style="text-transform: capitalize;">Complaints :
|
|
<span>
|
|
<?php echo ucwords(strtolower($complaints)) ?>
|
|
</span>
|
|
</td>
|
|
|
|
<td width="30%" style="text-transform: capitalize;">Diagnosis:
|
|
<span>
|
|
<?php echo ucwords(strtolower($ailment_names)) ?>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="30%" style="text-transform: capitalize;">Examination Findings :
|
|
<span>
|
|
<?php echo ucwords(strtolower($findings)) ?>
|
|
</span>
|
|
</td>
|
|
|
|
<td width="30%" style="text-transform: capitalize;">Body System:
|
|
<span>
|
|
<?php echo ucwords(strtolower($ailment_systems)) ?>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td width="32%" align="left">Remarks/Follow-up
|
|
Investigation Details:
|
|
<span>
|
|
<?php echo nl2br($rows_emp_appoint['remarks_rece']) ?>
|
|
</span>
|
|
</td>
|
|
|
|
<td width="32%" align="left">Disease Type:
|
|
<span>
|
|
<?php echo $disease_type; ?>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td width="50%" style="text-transform: capitalize;">Advices:
|
|
<span>
|
|
<?php echo nl2br(ucwords(strtolower($health_advices))) ?>
|
|
</span>
|
|
</td>
|
|
|
|
<td width="50%" style="text-transform: capitalize;">Chronic Illness:
|
|
<span>
|
|
<?php
|
|
echo ucwords(strtolower(getCommaSeperatedValuesForInClause("select abnormality_name from abnormality", "abnormality_id", $rows_emp_appoint['abnormalitys'])));
|
|
?>
|
|
</span>
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
<tr>
|
|
|
|
<td width="50%" style="text-transform: capitalize;">H/o of Drug Allergy:
|
|
<span>
|
|
<?php
|
|
echo ucwords(strtolower(getDrugAllergyData($rows_emp_appoint['emp_id'])));
|
|
?>
|
|
</span>
|
|
</td>
|
|
|
|
</tr>
|
|
</table>
|
|
|
|
<?php if ($rows_emp_appoint['is_detention'] == 'Y') { ?>
|
|
|
|
<h4>Detention Details</h4>
|
|
|
|
<table class="table table-striped table-bordered table-hover" style="width: 100%; border: 1px;">
|
|
<tr bgcolor="#eeeeee">
|
|
<td width="4%">Sr</td>
|
|
<td width="20%">Medicine</td>
|
|
<td width="15%">Admin. Route</td>
|
|
<td width="10%">Qty Issued</td>
|
|
</tr>
|
|
|
|
<?php $sql_detention = "select * from detention_intake where det_id = '" . $appoint_id . "'";
|
|
$result_detention = mysqli_query($conn, $sql_detention);
|
|
$count = 0;
|
|
while ($row_detention = mysqli_fetch_array($result_detention)) {
|
|
$medicine = $row_detention['medicine'];
|
|
$srno = $count + 1;
|
|
$unit_id = getFieldFromTable("unit_id", "tbl_items", "item_id", $medicine);
|
|
?>
|
|
|
|
<tr>
|
|
<td>
|
|
<span>
|
|
<?php echo $srno ?>
|
|
</span>
|
|
</td>
|
|
<td>
|
|
<span>
|
|
<?php echo getItemWithFormName($medicine) ?>
|
|
</span>
|
|
</td>
|
|
<td>
|
|
<span>
|
|
<?php echo strtoupper(getTableFieldValue('dosage_category', 'dosage_category', 'dosage_category_id', $row_detention['administration_route'])) ?>
|
|
</span>
|
|
</td>
|
|
<td>
|
|
<span>
|
|
<?php echo $row_detention['issued_qty'] ?>
|
|
</span>
|
|
<span>
|
|
<?php echo $unitMap[$unit_id] ?>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
|
|
<?php $count++;
|
|
} ?>
|
|
|
|
</table>
|
|
|
|
|
|
<h4>Rx</h4>
|
|
|
|
<?php } ?>
|
|
|
|
<br>
|
|
|
|
|
|
<?php $appointment_id = $appoint_id; ?>
|
|
|
|
<?php include ('treatment_view_common.php'); ?>
|
|
|
|
<br>
|
|
<table width="100%">
|
|
|
|
<?php
|
|
$dr_name = getTableFieldValue('referral_point', 'referral_point_name', 'referral_point_id', $rows_emp_appoint['referral']);
|
|
$spe = getTableFieldValue('referral_point', 'city', 'referral_point_id', $rows_emp_appoint['referral']);
|
|
$hospital_name = getTableFieldValue('referral_point', 'hospital_name', 'referral_point_id', $rows_emp_appoint['referral']);
|
|
|
|
?>
|
|
|
|
|
|
<tr>
|
|
|
|
<td width="30%" align="left">Referral:
|
|
<span>
|
|
<?php echo $dr_name . " - " . $spe . "(" . $hospital_name . ")"; ?>
|
|
</span>
|
|
</td>
|
|
|
|
|
|
<td width="30%" align="left">Follow-up date:
|
|
<span>
|
|
<?php
|
|
$followup_date = date_create($rows_emp_appoint['followup']);
|
|
if (!empty($rows_emp_appoint['followup']) && $rows_emp_appoint['followup'] != "30/11/-0001" && $rows_emp_appoint['followup'] != '0000-00-00' && $rows_emp_appoint['followup'] != '1970-01-01') {
|
|
echo date_format($followup_date, "d/m/Y");
|
|
}
|
|
|
|
?>
|
|
</span>
|
|
</td>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td width="50%" style="word-wrap: break-word; word-break: break-all;">Recommended Tests:
|
|
<span>
|
|
<?php
|
|
echo determineDataFormat($rows_emp_appoint['recommended_tests_new'])
|
|
?>
|
|
</span>
|
|
</td>
|
|
<td width="50%" style="word-wrap: break-word; word-break: break-all;">Recommended Test Parameters:
|
|
<span>
|
|
<?php
|
|
echo ucwords(strtolower(getCommaSeperatedValuesForInClause("select Parameter_name from checkup_parameter", "checkup_parameter_id", $rows_emp_appoint['recommended_test_param_new'])));
|
|
?>
|
|
</span>
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
$sql_get_sick = "SELECT date_absent,date_absent_to,half_day,approval_date FROM sickness WHERE followup_to_opd = '" . $appoint_id . "' and followup_id = '" . $followup_id . "' ";
|
|
error_log("error" . $sql_get_sick);
|
|
// echo $sql_get_sick;
|
|
|
|
error_log("OPD PDF QUERY:" . $sql_get_sick);
|
|
|
|
$res_det_sick = mysqli_query($conn, $sql_get_sick);
|
|
|
|
$data_for_sick = mysqli_fetch_array($res_det_sick);
|
|
|
|
@extract($data_for_sick);
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<td width="50%" style="word-wrap: break-word; word-break: break-all;">Doctor Comment:
|
|
<span>
|
|
<?php echo $rows_emp_appoint['doc_comment'] ?>
|
|
</span>
|
|
</td>
|
|
<td width="50%" align="left">Half Day:
|
|
<span>
|
|
<?php if ($data_for_sick['half_day'] == 1) {
|
|
echo "YES";
|
|
} ?>
|
|
</span>
|
|
</td>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
<td width="50%" align="left">Period Of Rest From:
|
|
<span>
|
|
<?php
|
|
$rest_from_time = date_create($data_for_sick['date_absent']);
|
|
if ($data_for_sick['date_absent'] != null && !empty($data_for_sick['date_absent']) && $data_for_sick['date_absent'] != '0000-00-00') {
|
|
echo date_format($rest_from_time, "d/m/Y");
|
|
}
|
|
|
|
|
|
?>
|
|
</span>
|
|
</td>
|
|
|
|
<td width="50%" align="left">Period Of Rest To:
|
|
<span>
|
|
<?php
|
|
$rest_to_time = date_create($data_for_sick['date_absent_to']);
|
|
if ($data_for_sick['date_absent_to'] != null && !empty($data_for_sick['date_absent_to']) && $data_for_sick['date_absent_to'] != '0000-00-00') {
|
|
echo date_format($rest_to_time, "d/m/Y");
|
|
}
|
|
?>
|
|
</span>
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Fitness Date:
|
|
<span>
|
|
<?php $approved_date = date_create($data_for_sick['approval_date']);
|
|
if ($data_for_sick['approval_date'] != null && !empty($data_for_sick['approval_date']) && $data_for_sick['approval_date'] != '0000-00-00') {
|
|
echo date_format($approved_date, "d/m/Y");
|
|
}
|
|
?>
|
|
</span>
|
|
</td>
|
|
|
|
<td width="50%" align="left" style="word-wrap: break-word; word-break: break-all;">Leave Remarks:
|
|
<span>
|
|
<?php
|
|
echo $rows_emp_appoint['injury_remarks']; ?>
|
|
</span>
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>Ambulance Out Time:
|
|
<span>
|
|
<?= $rows_emp_appoint['ambulance_out_time'] != null ? date_format(date_create($rows_emp_appoint['ambulance_out_time']), "d-M-Y h:i:sa ") : 'NA' ?>
|
|
</span>
|
|
</td>
|
|
|
|
<td width="50%" align="left">Ambulance In Time:
|
|
<span>
|
|
<?= $rows_emp_appoint['ambulance_in_time'] != null ? date_format(date_create($rows_emp_appoint['ambulance_in_time']), "d-M-Y h:i:sa ") : 'NA' ?>
|
|
</span>
|
|
</td>
|
|
|
|
</tr>
|
|
<tr>
|
|
|
|
|
|
<td>Treatment from outside or self-treatment:
|
|
<span>
|
|
<?php echo ($rows_emp_appoint['additional_treatment_info'] == 'Y') ? "Yes" : "No"; ?>
|
|
</span>
|
|
</td>
|
|
|
|
<td width="50%" align="left">Is Hospitalized
|
|
<span>
|
|
<?php echo ($rows_emp_appoint['is_hospitalized'] == 'Y') ? "Yes" : "No"; ?>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
</table>
|
|
|
|
<br>
|
|
<table width="100%">
|
|
<tr>
|
|
<td><img src="data:<?php echo $row_doc_details['image_type'] ?>;base64,<?php echo base64_encode($row_doc_details['emp_sign']) ?>"
|
|
style="width: 120px; height: 80px;float: right" /></td>
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<table width="100%">
|
|
<tr>
|
|
<td><span style="float: right;">Signature & Stamp</span></td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<table width="100%">
|
|
<tr>
|
|
<td><span style="float: right;">
|
|
<?php
|
|
echo $doc_name . " ," . $row_doc_details['qualification'];
|
|
?>
|
|
</span></td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<table width="100%">
|
|
<tr>
|
|
|
|
<td><span style="float: right;">KMC Reg No:
|
|
<?php echo $row_doc_details['registration_no'] ?>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
<br>
|
|
|
|
<hr>
|
|
<table cellspacing="0" width="100%">
|
|
<tr>
|
|
<td>
|
|
Note: <br>
|
|
<span style="word-wrap: break-word; word-break: break-all;">
|
|
<ul>
|
|
<li> If symptoms persists/Aggravates/worsens Review immediately </li>
|
|
<li>This medicine has been prescribed for current ailments only. </li>
|
|
<li>Do not take it more often or for a longer period than advised. </li>
|
|
<li>If you notice any untoward reaction like skin rash, itching, epigastric burning, or
|
|
breathlessness
|
|
- stop taking the medicines and review immediately. </li>
|
|
<li>Do not share medicines with others without consultation. </li>
|
|
<li>Avoid self-Medication. </li>
|
|
<li>Please do not substitute medicines. </li>
|
|
</ul>
|
|
</span>
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<hr>
|
|
<table cellspacing="0" width="100%">
|
|
|
|
<tr>
|
|
|
|
<td style="text-align:center">
|
|
<strong>Do not Dispense again, unless re-prescribed.</strong>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
|
|
<td style="text-align:center">
|
|
<strong>Please bring this prescription with you during your next visit.</strong>
|
|
</td>
|
|
</tr>
|
|
<!-- <tr>
|
|
|
|
<td style="text-align:center">
|
|
<strong>PREVENTION IS BETTER THAN CURE</strong>
|
|
</td>
|
|
</tr> -->
|
|
<!-- <tr>
|
|
<td style="text-align: center">
|
|
<strong>NOTE: NOT FOR USE MEDICO LEGAL PURPOSES</strong>
|
|
</td>
|
|
</tr> -->
|
|
</table>
|
|
|
|
|
|
|
|
|
|
</form>
|
|
|
|
<?php
|
|
|
|
if($_REQUEST['attachment'] == 'pdf'){?>
|
|
|
|
<form id="employeeDetailsFormPdf" action="" method="POST">
|
|
|
|
<input type="text" name="htmlText" id="htmlText" />
|
|
<input type="hidden" name="param" id="param" value="<?php echo $patient_name . "_" ."OPD" ?>" />
|
|
<input type="hidden" name="param_value" id="param_value" value="<?php echo $appoint_id ?>" />
|
|
|
|
</form>
|
|
|
|
<script>
|
|
formSubmit();
|
|
|
|
function formSubmit() {
|
|
|
|
$("#htmlText").val($("#opd_form").html());
|
|
|
|
document.forms['employeeDetailsFormPdf'].action = "generate_html_pdf.php";
|
|
|
|
document.forms['employeeDetailsFormPdf'].method = "post";
|
|
|
|
document.forms['employeeDetailsFormPdf'].submit();
|
|
|
|
}
|
|
</script>
|
|
|
|
<?php
|
|
} else{
|
|
|
|
?>
|
|
<form id="employeeDetailsFormPdf" action="" method="POST">
|
|
|
|
<input type="hidden" name="htmlText" id="htmlText" />
|
|
|
|
</form>
|
|
</div>
|
|
<script>
|
|
formSubmit();
|
|
|
|
function formSubmit() {
|
|
|
|
$("#htmlText").val($("#opd_form").html());
|
|
|
|
document.forms['employeeDetailsFormPdf'].action = "pdf_dynamic.php";
|
|
|
|
document.forms['employeeDetailsFormPdf'].method = "post";
|
|
|
|
document.forms['employeeDetailsFormPdf'].submit();
|
|
|
|
}
|
|
</script>
|
|
<?php
|
|
}
|
|
?>
|