示例#1
0
 function WSClaim($patient_id, $encounter)
 {
     if (!is_numeric($patient_id) && is_numeric($encounter)) {
         return;
     }
     parent::WSWrapper(null, false);
     $this->patient_id = $patient_id;
     $this->encounter = $encounter;
     $this->claim = null;
     $this->_db = $GLOBALS['adodb']['db'];
     if ($this->_config['enabled'] === 2) {
         return;
     }
     if ($this->load_claim()) {
         $function['ezybiz.add_invoice'] = array(new xmlrpcval($this->claim, "struct"));
         $this->send($function);
     }
     //print_r($this->claim);
 }
 function WSProvider($user_id)
 {
     if (!is_numeric($user_id)) {
         return;
     }
     parent::WSWrapper(null, false);
     $this->user_id = $user_id;
     $this->_db = $GLOBALS['adodb']['db'];
     if (!$this->_config['enabled']) {
         return;
     }
     if ($this->_config['enabled'] === 2) {
         return;
     }
     if ($this->load_info()) {
         $function['ezybiz.add_salesman'] = array(new xmlrpcval($this->data, "struct"));
         $this->send($function);
         // if the remote user was added make an entry in the local mapping table to that updates can be made correctly
         if (is_numeric($this->value)) {
             $sql = "REPLACE INTO integration_mapping set id = '" . $this->_db->GenID("sequences") . "', foreign_id ='" . $this->value . "', foreign_table ='salesman', local_id = '" . $this->user_id . "', local_table = 'users' ";
             $this->_db->Execute($sql) or die("error: " . $this->_db->ErrorMsg());
         }
     }
 }