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.
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');
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']))
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',
41 'fld_length' => '140',
43 'list_id' => 'DUB_Menstrual_History' ),
44 'previous_sonogram' =>
45 array( 'field_id' => 'previous_sonogram',
47 'fld_length' => '163',
48 'max_length' => '255',
51 'previous_blood_work' =>
52 array( 'field_id' => 'previous_blood_work',
54 'fld_length' => '163',
55 'max_length' => '255',
58 'previous_needs_rx' =>
59 array( 'field_id' => 'previous_needs_rx',
61 'fld_length' => '163',
62 'max_length' => '255',
66 array( 'field_id' => 'other',
68 'fld_length' => '151',
73 array( 'field_id' => 'dub_objective',
75 'fld_length' => '140',
77 'list_id' => 'DUB_Objective' ),
79 array( 'field_id' => 'a_dub',
81 'fld_length' => '140',
83 'list_id' => 'DUB_Diagnosis' ),
85 array( 'field_id' => 'plan_lab_work',
87 'fld_length' => '140',
89 'list_id' => 'DUB_Lab_Work' ),
90 'plan_tests_procedures' =>
91 array( 'field_id' => 'plan_tests_procedures',
93 'fld_length' => '140',
95 'list_id' => 'DUB_Tests_Procedures' ),
97 array( 'field_id' => 'plan_medications',
99 'fld_length' => '140',
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">
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
-->
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; ?>");
142 <title
><?php
echo htmlspecialchars('Show '.$form_name); ?
></title
>
145 <body
class="body_top">
148 <span
class="title"><?php
xl($form_name,'e'); ?
></span
>
150 if ($thisauth == 'write' ||
$thisauth == 'addonly')
152 <a href
="<?php echo $returnurl; ?>" onclick
="top.restoreSession()">
153 <span
class="back"><?php
xl($tmore,'e'); ?
></span
>
158 <form method
="post" id
="<?php echo $form_folder; ?>" action
="">
160 <!-- container
for the main body of the form
-->
161 <div id
="form_container">
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
'> </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
'> </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
'> </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
'> </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
'> </td><!-- called consumeRows 012--> </tr>
176 <tr><td valign='top
'> </td><!-- called consumeRows 012--> <!-- called consumeRows 212--> <!-- Exiting not($fields)0--></tr>
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
'); ?>" />
189 </div><!-- end button_bar -->
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(); });