Interim autoloaded library/classes via composer classmap, take 4. (#422)
[openemr.git] / interface / forms / prior_auth / C_FormPriorAuth.class.php
blob74e95055fb7aef3fd92fa0b29182013118eae308
1 <?php
3 require_once ($GLOBALS['fileroot'] . "/library/forms.inc");
4 require_once("FormPriorAuth.class.php");
6 class C_FormPriorAuth extends Controller {
8 var $template_dir;
10 function __construct($template_mod = "general") {
11 parent::__construct();
12 $returnurl = 'encounter_top.php';
13 $this->template_mod = $template_mod;
14 $this->template_dir = dirname(__FILE__) . "/templates/prior_auth/";
15 $this->assign("FORM_ACTION", $GLOBALS['web_root']);
16 $this->assign("DONT_SAVE_LINK",$GLOBALS['webroot'] . "/interface/patient_file/encounter/$returnurl");
17 $this->assign("STYLE", $GLOBALS['style']);
20 function default_action() {
21 $prior_auth = new FormPriorAuth();
22 $this->assign("prior_auth",$prior_auth);
23 return $this->fetch($this->template_dir . $this->template_mod . "_new.html");
26 function view_action($form_id) {
27 if (is_numeric($form_id)) {
28 $prior_auth = new FormPriorAuth($form_id);
30 else {
31 $prior_auth = new FormPriorAuth();
33 $this->assign("VIEW",true);
34 $this->assign("prior_auth",$prior_auth);
35 return $this->fetch($this->template_dir . $this->template_mod . "_new.html");
39 function default_action_process() {
40 if ($_POST['process'] != "true")
41 return;
42 $this->prior_auth = new FormPriorAuth($_POST['id']);
43 parent::populate_object($this->prior_auth);
46 $this->prior_auth->persist();
47 if ($GLOBALS['encounter'] == "") {
48 $GLOBALS['encounter'] = date("Ymd");
50 addForm($GLOBALS['encounter'], "Prior Authorization Form", $this->prior_auth->id, "prior_auth", $GLOBALS['pid'], $_SESSION['userauthorized']);
51 $_POST['process'] = "";
52 return;