4 * This displays the search criteria. The master processing is done here. This page
5 * is included in the billing_report.php
8 * @link http://www.open-emr.org
9 * @author Eldho Chacko <eldho@zhservices.com>
10 * @author Paul Simon K <paul@zhservices.com>
11 * @author Brady Miller <brady.g.miller@gmail.com>
12 * @copyright Copyright (c) 2011 Z&H Consultancy Services Private Limited <sam@zhservices.com>
13 * @copyright Copyright (c) 2019 Brady Miller <brady.g.miller@gmail.com>
14 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
17 use OpenEMR\Billing\BillingReport
;
23 // TPS = This Page Search
25 $TPSCriteriaKey = array();
26 $TPSCriteriaDataType = array();
27 $TPSCriteriaDisplay = array();
28 $TPSCriteriaRadioKey = array();
29 $TPSCriteriaDisplayRadio = array();
30 $TPSCriteriaQueryDropDown = array();
31 $TPSCriteriaQueryDropDownDefault = array();
32 $TPSCriteriaQueryDropDownDefaultKey = array();
33 $TPSCriteriaInclude = array();
34 // Filling the input array.
35 $TPSCriteriaDisplay = $TPSCriteriaDisplayMaster;
36 $TPSCriteriaKey = explode(',', $TPSCriteriaKeyMaster);
37 $TPSCriteriaDataType = explode(',', $TPSCriteriaDataTypeMaster);
38 // --------------------------------------------------------------
39 // Filling the input array.
40 // --------------------------------------------------------------
41 $NumberOfRadioTPSCriteria = 0;
42 $NumberOfQueryDropDownTPSCriteria = 0;
43 $NumberOfIncludeTPSCriteria = 0;
44 for ($TPSCriteriaIndex = 0; $TPSCriteriaIndex < sizeof($TPSCriteriaDataType); $TPSCriteriaIndex++
) {
45 if ($TPSCriteriaDataType[$TPSCriteriaIndex] == 'radio' ||
$TPSCriteriaDataType[$TPSCriteriaIndex] == 'radio_like') {
46 $NumberOfRadioTPSCriteria++
;
47 $TPSCriteriaDisplayRadio[$TPSCriteriaIndex] = $TPSCriteriaDisplayRadioMaster[$NumberOfRadioTPSCriteria];
48 $TPSCriteriaRadioKey[$TPSCriteriaIndex] = explode(',', $TPSCriteriaRadioKeyMaster[$NumberOfRadioTPSCriteria]);
50 if ($TPSCriteriaDataType[$TPSCriteriaIndex] == 'query_drop_down') {
51 $NumberOfQueryDropDownTPSCriteria++
;
52 $TPSCriteriaQueryDropDown[$TPSCriteriaIndex] = $NumberOfQueryDropDownTPSCriteria;
53 $TPSCriteriaQueryDropDownDefault[$TPSCriteriaIndex] = $TPSCriteriaQueryDropDownMasterDefault[$NumberOfQueryDropDownTPSCriteria];
54 $TPSCriteriaQueryDropDownDefaultKey[$TPSCriteriaIndex] = $TPSCriteriaQueryDropDownMasterDefaultKey[$NumberOfQueryDropDownTPSCriteria];
56 if ($TPSCriteriaDataType[$TPSCriteriaIndex] == 'include') {
57 $NumberOfIncludeTPSCriteria++
;
58 $TPSCriteriaInclude[$TPSCriteriaIndex] = $NumberOfIncludeTPSCriteria;
61 //------------------------------------------------------------------------------
65 <div
class="card bg-light">
66 <div
class="card-header pb-0"><h4
><?php
echo xlt('Choose Criteria'); ?
></h4
></div
>
67 <div
class="card-body">
68 <div
class="form-group px-2">
69 <label
for="choose_this_page_criteria"><?php
echo xlt('Select list'); ?
>:</label
>
70 <select name
="choose_this_page_criteria" id
="choose_this_page_criteria" title
="Choose Criteria" class="form-control" onChange
="CriteriaVisible()" size
='8'>
72 for ($TPSCriteriaIndex = 0; $TPSCriteriaIndex < sizeof($TPSCriteriaKey); $TPSCriteriaIndex++
) {
73 $optionValue = $TPSCriteriaKey[$TPSCriteriaIndex];
74 echo "<option value='" . attr($optionValue) . "'";
75 $optionLabel = $TPSCriteriaDisplay[$TPSCriteriaIndex];
76 echo ">" . text($optionLabel) . "</option>\n";
82 <div
class="card-footer">
83 <!-- Below section comes
as per the defined criteria arrays
. Initially all are hidden
. As per the click the corresponding items gets visible
. -->
85 for ($TPSCriteriaIndex = 0; $TPSCriteriaIndex < sizeof($TPSCriteriaKey); $TPSCriteriaIndex++
) {
86 if ($TPSCriteriaDataType[$TPSCriteriaIndex] == 'date' ||
$TPSCriteriaDataType[$TPSCriteriaIndex] == 'datetime') {
87 $DateNamePart = str_replace('.', '_', $TPSCriteriaKey[$TPSCriteriaIndex]);
89 <div
class="form-group px-2" id
="table_<?php echo attr($TPSCriteriaKey[$TPSCriteriaIndex]) ?>" style
="display: none">
90 <label
for="choose_this_page_criteria"><?php
echo text($TPSCriteriaDisplay[$TPSCriteriaIndex]); ?
></label
>
91 <?php
echo generate_select_list(
92 "date_master_criteria_$DateNamePart",
93 "date_master_criteria",
94 ($_REQUEST["date_master_criteria_$DateNamePart"] ??
''),
98 'calendar_function(this.value,' . attr_js('master_from_date_' . $DateNamePart) . ',' . attr_js('master_to_date_' . $DateNamePart) . ');
99 appendOptionDateCriteria(' . attr_js($TPSCriteriaDisplay[$TPSCriteriaIndex]) . ',' .
100 attr_js($TPSCriteriaKey[$TPSCriteriaIndex]) . ',this.options[this.selectedIndex].text,' .
101 'this.options[this.selectedIndex].value,' . attr_js('=') . ',' . attr_js('master_from_date_' . $DateNamePart) . ',' . attr_js('master_to_date_' . $DateNamePart) . ',
102 ' . attr_js($TPSCriteriaDataType[$TPSCriteriaIndex]) . ')'
105 <label
class="control-label" for="master_from_date_<?php echo attr($DateNamePart); ?>'"><?php
echo xlt('From'); ?
>:</label
>
106 <input type
='text' name
='master_from_date_<?php echo attr($DateNamePart); ?>' id
='master_from_date_<?php echo attr($DateNamePart); ?>' class="text form-control datepicker" value
="<?php echo attr($_REQUEST["master_from_date_
$DateNamePart"] ?? '') ?>"
107 onChange
="SetDateCriteriaCustom(<?php echo attr_js('date_master_criteria_' . $DateNamePart); ?>); appendOptionDateCriteria(<?php echo attr_js($TPSCriteriaDisplay[$TPSCriteriaIndex]);?>, <?php echo attr_js($TPSCriteriaKey[$TPSCriteriaIndex]);?>, <?php echo attr(xlj('Custom')); ?>, <?php echo attr(xlj('Custom')); ?>, ' = ', <?php echo attr_js('master_from_date_' . $DateNamePart); ?>, <?php echo attr_js('master_to_date_' . $DateNamePart); ?>, <?php echo attr_js($TPSCriteriaDataType[$TPSCriteriaIndex]); ?>)" />
109 <label
class="control-label" for="check_date"><?php
echo xlt('To{{Range}}'); ?
>:</label
>
110 <input type
='text' name
='master_to_date_<?php echo attr($DateNamePart); ?>' id
='master_to_date_<?php echo attr($DateNamePart); ?>' class="text form-control datepicker" value
="<?php echo attr($_REQUEST["master_to_date_
$DateNamePart"] ?? '') ?>"
111 onChange
="SetDateCriteriaCustom(<?php echo attr_js('date_master_criteria_' . $DateNamePart); ?>); appendOptionDateCriteria(<?php echo attr_js($TPSCriteriaDisplay[$TPSCriteriaIndex]);?>, <?php echo attr_js($TPSCriteriaKey[$TPSCriteriaIndex]); ?>, <?php echo attr(xlj('Custom')); ?>, <?php echo attr(xlj('Custom')); ?>, ' = ', <?php echo attr_js('master_from_date_' . $DateNamePart); ?>, <?php echo attr_js('master_to_date_' . $DateNamePart); ?>, <?php echo attr_js($TPSCriteriaDataType[$TPSCriteriaIndex]); ?>)" />
117 if ($TPSCriteriaDataType[$TPSCriteriaIndex] == 'query_drop_down') {
118 $array_query_drop_down = BillingReport
::buildArrayForReport($TPSCriteriaQueryDropDownMaster[$TPSCriteriaQueryDropDown[$TPSCriteriaIndex]]);
119 $QueryDropDownNamePart = str_replace('.', '_', $TPSCriteriaKey[$TPSCriteriaIndex]);
121 <div
class="form-group px-2" id
="table_<?php echo attr($TPSCriteriaKey[$TPSCriteriaIndex]) ?>" style
="display: none">
122 <label
class="control-label" for="query_drop_down_master_<?php echo attr($QueryDropDownNamePart); ?>"><?php
echo text($TPSCriteriaDisplay[$TPSCriteriaIndex]); ?
>:</label
>
123 <select
class="form-control" name
="query_drop_down_master_<?php echo attr($QueryDropDownNamePart); ?>" id
="query_drop_down_master_<?php echo attr($QueryDropDownNamePart); ?>"
124 onchange
="appendOptionRadioCriteria(<?php echo attr_js($TPSCriteriaDisplay[$TPSCriteriaIndex]); ?>, <?php echo attr_js($TPSCriteriaKey[$TPSCriteriaIndex]); ?>,this.options[this.selectedIndex].text, this.options[this.selectedIndex].value,' = ', <?php echo attr_js($TPSCriteriaDataType[$TPSCriteriaIndex]); ?>)">
125 <option value
="<?php echo attr($TPSCriteriaQueryDropDownDefaultKey[$TPSCriteriaIndex]) ?>" ><?php
echo text($TPSCriteriaQueryDropDownDefault[$TPSCriteriaIndex]) ?
></option
>
127 foreach ($array_query_drop_down as $array_query_drop_down_key => $array_query_drop_down_value) {
128 if ($_REQUEST["query_drop_down_master_" . $QueryDropDownNamePart] == $array_query_drop_down_key) {
129 $Selected = ' selected ';
134 <option value
="<?php echo attr($array_query_drop_down_key) ?>" <?php
echo $Selected ?
>><?php
echo text($array_query_drop_down_value) ?
></option
>
144 if ($TPSCriteriaDataType[$TPSCriteriaIndex] == 'include') {
145 $IncludeNamePart = str_replace('.', '_', $TPSCriteriaKey[$TPSCriteriaIndex]);
147 <div
class="form-group px-2" id
="table_<?php echo attr($TPSCriteriaKey[$TPSCriteriaIndex]) ?>" style
="display: none">
148 <label
class="control-label" for=""><?php
echo text($TPSCriteriaDisplay[$TPSCriteriaIndex]); ?
>:</label
>
149 <div
<?php
//Don't Use class = 'form-control'?>>
150 <?php
$FunctionName = $TPSCriteriaIncludeMaster[$TPSCriteriaInclude[$TPSCriteriaIndex]];
158 if ($TPSCriteriaDataType[$TPSCriteriaIndex] == 'text' ||
$TPSCriteriaDataType[$TPSCriteriaIndex] == 'text_like') {
159 $TextNamePart = str_replace('.', '_', $TPSCriteriaKey[$TPSCriteriaIndex]);
160 if ($TPSCriteriaDataType[$TPSCriteriaIndex] == 'text') {
161 $TextSeperator = ' = ';
163 if ($TPSCriteriaDataType[$TPSCriteriaIndex] == 'text_like') {
164 $TextSeperator = ' like ';
167 <div
class="form-group px-2" id
="table_<?php echo attr($TPSCriteriaKey[$TPSCriteriaIndex]) ?>" style
="display: none">
168 <label
class="control-label" for="text_master_<?php echo attr($TextNamePart);?>"><?php
echo text($TPSCriteriaDisplay[$TPSCriteriaIndex]); ?
>:</label
>
169 <input type
="text" name
="text_master_<?php echo attr($TextNamePart);?>" id
="text_master_<?php echo attr($TextNamePart);?>" value
="<?php echo attr($_REQUEST["text_master_
$TextNamePart"] ?? '') ?>" onkeyup
="appendOptionTextCriteria(<?php echo attr_js($TPSCriteriaDisplay[$TPSCriteriaIndex]); ?>, <?php echo attr_js($TPSCriteriaKey[$TPSCriteriaIndex]); ?>, this.value, this.value, <?php echo attr_js($TextSeperator); ?>, <?php echo attr_js($TPSCriteriaDataType[$TPSCriteriaIndex]); ?>)" onchange
="appendOptionTextCriteria(<?php echo attr_js($TPSCriteriaDisplay[$TPSCriteriaIndex]); ?>, <?php echo attr_js($TPSCriteriaKey[$TPSCriteriaIndex]); ?>,this.value,this.value,<?php echo attr_js($TextSeperator); ?>, <?php echo attr_js($TPSCriteriaDataType[$TPSCriteriaIndex]); ?>)" class="form-control" autocomplete
="off" />
175 if ($TPSCriteriaDataType[$TPSCriteriaIndex] == 'radio' ||
$TPSCriteriaDataType[$TPSCriteriaIndex] == 'radio_like') {
177 <div
class="form-group px-2" id
="table_<?php echo attr($TPSCriteriaKey[$TPSCriteriaIndex]) ?>" style
="display: none">
178 <label
class="control-label" for="radio_<?php echo attr($RadioNamePart ?? ''); ?>"><?php
echo text($TPSCriteriaDisplay[$TPSCriteriaIndex]); ?
>:</label
>
180 if ($TPSCriteriaDataType[$TPSCriteriaIndex] == 'radio') {
181 $RadioSeperator = ' = ';
183 if ($TPSCriteriaDataType[$TPSCriteriaIndex] == 'radio_like') {
184 $RadioSeperator = ' like ';
186 for ($TPSCriteriaRadioIndex = 0; $TPSCriteriaRadioIndex < sizeof($TPSCriteriaDisplayRadio[$TPSCriteriaIndex]); $TPSCriteriaRadioIndex++
) {
187 $RadioNamePart = str_replace('.', '_', $TPSCriteriaKey[$TPSCriteriaIndex]);
188 if (!empty($_REQUEST["radio_" . $RadioNamePart]) && ($_REQUEST["radio_" . $RadioNamePart] == $TPSCriteriaRadioKey[$TPSCriteriaIndex][$TPSCriteriaRadioIndex])) {
189 $Checked = ' checked ';
195 <input type
="radio" name
="radio_<?php echo attr($RadioNamePart) ?>" id
="radio_<?php echo attr($RadioNamePart . $TPSCriteriaRadioIndex) ?>" value
="<?php echo attr($TPSCriteriaRadioKey[$TPSCriteriaIndex][$TPSCriteriaRadioIndex]) ?>" <?php
echo $Checked;?
> onClick
="appendOptionRadioCriteria(<?php echo attr_js($TPSCriteriaDisplay[$TPSCriteriaIndex]); ?>, <?php echo attr_js($TPSCriteriaKey[$TPSCriteriaIndex]); ?>, <?php echo attr_js($TPSCriteriaDisplayRadio[$TPSCriteriaIndex][$TPSCriteriaRadioIndex]); ?>, <?php echo attr_js($TPSCriteriaRadioKey[$TPSCriteriaIndex][$TPSCriteriaRadioIndex]); ?>, <?php echo attr_js($RadioSeperator); ?>, <?php echo attr_js($TPSCriteriaDataType[$TPSCriteriaIndex]); ?>)" />
196 <?php
echo text($TPSCriteriaDisplayRadio[$TPSCriteriaIndex][$TPSCriteriaRadioIndex]);
208 <!-- Current Criteria
-->
210 <div
class="card bg-light">
211 <div
class="card-header pb-0"><h4
><?php
echo xlt('Current Criteria'); ?
></h4
></div
>
212 <div
class="card-body">
213 <div
class="form-group px-2">
214 <label
for="final_this_page_criteria"><?php
echo xlt('Criteria Actions') . ':'; ?
></label
>
215 <span
class="float-right">
216 <i
class="fa fa-trash fa-2x text-warning" aria
-hidden
="true" onclick
="removeOptionSelected()" title
="<?php echo xla('Click here to delete the selection'); ?>"></i
> 
;
217 <i
class="fa fa-trash fa-2x text-danger" aria
-hidden
="true" onclick
="removeOptionsAll()" title
="<?php echo xla('Click here to delete all options'); ?>"></i
>
219 <select name
='final_this_page_criteria[]' id
='final_this_page_criteria' class='form-control' size
="8" title
='Criteria' multiple
="multiple">
221 if (!empty($_REQUEST['final_this_page_criteria'])) {
222 for ($final_this_page_criteria_index = 0; $final_this_page_criteria_index < sizeof($_REQUEST['final_this_page_criteria']); $final_this_page_criteria_index++
) {
224 <option value
="<?php echo attr($_REQUEST['final_this_page_criteria'][$final_this_page_criteria_index]) ?>">
225 <?php
echo xlt($_REQUEST['final_this_page_criteria_text'][$final_this_page_criteria_index]) ?
></option
>
231 <select name
='final_this_page_criteria_text[]' id
='final_this_page_criteria_text' style
="display: none" multiple
="multiple">
233 if (!empty($_REQUEST['final_this_page_criteria'])) {
234 for ($final_this_page_criteria_index = 0; $final_this_page_criteria_index < sizeof($_REQUEST['final_this_page_criteria']); $final_this_page_criteria_index++
) {
236 <option value
="<?php echo attr($_REQUEST['final_this_page_criteria_text'][$final_this_page_criteria_index]) ?>">
249 <div
class="card bg-light">
250 <div
class="card-header pb-0"><h4
><?php
echo xlt('Select Action'); ?
></h4
></div
>
251 <div
class="card-body">
252 <div
class="form-group">
253 <ul
class="list-group list-group-flush">
254 <li
class="list-group-item bg-light d-flex justify-content-between align-items-center">
255 <a
class="link_submit" href
="#" onclick
="javascript:return SubmitTheScreen();"><strong
><?php
echo xlt('Update List') ?
></strong
></a
><i id
='update-tooltip' class="fa fa-info-circle fa-lg text-primary" aria
-hidden
="true"></i
>
257 <?php
if (file_exists("$webserver_root/custom/BillingExport.php")) { ?
>
258 <li
class="list-group-item bg-light">
259 <a
class='link_submit' href
="#" onclick
="javascript:return SubmitTheScreenExportOFX();"><strong
><?php
echo xlt('Export OFX'); ?
></strong
></a
>
262 <li
class="list-group-item bg-light">
263 <a
class='link_submit' href
="#" onclick
="javascript:return SubmitTheScreenPrint();"><strong
><?php
echo xlt('View Printable Report'); ?
></strong
></a
>
266 <?php
if ($daysheet) { ?
>
267 <li
class="list-group-item bg-light"><a
class='link_submit' href
="#" onclick
="javascript:return SubmitTheEndDayPrint();"><strong
><?php
echo xlt('End Of Day Report') . ' - ' ?
></strong
></a
>
268 <?php
if ($daysheet_total) { ?
>
269 <span
class="text"><strong
><?php
echo xlt('Totals'); ?
></strong
></span
>
270 <input name
="end_of_day_totals_only" type
="checkbox" value
="1">
272 <?php
if ($provider_run) { ?
>
273 <span
class="text"><strong
><?php
echo xlt('Provider'); ?
></strong
></span
>
274 <input name
="end_of_day_provider_only" type
="checkbox" value
="1">
279 <?php
if (!file_exists($EXPORT_INC)) { ?
>
280 <li
class="list-group-item bg-light"><a href
='#' id
="view-log-link" data
-toggle
="modal" data
-target
="#myModal" class='link_submit' title
='<?php echo xla('See messages from the last set of generated claims
'); ?>'><strong
><?php
echo xlt('View Log'); ?
></strong
></a
>
283 <li
class="list-group-item bg-light"><a href
="<?php echo $webroot ?>/interface/billing/customize_log.php" rel
="noopener" target
="_blank" onclick
="top.restoreSession()"><strong
><?php
echo xlt('Tab Log') ?
></strong
></a
>
285 <li
class="list-group-item bg-light"><a
class="link_submit" href
="JavaScript:void(0);" onclick
="select_all(); return false;"><strong
><?php
echo xlt('Select All'); ?
></strong
></a
>
287 <li
class="list-group-item bg-light"><a id
="clear-log" href
="#" title
='<?php xla('Clear the log
'); ?>'><strong
><?php
echo xlt('Clear Log') ?
></strong
></a
>
295 <!-- Criteria section Ends
-->