fix: set default x12 partner for item in billing manager (#7513)
[openemr.git] / library / classes / ClinicalTypes / Diagnosis.php
blobd109a662d633b854af970787a10b928c44787900
1 <?php
3 // Copyright (C) 2011 Ken Chapple <ken@mi-squared.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.
9 //
10 require_once('ClinicalType.php');
12 class Diagnosis extends ClinicalType
14 const OPTION_STATE = 'state';
15 const STATE_ACTIVE = 'active';
16 const STATE_INACTIVE = 'inactive';
17 const STATE_RESOLVED = 'resolved';
19 const HYPERTENSION = 'diag_hypertension';
20 const PREGNANCY = 'diag_pregnancy';
21 const ENCEPHALOPATHY = 'diag_encephalopathy';
22 const PROG_NEURO_DISORDER = 'diag_prog_neuro_disorder';
23 const CANCER_LYMPH_HIST = 'diag_cancer_lypmh_hist';
24 const ASYMPTOMATIC_HIV = 'diag_asymptomatic_hiv';
25 const MULT_MYELOMA = 'diag_mult_myeloma';
26 const LUKEMIA = 'diag_lukemia';
27 const IMMUNODEF = 'diag_immunodef';
28 const MEASLES = 'diag_measles';
29 const MUMPS = 'diag_mumps';
30 const RUBELLA = 'diag_rubella';
31 const HEP_B = 'diag_hep_b';
32 const HEP_A = 'diag_hep_a';
33 const VZV = 'diag_vzv';
34 const INFLUENZA_IMMUN_CONTRADICT = 'diag_influenza_immun_contradict';
35 const DIABETES = 'diag_diabetes';
36 const POLYCYSTIC_OVARIES = 'diag_polycystic_ovaries';
37 const GESTATIONAL_DIABETES = 'diag_gestational_diabetes';
38 const STEROID_INDUCED_DIABETES = 'diag_steroid_induced_diabetes';
39 const END_STAGE_RENAL_DISEASE = 'diag_end_stage_renal_disease';
40 const CHRONIC_KIDNEY_DISEASE = 'diag_chrnoic_kidney_disease';
41 const ACUTE_PHARYNGITIS = 'diag_acute_pharyngitis';
42 const ACUTE_TONSILLITIS = 'diag_acute_tonsillitis';
43 const LIMITED_LIFE = 'diag_limited_life_expectancy';
45 public function getListType()
47 return 'medical_problem';
50 public function getListColumn()
52 return 'diagnosis';
55 public function getListId()
57 return 'Clinical_Rules_Diagnosis_Types';
61 * Check if the patient has this diagnosis
63 * @param (CqmPatient) $patient
64 * @param (date) $beginMeasurement
65 * @param (date) $endMeasurement
67 * @return true if patient meets criteria, false ow
69 public function doPatientCheck(RsPatient $patient, $beginDate = null, $endDate = null, $options = null)
71 $data = Codes::lookup($this->getOptionId());
72 $type = $this->getListType();
73 foreach ($data as $codeType => $codes) {
74 foreach ($codes as $code) {
75 if (exist_lists_item($patient->id, $type, $codeType . '::' . $code, $endDate)) {
76 return true;
81 return false;