Installer Class missing array variable check
[openemr.git] / library / classes / ClinicalTypes / ClinicalType.php
blob96dbc38b637166ac9e9e9bb35a5ccfdb4eb12769
1 <?php
2 // Copyright (C) 2011 Ken Chapple <ken@mi-squared.com>
3 //
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.
8 //
9 require_once(dirname(__FILE__) . "/../../clinical_rules.php");
10 require_once(dirname(__FILE__) . "/../../forms.inc");
11 require_once(dirname(__FILE__) . "/../../patient.inc");
12 require_once(dirname(__FILE__) . "/../../lists.inc");
13 require_once(dirname(__FILE__) . "/../rulesets/library/RsPatient.php");
14 require_once( 'codes.php' );
16 abstract class ClinicalType
18 const ALLERGY = 'Allergy';
19 const CARE_GOAL = 'CareGoal';
20 const DIAGNOSIS = 'Diagnosis';
21 const ENCOUNTER = 'Encounter';
22 const MEDICATION = 'Medication';
23 const COMMUNICATION = 'Communication';
24 const CHARACTERISTIC = 'Characteristic';
25 const PHYSICAL_EXAM = 'PhysicalExam';
26 const LAB_RESULT = 'LabResult';
28 private $_optionId;
29 private $_title;
30 private $_notes;
32 public function __construct( $optionId ) {
33 $this->_optionId = $optionId;
34 $result = $this->getListOptionById( $optionId );
35 $this->_title = $result['title'];
36 $this->_notes = $result['notes'];
40 * Check if this clinical type applies to this patient.
42 * @param (RsPatient) $patient
43 * @param (date) $beginMeasurement
44 * @param (date) $endMeasurement
46 * @return true if type applies, false ow
48 public abstract function doPatientCheck( RsPatient $patient, $beginDate = null, $endDate = null, $options = null );
49 public abstract function getListId();
51 public function getOptionId() {
52 return $this->_optionId;
55 public function getNotes() {
56 return $this->_notes;
59 public function getListOptions() {
60 return array();
63 private function getListOptionById( $id )
65 $query = "SELECT * " .
66 "FROM `list_options` " .
67 "WHERE list_id = ? " .
68 "AND option_id = ?";
69 $results = sqlStatement( $query, array( $this->getListId(), $id ) );
70 $arr = sqlFetchArray( $results );
71 return $arr;