minor bug fixes for previous commit
[openemr.git] / interface / forms / treatment_plan / new.php
blob71c6bab4b18a7fcf11d53de0ae19cd6826177db0
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
22 //SANITIZE ALL ESCAPES
23 $sanitize_all_escapes=true;
25 //STOP FAKE REGISTER GLOBALS
26 $fake_register_globals=false;
28 include_once("../../globals.php");
29 include_once("$srcdir/api.inc");
30 require_once("$srcdir/patient.inc");
31 require_once("$srcdir/options.inc.php");
32 formHeader("Form:Treatment Planning");
33 $returnurl = $GLOBALS['concurrent_layout'] ? 'encounter_top.php' : 'patient_encounter.php';
34 $formid = 0 + (isset($_GET['id']) ? $_GET['id'] : '');
35 $obj = $formid ? formFetch("form_treatment_plan", $formid) : array();
38 // Get the providers list.
39 $ures = sqlStatement("SELECT id, username, fname, lname FROM users WHERE " .
40 "authorized != 0 AND active = 1 ORDER BY lname, fname");
42 <html><head>
43 <?php html_header_show();?>
44 <script type="text/javascript" src="../../../library/dialog.js"></script>
45 <!-- pop up calendar -->
46 <style type="text/css">@import url(<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar.css);</style>
47 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar.js"></script>
48 <?php include_once("{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php"); ?>
49 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar_setup.js"></script>
50 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/textformat.js"></script>
51 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js"></script>
52 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
53 </head>
54 <body class="body_top">
55 <p><span class="forms-title"><?php echo xlt('Treatment Planning'); ?></span></p>
56 </br>
57 <?php
58 echo "<form method='post' name='my_form' " .
59 "action='$rootdir/forms/treatment_plan/save.php?id=" . attr($formid) ."'>\n";
62 <table border="0">
64 <tr>
65 <td align="left" class="forms" class="forms"><?php echo xlt('Client Name' ); ?>:</td>
66 <td class="forms">
67 <label class="forms-data"> <?php if (is_numeric($pid)) {
69 $result = getPatientData($pid, "fname,lname,squad");
70 echo text($result['fname'])." ".text($result['lname']);}
71 $patient_name=($result['fname'])." ".($result['lname']);
73 </label>
74 <input type="hidden" name="client_name" value="<?php echo attr($patient_name);?>">
75 </td>
76 <td align="left" class="forms"><?php echo xlt('DOB'); ?>:</td>
77 <td class="forms">
78 <label class="forms-data"> <?php if (is_numeric($pid)) {
80 $result = getPatientData($pid, "*");
81 echo text($result['DOB']);}
82 $dob=($result['DOB']);
84 </label>
85 <input type="hidden" name="DOB" value="<?php echo attr($dob);?>">
86 </td>
87 </tr>
88 <tr>
92 <td align="left" class="forms"><?php echo xlt('Client Number'); ?>:</td>
93 <td class="forms">
94 <label class="forms-data" > <?php if (is_numeric($pid)) {
96 $result = getPatientData($pid, "*");
97 echo text($result['pid']);}
98 $patient_id=$result['pid'];
100 </label>
101 <input type="hidden" name="client_number" value="<?php echo attr($patient_id);?>">
102 </td>
105 <td align="left" class="forms"><?php echo xlt('Admit Date'); ?>:</td>
106 <td class="forms">
107 <input type='text' size='10' name='admit_date' id='admission_date' <?php echo attr($disabled) ?>;
108 value='<?php echo attr($obj{"admit_date"}); ?>'
109 title='<?php echo xla('yyyy-mm-dd Date of service'); ?>'
110 onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' />
111 <img src='../../pic/show_calendar.gif' align='absbottom' width='24' height='22'
112 id='img_admission_date' border='0' alt='[?]' style='cursor:pointer;cursor:hand'
113 title='<?php echo xla('Click here to choose a date'); ?>'>
114 </td>
116 </tr>
117 <tr>
118 <td align="left" class="forms"><?php echo xlt('Provider'); ?>:</td>
119 <td class="forms" width="280px">
120 <?php
122 echo "<select name='provider' style='width:60%' />";
123 while ($urow = sqlFetchArray($ures)) {
124 echo " <option value='" . attr($urow['lname']) . "'";
125 if ($urow['lname'] == attr($obj{"provider"})) echo " selected";
126 echo ">" . text($urow['lname']);
127 if ($urow['fname']) echo ", " . text($urow['fname']);
128 echo "</option>\n";
130 echo "</select>";
132 </td>
134 </tr>
136 <tr>
138 <td colspan='3' nowrap style='font-size:8pt'>
139 &nbsp;
140 </td>
141 </tr>
143 <tr>
144 <td align="left" class="forms"><?php echo xlt('Presenting Issue(s)'); ?>:</td>
145 <td colspan="3"><textarea name="presenting_issues" rows="2" cols="60" wrap="virtual name"><?php echo text($obj{"presenting_issues"});?></textarea></td>
147 </tr>
148 <tr>
149 <td align="left" class="forms"><?php echo xlt('Patient History'); ?>:</td>
150 <td colspan="3"><textarea name="patient_history" rows="2" cols="60" wrap="virtual name"><?php echo text($obj{"patient_history"});?></textarea></td>
152 </tr>
153 <tr>
155 <td align="left" class="forms"><?php echo xlt('Medications'); ?>:</td>
156 <td colspan="3"><textarea name="medications" rows="2" cols="60" wrap="virtual name"><?php echo text($obj{"medications"});?></textarea></td>
159 </tr>
160 <tr>
161 <td align="left" class="forms"><?php echo xlt('Anyother Relevant Information'); ?>:</td>
162 <td colspan="3"><textarea name="anyother_relevant_information" rows="2" cols="60" wrap="virtual name"><?php echo text($obj{"anyother_relevant_information"});?></textarea></td>
164 </tr>
165 <tr>
166 <td align="left" class="forms"><?php echo xlt('Diagnosis'); ?>:</td>
167 <td colspan="3"><textarea name="diagnosis" rows="2" cols="60" wrap="virtual name"><?php echo text($obj{"diagnosis"});?></textarea></td>
169 </tr>
170 <tr>
171 <td align="left" class="forms"><?php echo xlt('Treatment Received'); ?>:</td>
172 <td colspan="3"><textarea name="treatment_received" rows="2" cols="60" wrap="virtual name"><?php echo text($obj{"treatment_received"});?></textarea></td>
174 </tr>
175 <tr>
176 <td align="left" class="forms"><?php echo xlt('Recommendation For Follow Up'); ?>:</td>
177 <td colspan="3"><textarea name="recommendation_for_follow_up" rows="2" cols="60" wrap="virtual name"><?php echo text($obj{"recommendation_for_follow_up"});?></textarea></td>
179 </tr>
180 <tr>
181 <td align="left colspan="3" style="padding-bottom:7px;"></td>
182 </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 xlt('Save');?>' class="button-css">&nbsp;
189 <input type='button' value="Print" onclick="window.print()" class="button-css">&nbsp;
190 <input type='button' class="button-css" value='<?php echo xlt('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"});
199 </script>
200 <?php
201 formFooter();