PHP7 project, commit 1.
[openemr.git] / contrib / forms / review_of_systems / FormReviewOfSystems.class.php
blob9821caa58e304e1d62d771d7d12914a334a335af
1 <?php
3 require_once(dirname(__FILE__) . "/../../../library/classes/ORDataObject.class.php");
7 /**
8 * class Prosthesis
11 class FormReviewOfSystems extends ORDataObject {
13 /**
15 * @access public
18 /**
20 * @access private
23 var $id;
24 var $date;
25 var $pid;
26 var $activity;
27 var $date_tetnus_shot;
28 var $date_pneumonia_shot;
29 var $date_flu_shot;
30 var $date_pap_smear;
31 var $date_mammogram;
32 var $date_bone_density_scan;
33 var $abnormal_pap_smear;
34 var $abnormal_mammogram;
35 var $date_last_psa;
36 var $packs_per_day;
37 var $years_smoked;
38 var $alcohol_per_week;
39 var $recreational_drugs;
40 var $checks;
43 /**
44 * Constructor sets all Form attributes to their default value
47 function FormReviewOfSystems($id= "", $_prefix = "") {
48 if (is_numeric($id)) {
49 $this->id = $id;
51 else {
52 $id = "";
54 $this->_table = "form_review_of_systems";
55 $this->date = date("Y-m-d H:i:s");
56 $this->activity = 1;
57 $this->pid = $GLOBALS['pid'];
58 if ($id != "") {
59 $this->populate();
63 function toString($html = false) {
64 $string .= "\n"
65 ."ID: " . $this->id . "\n";
67 if ($html) {
68 return nl2br($string);
70 else {
71 return $string;
75 function populate() {
76 parent::populate();
78 $sql = "SELECT name from form_review_of_systems_checks where foreign_id = '" . add_escape_custom($this->id) . "'";
79 $results = sqlQ($sql);
81 while ($row = mysql_fetch_array($results, MYSQL_ASSOC)) {
82 $this->checks[] = $row['name'];
87 function persist() {
88 parent::persist();
89 if (is_numeric($this->id) and !empty($this->checks)) {
90 $sql = "delete FROM form_review_of_systems_checks where foreign_id = '" . $this->id . "'";
91 sqlQuery($sql);
92 foreach ($this->checks as $check) {
93 if (!empty($check)) {
94 $sql = "INSERT INTO form_review_of_systems_checks set foreign_id='" . add_escape_custom($this->id) . "', name = '" . add_escape_custom($check) . "'";
95 sqlQuery($sql);
96 //echo "$sql<br>";
103 function set_id($id) {
104 if (!empty($id) && is_numeric($id)) {
105 $this->id = $id;
108 function get_id() {
109 return $this->id;
111 function set_pid($pid) {
112 if (!empty($pid) && is_numeric($pid)) {
113 $this->pid = $pid;
116 function get_pid() {
117 return $this->pid;
119 function set_activity($tf) {
120 if (!empty($tf) && is_numeric($tf)) {
121 $this->activity = $tf;
124 function get_activity() {
125 return $this->activity;
128 function set_date_tetnus_shot($string) {
129 $this->date_tetnus_shot = $string;
131 function get_date_tetnus_shot() {
132 return $this->date_tetnus_shot;
135 function set_date_pneumonia_shot($string) {
136 $this->date_pneumonia_shot = $string;
138 function get_date_pneumonia_shot() {
139 return $this->date_pneumonia_shot;
142 function set_date_flu_shot($string) {
143 $this->date_flu_shot = $string;
145 function get_date_flu_shot() {
146 return $this->date_flu_shot;
149 function set_date_pap_smear($string) {
150 $this->date_pap_smear = $string;
152 function get_date_pap_smear() {
153 return $this->date_pap_smear;
156 function set_date_mammogram($string) {
157 $this->date_mammogram = $string;
159 function get_date_mammogram() {
160 return $this->date_mammogram;
163 function set_date_bone_density_scan($string) {
164 $this->date_bone_density_scan = $string;
166 function get_date_bone_density_scan() {
167 return $this->date_bone_density_scan;
170 function set_abnormal_pap_smear($string) {
171 $this->abnormal_pap_smear = $string;
173 function get_abnormal_pap_smear() {
174 return $this->abnormal_pap_smear;
177 function set_abnormal_mammogram($string) {
178 $this->abnormal_mammogram = $string;
180 function get_abnormal_mammogram() {
181 return $this->abnormal_mammogram;
184 function set_date_last_psa($string) {
185 $this->date_last_psa = $string;
187 function get_date_last_psa() {
188 return $this->date_last_psa;
191 function set_packs_per_day($string) {
192 $this->packs_per_day = $string;
194 function get_packs_per_day() {
195 return $this->packs_per_day;
198 function set_years_smoked($string) {
199 $this->years_smoked = $string;
201 function get_years_smoked() {
202 return $this->years_smoked;
205 function set_alcohol_per_week($string) {
206 $this->alcohol_per_week = $string;
208 function get_alcohol_per_week() {
209 return $this->alcohol_per_week;
212 function set_recreational_drugs($string) {
213 $this->recreational_drugs = $string;
215 function get_recreational_drugs() {
216 return $this->recreational_drugs;
219 function set_checks($check_array) {
220 $this->checks = $check_array;
223 function get_checks() {
224 return $this->checks;
228 function _form_layout() {
229 $a = array();
231 //at is array temp
232 //a is array
233 //a_bottom is the textually identified rows of a checkbox group
235 $at[1]['constitutional_fever'] = "Fever";
236 $at[1]['constitutional_chills'] = "Chills";
237 $at[1]['constitutional_fatigue'] = "Fatigue";
238 $at[1]['constitutional_weakness'] = "Weakness";
240 $at[2]['constitutional_night_sweats'] = "Night Sweats";
241 $at[2]['constitutional__unexplained_weight_loss'] = "Unexplained Weight Loss";
242 $at[2]['constitutional_unexplained_weight_gain'] = "Unexplained Weight Gain";
244 $a['Constitutional'] = $at;
246 $at = array();
247 $a_bottom = array();
248 $at[1]['heent_changes_in_vision'] = "Changes in Vision";
249 $at[1]['heent_light_sensitivity'] = "Light Sensitivity";
250 $at[1]['heent_changes_in_hearing'] = "Changes in Hearing";
251 $at[1]['heent_ringing_in_ears'] = "Ringing in Ears";
253 $at[2]['heent_frequent_nose_bleeds'] = "Frequent Nose Bleeds";
254 $at[2]['heent_pain_with_swallowing'] = "Pain with Swallowing";
255 $at[2]['heent_difficulty_swallowing'] = "Difficulty Swallowing";
257 $a['HEENT'] = $at;
259 $at = array();
260 $a_bottom = array();
261 $at[1]['endocrine_frequent_thirst'] = "Frequent Thirst";
262 $at[1]['endocrine_frequent_urination'] = "Frequent Urination";
263 $at[1]['endocrine_heat_intolerance'] = "Heat Intolerance";
264 $at[1]['endocrine_brittle_hair'] = "Brittle Hair";
266 $a['Enodcrine'] = $at;
268 $at = array();
269 $a_bottom = array();
270 $at[1]['respiratory_shortness_of_breath'] = "Shortness Of Breath";
271 $at[1]['respiratory_difficulty_breathing'] = "Difficulty Breathing";
272 $at[1]['respiratory_wheezing'] = "Wheezing";
273 $at[1]['respiratory_coughing_up_blood'] = "Coughing up Blood";
275 $a['Respiratory'] = $at;
277 $at = array();
278 $a_bottom = array();
279 $at[1]['cv_chest_pain'] = "Chest Pain";
280 $at[1]['cv_palpitations'] = "Palpitations";
281 $at[1]['cv_shortness_of_breath_with_exertion'] = "Shortness of Breath with Exertion";
282 $at[1]['cv_swelling_in_ankles'] = "Swelling in Ankles";
284 $a['CV'] = $at;
286 $at = array();
287 $a_bottom = array();
288 $at[1]['gi_frequent_heartburn'] = "Frequent Heartburn";
289 $at[1]['gi_vomiting'] = "Vomiting";
290 $at[1]['gi_diarrhea'] = "Diarrhea";
291 $at[1]['gi_constipation'] = "Constipation";
293 $at[2]['gi_unusually_dark_stools'] = "Unusually Dark Stools";
294 $at[2]['gi_vomiting_blood'] = "Vomiting Blood";
296 $a['GI'] = $at;
298 $at = array();
299 $a_bottom = array();
300 $at[1]['gu_pain_with_urination'] = "Pain with Urination";
301 $at[1]['gu_difficulty_urinating'] = "Difficulty Urinating";
302 $at[1]['gu_frequent_nightime_urination'] = "Frequent Nightime Urination";
304 $at["Women"]['gu_women_pelvic_pain'] = "Pelvic Pain";
305 $at["Women"]['gu_women_leaking_of_urine'] = "Leaking of Urine";
306 $at["Women"]['gu_women_nipple_discharge'] = "Nipple Discharge";
307 $at["Women"]['gu_women_breast_pain'] = "Breast Pain";
309 $at["Men"]['gu_men_difficulty_attaining_erection'] = "Difficulty Attaining Erection";
310 $at["Men"]['gu_men_testicular_pain'] = "Testicular Pain";
312 $a['GU'] = $at;
314 $at = array();
315 $a_bottom = array();
316 $at[1]['musculoskeletal_pain_in_joints'] = "Pain in Joints";
317 $at[1]['musculoskeletal_swollen_joints'] = "Swollen Joints";
318 $at[1]['musculoskeletal_muscle_pain'] = "Muscle Pain";
320 $a['Musculoskeletal'] = $at;
322 $at = array();
323 $a_bottom = array();
324 $at[1]['skin_rash'] = "Rash";
325 $at[1]['skin_hives'] = "Hives";
326 $at[1]['skin_changing_moles'] = "Changing Moles";
327 $at[1]['skin_sores_wont_heal'] = "Sores that Won't Heal";
329 $a['Skin'] = $at;
331 $at = array();
332 $a_bottom = array();
333 $at[1]['neurological_seizures'] = "Seizures";
334 $at[1]['neurological_loss_of_conciousness'] = "Loss of Conciousness";
335 $at[1]['neurological_speech_difficulty'] = "Speech Difficulty";
336 $at[1]['neurological_memory_loss'] = "Memory Loss";
338 $at[2]['neurological_numbness'] = "Numbness";
339 $at[2]['neurological_confusion'] = "Confusion";
341 $a['Neurological'] = $at;
343 $at = array();
344 $a_bottom = array();
345 $at[1]['hematologic_easy_bruising'] = "Easy Bruising";
346 $at[1]['hematologic_bleeding_gums'] = "Bleeding Gums";
348 $a['Hematologic'] = $at;
350 $at = array();
351 $a_bottom = array();
352 $at["When sexually active,<br> are you active with:"]['sexually_active_men'] = "Men";
353 $at["When sexually active,<br> are you active with:"]['sexually_active_women'] = "Women";
354 $at["When sexually active,<br> are you active with:"]['sexually_active_both'] = "Both";
356 $a['General'] = $at;
358 return $a;
362 } // end of Form