CDR rules: added another influenza CVX code target entry
[openemr.git] / controllers / C_X12Partner.class.php
blobd35f36ca4d79a54e9baee0efe5b4f5e8dd13b107
1 <?php
3 require_once ($GLOBALS['fileroot'] . "/library/classes/Controller.class.php");
4 require_once($GLOBALS['fileroot'] ."/library/classes/X12Partner.class.php");
6 class C_X12Partner extends Controller {
8 var $template_mod;
9 var $providers;
10 var $x12_partners;
12 function C_X12Partner($template_mod = "general") {
13 parent::Controller();
14 $this->x12_partner = array();
15 $this->template_mod = $template_mod;
16 $this->assign("FORM_ACTION", $GLOBALS['webroot']."/controller.php?" . $_SERVER['QUERY_STRING']);
17 $this->assign("CURRENT_ACTION", $GLOBALS['webroot']."/controller.php?" . "practice_settings&x12_partner&");
18 $this->assign("STYLE", $GLOBALS['style']);
19 $this->assign("WEB_ROOT", $GLOBALS['webroot'] );
22 function default_action() {
23 return $this->list_action();
26 function edit_action($id = "",$x_obj = null) {
27 if ($x_obj != null && get_class($x_obj) == "x12partner") {
28 $this->x12_partners[0] = $x_obj;
30 elseif (is_numeric($id)) {
31 $this->x12_partners[0] = new X12Partner($id);
33 else {
34 $this->x12_partners[0] = new X12Partner();
36 $this->assign("partner", $this->x12_partners[0]);
37 return $this->fetch($GLOBALS['template_dir'] . "x12_partners/" . $this->template_mod . "_edit.html");
40 function list_action() {
42 $x = new X12Partner();
43 //$x->set_name("Medi-Cal");
44 //$x->set_x12_sender_id("123454");
45 //$x->set_x12_receiver_id("123454");
46 //$x->persist();
47 //$x->populate();
49 $this->assign("partners", $x->x12_partner_factory());
50 return $this->fetch($GLOBALS['template_dir'] . "x12_partners/" . $this->template_mod . "_list.html");
54 function edit_action_process() {
55 if ($_POST['process'] != "true")
56 return;
57 //print_r($_POST);
58 if (is_numeric($_POST['id'])) {
59 $this->x12_partner[0] = new X12Partner($_POST['id']);
61 else {
62 $this->x12_partner[0] = new X12Partner();
65 parent::populate_object($this->x12_partner[0]);
67 $this->x12_partner[0]->persist();
68 //insurance numbers need to be repopulated so that insurance_company_name recieves a value
69 $this->x12_partner[0]->populate();
71 //echo "action processeed";
72 $_POST['process'] = "";
73 $this->_state = false;
74 header('Location:'.$GLOBALS['webroot']."/controller.php?" . "practice_settings&x12_partner&action=list");//Z&H
75 //return $this->edit_action(null,$this->x12_partner[0]);