From 3d0c9ef756a6264169920f1d96e9bbe03323b187 Mon Sep 17 00:00:00 2001 From: Rod Roark Date: Thu, 21 Mar 2013 13:14:42 -0700 Subject: [PATCH] Added procedure order manifest report for orders that need review or going out on paper. --- interface/orders/order_manifest.php | 227 ++++++++++++++++++++++++++ interface/orders/single_order_results.inc.php | 12 +- 2 files changed, 238 insertions(+), 1 deletion(-) create mode 100644 interface/orders/order_manifest.php diff --git a/interface/orders/order_manifest.php b/interface/orders/order_manifest.php new file mode 100644 index 000000000..f08cd4640 --- /dev/null +++ b/interface/orders/order_manifest.php @@ -0,0 +1,227 @@ + +* +* LICENSE: This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +* +* @package OpenEMR +* @author Rod Roark +*/ + +$sanitize_all_escapes = true; +$fake_register_globals = false; + +require_once("../globals.php"); +require_once("$srcdir/acl.inc"); +require_once("$srcdir/formdata.inc.php"); +require_once("$srcdir/options.inc.php"); +require_once("$srcdir/formatting.inc.php"); +require_once("$srcdir/classes/InsuranceCompany.class.php"); + +function getListItem($listid, $value) { + $lrow = sqlQuery("SELECT title FROM list_options " . + "WHERE list_id = ? AND option_id = ?", + array($listid, $value)); + $tmp = xl_list_label($lrow['title']); + if (empty($tmp)) $tmp = "($report_status)"; + return $tmp; +} + +function myCellText($s) { + if ($s === '') return ' '; + return text($s); +} + +function generate_order_summary($orderid) { + $orow = sqlQuery("SELECT " . + "po.procedure_order_id, po.patient_id, po.date_ordered, po.order_status, " . + "po.date_collected, po.specimen_type, po.specimen_location, " . + "pd.pubpid, pd.lname, pd.fname, pd.mname, pd.DOB, " . + "fe.date, " . + "pp.name AS labname, " . + "u.lname AS ulname, u.fname AS ufname, u.mname AS umname " . + "FROM procedure_order AS po " . + "LEFT JOIN patient_data AS pd ON pd.pid = po.patient_id " . + "LEFT JOIN procedure_providers AS pp ON pp.ppid = po.lab_id " . + "LEFT JOIN users AS u ON u.id = po.provider_id " . + "LEFT JOIN form_encounter AS fe ON fe.pid = po.patient_id AND fe.encounter = po.encounter_id " . + "WHERE po.procedure_order_id = ?", + array($orderid)); + + $patient_id = intval($orow['patient_id']); + $encdate = substr($orow['date'], 0, 10); + + // Get insurance info. + $ins_policy = ''; + $ins_group = ''; + $ins_name = ''; + $ins_addr = ''; + $ins_city = ''; + $ins_state = ''; + $ins_zip = ''; + $irow = getInsuranceDataByDate($patient_id, $encdate, 'primary', + "insd.provider, insd.policy_number, insd.group_number"); + if (!empty($irow['provider'])) { + $ins_policy = $irow['policy_number']; + $ins_group = $irow['group_number']; + $insco = new InsuranceCompany($irow['provider']); + if (!empty($insco)) { + $ins_name = $insco->get_name(); + $tmp = $insco->get_address(); + $ins_addr = $tmp->get_line1(); + $ins_city = $tmp->get_city(); + $ins_state = $tmp->get_state(); + $ins_zip = $tmp->get_zip(); + } + } +?> + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + 
+ + + + + + + + + +\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + } +?> + +
" . text("$procedure_code") . "" . text("$procedure_name") . "" . text("$diagnoses" ) . "
+
+ + + + + + +<?php echo xlt('Order Summary'); ?> + + + + + + diff --git a/interface/orders/single_order_results.inc.php b/interface/orders/single_order_results.inc.php index 0f00bc284..ac5a8a2fe 100644 --- a/interface/orders/single_order_results.inc.php +++ b/interface/orders/single_order_results.inc.php @@ -107,7 +107,17 @@ var mypcc = ''; - + + +"; + echo myCellText($orow['procedure_order_id']); + echo "\n"; +?> + -- 2.11.4.GIT