From 5220b634e2f1e28c8ce8204d766ba1cd5cad37ba Mon Sep 17 00:00:00 2001 From: Brady Miller Date: Mon, 9 Jan 2017 02:15:00 -0800 Subject: [PATCH] more organization of autoloaded files (#424) --- ccr/transmitCCD.php | 7 +- composer.json | 3 +- .../forms/evaluation/C_FormEvaluation.class.php | 23 +- contrib/forms/evaluation/report.php | 5 +- contrib/forms/example/SQL.php | 5 +- .../forms/prosthesis/C_FormProsthesis.class.php | 23 +- .../C_FormReviewOfSystems.class.php | 19 +- contrib/util/de_identification_upgrade.php | 2 - custom/BillingExport.csv.php | 1 - custom/search.php | 1 - interface/batchcom/batchcom.php | 1 - interface/batchcom/emailnotification.php | 3 +- interface/batchcom/settingsnotification.php | 3 +- interface/batchcom/smsnotification.php | 3 +- interface/billing/edit_payment.php | 1 - interface/billing/new_payment.php | 11 +- .../de_identification_screen1.php | 119 +++--- .../de_identification_screen2.php | 2 - .../re_identification_input_screen.php | 15 +- .../re_identification_op_single_patient.php | 3 +- interface/fax/fax_dispatch_newpid.php | 1 - interface/forms/CAMOS/ajax_save.php | 1 - interface/forms/CAMOS/content_parser.php | 15 +- interface/forms/CAMOS/new.php | 67 ++-- interface/forms/CAMOS/rx_print.php | 43 ++- interface/forms/CAMOS/save.php | 1 - interface/forms/eye_mag/SpectacleRx.php | 1 - interface/forms/eye_mag/a_issue.php | 1 - interface/forms/eye_mag/help.php | 131 ++++--- interface/forms/eye_mag/php/Anything_simple.php | 107 +++--- interface/forms/eye_mag/report.php | 1 - interface/forms/eye_mag/taskman.php | 1 - interface/forms/newpatient/save.php | 1 - interface/forms_admin/forms_admin.php | 25 +- interface/globals.php | 10 +- interface/language/language.php | 7 +- interface/main/blank.php | 1 - interface/main/calendar/new_patient_save.php | 1 - interface/main/pwd_expires_alert.php | 6 +- interface/new/new_comprehensive_save.php | 1 - interface/new/new_patient_save.php | 1 - interface/orders/lab_exchange_tools.php | 29 +- interface/patient_file/encounter/blank.php | 1 - interface/patient_file/encounter/copay.php | 2 - interface/patient_file/encounter/diagnosis.php | 3 +- interface/patient_file/encounter/other.php | 3 +- interface/patient_file/encounter/search_code.php | 9 +- .../patient_file/encounter/superbill_codes.php | 1 - .../encounter/superbill_custom_full.php | 1 - .../patient_file/summary/add_edit_amendments.php | 45 ++- .../patient_file/summary/advancedirectives.php | 1 - .../patient_file/summary/create_portallogin.php | 27 +- interface/patient_file/summary/disc_fragment.php | 11 +- interface/patient_file/summary/disclosure_full.php | 1 - interface/patient_file/summary/immunizations.php | 183 +++++---- interface/patient_file/summary/list_amendments.php | 15 +- interface/patient_file/summary/patient_picture.php | 1 - .../patient_file/summary/print_amendments.php | 9 +- .../patient_file/summary/record_disclosure.php | 31 +- interface/patient_file/summary/shot_record.php | 69 ++-- interface/reports/edi_271.php | 95 +++-- interface/reports/index.php | 11 +- interface/reports/services_by_category.php | 1 - interface/usergroup/facilities.php | 1 - interface/usergroup/facilities_add.php | 1 - interface/usergroup/facility_admin.php | 1 - interface/usergroup/facility_user.php | 9 +- interface/usergroup/facility_user_admin.php | 11 +- interface/usergroup/ssl_certificates_admin.php | 48 ++- interface/usergroup/user_admin.php | 1 - interface/usergroup/user_info.php | 1 - interface/usergroup/usergroup_admin.php | 1 - interface/usergroup/usergroup_admin_add.php | 1 - ippf_upgrade.php | 1 - library/ESign/ESign.php | 17 +- library/ajax/addlistitem.php | 9 +- library/ajax/execute_background_services.php | 19 +- library/ajax/facility_ajax_code.php | 1 - library/ajax/find_patients.php | 3 +- library/ajax/payment_ajax.php | 9 +- library/ajax/prescription_drugname_lookup.php | 3 +- library/api.inc | 11 +- library/auth.inc | 23 +- library/billing.inc | 2 - library/billrep.inc | 19 +- library/classes/ORDataObject.class.php | 15 +- library/classes/Prescription.class.php | 74 ++-- library/direct_message_check.inc | 43 ++- library/forms.inc | 9 +- library/log.inc | 10 +- library/patient.inc | 115 +++--- library/pnotes.inc | 38 +- library/registry.inc | 11 +- library/report.inc | 11 +- library/smarty/plugins/function.xl.php | 7 +- library/sql.inc | 16 +- library/transactions.inc | 1 - library/translation.inc.php | 1 - library/user.inc | 23 +- myportal/soap_service/server_side.php | 411 ++++++++++----------- patients/get_patient_info.php | 2 + sql_patch.php | 30 +- sql_upgrade.php | 1 - tests/unit/BaseHarness.class.php | 2 - vendor/composer/autoload_files.php | 1 + vendor/composer/autoload_static.php | 1 + 106 files changed, 1064 insertions(+), 1172 deletions(-) diff --git a/ccr/transmitCCD.php b/ccr/transmitCCD.php index aee69f948..3439dccc8 100644 --- a/ccr/transmitCCD.php +++ b/ccr/transmitCCD.php @@ -25,14 +25,13 @@ */ require_once(dirname(__FILE__) . "/../library/log.inc"); -require_once(dirname(__FILE__) . "/../library/sql.inc"); require_once(dirname(__FILE__) . "/../library/patient.inc"); require_once(dirname(__FILE__) . "/../library/direct_message_check.inc"); /* * Connect to a phiMail Direct Messaging server and transmit * a CCD document to the specified recipient. If the message is accepted by the - * server, the script will return "SUCCESS", otherwise it will return an error msg. + * server, the script will return "SUCCESS", otherwise it will return an error msg. * @param DOMDocument ccd the xml data to transmit, a CCDA document is assumed * @param string recipient the Direct Address of the recipient * @param string requested_by user | patient @@ -69,7 +68,7 @@ function transmitCCD($ccd,$recipient,$requested_by,$xml_type="CCD") { $ret = phimail_write_expect_OK($fp,"TO $recipient\n"); if($ret!==TRUE) return( xl("Delivery is not allowed to the specified Direct Address.") ); - + $ret=fgets($fp,1024); //ignore extra server data if($requested_by=="patient") @@ -129,7 +128,7 @@ function transmitCCD($ccd,$recipient,$requested_by,$xml_type="CCD") { /** * If we get here, the message was successfully sent and the return * value $ret is of the form "QUEUED recipient message-id" which - * is suitable for logging. + * is suitable for logging. */ $msg_id=explode(" ",trim($ret),4); if($msg_id[0]!="QUEUED" || !isset($msg_id[2])) { //unexpected response diff --git a/composer.json b/composer.json index 5af59c912..1788d53bb 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,8 @@ "library/formdata.inc.php", "library/sanitize.inc.php", "library/date_functions.php", - "library/validation/validate_core.php" + "library/validation/validate_core.php", + "library/translation.inc.php" ] }, "config": { diff --git a/contrib/forms/evaluation/C_FormEvaluation.class.php b/contrib/forms/evaluation/C_FormEvaluation.class.php index bfcaa9585..366678dd2 100644 --- a/contrib/forms/evaluation/C_FormEvaluation.class.php +++ b/contrib/forms/evaluation/C_FormEvaluation.class.php @@ -2,13 +2,12 @@ require_once ($GLOBALS['fileroot'] . "/library/classes/Controller.class.php"); require_once ($GLOBALS['fileroot'] . "/library/forms.inc"); -require_once ($GLOBALS['fileroot'] . "/library/sql.inc"); require_once("FormEvaluation.class.php"); class C_FormEvaluation extends Controller { var $template_dir; - + function C_FormEvaluation($template_mod = "general") { parent::Controller(); $this->template_mod = $template_mod; @@ -17,14 +16,14 @@ class C_FormEvaluation extends Controller { $this->assign("DONT_SAVE_LINK", $GLOBALS['form_exit_url']); $this->assign("STYLE", $GLOBALS['style']); } - + function default_action() { $evaluation = new FormEvaluation(); $this->assign("checks",$evaluation->_form_layout()); $this->assign("evaluation",$evaluation); return $this->fetch($this->template_dir . $this->template_mod . "_new.html"); } - + function view_action($form_id) { if (is_numeric($form_id)) { $evaluation = new FormEvaluation($form_id); @@ -38,35 +37,35 @@ class C_FormEvaluation extends Controller { return $this->fetch($this->template_dir . $this->template_mod . "_new.html"); } - + function default_action_process() { if ($_POST['process'] != "true") return; $this->evaluation = new FormEvaluation($_POST['id']); parent::populate_object($this->evaluation); - + $this->evaluation->persist(); if ($GLOBALS['encounter'] == "") { $GLOBALS['encounter'] = date("Ymd"); } addForm($GLOBALS['encounter'], "Evaluation Form", $this->evaluation->id, "evaluation", $GLOBALS['pid'], $_SESSION['userauthorized']); - + if (!empty($_POST['cpt_code'])) { $sql = "select * from codes where code ='" . add_escape_custom($_POST['cpt_code']) . "' order by id"; - + $results = sqlQ($sql); - + $row = sqlFetchArray($results); if (!empty($row)) { addBilling( date("Ymd"), 'CPT4', $row['code'], $row['code_text'], $_SESSION['pid'], $_SESSION['userauthorized'], $_SESSION['authUserID'],$row['modifier'],$row['units'],$row['fee']); } - + } - + $_POST['process'] = ""; return; } - + } diff --git a/contrib/forms/evaluation/report.php b/contrib/forms/evaluation/report.php index 037303bfb..c1866129c 100644 --- a/contrib/forms/evaluation/report.php +++ b/contrib/forms/evaluation/report.php @@ -2,7 +2,6 @@ //------------Forms generated from formsWiz include_once("../../globals.php"); include_once($GLOBALS["srcdir"]."/api.inc"); -include_once($GLOBALS["srcdir"]."/sql.inc"); function evaluation_report( $pid, $encounter, $cols, $id) { $count = 0; $data = formFetch("form_evaluation", $id); @@ -22,7 +21,7 @@ if ($data) { if ($value == "on") { $value = "yes"; } - + $key=ucwords(str_replace("_"," ",$key)); if (is_numeric($key)){ $key = "check"; @@ -37,4 +36,4 @@ if ($data) { } print ""; } -?> \ No newline at end of file +?> \ No newline at end of file diff --git a/contrib/forms/example/SQL.php b/contrib/forms/example/SQL.php index 91d00f74f..fdfefb3b0 100644 --- a/contrib/forms/example/SQL.php +++ b/contrib/forms/example/SQL.php @@ -4,7 +4,6 @@ include_once("../../../interface/globals.php"); echo "Building Statement
"; flush(); -$sqlLibPath = "../../../library/sql.inc"; $tablename = "example"; //our first six columns are NEEDED for operation of the suite $create = " @@ -19,11 +18,9 @@ $create = " `cats` longtext ) ENGINE=InnoDB "; - + echo "Connecting To SQL
"; flush(); -if (!include_once($sqlLibPath)) - die("failed!"); echo "Creating Tables
"; flush(); diff --git a/contrib/forms/prosthesis/C_FormProsthesis.class.php b/contrib/forms/prosthesis/C_FormProsthesis.class.php index 9db1cec8e..ee7279e81 100644 --- a/contrib/forms/prosthesis/C_FormProsthesis.class.php +++ b/contrib/forms/prosthesis/C_FormProsthesis.class.php @@ -2,13 +2,12 @@ require_once ($GLOBALS['fileroot'] . "/library/classes/Controller.class.php"); require_once ($GLOBALS['fileroot'] . "/library/forms.inc"); -require_once ($GLOBALS['fileroot'] . "/library/sql.inc"); require_once("FormProsthesis.class.php"); class C_FormProsthesis extends Controller { var $template_dir; - + function C_FormProsthesis($template_mod = "general") { parent::Controller(); $this->template_mod = $template_mod; @@ -17,13 +16,13 @@ class C_FormProsthesis extends Controller { $this->assign("DONT_SAVE_LINK", $GLOBALS['form_exit_url']); $this->assign("STYLE", $GLOBALS['style']); } - + function default_action() { $prosthesis = new FormProsthesis(); $this->assign("prosthesis",$prosthesis); return $this->fetch($this->template_dir . $this->template_mod . "_new.html"); } - + function view_action($form_id) { if (is_numeric($form_id)) { $prosthesis = new FormProsthesis($form_id); @@ -36,35 +35,35 @@ class C_FormProsthesis extends Controller { return $this->fetch($this->template_dir . $this->template_mod . "_new.html"); } - + function default_action_process() { if ($_POST['process'] != "true") return; $this->prosthesis = new FormProsthesis($_POST['id']); parent::populate_object($this->prosthesis); - + $this->prosthesis->persist(); if ($GLOBALS['encounter'] == "") { $GLOBALS['encounter'] = date("Ymd"); } addForm($GLOBALS['encounter'], "Prosthesis & Orthotics Form", $this->prosthesis->id, "prosthesis", $GLOBALS['pid'], $_SESSION['userauthorized']); - + if (!empty($_POST['cpt_code'])) { $sql = "select * from codes where code ='" . add_escape_custom($_POST['cpt_code']) . "' order by id"; - + $results = sqlQ($sql); - + $row = sqlFetchArray($results); if (!empty($row)) { addBilling( date("Ymd"), 'CPT4', $row['code'], $row['code_text'], $_SESSION['pid'], $_SESSION['userauthorized'], $_SESSION['authUserID'],$row['modifier'],$row['units'],$row['fee']); } - + } - + $_POST['process'] = ""; return; } - + } ?> diff --git a/contrib/forms/review_of_systems/C_FormReviewOfSystems.class.php b/contrib/forms/review_of_systems/C_FormReviewOfSystems.class.php index 7d0901a8d..d18e8e600 100644 --- a/contrib/forms/review_of_systems/C_FormReviewOfSystems.class.php +++ b/contrib/forms/review_of_systems/C_FormReviewOfSystems.class.php @@ -2,13 +2,12 @@ require_once ($GLOBALS['fileroot'] . "/library/classes/Controller.class.php"); require_once ($GLOBALS['fileroot'] . "/library/forms.inc"); -require_once ($GLOBALS['fileroot'] . "/library/sql.inc"); require_once("FormReviewOfSystems.class.php"); class C_FormReviewOfSystems extends Controller { var $template_dir; - + function C_FormReviewOfSystems($template_mod = "general") { parent::Controller(); $this->template_mod = $template_mod; @@ -17,14 +16,14 @@ class C_FormReviewOfSystems extends Controller { $this->assign("DONT_SAVE_LINK", $GLOBALS['form_exit_url']); $this->assign("STYLE", $GLOBALS['style']); } - + function default_action() { $review_of_systems = new FormReviewOfSystems(); $this->assign("review_of_systems",$review_of_systems); $this->assign("checks",$review_of_systems->_form_layout()); return $this->fetch($this->template_dir . $this->template_mod . "_new.html"); } - + function view_action($form_id) { if (is_numeric($form_id)) { $review_of_systems = new FormReviewOfSystems($form_id); @@ -38,7 +37,7 @@ class C_FormReviewOfSystems extends Controller { return $this->fetch($this->template_dir . $this->template_mod . "_new.html"); } - + function default_action_process() { if ($_POST['process'] != "true") return; @@ -49,21 +48,21 @@ class C_FormReviewOfSystems extends Controller { $GLOBALS['encounter'] = date("Ymd"); } addForm($GLOBALS['encounter'], "Review Of Systems", $this->review_of_systems->id, "review_of_systems", $GLOBALS['pid'], $_SESSION['userauthorized']); - + if (!empty($_POST['cpt_code'])) { $sql = "select * from codes where code ='" . add_escape_custom($_POST['cpt_code']) . "' order by id"; - + $results = sqlQ($sql); - + $row = sqlFetchArray($results); if (!empty($row)) { addBilling( date("Ymd"), 'CPT4', $row['code'], $row['code_text'], $_SESSION['pid'], $_SESSION['userauthorized'], $_SESSION['authUserID'],$row['modifier'],$row['units'],$row['fee']); } - + } $_POST['process'] = ""; return; } - + } ?> diff --git a/contrib/util/de_identification_upgrade.php b/contrib/util/de_identification_upgrade.php index 6070e6095..e035095b2 100644 --- a/contrib/util/de_identification_upgrade.php +++ b/contrib/util/de_identification_upgrade.php @@ -26,8 +26,6 @@ $ignoreAuth = true; // no login required $de_identification_config = 0; require_once('../../interface/globals.php'); -require_once('../../library/sql.inc'); -require_once('../../library/sqlconf.php'); function tableExists_de($tblname) { $row = sqlQuery("SHOW TABLES LIKE '$tblname'"); diff --git a/custom/BillingExport.csv.php b/custom/BillingExport.csv.php index ae695489a..9f43bcf2b 100644 --- a/custom/BillingExport.csv.php +++ b/custom/BillingExport.csv.php @@ -14,7 +14,6 @@ // // To implement this feature, rename this file to BillingExport.php. -require_once (dirname(__FILE__) . "/../library/sql.inc"); class BillingExport { diff --git a/custom/search.php b/custom/search.php index c4c5fd8cb..4d402a2fa 100644 --- a/custom/search.php +++ b/custom/search.php @@ -15,7 +15,6 @@ $fake_register_globals=false; // require_once("../interface/globals.php"); -require_once("$srcdir/sql.inc"); ?> diff --git a/interface/batchcom/batchcom.php b/interface/batchcom/batchcom.php index 4d91c76fa..0f2d67e1e 100644 --- a/interface/batchcom/batchcom.php +++ b/interface/batchcom/batchcom.php @@ -21,7 +21,6 @@ //INCLUDES, DO ANY ACTIONS, THEN GET OUR DATA include_once("../globals.php"); include_once("$srcdir/registry.inc"); -include_once("$srcdir/sql.inc"); include_once("../../library/acl.inc"); include_once("batchcom.inc.php"); diff --git a/interface/batchcom/emailnotification.php b/interface/batchcom/emailnotification.php index 1f72e00f1..5a6610b0d 100755 --- a/interface/batchcom/emailnotification.php +++ b/interface/batchcom/emailnotification.php @@ -2,7 +2,6 @@ //INCLUDES, DO ANY ACTIONS, THEN GET OUR DATA include_once("../globals.php"); include_once("$srcdir/registry.inc"); -include_once("$srcdir/sql.inc"); include_once("../../library/acl.inc"); include_once("batchcom.inc.php"); @@ -106,7 +105,7 @@ $min_array = array('00','05','10','15','20','25','30','35','40','45','50','55'); :
- + :
diff --git a/interface/batchcom/settingsnotification.php b/interface/batchcom/settingsnotification.php index 246d42719..12d746bcb 100755 --- a/interface/batchcom/settingsnotification.php +++ b/interface/batchcom/settingsnotification.php @@ -2,7 +2,6 @@ //INCLUDES, DO ANY ACTIONS, THEN GET OUR DATA include_once("../globals.php"); include_once("$srcdir/registry.inc"); -include_once("$srcdir/sql.inc"); include_once("../../library/acl.inc"); include_once("batchcom.inc.php"); @@ -94,7 +93,7 @@ if($result)
: - +

diff --git a/interface/batchcom/smsnotification.php b/interface/batchcom/smsnotification.php index 2907727ec..ce05b56ea 100755 --- a/interface/batchcom/smsnotification.php +++ b/interface/batchcom/smsnotification.php @@ -2,7 +2,6 @@ //INCLUDES, DO ANY ACTIONS, THEN GET OUR DATA include_once("../globals.php"); include_once("$srcdir/registry.inc"); -include_once("$srcdir/sql.inc"); include_once("../../library/acl.inc"); include_once("batchcom.inc.php"); @@ -105,7 +104,7 @@ $min_array = array('00','05','10','15','20','25','30','35','40','45','50','55');
- + :
diff --git a/interface/billing/edit_payment.php b/interface/billing/edit_payment.php index d388f7d03..641858e91 100644 --- a/interface/billing/edit_payment.php +++ b/interface/billing/edit_payment.php @@ -34,7 +34,6 @@ require_once("$srcdir/invoice_summary.inc.php"); require_once("$srcdir/sl_eob.inc.php"); require_once("$srcdir/parse_era.inc.php"); require_once("../../library/acl.inc"); -require_once("$srcdir/sql.inc"); require_once("$srcdir/auth.inc"); require_once("../../custom/code_types.inc.php"); require_once("$srcdir/patient.inc"); diff --git a/interface/billing/new_payment.php b/interface/billing/new_payment.php index aadd1d14c..eb3e37fb4 100644 --- a/interface/billing/new_payment.php +++ b/interface/billing/new_payment.php @@ -30,7 +30,6 @@ require_once("$srcdir/invoice_summary.inc.php"); require_once("$srcdir/sl_eob.inc.php"); require_once("$srcdir/parse_era.inc.php"); require_once("../../library/acl.inc"); -require_once("$srcdir/sql.inc"); require_once("$srcdir/auth.inc"); require_once("../../custom/code_types.inc.php"); require_once("$srcdir/patient.inc"); @@ -90,7 +89,7 @@ if ($mode == "new_payment" || $mode == "distribute") "', payment_method = '" . trim(formData('payment_method' )) . "'"); } - + //=============================================================================== //ar_activity addition code //=============================================================================== @@ -117,7 +116,7 @@ if ($mode == "PostPayments" || $mode == "FinishPayments") $mode = "search"; $_POST['mode'] = $mode; } - + //============================================================================== //=============================================================================== $payment_id=$payment_id*1 > 0 ? $payment_id : $request_payment_id; @@ -350,7 +349,7 @@ return false; - @@ -365,7 +364,7 @@ return false; - - 0) { ?> diff --git a/interface/de_identification_forms/de_identification_screen1.php b/interface/de_identification_forms/de_identification_screen1.php index 044316ae4..dbaecf814 100644 --- a/interface/de_identification_forms/de_identification_screen1.php +++ b/interface/de_identification_forms/de_identification_screen1.php @@ -21,7 +21,6 @@ require_once("$srcdir/lists.inc"); require_once("$srcdir/patient.inc"); require_once("$srcdir/acl.inc"); require_once("$srcdir/options.inc.php"); -require_once("$srcdir/translation.inc.php"); ?> @@ -47,7 +46,7 @@ function set_related(s,type) { list = "drug_list"; else if(type == "immunizations") list = "immunization_list"; - + var p=s.split("#"); var elSel = document.getElementById(list); var i,k; @@ -57,7 +56,7 @@ function set_related(s,type) { { if((elSel.options[k].value)==p[i]) p[i]= " "; - } + } if(p[i]!= " ") { var elOptNew = document.createElement('option'); @@ -70,7 +69,7 @@ function set_related(s,type) { elSel.add(elOptNew); // IE only } } - } + } show_value(type); } @@ -84,7 +83,7 @@ function get_values(type) dlgopen('find_immunization_popup.php', '_blank', 500, 400,true); } -//remove item selected from list +//remove item selected from list function remove_selected(type) { var list; @@ -93,11 +92,11 @@ function remove_selected(type) else if(type == "drugs") list = "drug_list"; else if(type == "immunizations") - list = "immunization_list"; + list = "immunization_list"; var elSel = document.getElementById(list); var i; for (i = elSel.length - 1; i>=0; i--) { - if (elSel.options[i].selected) + if (elSel.options[i].selected) { elSel.remove(i); } @@ -113,33 +112,33 @@ function show_value(type) else if(type == "drugs") { radio = "drugs"; list = "drug_list"; text="drug_text"; } else if(type == "immunizations") - { radio = "immunizations"; list = "immunization_list"; text="immunization_text"; } + { radio = "immunizations"; list = "immunization_list"; text="immunization_text"; } if(document.getElementById(radio) == "all") { document.getElementById(text).value="all"; } else -{ +{ var str; var elSel = document.getElementById(list); var i; for (i = elSel.length - 1; i>=0; i--) - { + { if(!str) str = elSel.options[i].value; - else + else str = str +"#"+elSel.options[i].value; - - } + + } document.getElementById(text).value=str; } -} - +} + //disable - enable other checkbox when all checkbox is clicked function disable_other_chkbox() { - var value = document.forms[0].all.checked; - if(value == 1) + var value = document.forms[0].all.checked; + if(value == 1) { document.forms[0].history_data.disabled = true; document.forms[0].prescriptions.disabled = true; @@ -197,7 +196,7 @@ function enable_controls(type) function form_validate() { if(document.forms[0].begin_date.value >= document.forms[0].end_date.value) - { + { alert(""); return false; } @@ -205,28 +204,28 @@ function form_validate() if(document.forms[0].all.checked == false && document.forms[0].history_data.checked == false && document.forms[0].prescriptions.checked == false && - document.forms[0].immunization.checked == false && + document.forms[0].immunization.checked == false && document.forms[0].lists.checked == false && - document.forms[0].transactions.checked == false && + document.forms[0].transactions.checked == false && document.forms[0].billing_data.checked == false && document.forms[0].insurance_data.checked == false) - { + { alert(""); return false; } - + if(document.forms[0].diagnosis_text.value == "undefined" || document.forms[0].diagnosis_text.value == "") - { + { alert(""); return false; } if(document.forms[0].drug_text.value == "undefined" || document.forms[0].drug_text.value == "") - { + { alert(""); return false; } if(document.forms[0].immunization_text.value == "undefined" || document.forms[0].immunization_text.value == "") - { + { alert(""); return false; } @@ -244,7 +243,7 @@ function download_file() -
+ - +
   
   
   
