4 * Maintenance for the list of procedure providers.
7 * @link http://www.open-emr.org
8 * @author Rod Roark <rod@sunsetsystems.com>
9 * @author Brady Miller <brady.g.miller@gmail.com>
10 * @copyright Copyright (c) 2012 Rod Roark <rod@sunsetsystems.com>
11 * @copyright Copyright (c) 2019 Brady Miller <brady.g.miller@gmail.com>
12 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 require_once("../globals.php");
16 require_once("$srcdir/options.inc.php");
18 use OpenEMR\Common\Acl\AclMain
;
19 use OpenEMR\Common\Csrf\CsrfUtils
;
20 use OpenEMR\Common\Twig\TwigContainer
;
21 use OpenEMR\Core\Header
;
23 if (!AclMain
::aclCheckCore('admin', 'users')) {
24 echo (new TwigContainer(null, $GLOBALS['kernel']))->getTwig()->render('core/unauthorized.html.twig', ['pageTitle' => xl("Procedure Providers")]);
28 $form_name = trim($_POST['form_name'] ??
'');
30 $form_inactive = empty($_POST['form_inactive']) ?
false : true;
32 $query = "SELECT pp.* FROM procedure_providers AS pp";
34 if (!$form_inactive) {
35 $query .= " WHERE active = '1'";
38 $query .= " ORDER BY pp.name";
39 $res = sqlStatement($query);
45 <?php Header
::setupHeader(); ?
>
47 <title
><?php
echo xlt('Procedure Providers'); ?
></title
>
50 // Callback from popups to refresh this display.
51 function refreshme() {
52 document
.forms
[0].submit();
55 // Process click to pop up the add window.
56 function doedclick_add() {
58 var addTitle
= '<i class="fa fa-plus" style="width:20px;" aria-hidden="true"></i> ' +
<?php
echo xlj("Add Mode"); ?
>;
59 let scriptTitle
= 'procedure_provider_edit.php?ppid=0&csrf_token_form=' +
<?php
echo js_url(CsrfUtils
::collectCsrfToken()); ?
>;
60 dlgopen(scriptTitle
, '_blank', 800, 750, false, addTitle
);
63 // Process click to pop up the edit window.
64 function doedclick_edit(ppid
) {
66 var editTitle
= '<i class="fa fa-pencil-alt" style="width:20px;" aria-hidden="true"></i> ' +
<?php
echo xlj("Edit Mode"); ?
> +
' ';
67 let scriptTitle
= 'procedure_provider_edit.php?ppid=' + ppid +
'&csrf_token_form=' +
<?php
echo js_url(CsrfUtils
::collectCsrfToken()); ?
>;
68 dlgopen(scriptTitle
, '_blank', 800, 750, false, editTitle
);
74 if ($GLOBALS['enable_help'] == 1) {
75 $help_icon = '<a class="oe-pull-away oe-help-redirect" data-target="#myModal" data-toggle="modal" href="#" id="help-href" name="help-href" style="color: var(--gray700)" title="' . xla("Click to view Help") . '"><i class="fa fa-question-circle" aria-hidden="true"></i></a>';
76 } elseif ($GLOBALS['enable_help'] == 2) {
77 $help_icon = '<a class="oe-pull-away oe-help-redirect" data-target="#myModal" data-toggle="modal" href="#" id="help-href" name="help-href" style="color: var(--gray300) !important" title="' . xla("To enable help - Go to Administration > Globals > Features > Enable Help Modal") . '"><i class="fa fa-question-circle" aria-hidden="true"></i></a>';
78 } elseif ($GLOBALS['enable_help'] == 0) {
82 <div
class="container mt-3">
84 <div
class="col-sm-12">
85 <div
class="page-title">
86 <h2
><?php
echo xlt('Procedure Providers');?
><?php
echo $help_icon; ?
></h2
>
92 <div
class="btn-group">
93 <button type
="button" class="btn btn-primary btn-add" onclick
="doedclick_add()"><?php
echo xlt('Add New{{Provider}}');?
></button
>
98 <div
class="col-sm-12">
99 <form method
='post' action
='procedure_provider_list.php'>
100 <div
class="form-check-inline mt-3">
101 <input type
='checkbox' class="form-check-input mr-2 " id
="form_inactive" name
='form_inactive'
102 value
='1' onclick
='submit()' <?php
echo ($form_inactive) ?
'checked ' : ''; ?
>>
103 <label
class="form-check-label bold" for="form_inactive" ><?php
echo xlt('Include Inactive Providers'); ?
></label
>
105 <div
class="table-responsive mt-2">
106 <table
class="table table-striped table-hover">
109 <th title
='<?php echo xla('Click to view
or edit
'); ?>'><?php
echo xlt('Name'); ?
></th
>
110 <th
><?php
echo xlt('NPI'); ?
></th
>
111 <th
><?php
echo xlt('Protocol'); ?
></th
>
112 <th
class="text-center"><?php
echo xlt('Edit'); ?
></th
>
117 while ($row = sqlFetchArray($res)) {
118 echo " <tr class='detail'>";
119 echo " <td>" . text($row['name']) . "</td>\n";
120 echo " <td>" . text($row['npi']) . "</td>\n";
121 echo " <td>" . text($row['protocol']) . "</td>\n";
122 if (AclMain
::aclCheckCore('admin', 'practice')) {
123 $trTitle = xl('Edit') . ' ' . $row['name'];
124 echo " <td class='text-center text-body'><span style='cursor: pointer;' onclick='doedclick_edit(" . attr_js($row['ppid']) . ")' class='haskids fa fa-pencil-alt' title='" . attr($trTitle) . "'></span></td>\n";
126 $trTitle = xl("Not Allowed to Edit") . ' ' . $row['name'];
127 echo " <td class='text-center'><span style='color: var(--gray400); cursor: no-drop;' class='haskids fa fa-pencil-alt' title='" . attr($trTitle) . "'></span></td>\n";
138 </div
><!-- End of container div
-->
140 //home of the help modal ;)
141 //$GLOBALS['enable_help'] = 0; // Please comment out line if you want help modal to function on this page
142 if ($GLOBALS['enable_help'] == 1) {
143 echo "<script>var helpFile = 'procedure_provider_help.php'</script>";
144 //help_modal.php lives in interface, set path accordingly
145 require "../help_modal.php";