";
}
if ($hasWriteAccess) {
$edit_link = "";
}
if ($hasExecuteAccess) {
$delete_link = "";
}
$space = " ";
$links = $assign_link . $space . $view_link . $space . $edit_link . $space . $delete_link;
$rule_eq = getTableFieldValue('rule_equation', 'rule_equation', 'rule_eq_id', $row1['equation_rule_id']);
$section_name = getTableFieldValue('checkup_form_section', 'section_name', 'section_id', $row1['checkup_form_section_id']);
$abnormality = getFieldFromTable('abnormality_name', 'abnormality', 'abnormality_id', $row1['abnormality']);
$result = getFieldFromTable('parameter_name', 'checkup_parameter', 'checkup_parameter_id', $row1['result']);
$section_id_result = getTableFieldValue('checkup_parameter', 'checkup_form_section_id', 'checkup_parameter_id', $row1['result']);
if ($section_id_result == '' || $section_id_result == null || empty($section_id_result)) {
$is_opd_param = getTableFieldValue('checkup_parameter', 'opd_param', 'checkup_parameter_id', $row1['result']);
if ($is_opd_param == '1') {
$section_name_result = "OPD";
}
$is_inj_param = getTableFieldValue('checkup_parameter', 'inj_param', 'checkup_parameter_id', $row1['result']);
if ($is_inj_param == '1') {
$section_name_result = "INJURY";
}
} else {
$section_name_result = getTableFieldValue('checkup_form_section', 'section_name', 'section_id', $section_id_result);
}
if ($result != null || $result != '' || $result != 0) {
$final_result = $result . " (section==>" . $section_name_result . ")";
} else {
$final_result = "Not Added";
}
$range_type = $row1['range_type'] == 'high' ? "high" : ($row1['range_type'] == 'low' ? "low" : ($row1['range_type'] == 'lb' ? "Low Boundary" : ($row1['range_type'] == 'ub' ? "Upper Boundary" : "")));
if ($row1['color'] != '') {
$color = "";
} else {
$color = "";
}
$risks = getCommaSeperatedValuesForInClause('select health_risk_name from health_risk', 'health_risk_id', $row1['risks']);
$advices = getCommaSeperatedValuesForInClause('select health_advice_name from health_advice', 'health_advice_id', $row1['advices']);
$is_string_rule = $row1['is_string_rule'] == 0 ? "No" : "Yes";
$data['rows'][] = array(
'id' => $row1['rule_eq_id'],
'cell' => array(
$links,
$count++,
$row1['rule_equation'],
$is_string_rule,
$row1['result_disp'],
$abnormality,
$final_result,
$risks,
$advices,
$color,
$range_type
)
);
}
commit();
$data['rows'][] = array(
'id' => $row['filterkey'],
'cell' => array('', "", "", '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '')
);
echo json_encode($data);
?>