Contributed GYM Forms, some of the table.sql files include inserts into list_options...
[openemr.git] / contrib / forms / dub_soap / show.php
blob189e6b37e90c4e0e8c294259668458323c77ebf5
1 <?php
2 /*
3 * The page shown when the user requests to see this form in a "report view". does not allow editing contents, or saving. has 'print' and 'delete' buttons.
4 */
6 /* for $GLOBALS[], ?? */
7 require_once('../../globals.php');
8 /* for acl_check(), ?? */
9 require_once($GLOBALS['srcdir'].'/api.inc');
10 /* for display_layout_rows(), ?? */
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 /* since we have no-where to return, abuse returnurl to link to the 'edit' page */
105 /* FIXME: pass the ID, create blank rows if necissary. */
106 $returnurl = "../../forms/$form_folder/view.php?mode=noencounter";
109 /* define check field functions. used for translating from fields to html viewable strings */
111 function chkdata_Txt(&$record, $var) {
112 return htmlspecialchars($record{"$var"},ENT_QUOTES);
115 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
116 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
117 <head>
119 <!-- declare this document as being encoded in UTF-8 -->
120 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" ></meta>
122 <!-- supporting javascript code -->
123 <!-- for dialog -->
124 <script type="text/javascript" src="<?php echo $GLOBALS['webroot']; ?>/library/dialog.js"></script>
125 <!-- For jquery, required by edit, print, and delete buttons. -->
126 <script type="text/javascript" src="<?php echo $GLOBALS['webroot']; ?>/library/js/jquery.js"></script>
127 <script type="text/javascript" src="<?php echo $GLOBALS['webroot']; ?>/library/textformat.js"></script>
129 <!-- Global Stylesheet -->
130 <link rel="stylesheet" href="<?php echo $css_header; ?>" type="text/css"/>
131 <!-- Form Specific Stylesheet. -->
132 <link rel="stylesheet" href="../../forms/<?php echo $form_folder; ?>/style.css" type="text/css"/>
134 <script type="text/javascript">
136 <!-- FIXME: this needs to detect access method, and construct a URL appropriately! -->
137 function PrintForm() {
138 newwin = window.open("<?php echo $rootdir.'/forms/'.$form_folder.'/print.php?id='.$_GET['id']; ?>","print_<?php echo $form_name; ?>");
141 </script>
142 <title><?php echo htmlspecialchars('Show '.$form_name); ?></title>
144 </head>
145 <body class="body_top">
147 <div id="title">
148 <span class="title"><?php xl($form_name,'e'); ?></span>
149 <?php
150 if ($thisauth == 'write' || $thisauth == 'addonly')
151 { ?>
152 <a href="<?php echo $returnurl; ?>" onclick="top.restoreSession()">
153 <span class="back"><?php xl($tmore,'e'); ?></span>
154 </a>
155 <?php }; ?>
156 </div>
158 <form method="post" id="<?php echo $form_folder; ?>" action="">
160 <!-- container for the main body of the form -->
161 <div id="form_container">
163 <div id="show">
165 <!-- display the form's manual based fields -->
166 <table border='0' cellpadding='0' width='100%'>
167 <tr><td class='sectionlabel'>Subjective</td><!-- called consumeRows 012--> </tr>
168 <tr><td valign='top'>&nbsp;</td><!-- called consumeRows 012--> <td class='fieldlabel' colspan='1'><?php echo xl_layout_label('Previous Sonogram','e').':'; ?></td><td class='text data' colspan='1'><?php echo generate_display_field($manual_layouts['previous_sonogram'], $xyzzy['previous_sonogram']); ?></td></tr>
169 <tr><td valign='top'>&nbsp;</td><!-- called consumeRows 012--> <td class='fieldlabel' colspan='1'><?php echo xl_layout_label('Previous Blood Work','e').':'; ?></td><td class='text data' colspan='1'><?php echo generate_display_field($manual_layouts['previous_blood_work'], $xyzzy['previous_blood_work']); ?></td></tr>
170 <tr><td valign='top'>&nbsp;</td><!-- called consumeRows 012--> <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_display_field($manual_layouts['previous_needs_rx'], $xyzzy['previous_needs_rx']); ?></td></tr>
171 <tr><td valign='top'>&nbsp;</td><!-- called consumeRows 012--> <td class='fieldlabel' colspan='1'><?php echo xl_layout_label('Other','e').':'; ?></td><td class='text data' colspan='1'><?php echo generate_display_field($manual_layouts['other'], $xyzzy['other']); ?></td><!-- called consumeRows 212--> <!-- Exiting not($fields)0--></tr>
172 <tr><td class='sectionlabel'>Objective</td><!-- called consumeRows 012--> <!-- called consumeRows 212--> <!-- Exiting not($fields)0--></tr>
173 <tr><td class='sectionlabel'>Assessment</td><!-- called consumeRows 012--> <!-- called consumeRows 212--> <!-- Exiting not($fields)0--></tr>
174 <tr><td class='sectionlabel'>Plan</td><!-- called consumeRows 012--> </tr>
175 <tr><td valign='top'>&nbsp;</td><!-- called consumeRows 012--> </tr>
176 <tr><td valign='top'>&nbsp;</td><!-- called consumeRows 012--> <!-- called consumeRows 212--> <!-- Exiting not($fields)0--></tr>
177 </table>
180 </div><!-- end show -->
182 </div><!-- end form_container -->
184 <!-- Print button -->
185 <div id="button_bar" class="button_bar">
186 <fieldset class="button_bar">
187 <input type="button" class="print" value="<?php xl('Print','e'); ?>" />
188 </fieldset>
189 </div><!-- end button_bar -->
191 </form>
192 <script type="text/javascript">
193 // jQuery stuff to make the page a little easier to use
195 $(document).ready(function(){
196 $(".print").click(function() { PrintForm(); });
198 </script>
199 </body>
200 </html>