making forms compatible with new frame layout
[openemr.git] / contrib / forms / review_of_systems / C_FormReviewOfSystems.class.php
blob6c90d40c7503c00b4d9a526ee3616ac5950ff668
1 <?php
3 require_once ($GLOBALS['fileroot'] . "/library/classes/Controller.class.php");
4 require_once ($GLOBALS['fileroot'] . "/library/forms.inc");
5 require_once ($GLOBALS['fileroot'] . "/library/sql.inc");
6 require_once("FormReviewOfSystems.class.php");
8 class C_FormReviewOfSystems extends Controller {
10 var $template_dir;
12 function C_FormReviewOfSystems($template_mod = "general") {
13 parent::Controller();
14 $this->template_mod = $template_mod;
15 $this->template_dir = dirname(__FILE__) . "/templates/review_of_systems/";
16 $this->assign("FORM_ACTION", $GLOBALS['web_root']);
17 $this->assign("DONT_SAVE_LINK", $GLOBALS['form_exit_url']);
18 $this->assign("STYLE", $GLOBALS['style']);
21 function default_action() {
22 $review_of_systems = new FormReviewOfSystems();
23 $this->assign("review_of_systems",$review_of_systems);
24 $this->assign("checks",$review_of_systems->_form_layout());
25 return $this->fetch($this->template_dir . $this->template_mod . "_new.html");
28 function view_action($form_id) {
29 if (is_numeric($form_id)) {
30 $review_of_systems = new FormReviewOfSystems($form_id);
32 else {
33 $review_of_systems = new FormReviewOfSystems();
35 $this->assign("VIEW",true);
36 $this->assign("review_of_systems",$review_of_systems);
37 $this->assign("checks",$review_of_systems->_form_layout());
38 return $this->fetch($this->template_dir . $this->template_mod . "_new.html");
42 function default_action_process() {
43 if ($_POST['process'] != "true")
44 return;
45 $this->review_of_systems = new FormReviewOfSystems($_POST['id']);
46 parent::populate_object($this->review_of_systems);
47 $this->review_of_systems->persist();
48 if ($GLOBALS['encounter'] == "") {
49 $GLOBALS['encounter'] = date("Ymd");
51 addForm($GLOBALS['encounter'], "Review Of Systems", $this->review_of_systems->id, "review_of_systems", $GLOBALS['pid'], $_SESSION['userauthorized']);
53 if (!empty($_POST['cpt_code'])) {
54 $sql = "select * from codes where code ='" . mysql_real_escape_string($_POST['cpt_code']) . "' order by id";
56 $results = sqlQ($sql);
58 $row = mysql_fetch_array($results);
59 if (!empty($row)) {
60 addBilling( date("Ymd"), 'CPT4', $row['code'], $row['code_text'], $_SESSION['pid'], $_SESSION['userauthorized'], $_SESSION['authUserID'],$row['modifier'],$row['units'],$row['fee']);
64 $_POST['process'] = "";
65 return;