function getDbView()
 {
     $dbView = parent::getDbView();
     $dbView->method = "database";
     $dbView->methodDetail = "";
     $dbView->value = "::" . $this->table . "::" . $this->column . "::" . $this->valueComparator . "::" . $this->value . "::" . $this->frequencyComparator . "::" . $this->frequency;
     return $dbView;
 }
 function getDbView()
 {
     $dbView = parent::getDbView();
     $dbView->method = "database";
     $dbView->methodDetail = "";
     $dbView->value = "CUSTOM::" . $this->category . "::" . $this->item . "::" . ($this->completed ? "YES" : "NO") . "::" . $this->frequencyComparator . "::" . $this->frequency;
     return $dbView;
 }
Example #3
0
 function getDbView()
 {
     $dbView = parent::getDbView();
     $dbView->method = "sex";
     $dbView->methodDetail = "";
     $dbView->value = $this->value;
     return $dbView;
 }
 function getDbView()
 {
     $dbView = parent::getDbView();
     $dbView->method = "lists";
     $dbView->methodDetail = "medical_problem";
     $dbView->value = $this->codeType . "::" . $this->id;
     return $dbView;
 }
Example #5
0
 function getDbView()
 {
     $dbView = parent::getDbView();
     $dbView->method = "age_" . $this->type;
     $dbView->methodDetail = $this->timeUnit->code;
     $dbView->value = $this->value;
     return $dbView;
 }
 function getDbView()
 {
     $dbView = parent::getDbView();
     $dbView->method = "database";
     $dbView->methodDetail = "";
     $dbView->value = "LIFESTYLE::" . $this->type . "::" . (is_null($this->matchValue) ? "" : $this->matchValue);
     return $dbView;
 }
Example #7
0
 /**
  *
  * @param Rule $rule
  * @param RuleCriteria $criteria
  */
 function updateTargetCriteria($rule, $criteria)
 {
     $dbView = $criteria->getDbView();
     $method = "target_" . $dbView->method;
     $guid = $criteria->guid;
     $group_id = $criteria->groupId;
     if (is_null($guid)) {
         /// insert
         if (!$group_id) {
             $result = sqlQuery("SELECT max(group_id) AS group_id FROM rule_target WHERE id = ?", array($rule->id));
             $group_id = 1;
             if ($result) {
                 $group_id = $result['group_id'] ? $result['group_id'] + 1 : 1;
             }
         }
         sqlStatement(self::SQL_INSERT_TARGET, array($rule->id, $dbView->inclusion ? 1 : 0, $dbView->optional ? 1 : 0, $dbView->method = $method, $dbView->value = $dbView->value, $group_id));
     } else {
         // update flags
         sqlStatement(self::SQL_UPDATE_TARGET, array($dbView->inclusion ? 1 : 0, $dbView->optional ? 1 : 0, $dbView->method = $method, $dbView->value = $dbView->value, $criteria->guid));
     }
     // interval
     $result = sqlQuery("SELECT COUNT(*) AS interval_count FROM rule_target WHERE rule_target.id = ? AND rule_target.method = ?", array($rule->id, 'target_interval'));
     if ($result && $result['interval_count'] > 0) {
         // update interval
         $intervalSql = "UPDATE rule_target\n                    SET rule_target.value = ?, rule_target.interval = ?, rule_target.include_flag = '1', rule_target.required_flag = '1'\n                  WHERE rule_target.method = ?\n                    AND rule_target.id = ?";
         sqlStatement($intervalSql, array($dbView->intervalType, $dbView->interval, 'target_interval', $rule->id));
     } else {
         // insert
         sqlStatement("INSERT INTO rule_target ( rule_target.value, rule_target.interval, rule_target.method, rule_target.id, rule_target.include_flag, rule_target.required_flag ) " . "VALUES ( ?, ?, ?, ?, '1', '1' ) ", array($dbView->intervalType, $dbView->interval, 'target_interval', $rule->id));
     }
 }