Contributed GYM Forms, some of the table.sql files include inserts into list_options...
[openemr.git] / contrib / forms / vaginitis_soap / print.php
blob30250f70b481a6f13d76f29f1b53704bcf359722
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_vaginitis_soap';
16 /** CHANGE THIS name to the name of your form. **/
17 $form_name = 'Vaginitis Complaints';
19 /** CHANGE THIS to match the folder you created for this form. **/
20 $form_folder = 'vaginitis_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 'vaginitis_complaints' =>
39 array( 'field_id' => 'vaginitis_complaints',
40 'data_type' => '25',
41 'fld_length' => '140',
42 'description' => '',
43 'list_id' => 'Vaginitis_Complaints' ),
44 'other' =>
45 array( 'field_id' => 'other',
46 'data_type' => '3',
47 'fld_length' => '151',
48 'max_length' => '4',
49 'description' => '',
50 'list_id' => '' ),
51 'duration' =>
52 array( 'field_id' => 'duration',
53 'data_type' => '2',
54 'fld_length' => '163',
55 'max_length' => '255',
56 'description' => '',
57 'list_id' => '' ),
58 'objective_exam' =>
59 array( 'field_id' => 'objective_exam',
60 'data_type' => '25',
61 'fld_length' => '140',
62 'description' => '',
63 'list_id' => 'Vaginitis_Exam' ),
64 'vaginitis' =>
65 array( 'field_id' => 'vaginitis',
66 'data_type' => '25',
67 'fld_length' => '140',
68 'description' => '',
69 'list_id' => 'Vaginitis_Diagnosis' ),
70 'plan_medications' =>
71 array( 'field_id' => 'plan_medications',
72 'data_type' => '25',
73 'fld_length' => '140',
74 'description' => '',
75 'list_id' => 'Vaginitis_Medications' ),
76 'plan_behavior_modification' =>
77 array( 'field_id' => 'plan_behavior_modification',
78 'data_type' => '3',
79 'fld_length' => '40',
80 'max_length' => '4',
81 'description' => '',
82 'list_id' => '' ),
83 'plan_cultures' =>
84 array( 'field_id' => 'plan_cultures',
85 'data_type' => '25',
86 'fld_length' => '140',
87 'description' => '',
88 'list_id' => 'Vaginitis_Cultures' ),
89 'plan_other' =>
90 array( 'field_id' => 'plan_other',
91 'data_type' => '3',
92 'fld_length' => '40',
93 'max_length' => '4',
94 'description' => '',
95 'list_id' => '' )
98 $returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php';
101 /* define check field functions. used for translating from fields to html viewable strings */
103 function chkdata_Txt(&$record, $var) {
104 return htmlspecialchars($record{"$var"},ENT_QUOTES);
107 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
109 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
110 <head>
112 <!-- declare this document as being encoded in UTF-8 -->
113 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" ></meta>
115 <!-- supporting javascript code -->
116 <!-- for dialog -->
117 <script type="text/javascript" src="<?php echo $GLOBALS['webroot']; ?>/library/dialog.js"></script>
118 <script type="text/javascript" src="<?php echo $GLOBALS['webroot']; ?>/library/textformat.js"></script>
120 <!-- Global Stylesheet -->
121 <link rel="stylesheet" href="<?php echo $css_header; ?>" type="text/css"/>
122 <!-- Form Specific Stylesheet. -->
123 <link rel="stylesheet" href="../../forms/<?php echo $form_folder; ?>/style.css" type="text/css"/>
124 <title><?php echo htmlspecialchars('Print '.$form_name); ?></title>
126 </head>
127 <body class="body_top">
129 <div class="print_date"><?php xl('Printed on ','e'); echo date('F d, Y', time()); ?></div>
131 <form method="post" id="<?php echo $form_folder; ?>" action="">
132 <div class="title"><?php xl($form_name,'e'); ?></div>
134 <!-- container for the main body of the form -->
135 <div id="print_form_container">
136 <fieldset>
138 <!-- display the form's manual based fields -->
139 <table border='0' cellpadding='0' width='100%'>
140 <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>
141 <!-- called consumeRows 012--> <!-- generating 2 cells and calling --><td class='fieldlabel' colspan='1'><?php echo xl_layout_label('Vaginitis Complaints','e').':'; ?></td><td class='text data' colspan='1'><?php echo generate_form_field($manual_layouts['vaginitis_complaints'], $xyzzy['vaginitis_complaints']); ?></td><!-- generating empties --><td class='emptycell' colspan='1'></td></tr>
142 <!-- called consumeRows 012--> <!-- generating 2 cells and calling --><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><!-- generating empties --><td class='emptycell' colspan='1'></td></tr>
143 <!-- called consumeRows 012--> <!-- generating not($fields[$checked+1]) and calling last --><td class='fieldlabel' colspan='1'><?php echo xl_layout_label('Duration','e').':'; ?></td><td class='text data' colspan='1'><?php echo generate_form_field($manual_layouts['duration'], $xyzzy['duration']); ?></td><!-- called consumeRows 212--> <!-- Exiting not($fields) and generating 0 empty fields --></tr>
144 </table></div>
145 </td></tr> <!-- end section subjective -->
146 <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>
147 <!-- called consumeRows 012--> <!-- generating not($fields[$checked+1]) and calling last --><td class='fieldlabel' colspan='1'><?php echo xl_layout_label('Exam','e').':'; ?></td><td class='text data' colspan='1'><?php echo generate_form_field($manual_layouts['objective_exam'], $xyzzy['objective_exam']); ?></td><!-- called consumeRows 212--> <!-- Exiting not($fields) and generating 0 empty fields --></tr>
148 </table></div>
149 </td></tr> <!-- end section objective -->
150 <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>
151 <!-- called consumeRows 012--> <!-- generating not($fields[$checked+1]) and calling last --><td class='fieldlabel' colspan='1'><?php echo xl_layout_label('Vginitis','e').':'; ?></td><td class='text data' colspan='1'><?php echo generate_form_field($manual_layouts['vaginitis'], $xyzzy['vaginitis']); ?></td><!-- called consumeRows 212--> <!-- Exiting not($fields) and generating 0 empty fields --></tr>
152 </table></div>
153 </td></tr> <!-- end section assessment -->
154 <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>
155 <!-- called consumeRows 012--> <!-- generating 2 cells and calling --><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><!-- generating empties --><td class='emptycell' colspan='1'></td></tr>
156 <!-- called consumeRows 012--> <!-- generating 2 cells and calling --><td class='fieldlabel' colspan='1'><?php echo xl_layout_label('Behavior Modification','e').':'; ?></td><td class='text data' colspan='1'><?php echo generate_form_field($manual_layouts['plan_behavior_modification'], $xyzzy['plan_behavior_modification']); ?></td><!-- generating empties --><td class='emptycell' colspan='1'></td></tr>
157 <!-- called consumeRows 012--> <!-- generating 2 cells and calling --><td class='fieldlabel' colspan='1'><?php echo xl_layout_label('Cultures','e').':'; ?></td><td class='text data' colspan='1'><?php echo generate_form_field($manual_layouts['plan_cultures'], $xyzzy['plan_cultures']); ?></td><!-- generating empties --><td class='emptycell' colspan='1'></td></tr>
158 <!-- 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['plan_other'], $xyzzy['plan_other']); ?></td><!-- called consumeRows 212--> <!-- Exiting not($fields) and generating 0 empty fields --></tr>
159 </table></div>
160 </td></tr> <!-- end section plan -->
161 </table>
164 </fieldset>
165 </div><!-- end print_form_container -->
167 </form>
168 <script type="text/javascript">
169 window.print();
170 window.close();
171 </script>
172 </body>
173 </html>