Another fix to upgrade clickoptions in windows
[openemr.git] / contrib / forms / habits / form_report.php
blobf16ea51462cf0baae7aaba1af09efb0fd443fa89
1 <?php
3 # this file is form_report.php,
4 # is called by all reporting pages, print, view, and report.
6 $row = formFetch("form_habits", $id);
8 if ($row) {
9 // render. will only take positive data.
10 echo ("<table span class=\"text\">");
12 if ($row['coffee'] || $row['tea'] || $row['soft_drinks'] || $row['other_caffeine'] || $row['caffeine_per_day']) {
13 echo ("<tr><td>");
14 echo ("Caffeine intake: Drinks ");
15 if ($row['coffee']) { echo ("coffee, "); }
16 if ($row['tea']) { echo ("tea, "); }
17 if ($row['soft_drinks']) { echo ("soft drinks, "); }
18 if ($row['other_caffeine']) { echo ("other caffeine, "); }
19 if ($row['caffeine_per_day']) { echo ("in an amount of ${row['caffeine_per_day']} serving(s) per day"); }
20 echo ("</td></tr>");
22 if ($row['salt_usage']) {
23 echo ("<tr><td>");
24 echo ("Salt usage is ${row['salt_usage']}");
25 echo ("</td></tr>");
27 if ($row['sugar_usage']) {
28 echo ("<tr><td>");
29 echo ("Sugar usage is ${row['sugar_usage']}");
30 echo ("</td></tr>");
32 if ($row['diet']) {
33 echo ("<tr><td>");
34 echo ("Diet is ${row['diet']}. ");
35 if ($row['diet_comments']) { echo (" Note: ${row['diet_comments']}"); }
36 echo ("</td></tr>");
38 if ($row['alc_per_day'] || $row['alc_per_week']) {
39 echo ("<tr><td>");
40 echo ("Drinks alcohol in an amount of: ");
41 if ($row['alc_per_day']) { echo ("${row['alc_per_day']} glass(es) per day"); $y=' and/or '; }
42 if ($row['alc_per_week']) { echo ("$y ${row['alc_per_week']} glass(es) per week"); }
43 echo ("</td></tr>");
45 if ($row['recr_drugs'] || $row['recr_drugs_often'] || $row['alc_drug_problem'] || $row['alc_drug_problem_explain'] ) {
46 echo ("<tr><td>");
47 if ($row['recr_drugs']) { echo ("The patients states that she/he uses ${row['recr_drugs']} as recreational drug(s)"); $y=' and/or '; }
48 if ($row['recr_drugs_often']) { echo ("$y she/he uses ${row['recr_drugs_often']} "); }
49 if ($row['recr_drugs'] AND !$row['recr_drugs_often'] ) { echo (" Frecuency is not stated"); }
50 echo ("</td></tr>");
51 echo ("<tr><td>");
52 if ($row['alc_drug_problem']=='YES') { $problem=''; } else { $problem='NOT';}
53 echo ("The patient states that she/he DOES $problem have alcohol or drug problems<br>");
54 if ($row['alc_drug_problem_explain']) { echo ("And explains that: \"${row['alc_drug_problem_explain']} \""); }
55 echo ("</td></tr>");
57 // smoking part.
58 if ($row['current_smoke'] || $row['ever_smoked'] || $row['cig_per_day_now'] || $row['cig_per_day_past'] || $row['how_long_smoke'] || $row['smoke_quit']) {
59 echo ("<tr><td>");
60 $enc_date=DBToDate ($row['date']);
61 if ($row['current_smoke']=='YES' || $row['cig_per_day_now']>=1 ) {
62 echo ("As of $enc_date refers that is currently smoking.");
63 if ($row['cig_per_day_now']>=1) {
64 echo (" ${row['cig_per_day_now']} cigaretes per day.");
66 echo ("<br>");
67 $flag_quit=1;
68 } else {
69 echo ("As of $enc_date refers that is NOT currently smoking.");
71 if ($row['ever_smoked']=='YES' || $row['cig_per_day_past']>=1 ) {
72 echo ("As of $enc_date refers that smoked in the past.");
73 if ($row['cig_per_day_past']>=1) {
74 echo (" ${row['cig_per_day_past']} cigaretes per day.");
76 echo ("<br>");
77 } else {
78 echo ("As of $enc_date refers that DID NOT smoked before.<br>");
81 if ($row['like_to_quit']=='YES') {
82 echo ("Would like to quit smoking.<br>");
83 } elseif ($row['like_to_quit']=='NO') {
84 echo ("Does not want to quit smoking.<br>");
85 } elseif ($flag_quit==1) {
86 echo ("Does not state if wants to quit smoking.<br>");
87 } else {
88 if ($row['smoke_quit_date']) {
89 echo ("Quit smoking on ${row['smoke_quit_date']}.<br>");
92 echo ("</tr></td>");
93 } //eof smoke
94 { // exercise
95 echo ("<tr><td>");
96 if ($row['exercise_types'] || $row['exercise_per_week'] || $row['exercise_minutes']) {
97 if ($row['exercise_types']) { echo ("Type of exercise: ${row['exercise_types']} ");}
98 if ($row['exercise_per_week']) { echo ("${row['exercise_per_week']} times per week");}
99 if ($row['exercise_minutes']) { echo (" for aprox. ${row['exercise_minutes']} each time.<br>");}
100 } else { $flag='no'; }
102 if ($row['exercise_reg'] && $flag=='no') {
103 if ($row['exercise_reg']=="YES") {
104 echo ("She/he states that exercises regularly, but doesn't especify how.<br>");
105 } elseif ($row['exercise_reg']=="NO") {
106 echo ("DOES NOT exercises regularly.<br>");
108 } else {
109 echo ("Does not specifies if exersices regularly.<br>");
111 echo ("</td></tr>");
112 } //eof exercise
113 { //seat belt.
114 if ($row['seat_belt']) {
115 echo ("<tr><td>");
116 echo ("${row['seat_belt']} uses seat belt.");
117 echo ("</td></tr>");
120 { // molestation
121 if ($row['ever_been_molested'] || $row['ever_molested_other'] ){
122 echo ("<tr><td>");
123 if ($row['ever_been_molested']=='NO') {
124 echo ("Declares she/he has never been molested.<br>");
125 } elseif ($row['ever_been_molested']=='YES') {
126 echo ("Declares she/he HAS been molested.<br>");
127 } else {
128 echo ("Does not specifies if ever been molested.<br>");
130 if ($row['ever_molested_other']=='NO') {
131 echo ("Declares she/he has never molested other person.<br>");
132 } elseif ($row['ever_molested_other']=='YES') {
133 echo ("Declares she/he HAS molested other person.<br>");
134 } else {
135 echo ("Does not specifies if ever molested other person.<br>");
137 echo ("</td></tr>");
140 } //eof molestation
143 echo ('</table>');
145 // eof render