Highway to PSR2
[openemr.git] / library / classes / ClinicalTypes / Diagnosis.php
blob2d163b14c0fb586e3a7d50769c5cbce5b5d34d85
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('ClinicalType.php');
11 class Diagnosis extends ClinicalType
13 const OPTION_STATE = 'state';
14 const STATE_ACTIVE = 'active';
15 const STATE_INACTIVE = 'inactive';
16 const STATE_RESOLVED = 'resolved';
18 const HYPERTENSION = 'diag_hypertension';
19 const PREGNANCY = 'diag_pregnancy';
20 const ENCEPHALOPATHY = 'diag_encephalopathy';
21 const PROG_NEURO_DISORDER = 'diag_prog_neuro_disorder';
22 const CANCER_LYMPH_HIST = 'diag_cancer_lypmh_hist';
23 const ASYMPTOMATIC_HIV = 'diag_asymptomatic_hiv';
24 const MULT_MYELOMA = 'diag_mult_myeloma';
25 const LUKEMIA = 'diag_lukemia';
26 const IMMUNODEF = 'diag_immunodef';
27 const MEASLES = 'diag_measles';
28 const MUMPS = 'diag_mumps';
29 const RUBELLA = 'diag_rubella';
30 const HEP_B = 'diag_hep_b';
31 const HEP_A = 'diag_hep_a';
32 const VZV = 'diag_vzv';
33 const INFLUENZA_IMMUN_CONTRADICT = 'diag_influenza_immun_contradict';
34 const DIABETES = 'diag_diabetes';
35 const POLYCYSTIC_OVARIES = 'diag_polycystic_ovaries';
36 const GESTATIONAL_DIABETES = 'diag_gestational_diabetes';
37 const STEROID_INDUCED_DIABETES = 'diag_steroid_induced_diabetes';
38 const END_STAGE_RENAL_DISEASE='diag_end_stage_renal_disease';
39 const CHRONIC_KIDNEY_DISEASE='diag_chrnoic_kidney_disease';
40 const ACUTE_PHARYNGITIS = 'diag_acute_pharyngitis';
41 const ACUTE_TONSILLITIS = 'diag_acute_tonsillitis';
42 const LIMITED_LIFE = 'diag_limited_life_expectancy';
44 public function getListType()
46 return 'medical_problem';
49 public function getListColumn()
51 return 'diagnosis';
54 public function getListId()
56 return 'Clinical_Rules_Diagnosis_Types';
60 * Check if the patient has this diagnosis
62 * @param (CqmPatient) $patient
63 * @param (date) $beginMeasurement
64 * @param (date) $endMeasurement
66 * @return true if patient meets criteria, false ow
68 public function doPatientCheck(RsPatient $patient, $beginDate = null, $endDate = null, $options = null)
70 $data = Codes::lookup($this->getOptionId());
71 $type = $this->getListType();
72 foreach ($data as $codeType => $codes) {
73 foreach ($codes as $code) {
74 if (exist_lists_item($patient->id, $type, $codeType.'::'.$code, $endDate)) {
75 return true;
80 return false;