2 // Copyright (C) 2010-2011 Aron Racho <aron@mi-squred.com>
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
10 * Description of RuleCriteriaType
14 class RuleCriteriaType
18 const ageMin
= "age_min";
19 const ageMax
= "age_max";
21 const diagnosis
= "diagnosis";
22 const issue
= "issue";
23 const medication
= "medication";
24 const allergy
= "allergy";
25 const surgery
= "surgery";
26 const lifestyle
= "lifestyle";
27 const custom
= "custom";
28 const custom_bucket
= "custom_bucket";
34 function __construct($code, $lbl, $method)
38 $this->method
= $method;
43 * @param string $value
44 * @return RuleCriteriaType
46 public static function from($code)
52 public static function values()
55 return array_keys($map);
58 private static function map()
61 self
::ageMin
=> new RuleCriteriaType(self
::ageMin
, xl('Age min'), 'age_min'),
62 self
::ageMax
=> new RuleCriteriaType(self
::ageMax
, xl('Age max'), 'age_max'),
63 self
::sex
=> new RuleCriteriaType(self
::sex
, xl('Sex'), 'sex'),
65 self
::issue
=> new RuleCriteriaType(self
::issue
, xl('Medical issue'), 'lists'),
66 self
::diagnosis
=> new RuleCriteriaType(self
::diagnosis
, xl('Diagnosis'), 'lists'),
67 self
::medication
=> new RuleCriteriaType(self
::medication
, xl('Medication'), 'lists'),
68 self
::allergy
=> new RuleCriteriaType(self
::allergy
, xl('Allergy'), 'lists'),
69 self
::surgery
=> new RuleCriteriaType(self
::surgery
, xl('Surgery'), 'lists'),
71 self
::lifestyle
=> new RuleCriteriaType(self
::lifestyle
, xl('Lifestyle'), 'database'),
72 self
::custom
=> new RuleCriteriaType(self
::custom
, xl('Custom Table'), 'database'),
73 self
::custom_bucket
=> new RuleCriteriaType(self
::custom_bucket
, xl('Custom'), 'database')