PHP7 project, commit 1.
[openemr.git] / contrib / forms / evaluation / FormEvaluation.class.php
blobe902d2413e436632b598a2bea1330ececb51211f
1 <?php
3 require_once(dirname(__FILE__) . "/../../../library/classes/ORDataObject.class.php");
5 /**
6 * class FormEvaluation
8 */
9 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 = "") {
42 if (is_numeric($id)) {
43 $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() {
61 parent::populate();
63 $sql = "SELECT name from form_evaluation_checks where foreign_id = '" . add_escape_custom($this->id) . "'";
64 $results = sqlQ($sql);
66 while ($row = mysql_fetch_array($results, MYSQL_ASSOC)) {
67 $this->checks[] = $row['name'];
72 function toString($html = false) {
73 $string .= "\n"
74 ."ID: " . $this->id . "\n";
76 if ($html) {
77 return nl2br($string);
79 else {
80 return $string;
83 function set_id($id) {
84 if (!empty($id) && is_numeric($id)) {
85 $this->id = $id;
88 function get_id() {
89 return $this->id;
91 function set_pid($pid) {
92 if (!empty($pid) && is_numeric($pid)) {
93 $this->pid = $pid;
96 function get_pid() {
97 return $this->pid;
99 function set_activity($tf) {
100 if (!empty($tf) && is_numeric($tf)) {
101 $this->activity = $tf;
104 function get_activity() {
105 return $this->activity;
108 function get_date() {
109 return $this->date;
112 function set_temp($string) {
113 $this->temp = $string;
116 function get_temp() {
117 return $this->temp;
120 function set_p($string) {
121 $this->p = $string;
124 function get_p() {
125 return $this->p;
128 function set_r($string) {
129 $this->r = $string;
132 function get_r() {
133 return $this->r;
136 function set_bp($string) {
137 $this->bp = $string;
140 function get_bp() {
141 return $this->bp;
144 function set_ht($string) {
145 $this->ht = $string;
148 function get_ht() {
149 return $this->ht;
152 function set_wt($string) {
153 $this->wt = $string;
156 function get_wt() {
157 return $this->wt;
160 function set_bmi($string) {
161 $this->bmi = $string;
164 function get_bmi() {
165 return $this->bmi;
168 function set_lmp($string) {
169 $this->lmp = $string;
172 function get_lmp() {
173 return $this->lmp;
176 function set_complaint($string) {
177 $this->complaint = $string;
180 function get_complaint() {
181 return $this->complaint;
184 function set_hpi($string) {
185 $this->hpi = $string;
188 function get_hpi() {
189 return $this->hpi;
192 function set_eyes_od($string) {
193 $this->eyes_od = $string;
196 function get_eyes_od() {
197 return $this->eyes_od;
200 function set_eyes_os($string) {
201 $this->eyes_os = $string;
204 function get_eyes_os() {
205 return $this->eyes_os;
208 function set_eyes_ou($string) {
209 $this->eyes_ou = $string;
212 function get_eyes_ou() {
213 return $this->eyes_ou;
216 function set_comments($string) {
217 $this->comments = $string;
220 function get_comments() {
221 return $this->comments;
224 function set_assesment($string) {
225 $this->assesment = $string;
228 function get_assesment() {
229 return $this->assesment;
232 function get_checks() {
233 return $this->checks;
236 function set_checks($check_array) {
237 $this->checks = $check_array;
240 function persist() {
242 parent::persist();
243 if (is_numeric($this->id) and !empty($this->checks)) {
244 $sql = "delete FROM form_evaluation_checks where foreign_id = '" . $this->id . "'";
245 sqlQuery($sql);
246 foreach ($this->checks as $check) {
247 if (!empty($check)) {
248 $sql = "INSERT INTO form_evaluation_checks set foreign_id='" . add_escape_custom($this->id) . "', name = '" . add_escape_custom($check) . "'";
249 sqlQuery($sql);
250 //echo "$sql<br>";
257 function _form_layout() {
258 $a = array();
260 //at is array temp
261 //a is array
262 //a_bottom is the textually identified rows of a checkbox group
264 $at[1]['appearance_normal_development'] = "Normal Developement";
265 $at[1]['appearance_normal_body_habitus'] = "Normal Body Habitus";
266 $at[1]['appearance_well_groomed'] = "Well Groomed";
268 $a['General Appearance'] = $at;
270 $at = array();
271 $a_bottom = array();
272 $at[1]['eyes_conjunctiva_lids_nl'] = "Conjunctiva and Lids NL";
273 $at[1]['eyes_pupils_iris_nl'] = "Pupils and Iris' NL";
274 $at[1]['eyes_optic_disks_nl'] = "Optic Disks NL";
275 $at[1]['eyes_visual_fields_full_to_confrontation'] = "Visual Fields Full to Confrontation";
277 $at[2]['eyes_extra_occular_movement_intact'] = "Eyes Extra Occular Movement Intact";
278 $at[2]['eyes_with_corrective_lenses'] = "With Corrective Lenses";
279 $at[2]['eyes_without_corrective_lenses'] = "Without Corrective Lenses";
281 $a['Eyes'] = $at;
283 $at = array();
284 $a_bottom = array();
285 $at[1]['ent_external_ears_nose_nl'] = "External Ears and Nose NL";
286 $at[1]['ent_external_auditory_canals_nl'] = "External Auditory Canals NL";
287 $at[1]['ent_tm_nl'] = "TM's NL";
288 $at[1]['ent_hearing_nl_to_confrontation'] = "Hearing NL to confrontation";
290 $a['ENT'] = $at;
292 $at = array();
293 $a_bottom = array();
294 $at[1]['neck_no_neck_masses'] = "No neck masses";
295 $at[1]['neck_symetrical'] = "Symetrical";
296 $at[1]['neck_trachea_midline'] = "Trachea Midline";
297 $at[1]['neck_thyroid_nl'] = "Thyroid NL";
299 $a['Neck'] = $at;
301 $at = array();
302 $a_bottom = array();
303 $at[1]['respiratory_nl_effort'] = "NL Effort";
304 $at[1]['respiratory_no_dullness_to_percussion'] = "No Dullness to Percussion";
305 $at[1]['respiratory_no_rhonci_or_rails'] = "No Rhonci or Rails";
306 $at[1]['respiratory_no_weezing'] = "No Wheezing";
308 $a['Respiratory'] = $at;
310 $at = array();
311 $a_bottom = array();
312 $at[1]['cv_no_lifts_or_thrills'] = "No Lifts or Thrills";
313 $at[1]['cv_pmi_fifth_ic_mc_line'] = "PMI 5th IC MC Line";
314 $at[1]['cv_nl_s1_s2'] = "NL S1/S2";
315 $at[1]['cv_regular_rhythm'] = "Regular Rhythm";
317 $at[2]['cv_carotids_without_bruits'] = "Carotids without bruits";
318 $at[2]['cv_no_jvd'] = "No JVD";
319 $at[2]['cv_no_lower_extremity_edema'] = "No Lower Extremity Edema";
321 $a['CV'] = $at;
323 $at = array();
324 $a_bottom = array();
325 $at[1]['gastrointestinal_abdomen_soft_nontender'] = "Abdomen soft, nontender";
326 $at[1]['gastrointestinal_no_fluid'] = "No Fluid";
327 $at[1]['gastrointestinal_no_hepatosplenomegally'] = "No HepatoSplenomegally";
328 $at[1]['gastrointestinal_no_hernia'] = "No Hernia";
329 $at[1]['gastrointestinal_guiac_negative'] = "Guiac Negative";
331 $a['GastroIntestinal'] = $at;
333 $at = array();
334 $a_bottom = array();
335 $at[1]['gu_male_scrotum_testis_nl'] = "Scrotum and Testis NL";
336 $at[1]['gu_male_penis_nl_without_legions'] = "Penis NL, Without legions";
337 $at[1]['gu_male_prostate_nl'] = "Prostate NL";
338 $at[1]['gu_male_no_penile_disharge'] = "No Penile Discharge";
340 $a['GU (male)'] = $at;
342 $at = array();
343 $a_bottom = array();
344 $at[1]['gu_female_external_genitalia_nl'] = "External Genitalia NL";
345 $at[1]['gu_female_urethra_nl'] = "Urethra NL";
346 $at[1]['gu_female_bladder_nl'] = "Bladder NL";
347 $at[1]['gu_female_cervix_without_discharge'] = "Cervix without discharge";
349 $at[2]['gu_female_no_cervical_motion_tenderness'] = "No Cervical Motion Tenderness";
350 $at[2]['gu_female_uterus_nl_size'] = "Uterus NL size";
351 $at[2]['gu_female_no_adnexal_masses'] = "No Adnexal Masses";
353 $a['GU (female)'] = $at;
355 $at = array();
356 $a_bottom = array();
357 $at[1]['lymphatics_no_cervical_nodes_palpable'] = "No Cervical nodes Palpable";
358 $at[1]['lymphatics_no_axillary_nodes_palpable'] = "No Axillary Nodes Palpable";
359 $at[1]['lymphatics_no_inguinal_nodes_palpable'] = "No Inguinal Nodes Palpable";
361 $a['Lymphatics'] = $at;
363 $at = array();
364 $a_bottom = array();
365 $at[1]['musculoskeletal_gait_normal'] = "Gait Normal";
366 $at[1]['musculoskeletal_nl_symmetry'] = "NL Symmetry";
367 $at[1]['musculoskeletal_nl_tone'] = "NL Tone";
368 $at[1]['musculoskeletal_nl_rom'] = "NL ROM";
370 $at[2]['musculoskeletal_no_instability'] = "No Instability";
371 $at[2]['musculoskeletal_normal_strength_five_five'] = "Normal Strength 5/5";
373 $a['Musculoskeletal'] = $at;
375 $at = array();
376 $a_bottom = array();
377 $at[1]['neurologic_alert_oriented_xthree'] = "Alert and Oriented x3";
378 $at[1]['neurologic_normal_memory'] = "Normal Memory";
379 $at[1]['neurologic_cn_ii_xii_intact_to_confrontation'] = "CN II-XII Intact to Confrontation";
381 $at[2]['neurologic_reflexes_five_five_bicipital_tendon'] = "Reflexes 5/5 Bicipital Tendon";
382 $at[2]['neurologic_reflexes_five_five_tricipital_tendon'] = "Reflexes 5/5 Tricipital Tendon";
383 $at[2]['neurologic_reflexes_five_five_patellar_tendon'] = "Reflexes 5/5 Patellar Tendon";
385 $at[3]['neurologic_reflexes_five_five_achillies_tendon'] = "Reflexes 5/5 Achillies Tendon";
386 $at[3]['neurologic_toes_downgoing_bilaterally'] = "Toes Downgoing Bilaterally";
387 $at[3]['neurologic_sensation_nl_to_light_touch'] = "Sensation NL to light touch";
389 $at[4]['neurologic_sensation_nl_to_hot_cold'] = "Sensation NL to Hot/Cold";
390 $at[4]['neurologic_sensation_nl_to_one_one_point_discrimination'] = "Sensation NL to 1-1 point discrimination";
391 $at[4]['neurologic_speech_is_appropriate'] = "Speech is appropriate";
393 $a['Neurologic'] = $at;
395 $at = array();
396 $a_bottom = array();
397 $at[1]['psychiatric_nl_judgement_insight'] = "NL Judgement/Insight";
398 $at[1]['psychiatric_nl_mood'] = "NL Mood";
399 $at[1]['psychiatric_nl_affect'] = "NL Affect";
400 $at[1]['psychiatric_no_suicidal_ideation'] = "No Suicidal Ideation";
401 $at[1]['psychiatric_normal_eye_contact'] = "Normal Eye Contact";
403 $a['Psychiatric'] = $at;
406 return $a;
410 } // end of Form