* @author Jerry Padgett * @author Brady Miller * @copyright Copyright (C) 2011 Cassian LUP * @copyright Copyright (C) 2016-2017 Jerry Padgett * @copyright Copyright (c) 2019 Brady Miller * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 */ require_once("verify_session.php"); require_once('../library/options.inc.php'); $selects = "po.procedure_order_id, po.date_ordered, pc.procedure_order_seq, " . "pt1.procedure_type_id AS order_type_id, pc.procedure_name, " . "pr.procedure_report_id, pr.date_report, pr.date_collected, pr.specimen_num, " . "pr.report_status, pr.review_status"; $joins = "JOIN procedure_order_code AS pc ON pc.procedure_order_id = po.procedure_order_id " . "LEFT JOIN procedure_type AS pt1 ON pt1.lab_id = po.lab_id AND pt1.procedure_code = pc.procedure_code " . "LEFT JOIN procedure_report AS pr ON pr.procedure_order_id = po.procedure_order_id AND " . "pr.procedure_order_seq = pc.procedure_order_seq"; $orderby = "po.date_ordered, po.procedure_order_id, " . "pc.procedure_order_seq, pr.procedure_report_id"; $where = "1 = 1"; $res = sqlStatement("SELECT $selects " . "FROM procedure_order AS po $joins " . "WHERE po.patient_id = ? AND $where " . "ORDER BY $orderby", array($pid)); if (sqlNumRows($res) > 0) { ?> "; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } } echo "
" . text($date[1] . "/" . $date[2] . "/" . $date[0]) . "" . text($row['procedure_name']) . "" . text($rrow['name']) . "" . generate_display_field(array('data_type' => '1', 'list_id' => 'proc_res_abnormal'), $rrow['abnormal']) . "" . text($rrow['result']) . "" . text($rrow['pt2_range']) . "" . generate_display_field(array('data_type' => '1', 'list_id' => 'proc_unit'), $rrow['pt2_units']) . "" . generate_display_field(array('data_type' => '1', 'list_id' => 'proc_res_status'), $rrow['result_status']) . "" . generate_display_field(array('data_type' => '1', 'list_id' => 'proc_rep_status'), $row['report_status']) . "
"; } else { echo xlt("No Results"); } ?>