Interim autoloaded library/classes via composer classmap, take 4. (#422)
[openemr.git] / contrib / forms / evaluation / FormEvaluation.class.php
blobfcf425fa5ae77ccdeb914beacdc09dcf09feaf37
1 <?php
4 /**
5 * class FormEvaluation
7 */
8 class FormEvaluation extends ORDataObject {
10 /**
12 * @access private
15 var $id;
16 var $temp;
17 var $p;
18 var $r;
19 var $bp;
20 var $ht;
21 var $wt;
22 var $bmi;
23 var $lmp;
24 var $complaint;
25 var $hpi;
26 var $eyes_od;
27 var $eyes_os;
28 var $eyes_ou;
29 var $comments;
30 var $assesment;
31 var $pid;
32 var $activity;
33 var $date;
34 var $checks;
36 /**
37 * Constructor sets all Form attributes to their default value
40 function FormEvaluation($id= "", $_prefix = "") {
41 if (is_numeric($id)) {
42 $this->id = $id;
44 else {
45 $id = "";
48 $this->_table = "form_evaluation";
49 $this->date = date("Y-m-d H:i:s");
50 $this->checks = array();
51 $this->activity = 1;
52 $this->pid = $GLOBALS['pid'];
54 if ($id != "") {
55 $this->populate();
59 function populate() {
60 parent::populate();
62 $sql = "SELECT name from form_evaluation_checks where foreign_id = '" . add_escape_custom($this->id) . "'";
63 $results = sqlQ($sql);
65 while ($row = sqlFetchArray($results)) {
66 $this->checks[] = $row['name'];
71 function toString($html = false) {
72 $string .= "\n"
73 ."ID: " . $this->id . "\n";
75 if ($html) {
76 return nl2br($string);
78 else {
79 return $string;
82 function set_id($id) {
83 if (!empty($id) && is_numeric($id)) {
84 $this->id = $id;
87 function get_id() {
88 return $this->id;
90 function set_pid($pid) {
91 if (!empty($pid) && is_numeric($pid)) {
92 $this->pid = $pid;
95 function get_pid() {
96 return $this->pid;
98 function set_activity($tf) {
99 if (!empty($tf) && is_numeric($tf)) {
100 $this->activity = $tf;
103 function get_activity() {
104 return $this->activity;
107 function get_date() {
108 return $this->date;
111 function set_temp($string) {
112 $this->temp = $string;
115 function get_temp() {
116 return $this->temp;
119 function set_p($string) {
120 $this->p = $string;
123 function get_p() {
124 return $this->p;
127 function set_r($string) {
128 $this->r = $string;
131 function get_r() {
132 return $this->r;
135 function set_bp($string) {
136 $this->bp = $string;
139 function get_bp() {
140 return $this->bp;
143 function set_ht($string) {
144 $this->ht = $string;
147 function get_ht() {
148 return $this->ht;
151 function set_wt($string) {
152 $this->wt = $string;
155 function get_wt() {
156 return $this->wt;
159 function set_bmi($string) {
160 $this->bmi = $string;
163 function get_bmi() {
164 return $this->bmi;
167 function set_lmp($string) {
168 $this->lmp = $string;
171 function get_lmp() {
172 return $this->lmp;
175 function set_complaint($string) {
176 $this->complaint = $string;
179 function get_complaint() {
180 return $this->complaint;
183 function set_hpi($string) {
184 $this->hpi = $string;
187 function get_hpi() {
188 return $this->hpi;
191 function set_eyes_od($string) {
192 $this->eyes_od = $string;
195 function get_eyes_od() {
196 return $this->eyes_od;
199 function set_eyes_os($string) {
200 $this->eyes_os = $string;
203 function get_eyes_os() {
204 return $this->eyes_os;
207 function set_eyes_ou($string) {
208 $this->eyes_ou = $string;
211 function get_eyes_ou() {
212 return $this->eyes_ou;
215 function set_comments($string) {
216 $this->comments = $string;
219 function get_comments() {
220 return $this->comments;
223 function set_assesment($string) {
224 $this->assesment = $string;
227 function get_assesment() {
228 return $this->assesment;
231 function get_checks() {
232 return $this->checks;
235 function set_checks($check_array) {
236 $this->checks = $check_array;
239 function persist() {
241 parent::persist();
242 if (is_numeric($this->id) and !empty($this->checks)) {
243 $sql = "delete FROM form_evaluation_checks where foreign_id = '" . $this->id . "'";
244 sqlQuery($sql);
245 foreach ($this->checks as $check) {
246 if (!empty($check)) {
247 $sql = "INSERT INTO form_evaluation_checks set foreign_id='" . add_escape_custom($this->id) . "', name = '" . add_escape_custom($check) . "'";
248 sqlQuery($sql);
249 //echo "$sql<br>";
256 function _form_layout() {
257 $a = array();
259 //at is array temp
260 //a is array
261 //a_bottom is the textually identified rows of a checkbox group
263 $at[1]['appearance_normal_development'] = "Normal Developement";
264 $at[1]['appearance_normal_body_habitus'] = "Normal Body Habitus";
265 $at[1]['appearance_well_groomed'] = "Well Groomed";
267 $a['General Appearance'] = $at;
269 $at = array();
270 $a_bottom = array();
271 $at[1]['eyes_conjunctiva_lids_nl'] = "Conjunctiva and Lids NL";
272 $at[1]['eyes_pupils_iris_nl'] = "Pupils and Iris' NL";
273 $at[1]['eyes_optic_disks_nl'] = "Optic Disks NL";
274 $at[1]['eyes_visual_fields_full_to_confrontation'] = "Visual Fields Full to Confrontation";
276 $at[2]['eyes_extra_occular_movement_intact'] = "Eyes Extra Occular Movement Intact";
277 $at[2]['eyes_with_corrective_lenses'] = "With Corrective Lenses";
278 $at[2]['eyes_without_corrective_lenses'] = "Without Corrective Lenses";
280 $a['Eyes'] = $at;
282 $at = array();
283 $a_bottom = array();
284 $at[1]['ent_external_ears_nose_nl'] = "External Ears and Nose NL";
285 $at[1]['ent_external_auditory_canals_nl'] = "External Auditory Canals NL";
286 $at[1]['ent_tm_nl'] = "TM's NL";
287 $at[1]['ent_hearing_nl_to_confrontation'] = "Hearing NL to confrontation";
289 $a['ENT'] = $at;
291 $at = array();
292 $a_bottom = array();
293 $at[1]['neck_no_neck_masses'] = "No neck masses";
294 $at[1]['neck_symetrical'] = "Symetrical";
295 $at[1]['neck_trachea_midline'] = "Trachea Midline";
296 $at[1]['neck_thyroid_nl'] = "Thyroid NL";
298 $a['Neck'] = $at;
300 $at = array();
301 $a_bottom = array();
302 $at[1]['respiratory_nl_effort'] = "NL Effort";
303 $at[1]['respiratory_no_dullness_to_percussion'] = "No Dullness to Percussion";
304 $at[1]['respiratory_no_rhonci_or_rails'] = "No Rhonci or Rails";
305 $at[1]['respiratory_no_weezing'] = "No Wheezing";
307 $a['Respiratory'] = $at;
309 $at = array();
310 $a_bottom = array();
311 $at[1]['cv_no_lifts_or_thrills'] = "No Lifts or Thrills";
312 $at[1]['cv_pmi_fifth_ic_mc_line'] = "PMI 5th IC MC Line";
313 $at[1]['cv_nl_s1_s2'] = "NL S1/S2";
314 $at[1]['cv_regular_rhythm'] = "Regular Rhythm";
316 $at[2]['cv_carotids_without_bruits'] = "Carotids without bruits";
317 $at[2]['cv_no_jvd'] = "No JVD";
318 $at[2]['cv_no_lower_extremity_edema'] = "No Lower Extremity Edema";
320 $a['CV'] = $at;
322 $at = array();
323 $a_bottom = array();
324 $at[1]['gastrointestinal_abdomen_soft_nontender'] = "Abdomen soft, nontender";
325 $at[1]['gastrointestinal_no_fluid'] = "No Fluid";
326 $at[1]['gastrointestinal_no_hepatosplenomegally'] = "No HepatoSplenomegally";
327 $at[1]['gastrointestinal_no_hernia'] = "No Hernia";
328 $at[1]['gastrointestinal_guiac_negative'] = "Guiac Negative";
330 $a['GastroIntestinal'] = $at;
332 $at = array();
333 $a_bottom = array();
334 $at[1]['gu_male_scrotum_testis_nl'] = "Scrotum and Testis NL";
335 $at[1]['gu_male_penis_nl_without_legions'] = "Penis NL, Without legions";
336 $at[1]['gu_male_prostate_nl'] = "Prostate NL";
337 $at[1]['gu_male_no_penile_disharge'] = "No Penile Discharge";
339 $a['GU (male)'] = $at;
341 $at = array();
342 $a_bottom = array();
343 $at[1]['gu_female_external_genitalia_nl'] = "External Genitalia NL";
344 $at[1]['gu_female_urethra_nl'] = "Urethra NL";
345 $at[1]['gu_female_bladder_nl'] = "Bladder NL";
346 $at[1]['gu_female_cervix_without_discharge'] = "Cervix without discharge";
348 $at[2]['gu_female_no_cervical_motion_tenderness'] = "No Cervical Motion Tenderness";
349 $at[2]['gu_female_uterus_nl_size'] = "Uterus NL size";
350 $at[2]['gu_female_no_adnexal_masses'] = "No Adnexal Masses";
352 $a['GU (female)'] = $at;
354 $at = array();
355 $a_bottom = array();
356 $at[1]['lymphatics_no_cervical_nodes_palpable'] = "No Cervical nodes Palpable";
357 $at[1]['lymphatics_no_axillary_nodes_palpable'] = "No Axillary Nodes Palpable";
358 $at[1]['lymphatics_no_inguinal_nodes_palpable'] = "No Inguinal Nodes Palpable";
360 $a['Lymphatics'] = $at;
362 $at = array();
363 $a_bottom = array();
364 $at[1]['musculoskeletal_gait_normal'] = "Gait Normal";
365 $at[1]['musculoskeletal_nl_symmetry'] = "NL Symmetry";
366 $at[1]['musculoskeletal_nl_tone'] = "NL Tone";
367 $at[1]['musculoskeletal_nl_rom'] = "NL ROM";
369 $at[2]['musculoskeletal_no_instability'] = "No Instability";
370 $at[2]['musculoskeletal_normal_strength_five_five'] = "Normal Strength 5/5";
372 $a['Musculoskeletal'] = $at;
374 $at = array();
375 $a_bottom = array();
376 $at[1]['neurologic_alert_oriented_xthree'] = "Alert and Oriented x3";
377 $at[1]['neurologic_normal_memory'] = "Normal Memory";
378 $at[1]['neurologic_cn_ii_xii_intact_to_confrontation'] = "CN II-XII Intact to Confrontation";
380 $at[2]['neurologic_reflexes_five_five_bicipital_tendon'] = "Reflexes 5/5 Bicipital Tendon";
381 $at[2]['neurologic_reflexes_five_five_tricipital_tendon'] = "Reflexes 5/5 Tricipital Tendon";
382 $at[2]['neurologic_reflexes_five_five_patellar_tendon'] = "Reflexes 5/5 Patellar Tendon";
384 $at[3]['neurologic_reflexes_five_five_achillies_tendon'] = "Reflexes 5/5 Achillies Tendon";
385 $at[3]['neurologic_toes_downgoing_bilaterally'] = "Toes Downgoing Bilaterally";
386 $at[3]['neurologic_sensation_nl_to_light_touch'] = "Sensation NL to light touch";
388 $at[4]['neurologic_sensation_nl_to_hot_cold'] = "Sensation NL to Hot/Cold";
389 $at[4]['neurologic_sensation_nl_to_one_one_point_discrimination'] = "Sensation NL to 1-1 point discrimination";
390 $at[4]['neurologic_speech_is_appropriate'] = "Speech is appropriate";
392 $a['Neurologic'] = $at;
394 $at = array();
395 $a_bottom = array();
396 $at[1]['psychiatric_nl_judgement_insight'] = "NL Judgement/Insight";
397 $at[1]['psychiatric_nl_mood'] = "NL Mood";
398 $at[1]['psychiatric_nl_affect'] = "NL Affect";
399 $at[1]['psychiatric_no_suicidal_ideation'] = "No Suicidal Ideation";
400 $at[1]['psychiatric_normal_eye_contact'] = "Normal Eye Contact";
402 $a['Psychiatric'] = $at;
405 return $a;
409 } // end of Form