Feat openemr #7982 #7983 #7984 newpatient encounter save refactors and bug fixes...
[openemr.git] / interface / billing / customize_log.php
blob31214899d8762c478eb9bbc8c19bafb8b72de01c
1 <?php
3 /**
4 * interface/billing/customize_log.php - starting point for customization of billing log
6 * @package OpenEMR
7 * @link http://www.open-emr.org
8 * @author Stephen Waite <stephen.waite@cmsvt.com>
9 * @author Brady Miller <brady.g.miller@gmail.com>
10 * @copyright Copyright (c) 2014 Stephen Waite <stephen.waite@cmsvt.com>
11 * @copyright Copyright (c) 2019 Brady Miller <brady.g.miller@gmail.com>
12 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 require_once("../globals.php");
17 use OpenEMR\Common\Acl\AclMain;
18 use OpenEMR\Common\Crypto\CryptoGen;
19 use OpenEMR\Common\Twig\TwigContainer;
21 //ensure user has proper access
22 if (!AclMain::aclCheckCore('acct', 'eob', '', 'write') && !AclMain::aclCheckCore('acct', 'bill', '', 'write')) {
23 echo (new TwigContainer(null, $GLOBALS['kernel']))->getTwig()->render('core/unauthorized.html.twig', ['pageTitle' => xl("Billing Log")]);
24 exit;
27 $filename = $GLOBALS['OE_SITE_DIR'] . '/documents/edi/process_bills.log';
29 if (!file_exists($filename)) {
30 echo xlt("Billing log is empty");
31 exit;
34 $fh = file_get_contents($filename);
36 $cryptoGen = new CryptoGen();
37 if ($cryptoGen->cryptCheckStandard($fh)) {
38 $fh = $cryptoGen->decryptStandard($fh, null, 'database');
41 if (!empty($fh)) {
42 echo nl2br(text($fh));
43 } else {
44 echo xlt("Billing log is empty");