@@ -265,7 +264,7 @@ function download_file() echo " de_identification_upgrade.php
";?>
- + @@ -275,7 +274,7 @@ function download_file()
 
    
- - +
   
   
   
@@ -308,7 +307,7 @@ function download_file() echo "
"; ?>
- + @@ -336,7 +335,7 @@ function download_file() $res = sqlStatement($query); ?>
 
   
- +
   
   
   
@@ -347,24 +346,24 @@ function download_file()
"; echo xl('Please start new De Identification process'); - echo "
"; ?>
+ echo "
"; ?>
- +
 
   
   
- + -
   
+ - +
   
   
   
@@ -377,7 +376,7 @@ function download_file() echo "
"; ?>
- +
 
   
   
@@ -396,7 +395,7 @@ function download_file() //3 - The De Identification process completed with error ?> - +
   
   
   
@@ -411,7 +410,7 @@ function download_file() echo "
"; ?>
- +
 
   
   
@@ -421,7 +420,7 @@ function download_file() onclick="download_file()"> - + @@ -434,7 +433,7 @@ function download_file() - + - + - - + + - + -
  @@ -445,15 +444,15 @@ function download_file() [?]    
 
 
  >  
   @@ -463,7 +462,7 @@ function download_file()
- +  


@@ -471,7 +470,7 @@ function download_file()


