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 RuleCriteriaDiagnosis
14 class RuleCriteriaDiagnosis
extends RuleCriteria
21 function __construct($title, $codeType = '', $id = '')
23 $this->title
= $title;
24 $this->codeType
= $codeType;
28 function getRequirements()
30 $codeManager = new CodeManager();
31 $code = $codeManager->get($this->id
);
33 return $this->codeType
. ":" . $this->id
;
36 return $code->display();
46 return "diagnosis.php";
51 $dbView = parent
::getDbView();
53 $dbView->method
= "lists";
54 $dbView->methodDetail
= "medical_problem";
55 $dbView->value
= $this->codeType
. "::" . $this->id
;
59 function updateFromRequest()
61 parent
::updateFromRequest();
62 $value = _post("fld_value");
63 $exploded = explode(" ", $value);
64 $diagInfo = explode(":", $exploded[0]);
65 $this->codeType
= $diagInfo[0];
66 $this->id
= $diagInfo[1];