Contributed GYM Forms, some of the table.sql files include inserts into list_options...
[openemr.git] / contrib / forms / dub_soap / print.php
blob7c100b61303364b837ec6603b0ca21c4355402e5
1 <?php
2 /*
3 * The page shown when the user requests to print this form. This page automatically prints itsself, and closes its parent browser window.
4 */
6 /* for $GLOBALS[], ?? */
7 require_once('../../globals.php');
8 /* for acl_check(), ?? */
9 require_once($GLOBALS['srcdir'].'/api.inc');
10 /* for generate_form_field, ?? */
11 require_once($GLOBALS['srcdir'].'/options.inc.php');
13 /** CHANGE THIS - name of the database table associated with this form **/
14 $table_name = 'form_dub_soap';
16 /** CHANGE THIS name to the name of your form. **/
17 $form_name = 'DUB/Pain';
19 /** CHANGE THIS to match the folder you created for this form. **/
20 $form_folder = 'dub_soap';
22 /* Check the access control lists to ensure permissions to this page */
23 $thisauth = acl_check('patients', 'med');
24 if (!$thisauth) {
25 die($form_name.': Access Denied.');
27 /* perform a squad check for pages touching patients, if we're in 'athletic team' mode */
28 if ($GLOBALS['athletic_team']!='false') {
29 $tmp = getPatientData($pid, 'squad');
30 if ($tmp['squad'] && ! acl_check('squads', $tmp['squad']))
31 $thisauth = 0;
33 /* Use the formFetch function from api.inc to load the saved record */
34 $xyzzy = formFetch($table_name, $_GET['id']);
36 /* in order to use the layout engine's draw functions, we need a fake table of layout data. */
37 $manual_layouts = array(
38 'menstrual_history' =>
39 array( 'field_id' => 'menstrual_history',
40 'data_type' => '25',
41 'fld_length' => '140',
42 'description' => '',
43 'list_id' => 'DUB_Menstrual_History' ),
44 'previous_sonogram' =>
45 array( 'field_id' => 'previous_sonogram',
46 'data_type' => '2',
47 'fld_length' => '163',
48 'max_length' => '255',
49 'description' => '',
50 'list_id' => '' ),
51 'previous_blood_work' =>
52 array( 'field_id' => 'previous_blood_work',
53 'data_type' => '2',
54 'fld_length' => '163',
55 'max_length' => '255',
56 'description' => '',
57 'list_id' => '' ),
58 'previous_needs_rx' =>
59 array( 'field_id' => 'previous_needs_rx',
60 'data_type' => '2',
61 'fld_length' => '163',
62 'max_length' => '255',
63 'description' => '',
64 'list_id' => '' ),
65 'other' =>
66 array( 'field_id' => 'other',
67 'data_type' => '3',
68 'fld_length' => '151',
69 'max_length' => '4',
70 'description' => '',
71 'list_id' => '' ),
72 'dub_objective' =>
73 array( 'field_id' => 'dub_objective',
74 'data_type' => '25',
75 'fld_length' => '140',
76 'description' => '',
77 'list_id' => 'DUB_Objective' ),
78 'a_dub' =>
79 array( 'field_id' => 'a_dub',
80 'data_type' => '25',
81 'fld_length' => '140',
82 'description' => '',
83 'list_id' => 'DUB_Diagnosis' ),
84 'plan_lab_work' =>
85 array( 'field_id' => 'plan_lab_work',
86 'data_type' => '25',
87 'fld_length' => '140',
88 'description' => '',
89 'list_id' => 'DUB_Lab_Work' ),
90 'plan_tests_procedures' =>
91 array( 'field_id' => 'plan_tests_procedures',
92 'data_type' => '25',
93 'fld_length' => '140',
94 'description' => '',
95 'list_id' => 'DUB_Tests_Procedures' ),
96 'plan_medications' =>
97 array( 'field_id' => 'plan_medications',
98 'data_type' => '25',
99 'fld_length' => '140',
100 'description' => '',
101 'list_id' => 'DUB_Medications' )
104 $returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php';
107 /* define check field functions. used for translating from fields to html viewable strings */
109 function chkdata_Txt(&$record, $var) {
110 return htmlspecialchars($record{"$var"},ENT_QUOTES);
113 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
115 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
116 <head>
118 <!-- declare this document as being encoded in UTF-8 -->
119 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" ></meta>
121 <!-- supporting javascript code -->
122 <!-- for dialog -->
123 <script type="text/javascript" src="<?php echo $GLOBALS['webroot']; ?>/library/dialog.js"></script>
124 <script type="text/javascript" src="<?php echo $GLOBALS['webroot']; ?>/library/textformat.js"></script>
126 <!-- Global Stylesheet -->
127 <link rel="stylesheet" href="<?php echo $css_header; ?>" type="text/css"/>
128 <!-- Form Specific Stylesheet. -->
129 <link rel="stylesheet" href="../../forms/<?php echo $form_folder; ?>/style.css" type="text/css"/>
130 <title><?php echo htmlspecialchars('Print '.$form_name); ?></title>
132 </head>
133 <body class="body_top">
135 <div class="print_date"><?php xl('Printed on ','e'); echo date('F d, Y', time()); ?></div>
137 <form method="post" id="<?php echo $form_folder; ?>" action="">
138 <div class="title"><?php xl($form_name,'e'); ?></div>
140 <!-- container for the main body of the form -->
141 <div id="print_form_container">
142 <fieldset>
144 <!-- display the form's manual based fields -->
145 <table border='0' cellpadding='0' width='100%'>
146 <tr><td class='sectionlabel'><input type='checkbox' id='form_cb_m_1' value='1' data-section="subjective" checked="checked" />Subjective</td></tr><tr><td><div id="print_subjective" class='section'><table>
147 <!-- called consumeRows 012--> <!-- generating 2 cells and calling --><td class='fieldlabel' colspan='1'><?php echo xl_layout_label('Menstrual History','e').':'; ?></td><td class='text data' colspan='1'><?php echo generate_form_field($manual_layouts['menstrual_history'], $xyzzy['menstrual_history']); ?></td><!-- generating empties --><td class='emptycell' colspan='1'></td></tr>
148 <!-- called consumeRows 012--> <!-- generating 2 cells and calling --><td class='fieldlabel' colspan='1'><?php echo xl_layout_label('Previous Sonogram','e').':'; ?></td><td class='text data' colspan='1'><?php echo generate_form_field($manual_layouts['previous_sonogram'], $xyzzy['previous_sonogram']); ?></td><!-- generating empties --><td class='emptycell' colspan='1'></td></tr>
149 <!-- called consumeRows 012--> <!-- generating 2 cells and calling --><td class='fieldlabel' colspan='1'><?php echo xl_layout_label('Previous Blood Work','e').':'; ?></td><td class='text data' colspan='1'><?php echo generate_form_field($manual_layouts['previous_blood_work'], $xyzzy['previous_blood_work']); ?></td><!-- generating empties --><td class='emptycell' colspan='1'></td></tr>
150 <!-- called consumeRows 012--> <!-- generating 2 cells and calling --><td class='fieldlabel' colspan='1'><?php echo xl_layout_label('Previous Needs for Rx','e').':'; ?></td><td class='text data' colspan='1'><?php echo generate_form_field($manual_layouts['previous_needs_rx'], $xyzzy['previous_needs_rx']); ?></td><!-- generating empties --><td class='emptycell' colspan='1'></td></tr>
151 <!-- called consumeRows 012--> <!-- generating not($fields[$checked+1]) and calling last --><td class='fieldlabel' colspan='1'><?php echo xl_layout_label('Other','e').':'; ?></td><td class='text data' colspan='1'><?php echo generate_form_field($manual_layouts['other'], $xyzzy['other']); ?></td><!-- called consumeRows 212--> <!-- Exiting not($fields) and generating 0 empty fields --></tr>
152 </table></div>
153 </td></tr> <!-- end section subjective -->
154 <tr><td class='sectionlabel'><input type='checkbox' id='form_cb_m_2' value='1' data-section="objective" checked="checked" />Objective</td></tr><tr><td><div id="print_objective" class='section'><table>
155 <!-- called consumeRows 012--> <!-- generating not($fields[$checked+1]) and calling last --><td class='fieldlabel' colspan='1'><?php echo xl_layout_label('Objective','e').':'; ?></td><td class='text data' colspan='1'><?php echo generate_form_field($manual_layouts['dub_objective'], $xyzzy['dub_objective']); ?></td><!-- called consumeRows 212--> <!-- Exiting not($fields) and generating 0 empty fields --></tr>
156 </table></div>
157 </td></tr> <!-- end section objective -->
158 <tr><td class='sectionlabel'><input type='checkbox' id='form_cb_m_3' value='1' data-section="assessment" checked="checked" />Assessment</td></tr><tr><td><div id="print_assessment" class='section'><table>
159 <!-- called consumeRows 012--> <!-- generating not($fields[$checked+1]) and calling last --><td class='fieldlabel' colspan='1'><?php echo xl_layout_label('DUB Assessment','e').':'; ?></td><td class='text data' colspan='1'><?php echo generate_form_field($manual_layouts['a_dub'], $xyzzy['a_dub']); ?></td><!-- called consumeRows 212--> <!-- Exiting not($fields) and generating 0 empty fields --></tr>
160 </table></div>
161 </td></tr> <!-- end section assessment -->
162 <tr><td class='sectionlabel'><input type='checkbox' id='form_cb_m_4' value='1' data-section="plan" checked="checked" />Plan</td></tr><tr><td><div id="print_plan" class='section'><table>
163 <!-- called consumeRows 012--> <!-- generating 2 cells and calling --><td class='fieldlabel' colspan='1'><?php echo xl_layout_label('Lab Work','e').':'; ?></td><td class='text data' colspan='1'><?php echo generate_form_field($manual_layouts['plan_lab_work'], $xyzzy['plan_lab_work']); ?></td><!-- generating empties --><td class='emptycell' colspan='1'></td></tr>
164 <!-- called consumeRows 012--> <!-- generating 2 cells and calling --><td class='fieldlabel' colspan='1'><?php echo xl_layout_label('Tests/Procedures','e').':'; ?></td><td class='text data' colspan='1'><?php echo generate_form_field($manual_layouts['plan_tests_procedures'], $xyzzy['plan_tests_procedures']); ?></td><!-- generating empties --><td class='emptycell' colspan='1'></td></tr>
165 <!-- called consumeRows 012--> <!-- generating not($fields[$checked+1]) and calling last --><td class='fieldlabel' colspan='1'><?php echo xl_layout_label('Medications','e').':'; ?></td><td class='text data' colspan='1'><?php echo generate_form_field($manual_layouts['plan_medications'], $xyzzy['plan_medications']); ?></td><!-- called consumeRows 212--> <!-- Exiting not($fields) and generating 0 empty fields --></tr>
166 </table></div>
167 </td></tr> <!-- end section plan -->
168 </table>
171 </fieldset>
172 </div><!-- end print_form_container -->
174 </form>
175 <script type="text/javascript">
176 window.print();
177 window.close();
178 </script>
179 </body>
180 </html>