From 86f08600c8607b6753df5c5994f164eff624aeec Mon Sep 17 00:00:00 2001 From: Brady Miller Date: Wed, 26 Sep 2018 17:44:03 -0700 Subject: [PATCH] continued bug fixes (#1876) --- interface/batchcom/batchEmail.php | 7 +- interface/batchcom/batchPhoneList.php | 5 + interface/batchcom/batch_phone_notification.php | 2 +- interface/batchcom/batch_reminders.php | 33 +-- interface/batchcom/batchcom.php | 5 + interface/batchcom/emailnotification.php | 8 +- interface/batchcom/settingsnotification.php | 7 +- interface/batchcom/smsnotification.php | 7 +- interface/billing/billing_process.php | 18 +- interface/billing/billing_report.php | 87 +++--- interface/billing/edih_main.php | 8 + interface/billing/edih_view.php | 47 +++- interface/billing/era_payments.php | 71 ++--- interface/billing/get_claim_file.php | 6 +- interface/billing/indigent_patients_report.php | 5 + interface/billing/payment_master.inc.php | 113 ++++---- interface/billing/payment_pat_sel.inc.php | 148 +++++------ interface/billing/print_billing_report.php | 18 +- interface/billing/print_daysheet_report_num1.php | 8 +- interface/billing/print_daysheet_report_num2.php | 8 +- interface/billing/print_daysheet_report_num3.php | 8 +- interface/billing/search_payments.php | 6 +- interface/billing/sl_eob_invoice.php | 161 ++++++------ interface/billing/sl_eob_patient_note.php | 37 +-- interface/billing/sl_eob_process.php | 104 ++++---- interface/billing/sl_eob_search.php | 2 +- interface/billing/sl_receipts_report.php | 5 + interface/billing/ub04_form.php | 8 +- interface/billing/ub04_helpers.php | 4 +- interface/reports/criteria.tab.php | 38 +-- library/edihistory/edih_271_html.php | 174 ++++++------ library/edihistory/edih_277_html.php | 134 +++++----- library/edihistory/edih_278_html.php | 240 ++++++++--------- library/edihistory/edih_835_html.php | 322 +++++++++++------------ library/edihistory/edih_997_error.php | 92 +++---- library/edihistory/edih_archive.php | 96 +++---- library/edihistory/edih_csv_data.php | 286 ++++++++++---------- library/edihistory/edih_csv_inc.php | 54 ++-- library/edihistory/edih_io.php | 68 ++--- library/edihistory/edih_segments.php | 26 +- library/edihistory/edih_uploads.php | 22 +- library/edihistory/edih_x12file_class.php | 64 ++--- library/edihistory/test_edih_835_accounting.php | 30 +-- library/sl_eob.inc.php | 84 ++---- 44 files changed, 1377 insertions(+), 1299 deletions(-) diff --git a/interface/batchcom/batchEmail.php b/interface/batchcom/batchEmail.php index 67300c9a0..4b5c9a289 100644 --- a/interface/batchcom/batchEmail.php +++ b/interface/batchcom/batchEmail.php @@ -14,8 +14,13 @@ // create file header. // menu for fields could be added in the future require_once("../globals.php"); + use OpenEMR\Core\Header; +if (!verifyCsrfToken($_POST["csrf_token_form"])) { + die(xlt('Authentication Error')); +} + ?> @@ -63,7 +68,7 @@ use OpenEMR\Core\Header; ' . xlt('Could not send email due to a server problem.') . ' ' . $m_error_count . ' ' . xlt('emails not sent') . ''; + echo '
' . xlt('Could not send email due to a server problem.') . ' ' . text($m_error_count) . ' ' . xlt('emails not sent') . '
'; } ?> diff --git a/interface/batchcom/batchPhoneList.php b/interface/batchcom/batchPhoneList.php index 19fa72aee..90acba305 100644 --- a/interface/batchcom/batchPhoneList.php +++ b/interface/batchcom/batchPhoneList.php @@ -13,8 +13,13 @@ */ require_once("../globals.php"); + use OpenEMR\Core\Header; +if (!verifyCsrfToken($_POST["csrf_token_form"])) { + die(xlt('Authentication Error')); +} + ?> diff --git a/interface/batchcom/batch_phone_notification.php b/interface/batchcom/batch_phone_notification.php index 73c910d5e..05cbdcf9c 100644 --- a/interface/batchcom/batch_phone_notification.php +++ b/interface/batchcom/batch_phone_notification.php @@ -182,7 +182,7 @@ function cron_InsertNotificationLogEntry($prow, $phone_msg, $phone_gateway) $sql_loginsert = "INSERT INTO `notification_log` ( `iLogId` , `pid` , `pc_eid` , `message`, `type` , `patient_info` , `smsgateway_info` , `pc_eventDate` , `pc_endDate` , `pc_startTime` , `pc_endTime` , `dSentDateTime` ) VALUES "; $sql_loginsert .= "(NULL , ?, ?, ?, 'Phone', ?, ?, ?, ?, ?, ?, ?)"; - $db_loginsert = ( sqlStatement($sql_loginsert, array($prow[pid], $prow[pc_eid], $message, $patient_info, $phone_gateway, $prow[pc_eventDate], $prow[pc_endDate], $prow[pc_startTime], $prow[pc_endTime], date("Y-m-d H:i:s")))); + $db_loginsert = ( sqlStatement($sql_loginsert, array($prow['pid'], $prow['pc_eid'], $message, $patient_info, $phone_gateway, $prow['pc_eventDate'], $prow['pc_endDate'], $prow['pc_startTime'], $prow['pc_endTime'], date('Y-m-d H:i:s')))); } //////////////////////////////////////////////////////////////////// diff --git a/interface/batchcom/batch_reminders.php b/interface/batchcom/batch_reminders.php index 2ce93e052..6d543a610 100644 --- a/interface/batchcom/batch_reminders.php +++ b/interface/batchcom/batch_reminders.php @@ -16,6 +16,7 @@ require_once(dirname(__FILE__)."/../../interface/globals.php"); require_once($GLOBALS['srcdir'] . "/maviq_phone_api.php"); require_once($GLOBALS['srcdir'] . "/reminders.php"); require_once($GLOBALS['srcdir'] . "/report_database.inc"); + use OpenEMR\Core\Header; //To improve performance and not freeze the session when running this @@ -83,29 +84,29 @@ if (empty($report_id) && !empty($GLOBALS['pat_rem_clin_nice'])) { ?>
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+


-
-
-
-
-
-
+
+
+
+
+
+


- +



diff --git a/interface/batchcom/batchcom.php b/interface/batchcom/batchcom.php index 227a1e92e..134c52c44 100644 --- a/interface/batchcom/batchcom.php +++ b/interface/batchcom/batchcom.php @@ -34,6 +34,10 @@ $sort_by_choices = array(xl('Zip Code')=>'patient_data.postal_code', xl('Last Na // process form if ($_POST['form_action']=='process') { + if (!verifyCsrfToken($_POST["csrf_token_form"])) { + die(xlt('Authentication Error')); + } + //validation uses the functions in batchcom.inc.php //validate dates if (!check_date_format($_POST['app_s'])) { @@ -184,6 +188,7 @@ if ($_POST['form_action']=='process') { } ?>
+
diff --git a/interface/batchcom/emailnotification.php b/interface/batchcom/emailnotification.php index db52fd59c..7d1eb452c 100755 --- a/interface/batchcom/emailnotification.php +++ b/interface/batchcom/emailnotification.php @@ -14,6 +14,7 @@ require_once("../globals.php"); require_once("$srcdir/registry.inc"); require_once("../../library/acl.inc"); require_once("batchcom.inc.php"); + use OpenEMR\Core\Header; // gacl control @@ -35,6 +36,10 @@ $email_sender = "EMR Group"; $email_subject = "Welcome to EMR Group"; // process form if ($_POST['form_action']=='save') { + if (!verifyCsrfToken($_POST["csrf_token_form"])) { + die(xlt('Authentication Error')); + } + //validation uses the functions in notification.inc.php if ($_POST['email_sender']=="") { $form_err .= xl('Empty value in "Email Sender"') . '
'; @@ -118,10 +123,11 @@ $min_array = array('00','05','10','15','20','25','30','35','40','45','50','55'); } if ($sql_msg) { - echo '
' . xlt('The following errors occurred') . ': ' . text($sql_msg) . '
'; + echo '
' . xlt('The following occurred') . ': ' . text($sql_msg) . '
'; } ?> +
diff --git a/interface/batchcom/settingsnotification.php b/interface/batchcom/settingsnotification.php index 03eadc294..163645d1d 100755 --- a/interface/batchcom/settingsnotification.php +++ b/interface/batchcom/settingsnotification.php @@ -27,6 +27,10 @@ if (!acl_check('admin', 'notification')) { $type = 'SMS/Email Settings'; // process form if ($_POST['form_action']=='save') { + if (!verifyCsrfToken($_POST["csrf_token_form"])) { + die(xlt('Authentication Error')); + } + if ($_POST['Send_SMS_Before_Hours']=="") { $form_err .= xl('Empty value in "SMS Hours"') . '
'; } @@ -95,10 +99,11 @@ if ($result) { } if ($sql_msg) { - echo '
' . xlt('The following errors occurred') . ': ' . text($sql_msg) . '
'; + echo '
' . xlt('The following occurred') . ': ' . text($sql_msg) . '
'; } ?> + diff --git a/interface/batchcom/smsnotification.php b/interface/batchcom/smsnotification.php index 29768fc77..ff5480634 100755 --- a/interface/batchcom/smsnotification.php +++ b/interface/batchcom/smsnotification.php @@ -35,6 +35,10 @@ $message="Welcome to EMR Group"; // process form if ($_POST['form_action']=='save') { + if (!verifyCsrfToken($_POST["csrf_token_form"])) { + die(xlt('Authentication Error')); + } + //validation uses the functions in notification.inc.php //validate dates if (!check_date_format($_POST['next_app_date'])) { @@ -111,10 +115,11 @@ $min_array = array('00','05','10','15','20','25','30','35','40','45','50','55'); } if ($sql_msg) { - echo '
' . xlt('The following errors occurred') . ': ' . text($sql_msg) . '
'; + echo '
' . xlt('The following occurred') . ': ' . text($sql_msg) . '
'; } ?> +
diff --git a/interface/billing/billing_process.php b/interface/billing/billing_process.php index cae47bc97..c6301a25e 100644 --- a/interface/billing/billing_process.php +++ b/interface/billing/billing_process.php @@ -25,12 +25,16 @@ * @author Jerry Padgett * @link http://www.open-emr.org */ -include_once("../globals.php"); -include_once("$srcdir/patient.inc"); -include_once("$srcdir/billrep.inc"); -include_once("$srcdir/billing.inc"); -include_once("$srcdir/gen_x12_837.inc.php"); -include_once("$srcdir/gen_hcfa_1500.inc.php"); +require_once("../globals.php"); +require_once("$srcdir/patient.inc"); +require_once("$srcdir/billrep.inc"); +require_once("$srcdir/billing.inc"); +require_once("$srcdir/gen_x12_837.inc.php"); +require_once("$srcdir/gen_hcfa_1500.inc.php"); + +if (!verifyCsrfToken($_POST["csrf_token_form"])) { + die(xlt('Authentication Error')); +} if ($GLOBALS['ub04_support']) { require_once("./ub04_dispose.php"); @@ -223,7 +227,7 @@ function process_form($ar) } if (! $tmp) { - die(xl("Claim ") . $claimid . xl(" update failed, not in database?")); + die(xlt("Claim ") . text($claimid) . xlt(" update failed, not in database?")); } else { if (isset($ar['bn_mark'])) { $bill_info[] = xl("Claim ") . $claimid . xl(" was marked as billed only.") . "\n"; diff --git a/interface/billing/billing_report.php b/interface/billing/billing_report.php index bf7d1fc3a..d9174b679 100644 --- a/interface/billing/billing_report.php +++ b/interface/billing/billing_report.php @@ -46,6 +46,10 @@ if ($GLOBALS['use_custom_daysheet'] != 0) { $alertmsg = ''; if (isset($_POST['mode'])) { + if (!verifyCsrfToken($_POST["csrf_token_form"])) { + die(xlt('Authentication Error')); + } + if ($_POST['mode'] == 'export') { $sql = ReturnOFXSql(); $db = get_db(); @@ -290,7 +294,7 @@ $oauthorized = $my_authorized; if (ele) { ele.style.display = "inline"; text.innerHTML = - ""; + ""; } } } else { @@ -302,7 +306,7 @@ $oauthorized = $my_authorized; if (ele) { ele.style.display = "none"; text.innerHTML = - ""; + ""; } } } @@ -315,11 +319,11 @@ $oauthorized = $my_authorized; if (ele.style.display == "inline") { ele.style.display = "none"; text.innerHTML = - ""; + ""; } else { ele.style.display = "inline"; text.innerHTML = - ""; + ""; } } } @@ -335,19 +339,19 @@ $oauthorized = $my_authorized; } } if (Type == 1) { - Message = ''; + Message = ''; } if (Type == 2) { - Message = ''; + Message = ''; } if (Type == 3) { - Message = ''; + Message = ''; } - if (confirm(Message + "\n\n\n" + ' ' + + if (confirm(Message + "\n\n\n" + ' ' + CheckBoxBillingCount + ' ' + - "\n" + - "\n" + - "" + "\n" + + "\n" + + "" )) { document.getElementById('HiddenMarkAsCleared').value = 'yes'; } else { @@ -419,9 +423,7 @@ $oauthorized = $my_authorized;
- +
@@ -553,7 +555,7 @@ $oauthorized = $my_authorized;
- +
    @@ -597,6 +599,7 @@ $oauthorized = $my_authorized;
+
@@ -686,7 +689,7 @@ $oauthorized = $my_authorized; + type="submit"> @@ -799,11 +802,11 @@ $oauthorized = $my_authorized; + href="JavaScript:void(0);"> + href="JavaScript:void(0);">   @@ -862,7 +865,7 @@ $oauthorized = $my_authorized; $lhtml .= '
'; $DivPut = 'no'; } - echo "\n\n$lhtml$rhtml\n"; + echo "\n\n$lhtml$rhtml\n"; echo "\n\n"; ++$encount; } @@ -950,10 +953,10 @@ $oauthorized = $my_authorized; - EncounterIdArray[][Count] = ''; - EncounterDateArray[][Count] = ''; - CalendarCategoryArray[][Count] = ''; - EncounterNoteArray[][Count] = ''; + EncounterIdArray[][Count] = ''; + EncounterDateArray[][Count] = ''; + CalendarCategoryArray[][Count] = ''; + EncounterNoteArray[][Count] = ''; Count++; "; // Not sure why the next section seems to do nothing except post "To Encounter" button 2/17/09 JCH - $lhtml .= "" . xlt('Encounter') . " " . text(oeFormatShortDate($raw_encounter_date)) . ""; + $lhtml .= "" . xlt('Encounter') . " " . text(oeFormatShortDate($raw_encounter_date)) . ""; // Changed "To xxx" buttons to allow room for encounter date display 2/17/09 JCH - $lhtml .= "" . xlt('Patient') . ""; + $lhtml .= "" . xlt('Patient') . ""; $is_edited = $iter['mboid'] ? 'btn-success' : 'btn-default'; $title = $iter['mboid'] ? xlt("This claim has HCFA 1500 miscellaneous billing options") : xlt("Click to add HCFA 1500 miscellaneous billing options"); - $lhtml .= "" . xlt('MBO ') . ""; + $lhtml .= "" . xlt('MBO ') . ""; if ($ub04_support && isset($iter['billed'])) { $c = sqlQuery( "SELECT submitted_claim AS status FROM claims WHERE " . @@ -984,12 +987,12 @@ $oauthorized = $my_authorized; ) ); $is_edited = $c['status'] ? 'btn-success' : 'btn-warning'; - $bname = $c['status'] ? xlt('Reviewed') : xlt('Review UB04'); - $lhtml .= "" . $bname . ""; + $bname = $c['status'] ? xl('Reviewed') : xl('Review UB04'); + $lhtml .= "" . text($bname) . ""; } $lhtml .= "
"; $divnos = $divnos + 1; - $lhtml .= "   (" . htmlspecialchars(xl('Expand'), ENT_QUOTES) . ')
'; + $lhtml .= "   (" . xlt('Expand') . ')
'; if ($GLOBALS['notes_to_display_in_Billing'] == 2 || $GLOBALS['notes_to_display_in_Billing'] == 3) { $lhtml .= '' . text($billing_note) . ''; } @@ -997,7 +1000,7 @@ $oauthorized = $my_authorized; if ($iter['id']) { $lcount += 2; $lhtml .= "
\n"; - $lhtml .= " Bill: "; + $lhtml .= " " . xlt('Bill') . ": "; $lhtml .= "
@@ -78,13 +79,14 @@ if (!acl_check('acct', 'eob')) { +
:   
- /> + " />
@@ -105,6 +107,7 @@ if (!acl_check('acct', 'eob')) {
+
: @@ -154,6 +157,7 @@ if (!acl_check('acct', 'eob')) { @@ -707,13 +719,13 @@ if ($_GET['original']=='original') { $alertmsg = parse_era_for_check($GLOBALS['OE_SITE_DIR'] . "/era/$eraname.edi"); $alertmsg = parse_era($GLOBALS['OE_SITE_DIR'] . "/era/$eraname.edi", 'era_callback'); if (!$debug) { - $StringIssue=htmlspecialchars(xl("Total Distribution for following check number is not full"), ENT_QUOTES).': '; + $StringIssue=xl("Total Distribution for following check number is not full").': '; $StringPrint='No'; foreach ($InsertionId as $key => $value) { - $rs= sqlQ("select pay_total from ar_session where session_id='$value'"); + $rs= sqlQ("select pay_total from ar_session where session_id=?", array($value)); $row=sqlFetchArray($rs); $pay_total=$row['pay_total']; - $rs= sqlQ("select sum(pay_amount) sum_pay_amount from ar_activity where session_id='$value'"); + $rs= sqlQ("select sum(pay_amount) sum_pay_amount from ar_activity where session_id=?", array($value)); $row=sqlFetchArray($rs); $pay_amount=$row['sum_pay_amount']; @@ -724,7 +736,7 @@ if ($_GET['original']=='original') { } if ($StringPrint=='Yes') { - echo ""; + echo ""; } } @@ -738,7 +750,7 @@ if ($_GET['original']=='original') { diff --git a/interface/billing/sl_eob_search.php b/interface/billing/sl_eob_search.php index 0125c558d..d2b23e171 100644 --- a/interface/billing/sl_eob_search.php +++ b/interface/billing/sl_eob_search.php @@ -1109,7 +1109,7 @@ if (($_POST['form_print'] || $_POST['form_download'] || $_POST['form_email'] || var f = document.forms[0]; var debug = f.form_without.checked ? '1' : '0'; var paydate = f.form_paydate.value; - window.open('sl_eob_process.php?eraname=&debug=' + debug + '&paydate=' + paydate + '&original=original', '_blank'); + window.open('sl_eob_process.php?eraname=&debug=' + debug + '&paydate=' + paydate + '&original=original' + '&csrf_token_form=', '_blank'); return false; } $(function() { diff --git a/interface/billing/sl_receipts_report.php b/interface/billing/sl_receipts_report.php index dfe7c60c3..23014e26b 100644 --- a/interface/billing/sl_receipts_report.php +++ b/interface/billing/sl_receipts_report.php @@ -159,6 +159,7 @@ $form_facility = $_POST['form_facility']; - +
@@ -304,6 +305,10 @@ $form_facility = $_POST['form_facility'];
+
@@ -189,6 +193,7 @@ if (!acl_check('acct', 'eob')) {
+
:
@@ -227,6 +232,7 @@ if (!acl_check('acct', 'eob')) { @@ -354,7 +363,10 @@ if (!acl_check('acct', 'eob')) { jQuery(function() { jQuery.ajax({ url: 'edih_main.php', - data: { srvinfo: 'yes' }, + data: { + srvinfo: 'yes', + csrf_token_form: '' + }, dataType: 'json', success: function(rsp){ phpserver = rsp } }); @@ -364,7 +376,10 @@ if (!acl_check('acct', 'eob')) { jQuery.ajax({ type: 'GET', url: 'edih_main.php', - data: { csvtbllist: 'yes' }, + data: { + csvtbllist: 'yes', + csrf_token_form: '' + }, dataType: 'json', success: function(data) { var options = jQuery('#csvselect').attr('options'); @@ -388,7 +403,10 @@ if (!acl_check('acct', 'eob')) { jQuery.ajax({ type: 'GET', url: 'edih_main.php', - data: { loglist: 'yes' }, + data: { + loglist: 'yes', + csrf_token_form: '' + }, dataType: 'json', success: function(data) { var options = jQuery('#logselect').attr('options'); @@ -409,7 +427,10 @@ if (!acl_check('acct', 'eob')) { jQuery.ajax({ type: 'GET', url: 'edih_main.php', - data: { archlist: 'yes' }, + data: { + archlist: 'yes', + csrf_token_form: '' + }, dataType: 'json', success: function(data) { //var options = jQuery('#archrestoresel').attr('options'); @@ -809,7 +830,10 @@ jQuery-UI dialog jQuery.ajax({ type: 'get', url: jQuery('#formlog').attr('action'), - data: { archivelog: 'yes' }, + data: { + archivelog: 'yes', + csrf_token_form: '' + }, dataType: "json", success: function(data) { var str = "

    "; @@ -869,7 +893,10 @@ jQuery-UI dialog jQuery.ajax({ type:'GET', url: jQuery('#formnotes').attr('action'), - data: { getnotes: "yes"}, + data: { + getnotes: "yes", + csrf_token_form: '' + }, dataType: "text", success: function(data){ jQuery('#notesrsp').html(''); @@ -887,7 +914,7 @@ jQuery-UI dialog e.preventDefault(); var notetxt = jQuery('#notesrsp :textarea').val(); var noteURL = jQuery('#formnotes').attr('action'); - jQuery.post(noteURL, { putnotes: 'yes', tnotes: notetxt }, + jQuery.post(noteURL, { putnotes: 'yes', tnotes: notetxt, csrf_token_form: '' }, function(data){ jQuery('#notesrsp').append(data); }); }); @@ -946,7 +973,7 @@ jQuery-UI dialog type: 'GET', //cache: false, dataType: 'html', - data: { archivereport: 'yes', period: sprd }, + data: { archivereport: 'yes', period: sprd, csrf_token_form: '' }, success: function(data) { //rspElem.html(data); diff --git a/interface/billing/era_payments.php b/interface/billing/era_payments.php index 36a5dd800..ae40544fd 100644 --- a/interface/billing/era_payments.php +++ b/interface/billing/era_payments.php @@ -27,7 +27,7 @@ //=============================================================================== //Electronic posting is handled here. //=============================================================================== -use OpenEMR\Core\Header; + require_once("../globals.php"); require_once("$srcdir/patient.inc"); @@ -35,6 +35,15 @@ require_once("$srcdir/invoice_summary.inc.php"); require_once($GLOBALS['OE_SITE_DIR'] . "/statement.inc.php"); require_once("$srcdir/parse_era.inc.php"); require_once("$srcdir/sl_eob.inc.php"); + +use OpenEMR\Core\Header; + +$hidden_type_code = isset($_POST['hidden_type_code']) ? $_POST['hidden_type_code'] : ''; +$check_date = isset($_POST['check_date']) ? $_POST['check_date'] : ''; +$post_to_date = isset($_POST['post_to_date']) ? $_POST['post_to_date'] : ''; +$deposit_date = isset($_POST['deposit_date']) ? $_POST['deposit_date'] : ''; +$type_code = isset($_POST['type_code']) ? $_POST['type_code'] : ''; + //=============================================================================== // This is called back by parse_era() if we are processing X12 835's. $alertmsg = ''; @@ -53,17 +62,21 @@ function era_callback(&$out) if ($where) { $where .= ' OR '; } - $where .= "( f.pid = '$pid' AND f.encounter = '$encounter' )"; + $where .= "( f.pid = '" . add_escape_custom($pid) . "' AND f.encounter = '" . add_escape_custom($encounter) . "' )"; } } //=============================================================================== // Handle X12 835 file upload. if ($_FILES['form_erafile']['size']) { + if (!verifyCsrfToken($_POST["csrf_token_form"])) { + die(xlt('Authentication Error')); + } + $tmp_name = $_FILES['form_erafile']['tmp_name']; // Handle .zip extension if present. Probably won't work on Windows. if (strtolower(substr($_FILES['form_erafile']['name'], -4)) == '.zip') { rename($tmp_name, "$tmp_name.zip"); - exec("unzip -p $tmp_name.zip > $tmp_name"); + exec("unzip -p " . escapeshellarg($tmp_name.".zip") . " > " . escapeshellarg($tmp_name)); unlink("$tmp_name.zip"); } $alertmsg .= parse_era($tmp_name, 'era_callback'); @@ -87,27 +100,24 @@ if ($_FILES['form_erafile']['size']) { - - + \n"; @@ -57,29 +63,30 @@ if ($_POST['form_save']) { } $row = sqlQuery("select fname, lname, billing_note " . - "from patient_data where pid = '$patient_id' limit 1"); + "from patient_data where pid = ? limit 1", array($patient_id)); ?>
    -
    + +
    - +
    - ' placeholder = "" /> + ' placeholder ='' />
    - +
    diff --git a/interface/billing/sl_eob_process.php b/interface/billing/sl_eob_process.php index c66669d23..c7a6bfa22 100644 --- a/interface/billing/sl_eob_process.php +++ b/interface/billing/sl_eob_process.php @@ -46,13 +46,18 @@ function parse_date($date) return ''; } -function writeMessageLine($bgcolor, $class, $description) +function writeMessageLine($bgcolor, $class, $description, $nl2br_process = "false") { $dline = - "
\n" . - " \n" . - " \n" . - " \n" . + " \n" . + " \n"; + if ($nl2br_process) { + $dline .= " \n"; + } else { + $dline .= " \n"; + } + $dline .= + " \n" . " \n"; echo $dline; } @@ -97,14 +102,14 @@ function writeDetailLine( } $dline = - " \n" . - " \n" . - " \n" . - " \n" . - " \n" . - " \n" . - " \n" . - " \n" . + " \n" . + " \n" . + " \n" . + " \n" . + " \n" . + " \n" . + " \n" . + " \n" . " \n"; echo $dline; } @@ -151,7 +156,7 @@ function era_callback_check(&$out) if ($_GET['original']=='original') { $StringToEcho="





"; $StringToEcho.="
+
@@ -238,6 +244,7 @@ if (!acl_check('acct', 'eob')) {
+
" /> @@ -263,6 +270,7 @@ if (!acl_check('acct', 'eob')) {
+
+
- /> + " />
 $description 
 " . nl2br(text($description)) . "" . text($description) . " 
$ptname$invnumber$code" . text(oeFormatShortDate($date)) . "$description" . oeFormatMoney($amount) . "" . oeFormatMoney($balance) . "
" . text($ptname) . "" . text($invnumber) . "" . text($code) . "" . text(oeFormatShortDate($date)) . "" . text($description) . "" . text(oeFormatMoney($amount)) . "" . text(oeFormatMoney($balance)) . "
"; - $StringToEcho.=""; + $StringToEcho.=""; $WarningFlag=false; for ($check_count=1; $check_count<=$out['check_count']; $check_count++) { if ($check_count%2==1) { @@ -160,23 +165,23 @@ function era_callback_check(&$out) $bgcolor='#ffdddd'; } - $rs=sqlQ("select reference from ar_session where reference='".$out['check_number'.$check_count]."'"); + $rs=sqlQ("select reference from ar_session where reference=?", array($out['check_number'.$check_count])); if (sqlNumRows($rs)>0) { $bgcolor='#ff0000'; $WarningFlag=true; } - $StringToEcho.=""; - $StringToEcho.=""; - $StringToEcho.=""; - $StringToEcho.=""; - $StringToEcho.=""; + $StringToEcho.=""; + $StringToEcho.=""; + $StringToEcho.=""; + $StringToEcho.=""; + $StringToEcho.=""; $StringToEcho.=""; } $StringToEcho.=""; if ($WarningFlag==true) { - $StringToEcho.=""; + $StringToEcho.=""; } $StringToEcho.="
".htmlspecialchars(xl('Check Number'), ENT_QUOTES)."".htmlspecialchars(xl('Payee Name'), ENT_QUOTES)."".htmlspecialchars(xl('Check Amount'), ENT_QUOTES)."
" . xlt('Check Number') . "" . xlt('Payee Name') . "" . xlt('Check Amount') . "
".htmlspecialchars($out['check_number'.$check_count])."".htmlspecialchars($out['payee_name'.$check_count])."".htmlspecialchars(number_format($out['check_amount'.$check_count], 2))."
" . text($out['check_number'.$check_count]) . "" . text($out['payee_name'.$check_count]) . "" . text(number_format($out['check_amount'.$check_count], 2)) . "
".htmlspecialchars(xl('Warning, Check Number already exist in the database'), ENT_QUOTES)."
" . xlt('Warning, Check Number already exist in the database') . "
"; @@ -208,7 +213,7 @@ function era_callback(&$out) writeMessageLine( '#ffffff', 'infdetail', - "Payer: " . htmlspecialchars($out['payer_name'], ENT_QUOTES) + "Payer: " . $out['payer_name'] ); if ($debug) { writeMessageLine( @@ -231,8 +236,8 @@ function era_callback(&$out) // Get invoice data into $arrow or $ferow. $ferow = sqlQuery("SELECT e.*, p.fname, p.mname, p.lname " . "FROM form_encounter AS e, patient_data AS p WHERE " . - "e.pid = '$pid' AND e.encounter = '$encounter' AND ". - "p.pid = e.pid"); + "e.pid = ? AND e.encounter = ? AND ". + "p.pid = e.pid", array($pid, $encounter)); if (empty($ferow)) { $pid = $encounter = 0; $invnumber = $out['our_claim_id']; @@ -316,7 +321,7 @@ function era_callback(&$out) } if ($out['warnings']) { - writeMessageLine($bgcolor, 'infdetail', nl2br(rtrim($out['warnings']))); + writeMessageLine($bgcolor, 'infdetail', rtrim($out['warnings']), true); } // Simplify some claim attributes for cleaner code. @@ -592,8 +597,8 @@ function era_callback(&$out) if ($out['crossover']==1) {//Automatic forward case.So need not again bill from the billing manager screen. sqlStatement("UPDATE form_encounter " . - "SET last_level_closed = $level_done,last_level_billed=".$level_done." WHERE " . - "pid = '$pid' AND encounter = '$encounter'"); + "SET last_level_closed = ?,last_level_billed=? WHERE " . + "pid = ? AND encounter = ?", array($level_done, $level_done, $pid, $encounter)); writeMessageLine( $bgcolor, 'infdetail', @@ -601,8 +606,8 @@ function era_callback(&$out) ); } else { sqlStatement("UPDATE form_encounter " . - "SET last_level_closed = $level_done WHERE " . - "pid = '$pid' AND encounter = '$encounter'"); + "SET last_level_closed = ? WHERE " . + "pid = ? AND encounter = ?", array($level_done, $pid, $encounter)); } // Check for secondary insurance. @@ -623,11 +628,16 @@ function era_callback(&$out) /////////////////////////// End Functions //////////////////////////// - $info_msg = ""; +$info_msg = ""; + +if (!verifyCsrfToken($_GET["csrf_token_form"])) { + die(xlt('Authentication Error')); +} + +$eraname = $_GET['eraname']; - $eraname = $_GET['eraname']; if (! $eraname) { - die(xl("You cannot access this page directly.")); + die(xlt("You cannot access this page directly.")); } // Open the output file early so that in case it fails, we do not post a @@ -644,7 +654,7 @@ if (!$debug) { $fnreport = "$nameprefix$namesuffix.html"; $fhreport = fopen($fnreport, 'w'); if (!$fhreport) { - die(xl("Cannot create") . " '" . text($fnreport) . "'"); + die(xlt("Cannot create") . " '" . text($fnreport) . "'"); } } @@ -661,12 +671,14 @@ if (!$debug) { .errdetail { color:#dd0000; font-family:sans-serif; font-size:9pt; font-weight:normal } .infdetail { color:#0000ff; font-family:sans-serif; font-size:9pt; font-weight:normal } -<?php xl('EOB Posting - Electronic Remittances', 'e')?> +<?php echo xlt('EOB Posting - Electronic Remittances')?> + +
- + - + - + - + - + -   +   -   +  
diff --git a/interface/billing/ub04_form.php b/interface/billing/ub04_form.php index f92f3773b..21dda256e 100644 --- a/interface/billing/ub04_form.php +++ b/interface/billing/ub04_form.php @@ -946,13 +946,13 @@ textarea{

diff --git a/interface/billing/ub04_helpers.php b/interface/billing/ub04_helpers.php index 3addac455..d902a4c9c 100644 --- a/interface/billing/ub04_helpers.php +++ b/interface/billing/ub04_helpers.php @@ -19,7 +19,7 @@ if ($lookup != "") { } // Falling through for user dialog. -$users = sqlStatementNoLog("SELECT id,fname,lname,npi,taxonomy FROM users WHERE " . "authorized=? AND active=?", array(1,1)); +$users = sqlStatementNoLog("SELECT id,fname,lname,npi,taxonomy FROM users WHERE authorized=? AND active=?", array(1,1)); ?> @@ -74,7 +74,7 @@ function lookup_codes($group, $term) $label = $v['code'] . " : " . $v['desc'] . ($v['desc1'] ? (" :: " . $v['desc1']) : ""); if (preg_match($s, $label)) { $gotem[] = array( - 'label' => htmlspecialchars($label, ENT_QUOTES), + 'label' => attr($label), 'value' => $v['code'] ); } diff --git a/interface/reports/criteria.tab.php b/interface/reports/criteria.tab.php index e9297ec3b..837460d00 100644 --- a/interface/reports/criteria.tab.php +++ b/interface/reports/criteria.tab.php @@ -72,10 +72,10 @@ for ($ThisPageSearchCriteriaIndex=0; $ThisPageSearchCriteriaIndex
- +
- + : + " onChange="SetDateCriteriaCustom('date_master_criteria_'); appendOptionDateCriteria('', '', - '', - '', + '', + '', ' = ','master_from_date_','master_to_date_', '')" />
- - : + " onChange="SetDateCriteriaCustom('date_master_criteria_'); appendOptionDateCriteria('', '', - '', - '', + '', + '', ' = ','master_from_date_','master_to_date_', '')" />
+ ?>
".PHP_EOL; + $hdr_html = "
Eligibility Benefit Response
".PHP_EOL; $hdr_html .= "".PHP_EOL; - $hdr_html .= "".PHP_EOL; + $hdr_html .= "".PHP_EOL; $hdr_html .= "".PHP_EOL."".PHP_EOL; $src_html = ""; $rcv_html = ""; @@ -91,7 +91,7 @@ function edih_271_transaction_html($obj271, $bht03) $bht03 = ( isset($sar[3]) && $sar[3]) ? $sar[3] : ""; $bht04 = ( isset($sar[4]) && $sar[4]) ? edih_format_date($sar[4]) : ""; // - $hdr_html .= "" .PHP_EOL; + $hdr_html .= "" .PHP_EOL; continue; } @@ -126,24 +126,24 @@ function edih_271_transaction_html($obj271, $bht03) $rej_reason = $cd271->get_271_code('AAA03', $sar[3]); $follow = $cd271->get_271_code('AAA04', $sar[4]); if ($loopid == '2000A') { - $src_html .= "" .PHP_EOL; + $src_html .= "" .PHP_EOL; } elseif ($loopid == '2000B') { - $rcv_html .= "" .PHP_EOL; + $rcv_html .= "" .PHP_EOL; } elseif ($loopid == '2000C') { - $sbr_nm1_html .= "" .PHP_EOL; + $sbr_nm1_html .= "" .PHP_EOL; } elseif ($loopid == '2000D') { - $dep_nm1_html .= "" .PHP_EOL; + $dep_nm1_html .= "" .PHP_EOL; } elseif ($loopid == '2110C') { - $sbr_eb_html .= "" .PHP_EOL; + $sbr_eb_html .= "" .PHP_EOL; } elseif ($loopid == '2110D') { - $dep_eb_html .= "" .PHP_EOL; + $dep_eb_html .= "" .PHP_EOL; } else { - $hdr_html .= "" .PHP_EOL; + $hdr_html .= "" .PHP_EOL; } continue; } - + if (strncmp('NM1'.$de, $seg, 4) === 0) { $sar = explode($de, $seg); // @@ -159,21 +159,21 @@ function edih_271_transaction_html($obj271, $bht03) $nm109 = (isset($sar[9]) && $sar[9]) ? $sar[9] : ""; // if ($loopid == '2000A') { - $src_html .= "" .PHP_EOL; + $src_html .= "" .PHP_EOL; $loopid = '2100A'; } elseif ($loopid == '2000B') { - $rcv_html .= "" .PHP_EOL; + $rcv_html .= "" .PHP_EOL; $loopid = '2100B'; } elseif ($loopid == '2000C') { - $sbr_nm1_html .= "" .PHP_EOL; + $sbr_nm1_html .= "" .PHP_EOL; $loopid = '2100C'; } elseif ($loopid == '2000D') { - $dep_nm1_html .= "" .PHP_EOL; + $dep_nm1_html .= "" .PHP_EOL; $loopid = '2100D'; } elseif ($loopid == '2120C') { - $sbr_eb_html .= "" .PHP_EOL; + $sbr_eb_html .= "" .PHP_EOL; } elseif ($loopid == '2120D') { - $dep_eb_html .= "" .PHP_EOL; + $dep_eb_html .= "" .PHP_EOL; } // @@ -187,11 +187,11 @@ function edih_271_transaction_html($obj271, $bht03) $idtype = (isset($sar[3]) && $sar[3]) ? $cd271->get_271_code('PER03', $sar[3]) : ""; $per04 = (isset($sar[4]) && $sar[2]) ? $sar[4] : ''; if ($loopid == '2100A') { - $src_html .= "" .PHP_EOL; + $src_html .= "" .PHP_EOL; } elseif ($loopid == '2120C') { - $sbr_eb_html .= "" .PHP_EOL; + $sbr_eb_html .= "" .PHP_EOL; } elseif ($loopid == '2120D') { - $dep_eb_html .= "" .PHP_EOL; + $dep_eb_html .= "" .PHP_EOL; } // @@ -204,13 +204,13 @@ function edih_271_transaction_html($obj271, $bht03) $addr = (isset($sar[1])) ? $sar[1] : ""; $addr .= (isset($sar[2])) ? " {$sar[2]}" : ""; if ($loopid == '2100C') { - $sbr_nm1_html .= "" .PHP_EOL; + $sbr_nm1_html .= "" .PHP_EOL; } elseif ($loopid == '2100D') { - $dep_nm1_html .= "" .PHP_EOL; + $dep_nm1_html .= "" .PHP_EOL; } elseif ($loopid == '2120C') { - $sbr_eb_html .= "" .PHP_EOL; + $sbr_eb_html .= "" .PHP_EOL; } elseif ($loopid == '2120D') { - $dep_eb_html .= "" .PHP_EOL; + $dep_eb_html .= "" .PHP_EOL; } continue; @@ -220,13 +220,13 @@ function edih_271_transaction_html($obj271, $bht03) if (strncmp('N4'.$de, $seg, 3) === 0) { $sar = explode($de, $seg); if ($loopid == '2100C') { - $sbr_nm1_html .= "" .PHP_EOL; + $sbr_nm1_html .= "" .PHP_EOL; } elseif ($loopid == '2100D') { - $dep_nm1_html .= "" .PHP_EOL; + $dep_nm1_html .= "" .PHP_EOL; } elseif ($loopid == '2120C') { - $sbr_eb_html .= "" .PHP_EOL; + $sbr_eb_html .= "" .PHP_EOL; } elseif ($loopid == '2120D') { - $dep_eb_html .= "" .PHP_EOL; + $dep_eb_html .= "" .PHP_EOL; } continue; @@ -237,15 +237,15 @@ function edih_271_transaction_html($obj271, $bht03) $sar = explode($de, $seg); $idtype = ($sar[1]) ? $cd271->get_271_code('PRV', $sar[1]) : ""; if ($loopid == '2100B') { - $src_html .= "" .PHP_EOL; + $src_html .= "" .PHP_EOL; } elseif ($loopid == '2100C') { - $sbr_nm1_html .= "" .PHP_EOL; + $sbr_nm1_html .= "" .PHP_EOL; } elseif ($loopid == '2100D') { - $dep_nm1_html .= "" .PHP_EOL; + $dep_nm1_html .= "" .PHP_EOL; } elseif ($loopid == '2120C') { - $sbr_eb_html .= "" .PHP_EOL; + $sbr_eb_html .= "" .PHP_EOL; } elseif ($loopid == '2120D') { - $dep_eb_html .= "" .PHP_EOL; + $dep_eb_html .= "" .PHP_EOL; } // @@ -267,9 +267,9 @@ function edih_271_transaction_html($obj271, $bht03) } if ($loopid == '2100C') { - $sbr_nm1_html .= "" .PHP_EOL; + $sbr_nm1_html .= "" .PHP_EOL; } elseif ($loopid == '2100D') { - $dep_nm1_html .= "" .PHP_EOL; + $dep_nm1_html .= "" .PHP_EOL; } continue; @@ -284,9 +284,9 @@ function edih_271_transaction_html($obj271, $bht03) $ins17 = (isset($sar[17]) && $sar[17]) ? $sar[17] : ""; // if ($loopid == '2100C') { - $sbr_nm1_html .= "" .PHP_EOL; + $sbr_nm1_html .= "" .PHP_EOL; } elseif ($loopid == '2100D') { - $dep_nm1_html .= "" .PHP_EOL; + $dep_nm1_html .= "" .PHP_EOL; } continue; @@ -309,13 +309,13 @@ function edih_271_transaction_html($obj271, $bht03) } if ($loopid == '2100C') { - $sbr_nm1_html .= "" .PHP_EOL; + $sbr_nm1_html .= "" .PHP_EOL; } elseif ($loopid == '2100D') { - $dep_nm1_html .= "" .PHP_EOL; + $dep_nm1_html .= "" .PHP_EOL; } elseif ($loopid == '2110C') { - $sbr_eb_html .= "" .PHP_EOL; + $sbr_eb_html .= "" .PHP_EOL; } elseif ($loopid == '2110D') { - $dep_eb_html .= "" .PHP_EOL; + $dep_eb_html .= "" .PHP_EOL; } continue; @@ -337,9 +337,9 @@ function edih_271_transaction_html($obj271, $bht03) } if ($loopid == '2100C') { - $sbr_nm1_html .= "" .PHP_EOL; + $sbr_nm1_html .= "" .PHP_EOL; } elseif ($loopid == '2100D') { - $dep_nm1_html .= "" .PHP_EOL; + $dep_nm1_html .= "" .PHP_EOL; } continue; @@ -370,13 +370,13 @@ function edih_271_transaction_html($obj271, $bht03) reset($eb13ar); while (list($k, $v) = each($eb13ar)) { if ($k == 0) { - $eb13 = $cd271->get_271_code('EB13', $v); + $eb13 = text($cd271->get_271_code('EB13', $v)); } else { - $eb13 .= " ".$v; + $eb13 .= " " . text($v); } } } else { - $eb13 = ($sar[13]) ? "Procedure $eb13" : ""; + $eb13 = ($sar[13]) ? "Procedure " . text($eb13) : ""; } $eb14 = ""; @@ -387,40 +387,40 @@ function edih_271_transaction_html($obj271, $bht03) $eb14 = $sar[14]; } - $eb14 = ($eb14) ? "Pointers $eb14" : ""; + $eb14 = ($eb14) ? "Pointers " . text($eb14) : ""; } // if LS - LE segments loop should be 2110C or 2110D if ($loopid == '2100C' || $loopid == '2110C') { $loopid = '2110C'; if (strpos('|A|B', $sar[1]) !== false) { - $sbr_eb_html .= "" .PHP_EOL; + $sbr_eb_html .= "" .PHP_EOL; } elseif (strpos('|C|G|J|Y', $sar[1]) !== false) { - $sbr_eb_html .= "" .PHP_EOL; + $sbr_eb_html .= "" .PHP_EOL; } elseif (strpos('|E|F|', $sar[1]) !== false) { - $sbr_eb_html .= "" .PHP_EOL; + $sbr_eb_html .= "" .PHP_EOL; } else { - $sbr_eb_html .= "" .PHP_EOL; + $sbr_eb_html .= "" .PHP_EOL; } - $sbr_eb_html .= ($eb09 || $eb10 || $eb11 || $eb12) ? "".PHP_EOL : ""; - $sbr_eb_html .= ($eb13 || $eb14) ? "".PHP_EOL : ""; - $sbr_eb_html .= ($eb05) ? "".PHP_EOL : ""; + $sbr_eb_html .= ($eb09 || $eb10 || $eb11 || $eb12) ? "".PHP_EOL : ""; + $sbr_eb_html .= ($eb13 || $eb14) ? "".PHP_EOL : ""; + $sbr_eb_html .= ($eb05) ? "".PHP_EOL : ""; } elseif ($loopid == '2100D' || $loopid == '2110D') { $loopid = '2110D'; if (strpos('|A|B', $eb01) && !$eb02) { - $dep_eb_html .= "" .PHP_EOL; + $dep_eb_html .= "" .PHP_EOL; } elseif (strpos('|C|G|J|Y', $eb01)) { - $dep_eb_html .= "" .PHP_EOL; + $dep_eb_html .= "" .PHP_EOL; } elseif (strpos('|E|F|', $eb01)) { - $dep_eb_html .= "" .PHP_EOL; + $dep_eb_html .= "" .PHP_EOL; } else { - $dep_eb_html .= "" .PHP_EOL; + $dep_eb_html .= "" .PHP_EOL; } - $dep_eb_html .= ($eb09 || $eb10 || $eb11 || $eb12) ? "".PHP_EOL : ""; - $dep_eb_html .= ($eb13 || $eb14) ? "".PHP_EOL : ""; - $dep_eb_html .= ($eb05) ? "".PHP_EOL : ""; + $dep_eb_html .= ($eb09 || $eb10 || $eb11 || $eb12) ? "".PHP_EOL : ""; + $dep_eb_html .= ($eb13 || $eb14) ? "".PHP_EOL : ""; + $dep_eb_html .= ($eb05) ? "".PHP_EOL : ""; } continue; @@ -440,11 +440,11 @@ function edih_271_transaction_html($obj271, $bht03) $hsd08 = (isset($sar[8]) && $sar[8]) ? $cd271->get_271_code('HSD08', $sar[8]) : ''; // delivery // if ($loopid == '2110C') { - $sbr_eb_html .= "" .PHP_EOL; - $sbr_eb_html .= ($hsd07 || $hsd08) ? "".PHP_EOL : ''; + $sbr_eb_html .= "" .PHP_EOL; + $sbr_eb_html .= ($hsd07 || $hsd08) ? "".PHP_EOL : ''; } elseif ($loopid == '2110D') { - $dep_eb_html .= "" .PHP_EOL; - $dep_eb_html .= ($hsd07 || $hsd08) ? "".PHP_EOL : ''; + $dep_eb_html .= "" .PHP_EOL; + $dep_eb_html .= ($hsd07 || $hsd08) ? "".PHP_EOL : ''; } continue; @@ -458,13 +458,13 @@ function edih_271_transaction_html($obj271, $bht03) $ref03 = (isset($sar[3]) && $sar[3]) ? $sar[3] : ''; // description // if ($loopid == '2100C') { - $sbr_ref_html .= "" .PHP_EOL; + $sbr_ref_html .= "" .PHP_EOL; } elseif ($loopid == '2100D') { - $dep_ref_html .= "" .PHP_EOL; + $dep_ref_html .= "" .PHP_EOL; } elseif ($loopid == '2110C') { - $sbr_eb_html .= "" .PHP_EOL; + $sbr_eb_html .= "" .PHP_EOL; } elseif ($loopid == '2110D') { - $dep_eb_html .= "" .PHP_EOL; + $dep_eb_html .= "" .PHP_EOL; } continue; @@ -474,9 +474,9 @@ function edih_271_transaction_html($obj271, $bht03) $sar = explode($de, $seg); $msg01 = (isset($sar[1]) && $sar[1]) ? $sar[1] : ''; if ($msg01 && $loopid == '2110C') { - $sbr_eb_html .= "" .PHP_EOL; + $sbr_eb_html .= "" .PHP_EOL; } elseif ($msg01 && $loopid == '2110D') { - $dep_eb_html .= "" .PHP_EOL; + $dep_eb_html .= "" .PHP_EOL; } continue; @@ -493,11 +493,11 @@ function edih_271_transaction_html($obj271, $bht03) $iii03 = (isset($sar[3]) && $sar[3]) ? $sar[3] : ''; // if ($loopid == '2110C') { - $sbr_eb_html .= "" .PHP_EOL; - $sbr_eb_html .= ($iii03) ? "" .PHP_EOL : ''; + $sbr_eb_html .= "" .PHP_EOL; + $sbr_eb_html .= ($iii03) ? "" .PHP_EOL : ''; } elseif ($loopid == '2110D') { - $dep_eb_html .= "" .PHP_EOL; - $dep_eb_html .= ($iii03) ? "" .PHP_EOL : ''; + $dep_eb_html .= "" .PHP_EOL; + $dep_eb_html .= ($iii03) ? "" .PHP_EOL : ''; } continue; @@ -548,7 +548,7 @@ function edih_271_transaction_html($obj271, $bht03) // return $str_html; } - + /** * create a display for an individual claim status response * @@ -576,12 +576,12 @@ function edih_271_html($filename, $bht03 = '') $env_ar = $obj271->edih_envelopes(); if (!isset($env_ar['ST'])) { $html_str .= "

edih_271_html: file parse error, envelope error

".PHP_EOL; - $html_str .= $obj271->edih_message(); + $html_str .= text($obj271->edih_message()); return $html_str; } else { $html_str .= "
".PHP_EOL; } - + foreach ($env_ar['ST'] as $st) { foreach ($env_ar['GS'] as $gs) { if ($gs['icn'] != $st['icn']) { @@ -598,8 +598,8 @@ function edih_271_html($filename, $bht03 = '') // // get each transaction foreach ($st['bht03'] as $bht) { - $html_str .= "

$bht Benefit Eligibility

".PHP_EOL; - $html_str .= "
".PHP_EOL; + $html_str .= "

" . text($bht) . " Benefit Eligibility

".PHP_EOL; + $html_str .= "
".PHP_EOL; // $html_str .= edih_271_transaction_html($obj271, $bht); // diff --git a/library/edihistory/edih_277_html.php b/library/edihistory/edih_277_html.php index 8f9d89f17..7265f122f 100644 --- a/library/edihistory/edih_277_html.php +++ b/library/edihistory/edih_277_html.php @@ -1,25 +1,25 @@ - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. - * - * + * + * */ // @@ -51,7 +51,7 @@ function edih_277_transaction_html($obj277, $bht03, $accordion = false) $fn = $obj277->edih_filename(); // if (!is_array($trans) || !count($trans)) { - $str_html = "

Did not find transaction $bht03 in $fn

".PHP_EOL; + $str_html = "

Did not find transaction " . text($bht03) . " in " . attr($fn) . "

".PHP_EOL; return $str_html; } @@ -62,10 +62,10 @@ function edih_277_transaction_html($obj277, $bht03, $accordion = false) $str_html = ""; $hdr_html = ""; // - $hdr_html = "
Eligibility Benefit Response
ReferenceInformation$fn
ReferenceInformation" . text($fn) . "
Reference: $bht03Date: $bht04Type: $bht02$bht01
Reference: " . text($bht03) . "Date: " . text($bht04) . "Type: " . text($bht02) . "" . text($bht01) . "
Rejection:$rej_reason
Rejection:" . text($rej_reason) . "
Rejection:$rej_reason
Rejection:" . text($rej_reason) . "
Rejection:$rej_reason
Rejection:" . text($rej_reason) . "
Rejection:$rej_reason
Rejection:" . text($rej_reason) . "
Rejection:$rej_reason
Rejection:" . text($rej_reason) . "
Rejection:$rej_reason
Rejection:" . text($rej_reason) . "
$loopid Rejection:$rej_reason
$loopid Rejection:" . text($rej_reason) . "
$nm109$name
" . text($nm109) . "" . text($name) . "
$nm109$name
" . text($nm109) . "" . text($name) . "
$nm109$name
" . text($nm109) . "" . text($name) . "
$nm109$name
" . text($nm109) . "" . text($name) . "
>$nm109$descr $name
>" . text($nm109) . "" . text($descr . " " . $name) . "
>$nm109$descr $name
>" . text($nm109) . "" . text($descr . " " . $name) . "
$per02$per04
$per02$per04
>$per04$per02
>" . text($per04) . "" . text($per02) . "
>$per04$per02
>" . text($per04) . "" . text($per02) . "
>$addr
>" . text($addr) . "
>$addr
>" . text($addr) . "
>$addr
>" . text($addr) . "
>$addr
>" . text($addr) . "
>{$sar[1]} {$sar[2]} {$sar[3]}
>" . text($sar[1] . " " . $sar[2] . " " . $sar[3]) . "
>{$sar[1]} {$sar[2]} {$sar[3]}
>" . text($sar[1] . " " . $sar[2] . " " . $sar[3]) . "
>{$sar[1]} {$sar[2]} {$sar[3]}
>" . text($sar[1] . " " . $sar[2] . " " . $sar[3]) . "
>{$sar[1]} {$sar[2]} {$sar[3]}
>" . text($sar[1] . " " . $sar[2] . " " . $sar[3]) . "
{$sar[2]}{$sar[3]}
" . text($sar[2]) . "" . text($sar[3]) . "
{$sar[3]}{$sar[2]}
" . text($sar[3]) . "" . text($sar[2]) . "
{$sar[3]}{$sar[2]}
" . text($sar[3]) . "" . text($sar[2]) . "
>{$sar[3]}{$sar[2]}
>" . text($sar[3]) . "" . text($sar[2]) . "
>{$sar[3]}{$sar[2]}
>" . text($sar[3]) . "" . text($sar[2]) . "
>$dmg03Date of Birth $dmg02
>" . text($dmg03) . "Date of Birth " . text($dmg02) . "
>$dmg03Date of Birth $dmg02
>" . text($dmg03) . "Date of Birth " . text($dmg02) . "
>$ins01 $ins17$ins02$ins03 $ins04
>" . text($ins01 . " " . $ins17) . "" . text($ins02) . "" . text($ins03) . " " . $ins04 . "
>$ins01 $ins17$ins02$ins03 $ins04
>" . text($ins01 . " " . $ins17) . "" . text($ins02) . "" . text($ins03) . " " . $ins04 . "
>$idtype$var
>" . text($idtype) . "" . text($var) . "
>$idtype$var
>" . text($idtype) . "" . text($var) . "
>$idtype$var
>" . text($idtype) . "" . text($var) . "
>$idtype$var
>" . text($idtype) . "" . text($var) . "
$idtype$var
" . text($idtype) . "" . text($var) . "
$idtype$var
" . text($idtype) . "" . text($var) . "
$eb01$eb07 $eb08$eb02 $eb03 $eb04 $eb06
" . text($eb01) . "" . text($eb07 . " " . $eb08) . "" . text($eb02 . " " . $eb03 . " " . $eb04 . " " . $eb06) . "
$eb01$eb02$eb06 $eb07$eb03 $eb04
" . text($eb01) . "" . text($eb02) . "" . text($eb06 . " " . $eb07) . "" . text($eb03 . " " . $eb04) . "
$eb01$eb02$eb03 $eb04 $eb06
" . text($eb01) . "" . text($eb02) . "" . text($eb03 . " " . $eb04 . " " . $eb06) . "
$eb01$eb02$eb07 $eb08 $eb03 $eb04 $eb06
" . text($eb01) . "" . text($eb02) . "" . text($eb07 . " " . $eb08 . " " . $eb03 . " " . $eb04 . " " . $eb06) . "
>$eb09 $eb10 $eb11 $eb12
>$eb13 $eb14
>$eb05
>" . text($eb09 . " " . $eb10 . " " . $eb11 . " " . $eb12) . "
>" . $eb13 . " " . $eb14 . "
>" . text($eb05) . "
$eb01$ebo7 $eb08$eb03 $eb04 $eb06
" . text($eb01) . "" . text($ebo7 . " " . $eb08) . "" . text($eb03 . " " . $eb04 . " " . $eb06) . "
$eb01$eb02$eb07 $eb08$eb11 $eb12
" . text($eb01) . "" . text($eb02) . "" . text($eb07 . " " . $eb08) . "" . text($eb11 . " " . $eb12) . "
$eb01$eb02$eb03 $eb04 $eb06
" . text($eb01) . "" . text($eb02) . "" . text($eb03 . " " . $eb04 . " " . $eb06) . "
$eb01$eb02$eb07 $eb08 $eb03 $eb04 $eb06
" . text($eb01) . "" . text($eb02) . "" . text($eb07 . " " . $eb08 . " " . $eb03 . " " . $eb04 . " " . $eb06) . "
>$eb09 $eb10 $eb11 $eb12
>$eb13 $eb14
>$eb05
>" . text($eb09 . " " . $eb10 . " " . $eb11 . " " . $eb12) . "
>" . $eb13 . " " . $eb14 . "
>" . text($eb05) . "
>$hsd01 : $hsd02$hsd03 : $hsd04$hsd05 : $hsd06
>$hsd07 $hsd08
>" . text($hsd01 . " : " . $hsd02) . "" . text($hsd03 . " : " . $hsd04) . "" . text($hsd05 . " : " . $hsd06) . "
>" . text($hsd07 . " " . $hsd08) . "
>$hsd01 : $hsd02$hsd03 : $hsd04$hsd05 : $hsd06
>$hsd07 $hsd08
>" . text($hsd01 . " : " . $hsd02) . "" . text($hsd03 . " : " . $hsd04) . "" . text($hsd05 . " : " . $hsd06) . "
>" . text($hsd07 . " " . $hsd08) . "
>$ref03$ref01 $ref02
>" . text($ref03) . "" . text($ref01 . " " . $ref02) . "
>$ref03$ref01 $ref02
>" . text($ref03) . "" . text($ref01 . " " . $ref02) . "
>$ref03$ref01 $ref02
>" . text($ref03) . "" . text($ref01 . " " . $ref02) . "
>$ref03$ref01 $ref02
>" . text($ref03) . "" . text($ref01 . " " . $ref02) . "
>$msg01
>" . text($msg01) . "
>$msg01
>" . text($msg01) . "
>$iii02
>$iii03
>" . text($iii02) . "
>" . text($iii03) . "
>$iii02
>$iii03
>" . text($iii02) . "
>" . text($iii03) . "
"; + $hdr_html = "
"; $hdr_html .= "".PHP_EOL; $hdr_html .= "".PHP_EOL; - $hdr_html .= "".PHP_EOL; // + $hdr_html .= "".PHP_EOL; // $hdr_html .= "".PHP_EOL."".PHP_EOL; // $src_html = ""; @@ -82,7 +82,7 @@ function edih_277_transaction_html($obj277, $bht03, $accordion = false) // $idtype = ''; $name = ''; - + $var = ''; $rej_reason = ''; $follow = ''; @@ -111,9 +111,9 @@ function edih_277_transaction_html($obj277, $bht03, $accordion = false) $elem04 = ( isset($sar[4]) && $sar[4]) ? edih_format_date($sar[4]) : ""; $elem06 = ( isset($sar[6]) && $sar[6]) ? $cd27x->get_271_code('BHT06', $sar[6]) : ""; // - $hdr_html .= "".PHP_EOL; - $hdr_html .= "".PHP_EOL; - $hdr_html .= ($elem06) ? "".PHP_EOL : ""; + $hdr_html .= "".PHP_EOL; + $hdr_html .= "".PHP_EOL; + $hdr_html .= ($elem06) ? "".PHP_EOL : ""; // $bht = $elem03; continue; @@ -126,28 +126,28 @@ function edih_277_transaction_html($obj277, $bht03, $accordion = false) if ($elem03 == '20') { // level code $loopid = '2000A'; // info source (payer) $cls = "src"; - $src_html .= "".PHP_EOL; + $src_html .= "".PHP_EOL; } elseif ($elem03 == '21') { $loopid = '2000B'; // info receiver (clinic) $cls = "rcv"; - $rcv_html .= "".PHP_EOL; + $rcv_html .= "".PHP_EOL; } elseif ($elem03 == '19') { $loopid = '2000C'; // provider $cls = "prv"; $has_eb = false; - $prv_html .= "".PHP_EOL; + $prv_html .= "".PHP_EOL; } elseif ($elem03 == '22') { $loopid = '2000D'; // subscriber $cls = "sbr"; - $sbr_nm1_html .= "".PHP_EOL; + $sbr_nm1_html .= "".PHP_EOL; } elseif ($elem03 == 'PT') { $loopid = '2000D'; // patient in 277CA $cls = "sbr"; - $sbr_nm1_html .= "".PHP_EOL; + $sbr_nm1_html .= "".PHP_EOL; } elseif ($elem03 == '23') { $loopid = '2000E'; // dependent $cls = "dep"; - $dep_nm1_html .= "".PHP_EOL; + $dep_nm1_html .= "".PHP_EOL; } else { csv_edihist_log("edih_277_transaction_html: HL segment error $fn"); } @@ -173,25 +173,25 @@ function edih_277_transaction_html($obj277, $bht03, $accordion = false) $nm108 = (isset($sar[8]) && $sar[8] ) ? $cd27x->get_271_code('NM108', $sar[8]) : ""; // if ($loopid == '2000A') { - $src_html .= "" .PHP_EOL; - $src_html .= "" .PHP_EOL; + $src_html .= "" .PHP_EOL; + $src_html .= "" .PHP_EOL; $loopid = '2100A'; } elseif ($loopid == '2000B') { - $rcv_html .= "" .PHP_EOL; - $rcv_html .= "" .PHP_EOL; + $rcv_html .= "" .PHP_EOL; + $rcv_html .= "" .PHP_EOL; $loopid = '2100B'; } elseif ($loopid == '2000C') { - $prv_html .= "" .PHP_EOL; - $prv_html .= "" .PHP_EOL; + $prv_html .= "" .PHP_EOL; + $prv_html .= "" .PHP_EOL; $loopid = '2100C'; } elseif ($loopid == '2000D') { - $sbr_nm1_html .= "" .PHP_EOL; - $sbr_nm1_html .= "" .PHP_EOL; + $sbr_nm1_html .= "" .PHP_EOL; + $sbr_nm1_html .= "" .PHP_EOL; $h3_lbl = $name; $loopid = '2100D'; } elseif ($loopid == '2000E') { - $dep_nm1_html .= "" .PHP_EOL; - $dep_nm1_html .= "" .PHP_EOL; + $dep_nm1_html .= "" .PHP_EOL; + $dep_nm1_html .= "" .PHP_EOL; $h3_lbl = $name; $loopid = '2100E'; } @@ -215,7 +215,7 @@ function edih_277_transaction_html($obj277, $bht03, $accordion = false) $elem09 = (isset($sar[9])) ? $sar[9] : ''; // if ($loopid == '2100A') { - $src_html .= "" .PHP_EOL; + $src_html .= "" .PHP_EOL; } else { csv_edihist_log('edih_277_html: PER segment not in 2100A loop '.$fn); } @@ -234,17 +234,17 @@ function edih_277_transaction_html($obj277, $bht03, $accordion = false) $elem04 = ( isset($sar[4]) ) ? $sar[4] : ''; // if ($loopid == '2100B') { - $rcv_html .= "".PHP_EOL; + $rcv_html .= "".PHP_EOL; $loopid = '2200B'; } elseif ($loopid == '2100C') { - $prv_html .= "".PHP_EOL; + $prv_html .= "".PHP_EOL; $loopid = '2200C'; } elseif ($loopid == '2100D') { - $sbr_stc_html .= "".PHP_EOL; + $sbr_stc_html .= "".PHP_EOL; $h3_lbl = ($h3_lbl) ? $h3_lbl.' '.$elem02 : $h3_lbl; $loopid = '2200D'; } elseif ($loopid == '2100E') { - $dep_stc_html .= "".PHP_EOL; + $dep_stc_html .= "".PHP_EOL; $h3_lbl = ($h3_lbl) ? $h3_lbl.' '.$elem02 : $h3_lbl; $loopid = '2200E'; } @@ -321,17 +321,17 @@ function edih_277_transaction_html($obj277, $bht03, $accordion = false) // $stc12 = ( isset($sar[12]) && $sar[12]) ? $sar[12] : ""; // message // - $stc_html = (isset($sc101)) ? "".PHP_EOL : ""; - $stc_html .= (isset($sc102)) ? "".PHP_EOL : ""; - $stc_html .= (isset($sc103) && $sc103) ? "".PHP_EOL : ""; - $stc_html .= ($stc05 || $stc06 || $stc08 || $stc09) ? "".PHP_EOL : ""; - $stc_html .= (isset($sc201)) ? "".PHP_EOL : ""; - $stc_html .= (isset($sc202)) ? "".PHP_EOL : ""; - $stc_html .= (isset($sc203) && $sc203) ? "".PHP_EOL : ""; - $stc_html .= (isset($sc301)) ? "".PHP_EOL : ""; - $stc_html .= (isset($sc302)) ? "".PHP_EOL : ""; - $stc_html .= (isset($sc303) && $sc303) ? "".PHP_EOL : ""; - $stc_html .= ($stc12) ?"".PHP_EOL : ""; + $stc_html = (isset($sc101)) ? "".PHP_EOL : ""; + $stc_html .= (isset($sc102)) ? "".PHP_EOL : ""; + $stc_html .= (isset($sc103) && $sc103) ? "".PHP_EOL : ""; + $stc_html .= ($stc05 || $stc06 || $stc08 || $stc09) ? "".PHP_EOL : ""; + $stc_html .= (isset($sc201)) ? "".PHP_EOL : ""; + $stc_html .= (isset($sc202)) ? "".PHP_EOL : ""; + $stc_html .= (isset($sc203) && $sc203) ? "".PHP_EOL : ""; + $stc_html .= (isset($sc301)) ? "".PHP_EOL : ""; + $stc_html .= (isset($sc302)) ? "".PHP_EOL : ""; + $stc_html .= (isset($sc303) && $sc303) ? "".PHP_EOL : ""; + $stc_html .= ($stc12) ?"".PHP_EOL : ""; // if ($loopid == '2200B') { $rcv_html .= $stc_html; @@ -366,7 +366,7 @@ function edih_277_transaction_html($obj277, $bht03, $accordion = false) } else { $qtystr = ""; } - + $qtystr .= (isset($sar[2]) && $sar[2]) ? $sar[2] : ""; } @@ -378,13 +378,13 @@ function edih_277_transaction_html($obj277, $bht03, $accordion = false) $amtstr .= (isset($sar[2]) && $sar[2]) ? edih_format_money($sar[2]) : ""; // if ($loopid == '2200B') { - $rcv_html .= "".PHP_EOL; + $rcv_html .= "".PHP_EOL; } elseif ($loopid == '2200C') { - $prv_html .= "".PHP_EOL; + $prv_html .= "".PHP_EOL; } elseif ($loopid == '2200D') { - $sbr_stc_html .= "".PHP_EOL; + $sbr_stc_html .= "".PHP_EOL; } elseif ($loopid == '2200E') { - $dep_stc_html .= "".PHP_EOL; + $dep_stc_html .= "".PHP_EOL; } $amtstr = ''; @@ -403,13 +403,13 @@ function edih_277_transaction_html($obj277, $bht03, $accordion = false) $elem03 = (isset($sar[3])) ? $sar[2] : ''; // if ($loopid == '2200B') { - $rcv_html .= "".PHP_EOL; + $rcv_html .= "".PHP_EOL; } elseif ($loopid == '2200C') { - $prv_html .= "".PHP_EOL; + $prv_html .= "".PHP_EOL; } elseif ($loopid == '2200D' || $loopid == '2220D') { - $sbr_stc_html .= "".PHP_EOL; + $sbr_stc_html .= "".PHP_EOL; } elseif ($loopid == '2200E' || $loopid == '2220E') { - $dep_stc_html .= "".PHP_EOL; + $dep_stc_html .= "".PHP_EOL; } // @@ -436,9 +436,9 @@ function edih_277_transaction_html($obj277, $bht03, $accordion = false) // if ($loopid == '2200D' || $loopid == '2220D') { - $sbr_stc_html .= "" .PHP_EOL; + $sbr_stc_html .= "" .PHP_EOL; } elseif ($loopid == '2200E' || $loopid == '2220E') { - $dep_stc_html .= "" .PHP_EOL; + $dep_stc_html .= "" .PHP_EOL; } // @@ -477,14 +477,14 @@ function edih_277_transaction_html($obj277, $bht03, $accordion = false) $elem07 = (isset($sar[7]) && $sar[7]) ? $sar[7] : ""; // original unis of service // if ($loopid == '2200B') { - $rcv_html .= "".PHP_EOL; - $rcv_html .= ($elem03 || $elem04) ? "".PHP_EOL : ""; + $rcv_html .= "".PHP_EOL; + $rcv_html .= ($elem03 || $elem04) ? "".PHP_EOL : ""; } elseif ($loopid == '2200D' || $loopid == '2220D') { - $sbr_stc_html .= "".PHP_EOL; - $sbr_stc_html .= ($elem03 || $elem04) ? "".PHP_EOL : ""; + $sbr_stc_html .= "".PHP_EOL; + $sbr_stc_html .= ($elem03 || $elem04) ? "".PHP_EOL : ""; } elseif ($loopid == '2200E' || $loopid == '2220E') { - $dep_stc_html .= "".PHP_EOL; - $dep_stc_html .= ($elem03 || $elem04) ? "".PHP_EOL : ""; + $dep_stc_html .= "".PHP_EOL; + $dep_stc_html .= ($elem03 || $elem04) ? "".PHP_EOL : ""; } // @@ -496,8 +496,8 @@ function edih_277_transaction_html($obj277, $bht03, $accordion = false) // if ($accordion) { - $str_html .= "

$bht $h3_lbl

".PHP_EOL; - $str_html .= "
".PHP_EOL; + $str_html .= "

" . text($bht . " " . $h3_lbl) . "

".PHP_EOL; + $str_html .= "
".PHP_EOL; } $str_html .= ($hdr_html) ? $hdr_html : ""; @@ -542,7 +542,7 @@ function edih_277_html($filename, $bht03 = '') $html_str .= "Error, no file given
".PHP_EOL; return $html_str; } - + if ($fn) { $obj277 = csv_check_x12_obj($fn, 'f277'); if ($obj277 && 'edih_x12_file' == get_class($obj277)) { @@ -554,7 +554,7 @@ function edih_277_html($filename, $bht03 = '') $env_ar = $obj277->edih_envelopes(); if (!isset($env_ar['ST'])) { $html_str .= "

edih_277_html: file parse error, envelope error

".PHP_EOL; - $html_str .= $obj277->edih_message(); + $html_str .= text($obj277->edih_message()); return $html_str; } else { $html_str .= "
".PHP_EOL; @@ -586,7 +586,7 @@ function edih_277_html($filename, $bht03 = '') $html_str .= "
".PHP_EOL; } } else { - $html_str .= "

$filename : file parse error

".PHP_EOL; + $html_str .= "

" . text($filename) . " : file parse error

".PHP_EOL; } } else { $html_str .= "Error with file name or file parsing
".PHP_EOL; diff --git a/library/edihistory/edih_278_html.php b/library/edihistory/edih_278_html.php index 8e8f257ad..01ecf4b69 100644 --- a/library/edihistory/edih_278_html.php +++ b/library/edihistory/edih_278_html.php @@ -1,36 +1,36 @@ - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. - * - * + * + * */ // //require_once("$srcdir/edihistory/codes/edih_271_code_class.php"); // /* - * HTML display of x12 278 file + * HTML display of x12 278 file * SV3 and TOO segments (Dental) are ignored - * + * * @uses edih_271_codes() - * + * * @param object edih_x12_file * $param string BHT03 value to identify transaction * @return string @@ -54,8 +54,8 @@ function edih_278_transaction_html($obj278, $bht03) $cls =''; $capstr = 'Services Review (Cert/Auth)'; // - $hdr_html = "
Claim Status
ReferenceInformation$fn
ReferenceInformation" . text($fn) . "
Reference: $elem03Sequence: $elem01
Date: $elem04Type: $elem02
>Type: $elem06
Reference: " . text($elem03) . "Sequence: " . text($elem01) . "
Date: " . text($elem04) . "Type: " . text($elem02) . "
>Type: " . text($elem06) . "
Information Source
Information Source
Information Receiver
Information Receiver
Provider
Provider
Subscriber
Subscriber
Patient
Patient
Dependent
Dependent
>$name
>$nm108 $nm109
>" . text($name) . "
>" . text($nm108) . " " . text($nm109) . "
>$name
>$nm108 $nm109
>" . text($name) . "
>" . text($nm108) . " " . text($nm109) . "
>$name
>$nm108 $nm109
>" . text($name) . "
>" . text($nm108) . " " . text($nm109) . "
>$name
>$nm108 $nm109
>" . text($name) . "
>" . text($nm108) . " " . text($nm109) . "
>$name
>$nm108 $nm109
>" . text($name) . "
>" . text($nm108) . " " . text($nm109) . "
$elem02$elem04 $elem06 $elem08
" . text($elem02) . "" . text($elem04 . " " . $elem06 . " " . $elem08) . "
>$elem01 $elem02
>" . text($elem01) . " " . text($elem02) . "
>$elem01 $elem02
>" . text($elem01) . " " . text($elem02) . "
>$elem01 $elem02
>" . text($elem01) . " " . text($elem02) . "
>$elem01 $elem02
>" . text($elem01) . " " . text($elem02) . "
$stc03$sc101$stc02 $stc04
>$sc102
>Entity $sc103
Payment$stc05 $stc06 $stc08 $stc09
>$sc201 $sc204
>$sc202
>Entity $sc203
>$sc301 $sc304
>$sc302
>Entity $sc303
Message$stc12
" . text($stc03) . "" . text($sc101) . "" . text($stc02 . " " . $stc04) . "
>" . text($sc102) . "
>Entity " . text($sc103) . "
Payment" . text($stc05 . " " . $stc06 . " " . $stc08 . " " . $stc09) . "
>" . text($sc201 . " " . $sc204) . "
>" . text($sc202) . "
>Entity " . text($sc203) . "
>" . text($sc301 . " " . $sc304) . "
>" . text($sc302) . "
>Entity " . text($sc303) . "
Message" . text($stc12) . "
>$qtystr $amtstr
>" . text($qtystr . " " . $amtstr) . "
>$qtystr $amtstr
>" . text($qtystr . " " . $amtstr) . "
>$qtystr $amtstr
>" . text($qtystr . " " . $amtstr) . "
>$qtystr $amtstr
>" . text($qtystr . " " . $amtstr) . "
>$elem01 $elem02$elem03
>" . text($elem01) . " " . text($elem02) . "" . text($elem03) . "
>$elem01 $elem02$elem03
>" . text($elem01) . " " . text($elem02) . "" . text($elem03) . "
>$elem01 $elem02$elem03
>" . text($elem01) . " " . text($elem02) . "" . text($elem03) . "
>$elem01 $elem02$elem03
>" . text($elem01) . " " . text($elem02) . "" . text($elem03) . "
>$elem01$var
>" . text($elem01) . "" . text($var) . "
>$elem01$var
>" . text($elem01) . "" . text($var) . "
Service$elem01$elem02$elem04
>$elem03 $elem04
Service" . text($elem01) . "" . text($elem02) . "" . text($elem04) . "
>" . text($elem03 . " " . $elem04) . "
Service$elem01$elem02 $elem04
>$elem03 $elem04
Service" . text($elem01) . "" . text($elem02 . " " . $elem04) . "
>" . text($elem03 . " " . $elem04) . "
Service$elem01$elem02 $elem04
>$elem03 $elem04
Service" . text($elem01) . "" . text($elem02 . " " . $elem04) . "
>" . text($elem03 . " " . $elem04) . "
"; - $hdr_html .= "".PHP_EOL; + $hdr_html = "
$capstr
ReferenceInformation$fn
"; + $hdr_html .= "".PHP_EOL; $hdr_html .= "".PHP_EOL; $str_html = ""; $src_html = ""; @@ -89,11 +89,11 @@ function edih_278_transaction_html($obj278, $bht03) // $elem06 = (isset($sar[6]) && $sar[6]) ? $cd27x->get_271_code('BHT06', $sar[6]) : ""; // - $hdr_html .= "".PHP_EOL; + $hdr_html .= "".PHP_EOL; if ($elem06) { - $hdr_html .= "".PHP_EOL; + $hdr_html .= "".PHP_EOL; } else { - $hdr_html .= "".PHP_EOL; + $hdr_html .= "".PHP_EOL; } // @@ -110,27 +110,27 @@ function edih_278_transaction_html($obj278, $bht03) if ($sar[3] == '20') { // level code $loopid = '2000A'; $cls = 'src'; // info source (payer) - $src_html .= "".PHP_EOL; + $src_html .= "".PHP_EOL; } elseif ($sar[3] == '21') { $loopid = '2000B'; $cls = 'rcv'; // info receiver (clinic) - $rcv_html .= "".PHP_EOL; + $rcv_html .= "".PHP_EOL; } elseif ($sar[3] == '22') { $loopid = '2000C'; // subscriber $cls = 'sbr'; - $sbr_nm1_html .= "".PHP_EOL; + $sbr_nm1_html .= "".PHP_EOL; } elseif ($sar[3] == '23') { $loopid = '2000D'; // dependent $cls = 'dep'; - $dep_nm1_html .= "".PHP_EOL; + $dep_nm1_html .= "".PHP_EOL; } elseif ($sar[3] == 'EV') { $loopid = '2000E'; // patient event $cls = 'evt'; - $evt_html .= "".PHP_EOL; + $evt_html .= "".PHP_EOL; } elseif ($sar[3] == 'SS') { $loopid = '2000F'; // service $cls = 'svc'; - $svc_html .= "".PHP_EOL; + $svc_html .= "".PHP_EOL; } // @@ -152,26 +152,26 @@ function edih_278_transaction_html($obj278, $bht03) $idtype = (isset($sar[8]) && $sar[8] ) ? $cd27x->get_271_code('NM108', $sar[8]) : ""; // if ($loopid == '2000A') { - $src_html .= "" .PHP_EOL; + $src_html .= "" .PHP_EOL; $loopid = '2010A'; } elseif ($loopid == '2000B') { - $rcv_html .= "" .PHP_EOL; + $rcv_html .= "" .PHP_EOL; $loopid = '2010B'; } elseif ($loopid == '2000C') { - $sbr_nm1_html .= "" .PHP_EOL; + $sbr_nm1_html .= "" .PHP_EOL; $loopid = '2010C'; } elseif ($loopid == '2000D') { - $dep_nm1_html .= "" .PHP_EOL; + $dep_nm1_html .= "" .PHP_EOL; $loopid = '2010D'; } elseif ($loopid == '2000E' || strpos($loopid, '010E')) { $loopid = (strpos('|71|72|73|77|AAJ|DD|DK|DN|FA|G3|P3|QB|QV|SJ', $nm101) ) ? '2010EA' : $loopid; $loopid = (strpos('|45|FS|ND|PW|R3', $nm101) ) ? '2010EB' : $loopid; $loopid = ($nm101 == 'L5') ? '2010EC' : $loopid; - $evt_html .= "" .PHP_EOL; + $evt_html .= "" .PHP_EOL; } elseif ($loopid == '2000F' || strpos($loopid, '010F')) { $loopid = (strpos('|71|72|73|77|AAJ|DD|DK|DN|FA|G3|P3|QB|QV|SJ', $nm101) ) ? '2010FA' : $loopid; $loopid = ($nm101 == 'L5') ? '2010FB' : $loopid; - $svc_html .= "" .PHP_EOL; + $svc_html .= "" .PHP_EOL; } // @@ -185,15 +185,15 @@ function edih_278_transaction_html($obj278, $bht03) $addr .= (isset($sar[2])) ? " {$sar[2]}" : ""; // if ($loopid == '2010B') { - $rcv_html .= "" .PHP_EOL; + $rcv_html .= "" .PHP_EOL; } elseif ($loopid == '2010C') { - $sbr_nm1_html .= "" .PHP_EOL; + $sbr_nm1_html .= "" .PHP_EOL; } elseif ($loopid == '2010D') { - $dep_nm1_html .= "" .PHP_EOL; + $dep_nm1_html .= "" .PHP_EOL; } elseif ($loopid == '2010EA' || $loopid == '2010EC') { - $evt_html .= "" .PHP_EOL; + $evt_html .= "" .PHP_EOL; } elseif ($loopid == '2010FA') { - $svc_html .= "" .PHP_EOL; + $svc_html .= "" .PHP_EOL; } continue; @@ -203,15 +203,15 @@ function edih_278_transaction_html($obj278, $bht03) if (strncmp('N4'.$de, $seg, 3) === 0) { $sar = explode($de, $seg); if ($loopid == '2010B') { - $rcv_html .= "" .PHP_EOL; + $rcv_html .= "" .PHP_EOL; } elseif ($loopid == '2010C') { - $sbr_nm1_html .= "" .PHP_EOL; + $sbr_nm1_html .= "" .PHP_EOL; } elseif ($loopid == '2010D') { - $dep_nm1_html .= "" .PHP_EOL; + $dep_nm1_html .= "" .PHP_EOL; } elseif ($loopid == '2010EA' || $loopid == '2010EC') { - $evt_html .= "" .PHP_EOL; + $evt_html .= "" .PHP_EOL; } elseif ($loopid == '2010FA' || $loopid == '2010FB') { - $svc_html .= "" .PHP_EOL; + $svc_html .= "" .PHP_EOL; } continue; @@ -229,16 +229,16 @@ function edih_278_transaction_html($obj278, $bht03) $elem07 = (isset($sar[7])) ? $cd27x->get_271_code('PER03', $sar[7]) : ""; $elem08 = (isset($sar[8])) ? $sar[8] : ''; $elem09 = (isset($sar[9])) ? $sar[9] : ''; - + $idtype = ($sar[3]) ? $cd27x->get_271_code('PER03', $sar[3]) : ""; if ($loopid == '2010A') { - $src_html .= "" .PHP_EOL; + $src_html .= "" .PHP_EOL; } elseif ($loopid == '2010B') { - $rcv_html .= "" .PHP_EOL; + $rcv_html .= "" .PHP_EOL; } elseif ($loopid == '2010EA') { - $evt_html .= "" .PHP_EOL; + $evt_html .= "" .PHP_EOL; } elseif ($loopid == '2010FA') { - $svc_html .="" .PHP_EOL; + $svc_html .="" .PHP_EOL; } // @@ -252,27 +252,27 @@ function edih_278_transaction_html($obj278, $bht03) $rej_reason = $cd27x->get_271_code('AAA03', $sar[3]); $follow = $cd27x->get_271_code('AAA04', $sar[4]); if ($loopid == '2000A') { - $src_html .= "" .PHP_EOL; + $src_html .= "" .PHP_EOL; } elseif ($loopid == '2010A') { - $src_html .= "" .PHP_EOL; + $src_html .= "" .PHP_EOL; } elseif ($loopid == '2000B') { - $rcv_html .= "" .PHP_EOL; + $rcv_html .= "" .PHP_EOL; } elseif ($loopid == '2010B') { - $sbr_eb_html .= "" .PHP_EOL; + $sbr_eb_html .= "" .PHP_EOL; } elseif ($loopid == '2000C') { - $sbr_nm1_html .= "" .PHP_EOL; + $sbr_nm1_html .= "" .PHP_EOL; } elseif ($loopid == '2010C') { - $sbr_eb_html .= "" .PHP_EOL; + $sbr_eb_html .= "" .PHP_EOL; } elseif ($loopid == '2000D') { - $dep_nm1_html .= "" .PHP_EOL; + $dep_nm1_html .= "" .PHP_EOL; } elseif ($loopid == '2010D') { - $dep_eb_html .= "" .PHP_EOL; + $dep_eb_html .= "" .PHP_EOL; } elseif ($loopid == '2010EA' || $loopid == '2010EC') { - $evt_html .= "" .PHP_EOL; + $evt_html .= "" .PHP_EOL; } elseif ($loopid == '2010FA') { - $svc_html .= "" .PHP_EOL; + $svc_html .= "" .PHP_EOL; } else { - $hdr_html .= "" .PHP_EOL; + $hdr_html .= "" .PHP_EOL; } continue; @@ -289,9 +289,9 @@ function edih_278_transaction_html($obj278, $bht03) // $trctp = ($elem01 == '2') ? 'Reference ' : 'Current '; if ($loopid == '2000E') { - $evt_html .= "" .PHP_EOL; + $evt_html .= "" .PHP_EOL; } elseif ($loopid == '2000F') { - $svc_html .= "" .PHP_EOL; + $svc_html .= "" .PHP_EOL; } continue; @@ -337,11 +337,11 @@ function edih_278_transaction_html($obj278, $bht03) //$elem08 = (isset($sar[8])) ? $cd27x->get_271_code('UM08', $sar[8]) : ''; // if ($loopid == '2000E') { - $evt_html .= "".PHP_EOL; - $evt_html .= ($elem03 || $elem04a || $elem06) ? "".PHP_EOL : ""; + $evt_html .= "".PHP_EOL; + $evt_html .= ($elem03 || $elem04a || $elem06) ? "".PHP_EOL : ""; } elseif ($loopid == '2000F') { - $svc_html .= "".PHP_EOL; - $svc_html .= ($elem03 || $elem04a || $elem06) ? "".PHP_EOL : ""; + $svc_html .= "".PHP_EOL; + $svc_html .= ($elem03 || $elem04a || $elem06) ? "".PHP_EOL : ""; } continue; @@ -360,13 +360,13 @@ function edih_278_transaction_html($obj278, $bht03) } // if ($loopid == '2000E') { - $evt_html .= "".PHP_EOL; - $evt_html .= "".PHP_EOL; - $evt_html .= ($elem04) ? "".PHP_EOL : ""; + $evt_html .= "".PHP_EOL; + $evt_html .= "".PHP_EOL; + $evt_html .= ($elem04) ? "".PHP_EOL : ""; } elseif ($loopid == '2000F') { - $svc_html .= "".PHP_EOL; - $svc_html .= "".PHP_EOL; - $svc_html .= ($elem04) ? "".PHP_EOL : ""; + $svc_html .= "".PHP_EOL; + $svc_html .= "".PHP_EOL; + $svc_html .= ($elem04) ? "".PHP_EOL : ""; } // @@ -383,19 +383,19 @@ function edih_278_transaction_html($obj278, $bht03) $elem03 = (isset($sar[3])) ? $sar[2] : ''; // if ($loopid == '2010B') { - $rcv_html .= "".PHP_EOL; + $rcv_html .= "".PHP_EOL; } elseif ($loopid == '2010C') { - $sbr_nm1_html .= "".PHP_EOL; + $sbr_nm1_html .= "".PHP_EOL; } elseif ($loopid == '2010D') { - $dep_nm1_html .= "".PHP_EOL; + $dep_nm1_html .= "".PHP_EOL; } elseif ($loopid == '2000E') { - $evt_html .= "".PHP_EOL; + $evt_html .= "".PHP_EOL; } elseif ($loopid == '2010E') { - $evt_html .= "".PHP_EOL; + $evt_html .= "".PHP_EOL; } elseif ($loopid == '2000F') { - $svc_html .= "".PHP_EOL; + $svc_html .= "".PHP_EOL; } elseif ($loopid == '2010FA') { - $svc_html .= "".PHP_EOL; + $svc_html .= "".PHP_EOL; } // @@ -417,9 +417,9 @@ function edih_278_transaction_html($obj278, $bht03) } if ($loopid == '2010C') { - $sbr_nm1_html .= "" .PHP_EOL; + $sbr_nm1_html .= "" .PHP_EOL; } elseif ($loopid == '2010D') { - $dep_nm1_html .= "" .PHP_EOL; + $dep_nm1_html .= "" .PHP_EOL; } continue; @@ -435,9 +435,9 @@ function edih_278_transaction_html($obj278, $bht03) $elem17 = (isset($sar[17]) && $sar[17]) ? $sar[17] : ""; // if ($loopid == '2010C') { - $sbr_nm1_html .= "" .PHP_EOL; + $sbr_nm1_html .= "" .PHP_EOL; } elseif ($loopid == '2010D') { - $dep_nm1_html .= "" .PHP_EOL; + $dep_nm1_html .= "" .PHP_EOL; } continue; @@ -461,9 +461,9 @@ function edih_278_transaction_html($obj278, $bht03) } if ($loopid == '2000E') { - $evt_html .= "" .PHP_EOL; + $evt_html .= "" .PHP_EOL; } elseif ($loopid == '2000F') { - $svc_html .= "" .PHP_EOL; + $svc_html .= "" .PHP_EOL; } continue; @@ -494,7 +494,7 @@ function edih_278_transaction_html($obj278, $bht03) $hi_str .= $hi.' '; } - $tr_str .= "".PHP_EOL; + $tr_str .= "".PHP_EOL; } // @@ -525,12 +525,12 @@ function edih_278_transaction_html($obj278, $bht03) $elem08 = (isset($sar[8]) && $sar[8]) ? $cd27x->get_271_code('HSD08', $sar[8]) : ''; // delivery // if (($elem01 || $elem02) && !$elem08) { - $tr_str .= ($elem03 && $elem04 && $elem06) ? "".PHP_EOL : ""; - $tr_str .= ($elem03 && $elem04 && !$elem06) ? "".PHP_EOL : ""; - $tr_str .= ($elem03 && !$elem04 && $elem06) ? "".PHP_EOL : ""; - $tr_str .= ($elem03 && !$elem04 && !$elem06) ? "".PHP_EOL : ""; + $tr_str .= ($elem03 && $elem04 && $elem06) ? "".PHP_EOL : ""; + $tr_str .= ($elem03 && $elem04 && !$elem06) ? "".PHP_EOL : ""; + $tr_str .= ($elem03 && !$elem04 && $elem06) ? "".PHP_EOL : ""; + $tr_str .= ($elem03 && !$elem04 && !$elem06) ? "".PHP_EOL : ""; } else { - $tr_str .= "" .PHP_EOL; + $tr_str .= "" .PHP_EOL; } // @@ -556,12 +556,12 @@ function edih_278_transaction_html($obj278, $bht03) $elem06 = (isset($sar[6]) && $sar[6]) ? $cd27x->get_271_code('CRC03', $sar[6]) : ''; // condition descripter $elem07 = (isset($sar[7]) && $sar[7]) ? $cd27x->get_271_code('CRC03', $sar[7]) : ''; // condition descripter // - $evt_html .= ($elem01) ? "".PHP_EOL : ""; - $evt_html .= ($elem03) ? "".PHP_EOL : ""; - $evt_html .= ($elem04) ? "".PHP_EOL : ""; - $evt_html .= ($elem05) ? "".PHP_EOL : ""; - $evt_html .= ($elem06) ? "".PHP_EOL : ""; - $evt_html .= ($elem07) ? "".PHP_EOL : ""; + $evt_html .= ($elem01) ? "".PHP_EOL : ""; + $evt_html .= ($elem03) ? "".PHP_EOL : ""; + $evt_html .= ($elem04) ? "".PHP_EOL : ""; + $evt_html .= ($elem05) ? "".PHP_EOL : ""; + $evt_html .= ($elem06) ? "".PHP_EOL : ""; + $evt_html .= ($elem07) ? "".PHP_EOL : ""; // continue; } @@ -576,8 +576,8 @@ function edih_278_transaction_html($obj278, $bht03) $elem02 = (isset($sar[2]) && $sar[2]) ? $cd27x->get_271_code('CL102', $sar[2]) : ''; // admission source code $elem03 = (isset($sar[3]) && $sar[3]) ? $cd27x->get_271_code('CL103', $sar[3]) : ''; // patient status code // - $tr_str .= "".PHP_EOL; - $tr_str .= ($elem03) ? "".PHP_EOL : ""; + $tr_str .= "".PHP_EOL; + $tr_str .= ($elem03) ? "".PHP_EOL : ""; // if ($loopid == '2000E') { $evt_html .= $tr_str; @@ -608,7 +608,7 @@ function edih_278_transaction_html($obj278, $bht03) $elem06 = (isset($sar[6])) ? $sar[6] : ""; // - $evt_html .= "".PHP_EOL; + $evt_html .= "".PHP_EOL; // continue; } @@ -625,7 +625,7 @@ function edih_278_transaction_html($obj278, $bht03) $elem04 = ($elem04) ? "-- ".$elem04 : ""; // elem05 -- elem12 not used // - $evt_html .= "".PHP_EOL; + $evt_html .= "".PHP_EOL; // continue; } @@ -649,14 +649,14 @@ function edih_278_transaction_html($obj278, $bht03) $title = "Descriptors and Rates/times per edi guide. Do not rely on these!".PHP_EOL; $t2 = "Descriptors per edi companion guide. Do not rely on these!".PHP_EOL; // - $tr_str .= "".PHP_EOL; - $tr_str .= "".PHP_EOL; - $tr_str .= ($elem03 || $elem04 ) ? "".PHP_EOL : ""; - $tr_str .= ($elem06 || $elem07 || $elem08) ? "".PHP_EOL : ""; - $tr_str .= ($elem09) ? "".PHP_EOL : ""; - $tr_str .= ($elem16) ? "".PHP_EOL : ""; - $tr_str .= ($elem17) ? "".PHP_EOL : ""; - $tr_str .= ($elem18) ? "".PHP_EOL : ""; + $tr_str .= "".PHP_EOL; + $tr_str .= "".PHP_EOL; + $tr_str .= ($elem03 || $elem04 ) ? "".PHP_EOL : ""; + $tr_str .= ($elem06 || $elem07 || $elem08) ? "".PHP_EOL : ""; + $tr_str .= ($elem09) ? "".PHP_EOL : ""; + $tr_str .= ($elem16) ? "".PHP_EOL : ""; + $tr_str .= ($elem17) ? "".PHP_EOL : ""; + $tr_str .= ($elem18) ? "".PHP_EOL : ""; // $evt_html .= $tr_str; // @@ -682,9 +682,9 @@ function edih_278_transaction_html($obj278, $bht03) $elem07 = (isset($sar[7]) && $sar[7]) ? $cd27x->get_271_code('HCR04', $sar[8]) : ""; $elem08 = (isset($sar[8]) && $sar[8]) ? $cd27x->get_271_code('CR608', $sar[8]) : ""; // certification type code // - $evt_html .= "".PHP_EOL; - $evt_html .= ($elem03 || $elem04) ? "".PHP_EOL : ""; - $evt_html .= ($elem08) ? "".PHP_EOL : ""; + $evt_html .= "".PHP_EOL; + $evt_html .= ($elem03 || $elem04) ? "".PHP_EOL : ""; + $evt_html .= ($elem08) ? "".PHP_EOL : ""; // continue; } @@ -702,9 +702,9 @@ function edih_278_transaction_html($obj278, $bht03) $elem06 = (isset($sar[6]) && $sar[6]) ? $sar[6] : ""; $elem07 = (isset($sar[7]) && $sar[7]) ? $sar[7] : ""; // - $tr_str .= "".PHP_EOL; - $tr_str .= ($elem05) ? "".PHP_EOL : ""; - $tr_str .= ($elem07) ? "".PHP_EOL : ""; + $tr_str .= "".PHP_EOL; + $tr_str .= ($elem05) ? "".PHP_EOL : ""; + $tr_str .= ($elem07) ? "".PHP_EOL : ""; // if ($loopid == '2000E') { $evt_html .= $tr_str; @@ -723,9 +723,9 @@ function edih_278_transaction_html($obj278, $bht03) $elem01 = (isset($sar[1]) && $sar[1]) ? $sar[1] : ""; // if ($loopid == '2000E') { - $evt_html .= ($elem01) ? "".PHP_EOL : ""; + $evt_html .= ($elem01) ? "".PHP_EOL : ""; } elseif ($loopid == '2000F') { - $svc_html .= ($elem01) ? "".PHP_EOL : ""; + $svc_html .= ($elem01) ? "".PHP_EOL : ""; } continue; @@ -749,7 +749,7 @@ function edih_278_transaction_html($obj278, $bht03) } else { $elem01 .= " ".$ar01[1]; } - + if ($elem01 && $ct > 2) { for ($i=2; $i<$ct; $i++) { @@ -768,8 +768,8 @@ function edih_278_transaction_html($obj278, $bht03) // $elem11 = ($elem11) ? "EPSDT ".$elem11 : ""; // - $svc_html .= ($elem01) ? "".PHP_EOL : ""; - $svc_html .= ($elem03 ||$elem04 || $elem11) ? "".PHP_EOL : ""; + $svc_html .= ($elem01) ? "".PHP_EOL : ""; + $svc_html .= ($elem03 ||$elem04 || $elem11) ? "".PHP_EOL : ""; $svc_html .= ($elem20) ? "".PHP_EOL : ""; // continue; @@ -793,7 +793,7 @@ function edih_278_transaction_html($obj278, $bht03) } else { $elem01 .= " ".$ar01[1]; } - + if ($elem01 && count($ar01) > 2) { for ($i=2; $i<$ct; $i++) { @@ -811,9 +811,9 @@ function edih_278_transaction_html($obj278, $bht03) $elem06 = (isset($sar[6]) && $sar[6]) ? edih_format_money($sar[6]) : ""; $elem10 = (isset($sar[20]) && $sar[20]) ? $cd27x->get_271_code('SV120', $ar01[20]) : ""; // - $svc_html .= ($elem01) ? "".PHP_EOL : ""; - $svc_html .= ($elem03 ||$elem04) ? "".PHP_EOL : ""; - $svc_html .= ($elem10) ? "".PHP_EOL : ""; + $svc_html .= ($elem01) ? "".PHP_EOL : ""; + $svc_html .= ($elem03 ||$elem04) ? "".PHP_EOL : ""; + $svc_html .= ($elem10) ? "".PHP_EOL : ""; // continue; } @@ -834,7 +834,7 @@ function edih_278_transaction_html($obj278, $bht03) // return $str_html; } - + /** * create a display for an individual authorization response * @@ -866,7 +866,7 @@ function edih_278_html($filename, $bht03 = '') $env_ar = $obj278->edih_envelopes(); if (!isset($env_ar['ST'])) { $html_str .= "

edih_278_html: file parse error, envelope error

".PHP_EOL; - $html_str .= $obj278->edih_message(); + $html_str .= text($obj278->edih_message()); return $html_str; } else { $html_str .= "
".PHP_EOL; @@ -888,8 +888,8 @@ function edih_278_html($filename, $bht03 = '') // // get each transaction foreach ($st['bht03'] as $bht) { - $html_str .= "

$bht Services Review

".PHP_EOL; - $html_str .= "
".PHP_EOL; + $html_str .= "

" . text($bht) . " Services Review

".PHP_EOL; + $html_str .= "
".PHP_EOL; // $html_str .= edih_278_transaction_html($obj278, $bht); // diff --git a/library/edihistory/edih_835_html.php b/library/edihistory/edih_835_html.php index bb0ce3bb7..0a1e87613 100644 --- a/library/edihistory/edih_835_html.php +++ b/library/edihistory/edih_835_html.php @@ -1,28 +1,28 @@ - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. - * - * + * + * */ - + // lookup codes //require_once("$srcdir/edihistory/codes/edih_835_code_class.php"); //require_once("$srcdir/edihistory/codes/edih_271_code_class.php"); @@ -104,7 +104,7 @@ function edih_835_clp_summary($trans_array, $codes27x, $codes835, $delimiters, $ $capstr = ""; $mia_str = ""; // - $hdr_html = "
".PHP_EOL; + $hdr_html = "".PHP_EOL; $hdr_html .= "".PHP_EOL."".PHP_EOL; $clp_html = ""; $svc_html = ""; @@ -147,29 +147,29 @@ function edih_835_clp_summary($trans_array, $codes27x, $codes835, $delimiters, $ $clp02 = $cd835->get_835_code('CLAIM_STATUS', $v); break; case 3: - $clp03 = ($v) ? "Fee: ".edih_format_money($v) : "0"; + $clp03 = ($v) ? "Fee: " . text(edih_format_money($v)) : "0"; break; case 4: - $clp04 = ($v) ? "Pmt: ".edih_format_money($v) : "0"; + $clp04 = ($v) ? "Pmt: " . text(edih_format_money($v)) : "0"; break; case 5: - $clp05 = ($v) ? "PtRsp: ".edih_format_money($v) : "0"; + $clp05 = ($v) ? "PtRsp: " . text(edih_format_money($v)) : "0"; break; case 7: - $clp07 = ($v) ? "PR Ref: ".$v : ""; + $clp07 = ($v) ? "PR Ref: " . text($v) : ""; break; case 8: - $clp08 = ($v) ? "Location ".$cd27x->get_271_code('POS', $v) : ''; + $clp08 = ($v) ? "Location " . text($cd27x->get_271_code('POS', $v)) : ''; break; case 9: - $clp09 = ($v && isset($clp09ar[$v])) ? "Freq ".$clp09ar[$v] : $v; + $clp09 = ($v && isset($clp09ar[$v])) ? "Freq " . text($clp09ar[$v]) : text($v); } } // - $clp_html .= "".PHP_EOL; - $clp_html .= "".PHP_EOL; - $clp_html .= ($clp08 || $clp09) ? "".PHP_EOL : ""; + $clp_html .= "".PHP_EOL; + $clp_html .= "".PHP_EOL; + $clp_html .= ($clp08 || $clp09) ? "".PHP_EOL : ""; // continue; // @@ -183,7 +183,7 @@ function edih_835_clp_summary($trans_array, $codes27x, $codes835, $delimiters, $ $amt01 = (isset($sar[1]) && $sar[1]) ? $cd835->get_835_code('AMT', $sar[1]) : ""; $amt02 = (isset($sar[2]) && $sar[2]) ? edih_format_money($sar[2]) : ""; // - $clp_html .= ($amt01) ? "".PHP_EOL : ""; + $clp_html .= ($amt01) ? "".PHP_EOL : ""; // continue; } @@ -197,13 +197,13 @@ function edih_835_clp_summary($trans_array, $codes27x, $codes835, $delimiters, $ $qty02 = (isset($sar[2]) && $sar[2]) ? edih_format_money($sar[2]) : ""; // if ($loopid == '2100') { - $clp_html .= ($qty01) ? "".PHP_EOL : ""; + $clp_html .= ($qty01) ? "".PHP_EOL : ""; } // continue; } - + if (strncmp('NM1'.$de, $seg, 4) === 0) { $sar = explode($de, $seg); // @@ -224,9 +224,9 @@ function edih_835_clp_summary($trans_array, $codes27x, $codes835, $delimiters, $ // if ($nm108) { - $sbr_html .= "" .PHP_EOL; + $sbr_html .= "" .PHP_EOL; } else { - $sbr_html .= "" .PHP_EOL; + $sbr_html .= "" .PHP_EOL; } // @@ -277,7 +277,7 @@ function edih_835_clp_summary($trans_array, $codes27x, $codes835, $delimiters, $ } } - $clp_html .= ($cas_str) ? "".PHP_EOL : ""; + $clp_html .= ($cas_str) ? "".PHP_EOL : ""; // continue; } @@ -285,7 +285,7 @@ function edih_835_clp_summary($trans_array, $codes27x, $codes835, $delimiters, $ } // - $str_html .= "
" . text($capstr) . "
ReferenceInformation" . text($fn) . "
Transaction ID: $elem03 Sequence: $elem01
Transaction ID: " . text($elem03) . " Sequence: " . text($elem01) . "
Transaction Date: $elem04 $elem02 Type: $elem06
Transaction Date: " . text($elem04) . " " . text($elem02) . " Type: " . text($elem06) . "
Transaction Date: $elem04 Type: $elem02
Transaction Date: " . text($elem04) . " Type: " . text($elem02) . "
Information Source
Information Source
Information Receiver
Information Receiver
Subscriber
Subscriber
Dependent
Dependent
Patient Event
Patient Event
Service
Service
$nm109$name
" . text($nm109) . "" . text($name) . "
$nm109$name
" . text($nm109) . "" . text($name) . "
$nm109$name
" . text($nm109) . "" . text($name) . "
$nm109$name
" . text($nm109) . "" . text($name) . "
$nm109$descr $name
" . text($nm109) . "" . text($descr . " " . $name) . "
$nm109$descr $name
" . text($nm109) . "" . text($descr . " " . $name) . "
>$addr
>" . text($addr) . "
>$addr
>" . text($addr) . "
>$addr
>" . text($addr) . "
>$addr
>" . text($addr) . "
>$addr
>" . text($addr) . "
>{$sar[1]} {$sar[2]} {$sar[3]}
>" . text($sar[1] . " " . $sar[2] . " " . $sar[3]) . "
>{$sar[1]} {$sar[2]} {$sar[3]}
>" . text($sar[1] . " " . $sar[2] . " " . $sar[3]) . "
>{$sar[1]} {$sar[2]} {$sar[3]}
>" . text($sar[1] . " " . $sar[2] . " " . $sar[3]) . "
>{$sar[1]} {$sar[2]} {$sar[3]}
>" . text($sar[1] . " " . $sar[2] . " " . $sar[3]) . "
>{$sar[1]} {$sar[2]} {$sar[3]}
>" . text($sar[1] . " " . $sar[2] . " " . $sar[3]) . "
$elem02$elem04 $elem06 $elem08
" . text($elem02) . "" . text($elem04 . " " . $elem06 . " " . $elem08) . "
$elem02$elem04 $elem06 $elem08
" . text($elem02) . "" . text($elem04 . " " . $elem06 . " " . $elem08) . "
$elem02$elem04 $elem06 $elem08
" . text($elem02) . "" . text($elem04 . " " . $elem06 . " " . $elem08) . "
$elem02$elem04 $elem06 $elem08
" . text($elem02) . "" . text($elem04 . " " . $elem06 . " " . $elem08) . "
Rejection:$rej_reason
Rejection:" . text($rej_reason) . "
Rejection:$rej_reason
Rejection:" . text($rej_reason) . "
Rejection:$rej_reason
Rejection:" . text($rej_reason) . "
Rejection:$rej_reason
Rejection:" . text($rej_reason) . "
Rejection:$rej_reason
Rejection:" . text($rej_reason) . "
Rejection:$rej_reason
Rejection:" . text($rej_reason) . "
Rejection:$rej_reason
Rejection:" . text($rej_reason) . "
Rejection:$rej_reason
Rejection:" . text($rej_reason) . "
Rejection:$rej_reason
Rejection:" . text($rej_reason) . "
Rejection:$rej_reason
Rejection:" . text($rej_reason) . "
$loopid Rejection:$rej_reason
" . text($loopid) . " Rejection:" . text($rej_reason) . "
>$trctp tracking no: $elem02 (by $elem03 $elem04)
>" . text($trctp) . " tracking no: " . text($elem02) . " (by " . text($elem03 . " " . $elem04) . ")
>$trctp tracking no: $elem02 (by $elem03 $elem04)
>" . text($trctp) . " tracking no: " . text($elem02) . " (by " . text($elem03 . " " . $elem04) . ")
>$elem01 Certification Type: $elem02
>$elem03 $elem04a ($elem06)
>" . text($elem01) . " Certification Type: " . text($elem02) . "
>" . text($elem03 . " " . $elem04a) . " (" . text($elem06) . ")
>$elem01 Certification Type: $elem02
>$elem03 $elem04a ($elem06)
>" . text($elem01) . " Certification Type: " . text($elem02) . "
>" . text($elem03 . " " . $elem04a) . " (" . text($elem06) . ")
>$elem01 $elem02
>$elem03
>$elem04
>" . text($elem01 . " " . $elem02) . "
>" . text($elem03) . "
>" . text($elem04) . "
>$elem01 $elem02
>$elem03
>$elem04
>" . text($elem01 . " " . $elem02) . "
>" . text($elem03) . "
>" . text($elem04) . "
>$elem01 $elem02$elem03
>" . text($elem01) . " " . text($elem02) . "" . text($elem03) . "
>$elem01 $elem02$elem03
>" . text($elem01) . " " . text($elem02) . "" . text($elem03) . "
>$elem01 $elem02$elem03
>" . text($elem01) . " " . text($elem02) . "" . text($elem03) . "
>$elem01 $elem02$elem03
>" . text($elem01) . " " . text($elem02) . "" . text($elem03) . "
>$elem01 $elem02$elem03
>" . text($elem01) . " " . text($elem02) . "" . text($elem03) . "
>$elem01 $elem02$elem03
>" . text($elem01) . " " . text($elem02) . "" . text($elem03) . "
>$elem01 $elem02$elem03
>" . text($elem01) . " " . text($elem02) . "" . text($elem03) . "
>$elem03Date of Birth $elem02
>" . text($elem03) . "Date of Birth " . text($elem02) . "
>$elem03Date of Birth $elem02
>" . text($elem03) . "Date of Birth " . text($elem02) . "
>$elem01 $elem17$elem02$elem03 $elem04
>" . text($elem01 . " " . $elem17) . "" . text($elem02) . "" . text($elem03 . " " . $elem04) . "
>$elem01 $elem17$elem02$elem03 $elem04
>" . text($elem01 . " " . $elem17) . "" . text($elem02) . "" . text($elem03 . " " . $elem04) . "
>$idtype$var
>" . text($idtype) . "" . text($var) . "
>$idtype$var
>" . text($idtype) . "" . text($var) . "
Codes$hi_str
Codes" . text($hi_str) . "
$id$elem02 $elem01 per every $elem04 $elem03 for $elem06 $elem05 $elem07
$id$elem02 $elem01 per every $elem04 $elem03 $elem07
$id$elem02 $elem01 for $elem06 $elem05 $elem07
$id$elem02 $elem01 $elem07
" . text($id) . "" . text($elem02 . " " . $elem01) . " per every " . text($elem04 . " " . $elem03) . " for " . text($elem06 . " " . $elem05 . " " . $elem07) . "
" . text($id) . "" . text($elem02 . " " . $elem01) . " per every " . text($elem04 . " " . $elem03 . " " . $elem07) . "
" . text($id) . "" . text($elem02 . " " . $elem01) . " for " . text($elem06 . " " . $elem05 . " " . $elem07) . "
" . text($id) . "" . text($elem02 . " " . $elem01 . " " . $elem07) . "
$id$elem02 $elem01 $elem07 $elem08
" . text($id) . "" . text($elem02 . " " . $elem01 . " " . $elem07 . " " . $elem08) . "
$elem01Conditions Apply: $elem02
>$elem03
>$elem04
>$elem05
>$elem06
>$elem07
" . text($elem01) . "Conditions Apply: " . text($elem02) . "
>" . text($elem03) . "
>" . text($elem04) . "
>" . text($elem05) . "
>" . text($elem06) . "
>" . text($elem07) . "
Hospital $elem01 $elem02
>$elem03
Hospital " . text($elem01 . " " . $elem02) . "
>" . text($elem03) . "
Ambulance:$elem03 $elem06 $elem05
Ambulance:" . text($elem03 . " " . $elem06 . " " . $elem05) . "
Spinal: $elem01 $elem02 $elem03 $elem04
Spinal: " . text($elem01 . " " . $elem02 . " " . $elem03 . " " . $elem04) . "
OxygenYou must independently verify this information!
>$title
>Equipment Type: $elem03 $elem04
>$elem06 $elem07 $elem08
>Therapist: $elem09
>$elem16
>Delivery: $elem17
>Equipment Type: $elem18
OxygenYou must independently verify this information!
>$title
>Equipment Type: " . text($elem03 . " " . $elem04) . "
>" . text($elem06 . " " . $elem07 . " " . $elem08) . "
>Therapist: " . text($elem09) . "
>" . text($elem16) . "
>Delivery: " . text($elem17) . "
>Equipment Type: " . text($elem18) . "
Home HealthHH Began $elem02$elem01
>Period $elem04(MCR) $elem07
>Period $elem08(MCR) $elem05
Home HealthHH Began " . text($elem02) . "" . text($elem01) . "
>Period " . text($elem04) . "(MCR) " . text($elem07) . "
>Period " . text($elem08) . "(MCR) " . attr($elem05) . "
Paperwork$elem01 $elem02
>$elem05 $elem06
>$elem07
Paperwork" . text($elem01 . " " . $elem02) . "
>" . text($elem05 . " " . $elem06) . "
>" . text($elem07) . "
Message$elem01
Message" . text($elem01) . "
Message$elem01
Message" . text($elem01) . "
Professional Svc$elem01 $elem02
>$elem03 $elem04 $elem11
Professional Svc" . text($elem01 . " " . $elem02) . "
>" . text($elem03 . " " . $elem04 . " " . $elem11) . "
>$elem20
Inst Service$elem01 $elem02
>$elem03 $elem04 $elem05 $elem06
>$elem10
Inst Service" . text($elem01 . " " . $elem02) . "
>" . text($elem03 . " " . $elem04 . " " . $elem05 . " " . $elem06) . "
>" . text($elem10) . "
ReferenceInformation$fn
ReferenceInformation" . text($fn) . "
PtID: $clp01Status $clp02 $clp06
>$clp03 $clp04 $clp05 $clp07
>$clp08 $clp09
PtID: " . text($clp01) . "Status " . text($clp02) . " " . text($clp06) . "
>$clp03 $clp04 $clp05 $clp07
>$clp08 $clp09
>$amt01 $amt02
>" . text($amt01 . " " . $amt02) . "
>$qty01 $qty02
>" . text($qty01 . " " . $qty02) . "
$descr$name $nm108 $nm109
" . text($descr) . "" . text($name) . " " . text($nm108) . " " . text($nm109) . "
$descr$name
" . text($descr) . "" . text($name) . "
>$cas_str
>" . text($cas_str) . "
".PHP_EOL."".PHP_EOL; + $str_html .= "
$capstr
".PHP_EOL."".PHP_EOL; $str_html .= $hdr_html; $str_html .= $sbr_html; $str_html .= $clp_html; @@ -366,7 +366,7 @@ function edih_835_transaction_html($trans_array, $codes27x, $codes835, $delimite $capstr = ""; $mia_str = ""; // - $hdr_html = "".PHP_EOL; + $hdr_html = "".PHP_EOL; $hdr_html .= "".PHP_EOL."".PHP_EOL; $clp_html = ""; $svc_html = ""; @@ -400,9 +400,9 @@ function edih_835_transaction_html($trans_array, $codes27x, $codes835, $delimite // if ($loopid == '2100') { - $clp_html .= "".PHP_EOL; + $clp_html .= "".PHP_EOL; } elseif ($loopid == '2110') { - $svc_html .= "".PHP_EOL; + $svc_html .= "".PHP_EOL; } } @@ -427,9 +427,9 @@ function edih_835_transaction_html($trans_array, $codes27x, $codes835, $delimite //} //} if ($loopid == '2100') { - $clp_html .= "".PHP_EOL; + $clp_html .= "".PHP_EOL; } elseif ($loopid == '2110') { - $svc_html .= "".PHP_EOL; + $svc_html .= "".PHP_EOL; } // @@ -474,8 +474,8 @@ function edih_835_transaction_html($trans_array, $codes27x, $codes835, $delimite // if ($loopid == '2100') { - $clp_html .= "".PHP_EOL; - $clp_html .= ($per05 || $per07) ? "".PHP_EOL : ""; + $clp_html .= "".PHP_EOL; + $clp_html .= ($per05 || $per07) ? "".PHP_EOL : ""; } // @@ -497,30 +497,30 @@ function edih_835_transaction_html($trans_array, $codes27x, $codes835, $delimite $clp05 = (isset($sar[5]) && $sar[5]) ? edih_format_money($sar[5]) : '0'; // pt responsibility amont $clp06 = (isset($sar[6]) && $sar[6]) ? $cd835->get_835_code('CLP06', $sar[6]) : ''; // filing indicator code $clp07 = (isset($sar[7]) && $sar[7]) ? $sar[7] : ''; // Payer reference ID - $clp08 = (isset($sar[8]) && $sar[8]) ? "Location ".$cd27x->get_271_code('POS', $sar[8]) : ''; // Faciliy code place of service + $clp08 = (isset($sar[8]) && $sar[8]) ? "Location " . text($cd27x->get_271_code('POS', $sar[8])) : ''; // Faciliy code place of service // frequency type code 1 original 7 replacement 8 void $clp09ar = array('1'=>'original', '7'=>'replacement', '8'=>'void'); if (isset($sar[9]) && array_key_exists($sar[9], $clp09ar)) { // claim frequency code - $clp09 = "Freq ".$clp09ar[$sar[9]]; + $clp09 = "Freq " . text($clp09ar[$sar[9]]); } else { - $clp09 = (isset($sar[9]) && $sar[9]) ? "Freq ".$sar[9] : ""; + $clp09 = (isset($sar[9]) && $sar[9]) ? "Freq " . text($sar[9]) : ""; } // DRG code not expected - $clp11 = (isset($sar[11]) && $sar[11]) ? "DRG Code ".$sar[11] : ''; + $clp11 = (isset($sar[11]) && $sar[11]) ? "DRG Code " . text($sar[11]) : ''; // DRG weight - $clp12 = (isset($sar[12]) && $sar[12]) ? "DRG Weight ".$sar[12] : ''; + $clp12 = (isset($sar[12]) && $sar[12]) ? "DRG Weight " . text($sar[12]) : ''; // DRG percentage - $clp13 = (isset($sar[13]) && $sar[13]) ? "Dischg Frctn ".edih_format_percent($sar[13]) : ''; + $clp13 = (isset($sar[13]) && $sar[13]) ? "Dischg Frctn " . text(edih_format_percent($sar[13])) : ''; // // table caption PtID PtName $capstr .= $clp01; $tblid = $clp01; // - $clp_html .= "".PHP_EOL; - $clp_html .= "".PHP_EOL; - $clp_html .= ($clp08 || $clp09) ? "".PHP_EOL : ""; - $clp_html .= ($clp11 || $clp12 || $clp13) ? "".PHP_EOL : ""; + $clp_html .= "".PHP_EOL; + $clp_html .= "".PHP_EOL; + $clp_html .= ($clp08 || $clp09) ? "".PHP_EOL : ""; + $clp_html .= ($clp11 || $clp12 || $clp13) ? "".PHP_EOL : ""; // continue; // @@ -578,9 +578,9 @@ function edih_835_transaction_html($trans_array, $codes27x, $codes835, $delimite // if ($nm108) { - $nm1_str .= "" .PHP_EOL; + $nm1_str .= "" .PHP_EOL; } else { - $nm1_str .= "" .PHP_EOL; + $nm1_str .= "" .PHP_EOL; } if ($loopid == '2100') { @@ -602,28 +602,28 @@ function edih_835_transaction_html($trans_array, $codes27x, $codes835, $delimite $tr1 = "".PHP_EOL; // - $mia_str .= (isset($sar[1]) && $sar[1]) ? $tr1."Covered Days or Visits: ".$sar[1].$tr2 : ""; // days or visits - $mia_str .= (isset($sar[2]) && $sar[2]) ? $tr1."PPS Operating Outlier Amt: ".edih_format_money($sar[2]).$tr2 : ""; - $mia_str .= (isset($sar[3]) && $sar[3]) ? $tr1."Lifetime Psychiatric Days: ".$sar[3].$tr2 : ""; - $mia_str .= (isset($sar[4]) && $sar[4]) ? $tr1."Claim DRG Amt: ".edih_format_money($sar[4]).$tr2 : ""; - $mia_str .= (isset($sar[5]) && $sar[5]) ? "".PHP_EOL : ""; + $clp_html .= ($moa_str) ? "".PHP_EOL : ""; // continue; } @@ -672,9 +672,9 @@ function edih_835_transaction_html($trans_array, $codes27x, $codes835, $delimite $amt02 = (isset($sar[2]) && $sar[2]) ? edih_format_money($sar[2]) : ""; // if ($loopid == '2100') { - $clp_html .= ($amt01) ? "".PHP_EOL : ""; + $clp_html .= ($amt01) ? "".PHP_EOL : ""; } elseif ($loopid == '2110') { - $svc_html .= ($amt01) ? "".PHP_EOL : ""; + $svc_html .= ($amt01) ? "".PHP_EOL : ""; } // @@ -690,9 +690,9 @@ function edih_835_transaction_html($trans_array, $codes27x, $codes835, $delimite $qty02 = (isset($sar[2]) && $sar[2]) ? edih_format_money($sar[2]) : ""; // if ($loopid == '2100') { - $clp_html .= ($qty01) ? "".PHP_EOL : ""; + $clp_html .= ($qty01) ? "".PHP_EOL : ""; } elseif ($loopid == '2110') { - $svc_html .= ($qty01) ? "".PHP_EOL : ""; + $svc_html .= ($qty01) ? "".PHP_EOL : ""; } // @@ -748,11 +748,11 @@ function edih_835_transaction_html($trans_array, $codes27x, $codes835, $delimite $svc06 = $sar[6]; } } - + $svc07 = (isset($sar[7]) && $sar[7]) ? $sar[7] : ""; // original unis of service // - $svc_html .= "".PHP_EOL; - $svc_html .= ($svc06) ? "".PHP_EOL : ""; + $svc_html .= "".PHP_EOL; + $svc_html .= ($svc06) ? "".PHP_EOL : ""; // continue; } @@ -765,12 +765,12 @@ function edih_835_transaction_html($trans_array, $codes27x, $codes835, $delimite if (isset($sar[2])) { $lq02 = ($lq01 == 'HE') ? $sar[2] : ""; //$lq02 = $cd835->get_835_code('RARC', $sar[2]); - $rarc_str .= ($rarc_str) ? ' '.$sar[2] : 'Service Remarks '.$sar[2]; + $rarc_str .= ($rarc_str) ? ' '.$sar[2] : 'Service Remarks ' . text($sar[2]); $lq_ar[] = $sar[2]; } else { $lq02 = ""; } - + //$lq02 = (isset($sar[2]) && $sar[2] && $lq01 == 'HE') ? $cd835->get_835_code('RARC', $sar[2]) : ""; // // $svc_html .= ($rarc_str) ? "".PHP_EOL : ""; @@ -782,7 +782,7 @@ function edih_835_transaction_html($trans_array, $codes27x, $codes835, $delimite } // end foreach trans as seg // assemble the html table at end of the inside foreach loop // - $str_html .= "
" . text($capstr) . "
ReferenceInformation  $fn
ReferenceInformation  " . text($fn) . "
>$ref01 $ref02
>" . text($ref01) . " " . text($ref02) . "
>$ref01 $ref02
>" . text($ref01) . " " . text($ref02) . "
>$dtm01 $dtm02
>" . text($dtm01) . " " . text($dtm02) . "
>$dtm01 $dtm02
>" . text($dtm01) . " " . text($dtm02) . "
>$per01 $per02 $per03 $per04
>$per05 $per06 $per07 $per08
>" . text($per01 . " " . $per02 . " " . $per03 . " " . $per04) . "
>" . text($per05 . " " . $per06 . " " . $per07 . " " . $per08) . "
Pt ID $clp01Status $clp02 $clp06
>Fee $clp03 Pmt $clp04 PtRsp $clp05 PR Ref $clp07
>$clp08 $clp09
>$clp11 $clp12 $clp13
Pt ID " . text($clp01) . "Status " . text($clp02) . " " . text($clp06) . "
>Fee " . text($clp03) . " Pmt " . text($clp04) . " PtRsp " . text($clp05) . " PR Ref " . text($clp07) . "
>$clp08 $clp09
>$clp11 $clp12 $clp13
$descr$name $nm108 $nm109
" . text($descr) . "" . text($name) . " " . text($nm108) . " " . text($nm109) . "
$descr$name
" . text($descr) . "" . text($name) . "
>"; $tr2 = "
".$sar[5]."".$cd835->get_835_code('RARC', $sar[5]).$tr2 : ""; - $mia_str .= (isset($sar[6]) && $sar[6]) ? $tr1."Claim DSH Amt: ".edih_format_money($sar[6]).$tr2 : ""; - $mia_str .= (isset($sar[7]) && $sar[7]) ? $tr1."Claim MSP Pass Thru Amt: ".edih_format_money($sar[7]).$tr2 : ""; - $mia_str .= (isset($sar[8]) && $sar[8]) ? $tr1."Claim PPS Capital Amt: ".edih_format_money($sar[8]).$tr2 : ""; - $mia_str .= (isset($sar[9]) && $sar[9]) ? $tr1."PPS Capital FSP DRG Amt: ".edih_format_money($sar[9]).$tr2 : ""; - $mia_str .= (isset($sar[10]) && $sar[10]) ? $tr1."PPS Capital HSP DRG Amt: ".edih_format_money($sar[10]).$tr2 : ""; - $mia_str .= (isset($sar[11]) && $sar[11]) ? $tr1."PPS Capital DSH DRG Amt: ".edih_format_money($sar[11]).$tr2 : ""; - $mia_str .= (isset($sar[12]) && $sar[12]) ? $tr1."Old Capital Amt: ".edih_format_money($sar[12]).$tr2 : ""; - $mia_str .= (isset($sar[13]) && $sar[13]) ? $tr1."PPS Capital Ind Med Edu Amt: ".edih_format_money($sar[13]).$tr2 : ""; - $mia_str .= (isset($sar[14]) && $sar[14]) ? $tr1."PPS Oper HSP Spec DRG Amt: ".edih_format_money($sar[14]).$tr2 : ""; - $mia_str .= (isset($sar[15]) && $sar[15]) ? $tr1."Cost Report Day Count: ".$sar[15].$tr2 : ""; - $mia_str .= (isset($sar[16]) && $sar[16]) ? $tr1."PPS Oper FSP Spec DRG Amt: ".edih_format_money($sar[16]).$tr2 : ""; - $mia_str .= (isset($sar[17]) && $sar[17]) ? $tr1."Claim PPS Outlier Amt: ".edih_format_money($sar[17]).$tr2 : ""; - $mia_str .= (isset($sar[18]) && $sar[18]) ? $tr1."Claim Indirect Teaching: ".edih_format_money($sar[18]).$tr2 : ""; - $mia_str .= (isset($sar[19]) && $sar[19]) ? $tr1."Non Pay Prof Component Amt: ".edih_format_money($sar[19]).$tr2 : ""; - $mia_str .= (isset($sar[20]) && $sar[20]) ? "
".$sar[20]."".$cd835->get_835_code('RARC', $sar[20]).$tr2 : ""; - $mia_str .= (isset($sar[21]) && $sar[21]) ? "
".$sar[21]."".$cd835->get_835_code('RARC', $sar[21]).$tr2 : ""; - $mia_str .= (isset($sar[22]) && $sar[22]) ? "
".$sar[22]."".$cd835->get_835_code('RARC', $sar[22]).$tr2 : ""; + $mia_str .= (isset($sar[1]) && $sar[1]) ? $tr1."Covered Days or Visits: " . text($sar[1]) . $tr2 : ""; // days or visits + $mia_str .= (isset($sar[2]) && $sar[2]) ? $tr1."PPS Operating Outlier Amt: " . text(edih_format_money($sar[2])) . $tr2 : ""; + $mia_str .= (isset($sar[3]) && $sar[3]) ? $tr1."Lifetime Psychiatric Days: " . text($sar[3]) . $tr2 : ""; + $mia_str .= (isset($sar[4]) && $sar[4]) ? $tr1."Claim DRG Amt: " . text(edih_format_money($sar[4])) . $tr2 : ""; + $mia_str .= (isset($sar[5]) && $sar[5]) ? "
" . text($sar[5]) . "" . text($cd835->get_835_code('RARC', $sar[5])) . $tr2 : ""; + $mia_str .= (isset($sar[6]) && $sar[6]) ? $tr1."Claim DSH Amt: " . text(edih_format_money($sar[6])) . $tr2 : ""; + $mia_str .= (isset($sar[7]) && $sar[7]) ? $tr1."Claim MSP Pass Thru Amt: " . text(edih_format_money($sar[7])) . $tr2 : ""; + $mia_str .= (isset($sar[8]) && $sar[8]) ? $tr1."Claim PPS Capital Amt: " . text(edih_format_money($sar[8])) . $tr2 : ""; + $mia_str .= (isset($sar[9]) && $sar[9]) ? $tr1."PPS Capital FSP DRG Amt: " . text(edih_format_money($sar[9])) . $tr2 : ""; + $mia_str .= (isset($sar[10]) && $sar[10]) ? $tr1."PPS Capital HSP DRG Amt: " . text(edih_format_money($sar[10])) . $tr2 : ""; + $mia_str .= (isset($sar[11]) && $sar[11]) ? $tr1."PPS Capital DSH DRG Amt: " . text(edih_format_money($sar[11])) . $tr2 : ""; + $mia_str .= (isset($sar[12]) && $sar[12]) ? $tr1."Old Capital Amt: " . text(edih_format_money($sar[12])) . $tr2 : ""; + $mia_str .= (isset($sar[13]) && $sar[13]) ? $tr1."PPS Capital Ind Med Edu Amt: " . text(edih_format_money($sar[13])) . $tr2 : ""; + $mia_str .= (isset($sar[14]) && $sar[14]) ? $tr1."PPS Oper HSP Spec DRG Amt: " . text(edih_format_money($sar[14])) . $tr2 : ""; + $mia_str .= (isset($sar[15]) && $sar[15]) ? $tr1."Cost Report Day Count: " . text($sar[15]) . $tr2 : ""; + $mia_str .= (isset($sar[16]) && $sar[16]) ? $tr1."PPS Oper FSP Spec DRG Amt: " . text(edih_format_money($sar[16])) . $tr2 : ""; + $mia_str .= (isset($sar[17]) && $sar[17]) ? $tr1."Claim PPS Outlier Amt: " . text(edih_format_money($sar[17])) . $tr2 : ""; + $mia_str .= (isset($sar[18]) && $sar[18]) ? $tr1."Claim Indirect Teaching: " . text(edih_format_money($sar[18])) . $tr2 : ""; + $mia_str .= (isset($sar[19]) && $sar[19]) ? $tr1."Non Pay Prof Component Amt: " . text(edih_format_money($sar[19])) . $tr2 : ""; + $mia_str .= (isset($sar[20]) && $sar[20]) ? "
" . text($sar[20]) . "" . text($cd835->get_835_code('RARC', $sar[20])) . $tr2 : ""; + $mia_str .= (isset($sar[21]) && $sar[21]) ? "
" . text($sar[21]) . "" . text($cd835->get_835_code('RARC', $sar[21])) . $tr2 : ""; + $mia_str .= (isset($sar[22]) && $sar[22]) ? "
" . text($sar[22]) . "" . text($cd835->get_835_code('RARC', $sar[22])) . $tr2 : ""; // continue; } @@ -658,7 +658,7 @@ function edih_835_transaction_html($trans_array, $codes27x, $codes835, $delimite } // - $clp_html .= ($moa_str) ? "
>$moa_str
>" . text($moa_str) . "
>$amt01 $amt02
>" . text($amt01 . " " . $amt02) . "
>$amt01 $amt02
>" . text($amt01 . " " . $amt02) . "
>$qty01 $qty02
>" . text($qty01 . " " . $qty02) . "
>$qty01 $qty02
>" . text($qty01 . " " . $qty02) . "
>Service $svc01 Fee $svc02 Pmt $svc03 $svc05 $svc04
>Submitted Svc $svc06 Units $svc07
>Service " . text($svc01) . " Fee " . text($svc02) . " Pmt " . text($svc03 . " " . $svc05 . " " . $svc04) . "
>Submitted Svc " . text($svc06) . " Units " . text($svc07) . "
>$rarc_str
".PHP_EOL."".PHP_EOL; + $str_html .= "
$capstr
".PHP_EOL."".PHP_EOL; $str_html .= $hdr_html; $str_html .= $sbr_html; $str_html .= $clp_html; @@ -797,10 +797,10 @@ function edih_835_transaction_html($trans_array, $codes27x, $codes835, $delimite if ($key == '2100' && count($cas)) { $cls = 'remc'; - $str_html .= "".PHP_EOL; + $str_html .= "".PHP_EOL; } else { $cls = 'rems'; - $str_html .= "".PHP_EOL; + $str_html .= "".PHP_EOL; } $cg = ''; @@ -838,27 +838,27 @@ function edih_835_transaction_html($trans_array, $codes27x, $codes835, $delimite } // - $str_html .= "".PHP_EOL; - $str_html .= "".PHP_EOL; + $str_html .= "".PHP_EOL; + $str_html .= "".PHP_EOL; } } } if (count($moa_ar)) { $cls = 'remc'; - $str_html .= "".PHP_EOL; + $str_html .= "".PHP_EOL; foreach ($moa_ar as $moa) { $moar = $cd835->get_835_code('RARC', $moa); - $str_html .= "".PHP_EOL; + $str_html .= "".PHP_EOL; } } if (count($lq_ar)) { $cls = 'mia'; - $str_html .= ($rarc_str) ? "".PHP_EOL : ""; + $str_html .= ($rarc_str) ? "".PHP_EOL : ""; foreach ($lq_ar as $lq) { $lqr = $cd835->get_835_code('RARC', $lq); - $str_html .= "".PHP_EOL; + $str_html .= "".PHP_EOL; } } @@ -873,7 +873,7 @@ function edih_835_transaction_html($trans_array, $codes27x, $codes835, $delimite } - + /** * Create an HTML rendition of the 835 check payment transaction. * @@ -898,7 +898,7 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn $str_html .= "

invalid segments argument

".PHP_EOL; return $str_html; } - + if (is_array($delimiters) && count($delimiters)) { $de = $delimiters['e']; $ds = $delimiters['s']; @@ -937,7 +937,7 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn $str_html = ""; // $hdr_html = "".PHP_EOL; - $hdr_html .= "".PHP_EOL; + $hdr_html .= "".PHP_EOL; $hdr_html .= "".PHP_EOL."".PHP_EOL; $pmt_html = ""; $src_html = ""; @@ -992,16 +992,16 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn $bpr16 = (isset($sar[16]) && $sar[16]) ? edih_format_date($sar[16]) : ''; // check or payment date // if ($bpr04 == 'NON') { - $pmt_html .= "".PHP_EOL; + $pmt_html .= "".PHP_EOL; } else { - $pmt_html .= "".PHP_EOL; + $pmt_html .= "".PHP_EOL; } if (strpos('|ACH|BOP|FWT', $bpr04)) { - $pmt_html .= "".PHP_EOL; + $pmt_html .= "".PHP_EOL; } - $pmt_html .= ($bpr11) ? "".PHP_EOL : ""; + $pmt_html .= ($bpr11) ? "".PHP_EOL : ""; $acctng['pmt'] =(isset($sar[2]) && $sar[2]) ? (float)$sar[2] : ""; // continue; @@ -1022,7 +1022,7 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn $tblid = ($trn02) ? $trn02 : ""; $capstr .= ($trn02) ? "Check No: ".$trn02 : "Payment Listing"; // - $pmt_html .= "".PHP_EOL; + $pmt_html .= "".PHP_EOL; // continue; } @@ -1034,7 +1034,7 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn $cur01 = (isset($sar[1])) ? $sar[1] : ''; // entity ID code $cur02 = (isset($sar[2])) ? $sar[2] : ''; // currency code // - $pmt_html .= "".PHP_EOL; + $pmt_html .= "".PHP_EOL; // continue; } @@ -1048,13 +1048,13 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn // if ($loopid == 'header') { // should not be present for payee receiver - $pmt_html .= "".PHP_EOL; + $pmt_html .= "".PHP_EOL; } elseif ($loopid == '1000A') { // source - $src_html .="".PHP_EOL; + $src_html .="".PHP_EOL; } elseif ($loopid == '1000B') { // receiver - $rcv_html .= "".PHP_EOL; + $rcv_html .= "".PHP_EOL; } elseif ($loopid == '2100') { // $clpsegs[] = $seg; @@ -1066,7 +1066,7 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn // continue; } - + if (strncmp('DTM'.$de, $seg, 4) === 0) { $sar = explode($de, $seg); // DTM in 835 use DTP codes from 271 codes @@ -1085,7 +1085,7 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn // if ($loopid == 'header') { // should not be present for payee or receiver - $pmt_html .= "".PHP_EOL; + $pmt_html .= "".PHP_EOL; } elseif ($loopid == '2100') { $clpsegs[] = $seg; } elseif ($loopid == '2110') { @@ -1108,13 +1108,13 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn if ($loopid == 'header') { $loopid = '1000A'; $cls = 'src'; - $src_html .= "".PHP_EOL; + $src_html .= "".PHP_EOL; } elseif ($loopid == '1000A') { $loopid = '1000B'; $cls = 'rcv'; - $rcv_html .= "".PHP_EOL; + $rcv_html .= "".PHP_EOL; } - + // continue; } @@ -1127,9 +1127,9 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn $n302 = (isset($sar[2])) ? $sar[2] : ''; // address line 2 // if ($loopid == '1000A') { - $src_html .= "".PHP_EOL; + $src_html .= "".PHP_EOL; } elseif ($loopid == '1000B') { - $rcv_html .= "".PHP_EOL; + $rcv_html .= "".PHP_EOL; } // @@ -1147,11 +1147,11 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn $n407 = (isset($sar[7])) ? $sar[7] : ''; // Country subdivision // if ($loopid == '1000A') { - $src_html .= "".PHP_EOL; - $src_html .= ($n404 || $n407) ? "".PHP_EOL : ""; + $src_html .= "".PHP_EOL; + $src_html .= ($n404 || $n407) ? "".PHP_EOL : ""; } elseif ($loopid == '1000B') { - $rcv_html .= "".PHP_EOL; - $rcv_html .= ($n404 || $n407) ? "".PHP_EOL : ""; + $rcv_html .= "".PHP_EOL; + $rcv_html .= ($n404 || $n407) ? "".PHP_EOL : ""; } // @@ -1201,11 +1201,11 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn // if ($loopid == '1000A') { - $src_html .= "".PHP_EOL; - $src_html .= ($per05 || $per07) ? "".PHP_EOL : ""; + $src_html .= "".PHP_EOL; + $src_html .= ($per05 || $per07) ? "".PHP_EOL : ""; } elseif ($loopid == '1000B') { - $rcv_html .= "".PHP_EOL; - $rcv_html .= ($per05 || $per07) ? "".PHP_EOL : ""; + $rcv_html .= "".PHP_EOL; + $rcv_html .= ($per05 || $per07) ? "".PHP_EOL : ""; } // @@ -1232,7 +1232,7 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn $rdm02 = (isset($sar[2])) ? $sar[2] : ''; // name $rdm03 = (isset($sar[3])) ? $sar[3] : ''; // number // - $pmt_html .= "".PHP_EOL; + $pmt_html .= "".PHP_EOL; // continue; } @@ -1252,7 +1252,7 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn $clpsegs = array(); } - $nlx_html = ($lx_html) ? "
" . text($capstr) . "
>Claim Level Adjustments
>Claim Level Adjustments
>Service Level Adjustments
>Service Level Adjustments
>$ky $cg $cd $ca $cq
$ky $cd$cr
>" . text($ky . " " . $cg . " " . $cd . " " . $ca . " " . $cq) . "
" . text($ky . " " . $cd) . "" . text($cr) . "
Remarks
Remarks
$moa$moar
" . text($moa) . "" . text($moar) . "
$rarc_str
$rarc_str
$lq$lqr
$lq" . text($lqr) . "
ReferenceInformation$fn
ReferenceInformation" . text($fn) . "
$bpr16$bpr03 $bpr04Non Payment
" . text($bpr16) . "" . text($bpr03 . " " . $bpr04) . "Non Payment
$bpr16$bpr03 $bpr04$bpr02 to $bpr13 $bpr12 $bpr14
" . text($bpr16) . "" . text($bpr03 . " " . $bpr04) . "" . text($bpr02) . " to " . text($bpr13 . " " . $bpr12 . " " . $bpr14) . "
>$bpr05 from: $bpr07 $bpr09 $bpr10
>" . text($bpr05) . " from: " . text($bpr07 . " " . $bpr09 . " " . $bpr10) . "
>Pmt No. $bpr11 $bpr01
>Pmt No. " . text($bpr11 . " " . $bpr01) . "
>Trace $trn02 by $trn03 $trn04
>Trace " . text($trn02) . " by " . text($trn03 . " " . $trn04) . "
>Trace $cur02 by $cur03 $cur04
>Trace " . text($cur02) . " by " . text($cur03 . " " . $cur04) . "
>$ref01 $ref02
>" . text($ref01) . " " . text($ref02) . "
>$ref01 $ref02
>" . text($ref01) . " " . text($ref02) . "
>$ref01 $ref02
>" . text($ref01) . " " . text($ref02) . "
>$dtm01 $dtm02
>" . text($dtm01) . " " . text($dtm02) . "
$n101$n102 $n103 $n104
" . text($n101) . "" . text($n102) . " " . text($n103) . " " . text($n104) . "
$n101$n102 $n103 $n104
" . text($n101) . "" . text($n102) . " " . text($n103) . " " . text($n104) . "
>$n301 $n302
>" . text($n301 . " " . $n302) . "
>$n301 $n302
>" . text($n301 . " " . $n302) . "
>$n401 $n402 $n403
>$n404 $n405
>" . text($n401 . " " . $n402 . " " . $n403) . "
>" . text($n404 . " " . $n405) . "
>$n401 $n402 $n403
>$n404 $n405
>" . text($n401 . " " . $n402 . " " . $n403) . "
>" . text($n404 . " " . $n405) . "
>$per01 $per02 $per03 $per04
>$per05 $per06 $per07 $per08
>" . text($per01 . " " . $per02 . " " . $per03 . " " . $per04) . "
>" . text($per05 . " " . $per06 . " " . $per07 . " " . $per08) . "
>$per01 $per02 $per03 $per04
>$per05 $per06 $per07 $per08
>" . text($per01 . " " . $per02 . " " . $per03 . " " . $per04) . "
>" . text($per05 . " " . $per06 . " " . $per07 . " " . $per08) . "
$rdm01$rdm02 $rdm03
" . text($rdm01) . "" . text($rdm02 . " " . $rdm03) . "
".PHP_EOL."".PHP_EOL.$lx_html.PHP_EOL : ""; + $nlx_html = ($lx_html) ? "
".PHP_EOL."".PHP_EOL.$lx_html.PHP_EOL : ""; $lx_ar[$lxkey]['lx'] = $nlx_html; $lx_ar[$lxkey]['clp'] = $clp_html; $lx_html = ""; @@ -1268,7 +1268,7 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn $loopid = '2000'; $cls = 'lx'; //$lx_ct = count($lx_ar); - $lx_html .= ($lxkey) ? "".PHP_EOL: ""; + $lx_html .= ($lxkey) ? "".PHP_EOL: ""; continue; } @@ -1284,21 +1284,21 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn $ts304 = (isset($sar[4]) && $sar[4]) ? $sar[4] : ''; // quantity $ts305 = (isset($sar[5]) && $sar[5]) ? edih_format_money($sar[5]) : ''; // monetary amount // - $lx_html .= "".PHP_EOL; + $lx_html .= "".PHP_EOL; // // Medicare Part A - $tr1 = "".PHP_EOL; // - $lx_html .= (isset($sar[13]) && $sar[13]) ? $tr1."Total MSP Payer Amt: ".edih_format_money($sar[13]).$tr2.PHP_EOL : ""; - $lx_html .= (isset($sar[15]) && $sar[15]) ? $tr1."Total Non-Lab Chrg Amt: ".edih_format_money($sar[15]).$tr2.PHP_EOL : ""; - $lx_html .= (isset($sar[17]) && $sar[17]) ? $tr1."Total HCPCS Rpt Chrg Amt: ".edih_format_money($sar[17]).$tr2.PHP_EOL : ""; - $lx_html .= (isset($sar[18]) && $sar[18]) ? $tr1."Total HCPCS Payable Amt: ".edih_format_money($sar[18]).$tr2.PHP_EOL : ""; - $lx_html .= (isset($sar[20]) && $sar[20]) ? $tr1."Total Prof Cmpnt Amt: ".edih_format_money($sar[20]).$tr2.PHP_EOL : ""; - $lx_html .= (isset($sar[21]) && $sar[21]) ? $tr1."Total MSP Pt Liab Met Amt: ".edih_format_money($sar[21]).$tr2.PHP_EOL : ""; - $lx_html .= (isset($sar[22]) && $sar[22]) ? $tr1."Total MSP Pt Reimb Amt: ".edih_format_money($sar[22]).$tr2.PHP_EOL : ""; - $lx_html .= (isset($sar[23]) && $sar[23]) ? $tr1."Total PIP Claim Count: ".$sar[23].$tr2.PHP_EOL : ""; - $lx_html .= (isset($sar[24]) && $sar[24]) ? $tr1."Total PIP Claim Count: ".edih_format_money($sar[24]).$tr2.PHP_EOL : ""; + $lx_html .= (isset($sar[13]) && $sar[13]) ? $tr1."Total MSP Payer Amt: " . text(edih_format_money($sar[13])) . $tr2.PHP_EOL : ""; + $lx_html .= (isset($sar[15]) && $sar[15]) ? $tr1."Total Non-Lab Chrg Amt: " . text(edih_format_money($sar[15])) . $tr2.PHP_EOL : ""; + $lx_html .= (isset($sar[17]) && $sar[17]) ? $tr1."Total HCPCS Rpt Chrg Amt: " . text(edih_format_money($sar[17])) . $tr2.PHP_EOL : ""; + $lx_html .= (isset($sar[18]) && $sar[18]) ? $tr1."Total HCPCS Payable Amt: " . text(edih_format_money($sar[18])) . $tr2.PHP_EOL : ""; + $lx_html .= (isset($sar[20]) && $sar[20]) ? $tr1."Total Prof Cmpnt Amt: " . text(edih_format_money($sar[20])) . $tr2.PHP_EOL : ""; + $lx_html .= (isset($sar[21]) && $sar[21]) ? $tr1."Total MSP Pt Liab Met Amt: " . text(edih_format_money($sar[21])) . $tr2.PHP_EOL : ""; + $lx_html .= (isset($sar[22]) && $sar[22]) ? $tr1."Total MSP Pt Reimb Amt: " . text(edih_format_money($sar[22])) . $tr2.PHP_EOL : ""; + $lx_html .= (isset($sar[23]) && $sar[23]) ? $tr1."Total PIP Claim Count: " . text($sar[23]) . $tr2.PHP_EOL : ""; + $lx_html .= (isset($sar[24]) && $sar[24]) ? $tr1."Total PIP Claim Count: " . text(edih_format_money($sar[24])) . $tr2.PHP_EOL : ""; // continue; } @@ -1307,32 +1307,32 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn if (strncmp('TS2'.$de, $seg, 4) === 0) { csv_edihist_log("edih_835_transaction_html: segment TS2 present in $fn"); // Medicare Part A - $tr1 = "".PHP_EOL; // - $lx_html .= (isset($sar[1]) && $sar[1]) ? $tr1."Total DRG Amt: ".edih_format_money($sar[1]).$tr2 : ""; - $lx_html .= (isset($sar[2]) && $sar[2]) ? $tr1."Total Fed Specific Amt: ".edih_format_money($sar[2]).$tr2 : ""; - $lx_html .= (isset($sar[3]) && $sar[3]) ? $tr1."Total Hosp Specific Amt: ".edih_format_money($sar[3]).$tr2 : ""; - $lx_html .= (isset($sar[4]) && $sar[4]) ? $tr1."Total DSP Share Amt: ".edih_format_money($sar[4]).$tr2 : ""; - $lx_html .= (isset($sar[5]) && $sar[5]) ? $tr1."Total Capital Amt: ".edih_format_money($sar[5]).$tr2 : ""; - $lx_html .= (isset($sar[6]) && $sar[6]) ? $tr1."Total Ind Med Edu Amt: ".edih_format_money($sar[6]).$tr2 : ""; - $lx_html .= (isset($sar[7]) && $sar[7]) ? $tr1."Total Outlier Day Amt: ".edih_format_money($sar[7]).$tr2 : ""; - $lx_html .= (isset($sar[8]) && $sar[8]) ? $tr1."Total Day Outlier Day Amt: ".edih_format_money($sar[8]).$tr2 : ""; - $lx_html .= (isset($sar[9]) && $sar[9]) ? $tr1."Total Cost Outlier Day Amt: ".edih_format_money($sar[9]).$tr2 : ""; - $lx_html .= (isset($sar[10]) && $sar[10]) ? $tr1."Avg DRG Length of Stay: ".$sar[10].$tr2 : ""; - $lx_html .= (isset($sar[11]) && $sar[11]) ? $tr1."Total Discharge Count: ".$sar[11].$tr2 : ""; - $lx_html .= (isset($sar[12]) && $sar[12]) ? $tr1."Total Cost Rpt Day Count: ".$sar[12].$tr2 : ""; - $lx_html .= (isset($sar[13]) && $sar[13]) ? $tr1."Total Covered Day Count: ".$sar[13].$tr2 : ""; - $lx_html .= (isset($sar[14]) && $sar[14]) ? $tr1."Total Non Covered Day Count: ".$sar[14].$tr2 : ""; - $lx_html .= (isset($sar[15]) && $sar[15]) ? $tr1."Total MSP Pass-Thru Amt: ".edih_format_money($sar[15]).$tr2 : ""; - $lx_html .= (isset($sar[16]) && $sar[16]) ? $tr1."Avg DRG Weight: ".$sar[16].$tr2 : ""; - $lx_html .= (isset($sar[17]) && $sar[17]) ? $tr1."Total PPS Capital FSP DRG Amt: ".edih_format_money($sar[17]).$tr2 : ""; - $lx_html .= (isset($sar[18]) && $sar[18]) ? $tr1."Total PPS Capital FSP HSP Amt: ".edih_format_money($sar[18]).$tr2 : ""; - $lx_html .= (isset($sar[19]) && $sar[19]) ? $tr1."Total PPS DSH DRG Amt: ".edih_format_money($sar[19]).$tr2 : ""; + $lx_html .= (isset($sar[1]) && $sar[1]) ? $tr1."Total DRG Amt: " . text(edih_format_money($sar[1])) . $tr2 : ""; + $lx_html .= (isset($sar[2]) && $sar[2]) ? $tr1."Total Fed Specific Amt: " . text(edih_format_money($sar[2])) . $tr2 : ""; + $lx_html .= (isset($sar[3]) && $sar[3]) ? $tr1."Total Hosp Specific Amt: " . text(edih_format_money($sar[3])) . $tr2 : ""; + $lx_html .= (isset($sar[4]) && $sar[4]) ? $tr1."Total DSP Share Amt: " . text(edih_format_money($sar[4])) . $tr2 : ""; + $lx_html .= (isset($sar[5]) && $sar[5]) ? $tr1."Total Capital Amt: " . text(edih_format_money($sar[5])) . $tr2 : ""; + $lx_html .= (isset($sar[6]) && $sar[6]) ? $tr1."Total Ind Med Edu Amt: " . text(edih_format_money($sar[6])) . $tr2 : ""; + $lx_html .= (isset($sar[7]) && $sar[7]) ? $tr1."Total Outlier Day Amt: " . text(edih_format_money($sar[7])) . $tr2 : ""; + $lx_html .= (isset($sar[8]) && $sar[8]) ? $tr1."Total Day Outlier Day Amt: " . text(edih_format_money($sar[8])) . $tr2 : ""; + $lx_html .= (isset($sar[9]) && $sar[9]) ? $tr1."Total Cost Outlier Day Amt: " . text(edih_format_money($sar[9])) . $tr2 : ""; + $lx_html .= (isset($sar[10]) && $sar[10]) ? $tr1."Avg DRG Length of Stay: " . text($sar[10]) . $tr2 : ""; + $lx_html .= (isset($sar[11]) && $sar[11]) ? $tr1."Total Discharge Count: " . text($sar[11]) . $tr2 : ""; + $lx_html .= (isset($sar[12]) && $sar[12]) ? $tr1."Total Cost Rpt Day Count: " . text($sar[12]) . $tr2 : ""; + $lx_html .= (isset($sar[13]) && $sar[13]) ? $tr1."Total Covered Day Count: " . text($sar[13]) . $tr2 : ""; + $lx_html .= (isset($sar[14]) && $sar[14]) ? $tr1."Total Non Covered Day Count: " . text($sar[14]) . $tr2 : ""; + $lx_html .= (isset($sar[15]) && $sar[15]) ? $tr1."Total MSP Pass-Thru Amt: " . text(edih_format_money($sar[15])) . $tr2 : ""; + $lx_html .= (isset($sar[16]) && $sar[16]) ? $tr1."Avg DRG Weight: " . text($sar[16]) . $tr2 : ""; + $lx_html .= (isset($sar[17]) && $sar[17]) ? $tr1."Total PPS Capital FSP DRG Amt: " . text(edih_format_money($sar[17])) . $tr2 : ""; + $lx_html .= (isset($sar[18]) && $sar[18]) ? $tr1."Total PPS Capital FSP HSP Amt: " . text(edih_format_money($sar[18])) . $tr2 : ""; + $lx_html .= (isset($sar[19]) && $sar[19]) ? $tr1."Total PPS DSH DRG Amt: " . text(edih_format_money($sar[19])) . $tr2 : ""; // continue; } - + if (strncmp('PLB'.$de, $seg, 4) === 0) { // can signal end of claim transaction $loopid = 'summary'; @@ -1347,7 +1347,7 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn $plb01 = (isset($sar[1]) && $sar[1]) ? $sar[1] : ""; $plb02 = (isset($sar[2]) && $sar[2]) ? edih_format_date($sar[2]) : ""; // - $pmt_html .= "".PHP_EOL; + $pmt_html .= "".PHP_EOL; // $plbar = array_slice($sar, 2); $plbar = array_chunk($plbar, 2); @@ -1374,7 +1374,7 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn } } - $pmt_html .= "".PHP_EOL; + $pmt_html .= "".PHP_EOL; } // @@ -1390,16 +1390,16 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn if (is_array($acctng) && count($acctng)) { array_walk($acctng, 'edih_round_cb'); $bal = ($acctng['fee'] == ($acctng['pmt'] + $acctng['clmadj'] + $acctng['svcadj'] + $acctng['svcptrsp'] + $acctng['plbadj']) ) ? "Balanced" : "Not Balanced"; - $acct_str = "$bal: Fee {$acctng['fee']} Pmt {$acctng['pmt']} "; - $acct_str .= "ClpAdj {$acctng['clmadj']} SvcAdj {$acctng['svcadj']} "; - $acct_str .= "PtRsp {$acctng['ptrsp']} (svcPtRsp {$acctng['svcptrsp']}) PlbAdj {$acctng['plbadj']} "; + $acct_str = text($bal) . ": Fee " . text($acctng['fee']) . " Pmt " . text($acctng['pmt']) . " "; + $acct_str .= "ClpAdj " . text($acctng['clmadj']) . " SvcAdj " . text($acctng['svcadj']) . " "; + $acct_str .= "PtRsp " . text($acctng['ptrsp']) . " (svcPtRsp " . text($acctng['svcptrsp']) . ") PlbAdj " . text($acctng['plbadj']) . " "; // - $pmt_html .= "".PHP_EOL; + $pmt_html .= "".PHP_EOL; } // // create the html page - $str_html .= "
Claim Group $lxkey
Claim Group " . text($lxkey) . "
Prv $ts301$ts302 Count $ts304 Amount $ts305
Prv " . text($ts301) . "" . text($ts302) . " Count " . text($ts304) . " Amount " . text($ts305) . "
>"; + $tr1 = "
>"; $tr2 = "
>"; + $tr1 = "
>"; $tr2 = "
Provider$plb01 $plb02
Provider" . text($plb01 . " " . $plb02) . "
$plb_tr$plb_rc $plb_rt $plb_amt
" . text($plb_tr) . "" . text($plb_rc . " " . $plb_rt . " " . $plb_amt) . "
$acct_str
$acct_str
".PHP_EOL; + $str_html .= "
$capstr
".PHP_EOL; $str_html .= $hdr_html; if ($pmt_html) { $str_html .= $pmt_html; @@ -1427,7 +1427,7 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn } // note: table ending in CLP if stanza - $nlx_html = "
" . text($capstr) . "
".PHP_EOL."".PHP_EOL.$lx_html.PHP_EOL; + $nlx_html = "
".PHP_EOL."".PHP_EOL.$lx_html.PHP_EOL; $lx_ar[$lxkey]['lx'] = $nlx_html; $lx_ar[$lxkey]['clp'] = $clp_html; $lx_html = ""; @@ -1466,7 +1466,7 @@ function edih_835_payment_html($segments, $codes27x, $codes835, $delimiters, $fn // continue; } - + if (strncmp('CLP'.$de, $seg, 4) === 0) { if ($loopid == '1000B') { // end of 1000B (receiver) loop @@ -1608,7 +1608,7 @@ function edih_835_html($filename, $trace = '', $clm01 = '', $summary = false) $cd835 = new edih_835_codes($ds, $dr); } else { csv_edihist_log("edih_835_html: Did not get delimiters"); - $html_str .= "

Did not get delimiters for $fn

".PHP_EOL; + $html_str .= "

Did not get delimiters for " . text($fn) . "

".PHP_EOL; return $html_str; } @@ -1634,7 +1634,7 @@ function edih_835_html($filename, $trace = '', $clm01 = '', $summary = false) } } else { csv_edihist_log("edih_835_html: Did not find PtID $pid in $fn"); - $html_str .= "

Did not find PtID $pid in $fn

".PHP_EOL; + $html_str .= "

Did not find PtID " . text($pid) . " in " . text($fn) . "

".PHP_EOL; return $html_str; } } elseif ($chk) { @@ -1650,7 +1650,7 @@ function edih_835_html($filename, $trace = '', $clm01 = '', $summary = false) } } else { csv_edihist_log("edih_835_transaction_html: Did not get envelopes information for $fn"); - $html_str .= "

Did not get envelopes information for $fn

".PHP_EOL; + $html_str .= "

Did not get envelopes information for " . text($fn) . "

".PHP_EOL; return $html_str; } @@ -1659,7 +1659,7 @@ function edih_835_html($filename, $trace = '', $clm01 = '', $summary = false) $html_str .= edih_835_payment_html($trans_ar, $cd27x, $cd835, $delims, $fn); } else { csv_edihist_log("edih_835_transaction_html: Did not find trace $chk in $fn"); - $html_str .= "

Did not find trace $chk in $fn

".PHP_EOL; + $html_str .= "

Did not find trace " . text($chk) . " in " . text($fn) . "

".PHP_EOL; return $html_str; } } else { @@ -1671,7 +1671,7 @@ function edih_835_html($filename, $trace = '', $clm01 = '', $summary = false) } } else { csv_edihist_log("edih_835_transaction_html: Did not envelopes information for $fn"); - $html_str .= "

Did not get envelopes information for $fn

".PHP_EOL; + $html_str .= "

Did not get envelopes information for " . text($fn) . "

".PHP_EOL; return $html_str; } @@ -1680,7 +1680,7 @@ function edih_835_html($filename, $trace = '', $clm01 = '', $summary = false) $html_str .= edih_835_payment_html($trans_ar, $cd27x, $cd835, $delims, $fn); } else { csv_edihist_log("edih_835_transaction_html: Did not get ST envelopes for $fn"); - $html_str .= "

Did not get ST envelopes for $fn

".PHP_EOL; + $html_str .= "

Did not get ST envelopes for " . text($fn) . "

".PHP_EOL; return $html_str; } } diff --git a/library/edihistory/edih_997_error.php b/library/edihistory/edih_997_error.php index 74d2a8716..b6b9296d8 100644 --- a/library/edihistory/edih_997_error.php +++ b/library/edihistory/edih_997_error.php @@ -1,30 +1,30 @@ - * - * + * + * * @author Kevin McCormick * @link: http://www.open-emr.org * @package OpenEMR * @subpackage ediHistory */ - + // codes used in 997/999 files; //require_once './codes/edih_997_codes.php'; @@ -105,7 +105,7 @@ function edih_997_errdata($obj997) // continue; } - + if (strncmp($seg, 'AK2'.$de, 4) == 0 || strncmp($seg, 'IK2'.$de, 4) == 0) { $sar = explode($de, $seg); // @@ -235,29 +235,29 @@ function edih_997_err_report($err_array) extract($err_array['summary'], EXTR_OVERWRITE); // $str_html .= "

".PHP_EOL; - $str_html .= (isset($sub_icn)) ? "Submitted ICN $sub_icn" : "Submitted file unknown"; - $str_html .= (isset($subdate)) ? " Date ".edih_format_date($subdate) : ""; - $str_html .= (isset($subtime)) ? " Time $subtime
" : "
"; - $str_html .= (isset($ackcode)) ? " TA1 $ackcode : ".edih_997_ta1_code($ackcode)."
" : ""; - $str_html .= (isset($acknote)) ? " TA1 $acknote : ".edih_997_ta1_code($acknote)."
".PHP_EOL : "
".PHP_EOL; + $str_html .= (isset($sub_icn)) ? "Submitted ICN" . text($sub_icn) : "Submitted file unknown"; + $str_html .= (isset($subdate)) ? " Date " . text(edih_format_date($subdate)) : ""; + $str_html .= (isset($subtime)) ? " Time " . text($subtime) . "
" : "
"; + $str_html .= (isset($ackcode)) ? " TA1 $ackcode : " . text(edih_997_ta1_code($ackcode)) . "
" : ""; + $str_html .= (isset($acknote)) ? " TA1 $acknote : " . text(edih_997_ta1_code($acknote)) . "
".PHP_EOL : "
".PHP_EOL; if (isset($fg_type)) { $fgtp = csv_file_type($fg_type); - $str_html .= " Functional Group Type $fg_type ($fgtp)"; - $str_html .= (isset($fg_id)) ? " GS06 $fg_id
".PHP_EOL : "
".PHP_EOL; + $str_html .= " Functional Group Type " . text($fg_type) . " (" . text($fgtp) . ")"; + $str_html .= (isset($fg_id)) ? " GS06 " . text($fg_id) . "
".PHP_EOL : "
".PHP_EOL; } // //$str_html .= "

".PHP_EOL; // - $str_html .= (isset($ak901)) ? "999/997 $ak901 ".edih_997_code_text('ak501', $ak901)."
" : ""; + $str_html .= (isset($ak901)) ? "999/997 $ak901 " . text(edih_997_code_text('ak501', $ak901)) . "
" : ""; $str_html .= (isset($ak902)) ? " Transactions: submitted $ak902" : " "; $str_html .= (isset($ak903)) ? " received $ak903" : ""; $str_html .= (isset($ak904)) ? " accepted $ak904" : ""; - $str_html .= (isset($ak905) && $ak905) ? "
$ak905 ".edih_997_code_text('ak502', $ak905)."
" : ""; - $str_html .= (isset($ak906) && $ak906) ? $ak906." ".edih_997_code_text('ak502', $ak906)."
" : ""; - $str_html .= (isset($ak907) && $ak907) ? $ak907." ".edih_997_code_text('ak502', $ak907)."
" : ""; - $str_html .= (isset($ak908) && $ak908) ? $ak908." ".edih_997_code_text('ak502', $ak908)."
" : ""; - $str_html .= (isset($ak909) && $ak909) ? $ak909." ".edih_997_code_text('ak502', $ak909)."
" : ""; + $str_html .= (isset($ak905) && $ak905) ? "
$ak905 " . text(edih_997_code_text('ak502', $ak905)) . "
" : ""; + $str_html .= (isset($ak906) && $ak906) ? $ak906." " . text(edih_997_code_text('ak502', $ak906)) . "
" : ""; + $str_html .= (isset($ak907) && $ak907) ? $ak907." " . text(edih_997_code_text('ak502', $ak907)) . "
" : ""; + $str_html .= (isset($ak908) && $ak908) ? $ak908." " . text(edih_997_code_text('ak502', $ak908)) . "
" : ""; + $str_html .= (isset($ak909) && $ak909) ? $ak909." " . text(edih_997_code_text('ak502', $ak909)) . "
" : ""; // $str_html .= "

".PHP_EOL; } @@ -271,8 +271,8 @@ function edih_997_err_report($err_array) $rtp = (isset($v['subtype'])) ? $v['subtype'] : ''; // $str_html .= "

".PHP_EOL; - $str_html .= "Error $ct "; - $str_html .= ($stn) ? "ST $stn
" : "
"; + $str_html .= "Error " . text($ct) . " "; + $str_html .= ($stn) ? "ST " . text($stn) . "
" : "
"; // if ($icn && $stn && $rtp) { $trc = sprintf("%s%04d", $icn, $stn); @@ -287,36 +287,36 @@ function edih_997_err_report($err_array) $clm01 = ($rtp == 'f837') ? $trn_ar[0][2] : $trn_ar[0][4]; // $trn_ar['CLM01'] : $trn_ar['BHT03']; $svcdate = $trn_ar[0][1]; // ($rtp == 'f270') ? $trn_ar['ReqDate'] : $trn_ar['SvcDate']; $btfn = $trn_ar[0][5]; // $trn_ar['FileName']; - $str_html .= "$pt_name $svcdate Trace $clm01
".PHP_EOL; + $str_html .= text($pt_name) . " " . text($svcdate) . " Trace " . text($clm01) . "
".PHP_EOL; } else { - $str_html .= "Unable to locate transaction Trace $trc
".PHP_EOL; + $str_html .= "Unable to locate transaction Trace " . text($trc) . "
".PHP_EOL; } } else { $str_html .= "Unable to trace, did not get all of icn, type, and st number
".PHP_EOL; } // - $str_html .= (isset($v['ctxacct'])) ? "Transaction ID ".$v['ctxacct'] : ""; - $str_html .= (isset($v['ik3segid'])) ? " Segment ID ".$v['ik3segid'] : ""; - $str_html .= (isset($v['ik3segpos'])) ? " Position ".$v['ik3segpos'] : ""; - $str_html .= (isset($v['ik3loop'])) ? " Loop ".$v['ik3loop'] : ""; - $str_html .= (isset($v['ik3code'])) ? "
Code ".$v['ik3code']." ".edih_997_code_text('ak304', $v['ik3code'])."
" : "
"; + $str_html .= (isset($v['ctxacct'])) ? "Transaction ID " . text($v['ctxacct']) : ""; + $str_html .= (isset($v['ik3segid'])) ? " Segment ID " . text($v['ik3segid']) : ""; + $str_html .= (isset($v['ik3segpos'])) ? " Position " . text($v['ik3segpos']) : ""; + $str_html .= (isset($v['ik3loop'])) ? " Loop " . text($v['ik3loop']) : ""; + $str_html .= (isset($v['ik3code'])) ? "
Code " . text($v['ik3code']) ." " . text(edih_997_code_text('ak304', $v['ik3code'])) . "
" : "
"; // - $str_html .= (isset($v['ctxid'])) ? "Situational ".PHP_EOL."Segment ".$v['ctxid'] : ""; - $str_html .= (isset($v['ctxpos'])) ? " Position ".$v['ctxpos'] : ""; - $str_html .= (isset($v['ctxloop'])) ? " Position ".$v['ctxloop'] : ""; - $str_html .= (isset($v['ctxelem'])) ? " Element ".$v['ctxelem']."
".PHP_EOL : PHP_EOL; + $str_html .= (isset($v['ctxid'])) ? "Situational ".PHP_EOL."Segment " . text($v['ctxid']) : ""; + $str_html .= (isset($v['ctxpos'])) ? " Position " . text($v['ctxpos']) : ""; + $str_html .= (isset($v['ctxloop'])) ? " Position " . text($v['ctxloop']) : ""; + $str_html .= (isset($v['ctxelem'])) ? " Element " . text($v['ctxelem']) . "
".PHP_EOL : PHP_EOL; // - $str_html .= (isset($v['ik401'])) ? "Data Element element ".$v['ik401'] : ""; - $str_html .= (isset($v['ik402'])) ? " ref ".$v['ik402'] : ""; - $str_html .= (isset($v['ik404'])) ? " data ".$v['ik404'] : ""; - $str_html .= (isset($v['ik403'])) ? "
code ".$v['ik403']." ".edih_997_code_text('ak403', $v['ik403'])."
" : "
"; + $str_html .= (isset($v['ik401'])) ? "Data Element element " . text($v['ik401']) : ""; + $str_html .= (isset($v['ik402'])) ? " ref " . text($v['ik402']) : ""; + $str_html .= (isset($v['ik404'])) ? " data " . text($v['ik404']) : ""; + $str_html .= (isset($v['ik403'])) ? "
code " . text($v['ik403']) . " " . text(edih_997_code_text('ak403', $v['ik403'])) . "
" : "
"; // - $str_html .= (isset($v['ik501']) && $v['ik501']) ? "Status ".$v['ik501']." ".edih_997_code_text('ak501', $v['ik501'])."
" : ""; - $str_html .= (isset($v['ik502']) && $v['ik502']) ? " code ".$v['ik502']." ".edih_997_code_text('ak502', $v['ik502'])."
" : ""; - $str_html .= (isset($v['ik503']) && $v['ik503']) ? " code ".$v['ik503']." ".edih_997_code_text('ak502', $v['ik503'])."
" : ""; - $str_html .= (isset($v['ik504']) && $v['ik504']) ? " code ".$v['ik504']." ".edih_997_code_text('ak502', $v['ik504'])."
" : ""; - $str_html .= (isset($v['ik505']) && $v['ik505']) ? " code ".$v['ik505']." ".edih_997_code_text('ak502', $v['ik505'])."
" : ""; + $str_html .= (isset($v['ik501']) && $v['ik501']) ? "Status " . text($v['ik501']) . " " . text(edih_997_code_text('ak501', $v['ik501'])) . "
" : ""; + $str_html .= (isset($v['ik502']) && $v['ik502']) ? " code " . text($v['ik502']) . " " . text(edih_997_code_text('ak502', $v['ik502'])) . "
" : ""; + $str_html .= (isset($v['ik503']) && $v['ik503']) ? " code " . text($v['ik503']) . " " . text(edih_997_code_text('ak502', $v['ik503'])) . "
" : ""; + $str_html .= (isset($v['ik504']) && $v['ik504']) ? " code " . text($v['ik504']) . " " . text(edih_997_code_text('ak502', $v['ik504'])) . "
" : ""; + $str_html .= (isset($v['ik505']) && $v['ik505']) ? " code " . text($v['ik505']) . " " . text(edih_997_code_text('ak502', $v['ik505'])) . "
" : ""; // $str_html .= "

".PHP_EOL; } diff --git a/library/edihistory/edih_archive.php b/library/edihistory/edih_archive.php index 56556350b..7c916bd7a 100644 --- a/library/edihistory/edih_archive.php +++ b/library/edihistory/edih_archive.php @@ -1,35 +1,35 @@ Report on edi files using archive date $strdt".PHP_EOL; + $str_html .= "

Report on edi files using archive date " . text($strdt) . "

".PHP_EOL; foreach ($params as $key => $param) { $old_ct = 0; $clm_ct = 0; @@ -88,7 +88,7 @@ function edih_archive_report($period = '') if (is_dir($fdir)) { $dir_ar = scandir($fdir); if (is_array($dir_ar) && ((count($dir_ar)-2) > 0)) { - $str_html .= "

Type ".$tp."

".PHP_EOL; + $str_html .= "

Type " . text($tp) . "

".PHP_EOL; $str_html .= "
    ".PHP_EOL; $dir_ct = count($dir_ar); foreach ($dir_ar as $fn) { @@ -156,17 +156,17 @@ function edih_archive_report($period = '') } // - $str_html .= "
  • files directory has $dir_ct files, using $dir_kb
  • ".PHP_EOL; - $str_html .= ($subdir_ct && ($tp != 'f837')) ? "
  • warning found $subdir_ct sub-directories
  • ".PHP_EOL : ""; - $str_html .= "
  • files csv table has $row_ct rows $mis
  • ".PHP_EOL; - $str_html .= ($clm_ct) ? "
  • there are $clm_ct claim transactions counted
  • ".PHP_EOL : ""; - $str_html .= ($old_ct) ? "
  • Archive date $strdt would archive $old_ct files
  • ".PHP_EOL : ""; + $str_html .= "
  • files directory has " . text($dir_ct) . " files, using " . text($dir_kb) . "
  • ".PHP_EOL; + $str_html .= ($subdir_ct && ($tp != 'f837')) ? "
  • warning found " . text($subdir_ct) . " sub-directories
  • ".PHP_EOL : ""; + $str_html .= "
  • files csv table has " . text($row_ct) . " rows " . text($mis) . "
  • ".PHP_EOL; + $str_html .= ($clm_ct) ? "
  • there are " . text($clm_ct) . " claim transactions counted
  • ".PHP_EOL : ""; + $str_html .= ($old_ct) ? "
  • Archive date " . text($strdt) . " would archive " . text($old_ct) . " files
  • ".PHP_EOL : ""; $str_html .= "
".PHP_EOL; } else { - $str_html .= "

Type $tp
-- empty $tp file directory

".PHP_EOL; + $str_html .= "

Type " . text($tp) . "
-- empty " . text($tp) . " file directory

".PHP_EOL; } } else { - $str_html .= "

warning $tp file directory does not exist

".PHP_EOL; + $str_html .= "

warning " . text($tp) . " file directory does not exist

".PHP_EOL; } } @@ -318,7 +318,7 @@ function edih_archive_csv_split($csv_ar, $filename_array) // return $arch_ar; } - + /** * Creates a zip archive of the files in the $filename_ar array and @@ -759,10 +759,10 @@ function edih_archive_restore($archive_name) // if (is_file($archdir.DS.$archive_name)) { $arch = realpath($archdir.DS.$archive_name); - $str_out .= "Archive: restoring $archive_name
"; + $str_out .= "Archive: restoring " . text($archive_name) . "
"; csv_edihist_log("edih_archive_restore: restoring $archive_name"); } else { - $str_out = "Archive: restore archive bad file name $archive_name
"; + $str_out = "Archive: restore archive bad file name " . text($archive_name) . "
"; csv_edihist_log("edih_archive_restore: restore archive bad file name $archive_name"); return $str_out; } @@ -773,21 +773,21 @@ function edih_archive_restore($archive_name) //$res = $zip_obj->open($arch, ZIPARCHIVE::CHECKCONS); if ($zip_obj->open($arch, ZIPARCHIVE::CHECKCONS) === true) { $f_ct = $zip_obj->numFiles; - $str_out .= "Extracting $f_ct items from $archive_name
"; + $str_out .= "Extracting " . text($f_ct) . " items from " . text($archive_name) . "
"; csv_edihist_log("edih_archive_restore: Extracting $f_ct items from $archive_name"); $isOK = $zip_obj->extractTo($tmpdir); if (!$isOK) { $msg = $zip_obj->getStatusString(); csv_edihist_log("edih_archive_restore: error extracting archive"); - $str_out .= "Archive: error extracting archive $archive_name
"; - $str_out .= "zipArchive: $msg
"; + $str_out .= "Archive: error extracting archive " . text($archive_name) . "
"; + $str_out .= "zipArchive: " . text($msg) . "
"; return $str_out; } } else { $msg = $zip_obj->getStatusString(); csv_edihist_log("edih_archive_restore: error opening archive"); $str_out .= "Archive: error opening archive
".PHP_EOL; - $str_out .= "zipArchive: $msg
"; + $str_out .= "zipArchive: " . text($msg) . "
"; return $str_out; } @@ -818,10 +818,10 @@ function edih_archive_restore($archive_name) // csv_edihist_log("edih_archive_restore: types in archive $tpstr"); - $str_out .= "Archive: types in archive $tpstr
".PHP_EOL; + $str_out .= "Archive: types in archive " . text($tpstr) . "
".PHP_EOL; // foreach ($type_ar as $ft) { - $str_out .= "Archive: now restoring $ft
".PHP_EOL; + $str_out .= "Archive: now restoring " . text($ft) . "
".PHP_EOL; csv_edihist_log("edih_archive_restore: now restoring $ft"); // $frows = edih_archive_csv_combine($ft, 'file'); @@ -838,20 +838,20 @@ function edih_archive_restore($archive_name) if (is_file($tmpdir.DS.$ft.DS.$fn)) { $rn = rename($tmpdir.DS.$ft.DS.$fn, $bdir.DS.$ft.DS.$fn); if (!$rn) { - $str_out .= " -- error restoring ".$ft.DS.$fn."
".PHP_EOL; + $str_out .= " -- error restoring " . text($ft) . DS . text($fn) ."
".PHP_EOL; csv_edihist_log("edih_archive_restore: error restoring ".$ft.DS.$fn); } } } // this will catch the csv files for the particulat type - $str_out .= "Archive: now replacing csv tables for $ft
".PHP_EOL; + $str_out .= "Archive: now replacing csv tables for " . text($ft) . "
".PHP_EOL; csv_edihist_log("edih_archive_restore: now replacing csv tables for $ft"); // $rnf = rename($tmpdir.DS.'cmb_files_'.$ft.'.csv', $bdir.DS.'csv'.DS.'files_'.$ft.'.csv'); $rnc = rename($tmpdir.DS.'cmb_claims_'.$ft.'.csv', $bdir.DS.'csv'.DS.'claims_'.$ft.'.csv'); - $str_out .= ($rnf) ? "" : " -- error restoring files_$ft.csv
".PHP_EOL; - $str_out .= ($rnc) ? "" : " -- error restoring claims_$ft.csv
".PHP_EOL; + $str_out .= ($rnf) ? "" : " -- error restoring files_" . text($ft) . ".csv
".PHP_EOL; + $str_out .= ($rnc) ? "" : " -- error restoring claims_" . text($ft) . ".csv
".PHP_EOL; } // @@ -860,7 +860,7 @@ function edih_archive_restore($archive_name) $rm = unlink($arch); if (!$rm) { csv_edihist_log("edih_archive_restore: error removing $archdir.DS.$archive_name"); - $str_out .= ($rnf) ? "" : " -- error removing $archdir.DS.$archive_name".PHP_EOL; + $str_out .= ($rnf) ? "" : " -- error removing " . text($archdir) . "." . DS . "." . text($archive_name) . PHP_EOL; } // @@ -880,7 +880,7 @@ function edih_archive_restore($archive_name) return $str_out; } - + /** * restores files from the tmp dir if the archive process needs to be aborted * @@ -941,7 +941,7 @@ function edih_archive_undo() if (in_array($fa, $types_ar)) { $fpath = $params[$fa]['directory']; if ($dh = opendir($tmpdir.DS.$fa)) { - $str_out .= "Archive: undo restoring $fa files
".PHP_EOL; + $str_out .= "Archive: undo restoring " . text($fa) . " files
".PHP_EOL; csv_edihist_log("edih_archive_undo: restoring $fa files"); while (false !== ($entry = readdir($dh))) { if ($entry != "." && $entry != "..") { @@ -1066,7 +1066,7 @@ function edih_archive_cleanup($archivename, $types_ar) $ul = unlink($tmpdir.DS.$td.DS.$fn); if (!$ul) { csv_edihist_log("edih_archive_cleanup: error removing file $fn"); - $str_out .= "

edih_archive_cleanup: error removing file ".$td.DS.$fn."

"; + $str_out .= "

edih_archive_cleanup: error removing file " . text($td) . DS . text($fn) . "

"; } else { $fct++; } @@ -1083,7 +1083,7 @@ function edih_archive_cleanup($archivename, $types_ar) return $str_out; } - + /** * The main function in this edih_archive.php script. This function gets the parameters array @@ -1117,7 +1117,7 @@ function edih_archive_main($period) $params = csv_parameters(); } else { csv_edihist_log("edih_archive_main: error creating archive date from $period"); - $out_html = "Error creating archive date from $period
" .PHP_EOL; + $out_html = "Error creating archive date from " . text($period) . "
" .PHP_EOL; } } else { $out_html = "Archive period invalid.
" .PHP_EOL; @@ -1128,7 +1128,7 @@ function edih_archive_main($period) if (is_dir($archive_dir)) { if (is_file($archive_dir.DS.$arch_fn)) { csv_edihist_log("edih_archive_main: archive file $arch_fn already exists"); - $out_html = "Archive: archive file $arch_fn already exists
" .PHP_EOL; + $out_html = "Archive: archive file " . text($arch_fn) . " already exists
" .PHP_EOL; return $out_html; } } else { @@ -1226,13 +1226,13 @@ function edih_archive_main($period) if (isset($arch_new['keep'])) { // write the new $frws = edih_archive_rewrite_csv($fn_files_keep, $fh_ar, $arch_new['keep']); - $out_html .= "type $ft keep files_csv file with $frws rows
"; + $out_html .= "type " . text($ft) . " keep files_csv file with " . text($frws) . " rows
"; } if (isset($arch_new['arch'])) { // write the old $frws2 = edih_archive_rewrite_csv($fn_files_arch, $fh_ar, $arch_new['arch']); - $out_html .= "type $ft archive files_csv file with $frws2 rows
"; + $out_html .= "type " . text($ft) . " archive files_csv file with " . text($frws2) . " rows
"; } } else { $out_html .= "type $ft error creating new files_csv tables"; @@ -1244,16 +1244,16 @@ function edih_archive_main($period) if (isset($arch_new['keep'])) { // write the new $crws = edih_archive_rewrite_csv($fn_claims_keep, $ch_ar, $arch_new['keep']); - $out_html .= "type $ft keep claims_csv file with $crws rows
"; + $out_html .= "type " . text($ft) . " keep claims_csv file with " . text($crws) . " rows
"; } if (isset($arch_new['arch'])) { // write the old $crws = edih_archive_rewrite_csv($fn_claims_arch, $ch_ar, $arch_new['arch']); - $out_html .= "type $ft archive claims_csv file with $crws rows
"; + $out_html .= "type " . text($ft) . " archive claims_csv file with " . text($crws) . " rows
"; } } else { - $out_html .= "type $ft error creating new claims csv tables
"; + $out_html .= "type " . text($ft) . " error creating new claims csv tables
"; } // now the csv_records are in files @@ -1285,15 +1285,15 @@ function edih_archive_main($period) // $rndir = mkdir($tmpdir.DS.$fdir); csv_edihist_log("edih_archive_main: $ft now moving old files "); $del = edih_archive_move_old($p, $fn_ar); - $out_html .= "Archive moved $del $ft type files
".PHP_EOL; + $out_html .= "Archive moved " . text($del . " " . $ft) . " type files
".PHP_EOL; // } else { csv_edihist_log("edih_archive_main: type $ft error in creating archive"); - $out_html .= "type $ft error in creating archive
" .PHP_EOL; + $out_html .= "type " . text($ft) . " error in creating archive
" .PHP_EOL; } } else { csv_edihist_log("edih_archive_main: search found no type $ft files older than $period"); - $out_html .= "Archive: type $ft archive found no files older than $period
" .PHP_EOL; + $out_html .= "Archive: type " . text($ft) . " archive found no files older than " . text($period) . "
" .PHP_EOL; } } // end foreach($params as $k=>$p) // @@ -1304,7 +1304,7 @@ function edih_archive_main($period) csv_edihist_log("edih_archive_main: moved $arch_fn to archive directory"); } else { csv_edihist_log("edih_archive_main: error moving archive file $arch_fn"); - $out_html .= "

edih_archive_main: error moving archive file $arch_fn

"; + $out_html .= "

edih_archive_main: error moving archive file " . text($arch_fn) . "

"; } } else { csv_edihist_log("edih_archive_main: is_file false $tmp_dir.DS.$arch_fn"); diff --git a/library/edihistory/edih_csv_data.php b/library/edihistory/edih_csv_data.php index 859190e20..566d3d823 100644 --- a/library/edihistory/edih_csv_data.php +++ b/library/edihistory/edih_csv_data.php @@ -51,7 +51,7 @@ function edih_csv_process_html($data_ar, $err_only = false) if (array_key_exists('type', $csvdata)) { $ft = $csvdata['type']; } else { - $str_html .= 'edih_csv_process_html() for '.$icn.' did not get type value'; + $str_html .= 'edih_csv_process_html() for ' . text($icn) . ' did not get type value'; csv_edihist_log('edih_csv_process_html: for '.$icn.' did not get type value'); return $str_html; } @@ -77,24 +77,24 @@ function edih_csv_process_html($data_ar, $err_only = false) $typ = (isset($csvfile['RspType'])) ? $csvfile['RspType'] : ''; $rej = (isset($csvfile['RejCt'])) ? $csvfile['RejCt'] : ''; // - $dt_str .= ($fn1) ? "$fn1 " : ""; - $dt_str .= ($dte) ? "  ".substr($dte, 0, 4)."-".substr($dte, 4, 2)."-".substr($dte, 6, 2) : ""; - $dt_str .= ($clmct) ? "  Claims ".$clmct : ""; + $dt_str .= ($fn1) ? "" . text($fn1) . " " : ""; + $dt_str .= ($dte) ? "  " . text(substr($dte, 0, 4)) . "-" . text(substr($dte, 4, 2)) . "-" . text(substr($dte, 6, 2)) : ""; + $dt_str .= ($clmct) ? "  Claims " . text($clmct) : ""; if ($ft == 'f997' || $ft == 'ta1') { - $dt_str .= ($typ) ? "  ".$typ : ""; - $dt_str .= ($rej) ? "  ".$rej : ""; - $dt_str .= ($trc) ? "  trace " : ""; + $dt_str .= ($typ) ? "  " . text($typ) : ""; + $dt_str .= ($rej) ? "  " . text($rej) : ""; + $dt_str .= ($trc) ? "  trace " : ""; } elseif ($ft == 'f277') { - $dt_str .= (isset($csvfile['Accept'])) ? "  Accpt ".$csvfile['Accept'] : ""; - $dt_str .= (isset($csvfile['Reject'])) ? "  Rej ".$csvfile['Reject'] : ""; + $dt_str .= (isset($csvfile['Accept'])) ? "  Accpt " . text($csvfile['Accept']) : ""; + $dt_str .= (isset($csvfile['Reject'])) ? "  Rej " . text($csvfile['Reject']) : ""; } elseif ($ft == 'f835') { - $dt_str .= (isset($csvfile['Denied'])) ? "  Denied ".$csvfile['Denied'] : ""; - $dt_str .= ($trc) ? "  Chk$trc " : ""; - $dt_str .= (isset($csvfile['Payer'])) ? "  ".$csvfile['Payer'] : ""; + $dt_str .= (isset($csvfile['Denied'])) ? "  Denied " . text($csvfile['Denied']) : ""; + $dt_str .= ($trc) ? "  Chk" . text($trc) . " " : ""; + $dt_str .= (isset($csvfile['Payer'])) ? "  " . text($csvfile['Payer']) : ""; } // - $str_html .= "
$dt_str
".PHP_EOL; + $str_html .= "
$dt_str
".PHP_EOL; $fidx++; } } @@ -150,30 +150,30 @@ function edih_csv_process_html($data_ar, $err_only = false) $dte = (isset($claim['ReqDate'])) ? $claim['ReqDate'] : $dte; $dte = (isset($claim['RspDate'])) ? $claim['RspDate'] : $dte; $dte = (isset($claim['FileDate'])) ? $claim['FileDate'] : $dte; - - $dd_str .= ($ptn) ? $ptn."  " : ""; - $dd_str .= ($dte) ? "  ".substr($dte, 0, 4)."-".substr($dte, 4, 2)."-".substr($dte, 6, 2) : ""; + + $dd_str .= ($ptn) ? text($ptn) . "  " : ""; + $dd_str .= ($dte) ? "  " . text(substr($dte, 0, 4)) . "-" . text(substr($dte, 4, 2)) . "-" . text(substr($dte, 6, 2)) : ""; if (strpos('|f277|f276|f270|f271|f278', $ft)) { - $dd_str .= ($sts) ? "  $sts" : ""; - $dd_str .= ($ins) ? "  $ins" : ""; - $dd_str .= ($clm) ? "  $clm" : ""; - $dd_str .= ($bht03) ? "  viewH  T " : ""; - $dd_str .= ($pid) ? "  trace$pid" : ""; - $dd_str .= ($auth && $auth == 'Rsp' || $auth == 'Reply') ? "trace" : ""; + $dd_str .= ($sts) ? "  " . text($sts) : ""; + $dd_str .= ($ins) ? "  " . text($ins) : ""; + $dd_str .= ($clm) ? "  " . text($clm) : ""; + $dd_str .= ($bht03) ? "  viewH  T " : ""; + $dd_str .= ($pid) ? "  trace" . text($pid) . "" : ""; + $dd_str .= ($auth && $auth == 'Rsp' || $auth == 'Reply') ? "trace" : ""; } elseif ($ft == 'f835') { $dd_str .= ($clm) ? "  Claim ID $ins" : ""; $dd_str .= ($ins) ? "  InsLevel $ins" : ""; - $dd_str .= ($pid) ? "  $pid HT" : ""; + $dd_str .= ($pid) ? "  $pid HT" : ""; } elseif ($ft == 'f997') { - $dd_str .= ($trc) ? "  trace" : ""; - $dd_str .= ($err) ? "  ".substr($err, 0, 8) : ""; + $dd_str .= ($trc) ? "  trace" : ""; + $dd_str .= ($err) ? "  " . text(substr($err, 0, 8)) : ""; } else { - $dd_str .= ($pid) ? "  $pid" : ""; + $dd_str .= ($pid) ? "  " . text($pid) . "" : ""; } - $dd_str .= ($fn1) ? "  file" : ""; + $dd_str .= ($fn1) ? "  file" : ""; // - $clm_html .= "
$dd_str
".PHP_EOL; + $clm_html .= "
$dd_str
".PHP_EOL; // } } @@ -218,7 +218,7 @@ function edih_list_denied_claims($filetype, $filename, $trace = '') } elseif (strpos('|f271|f277|f835', $ft)) { $row_ar = csv_denied_by_file($ft, $filename, $trace); } else { - $str_html .= "Invalid file type $filetype for denied claim search
"; + $str_html .= "Invalid file type " . text($filetype) . " for denied claim search
"; csv_edihist_log("edih_list_denied_claims: wrong filetype $filetype"); return $str_html; } @@ -228,45 +228,45 @@ function edih_list_denied_claims($filetype, $filename, $trace = '') $rw_ct = count($row_ar); $rwct = 0; $str_html .= "

Denied/Rejected Claims Listing

".PHP_EOL; - $str_html .= "
$rw_ct claims File $filename "; + $str_html .= "
" . text($rw_ct) . " claims File" . text($filename) . " "; $str_html .= ($trace) ? "Trace $trace
".PHP_EOL : "".PHP_EOL; if ($ft == 'f835') { foreach ($row_ar as $row) { $oe = ( $rwct % 2 ) ? 'codd' : 'ceven'; $rwct++; - $str_html .= "
{$row[0]} {$row[2]}
".PHP_EOL; + $str_html .= "
" . text($row[0]) . " " . text($row[2]) . "
".PHP_EOL; } } elseif ($ft == 'f277') { foreach ($row_ar as $row) { $oe = ( $rwct % 2 ) ? 'codd' : 'ceven'; $rwct++; - $str_html .= "
{$row[0]} {$row[4]}
".PHP_EOL; + $str_html .= "
" . text($row[0]) . " " . text($row[4]) . "
".PHP_EOL; } } elseif ($ft == 'f271') { foreach ($row_ar as $row) { $oe = ( $rwct % 2 ) ? 'codd' : 'ceven'; $rwct++; - $str_html .= "
{$row[0]} {$row[4]}
".PHP_EOL; + $str_html .= "
" . text($row[0]) . " " . text($row[4]) . "
".PHP_EOL; } } elseif ($ft == 'f997') { foreach ($row_ar as $row) { $oe = ( $rwct % 2 ) ? 'codd' : 'ceven'; $rwct++; - $str_html .= "
{$row[0]} {$row[2]}
".PHP_EOL; + $str_html .= "
" . text($row[0]) . " " . text($row[2]) . "
".PHP_EOL; } } // $str_html .= "
".PHP_EOL; } else { - $str_html .= "Search returned no data rows from file $filename
"; + $str_html .= "Search returned no data rows from file " . text($filename) . "
"; csv_edihist_log("edih_list_denied_claims: no rows returned $filetype $filename $trace"); } // return $str_html; } - + /** * check the csv claims tables and return rows for a particular encounter @@ -286,7 +286,7 @@ function edih_claim_history($encounter) if ($encounter) { $e = (string)$encounter; } else { - return 'invalid encounter value '.$encounter.'
'.PHP_EOL; + return 'invalid encounter value ' . text($encounter) . '
'.PHP_EOL; } // use function csv_table_select_list() so that only @@ -302,7 +302,7 @@ function edih_claim_history($encounter) } // - $ch_html = "
"; + $ch_html = "
Encounter Record for $e
"; $ch_html .= "".PHP_EOL; // if (in_array('f837', $rtypes)) { @@ -310,7 +310,7 @@ function edih_claim_history($encounter) $btar = csv_file_by_enctr($e, $tp); // if (is_array($btar) && count($btar)) { - $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; $ch_html .= "".PHP_EOL; $ch_html .= "".PHP_EOL; $ch_html .= "".PHP_EOL; @@ -319,16 +319,16 @@ function edih_claim_history($encounter) //array('PtName', 'SvcDate', 'CLM01', 'InsLevel', 'Control', 'FileName', 'Fee', 'PtPaid', 'Provider' ); $ch_html .= "".PHP_EOL; // - $ch_html .= "".PHP_EOL; - $ch_html .= "".PHP_EOL; - $ch_html .= "".PHP_EOL; - $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; // $ch_html .= "".PHP_EOL; } } else { $ch_html .= "".PHP_EOL; - $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; $ch_html .= "".PHP_EOL; } } @@ -339,7 +339,7 @@ function edih_claim_history($encounter) $f997ar = csv_file_by_enctr($e, $tp); // if (is_array($f997ar) && count($f997ar)) { - $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; $ch_html .= "".PHP_EOL; $ch_html .= "".PHP_EOL; $ch_html .= "".PHP_EOL; @@ -349,14 +349,14 @@ function edih_claim_history($encounter) //array('PtName', 'RspDate', 'Trace', 'Status', 'Control', 'FileName', 'RspType', 'err_seg');; $ch_html .= ""; $ch_html .= "".PHP_EOL; - $ch_html .= "".PHP_EOL; - $ch_html .= "".PHP_EOL; - $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; $ch_html .= "".PHP_EOL; } } else { $ch_html .= ""; - $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; $ch_html .= "".PHP_EOL; } } @@ -367,7 +367,7 @@ function edih_claim_history($encounter) $f277ar = csv_file_by_enctr($e, $tp); // if (is_array($f277ar) && count($f277ar)) { - $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; $ch_html .= "".PHP_EOL; $ch_html .= "".PHP_EOL; $ch_html .= "".PHP_EOL; @@ -376,15 +376,15 @@ function edih_claim_history($encounter) $ch_html .= ""; // $ch_html .= "".PHP_EOL; - $ch_html .= "".PHP_EOL; - $ch_html .= "".PHP_EOL; - $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; // $ch_html .= "".PHP_EOL; } } else { $ch_html .= ""; - $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; $ch_html .= "".PHP_EOL; } } @@ -395,7 +395,7 @@ function edih_claim_history($encounter) $f835ar = csv_file_by_enctr($e, $tp); // if (is_array($f835ar) && count($f835ar)) { - $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; $ch_html .= "".PHP_EOL; $ch_html .= "".PHP_EOL; $ch_html .= "".PHP_EOL; @@ -405,16 +405,16 @@ function edih_claim_history($encounter) // array('PtName', 'SvcDate', 'CLM01', 'Status', 'Trace', 'FileName', 'ClaimID', 'Pmt', 'PtResp', 'Payer'); $ch_html .= ""; // - $ch_html .= "".PHP_EOL; - $ch_html .= "".PHP_EOL; - $ch_html .= "".PHP_EOL; - $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; // $ch_html .= "".PHP_EOL; } } else { $ch_html .= ""; - $ch_html .= "".PHP_EOL; + $ch_html .= "".PHP_EOL; $ch_html .= "".PHP_EOL; } @@ -467,20 +467,20 @@ function edih_csv_to_html($file_type, $csv_type, $period = '', $datestart = '', $rwct = count($csv_ar); } else { csv_edihist_log("edih_csv_to_html: error opening csv file $file_type $csv_type"); - $csv_html .= "error opening csv file $file_type $csv_type
"; + $csv_html .= "error opening csv file " . text($file_type) . " " . text($csv_type) . "
"; return false; } } else { $csv_html .= "invalid arguments for opening csv table
"; return false; } - + $tp = csv_file_type($file_type); if ($tp) { $params = csv_parameters($tp); } else { csv_edihist_log("csv_to_html error: incorrect file type $file_type"); - $csv_html .= "csv_to_html error: incorrect file type $file_type
".PHP_EOL; + $csv_html .= "csv_to_html error: incorrect file type " . text($file_type) . "
".PHP_EOL; return false; } @@ -577,14 +577,14 @@ function edih_csv_to_html($file_type, $csv_type, $period = '', $datestart = '', // if ($is_date) { //$csv_html .= "
".PHP_EOL; - $csv_html .= "

Table: $tp_lbl  $tp   Start: $datestart   End: $dateend  Rows: $rwct  Shown: $ln_ct

".PHP_EOL; + $csv_html .= "

Table: " . text($tp_lbl) . "  " . text($tp) . "   Start: " . text($datestart) . "   End: " . text($dateend) . "  Rows: " . text($rwct) . "  Shown: " . text($ln_ct) . "

".PHP_EOL; //$csv_html .= "
".PHP_EOL; } elseif ($is_period) { //div id='dttl'> - $csv_html .= "

Table: $tp_lbl  $tp  From Date: $dtpdlbl  Rows: $rwct  Shown: $ln_ct

".PHP_EOL; + $csv_html .= "

Table: " . text($tp_lbl) . "  " . text($tp) . "  From Date: " . text($dtpdlbl) . "  Rows: " . text($rwct) . "  Shown: " . text($ln_ct) . "

".PHP_EOL; } else { //
- $csv_html .= "

Table: $tp_lbl  $tp  All Dates Rows: $rwct   Shown: $ln_ct

".PHP_EOL; + $csv_html .= "

Table: " . text($tp_lbl) . "  " . text($tp) . "  All Dates Rows: " . text($rwct) . "   Shown: " . text($ln_ct) . "

".PHP_EOL; } // @@ -604,28 +604,28 @@ function edih_csv_to_html($file_type, $csv_type, $period = '', $datestart = '', //array('Date', 'FileName', 'Control', 'Trace', 'Claim_ct', 'Denied', 'Payer') foreach ($csv_d as $val) { $bgc = ($idx % 2 == 1 ) ? 'odd' : 'even'; - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; foreach ($val as $k => $v) { if ($k == 'Date') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'FileName') { $fn = $v; - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'Control') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'Trace') { $trc = $v; - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'Claim_ct') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'Denied') { if ((int)$v > 0) { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } else { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } } else { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } } @@ -636,25 +636,25 @@ function edih_csv_to_html($file_type, $csv_type, $period = '', $datestart = '', //array('Date', 'FileName', 'Control', 'Trace', 'RspType', 'RejCt') foreach ($csv_d as $val) { $bgc = ($idx % 2 == 1 ) ? 'odd' : 'even'; - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; // $rsp = $val['RspType']; foreach ($val as $k => $v) { if ($k == 'Date') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'FileName') { $fn = $v; - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'Trace') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'RejCt') { if ((int)$v > 0) { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } else { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } } else { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } } @@ -667,22 +667,22 @@ function edih_csv_to_html($file_type, $csv_type, $period = '', $datestart = '', // the generic case -- for 'file' type tables foreach ($csv_d as $val) { $bgc = ($idx % 2 == 1 ) ? 'odd' : 'even'; - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; foreach ($val as $k => $v) { if ($k == 'Date') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'FileName') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'Control') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'Reject') { if ((int)$v > 0) { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } else { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } } else { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } } @@ -696,18 +696,18 @@ function edih_csv_to_html($file_type, $csv_type, $period = '', $datestart = '', // array('PtName', 'SvcDate', 'CLM01', 'InsLevel', 'Control', 'FileName', 'Fee', 'PtPaid', 'Provider' ); foreach ($csv_d as $val) { $bgc = ($idx % 2 == 1 ) ? 'odd' : 'even'; - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; // needed values for links $fn = $val['FileName']; foreach ($val as $k => $v) { if ($k == 'CLM01') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'SvcDate') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'FileName') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } else { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } } @@ -718,23 +718,23 @@ function edih_csv_to_html($file_type, $csv_type, $period = '', $datestart = '', // array('PtName', 'SvcDate', 'CLM01', 'Status', 'Trace', 'FileName', 'ClaimID', 'Pmt', 'PtResp', 'Payer') foreach ($csv_d as $val) { $bgc = ($idx % 2 == 1 ) ? 'odd' : 'even'; - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; // needed values for links $fn = $val['FileName']; $pid = $val['CLM01']; foreach ($val as $k => $v) { if ($k == 'SvcDate') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'CLM01') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'Trace') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'FileName') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } else { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } } @@ -745,24 +745,24 @@ function edih_csv_to_html($file_type, $csv_type, $period = '', $datestart = '', // array('PtName', 'SvcDate', 'CLM01', 'Status', 'BHT03', 'FileName', 'Payer', 'Ins_ID', 'Trace'); foreach ($csv_d as $val) { $bgc = ($idx % 2 == 1 ) ? 'odd' : 'even'; - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; // needed values for links $fn = $val['FileName']; $bht03 = $val['BHT03']; $trc = $val['CLM01']; foreach ($val as $k => $v) { if ($k == 'SvcDate') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'CLM01') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'BHT03') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'FileName') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } else { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } } @@ -773,23 +773,23 @@ function edih_csv_to_html($file_type, $csv_type, $period = '', $datestart = '', // array('PtName', 'ReqDate', 'CLM01', 'InsBnft', 'BHT03', 'FileName', 'Payer', 'Trace'); foreach ($csv_d as $val) { $bgc = ($idx % 2 == 1 ) ? 'odd' : 'even'; - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; // needed values for links $fn = $val['FileName']; $bht03 = $val['BHT03']; $trc = $val['CLM01']; foreach ($val as $k => $v) { if ($k == 'ReqDate') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'CLM01') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'BHT03') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'FileName') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } else { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } } @@ -800,19 +800,19 @@ function edih_csv_to_html($file_type, $csv_type, $period = '', $datestart = '', // array('PtName', 'ReqDate', 'Trace', 'InsBnft', 'BHT03', 'FileName', 'Payer'); foreach ($csv_d as $val) { $bgc = ($idx % 2 == 1 ) ? 'odd' : 'even'; - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; // needed values for links $fn = $val['FileName']; $bht03 = $val['BHT03']; foreach ($val as $k => $v) { if ($k == 'ReqDate') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'BHT03') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'FileName') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } else { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } } @@ -823,21 +823,21 @@ function edih_csv_to_html($file_type, $csv_type, $period = '', $datestart = '', // array('PtName', 'RspDate', 'Trace', 'Status', 'BHT03', 'FileName', 'Payer'); foreach ($csv_d as $val) { $bgc = ($idx % 2 == 1 ) ? 'odd' : 'even'; - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; // needed values for links $fn = $val['FileName']; $bht03 = $val['BHT03']; foreach ($val as $k => $v) { if ($k == 'RspDate') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'BHT03') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'FileName') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } else { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } } @@ -848,19 +848,19 @@ function edih_csv_to_html($file_type, $csv_type, $period = '', $datestart = '', // array('PtName', 'FileDate', 'Trace', 'Status', 'BHT03', 'FileName', 'Auth', 'Payer') foreach ($csv_d as $val) { $bgc = ($idx % 2 == 1 ) ? 'odd' : 'even'; - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; // needed values for links $fn = $val['FileName']; $bht03 = $val['BHT03']; foreach ($val as $k => $v) { if ($k == 'FileDate') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'BHT03') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'FileName') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } else { $csv_html .= "".PHP_EOL; } @@ -880,15 +880,15 @@ function edih_csv_to_html($file_type, $csv_type, $period = '', $datestart = '', $err = $val['err_seg']; foreach ($val as $k => $v) { if ($k == 'RspDate') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'FileName') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'Trace') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } elseif ($k == 'err_seg') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } else { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } } @@ -899,12 +899,12 @@ function edih_csv_to_html($file_type, $csv_type, $period = '', $datestart = '', // all types in the tables are covered in an elseif, so this is unexpected foreach ($csv_d as $val) { $bgc = ($idx % 2 == 1 ) ? 'odd' : 'even'; - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; foreach ($val as $k => $v) { if ($k == 'FileName') { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } else { - $csv_html .= "".PHP_EOL; + $csv_html .= "".PHP_EOL; } } diff --git a/library/edihistory/edih_csv_inc.php b/library/edihistory/edih_csv_inc.php index e0a8b630f..8ce9adc55 100644 --- a/library/edihistory/edih_csv_inc.php +++ b/library/edihistory/edih_csv_inc.php @@ -44,7 +44,7 @@ * * * The claim_history x12 files are claim (837) acknowledgement (997/999) claim status (277) and claim payment (835) - * Also eligibility request (270) and eligibility response (271) + * Also eligibility request (270) and eligibility response (271) * *
  * Basic workflow:
@@ -146,7 +146,7 @@ function csv_log_html($logname = '')
         $fh = fopen($fp, 'r');
         if ($fh !== false) {
             while (($buffer = fgets($fh)) !== false) {
-                $html_str .= "
  • ".$buffer."
  • ".PHP_EOL; + $html_str .= "
  • " . text($buffer) . "
  • ".PHP_EOL; } $html_str .= "".PHP_EOL."".PHP_EOL; @@ -318,7 +318,7 @@ function csv_notes_file($content = '', $open = true) $ftxt = '## '. date("F j, Y, g:i a"); } - $str_html .= PHP_EOL.$ftxt.PHP_EOL; + $str_html .= PHP_EOL . text($ftxt) . PHP_EOL; // next stanza for saving content } elseif (strlen($content)) { //echo "csv_notes_file: we have content
    ".PHP_EOL; @@ -328,14 +328,14 @@ function csv_notes_file($content = '', $open = true) $mimeinfo = $finfo->buffer($content); if (strncmp($mimeinfo, 'text/plain; charset=us-ascii', 28) !== 0) { csv_edihist_log('csv_notes_file: invalid mime-type '.$mimeinfo); - $str_html = 'csv_notes_file: invalid mime-type
    '.$mimeinfo; + $str_html = 'csv_notes_file: invalid mime-type
    ' . text($mimeinfo); // return $str_html; } } elseif (preg_match('/[^\x20-\x7E\x0A\x0D]|(<\?)|(<%)|(' . PHP_EOL; + $str_html .= ' character: ' . text($matches[0][0]) . ' position: ' . text($matches[0][1]) . '
    ' . PHP_EOL; // return $str_html; } @@ -434,22 +434,22 @@ function csv_setup() $isOK = true; //csv_edihist_log('setup: directory '.$basedir); $out_str .= 'EDI_History Setup should not overwrite existing data.
    '.PHP_EOL; - $out_str .= 'Setup: directory '.$basedir.'
    '.PHP_EOL; + $out_str .= 'Setup: directory ' . text($basedir) . '
    '.PHP_EOL; // if (is_dir($edihist_dir) || mkdir($edihist_dir, 0755)) { - $out_str .= 'created folder '.$edihist_dir.'
    '.PHP_EOL; + $out_str .= 'created folder ' . text($edihist_dir) . '
    '.PHP_EOL; $isOK = true; if (is_dir($csv_dir) || mkdir($csv_dir, 0755)) { - $out_str .= 'created folder '.$csv_dir.'
    '.PHP_EOL; + $out_str .= 'created folder ' . text($csv_dir) . '
    '.PHP_EOL; $isOK = true; } else { $isOK = false; $out_str .= 'Setup: Failed to create csv folder... '.'
    '.PHP_EOL; - die('Failed to create csv folder... '.$archive_dir); + die('Failed to create csv folder... ' . text($archive_dir)); } if (is_dir($archive_dir) || mkdir($archive_dir, 0755)) { - $out_str .= 'created folder '.$archive_dir.'
    '.PHP_EOL; + $out_str .= 'created folder ' . text($archive_dir) . '
    '.PHP_EOL; $isOK = true; } else { $isOK = false; @@ -458,7 +458,7 @@ function csv_setup() } if (is_dir($log_dir) || mkdir($log_dir, 0755)) { - $out_str .= 'created folder '.$log_dir.'
    '.PHP_EOL; + $out_str .= 'created folder ' . text($log_dir) . '
    '.PHP_EOL; $isOK = true; } else { $isOK = false; @@ -467,7 +467,7 @@ function csv_setup() } if (is_dir($tmp_dir) || mkdir($tmp_dir, 0755)) { - $out_str .= 'created folder '.$tmp_dir.PHP_EOL; + $out_str .= 'created folder ' . text($tmp_dir) . PHP_EOL; $isOK = true; } else { $isOK = false; @@ -476,13 +476,13 @@ function csv_setup() } } else { $isOK = false; - $out_str .= 'Setup failed: cannot write to folder '.$basedir.'
    '.PHP_EOL; - die('Setup failed: cannot write to '.$basedir); + $out_str .= 'Setup failed: cannot write to folder ' . text($basedir) . '
    '.PHP_EOL; + die('Setup failed: cannot write to ' . text($basedir)); } } else { $isOK = false; $out_str .= 'Setup: Failed to create history folder... '.'
    '.PHP_EOL; - die('Failed to create history folder... '.$edihist_dir); + die('Failed to create history folder... ' . text($edihist_dir)); } if ($isOK) { @@ -496,9 +496,9 @@ function csv_setup() if (is_file($csv_dir.DS.$file) && strpos($file, 'csv')) { $rn = rename($csv_dir.DS.$file, $csv_dir.DS.'old_'.$file); if ($rn) { - $out_str .= 'renamed csv/'.$file.' to old_'.$file.'
    '.PHP_EOL; + $out_str .= 'renamed csv/' . text($file) . ' to old_' . text($file) . '
    '.PHP_EOL; } else { - $out_str .= 'attempt to rename csv/'.$file.' failed
    '.PHP_EOL; + $out_str .= 'attempt to rename csv/' . text($file) . ' failed
    '.PHP_EOL; } } } @@ -511,7 +511,7 @@ function csv_setup() $type_dir = $p_ar[$key]['directory']; // if (is_dir($type_dir)) { - $out_str .= 'folder for '.$tp.' exists '.$type_dir.'
    '.PHP_EOL; + $out_str .= 'folder for ' . text($tp) . ' exists ' . text($type_dir) . '
    '.PHP_EOL; } elseif (mkdir($type_dir, 0755)) { if ($tp == 'f835') { // in upgrade case the f835 directory should not exist @@ -529,19 +529,19 @@ function csv_setup() } } - $out_str .= 'created type folder '.$type_dir.' and moved '.$fct.' of '.$rct.' files from /era
    '.PHP_EOL; + $out_str .= 'created type folder ' . text($type_dir) . ' and moved ' . text($fct) . ' of ' . text($rct) . ' files from /era
    '.PHP_EOL; } } else { - $out_str .= 'created type folder '.$type_dir.'
    '.PHP_EOL; + $out_str .= 'created type folder ' . text($type_dir) . '
    '.PHP_EOL; } } else { - $out_str .= 'Setup failed to create directory for '.$tp.'
    '.PHP_EOL; + $out_str .= 'Setup failed to create directory for ' . text($tp) . '
    '.PHP_EOL; } } } else { $out_str .= 'Setup failed: Can not create directories
    '.PHP_EOL; } - + if ($isOK) { csv_edihist_log($out_str); return true; @@ -1262,7 +1262,7 @@ function csv_thead_html($file_type, $csv_type, $tblhd = null) $str_html .= "
    ".PHP_EOL."".PHP_EOL; foreach ($hvals as $val) { - $str_html .=""; + $str_html .=""; } $str_html .= PHP_EOL."".PHP_EOL."".PHP_EOL; @@ -1466,7 +1466,7 @@ function csv_singlerecord_test($array) /* * give first and last index keys for an array - * + * * @param array * @return array */ @@ -1492,7 +1492,7 @@ function csv_array_bounds($array) * the first row is the header or array keys for the row * array structure: * array[i]=>array(hdr0=>csvrow[0], hdr1=>csvrow[1], hdr2=>csvrow[2], ...) - * + * * @param string file type e.g. f837 * @param string csv type claim or file * @return array @@ -1833,7 +1833,7 @@ function csv_file_by_enctr($clm01, $filetype = 'f837') $srchtype = 'pid'; } else { csv_edihist_log('csv_file_by_enctr: unable to determine encounter value '.$clm01); - return 'unable to determine encounter value '.$clm01.'
    '.PHP_EOL; + return 'unable to determine encounter value ' . text($clm01) . '
    '.PHP_EOL; } // OpenEMR creates CLM01 as nnn-nnn in genX12 batch @@ -1894,7 +1894,7 @@ function csv_file_by_enctr($clm01, $filetype = 'f837') return $ret_ar; } - + /** * get the x12 file containing the control_num ISA13 * diff --git a/library/edihistory/edih_io.php b/library/edihistory/edih_io.php index be5407303..452b4e5c0 100644 --- a/library/edihistory/edih_io.php +++ b/library/edihistory/edih_io.php @@ -147,25 +147,25 @@ function edih_html_heading($option, $title = '') $str_html .= "".PHP_EOL."".PHP_EOL; if ($option == 'newfiles') { - $str_html = str_replace('##TITLE##', 'Process New Files '.$title, $str_html); + $str_html = str_replace('##TITLE##', 'Process New Files '.text($title), $str_html); } elseif ($option == 'eradisplay') { - $str_html = str_replace('##TITLE##', 'ERA Display '.$title, $str_html); + $str_html = str_replace('##TITLE##', 'ERA Display '.text($title), $str_html); } elseif ($option == 'claimstatus') { - $str_html = str_replace('##TITLE##', 'Claim Status '.$title, $str_html); + $str_html = str_replace('##TITLE##', 'Claim Status '.text($title), $str_html); } elseif ($option == 'eligibility') { - $str_html = str_replace('##TITLE##', 'Eligiility '.$title, $str_html); + $str_html = str_replace('##TITLE##', 'Eligiility '.text($title), $str_html); } elseif ($option == 'authorization') { - $str_html = str_replace('##TITLE##', 'Authorization '.$title, $str_html); + $str_html = str_replace('##TITLE##', 'Authorization '.text($title), $str_html); } elseif ($option == 'x12display') { - $str_html = str_replace('##TITLE##', 'x12 File '.$title, $str_html); + $str_html = str_replace('##TITLE##', 'x12 File '.text($title), $str_html); } elseif ($option == 'csvtable') { - $str_html = str_replace('##TITLE##', 'CSV Table '.$title, $str_html); + $str_html = str_replace('##TITLE##', 'CSV Table '.text($title), $str_html); } elseif ($option == 'textdisplay') { - $str_html = str_replace('##TITLE##', 'Text '.$title, $str_html); + $str_html = str_replace('##TITLE##', 'Text '.text($title), $str_html); } elseif ($option == 'readme') { - $str_html = str_replace('##TITLE##', 'Readme '.$title, $str_html); + $str_html = str_replace('##TITLE##', 'Readme '.text($title), $str_html); } else { - $str_html = str_replace('##TITLE##', 'OEMR edi_history '.$title, $str_html); + $str_html = str_replace('##TITLE##', 'OEMR edi_history '.text($title), $str_html); } // @@ -342,8 +342,8 @@ function edih_disp_file_process() //$str_html .= "
    Encounter Record for " . text($e) . "
    837 Claim ".count($btar)."
    837 Claim " . text(count($btar)) . "
    NameSvcDateCLM01File
    {$ch['PtName']}$dt{$ch['CLM01']}{$ch['FileName']}" . text($ch['PtName']) . "" . text($dt) . "" . text($ch['CLM01']) . "" . text($ch['FileName']) . "
    837 Claim -- Nothing found for $e837 Claim -- Nothing found for " . text($e) . "
    Ack 997/999 ".count($f997ar)."
    Ack 997/999 " . text(count($f997ar)) . "
    Acknowledgement FileNotes
    Rsp Ack{$ch['Status']}{$ch['FileName']}{$ch['RspType']} {$ch['RspDate']}" . text($ch['Status']) . "" . text($ch['FileName']) . "" . text($ch['RspType']) . " " . text($ch['RspDate']) . "
    Ack 997/999 -- Nothing found for $eAck 997/999 -- Nothing found for " . text($e) . "
    Status 277 ".count($f277ar)."
    Status 277 " . text(count($f277ar)) . "
    ResponseStatusFileClaimID
    Claim Status{$ch['Status']}{$ch['FileName']}{$ch['Trace']}" . text($ch['Status']) . "" . text($ch['FileName']) . "" . text($ch['Trace']) . "
    Status 277 -- Nothing found for $eStatus 277 -- Nothing found for " . text($e) . "
    Payment 835 ".count($f835ar)."
    Payment 835 " . text(count($f835ar)) . "
    ResponseStatusTracePayer
    {$ch['PtName']}{$ch['Status']}{$ch['Trace']}{$ch['Payer']}" . text($ch['PtName']) . "" . text($ch['Status']) . "" . text($ch['Trace']) . "" . text($ch['Payer']) . "
    Payment 835 -- Nothing found for $ePayment 835 -- Nothing found for " . text($e) . "
    ".substr($v, 0, 4).'-'.substr($v, 4, 2).'-'.substr($v, 6, 2)."" . text(substr($v, 0, 4)) . '-' . text(substr($v, 4, 2)) . '-' . text(substr($v, 6, 2)) . "$v" . text($v) . "$v" . text($v) . "$v" . text($v) . "$v P?" . text($v) . " P?$v" . text($v) . "$v" . text($v) . "$v" . text($v) . "
    ".substr($v, 0, 4).'-'.substr($v, 4, 2).'-'.substr($v, 6, 2)."" . text(substr($v, 0, 4)) . '-' . text(substr($v, 4, 2)) . '-' . text(substr($v, 6, 2)) ."$v" . text($v) . "$v" . text($v) . "$v" . text($v) . "$v" . text($v) . "$v" . text($v) . "
    ".substr($v, 0, 4).'-'.substr($v, 4, 2).'-'.substr($v, 6, 2)."" . text(substr($v, 0, 4)) . '-' . text(substr($v, 4, 2)) . '-' . text(substr($v, 6, 2)) . "$v" . text($v) . "$v" . text($v) . "$v" . text($v) . "$v" . text($v) . "$v" . text($v) . "
    $v" . text($v) . "".substr($v, 0, 4).'-'.substr($v, 4, 2).'-'.substr($v, 6, 2)."" . text(substr($v, 0, 4)) . '-' . text(substr($v, 4, 2)) . '-' . text(substr($v, 6, 2)) . "$v" . text($v) . "$v" . text($v) . "
    ".substr($v, 0, 4).'-'.substr($v, 4, 2).'-'.substr($v, 6, 2)."" . text(substr($v, 0, 4)) . '-' . text(substr($v, 4, 2)) . '-' . text(substr($v, 6, 2)) . "$v H "; - $csv_html .= " T" . text($v) . " H "; + $csv_html .= " T$v" . text($v) . "File H "; - $csv_html .= " TFile H "; + $csv_html .= " T$v" . text($v) . "
    ".substr($v, 0, 4).'-'.substr($v, 4, 2).'-'.substr($v, 6, 2)."" . text(substr($v, 0, 4)) . '-' . text(substr($v, 4, 2)) . '-' . text(substr($v, 6, 2)) . "$v" . text($v) . "$v H "; - $csv_html .= " T" . text($v) . " H "; + $csv_html .= " TFile H "; - $csv_html .= " TFile H "; + $csv_html .= " T$v" . text($v) . "
    ".substr($v, 0, 4).'-'.substr($v, 4, 2).'-'.substr($v, 6, 2)."" . text(substr($v, 0, 4)) . '-' . text(substr($v, 4, 2)) . '-' . text(substr($v, 6, 2)) . "$v" . text($v) . "$v H "; - $csv_html .= " T" . text($v) . " H "; + $csv_html .= " T$v" . text($v) . "$v" . text($v) . "
    ".substr($v, 0, 4).'-'.substr($v, 4, 2).'-'.substr($v, 6, 2)."" . text(substr($v, 0, 4)) . '-' . text(substr($v, 4, 2)) . '-' . text(substr($v, 6, 2)) . " $v " . text($v) . "$v" . text($v) . "$v" . text($v) . "
    ".substr($v, 0, 4).'-'.substr($v, 4, 2).'-'.substr($v, 6, 2)."" . text(substr($v, 0, 4)) . '-' . text(substr($v, 4, 2)) . '-' . text(substr($v, 6, 2)) . "$v H ".PHP_EOL; - $csv_html .= " T" . text($v) . " H ".PHP_EOL; + $csv_html .= " T File H "; - $csv_html .= " T File H "; + $csv_html .= " T$v" . text($v) . "
    ".substr($v, 0, 4).'-'.substr($v, 4, 2).'-'.substr($v, 6, 2)."" . text(substr($v, 0, 4)) . '-' . text(substr($v, 4, 2)) . '-' . text(substr($v, 6, 2)) . "$v H ".PHP_EOL; - $csv_html .= " T" . text($v) . " H ".PHP_EOL; + $csv_html .= " T File H "; - $csv_html .= " T File H "; + $csv_html .= " T$v".substr($v, 0, 4).'-'.substr($v, 4, 2).'-'.substr($v, 6, 2)."" . text(substr($v, 0, 4)) .'-' . text(substr($v, 4, 2)) . '-' . text(substr($v, 6, 2)) . "$v" . text($v) . "$v" . text($v) . "".substr($v, 0, 8)."..." . text(substr($v, 0, 8)) . "...$v" . text($v) . "
    $v" . text($v) . "$v" . text($v) . "
    $val" . text($val) . "
    ".PHP_EOL; //$str_html .= csv_thead_html($tp, 'file'); //$str_html .= "".PHP_EOL; - $str_html .= "

    $tp $dirct files $dtl

    ".PHP_EOL; - $str_html .= "
    ".PHP_EOL; + $str_html .= "

    " . text($tp) . " " . text($dirct) . " files " . text($dtl) . "

    ".PHP_EOL; + $str_html .= "
    ".PHP_EOL; } foreach ($upload_ar as $fn) { @@ -359,11 +359,11 @@ function edih_disp_file_process() //$str_html .= ($htm) ? "
    ".PHP_EOL."
    $tp Files Summary $dtl
    ".PHP_EOL : ""; $str_html .= ($htm) ? "".PHP_EOL : ""; } else { - $str_html .= "

    No new $tp files

    "; + $str_html .= "

    No new " . text($tp) . " files

    "; } } - $capt_html = "

    Process new files ($fct files)

    ".PHP_EOL; + $capt_html = "

    Process new files (" . text($fct) . " files)

    ".PHP_EOL; return $capt_html . $str_html; } @@ -480,7 +480,7 @@ function edih_disp_x12trans() if ($fname) { $str_htm .= edih_display_text($fname, $rsptype, $trace, $err); } else { - $str_htm .= "

    Did not find $trace in the $rsptype claims table.

    "; + $str_htm .= "

    Did not find " . text($trace) . " in the " . text($rsptype) . " claims table.

    "; } //$fnar = csv_file_by_enctr($trace, $rsptype, $srchtype='ptidn' ); @@ -522,7 +522,7 @@ function edih_disp_x12trans() if ($fname) { $str_htm .= edih_display_text($fname, $rsptype, $trace); } else { - $str_htm .= "

    Did not find $trace in type $rsptype csv_claims table

    ".PHP_EOL; + $str_htm .= "

    Did not find " . text($trace) . " in type " . text($rsptype) . " csv_claims table

    ".PHP_EOL; csv_edihist_log("edih_disp_x12trans: Did not find $trace in type $rsptype csv_claims table"); } } else { @@ -564,7 +564,7 @@ function edih_disp_x12trans() if ($fname) { $str_htm .= edih_display_text($fname, $rsptype, $trace); } else { - $str_htm .= "

    Did not find $trace in type $rsptype csv_claims table

    ".PHP_EOL; + $str_htm .= "

    Did not find " . text($trace) . " in type " . text($rsptype) . " csv_claims table

    ".PHP_EOL; csv_edihist_log("edih_disp_x12trans: Did not find $trace in type $rsptype csv_claims table"); } } elseif ($clm01) { @@ -623,7 +623,7 @@ function edih_disp_x12file() // post request from x12 file tab if (count($_FILES) && isset($_FILES['fileUplx12'])) { - $fnupl = htmlentities($_FILES['fileUplx12']['name']); + $fnupl = $_FILES['fileUplx12']['name']; // the upload files validator $f_array = edih_upload_files(); // @@ -634,8 +634,8 @@ function edih_disp_x12file() $cmt = (count($f_array['reject'][0])) ? $f_array['reject'][0]['comment'] : ''; //$str_html = edih_html_heading('error'); $str_htm .= "

    Rejected file:

    ".PHP_EOL; - $str_htm .= "

    $fn
    ".PHP_EOL; - $str_htm .= " -- $cmt

    ".PHP_EOL; + $str_htm .= "

    " . text($fn) . "
    ".PHP_EOL; + $str_htm .= " -- " . text($cmt) . "

    ".PHP_EOL; // csv_edihist_log("edih_disp_x12file: rejected file $fn comment: $cmt"); // @@ -649,14 +649,14 @@ function edih_disp_x12file() // if (!$fn) { //$str_htm = edih_html_heading('error'); - $str_htm .= "

    Path error for $fn1

    " . PHP_EOL; + $str_htm .= "

    Path error for " . text($fn1) . "

    " . PHP_EOL; csv_edihist_log("edih_disp_x12file: Path error for $fn1"); return $str_htm; } } } else { //$str_htm = edih_html_heading('error'); - $str_htm .= "

    File not accepted $fnupl

    " . PHP_EOL; + $str_htm .= "

    File not accepted " . text($fnupl) . "

    " . PHP_EOL; csv_edihist_log("edih_disp_x12file: File not accepted $fnupl"); return $str_htm; } @@ -696,7 +696,7 @@ function edih_disp_x12file() $ft = $rsptype; $trace = ''; if (!$fn) { - $str_htm .= "

    997/999 Trace value $trace not found for type $rsptype

    " . PHP_EOL; + $str_htm .= "

    997/999 Trace value " . text($trace) . " not found for type " . text($rsptype) . "

    " . PHP_EOL; csv_edihist_log("edih_disp_x12file: 997/999 Trace value $trace not found for type $rsptype"); return $str_htm; } @@ -705,7 +705,7 @@ function edih_disp_x12file() if (!$fn) { //$str_htm = edih_html_heading('error'); - $str_htm .= "

    Name error for file: type $ft icn $icn trace $trace rsp $rsptype

    " . PHP_EOL; + $str_htm .= "

    Name error for file: type " . text($ft) . " icn " . text($icn) . " trace " . text($trace) . " rsp " . text($rsptype) . "

    " . PHP_EOL; csv_edihist_log("edih_disp_x12file: Name error for file: type $ft icn $icn trace $trace rsp $rsptype"); return $str_htm; } @@ -781,7 +781,7 @@ function edih_disp_csvtable() if (strlen($_GET['csv_date_start']) == 10 && strpos($_GET['csv_date_start'], '/') == 4) { $dts = str_replace('/', '-', $dts); } else { - $str_html = "

    Date $dts must be in YYYY-MM-DD format, no / or . please

    ".PHP_EOL; + $str_html = "

    Date " . text($dts) . " must be in YYYY-MM-DD format, no / or . please

    ".PHP_EOL; csv_edihist_log("invalid date $dts submitted for csv_table filter"); return $str_html; } @@ -951,21 +951,21 @@ function ibr_disp_997_for_batch() foreach ($result as $rslt) { $ext = substr($rslt[1], -3); // - $str_html .= "Date: {$rslt[0]}
    ".PHP_EOL; - $str_html .= "File: {$rslt[1]}
    ".PHP_EOL; - $str_html .= "Batch ICN: {$rslt[3]}
    "; + $str_html .= "Date: " . text($rslt[0]) . "
    ".PHP_EOL; + $str_html .= "File: " . text($rslt[1]) . "
    ".PHP_EOL; + $str_html .= "Batch ICN: " . text($rslt[3]) . "
    "; // error count or code in position 4 if ($ext == '999' || $ext == '997') { - $str_html .= "Rejects: {$rslt[4]}
    ".PHP_EOL; + $str_html .= "Rejects: " . text($rslt[4]) . "
    ".PHP_EOL; // don't have dialog from this dialog, so don't link //$str_html .= "Rejects: {$rslt[4]}
    ".PHP_EOL; } elseif ($ext == 'ta1' || $ext == 'ack') { - $str_html .= "Code: {$rslt[4]}
    ".PHP_EOL; + $str_html .= "Code: " . text($rslt[4]) . "
    ".PHP_EOL; //$str_html .= "Code: {$rslt[4]}
    ".PHP_EOL; } } } else { - $str_html .= "Did not find corresponding 997/999 file for $ctln
    ".PHP_EOL; + $str_html .= "Did not find corresponding 997/999 file for " . text($ctln) . "
    ".PHP_EOL; } } else { $str_html .= "Invalid value for ICN number
    ".PHP_EOL; @@ -995,13 +995,13 @@ function edih_disp_era_processed() if ($row['global_amount'] === '0') { $str_html .= " fully allocated"; } else { - $str_html .= " ({$row['global_amount']} not allocated)"; + $str_html .= " (" . text($row['global_amount']) . " not allocated)"; } } else { - $str_html .= "trace $ckno not posted"; + $str_html .= "trace " . text($ckno) . " not posted"; } } else { - $str_html .= "trace $ckno not found"; + $str_html .= "trace " . text($ckno) . " not found"; } return $str_html; diff --git a/library/edihistory/edih_segments.php b/library/edihistory/edih_segments.php index ed2036dbf..1ad714a5f 100644 --- a/library/edihistory/edih_segments.php +++ b/library/edihistory/edih_segments.php @@ -1,31 +1,31 @@ - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. - * + * * @author Kevin McCormick * @link: http://www.open-emr.org * @package OpenEMR * @subpackage ediHistory */ - + /** * increment loop values ($lpval is a reference) * @@ -552,7 +552,7 @@ function edih_271_text($segments, $delimiter, $err_seg = '') // return $str_html; } - + function edih_835_text($segments, $delimiter, $err_seg = '') { @@ -1092,7 +1092,7 @@ function edih_997_text($segments, $delimiter) // return $str_html; } - + /** * Display of x12 edi transaction listing or all segments in the files. * When using $err_info, you must use the filepath of the submitted file @@ -1136,7 +1136,7 @@ function edih_display_text($filepath, $filetype = '', $claimid = '', $trace = fa if (!is_array($segs_ar) || !count($segs_ar)) { // unknown error - $str_html = "

    unknown error retrieving segments for $fn

    ".PHP_EOL; + $str_html = "

    unknown error retrieving segments for " . text($fn) . "

    ".PHP_EOL; $str_html .= $x12obj->edih_message().PHP_EOL; return $str_html; } @@ -1193,12 +1193,12 @@ function edih_display_text($filepath, $filetype = '', $claimid = '', $trace = fa // now check if we have segments if (empty($segments) || !count($segments)) { if ($claimid) { - $str_html = "

    error: transaction $claimid not found in $fn

    ".PHP_EOL; + $str_html = "

    error: transaction " . text($claimid) . " not found in " . text($fn) . "

    ".PHP_EOL; $str_html .= $x12obj->edih_message().PHP_EOL; return $str_html; } else { // unknown error - $str_html = "

    unknown error retrieving segments for $fn

    ".PHP_EOL; + $str_html = "

    unknown error retrieving segments for " . text($fn) . "

    ".PHP_EOL; $str_html .= $x12obj->edih_message().PHP_EOL; return $str_html; } @@ -1267,12 +1267,12 @@ function edih_display_text($filepath, $filetype = '', $claimid = '', $trace = fa } // - $capstr .= ($claimid) ? " ID: $claimid" : ""; + $capstr .= ($claimid) ? " ID: " . text($claimid) : ""; // $str_html .= "".PHP_EOL; $str_html .= "".PHP_EOL; $str_html .= ""; - $str_html .= "".PHP_EOL; + $str_html .= "".PHP_EOL; $str_html .= "".PHP_EOL."".PHP_EOL; // $str_html .= $trn_html; diff --git a/library/edihistory/edih_uploads.php b/library/edihistory/edih_uploads.php index 04174c845..bf9fe9132 100644 --- a/library/edihistory/edih_uploads.php +++ b/library/edihistory/edih_uploads.php @@ -225,7 +225,7 @@ function edih_ziptoarray($zipfilename, $param_ar, $single = false) } if ($zip_obj->status != 0) { - $err .= "Error code: " . $zip_obj->status ." ". $zip_obj->getStatusString() . "
    " . PHP_EOL; + $err .= "Error code: " . text($zip_obj->status) ." ". text($zip_obj->getStatusString()) . "
    " . PHP_EOL; csv_edihist_log('edih_ziptoarray: '.$zipfilename.' '.$err); $f_zr['reject'][] = array('name'=>$zipfilename, 'comment'=>$err); return $f_zr; @@ -264,13 +264,13 @@ function edih_ziptoarray($zipfilename, $param_ar, $single = false) // if ($newCrc !== $oldCrc && ($oldCrc + 4294967296) !== $newCrc) { // failure case, mismatched crc file integrity values - $html_str .= "CRC error: The files don't match! Removing file $bnm
    " . PHP_EOL; + $html_str .= "CRC error: The files don't match! Removing file " . text($bnm) . "
    " . PHP_EOL; $isGone = unlink($newname); if ($isGone) { $is_tmpzip = false; - $html_str .= "File Removed $bnm
    ".PHP_EOL; + $html_str .= "File Removed " . text($bnm) . "
    ".PHP_EOL; } else { - $html_str .= "Failed to removed file $bnm
    ".PHP_EOL; + $html_str .= "Failed to removed file " . text($bnm) . "
    ".PHP_EOL; } } else { // passed the CRC test, now type and verify file @@ -551,7 +551,7 @@ function edih_sort_upload($files_array, $html_out = true, $err_only = true) $tp_dir = $p_ar[$key]['directory']; $tp_base = basename($tp_dir); $idx = 0; - $prc_htm .= "
  • type $key
  • ".PHP_EOL; + $prc_htm .= "
  • type " . text($key) . "
  • ".PHP_EOL; if (!is_array($val) || !count($val)) { $prc_htm .= "
  • no new files
  • " . PHP_EOL; continue; @@ -562,7 +562,7 @@ function edih_sort_upload($files_array, $html_out = true, $err_only = true) // a matching file name will not be replaced $nfb = basename($nf); $testname = $tp_dir.DS.$nfb; - $prc_htm .= "
  • $nfb
  • ".PHP_EOL; + $prc_htm .= "
  • " . text($nfb) . "
  • ".PHP_EOL; if (is_file($testname)) { $prc_htm .= "
  • -- file exists
  • " .PHP_EOL; } elseif (rename($nf, $testname)) { @@ -579,20 +579,20 @@ function edih_sort_upload($files_array, $html_out = true, $err_only = true) } elseif ($key == 'reject') { $prc_htm .= "
  • Reject:
  • ".PHP_EOL; foreach ($val as $idx => $nf) { - $prc_htm .= "
  • ".$nf['name']."
  • ".PHP_EOL; - $prc_htm .= "
  • --".$nf['comment']."
  • ".PHP_EOL; + $prc_htm .= "
  • " . text($nf['name']) . "
  • ".PHP_EOL; + $prc_htm .= "
  • --" . text($nf['comment']) . "
  • ".PHP_EOL; } } elseif ($key == 'remark') { $rmk_htm .= "

    Remarks:
    ".PHP_EOL; foreach ($val as $idx => $r) { - $rmk_htm .= $r."
    ".PHP_EOL; + $rmk_htm .= text($r) . "
    ".PHP_EOL; } $rmk_htm .= "

    ".PHP_EOL; } else { - $prc_htm .= "
  • $key type not stored
  • ".PHP_EOL; + $prc_htm .= "
  • " . text($key) . " type not stored
  • ".PHP_EOL; foreach ($val as $idx => $nf) { - $prc_htm .= "
  • ".basename($nf)."
  • ".PHP_EOL; + $prc_htm .= "
  • " . text(basename($nf)) . "
  • ".PHP_EOL; } } diff --git a/library/edihistory/edih_x12file_class.php b/library/edihistory/edih_x12file_class.php index 46af49719..8e688916d 100644 --- a/library/edihistory/edih_x12file_class.php +++ b/library/edihistory/edih_x12file_class.php @@ -24,17 +24,17 @@ * @package: OpenEMR * @subpackage: ediHistory */ - + /* ********* project notes ================= * determine GET and POST array elements * process new files -- type and csv data values * display tables -- links with GET and POST * find files -- find transactions * format display - * + * * ========================================== */ - + /*********** php code here ****************************************************************/ /** @@ -112,7 +112,7 @@ class edih_x12_file $this->envelopes = $this->edih_x12_envelopes(); $this->type = $this->edih_x12_type(); } else { - $this->message[] = 'edih_x12_file: error in creating segment array ' . $this->filename . PHP_EOL; + $this->message[] = 'edih_x12_file: error in creating segment array ' . text($this->filename) . PHP_EOL; } } else { // read file contents to try and determine x12 type @@ -122,7 +122,7 @@ class edih_x12_file } } else { // invalid file path - $this->message[] = 'edih_x12_file: invalid file path ' . $file_path; + $this->message[] = 'edih_x12_file: invalid file path ' . text($file_path); } $this->constructing = false; @@ -150,7 +150,7 @@ class edih_x12_file // do verifications $v = $this->edih_x12_scan($file_text); if (!strpos($v, 's')) { - $this->message[] = 'edih_file_text(): failed scan of file text ('.$v.')'; + $this->message[] = 'edih_file_text(): failed scan of file text (' . text($v) . ')'; return $ret_ar; } @@ -304,7 +304,7 @@ class edih_x12_file $finfo = new finfo(FILEINFO_MIME); $mimeinfo = $finfo->buffer($ftxt); if (strncmp($mimeinfo, 'text/plain; charset=us-ascii', 28) !== 0) { - $this->message[] = 'edih_x12_scan: '.$this->filename.' : invalid mime info:
    '.$mimeinfo; + $this->message[] = 'edih_x12_scan: ' . text($this->filename) . ' : invalid mime info:
    ' . text($mimeinfo); // return $hasval; } @@ -313,8 +313,8 @@ class edih_x12_file // if (preg_match('/[^\x20-\x7E\x0A\x0D]|(<\?)|(<%)|(message[] = 'edih_x12_scan: suspect characters in file '.$this->filename.'
    '. - ' character: '.$matches[0][0].' position: '. $matches[0][1]; + $this->message[] = 'edih_x12_scan: suspect characters in file ' . text($this->filename) . '
    ' . + ' character: ' . text($matches[0][0]) . ' position: ' . text($matches[0][1]); // return $hasval; } @@ -401,7 +401,7 @@ class edih_x12_file $tp_tmp[] = $gs_ar[1]; } else { $tp_tmp[] = $gs_ar[1]; - $this->message[] = 'edih_x12_type: unknown x12 type '.$gs_ar[1]; + $this->message[] = 'edih_x12_type: unknown x12 type ' . text($gs_ar[1]); } } } @@ -425,7 +425,7 @@ class edih_x12_file $tp_tmp[] = $gs_ar1[1]; } else { $tp_tmp[] = $gs_ar1[1]; - $this->message[] = 'edih_x12_type: unknown x12 type '.$gs_ar1[1]; + $this->message[] = 'edih_x12_type: unknown x12 type ' . text($gs_ar1[1]); } } } else { @@ -698,7 +698,7 @@ class edih_x12_file } else { $gs_fid = 'NA'; $env_ar['GS'][$gs_ct]['type'] = 'NA'; - $this->message[] = 'edih_x12_envelopes: Unknown GS type '.$seg_ar[1]; + $this->message[] = 'edih_x12_envelopes: Unknown GS type ' . text($seg_ar[1]); } continue; @@ -737,7 +737,7 @@ class edih_x12_file $env_ar['ST'][$st_ct]['bht03'] = array(); // GS file id FA can be 999 or 997 if ($gs_fid != $st_type && strpos($st_type, '99') === false) { - $this->message[] = "edih_x12_envelopes: ISA $icn, GS $gsn $gs_fid ST $stn $st_type type mismatch".PHP_EOL; + $this->message[] = "edih_x12_envelopes: ISA " . text($icn) . ", GS " . text($gsn . " " . $gs_fid) . " ST " . text($stn . " " . $st_type) . " type mismatch".PHP_EOL; } // @@ -792,7 +792,7 @@ class edih_x12_file if (strncmp($sn, 'TRN'.$de, 4) == 0) { $seg_ar = explode($de, $seg_text); if (!isset($seg_ar[2]) || !isset($seg_ar[3])) { - $this->message[] = 'error in 835 TRN segment '.$seg_text; + $this->message[] = 'error in 835 TRN segment ' . text($seg_text); } $env_ar['ST'][$st_ct]['trace'] = (isset($seg_ar[2])) ? $seg_ar[2] : ""; @@ -812,7 +812,7 @@ class edih_x12_file if (isset($seg_ar[1])) { $env_ar['ST'][$st_ct]['acct'][] = $seg_ar[1]; } else { - $this->message[] = 'error in 835 CLP segment '.$seg_text; + $this->message[] = 'error in 835 CLP segment ' . text($seg_text); } continue; @@ -836,7 +836,7 @@ class edih_x12_file if (isset($seg_ar[1])) { $env_ar['ST'][$st_ct]['acct'][] = $seg_ar[1]; } else { - $this->message[] = 'error in 837 CLM segment '.$seg_text; + $this->message[] = 'error in 837 CLM segment ' . text($seg_text); } continue; @@ -862,11 +862,11 @@ class edih_x12_file // errors if ($se_num != $stn) { - $this->message[] = 'edih_x12_envelopes: ST-SE number mismatch '.$stn.' '. $se_num.' in ISA '.$icn.PHP_EOL; + $this->message[] = 'edih_x12_envelopes: ST-SE number mismatch ' . text($stn) . ' ' . text($se_num) . ' in ISA ' . text($icn) . PHP_EOL; } if (intval($seg_ar[1]) != $st_segs_ct) { - $this->message[] = 'edih_x12_envelopes: ST-SE segment count mismatch '.$st_segs_ct.' '.$seg_ar[1].' in ISA '.$icn.PHP_EOL; + $this->message[] = 'edih_x12_envelopes: ST-SE segment count mismatch ' . text($st_segs_ct) . ' ' . text($seg_ar[1]) . ' in ISA ' . text($icn) . PHP_EOL; } continue; @@ -900,23 +900,23 @@ class edih_x12_file $iea_ct++; // if (count($env_ar['GS']) != $seg_ar[1]) { - $this->message[] = 'edih_x12_envelopes: GS count mismatch in ISA '.$icn.PHP_EOL; + $this->message[] = 'edih_x12_envelopes: GS count mismatch in ISA ' . text($icn) . PHP_EOL; $gsct = count($env_ar['GS']); - $this->message[] = 'GS group count: '.$gsct.' IEA01: '.$seg_ar[1].' segment: '.$seg_text; + $this->message[] = 'GS group count: ' . text($gsct) . ' IEA01: ' . text($seg_ar[1]) . ' segment: ' . text($seg_text); } if ($env_ar['ISA'][$icn]['icn'] !== $seg_ar[2]) { - $this->message[] = 'edih_x12_envelopes: ISA-IEA identifier mismatch ISA '.$icn.' IEA '.$seg_ar[2]; + $this->message[] = 'edih_x12_envelopes: ISA-IEA identifier mismatch ISA ' . text($icn) . ' IEA ' . text($seg_ar[2]); } if ($iea_ct == $isa_ct) { $trnset_seg_ct += $isa_segs_ct; //if ( $i+1 != $trnset_seg_ct ) { if ($i != $trnset_seg_ct) { - $this->message[] = 'edih_x12_envelopes: IEA segment count error '.($i).' : '.$trnset_seg_ct; + $this->message[] = 'edih_x12_envelopes: IEA segment count error ' . text($i) . ' : ' . text($trnset_seg_ct); } } else { - $this->message[] = 'edih_x12_envelopes: ISA-IEA count mismatch ISA '.$isa_ct.' IEA '.$iea_ct; + $this->message[] = 'edih_x12_envelopes: ISA-IEA count mismatch ISA ' . text($isa_ct) . ' IEA ' . text($iea_ct); } continue; @@ -1071,7 +1071,7 @@ class edih_x12_file } if (!strpos('|HB|271|HS|270|HR|276|HI|278|HN|277|HP|835|FA|999|HC|837', $tp)) { - $this->message[] = 'edih_x12_transaction: wrong edi type for transaction search '.$tp; + $this->message[] = 'edih_x12_transaction: wrong edi type for transaction search ' . text($tp); return $ret_ar; } @@ -1109,7 +1109,7 @@ class edih_x12_file // verify we have type if ($srch_ar[0]['type'] == 'NA' || !$srch_ar[0]['type']) { - $this->edih_message('edih_x12_transaction(): invalid file type '.$srch_ar[0]['type']); + $this->edih_message('edih_x12_transaction(): invalid file type ' . text($srch_ar[0]['type'])); return $ret_ar; } @@ -1350,8 +1350,8 @@ class edih_x12_file // return $ret_ar; } - - + + /** * Get a slice of the segments array * Supply an array with one or more of the following keys and values: @@ -1439,7 +1439,7 @@ class edih_x12_file // if ($trace && strpos('|HP|FA', $ft) === false) { - $this->message[] = 'edih_x12_slice() incorrect type ['.$ft.'] for trace'; + $this->message[] = 'edih_x12_slice() incorrect type [' . text($ft) . '] for trace'; return $ret_ar; } @@ -1450,7 +1450,7 @@ class edih_x12_file $icnpos = strpos($f_str, $de.$icn.$de); if ($icnpos === false) { // $icn not found - $this->message[] = 'edih_x12_slice() did not find ISA13 '.$icn; + $this->message[] = 'edih_x12_slice() did not find ISA13 ' . text($icn); // debug //echo $this->edih_message().PHP_EOL; return $ret_ar; @@ -1472,7 +1472,7 @@ class edih_x12_file $gspos = strpos($srchstr, $de.$gsn.$de); if ($gspos === false) { // $gsn not found - $this->message[] = 'edih_x12_slice() did not find GS06 '.$gsn; + $this->message[] = 'edih_x12_slice() did not find GS06 ' . text($gsn); return $ret_ar; } else { $gspos = strrpos(substr($srchstr, 0, $gspos), $dt) + 1; @@ -1494,7 +1494,7 @@ class edih_x12_file $stpos = strpos($srchstr, $seg_st); if ($stpos === false) { // $stn not found - $this->message[] = 'edih_x12_slice() did not find ST02 '.$stn; + $this->message[] = 'edih_x12_slice() did not find ST02 ' . text($stn); return $ret_ar; } else { $stpos = $stpos + 1; @@ -1512,7 +1512,7 @@ class edih_x12_file $trpos = strpos($f_str, $de.$trace); if ($trpos === false) { // $icn not found - $this->message[] = 'edih_x12_slice() did not find trace '.$trace; + $this->message[] = 'edih_x12_slice() did not find trace ' . text($trace); return $ret_ar; } diff --git a/library/edihistory/test_edih_835_accounting.php b/library/edihistory/test_edih_835_accounting.php index bec99cbc5..e9841de77 100644 --- a/library/edihistory/test_edih_835_accounting.php +++ b/library/edihistory/test_edih_835_accounting.php @@ -1,25 +1,25 @@ - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. - * - * + * + * */ function edih_835_accounting($segments, $delimiters) @@ -106,7 +106,7 @@ function edih_835_accounting($segments, $delimiters) } else if ($segid == 'NM1' && $seg[1] == 'TT' && $out['loopid'] == '2100') { $out['crossover'] = 1;//Claim automatic forward case. - + } * * else if ($segid == 'REF' && $seg[1] == '1W' && $out['loopid'] == '2100') { @@ -118,7 +118,7 @@ function edih_835_accounting($segments, $delimiters) } * * else if ($segid == 'PER' && $out['loopid'] == '2100') { - + $out['payer_insurance'] = trim($seg[2]); $out['warnings'] .= 'Claim contact information: ' . $seg[4] . "\n"; @@ -214,10 +214,10 @@ function edih_835_accounting($segments, $delimiters) } * * - * - * + * + * */ - + if (is_array($segments) && count($segments)) { $acct = array(); } else { @@ -282,7 +282,7 @@ function edih_835_accounting($segments, $delimiters) $out[$ck]['clp'][$i]['amount_patient'] = (isset($sar[5]) && $sar[5]) ? trim($sar[5]) : ""; // pt responsibility, copay + deductible $out[$ck]['clp'][$i]['payer_claim_id'] = (isset($sar[7]) && $sar[7]) ? trim($sar[7]) : ""; // payer's claim number } - + if (strncmp('CAS'.$de, $seg, 4) === 0) { $sar = explode($de, $seg); if ($loop == '2100') { @@ -446,9 +446,9 @@ if ($chk) { $bal = 'Not Balanced'; } - $pmt_html .= "
    ".PHP_EOL; - $pmt_html .= "".PHP_EOL; - $pmt_html .= "".PHP_EOL; + $pmt_html .= "".PHP_EOL; + $pmt_html .= "".PHP_EOL; + $pmt_html .= "".PHP_EOL; } } diff --git a/library/sl_eob.inc.php b/library/sl_eob.inc.php index 605763974..5b3a821c6 100644 --- a/library/sl_eob.inc.php +++ b/library/sl_eob.inc.php @@ -6,9 +6,9 @@ // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. - include_once("patient.inc"); - include_once("billing.inc"); - include_once("invoice_summary.inc.php"); + require_once("patient.inc"); + require_once("billing.inc"); + require_once("invoice_summary.inc.php"); $chart_id_cash = 0; $chart_id_ar = 0; @@ -34,14 +34,14 @@ function slInvoiceNumber(&$out) } else if ($acount == 3) { $pid = $atmp[0]; $brow = sqlQuery("SELECT encounter FROM billing WHERE " . - "pid = '$pid' AND encounter = '" . $atmp[1] . "' AND activity = 1"); - + "pid = '$pid' AND encounter = ? AND activity = 1", array($atmp[1])); + $encounter = $brow['encounter']; } else if ($acount == 1) { $pres = sqlStatement("SELECT pid FROM patient_data WHERE " . - "lname LIKE '" . addslashes($out['patient_lname']) . "' AND " . - "fname LIKE '" . addslashes($out['patient_fname']) . "' " . - "ORDER BY pid DESC"); + "lname LIKE ? AND " . + "fname LIKE ? " . + "ORDER BY pid DESC", array($out['patient_lname'], $out['patient_fname'])); while ($prow = sqlFetchArray($pres)) { if (strpos($invnumber, $prow['pid']) === 0) { $pid = $prow['pid']; @@ -70,9 +70,9 @@ function arGetSession($payer_id, $reference, $check_date, $deposit_date = '', $p if ($payer_id) { $row = sqlQuery("SELECT session_id FROM ar_session WHERE " . - "payer_id = '$payer_id' AND reference = '$reference' AND " . - "check_date = '$check_date' AND deposit_date = '$deposit_date' " . - "ORDER BY session_id DESC LIMIT 1"); + "payer_id = ? AND reference = ? AND " . + "check_date = ? AND deposit_date = ? " . + "ORDER BY session_id DESC LIMIT 1", array($payer_id, $reference, $check_date, $deposit_date)); if (!empty($row['session_id'])) { return $row['session_id']; } @@ -80,38 +80,22 @@ function arGetSession($payer_id, $reference, $check_date, $deposit_date = '', $p return sqlInsert("INSERT INTO ar_session ( " . "payer_id, user_id, reference, check_date, deposit_date, pay_total " . - ") VALUES ( " . - "'$payer_id', " . - "'" . $_SESSION['authUserID'] . "', " . - "'$reference', " . - "'$check_date', " . - "'$deposit_date', " . - "'$pay_total' " . - ")"); + ") VALUES ( ?, ?, ?, ?, ?, ? )", array($payer_id, $_SESSION['authUserID'], $reference, $check_date, $deposit_date, $pay_total)); } //writing the check details to Session Table on ERA proxcessing function arPostSession($payer_id, $check_number, $check_date, $pay_total, $post_to_date, $deposit_date, $debug) { $query = "INSERT INTO ar_session( " . "payer_id,user_id,closed,reference,check_date,pay_total,post_to_date,deposit_date,patient_id,payment_type,adjustment_code,payment_method " . - ") VALUES ( " . - "'$payer_id'," . - $_SESSION['authUserID']."," . - "0," . - "'ePay - $check_number'," . - "'$check_date', " . - "$pay_total, " . - "'$post_to_date','$deposit_date', " . - "0,'insurance','insurance_payment','electronic'" . - ")"; + ") VALUES (?, ?, 0, ?, ?, ?, ? ,?, 0, 'insurance', 'insurance_payment', 'electronic')"; if ($debug) { - echo $query . "
    \n"; + echo text($query) . "
    \n"; } else { - $sessionId=sqlInsert($query); + $sessionId=sqlInsert($query, array($payer_id, $_SESSION['authUserID'], 'ePay - '.$check_number, $check_date, $pay_total, $post_to_date, $deposit_date)); return $sessionId; } } - + // Post a payment, new style. // function arPostPayment($patient_id, $encounter_id, $session_id, $amount, $code, $payer_type, $memo, $debug, $time = '', $codetype = '') @@ -133,21 +117,8 @@ function arPostPayment($patient_id, $encounter_id, $session_id, $amount, $code, $query = "INSERT INTO ar_activity ( " . "pid, encounter, sequence_no, code_type, code, modifier, payer_type, post_time, post_user, " . "session_id, memo, pay_amount " . - ") VALUES ( " . - "'$patient_id', " . - "'$encounter_id', " . - "'{$sequence_no['increment']}', " . - "'$codetype', " . - "'$codeonly', " . - "'$modifier', " . - "'$payer_type', " . - "'$time', " . - "'" . $_SESSION['authUserID'] . "', " . - "'$session_id', " . - "'$memo', " . - "'$amount' " . - ")"; - sqlStatement($query); + ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; + sqlStatement($query, array($patient_id, $encounter_id, $sequence_no['increment'], $codetype, $codeonly, $modifier, $payer_type, $time, $_SESSION['authUserID'], $session_id, $memo, $amount)); sqlCommitTrans(); return; } @@ -222,21 +193,8 @@ function arPostAdjustment($patient_id, $encounter_id, $session_id, $amount, $cod $query = "INSERT INTO ar_activity ( " . "pid, encounter, sequence_no, code_type, code, modifier, payer_type, post_user, post_time, " . "session_id, memo, adj_amount " . - ") VALUES ( " . - "'$patient_id', " . - "'$encounter_id', " . - "'{$sequence_no['increment']}', " . - "'$codetype', " . - "'$codeonly', " . - "'$modifier', " . - "'$payer_type', " . - "'" . $_SESSION['authUserID'] . "', " . - "'$time', " . - "'$session_id', " . - "'$reason', " . - "'$amount' " . - ")"; - sqlStatement($query); + ") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; + sqlStatement($query, array($patient_id, $encounter_id, $sequence_no['increment'], $codetype, $codeonly, $modifier, $payer_type, $_SESSION['authUserID'], $time, $session_id, $reason, $amount)); sqlCommitTrans(); return; } @@ -274,7 +232,7 @@ function arSetupSecondary($patient_id, $encounter_id, $debug, $crossover = 0) // Determine the next insurance level to be billed. $ferow = sqlQuery("SELECT date, last_level_billed " . "FROM form_encounter WHERE " . - "pid = '$patient_id' AND encounter = '$encounter_id'"); + "pid = ? AND encounter = ?", array($patient_id, $encounter_id)); $date_of_service = substr($ferow['date'], 0, 10); $new_payer_type = 0 + $ferow['last_level_billed']; if ($new_payer_type < 3 && !empty($ferow['last_level_billed']) || $new_payer_type == 0) { -- 2.11.4.GIT
    $capstr
    LoopNumSegment (File: $fn)
    Segment (File: " . text($fn) . ")
    Accounting $bal
    Fee {$acctng['fee']}Adj {$acctng['clmadj']}PtRsp {$acctng['ptrsp']}
    PMT {$acctng['pmt']}CLP {$acctng['clmpmt']}PLB {$acctng['prvadj']}
    Accounting " . text($bal) . "
    Fee " . text($acctng['fee']) . "Adj " . text($acctng['clmadj']) . "PtRsp " . text($acctng['ptrsp']) . "
    PMT " . text($acctng['pmt']) . "CLP " . text($acctng['clmpmt']) . "PLB " . text($acctng['prvadj']) . "