";
$space = " ";
$isEmergency = "";
$isInjury = "";
$checkup_id = getTableFieldValue('checkup_form', 'checkup_id', 'appointment_id', $appointment_id);
$view_link = $space . "";
$edit_link = $space . "";
$followup_links = "";
$query_followup = "select * from followup_details where appointment_id='" . $row_employee_appointment['appointment_id'] . "' and ((doctor_attended_flag='N' and attended_status='DRP') or (doctor_attended_flag='Y' and attended_status='MDP') or (doctor_attended_flag='Y' and attended_status='DRP')) and appointment_type='O' and ohc_type_id='" . $_SESSION['current_ohcttype'] . "' ";
error_log("Patient_Search_followup:" . $query_followup);
if (!$result_followup = @mysqli_query($conn, $query_followup)) {
exit(mysqli_error($conn));
}
if (mysqli_num_rows($result_followup) > 0) {
while ($row_followup = mysqli_fetch_assoc($result_followup)) {
if (isAccessible($_SESSION['RoleId'], $menu_key, 'W')) {
$followup_links .= "" . $row_followup["ticket_no"] . "";
}
}
}
if ($row_employee_appointment['current_status'] == 'MRA' && $row_employee_appointment['attended_status'] == 'DRP') {
$print_link = $space . "";
}
// if ($appointment_type == 'I') {
// $isInjury = "Yes";
// $edit_link = "";
// $view_link = "";
// } else {
// $isInjury = "No";
// $edit_link = "";
// $view_link = "";
// }
if ($row_employee_appointment['IsEmergency'] == 1) {
$isEmergency = "Yes";
} else {
$isEmergency = "No";
}
if (!isAccessible($_SESSION['RoleId'], $menu_key, 'R')) {
$view_link = "";
}
if (!isAccessible($_SESSION['RoleId'], $menu_key, 'W')) {
$edit_link = "";
}
$check_results = "SBP:" . $row_employee_appointment['bp_sbp'] . ", DBP:" . $row_employee_appointment['bp_dbp'] . ", FBS:" . $row_employee_appointment['blood_sugar_fbs'] . ", RBS:" . $row_employee_appointment['blood_sugar_rbs'] . ",Temp:" . $row_employee_appointment['temperature'] . ",SPOC2%:" . $row_employee_appointment['spo2_percent'] . ",WEIGHT:" . $row_employee_appointment['weight'] . ",HEIGHT:" . $row_employee_appointment['height'] . ",BMI:" . $row_employee_appointment['bmi'] . ",RESPIARATORY RATE:" . $row_employee_appointment['respiratory_rate'] . ",HEART RATE:" . $row_employee_appointment['heart_rate'] . ",URINE OUTPUT:" . $row_employee_appointment['urine_output'] . ",OXYGEN SUPPLY:" . $row_employee_appointment['oxygen_supply'] . ",AVPU" . $row_employee_appointment['avpu'] . ", MOBILITY:" . $row_employee_appointment['mobility'] . ",TRAMA:" . $row_employee_appointment['trama'] . ", GLASGOW COMA SCALE:" . $row_employee_appointment['glasgow_coma_scale'];
$links = $edit_link . $space . $print_link;
// echo $row_employee_appointment['bp_sbp'];
$data['rows'][] = array(
'id' => $row_employee_appointment['appointment_id'],
'cell' => array(
$count++,
$links,
date_format(date_create($row_employee_appointment['appointment_date']), "d-M-Y H:i A"),
$row_employee_appointment['ticket_no'],
$followup_links,
$row_employee_appointment['emp_code'],
$row_employee_appointment['patient_name'],
$complaints,
$isEmergency,
$isInjury,
$check_results,
$row_employee_appointment['remarks_rece'],
getFieldFromTable('user_name', 'tbl_users', 'user_id', $row_employee_appointment['modified_by'])
)
);
}
$data['rows'][] = array(
'id' => $row['filterkey'],
'cell' => array(
'',
"",
"",
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
''
)
);
echo json_encode($data);
?>