Focus the search term on load
[openemr.git] / interface / forms / prior_auth / C_FormPriorAuth.class.php
blob9ab04057d12df6d471b413a19cdcb0c78f9cdb8b
1 <?php
3 require_once ($GLOBALS['fileroot'] . "/library/classes/Controller.class.php");
4 require_once ($GLOBALS['fileroot'] . "/library/forms.inc");
5 require_once("FormPriorAuth.class.php");
7 class C_FormPriorAuth extends Controller {
9 var $template_dir;
11 function C_FormPriorAuth($template_mod = "general") {
12 parent::Controller();
13 $returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php';
14 $this->template_mod = $template_mod;
15 $this->template_dir = dirname(__FILE__) . "/templates/prior_auth/";
16 $this->assign("FORM_ACTION", $GLOBALS['web_root']);
17 $this->assign("DONT_SAVE_LINK",$GLOBALS['webroot'] . "/interface/patient_file/encounter/$returnurl");
18 $this->assign("STYLE", $GLOBALS['style']);
21 function default_action() {
22 $prior_auth = new FormPriorAuth();
23 $this->assign("prior_auth",$prior_auth);
24 return $this->fetch($this->template_dir . $this->template_mod . "_new.html");
27 function view_action($form_id) {
28 if (is_numeric($form_id)) {
29 $prior_auth = new FormPriorAuth($form_id);
31 else {
32 $prior_auth = new FormPriorAuth();
34 $this->assign("VIEW",true);
35 $this->assign("prior_auth",$prior_auth);
36 return $this->fetch($this->template_dir . $this->template_mod . "_new.html");
40 function default_action_process() {
41 if ($_POST['process'] != "true")
42 return;
43 $this->prior_auth = new FormPriorAuth($_POST['id']);
44 parent::populate_object($this->prior_auth);
47 $this->prior_auth->persist();
48 if ($GLOBALS['encounter'] == "") {
49 $GLOBALS['encounter'] = date("Ymd");
51 addForm($GLOBALS['encounter'], "Prior Authorization Form", $this->prior_auth->id, "prior_auth", $GLOBALS['pid'], $_SESSION['userauthorized']);
52 $_POST['process'] = "";
53 return;