Highway to PSR2
[openemr.git] / contrib / forms / evaluation / FormEvaluation.class.php
blob23a7c236622bfd1594c2ae8374e8198097ba8fbb
1 <?php
4 /**
5 * class FormEvaluation
7 */
8 class FormEvaluation extends ORDataObject
11 /**
13 * @access private
16 var $id;
17 var $temp;
18 var $p;
19 var $r;
20 var $bp;
21 var $ht;
22 var $wt;
23 var $bmi;
24 var $lmp;
25 var $complaint;
26 var $hpi;
27 var $eyes_od;
28 var $eyes_os;
29 var $eyes_ou;
30 var $comments;
31 var $assesment;
32 var $pid;
33 var $activity;
34 var $date;
35 var $checks;
37 /**
38 * Constructor sets all Form attributes to their default value
41 function FormEvaluation($id = "", $_prefix = "")
43 if (is_numeric($id)) {
44 $this->id = $id;
45 } else {
46 $id = "";
49 $this->_table = "form_evaluation";
50 $this->date = date("Y-m-d H:i:s");
51 $this->checks = array();
52 $this->activity = 1;
53 $this->pid = $GLOBALS['pid'];
55 if ($id != "") {
56 $this->populate();
60 function populate()
62 parent::populate();
64 $sql = "SELECT name from form_evaluation_checks where foreign_id = '" . add_escape_custom($this->id) . "'";
65 $results = sqlQ($sql);
67 while ($row = sqlFetchArray($results)) {
68 $this->checks[] = $row['name'];
72 function toString($html = false)
74 $string .= "\n"
75 ."ID: " . $this->id . "\n";
77 if ($html) {
78 return nl2br($string);
79 } else {
80 return $string;
83 function set_id($id)
85 if (!empty($id) && is_numeric($id)) {
86 $this->id = $id;
89 function get_id()
91 return $this->id;
93 function set_pid($pid)
95 if (!empty($pid) && is_numeric($pid)) {
96 $this->pid = $pid;
99 function get_pid()
101 return $this->pid;
103 function set_activity($tf)
105 if (!empty($tf) && is_numeric($tf)) {
106 $this->activity = $tf;
109 function get_activity()
111 return $this->activity;
114 function get_date()
116 return $this->date;
119 function set_temp($string)
121 $this->temp = $string;
124 function get_temp()
126 return $this->temp;
129 function set_p($string)
131 $this->p = $string;
134 function get_p()
136 return $this->p;
139 function set_r($string)
141 $this->r = $string;
144 function get_r()
146 return $this->r;
149 function set_bp($string)
151 $this->bp = $string;
154 function get_bp()
156 return $this->bp;
159 function set_ht($string)
161 $this->ht = $string;
164 function get_ht()
166 return $this->ht;
169 function set_wt($string)
171 $this->wt = $string;
174 function get_wt()
176 return $this->wt;
179 function set_bmi($string)
181 $this->bmi = $string;
184 function get_bmi()
186 return $this->bmi;
189 function set_lmp($string)
191 $this->lmp = $string;
194 function get_lmp()
196 return $this->lmp;
199 function set_complaint($string)
201 $this->complaint = $string;
204 function get_complaint()
206 return $this->complaint;
209 function set_hpi($string)
211 $this->hpi = $string;
214 function get_hpi()
216 return $this->hpi;
219 function set_eyes_od($string)
221 $this->eyes_od = $string;
224 function get_eyes_od()
226 return $this->eyes_od;
229 function set_eyes_os($string)
231 $this->eyes_os = $string;
234 function get_eyes_os()
236 return $this->eyes_os;
239 function set_eyes_ou($string)
241 $this->eyes_ou = $string;
244 function get_eyes_ou()
246 return $this->eyes_ou;
249 function set_comments($string)
251 $this->comments = $string;
254 function get_comments()
256 return $this->comments;
259 function set_assesment($string)
261 $this->assesment = $string;
264 function get_assesment()
266 return $this->assesment;
269 function get_checks()
271 return $this->checks;
274 function set_checks($check_array)
276 $this->checks = $check_array;
279 function persist()
282 parent::persist();
283 if (is_numeric($this->id) and !empty($this->checks)) {
284 $sql = "delete FROM form_evaluation_checks where foreign_id = '" . $this->id . "'";
285 sqlQuery($sql);
286 foreach ($this->checks as $check) {
287 if (!empty($check)) {
288 $sql = "INSERT INTO form_evaluation_checks set foreign_id='" . add_escape_custom($this->id) . "', name = '" . add_escape_custom($check) . "'";
289 sqlQuery($sql);
290 //echo "$sql<br>";
296 function _form_layout()
298 $a = array();
300 //at is array temp
301 //a is array
302 //a_bottom is the textually identified rows of a checkbox group
304 $at[1]['appearance_normal_development'] = "Normal Developement";
305 $at[1]['appearance_normal_body_habitus'] = "Normal Body Habitus";
306 $at[1]['appearance_well_groomed'] = "Well Groomed";
308 $a['General Appearance'] = $at;
310 $at = array();
311 $a_bottom = array();
312 $at[1]['eyes_conjunctiva_lids_nl'] = "Conjunctiva and Lids NL";
313 $at[1]['eyes_pupils_iris_nl'] = "Pupils and Iris' NL";
314 $at[1]['eyes_optic_disks_nl'] = "Optic Disks NL";
315 $at[1]['eyes_visual_fields_full_to_confrontation'] = "Visual Fields Full to Confrontation";
317 $at[2]['eyes_extra_occular_movement_intact'] = "Eyes Extra Occular Movement Intact";
318 $at[2]['eyes_with_corrective_lenses'] = "With Corrective Lenses";
319 $at[2]['eyes_without_corrective_lenses'] = "Without Corrective Lenses";
321 $a['Eyes'] = $at;
323 $at = array();
324 $a_bottom = array();
325 $at[1]['ent_external_ears_nose_nl'] = "External Ears and Nose NL";
326 $at[1]['ent_external_auditory_canals_nl'] = "External Auditory Canals NL";
327 $at[1]['ent_tm_nl'] = "TM's NL";
328 $at[1]['ent_hearing_nl_to_confrontation'] = "Hearing NL to confrontation";
330 $a['ENT'] = $at;
332 $at = array();
333 $a_bottom = array();
334 $at[1]['neck_no_neck_masses'] = "No neck masses";
335 $at[1]['neck_symetrical'] = "Symetrical";
336 $at[1]['neck_trachea_midline'] = "Trachea Midline";
337 $at[1]['neck_thyroid_nl'] = "Thyroid NL";
339 $a['Neck'] = $at;
341 $at = array();
342 $a_bottom = array();
343 $at[1]['respiratory_nl_effort'] = "NL Effort";
344 $at[1]['respiratory_no_dullness_to_percussion'] = "No Dullness to Percussion";
345 $at[1]['respiratory_no_rhonci_or_rails'] = "No Rhonci or Rails";
346 $at[1]['respiratory_no_weezing'] = "No Wheezing";
348 $a['Respiratory'] = $at;
350 $at = array();
351 $a_bottom = array();
352 $at[1]['cv_no_lifts_or_thrills'] = "No Lifts or Thrills";
353 $at[1]['cv_pmi_fifth_ic_mc_line'] = "PMI 5th IC MC Line";
354 $at[1]['cv_nl_s1_s2'] = "NL S1/S2";
355 $at[1]['cv_regular_rhythm'] = "Regular Rhythm";
357 $at[2]['cv_carotids_without_bruits'] = "Carotids without bruits";
358 $at[2]['cv_no_jvd'] = "No JVD";
359 $at[2]['cv_no_lower_extremity_edema'] = "No Lower Extremity Edema";
361 $a['CV'] = $at;
363 $at = array();
364 $a_bottom = array();
365 $at[1]['gastrointestinal_abdomen_soft_nontender'] = "Abdomen soft, nontender";
366 $at[1]['gastrointestinal_no_fluid'] = "No Fluid";
367 $at[1]['gastrointestinal_no_hepatosplenomegally'] = "No HepatoSplenomegally";
368 $at[1]['gastrointestinal_no_hernia'] = "No Hernia";
369 $at[1]['gastrointestinal_guiac_negative'] = "Guiac Negative";
371 $a['GastroIntestinal'] = $at;
373 $at = array();
374 $a_bottom = array();
375 $at[1]['gu_male_scrotum_testis_nl'] = "Scrotum and Testis NL";
376 $at[1]['gu_male_penis_nl_without_legions'] = "Penis NL, Without legions";
377 $at[1]['gu_male_prostate_nl'] = "Prostate NL";
378 $at[1]['gu_male_no_penile_disharge'] = "No Penile Discharge";
380 $a['GU (male)'] = $at;
382 $at = array();
383 $a_bottom = array();
384 $at[1]['gu_female_external_genitalia_nl'] = "External Genitalia NL";
385 $at[1]['gu_female_urethra_nl'] = "Urethra NL";
386 $at[1]['gu_female_bladder_nl'] = "Bladder NL";
387 $at[1]['gu_female_cervix_without_discharge'] = "Cervix without discharge";
389 $at[2]['gu_female_no_cervical_motion_tenderness'] = "No Cervical Motion Tenderness";
390 $at[2]['gu_female_uterus_nl_size'] = "Uterus NL size";
391 $at[2]['gu_female_no_adnexal_masses'] = "No Adnexal Masses";
393 $a['GU (female)'] = $at;
395 $at = array();
396 $a_bottom = array();
397 $at[1]['lymphatics_no_cervical_nodes_palpable'] = "No Cervical nodes Palpable";
398 $at[1]['lymphatics_no_axillary_nodes_palpable'] = "No Axillary Nodes Palpable";
399 $at[1]['lymphatics_no_inguinal_nodes_palpable'] = "No Inguinal Nodes Palpable";
401 $a['Lymphatics'] = $at;
403 $at = array();
404 $a_bottom = array();
405 $at[1]['musculoskeletal_gait_normal'] = "Gait Normal";
406 $at[1]['musculoskeletal_nl_symmetry'] = "NL Symmetry";
407 $at[1]['musculoskeletal_nl_tone'] = "NL Tone";
408 $at[1]['musculoskeletal_nl_rom'] = "NL ROM";
410 $at[2]['musculoskeletal_no_instability'] = "No Instability";
411 $at[2]['musculoskeletal_normal_strength_five_five'] = "Normal Strength 5/5";
413 $a['Musculoskeletal'] = $at;
415 $at = array();
416 $a_bottom = array();
417 $at[1]['neurologic_alert_oriented_xthree'] = "Alert and Oriented x3";
418 $at[1]['neurologic_normal_memory'] = "Normal Memory";
419 $at[1]['neurologic_cn_ii_xii_intact_to_confrontation'] = "CN II-XII Intact to Confrontation";
421 $at[2]['neurologic_reflexes_five_five_bicipital_tendon'] = "Reflexes 5/5 Bicipital Tendon";
422 $at[2]['neurologic_reflexes_five_five_tricipital_tendon'] = "Reflexes 5/5 Tricipital Tendon";
423 $at[2]['neurologic_reflexes_five_five_patellar_tendon'] = "Reflexes 5/5 Patellar Tendon";
425 $at[3]['neurologic_reflexes_five_five_achillies_tendon'] = "Reflexes 5/5 Achillies Tendon";
426 $at[3]['neurologic_toes_downgoing_bilaterally'] = "Toes Downgoing Bilaterally";
427 $at[3]['neurologic_sensation_nl_to_light_touch'] = "Sensation NL to light touch";
429 $at[4]['neurologic_sensation_nl_to_hot_cold'] = "Sensation NL to Hot/Cold";
430 $at[4]['neurologic_sensation_nl_to_one_one_point_discrimination'] = "Sensation NL to 1-1 point discrimination";
431 $at[4]['neurologic_speech_is_appropriate'] = "Speech is appropriate";
433 $a['Neurologic'] = $at;
435 $at = array();
436 $a_bottom = array();
437 $at[1]['psychiatric_nl_judgement_insight'] = "NL Judgement/Insight";
438 $at[1]['psychiatric_nl_mood'] = "NL Mood";
439 $at[1]['psychiatric_nl_affect'] = "NL Affect";
440 $at[1]['psychiatric_no_suicidal_ideation'] = "No Suicidal Ideation";
441 $at[1]['psychiatric_normal_eye_contact'] = "Normal Eye Contact";
443 $a['Psychiatric'] = $at;
446 return $a;
448 } // end of Form