Skip to content

Commit

Permalink
more organization of autoloaded files (openemr#424)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradymiller committed Jan 9, 2017
1 parent da39bbf commit 5220b63
Show file tree
Hide file tree
Showing 106 changed files with 1,064 additions and 1,172 deletions.
7 changes: 3 additions & 4 deletions ccr/transmitCCD.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
23 changes: 11 additions & 12 deletions contrib/forms/evaluation/C_FormEvaluation.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -17,14 +16,14 @@ function C_FormEvaluation($template_mod = "general") {
$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);
Expand All @@ -38,35 +37,35 @@ function view_action($form_id) {
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;
}

}


Expand Down
5 changes: 2 additions & 3 deletions contrib/forms/evaluation/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -22,7 +21,7 @@ function evaluation_report( $pid, $encounter, $cols, $id) {
if ($value == "on") {
$value = "yes";
}

$key=ucwords(str_replace("_"," ",$key));
if (is_numeric($key)){
$key = "check";
Expand All @@ -37,4 +36,4 @@ function evaluation_report( $pid, $encounter, $cols, $id) {
}
print "</tr></table>";
}
?>
?>
5 changes: 1 addition & 4 deletions contrib/forms/example/SQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
echo "Building Statement<br>";
flush();

$sqlLibPath = "../../../library/sql.inc";
$tablename = "example";
//our first six columns are NEEDED for operation of the suite
$create = "
Expand All @@ -19,11 +18,9 @@
`cats` longtext
) ENGINE=InnoDB
";

echo "Connecting To SQL<br>";
flush();
if (!include_once($sqlLibPath))
die("failed!");

echo "Creating Tables<br>";
flush();
Expand Down
23 changes: 11 additions & 12 deletions contrib/forms/prosthesis/C_FormProsthesis.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -17,13 +16,13 @@ function C_FormProsthesis($template_mod = "general") {
$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);
Expand All @@ -36,35 +35,35 @@ function view_action($form_id) {
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;
}

}
?>
19 changes: 9 additions & 10 deletions contrib/forms/review_of_systems/C_FormReviewOfSystems.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -17,14 +16,14 @@ function C_FormReviewOfSystems($template_mod = "general") {
$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);
Expand All @@ -38,7 +37,7 @@ function view_action($form_id) {
return $this->fetch($this->template_dir . $this->template_mod . "_new.html");

}

function default_action_process() {
if ($_POST['process'] != "true")
return;
Expand All @@ -49,21 +48,21 @@ function default_action_process() {
$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;
}

}
?>
2 changes: 0 additions & 2 deletions contrib/util/de_identification_upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
$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'");
Expand Down
1 change: 0 additions & 1 deletion custom/BillingExport.csv.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
//
// To implement this feature, rename this file to BillingExport.php.

require_once (dirname(__FILE__) . "/../library/sql.inc");

class BillingExport {

Expand Down
1 change: 0 additions & 1 deletion custom/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
//

require_once("../interface/globals.php");
require_once("$srcdir/sql.inc");
?>
<html>
<head>
Expand Down
1 change: 0 additions & 1 deletion interface/batchcom/batchcom.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
3 changes: 1 addition & 2 deletions interface/batchcom/emailnotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -106,7 +105,7 @@
<?php xl('Email Subject','e')?> :
<INPUT TYPE="text" NAME="email_subject" size="60" value="<?php echo $email_subject?>">
<br>

<?php xl('Name of Provider','e')?> :
<INPUT TYPE="text" NAME="provider_name" size="40" value="<?php echo $provider_name?>">
<br>
Expand Down
3 changes: 1 addition & 2 deletions interface/batchcom/settingsnotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -94,7 +93,7 @@
<br>
<?php xl('SMS Gateway API key','e')?> :
<INPUT TYPE="text" NAME="SMS_gateway_apikey" size="40" value="<?php $SMS_gateway_apikey?>">

<br><br>
<INPUT TYPE="submit" name="form_action" value="Save">
</div>
Expand Down
3 changes: 1 addition & 2 deletions interface/batchcom/smsnotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -105,7 +104,7 @@
<?php }?>
</SELECT>
<br>

<?php xl('Name of Provider','e')?> :
<INPUT TYPE="text" NAME="provider_name" size="40" value="<?php echo $provider_name?>">
<br>
Expand Down
Loading

0 comments on commit 5220b63

Please sign in to comment.