Support for optional logging of print actions.
[openemr.git] / interface / forms / aftercare_plan / new.php
blob306bbf49dda310689d8b9b8134b1fd0b3fb7ac03
1 <?php
2 /**
4 * Copyright (C) 2012-2013 Naina Mohamed <naina@capminds.com> CapMinds Technologies
6 * LICENSE: This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 3
9 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
17 * @package OpenEMR
18 * @author Naina Mohamed <naina@capminds.com>
19 * @link http://www.open-emr.org
23 //SANITIZE ALL ESCAPES
24 $sanitize_all_escapes=true;
26 //STOP FAKE REGISTER GLOBALS
27 $fake_register_globals=false;
29 include_once("../../globals.php");
30 include_once("$srcdir/api.inc");
31 require_once("$srcdir/patient.inc");
32 require_once("$srcdir/options.inc.php");
33 require_once("$srcdir/htmlspecialchars.inc.php");
34 formHeader("Form:AfterCare Planning");
35 $returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php';
36 $formid = 0 + (isset($_GET['id']) ? $_GET['id'] : '');
37 $obj = $formid ? formFetch("form_aftercare_plan", $formid) : array();
40 <html>
41 <head>
42 <?php html_header_show();?>
43 <script type="text/javascript" src="../../../library/dialog.js"></script>
44 <!-- pop up calendar -->
45 <style type="text/css">@import url(<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar.css);</style>
46 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar.js"></script>
47 <?php include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?>
48 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar_setup.js"></script>
49 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/textformat.js"></script>
50 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js"></script>
51 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
53 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery-1.9.1.min.js"></script>
54 <script language="JavaScript">
55 $(document).ready(function() {
56 var win = top.printLogSetup ? top : opener.top;
57 win.printLogSetup(document.getElementById('printbutton'));
58 });
59 </script>
61 </head>
62 <body class="body_top">
63 <p><span class="forms-title"><?php echo xlt('AfterCare Planning'); ?></span></p>
64 </br>
65 <?php
66 echo "<form method='post' name='my_form' " .
67 "action='$rootdir/forms/aftercare_plan/save.php?id=" . attr($formid) ."'>\n";
69 <table border="0">
70 <tr>
71 <td align="left" class="forms" class="forms"><?php echo xlt('Client Name' ); ?>:</td>
72 <td class="forms">
73 <label class="forms-data"> <?php if (is_numeric($pid)) {
75 $result = getPatientData($pid, "fname,lname,squad");
76 echo htmlspecialchars(text($result['fname'])." ".text($result['lname']));}
77 $patient_name=($result['fname'])." ".($result['lname']);
79 </label>
80 <input type="hidden" name="client_name" value="<?php echo attr($patient_name);?>">
81 </td>
82 <td align="left" class="forms"><?php echo xlt('DOB'); ?>:</td>
83 <td class="forms">
84 <label class="forms-data"> <?php if (is_numeric($pid)) {
86 $result = getPatientData($pid, "*");
87 echo htmlspecialchars($result['DOB']);}
88 $dob=($result['DOB']);
90 </label>
91 <input type="hidden" name="DOB" value="<?php echo attr($dob);?>">
92 </td>
93 </tr>
94 <tr>
97 <td align="left" class="forms"><?php echo xlt('Admit Date'); ?>:</td>
98 <td class="forms">
99 <input type='text' size='10' name='admit_date' id='admission_date' <?php echo attr($disabled); ?>;
100 value='<?php echo attr($obj{"admit_date"}); ?>'
101 title='<?php echo xla('yyyy-mm-dd Date of service'); ?>'
102 onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' />
103 <img src='../../pic/show_calendar.gif' align='absbottom' width='24' height='22'
104 id='img_admission_date' border='0' alt='[?]' style='cursor:pointer;cursor:hand'
105 title='<?php echo xla('Click here to choose a date'); ?>'>
106 </td>
110 <td align="left" class="forms"><?php echo xlt('Discharged'); ?>:</td>
111 <td class="forms">
112 <input type='text' size='10' name='discharged' id='discharge_date' <?php echo attr($disabled); ?>;
113 value='<?php echo attr($obj{"discharged"}); ?>'
114 title='<?php echo xla('yyyy-mm-dd Date of service'); ?>'
115 onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' />
116 <img src='../../pic/show_calendar.gif' align='absbottom' width='24' height='22'
117 id='img_discharge_date' border='0' alt='[?]' style='cursor:pointer;cursor:hand'
118 title='<?php echo xla('Click here to choose a date'); ?>'>
119 </td>
120 </tr>
121 <tr>
122 <td align="left colspan="3" style="padding-bottom:7px;"></td>
123 </tr>
124 <tr>
126 <td class="forms-subtitle" colspan="4"><B><?php echo xlt('Goal and Methods');?></B></td>
128 </tr>
129 <tr>
130 <td align="left colspan="3" style="padding-bottom:7px;"></td>
131 </tr>
132 <tr>
134 <td class="forms-subtitle" colspan="4"><B><?php echo xlt('Goal A');?>:</B>&nbsp;<?php echo xlt('Acute Intoxication/Withdrawal'); ?></td>
136 </tr>
137 <tr>
138 <td align="right" class="forms">1.</td>
139 <td colspan="3"><textarea name="goal_a_acute_intoxication" rows="2" cols="80" wrap="virtual name"><?php echo text($obj{"goal_a_acute_intoxication"});?></textarea></td>
141 </tr>
142 <tr>
143 <td align="right" class="forms">2.</td>
144 <td colspan="3"><textarea name="goal_a_acute_intoxication_I" rows="2" cols="80" wrap="virtual name"><?php echo text($obj{"goal_a_acute_intoxication_I"});?></textarea></td>
146 </tr>
147 <tr>
148 <td align="right" class="forms">3.</td>
149 <td colspan="3"><textarea name="goal_a_acute_intoxication_II" rows="2" cols="80" wrap="virtual name"><?php echo text($obj{"goal_a_acute_intoxication_II"});?></textarea></td>
152 <tr>
154 <td class="forms-subtitle" colspan="4"><B><?php echo xlt('Goal B');?>:</B>&nbsp;<?php echo xlt('Emotional / Behavioral Conditions & Complications'); ?></td>
156 </tr>
157 <tr>
158 <td align="right" class="forms">1.</td>
159 <td colspan="3"><textarea name="goal_b_emotional_behavioral_conditions" rows="2" cols="80" wrap="virtual name"><?php echo text($obj{"goal_b_emotional_behavioral_conditions"});?></textarea></td>
161 </tr>
162 <tr>
163 <td align="right" class="forms">2.</td>
164 <td colspan="3"><textarea name="goal_b_emotional_behavioral_conditions_I" rows="2" cols="80" wrap="virtual name"><?php echo text($obj{"goal_b_emotional_behavioral_conditions_I"});?></textarea></td>
166 </tr>
169 <td class="forms-subtitle" colspan="4"><B><?php echo xlt('Goal C');?>:</B>&nbsp;<?php echo xlt('Relapse Potential'); ?></td>
171 </tr>
172 <tr>
173 <td align="right" class="forms">1.</td>
174 <td colspan="3"><textarea name="goal_c_relapse_potential" rows="2" cols="80" wrap="virtual name"><?php echo text($obj{"goal_c_relapse_potential"});?></textarea></td>
176 </tr>
177 <tr>
178 <td align="right" class="forms">2.</td>
179 <td colspan="3"><textarea name="goal_c_relapse_potential_I" rows="2" cols="80" wrap="virtual name"><?php echo text($obj{"goal_c_relapse_potential_I"});?></textarea></td>
181 </tr>
183 <tr>
184 <td align="left colspan="3" style="padding-bottom:7px;"></td>
185 </tr>
186 <tr>
187 <td></td>
188 <td><input type='submit' value='<?php echo xla('Save'); ?>' class='button-css' />&nbsp;
189 <input type='button' value='<?php echo xla('Print'); ?>' id='printbutton' class='button-css' />&nbsp;
190 <input type='button' class='button-css' value='<?php echo xla('Cancel'); ?>'
191 onclick="top.restoreSession();location='<?php echo "$rootdir/patient_file/encounter/$returnurl" ?>'" /></td>
192 </tr>
193 </table>
194 </form>
195 <script language="javascript">
196 /* required for popup calendar */
197 Calendar.setup({inputField:"admission_date", ifFormat:"%Y-%m-%d", button:"img_admission_date"});
198 Calendar.setup({inputField:"discharge_date", ifFormat:"%Y-%m-%d", button:"img_discharge_date"});
199 </script>
200 <?php
201 formFooter();