- +  
@@ -491,27 +490,27 @@ function download_file()
- + - + - +
- +
+
onclick="get_values('diagnosis')"> - onclick="remove_selected('diagnosis')">  + onclick="remove_selected('diagnosis')">  onclick="get_values('drugs')"> - onclick="remove_selected('drugs')"> + onclick="remove_selected('drugs')">
@@ -523,7 +522,7 @@ function download_file()
- +

@@ -539,7 +538,7 @@ function download_file() >   - +

@@ -548,11 +547,11 @@ function download_file() /* required for popup calendar */ Calendar.setup({inputField:"begin_date", ifFormat:"%Y-%m-%d", button:"img_begin_date"}); Calendar.setup({inputField:"end_date", ifFormat:"%Y-%m-%d", button:"img_end_date"}); - - +
diff --git a/interface/de_identification_forms/de_identification_screen2.php b/interface/de_identification_forms/de_identification_screen2.php index 1b0f8f84e..58d121087 100644 --- a/interface/de_identification_forms/de_identification_screen2.php +++ b/interface/de_identification_forms/de_identification_screen2.php @@ -21,8 +21,6 @@ require_once("$srcdir/lists.inc"); require_once("$srcdir/patient.inc"); require_once("$srcdir/acl.inc"); require_once("$srcdir/options.inc.php"); -require_once("$srcdir/translation.inc.php"); -require_once("../../library/sqlconf.php"); ?> @@ -41,9 +40,9 @@ require_once("$srcdir/translation.inc.php"); - + - + - + @@ -188,7 +187,7 @@ function formValidation() { - + @@ -196,7 +195,7 @@ function formValidation() { - - + - + - - + - + -
@@ -209,39 +208,39 @@ function formValidation() {
- +
- + - + @@ -250,9 +249,9 @@ function formValidation() { - + -
- + diff --git a/interface/patient_file/summary/advancedirectives.php b/interface/patient_file/summary/advancedirectives.php index 83f5463cc..579525193 100644 --- a/interface/patient_file/summary/advancedirectives.php +++ b/interface/patient_file/summary/advancedirectives.php @@ -1,6 +1,5 @@ diff --git a/interface/patient_file/summary/create_portallogin.php b/interface/patient_file/summary/create_portallogin.php index cbf361ce4..b9ee85808 100644 --- a/interface/patient_file/summary/create_portallogin.php +++ b/interface/patient_file/summary/create_portallogin.php @@ -1,5 +1,5 @@ // // @@ -19,7 +19,7 @@ // openemr/interface/login/GnuGPL.html // For more information write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// // Author: Eldho Chacko // Jacob T Paul // Paul Simon @@ -34,7 +34,6 @@ $sanitize_all_escapes=true; $fake_register_globals=false; // require_once("../../globals.php"); - require_once("$srcdir/sql.inc"); require_once("$srcdir/classes/postmaster.php"); // Collect portalsite parameter (either off for offsite or on for onsite); only allow off or on @@ -42,13 +41,13 @@ $portalsite = isset($_GET['portalsite']) ? $_GET['portalsite'] : $portalsite = " if ($portalsite != "off" && $portalsite != "on") $portalsite = "off"; $row = sqlQuery("SELECT pd.*,pao.portal_username,pao.portal_pwd,pao.portal_pwd_status FROM patient_data AS pd LEFT OUTER JOIN patient_access_" . add_escape_custom($portalsite) . "site AS pao ON pd.pid=pao.pid WHERE pd.pid=?",array($pid)); - + function generatePassword($length=6, $strength=1) { $consonants = 'bdghjmnpqrstvzacefiklowxy'; $numbers = '0234561789'; $specials = '@#$%'; - - + + $password = ''; $alt = time() % 2; for ($i = 0; $i < $length/3; $i++) { @@ -83,7 +82,7 @@ function messageCreate($uname,$pass,$site){ $message .= htmlspecialchars(xl("Provider Id"),ENT_NOQUOTES) . ": " . htmlspecialchars($GLOBALS['portal_offsite_providerid'],ENT_NOQUOTES) . "

"; } - + $message .= htmlspecialchars(xl("User Name"),ENT_NOQUOTES) . ": " . htmlspecialchars($uname,ENT_NOQUOTES) . "

" . htmlspecialchars(xl("Password"),ENT_NOQUOTES) . ": " . @@ -115,7 +114,7 @@ function emailLogin($patient_id,$message){ $mail->MsgHTML("
".$message."
"); $mail->IsHTML(true); $mail->AltBody = $message; - + if ($mail->Send()) { return true; } else { @@ -140,7 +139,7 @@ if(isset($_REQUEST['form_save']) && $_REQUEST['form_save']=='SUBMIT'){ require_once("$srcdir/authentication/common_operations.php"); $clear_pass=$_REQUEST['pwd']; - + $res = sqlStatement("SELECT * FROM patient_access_" . add_escape_custom($portalsite) . "site WHERE pid=?",array($pid)); $query_parameters=array($_REQUEST['uname']); $salt_clause=""; @@ -164,7 +163,7 @@ if(isset($_REQUEST['form_save']) && $_REQUEST['form_save']=='SUBMIT'){ else{ sqlStatement("INSERT INTO patient_access_" . add_escape_custom($portalsite) . "site SET portal_username=?,portal_pwd=?,portal_pwd_status=0" . $salt_clause . " ,pid=?",$query_parameters); } - + // Create the message $message = messageCreate($_REQUEST['uname'],$clear_pass,$portalsite); // Email and display/print the message @@ -186,8 +185,8 @@ if(isset($_REQUEST['form_save']) && $_REQUEST['form_save']=='SUBMIT'){ @@ -344,15 +343,15 @@ var mypcc = ' - - + +
" . xlt("Entered in Error") . ""; } - ?> + ?> @@ -363,7 +362,7 @@ var mypcc = '1,'field_id'=>'immunization_id','list_id'=>'immunizations','empty_title'=>'SKIP'), $immunization_id); - ?> + ?> @@ -380,7 +379,7 @@ var mypcc = ' - + - + @@ -504,7 +503,7 @@ var mypcc = ' - - +
@@ -416,7 +415,7 @@ var mypcc = '/pic/show_calendar.gif' align='absbottom' width='24' height='22' id='img_immuniz_exp_date' border='0' alt='[?]' style='cursor:pointer;cursor:hand' title=''>
@@ -487,7 +486,7 @@ var mypcc = ' - +
- + @@ -518,7 +517,7 @@ var mypcc = '
- + @@ -526,7 +525,7 @@ var mypcc = '
- +
- + @@ -576,7 +575,7 @@ var mypcc = '$value) { $key_snomed = 0; $key_cvx = 0; $style= '';?>
style="display: none;" class="observation_criteria_value_td" id="observation_criteria_value_td_"> - + style="display: none;" class="code_serach_vaccine_type_td" id="code_serach_vaccine_type_td_"> 0) ? (($key*2) + 3) : ($key + 3);?> - -
- - +
+ +
style="display: none;" class="vis_published_date_td" id="vis_published_date_td_"> - @@ -631,7 +630,7 @@ var mypcc = ' style="display: none;" class="vis_presented_date_td" id="vis_presented_date_td_"> - @@ -669,19 +668,19 @@ var mypcc = '" onclick='sel_code(this.id);'>
- +
style="display: none;" class="code_serach_vaccine_type_td" id="code_serach_vaccine_type_td_1"> - -
- - +
+ +
style="display: none;" class="vis_published_date_td" id="vis_published_date_td_1"> - @@ -689,7 +688,7 @@ var mypcc = ' style="display: none;" class="vis_presented_date_td" id="vis_presented_date_td_1"> - @@ -713,11 +712,11 @@ var mypcc = ' - + - + - +
@@ -752,13 +751,13 @@ var mypcc = '   - + '1','list_id'=>'immunizations'), $row['immunization_id']); } } - + if ($isError) { $del_tag_open = ""; $del_tag_close = ""; @@ -792,9 +791,9 @@ var mypcc = '" . $del_tag_open . $vaccine_display . $del_tag_close . ""; - + if ($row["administered_date"]) { $administered_date_summary = new DateTime($row['administered_date']); $administered_date_summary = $administered_date_summary->format('Y-m-d H:i'); @@ -817,15 +816,15 @@ var mypcc = '" . $del_tag_open . generate_display_field(array('data_type'=>'1','list_id'=>'immunization_administered_site'), $row['administration_site']) . $del_tag_close . ""; echo "" . $del_tag_open . htmlspecialchars( $row["note"], ENT_NOQUOTES) . $del_tag_close . ""; echo "" . $del_tag_open . generate_display_field(array('data_type'=>'1','list_id'=>'Immunization_Completion_Status'), $row['completion_status']) . $del_tag_close . ""; - + if ($isError) { $checkbox = "checked"; } else { $checkbox = ""; } - + echo ""; - + echo ""; echo ""; } @@ -853,7 +852,7 @@ $(document).ready(function(){ $("#save").click(function() { SaveForm(); }); - $("#save").click(function() { + $("#save").click(function() { if (validate_cvx()) { SaveForm(); } @@ -917,14 +916,14 @@ function set_related(codetype, code, selector, codedesc) { var f = document.forms[0][current_sel_name]; if(!f.length) { var s = f.value; - + if (code) { s = code; } else { s = ''; } - + f.value = s; if(f.name != 'cvx_vac_type_code[]'){ $("#cvx_description").text( codedesc ); @@ -976,7 +975,7 @@ function validate_cvx() { document.add_immunization.cvx_code.style.backgroundColor="red"; document.add_immunization.cvx_code.focus(); return false; - } + } } function showObservationResultSection() @@ -988,7 +987,7 @@ function selectCriteria(id,value) { var arr = id.split('observation_criteria_'); var key = arr[1]; - if(value == 'funding_program_eligibility') { + if(value == 'funding_program_eligibility') { $('.obs_res_table').css('width','50%'); if(key > 1) { var target = $("#observation_criteria_value_"+key); @@ -1010,17 +1009,17 @@ function selectCriteria(id,value) } }); } - $("#code_search_td_"+key).hide(); + $("#code_search_td_"+key).hide(); $("#vis_published_date_td_"+key).hide(); $("#vis_presented_date_td_"+key).hide(); $("#code_serach_vaccine_type_td_"+key).hide(); - $("#observation_criteria_value_td_"+key).show(); + $("#observation_criteria_value_td_"+key).show(); } if(value == 'vaccine_type') { - $("#observation_criteria_value_td_"+key).hide(); - $("#code_search_td_"+key).hide(); - $("#code_serach_vaccine_type_td_"+key).show(); + $("#observation_criteria_value_td_"+key).hide(); + $("#code_search_td_"+key).hide(); + $("#code_serach_vaccine_type_td_"+key).show(); $("#vis_published_date_td_"+key).show(); $("#vis_presented_date_td_"+key).show(); if(key == 1) { @@ -1036,11 +1035,11 @@ function selectCriteria(id,value) if(value == 'disease_with_presumed_immunity') { $('.obs_res_table').css('width','50%'); - $("#observation_criteria_value_td_"+key).hide(); + $("#observation_criteria_value_td_"+key).hide(); $("#vis_published_date_td_"+key).hide(); $("#vis_presented_date_td_"+key).hide(); $("#code_serach_vaccine_type_td_"+key).hide(); - $("#code_search_td_"+key).show(); + $("#code_search_td_"+key).show(); if(key == 1) { key = parseInt(key) + 1; } @@ -1048,20 +1047,20 @@ function selectCriteria(id,value) key = (parseInt(key) * 2); } $("#sct_code_"+key).css("background-color", "red"); - $("#sct_code_"+key).focus(); + $("#sct_code_"+key).focus(); return false; } if(value == '') { - $("#observation_criteria_value_td_"+key).hide(); + $("#observation_criteria_value_td_"+key).hide(); $("#vis_published_date_td_"+key).hide(); $("#vis_presented_date_td_"+key).hide(); $("#code_serach_vaccine_type_td_"+key).hide(); - $("#code_search_td_"+key).hide(); + $("#code_search_td_"+key).hide(); } } -function RemoveRow(id) +function RemoveRow(id) { tr_count = parseInt($("#tr_count").val()); new_tr_count = tr_count-1; @@ -1069,10 +1068,10 @@ function RemoveRow(id) $("#or_tr_"+id).remove(); } -function addNewRow() -{ +function addNewRow() +{ tr_count = parseInt($("#tr_count").val()); - new_tr_count = tr_count+1; + new_tr_count = tr_count+1; new_tr_count_2 = (new_tr_count * 2); new_tr_count_3 = (new_tr_count *2) + 1; $("#tr_count").val(new_tr_count); @@ -1089,27 +1088,27 @@ function addNewRow() ''+ ''+ ''+ - ''+ + ''+ ''+ '
'+ ''+ ''+ ' '+ - ''+ + ''+ ''+ ''+ '
'+ ' '+ - ''+ + ''+ ''+ ''+ '[?]'+ ''+ '[?]'+ - ''; - + ''; + $(".obs_res_table").append(str); - + var ajax_url = 'immunizations.php'; var target = $("#observation_criteria_"+new_tr_count); $.ajax({ @@ -1129,7 +1128,7 @@ function addNewRow() alert("ajax error"); } }); - + Calendar.setup({inputField:"vis_published_date_"+new_tr_count, ifFormat:"%Y-%m-%d", button:"img_immuniz_vis_date_published_"+new_tr_count}); Calendar.setup({inputField:"vis_presented_date_"+new_tr_count, ifFormat:"%Y-%m-%d", button:"img_immuniz_vis_date_presented_"+new_tr_count}); } diff --git a/interface/patient_file/summary/list_amendments.php b/interface/patient_file/summary/list_amendments.php index 3f56da179..c67b696f6 100644 --- a/interface/patient_file/summary/list_amendments.php +++ b/interface/patient_file/summary/list_amendments.php @@ -29,7 +29,6 @@ $fake_register_globals=false; // include_once("../../globals.php"); -include_once("$srcdir/sql.inc"); include_once("$srcdir/options.inc.php"); ?> @@ -53,9 +52,9 @@ include_once("$srcdir/options.inc.php"); } tr.selected { background-color: white; -} +} - + @@ -67,17 +66,17 @@ tr.selected { $("#list_amendments input:checkbox:checked").each(function() { amendments += $(this).val() + ","; }); - + if ( amendments == '' ) { alert(""); return; } - + // Call the function to print var url = "print_amendments.php?ids=" + amendments; window.open(url); } - + function checkUncheck(option) { $("input[name='check_list[]']").each( function () { var optionFlag = ( option ) ? true : false; @@ -92,7 +91,7 @@ tr.selected {
  - @@ -116,7 +115,7 @@ tr.selected { - + " . oeFormatShortDate($row['amendment_date']) . ""; ?> diff --git a/interface/patient_file/summary/patient_picture.php b/interface/patient_file/summary/patient_picture.php index 45e27defa..58c5eb8d2 100644 --- a/interface/patient_file/summary/patient_picture.php +++ b/interface/patient_file/summary/patient_picture.php @@ -9,7 +9,6 @@ $fake_register_globals=false; // require_once("../../globals.php"); -require_once("$srcdir/sql.inc"); function pic_array() { $picture_directory = "Patient Photograph"; //change this if you want $pics = array(); diff --git a/interface/patient_file/summary/print_amendments.php b/interface/patient_file/summary/print_amendments.php index dd598b9f5..14d05e434 100644 --- a/interface/patient_file/summary/print_amendments.php +++ b/interface/patient_file/summary/print_amendments.php @@ -29,7 +29,6 @@ $fake_register_globals=false; // include_once("../../globals.php"); -include_once("$srcdir/sql.inc"); include_once("$srcdir/options.inc.php"); $amendments = $_REQUEST["ids"]; @@ -40,7 +39,7 @@ $patientDetails = getPatientData($pid,"fname,lname"); $patientName = $patientDetails['lname'] . ", " . $patientDetails['fname']; function printAmendment($amendmentID,$lastAmendment) { - $query = "SELECT lo.title AS 'amendmentFrom', lo1.title AS 'amendmentStatus',a.* FROM amendments a + $query = "SELECT lo.title AS 'amendmentFrom', lo1.title AS 'amendmentStatus',a.* FROM amendments a LEFT JOIN list_options lo ON a.amendment_by = lo.option_id AND lo.list_id = 'amendment_from' AND lo.activity = 1 LEFT JOIN list_options lo1 ON a.amendment_status = lo1.option_id AND lo1.list_id = 'amendment_status' AND lo1.activity = 1 WHERE a.amendment_id = ?"; @@ -67,7 +66,7 @@ function printAmendment($amendmentID,$lastAmendment) { echo ""; echo ""; - + echo "
"; echo "" . xlt("History") . "
"; $pageBreak = ( $lastAmendment ) ? "" : "page-break-after:always"; @@ -77,7 +76,7 @@ function printAmendment($amendmentID,$lastAmendment) { echo "" . xlt("By") . ""; echo "" . xlt("Comments") . ""; echo ""; - + $query = "SELECT u.fname,u.lname,ah.* FROM amendments_history ah INNER JOIN users u ON ah.created_by = u.id WHERE ah.amendment_id = ?"; $resultSet = sqlStatement($query,array($amendmentID)); while( $row = sqlFetchArray($resultSet)) { @@ -122,7 +121,7 @@ function printAmendment($amendmentID,$lastAmendment) { - + diff --git a/interface/patient_file/summary/record_disclosure.php b/interface/patient_file/summary/record_disclosure.php index e21119b24..5250ab9e1 100644 --- a/interface/patient_file/summary/record_disclosure.php +++ b/interface/patient_file/summary/record_disclosure.php @@ -33,7 +33,6 @@ $fake_register_globals=false; require_once("../../globals.php"); -require_once("$srcdir/sql.inc"); require_once("$srcdir/options.inc.php"); //if the edit button for editing disclosure is set. @@ -52,12 +51,12 @@ if (isset($_GET['editlid'])) @@ -97,24 +96,24 @@ else {?> : - - + - - + ?> + +     - + ?> + @@ -139,7 +138,7 @@ else {?> : - - + : 0) { $data[$current][xl('Amount') . "\n" . xl('Admin')] = $row['amount_administered'] . " " . @@ -71,7 +70,7 @@ function convertToDataArray($data_array) { else { $data[$current][xl('Amount') . "\n" . xl('Admin')] = ""; } - + //expiration date fixed by checking for empty value, smw 040214 if (isset($row['expiration_date'])) { $temp_date = new DateTime($row['expiration_date']); @@ -80,26 +79,26 @@ function convertToDataArray($data_array) { else{ $data[$current][xl('Expiration') . "\n" . xl('Date')] = '';//$temp_date->format('Y-m-d'); } - + //Manufacturer $data[$current][xl('Manufacturer')] = $row['manufacturer']; - + //Lot Number $data[$current][xl('Lot') . "\n" . xl('Number')] = $row['lot_number']; //Admin By $data[$current][xl('Admin') . "\n" . xl('By')] = $row['administered_by']; - + //education date $temp_date = new DateTime($row['education_date']); $data[$current][xl('Patient') . "\n" . xl('Education') . "\n" . xl('Date')] = $temp_date->format('Y-m-d'); //Route $data[$current][xl('Route')] = generate_display_field(array('data_type'=>'1','list_id'=>'drug_route'), $row['route']); - + //Admin Site $data[$current][xl('Admin') . "\n" . xl('Site')] = generate_display_field(array('data_type'=>'1','list_id'=>'proc_body_site'), $row['administration_site']); - + //Comments $data[$current][xl('Comments')] = $row['note']; $current ++; @@ -112,15 +111,15 @@ function printPDF($res, $res2, $data) { $pdf = new Cezpdf("LETTER"); $pdf->ezSetMargins(72,30,50,30); $pdf->selectFont('Helvetica'); - + $opts = array('justification' => "center"); $pdf->ezText($res['facility_address'] ,"",$opts); - + $pdf->ezText("\n" . $res2['patient_name'] . "\n" . xl('Date of Birth') . ": " . $res2['patient_DOB'] . "\n" . $res2['patient_address']); $pdf->ezText("\n"); - + $opts = array('maxWidth' => 550, 'fontSize' => 8); - + $pdf->ezTable($data, "", $title, $opts); $pdf->ezText("\n\n\n\n" . xl('Signature') . ":________________________________","",array('justification' => 'right')); $pdf->ezStream(); @@ -136,12 +135,12 @@ function printHTML($res, $res2, $data) { $res['facility_address'] = preg_replace($patterns, $replace, $res['facility_address']); $res2['patient_address'] = htmlspecialchars( $res2['patient_address'], ENT_NOQUOTES); $res2['patient_address'] = preg_replace($patterns, $replace, $res2['patient_address']); - + //deal with bug (last array index is empty) //array_pop($data); - ?> - + ?> +