3 class C_InsuranceCompany
extends Controller
9 public function __construct($template_mod = "general")
11 parent
::__construct();
12 $this->icompanies
= array();
13 $this->template_mod
= $template_mod;
14 $this->template_dir
= __DIR__
. "/templates/insurance_companies/";
15 $this->assign("FORM_ACTION", $GLOBALS['webroot'] . "/controller.php?" . attr($_SERVER['QUERY_STRING']));
16 $this->assign("CURRENT_ACTION", $GLOBALS['webroot'] . "/controller.php?" . "practice_settings&insurance_company&");
17 $this->assign("STYLE", $GLOBALS['style']);
18 $this->assign("SUPPORT_ENCOUNTER_CLAIMS", $GLOBALS['support_encounter_claims']);
19 $this->assign("SUPPORT_ELIGIBILITY_REQUESTS", $GLOBALS['enable_oa']);
20 $this->InsuranceCompany
= new InsuranceCompany();
23 public function default_action()
25 return $this->list_action();
28 public function edit_action($id = "", $patient_id = "", $p_obj = null)
30 if ($p_obj != null && get_class($p_obj) == "insurancecompany") {
31 $this->icompanies
[0] = $p_obj;
32 } elseif (empty($this->icompanies
[0]) ||
$this->icompanies
[0] == null ||
get_class($this->icompanies
[0]) != "insurancecompany") {
33 $this->icompanies
[0] = new InsuranceCompany($id);
36 $x = new X12Partner();
37 $this->assign("x12_partners", $x->_utility_array($x->x12_partner_factory()));
39 $this->assign("insurancecompany", $this->icompanies
[0]);
40 return $this->fetch($GLOBALS['template_dir'] . "insurance_companies/" . $this->template_mod
. "_edit.html");
43 public function list_action()
46 $this->assign("icompanies", $this->InsuranceCompany
->insurance_companies_factory());
48 return $this->fetch($GLOBALS['template_dir'] . "insurance_companies/" . $this->template_mod
. "_list.html");
52 public function edit_action_process()
54 if ($_POST['process'] != "true") {
58 if (is_numeric($_POST['id'])) {
59 $this->icompanies
[0] = new InsuranceCompany($_POST['id']);
61 $this->icompanies
[0] = new InsuranceCompany();
64 self
::populate_object($this->icompanies
[0]);
66 $this->icompanies
[0]->persist();
67 $this->icompanies
[0]->populate();
69 $_POST['process'] = "";
70 header('Location:' . $GLOBALS['webroot'] . "/controller.php?" . "practice_settings&insurance_company&action=list");//Z&H