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>.
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");
29 // Collect user id if editing entry
30 $ppid = $_REQUEST['ppid'];
34 function invalue($name) {
35 $fld = add_escape_custom(trim($_POST[$name]));
42 <script type
="text/javascript" src
="<?php echo $webroot ?>/interface/main/tabs/js/include_opener.js"></script
>
43 <title
><?php
echo $ppid ?
xlt('Edit') : xlt('Add New') ?
> <?php
echo xlt('Procedure Provider'); ?
></title
>
44 <link rel
="stylesheet" href
='<?php echo $css_header ?>' type
='text/css'>
45 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-1-3-2/index.js"></script
>
48 td
{ font
-size
:10pt
; }
56 font
-family
:sans
-serif
;
62 <script language
="JavaScript">
67 <body
class="body_top">
69 // If we are saving, then save and close the window.
71 if ($_POST['form_save']) {
72 $org_qry = "SELECT organization FROM users WHERE id = ?";
73 $org_res = sqlQuery($org_qry, array($_POST['form_name']));
74 $org_name = $org_res['organization'];
76 "name = '" .add_escape_custom($org_name). "', " .
77 "lab_director = " . invalue('form_name') . ", " .
78 "npi = " . invalue('form_npi') . ", " .
79 "send_app_id = " . invalue('form_send_app_id') . ", " .
80 "send_fac_id = " . invalue('form_send_fac_id') . ", " .
81 "recv_app_id = " . invalue('form_recv_app_id') . ", " .
82 "recv_fac_id = " . invalue('form_recv_fac_id') . ", " .
83 "DorP = " . invalue('form_DorP') . ", " .
84 "direction = " . invalue('form_direction') . ", " .
85 "protocol = " . invalue('form_protocol') . ", " .
86 "remote_host = " . invalue('form_remote_host') . ", " .
87 "login = " . invalue('form_login') . ", " .
88 "password = " . invalue('form_password') . ", " .
89 "orders_path = " . invalue('form_orders_path') . ", " .
90 "results_path = " . invalue('form_results_path') . ", " .
91 "notes = " . invalue('form_notes');
93 $query = "UPDATE procedure_providers SET $sets " .
94 "WHERE ppid = '" . add_escape_custom($ppid) . "'";
98 $ppid = sqlInsert("INSERT INTO procedure_providers SET $sets");
101 else if ($_POST['form_delete']) {
103 sqlStatement("DELETE FROM procedure_providers WHERE ppid = ?", array($ppid));
107 if ($_POST['form_save'] ||
$_POST['form_delete']) {
108 // Close this window and redisplay the updated list.
109 echo "<script language='JavaScript'>\n";
110 if ($info_msg) echo " alert('" . addslashes($info_msg) . "');\n";
111 echo " window.close();\n";
112 echo " if (opener.refreshme) opener.refreshme();\n";
113 echo "</script></body></html>\n";
118 $row = sqlQuery("SELECT * FROM procedure_providers WHERE ppid = ?", array($ppid));
121 $lab_org_query = "SELECT id, organization FROM users WHERE abook_type = 'ord_lab'";
122 $org_res = sqlStatement($lab_org_query);
123 while ($org_row = sqlFetchArray($org_res)) {
124 $lab_org_name = $org_row['organization'];
127 if($row['lab_director'] == $org_row['id']){
128 $selected = "SELECTED";
131 $optionsStr .= "<option value='".attr($org_row['id'])."' $selected>". text($lab_org_name)."</option>";
135 <form method
='post' name
='theform' action
='procedure_provider_edit.php?ppid=<?php echo attr($ppid) ?>'>
138 <table border
='0' width
='100%'>
141 <td nowrap
><b
><?php
echo xlt('Name'); ?
>:</b
></td
>
143 <select name
='form_name' id
='form_name' class='inputtext' style
='width:150px'>
144 <?php
echo $optionsStr; ?
>
150 <td nowrap
><b
><?php
echo xlt('NPI'); ?
>:</b
></td
>
152 <input type
='text' size
='10' name
='form_npi' maxlength
='10'
153 value
='<?php echo attr($row['npi
']); ?>' class='inputtext' />
158 <td nowrap
><b
><?php
echo xlt('Sender IDs'); ?
>:</b
></td
>
160 <?php
echo xlt('Application'); ?
>:
161 <input type
='text' size
='10' name
='form_send_app_id' maxlength
='100'
162 value
='<?php echo attr($row['send_app_id
']); ?>'
163 title
='<?php echo xla('MSH
-3.1'); ?>'
165  
;<?php
echo xlt('Facility'); ?
>:
166 <input type
='text' size
='10' name
='form_send_fac_id' maxlength
='100'
167 value
='<?php echo attr($row['send_fac_id
']); ?>'
168 title
='<?php echo xla('MSH
-4.1'); ?>'
174 <td nowrap
><b
><?php
echo xlt('Receiver IDs'); ?
>:</b
></td
>
176 <?php
echo xlt('Application'); ?
>:
177 <input type
='text' size
='10' name
='form_recv_app_id' maxlength
='100'
178 value
='<?php echo attr($row['recv_app_id
']); ?>'
179 title
='<?php echo xla('MSH
-5.1'); ?>'
181  
;<?php
echo xlt('Facility'); ?
>:
182 <input type
='text' size
='10' name
='form_recv_fac_id' maxlength
='100'
183 value
='<?php echo attr($row['recv_fac_id
']); ?>'
184 title
='<?php echo xla('MSH
-6.1'); ?>'
190 <td nowrap
><b
><?php
echo xlt('Usage'); ?
>:</b
></td
>
192 <select name
='form_DorP' title
='<?php echo xla('MSH
-11'); ?>'>
195 'D' => xl('Debugging'),
196 'P' => xl('Production'),
199 echo " <option value='" . attr($key) . "'";
200 if ($key == $row['DorP']) echo " selected";
201 echo ">" . text($value) . "</option>\n";
209 <td nowrap
><b
><?php
echo xlt('Protocol'); ?
>:</b
></td
>
211 <select name
='form_protocol'>
214 // Add to this list as more protocols are supported.
215 'DL' => xl('Download'),
216 'SFTP' => xl('SFTP'),
217 'FS' => xl('Local Filesystem'),
220 echo " <option value='" . attr($key) . "'";
221 if ($key == $row['protocol']) echo " selected";
222 echo ">" . text($value) . "</option>\n";
227 <select name
='form_direction'>
230 'B' => xl('Bidirectional'),
231 'R' => xl('Results Only'),
234 echo " <option value='" . attr($key) . "'";
235 if ($key == $row['direction']) echo " selected";
236 echo ">" . text($value) . "</option>\n";
244 <td nowrap
><b
><?php
echo xlt('Remote Host'); ?
>:</b
></td
>
246 <input type
='text' size
='40' name
='form_remote_host' maxlength
='255'
247 value
='<?php echo attr($row['remote_host
']); ?>' class='inputtext' />
252 <td nowrap
><b
><?php
echo xlt('Login'); ?
>:</b
></td
>
254 <input type
='text' size
='20' name
='form_login' maxlength
='255'
255 value
='<?php echo attr($row['login
']); ?>' class='inputtext' />
260 <td nowrap
><b
><?php
echo xlt('Password'); ?
>:</b
></td
>
262 <input type
='text' size
='20' name
='form_password' maxlength
='255'
263 value
='<?php echo attr($row['password
']); ?>' class='inputtext' />
268 <td nowrap
><b
><?php
echo xlt('Orders Path'); ?
>:</b
></td
>
270 <input type
='text' size
='40' name
='form_orders_path' maxlength
='255'
271 value
='<?php echo attr($row['orders_path
']); ?>' class='inputtext' />
276 <td nowrap
><b
><?php
echo xlt('Results Path'); ?
>:</b
></td
>
278 <input type
='text' size
='40' name
='form_results_path' maxlength
='255'
279 value
='<?php echo attr($row['results_path
']); ?>' class='inputtext' />
284 <td nowrap
><b
><?php
echo xlt('Notes'); ?
>:</b
></td
>
286 <textarea rows
='3' cols
='40' name
='form_notes' style
='width:100%'
287 wrap
='virtual' class='inputtext' /><?php
echo text($row['notes']) ?
></textarea
>
295 <input type
='submit' name
='form_save' value
='<?php echo xla('Save
'); ?>' />
297 <?php
if ($ppid) { ?
>
299 <input type
='submit' name
='form_delete' value
='<?php echo xla('Delete
'); ?>' style
='color:red' />
303 <input type
='button' value
='<?php echo xla('Cancel
'); ?>' onclick
='window.close()' />