another minor fix to prior commit
[openemr.git] / library / classes / ClinicalTypes / Diagnosis.php
blob3f35074ed276213846e008b0596aecc764faacb6
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() {
45 return 'medical_problem';
48 public function getListColumn() {
49 return 'diagnosis';
52 public function getListId() {
53 return 'Clinical_Rules_Diagnosis_Types';
57 * Check if the patient has this diagnosis
59 * @param (CqmPatient) $patient
60 * @param (date) $beginMeasurement
61 * @param (date) $endMeasurement
63 * @return true if patient meets criteria, false ow
65 public function doPatientCheck( RsPatient $patient, $beginDate = null, $endDate = null, $options = null ) {
66 $data = Codes::lookup( $this->getOptionId() );
67 $type = $this->getListType();
68 foreach( $data as $codeType => $codes ) {
69 foreach ( $codes as $code ) {
70 if ( exist_lists_item( $patient->id, $type, $codeType.'::'.$code, $endDate ) ) {
71 return true;
75 return false;