psr12 fixes for new PHP_CodeSniffer (#4795)
[openemr.git] / interface / super / rules / library / RuleType.php
blob1883809c85e83309e19323ecbb6c10d963b98aac
1 <?php
3 // Copyright (C) 2010-2011 Aron Racho <aron@mi-squred.com>
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 /**
11 * Enumerates rule types
12 * todo turn this into a real enum
13 * @author aron
15 class RuleType
17 var $code;
18 var $lbl;
20 const ActiveAlert = "activealert";
21 const PassiveAlert = "passivealert";
22 const CQM = "cqm";
23 const AMC = "amc";
24 const PatientReminder = "patientreminder";
26 function __construct($code, $lbl)
28 $this->lbl = $lbl;
29 $this->code = $code;
32 /**
34 * @param string $value
35 * @return RuleType
37 public static function from($code)
39 $map = self::map();
40 return $map[$code];
43 public static function values()
45 $map = self::map();
46 return array_keys($map);
49 private static function map()
51 $map = array(
52 self::ActiveAlert => new RuleType(self::ActiveAlert, xl('Active Alert')),
53 self::PassiveAlert => new RuleType(self::PassiveAlert, xl('Passive Alert')),
54 // not yet supported
55 // self::CQM => new RuleType( self::CQM, xl( 'CQM' ) ),
56 // self::AMC => new RuleType( self::AMC, xl( 'AMC' ) ),
57 self::PatientReminder => new RuleType(self::PatientReminder, xl('Patient Reminder'))
59 return $map;