Changes to support a results-only lab interface.
[openemr.git] / interface / orders / procedure_provider_edit.php
blob1c92ac193fd0e27a4f6fd2d6210801c0308517c0
1 <?php
2 /**
3 * Maintenance for the list of procedure providers.
5 * Copyright (C) 2012-2014 Rod Roark <rod@sunsetsystems.com>
7 * LICENSE: This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>.
18 * @package OpenEMR
19 * @author Rod Roark <rod@sunsetsystems.com>
22 $sanitize_all_escapes = true;
23 $fake_register_globals =false;
25 require_once("../globals.php");
26 require_once("$srcdir/acl.inc");
27 require_once("$srcdir/options.inc.php");
28 require_once("$srcdir/formdata.inc.php");
29 require_once("$srcdir/htmlspecialchars.inc.php");
31 // Collect user id if editing entry
32 $ppid = $_REQUEST['ppid'];
34 $info_msg = "";
36 function invalue($name) {
37 $fld = add_escape_custom(trim($_POST[$name]));
38 return "'$fld'";
42 <html>
43 <head>
44 <title><?php echo $ppid ? xlt('Edit') : xlt('Add New') ?> <?php echo xlt('Procedure Provider'); ?></title>
45 <link rel="stylesheet" href='<?php echo $css_header ?>' type='text/css'>
46 <script type="text/javascript" src="../../library/js/jquery.1.3.2.js"></script>
48 <style>
49 td { font-size:10pt; }
51 .inputtext {
52 padding-left:2px;
53 padding-right:2px;
56 .button {
57 font-family:sans-serif;
58 font-size:9pt;
59 font-weight:bold;
61 </style>
63 <script language="JavaScript">
64 </script>
66 </head>
68 <body class="body_top">
69 <?php
70 // If we are saving, then save and close the window.
72 if ($_POST['form_save']) {
73 $sets =
74 "name = " . invalue('form_name') . ", " .
75 "npi = " . invalue('form_npi') . ", " .
76 "send_app_id = " . invalue('form_send_app_id') . ", " .
77 "send_fac_id = " . invalue('form_send_fac_id') . ", " .
78 "recv_app_id = " . invalue('form_recv_app_id') . ", " .
79 "recv_fac_id = " . invalue('form_recv_fac_id') . ", " .
80 "DorP = " . invalue('form_DorP') . ", " .
81 "direction = " . invalue('form_direction') . ", " .
82 "protocol = " . invalue('form_protocol') . ", " .
83 "remote_host = " . invalue('form_remote_host') . ", " .
84 "login = " . invalue('form_login') . ", " .
85 "password = " . invalue('form_password') . ", " .
86 "orders_path = " . invalue('form_orders_path') . ", " .
87 "results_path = " . invalue('form_results_path') . ", " .
88 "notes = " . invalue('form_notes');
89 if ($ppid) {
90 $query = "UPDATE procedure_providers SET $sets " .
91 "WHERE ppid = '" . add_escape_custom($ppid) . "'";
92 sqlStatement($query);
94 else {
95 $ppid = sqlInsert("INSERT INTO procedure_providers SET $sets");
98 else if ($_POST['form_delete']) {
99 if ($ppid) {
100 sqlStatement("DELETE FROM procedure_providers WHERE ppid = ?", array($ppid));
104 if ($_POST['form_save'] || $_POST['form_delete']) {
105 // Close this window and redisplay the updated list.
106 echo "<script language='JavaScript'>\n";
107 if ($info_msg) echo " alert('" . addslashes($info_msg) . "');\n";
108 echo " window.close();\n";
109 echo " if (opener.refreshme) opener.refreshme();\n";
110 echo "</script></body></html>\n";
111 exit();
114 if ($ppid) {
115 $row = sqlQuery("SELECT * FROM procedure_providers WHERE ppid = ?", array($ppid));
119 <form method='post' name='theform' action='procedure_provider_edit.php?ppid=<?php echo attr($ppid) ?>'>
120 <center>
122 <table border='0' width='100%'>
124 <tr>
125 <td nowrap><b><?php echo xlt('Name'); ?>:</b></td>
126 <td>
127 <input type='text' size='40' name='form_name' maxlength='255'
128 value='<?php echo attr($row['name']); ?>'
129 style='width:100%' class='inputtext' />
130 </td>
131 </tr>
133 <tr>
134 <td nowrap><b><?php echo xlt('NPI'); ?>:</b></td>
135 <td>
136 <input type='text' size='10' name='form_npi' maxlength='10'
137 value='<?php echo attr($row['npi']); ?>' class='inputtext' />
138 </td>
139 </tr>
141 <tr>
142 <td nowrap><b><?php echo xlt('Sender IDs'); ?>:</b></td>
143 <td>
144 <?php echo xlt('Application'); ?>:
145 <input type='text' size='10' name='form_send_app_id' maxlength='100'
146 value='<?php echo attr($row['send_app_id']); ?>'
147 title='<?php echo xla('MSH-3.1'); ?>'
148 class='inputtext' />
149 &nbsp;<?php echo xlt('Facility'); ?>:
150 <input type='text' size='10' name='form_send_fac_id' maxlength='100'
151 value='<?php echo attr($row['send_fac_id']); ?>'
152 title='<?php echo xla('MSH-4.1'); ?>'
153 class='inputtext' />
154 </td>
155 </tr>
157 <tr>
158 <td nowrap><b><?php echo xlt('Receiver IDs'); ?>:</b></td>
159 <td>
160 <?php echo xlt('Application'); ?>:
161 <input type='text' size='10' name='form_recv_app_id' maxlength='100'
162 value='<?php echo attr($row['recv_app_id']); ?>'
163 title='<?php echo xla('MSH-5.1'); ?>'
164 class='inputtext' />
165 &nbsp;<?php echo xlt('Facility'); ?>:
166 <input type='text' size='10' name='form_recv_fac_id' maxlength='100'
167 value='<?php echo attr($row['recv_fac_id']); ?>'
168 title='<?php echo xla('MSH-6.1'); ?>'
169 class='inputtext' />
170 </td>
171 </tr>
173 <tr>
174 <td nowrap><b><?php echo xlt('Usage'); ?>:</b></td>
175 <td>
176 <select name='form_DorP' title='<?php echo xla('MSH-11'); ?>'>
177 <?php
178 foreach(array(
179 'D' => xl('Debugging'),
180 'P' => xl('Production'),
181 ) as $key => $value)
183 echo " <option value='" . attr($key) . "'";
184 if ($key == $row['DorP']) echo " selected";
185 echo ">" . text($value) . "</option>\n";
188 </select>
189 </td>
190 </tr>
192 <tr>
193 <td nowrap><b><?php echo xlt('Protocol'); ?>:</b></td>
194 <td>
195 <select name='form_protocol'>
196 <?php
197 foreach(array(
198 // Add to this list as more protocols are supported.
199 'DL' => xl('Download'),
200 'SFTP' => xl('SFTP'),
201 'FS' => xl('Local Filesystem'),
202 ) as $key => $value)
204 echo " <option value='" . attr($key) . "'";
205 if ($key == $row['protocol']) echo " selected";
206 echo ">" . text($value) . "</option>\n";
209 </select>
210 &nbsp;
211 <select name='form_direction'>
212 <?php
213 foreach(array(
214 'B' => xl('Bidirectional'),
215 'R' => xl('Results Only'),
216 ) as $key => $value)
218 echo " <option value='" . attr($key) . "'";
219 if ($key == $row['direction']) echo " selected";
220 echo ">" . text($value) . "</option>\n";
223 </select>
224 </td>
225 </tr>
227 <tr>
228 <td nowrap><b><?php echo xlt('Remote Host'); ?>:</b></td>
229 <td>
230 <input type='text' size='40' name='form_remote_host' maxlength='255'
231 value='<?php echo attr($row['remote_host']); ?>' class='inputtext' />
232 </td>
233 </tr>
235 <tr>
236 <td nowrap><b><?php echo xlt('Login'); ?>:</b></td>
237 <td>
238 <input type='text' size='20' name='form_login' maxlength='255'
239 value='<?php echo attr($row['login']); ?>' class='inputtext' />
240 </td>
241 </tr>
243 <tr>
244 <td nowrap><b><?php echo xlt('Password'); ?>:</b></td>
245 <td>
246 <input type='text' size='20' name='form_password' maxlength='255'
247 value='<?php echo attr($row['password']); ?>' class='inputtext' />
248 </td>
249 </tr>
251 <tr>
252 <td nowrap><b><?php echo xlt('Orders Path'); ?>:</b></td>
253 <td>
254 <input type='text' size='40' name='form_orders_path' maxlength='255'
255 value='<?php echo attr($row['orders_path']); ?>' class='inputtext' />
256 </td>
257 </tr>
259 <tr>
260 <td nowrap><b><?php echo xlt('Results Path'); ?>:</b></td>
261 <td>
262 <input type='text' size='40' name='form_results_path' maxlength='255'
263 value='<?php echo attr($row['results_path']); ?>' class='inputtext' />
264 </td>
265 </tr>
267 <tr>
268 <td nowrap><b><?php echo xlt('Notes'); ?>:</b></td>
269 <td>
270 <textarea rows='3' cols='40' name='form_notes' style='width:100%'
271 wrap='virtual' class='inputtext' /><?php echo text($row['notes']) ?></textarea>
272 </td>
273 </tr>
275 </table>
277 <br />
279 <input type='submit' name='form_save' value='<?php echo xla('Save'); ?>' />
281 <?php if ($ppid) { ?>
282 &nbsp;
283 <input type='submit' name='form_delete' value='<?php echo xla('Delete'); ?>' style='color:red' />
284 <?php } ?>
286 &nbsp;
287 <input type='button' value='<?php echo xla('Cancel'); ?>' onclick='window.close()' />
288 </p>
290 </center>
291 </form>
292 </body>
293 </html>