/**
  * @return RuleCriteriaType
  */
 function resolveRuleCriteriaType($method, $methodDetail, $value)
 {
     if (strpos($method, "sex")) {
         return RuleCriteriaType::from(RuleCriteriaType::sex);
     }
     return null;
 }
 /**
  * @return RuleCriteriaType
  */
 function resolveRuleCriteriaType($method, $methodDetail, $value)
 {
     if (strpos($method, "lists")) {
         if ($methodDetail == 'medical_problem') {
             $exploded = explode("::", $value);
             if ($exploded[0] == "CUSTOM") {
                 // its a medical issue
                 return RuleCriteriaType::from(RuleCriteriaType::issue);
             } else {
                 // assume its a diagnosis
                 return RuleCriteriaType::from(RuleCriteriaType::diagnosis);
             }
         } else {
             if ($methodDetail == 'medication') {
                 // its a medication
                 return RuleCriteriaType::from(RuleCriteriaType::medication);
             } else {
                 if ($methodDetail == 'allergy') {
                     // its a medication
                     return RuleCriteriaType::from(RuleCriteriaType::allergy);
                 } else {
                     if ($methodDetail == 'surgery') {
                         // its a medication
                         return RuleCriteriaType::from(RuleCriteriaType::surgery);
                     }
                 }
             }
         }
     }
     return null;
 }
 /**
  * @return RuleCriteriaType
  */
 function resolveRuleCriteriaType($method, $methodDetail, $value)
 {
     if (strpos($method, "age_max")) {
         return RuleCriteriaType::from(RuleCriteriaType::ageMax);
     }
     if (strpos($method, "age_min")) {
         return RuleCriteriaType::from(RuleCriteriaType::ageMin);
     }
     return null;
 }
 /**
  * @return RuleCriteriaType
  */
 function resolveRuleCriteriaType($method, $methodDetail, $value)
 {
     if (strpos($method, "database")) {
         $exploded = explode("::", $value);
         if ($exploded[0] == "LIFESTYLE") {
             return RuleCriteriaType::from(RuleCriteriaType::lifestyle);
         }
         if ($exploded[0] == 'CUSTOM') {
             return RuleCriteriaType::from(RuleCriteriaType::custom_bucket);
         } else {
             return RuleCriteriaType::from(RuleCriteriaType::custom);
         }
     }
     return null;
 }
示例#5
0
 function _action_choose_criteria()
 {
     $type = _get("type");
     $id = _get("id");
     $groupId = _get("group_id");
     $criteriaType = RuleCriteriaType::from(_get("criteriaType"));
     $rule = $this->getRuleManager()->getRule($id);
     if ($type == "filter") {
         $criteria = $this->getRuleManager()->createFilterRuleCriteria($rule, $criteriaType);
     }
     if ($type == "target") {
         $criteria = $this->getRuleManager()->createTargetRuleCriteria($rule, $criteriaType);
     }
     $criteria->groupId = $groupId;
     $this->viewBean->type = $type;
     $this->viewBean->rule = $rule;
     $this->viewBean->criteria = $criteria;
     $this->addHelper("common.php");
     $this->set_view($criteria->getView(), "criteria.php");
 }
示例#6
0
 function getAllowedTargetCriteriaTypes()
 {
     $allowed = array();
     array_push($allowed, RuleCriteriaType::from(RuleCriteriaType::lifestyle));
     array_push($allowed, RuleCriteriaType::from(RuleCriteriaType::custom));
     array_push($allowed, RuleCriteriaType::from(RuleCriteriaType::custom_bucket));
     return $allowed;
 }