From abdae79a1f73dfa0144a71a663b6d95e122fd4e8 Mon Sep 17 00:00:00 2001 From: Wakie87 Date: Wed, 17 Aug 2016 18:06:52 +0800 Subject: [PATCH] Remove freeb and some other legacy code. --- Documentation/INSTALL | 2 +- .../privileged_db/example_user_permissions.sql | 1 - contrib/util/installScripts/cvsDemoInstall | 182 --- contrib/util/installScripts/cvsDemoMisc/README | 2 - .../cvsDemoMisc/StartupDeveloperAppliance2 | 274 ---- .../cvsDemoMisc/developerApplianceManual.txt | 146 -- contrib/util/installScripts/cvsDemoMisc/refresh | 52 - .../ubuntu_package_scripts/development/postinst | 1 - .../ubuntu_package_scripts/production/postinst | 2 - controllers/C_InsuranceCompany.class.php | 67 - custom/BillingExport.csv.php | 1 - custom/export_labworks.php | 4 +- custom/export_xml.php | 6 +- custom/qrda_functions.php | 16 +- interface/billing/billing_process.php | 2 - interface/billing/billing_report.php | 11 - interface/billing/freebtest.php | 103 -- interface/billing/get_claim_file.php | 22 +- interface/patient_file/deleter.php | 5 - interface/patient_file/pos_checkout.php | 182 +-- interface/patient_file/summary/demographics.php | 7 +- interface/patient_file/summary/fitness_status.php | 2 - interface/practice/ins_search.php | 14 +- interface/usergroup/user_admin.php | 3 - interface/usergroup/usergroup_admin.php | 7 - interface/usergroup/usergroup_admin_add.php | 1 - library/Claim.class.php | 4 +- library/billing.inc | 17 +- library/calendar_nikki.inc | 290 ---- library/classes/InsuranceCompany.class.php | 88 +- library/classes/WSClaim.class.php | 255 ---- library/classes/WSProvider.class.php | 59 - library/classes/WSWrapper.class.php | 43 - library/freeb/ActionKeys.class.php | 312 ---- library/freeb/BillingContact.class.php | 315 ---- library/freeb/BillingService.class.php | 401 ----- library/freeb/ClearingHouse.class.php | 485 ------ library/freeb/DataObjectBase.class.php | 97 -- library/freeb/Diagnosis.class.php | 592 -------- library/freeb/Facility.class.php | 470 ------ library/freeb/Global.class.php | 38 - library/freeb/Insured.class.php | 801 ---------- library/freeb/OpenemrBillingServer.class.php | 55 - library/freeb/Patient.class.php | 1382 ----------------- library/freeb/Payer.class.php | 646 -------- library/freeb/Practice.class.php | 765 ---------- library/freeb/Procedure.class.php | 1418 ------------------ library/freeb/Provider.class.php | 629 -------- library/freeb/Utility.class.php | 38 - library/freeb/process_bills.php | 159 -- library/freeb/xmlrpc.inc | 1566 -------------------- library/freeb/xmlrpc_server.php | 31 - library/freeb/xmlrpcs.inc | 549 ------- library/gen_hcfa_1500.inc.php | 9 +- library/globals.inc.php | 7 + library/patient.inc | 92 -- setup.php | 2 - sites/default/config.php | 32 - sql/4_2_2-to-4_3_1_upgrade.sql | 7 + sql/database.sql | 19 +- templates/insurance_companies/general_edit.html | 2 +- version.php | 2 +- 62 files changed, 99 insertions(+), 12693 deletions(-) delete mode 100644 contrib/util/installScripts/cvsDemoInstall delete mode 100644 contrib/util/installScripts/cvsDemoMisc/README delete mode 100644 contrib/util/installScripts/cvsDemoMisc/StartupDeveloperAppliance2 delete mode 100644 contrib/util/installScripts/cvsDemoMisc/developerApplianceManual.txt delete mode 100644 contrib/util/installScripts/cvsDemoMisc/refresh delete mode 100644 interface/billing/freebtest.php delete mode 100644 library/calendar_nikki.inc delete mode 100644 library/classes/WSClaim.class.php delete mode 100644 library/classes/WSProvider.class.php delete mode 100644 library/classes/WSWrapper.class.php delete mode 100644 library/freeb/ActionKeys.class.php delete mode 100644 library/freeb/BillingContact.class.php delete mode 100644 library/freeb/BillingService.class.php delete mode 100644 library/freeb/ClearingHouse.class.php delete mode 100644 library/freeb/DataObjectBase.class.php delete mode 100644 library/freeb/Diagnosis.class.php delete mode 100644 library/freeb/Facility.class.php delete mode 100644 library/freeb/Global.class.php delete mode 100644 library/freeb/Insured.class.php delete mode 100644 library/freeb/OpenemrBillingServer.class.php delete mode 100644 library/freeb/Patient.class.php delete mode 100644 library/freeb/Payer.class.php delete mode 100644 library/freeb/Practice.class.php delete mode 100644 library/freeb/Procedure.class.php delete mode 100644 library/freeb/Provider.class.php delete mode 100644 library/freeb/Utility.class.php delete mode 100644 library/freeb/process_bills.php delete mode 100644 library/freeb/xmlrpc.inc delete mode 100644 library/freeb/xmlrpc_server.php delete mode 100644 library/freeb/xmlrpcs.inc diff --git a/Documentation/INSTALL b/Documentation/INSTALL index 469689b39..c0c290749 100644 --- a/Documentation/INSTALL +++ b/Documentation/INSTALL @@ -84,7 +84,7 @@ openemr/interface/modules/zend_modules/config/application.config.php. In linux, these can be set by "chmod a+w filename" command to grant global write permissions to the file. The directories include openemr/gacl/admin/templates_c, openemr/sites/default/edi, -openemr/sites/default/era, openemr/sites/default/documents, openemr/library/freeb, +openemr/sites/default/era, openemr/sites/default/documents, openemr/custom/letter_templates, openemr/interface/main/calendar/modules/PostCalendar/pntemplates/compiled, and openemr/interface/main/calendar/modules/PostCalendar/pntemplates/cache. In diff --git a/Documentation/privileged_db/example_user_permissions.sql b/Documentation/privileged_db/example_user_permissions.sql index 6ae72e6af..1e9d2ce4b 100644 --- a/Documentation/privileged_db/example_user_permissions.sql +++ b/Documentation/privileged_db/example_user_permissions.sql @@ -107,7 +107,6 @@ GRANT ALL ON openemr.insurance_companies to 'openemr'@'localhost'; GRANT ALL ON openemr.insurance_data to 'openemr'@'localhost'; GRANT ALL ON openemr.insurance_numbers to 'openemr'@'localhost'; - GRANT ALL ON openemr.integration_mapping to 'openemr'@'localhost'; GRANT ALL ON openemr.issue_encounter to 'openemr'@'localhost'; GRANT ALL ON openemr.issue_types to 'openemr'@'localhost'; GRANT ALL ON openemr.lang_constants to 'openemr'@'localhost'; diff --git a/contrib/util/installScripts/cvsDemoInstall b/contrib/util/installScripts/cvsDemoInstall deleted file mode 100644 index b44b635ef..000000000 --- a/contrib/util/installScripts/cvsDemoInstall +++ /dev/null @@ -1,182 +0,0 @@ -#!/bin/sh -# Copyright (C) 2010 Brady Miller -# -#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 script is called by the the OpenEMR developer demos and -# developer appliance. It configures the Developer Demos and the -# Developer Appliance with the most recent git repository. -# (Note it first actually grabs the cvs version) -# Logs errors. -# - -# OPTIONS -#flag for the isntance to serve as the developer translation set server -translationServe=true - -# PATH VARIABLES -WEB=/var/www/html -OPENEMR=$WEB/openemr -LOG=$WEB/log/logSetup.txt -CVS=/home/openemr/cvs -GITMAIN=/home/openemr/git -GIT=$GITMAIN/openemr -TMPDIR=/tmp/openemr-tmp -TRANSSERVEDIR=$WEB/translations -GITTRANS=$GITMAIN/translations_development_openemr - -# PATH OF INSTALL SCRIPT -INST=$OPENEMR/contrib/util/installScripts/InstallerAuto.php -INSTTEMP=$OPENEMR/contrib/util/installScripts/InstallerAutoTemp.php - -# Turn off apache to avoid users messing up while setting up -# (start it again below after install/configure openemr -service httpd stop - -# Connect to a new mandriva package repository (official repository no longer supports mandriva 2008) -echo "Updating new Mandriva Package repository. This is a 100MB download, so may take several minutes." -echo "Updating new Mandriva Package repository. This is a 100MB download, so may take several minutes." >> $LOG -urpmi.addmedia main http://ftp.ussg.iu.edu/linux/mandrake/official/2008.0/i586/media/main/release with media_info/hdlist.cz -urpmi.addmedia --update main_updates http://ftp.ussg.iu.edu/linux/mandrake/official/2008.0/i586/media/main/updates with media_info/hdlist.cz -urpmi.addmedia contrib http://ftp.ussg.iu.edu/linux/mandrake/official/2008.0/i586/media/contrib/release with media_info/hdlist.cz -urpmi.addmedia --update contrib_updates http://ftp.ussg.iu.edu/linux/mandrake/official/2008.0/i586/media/contrib/updates with media_info/hdlist.cz - -# Install php-gd (graphics), php-mbstring (multibyte character support), php-zip, php-xsl and perl-CGI packages -# and restart apache (done after below suhosin patch). -echo "Installing gd(graphics) and mbstring(multibyte support) and zip php packages and xsl php package and perl-CGI package and git packages..." -echo "Installing gd(graphics) and mbstring(multibyte support) and zip php packages and xsl php package and perl-CGI package and git packages..." >> $LOG -urpmi --auto php-gd php-mbstring php-zip php-xsl php-curl php-mcrypt perl-CGI patch git-core qgit >> $LOG - -#Patch the suhosin bug -SUHOSINCONF=/etc/php.d/Z98_suhosin.ini -echo "Disabling suhosin patch which is not compatible with OpenEMR" -echo "Disabling suhosin patch which is not compatible with OpenEMR" >> $LOG -echo " In /etc/php.d/Z98_suhosin.ini file commenting out:" -echo " In /etc/php.d/Z98_suhosin.ini file commenting out:" >> $LOG -echo " extension = suhosin.so" -echo " extension = suhosin.so" >> $LOG -echo " Then will restart apache." -echo " Then will restart apache." >> $LOG -echo "" -sed -i 's/^extension = suhosin.so/; extension = suhosin.so/' $SUHOSINCONF -service httpd start -echo "" - -# COLLECT THE GIT REPO (if it doesn't exist) -if ! [ -d $GITMAIN ]; then - echo "Downloading the OpenEMR git repository" - echo "Downloading the OpenEMR git repository" >> $LOG - mkdir -p $GITMAIN - cd $GITMAIN - git clone git://github.com/openemr/openemr.git - if $translationServe ; then - # download the translations git repo and place the set sql file for serving - git clone git://github.com/openemr/translations_development_openemr.git - mkdir -p $TRANSSERVEDIR - cp $GITTRANS/languageTranslations_utf8.sql $TRANSSERVEDIR/ - fi -else - echo "The OpenEMR git repository already exist" - echo "The OpenEMR git repository already exist" >> $LOG -fi - -# COPY THE GIT REPO OPENEMR COPY TO THE WEB DIRECTOY -echo "Copy git OpenEMR to web directory" -echo "Copy git OpenEMR to web directory" >> $LOG -rm -fr $OPENEMR/* -rsync --recursive --exclude .git $GIT/* $OPENEMR/ - -#INSTALL AND CONFIGURE OPENEMR -echo "Configuring OpenEMR" -echo "Configuring OpenEMR" >> $LOG -# -# Set file and directory permissions -chmod 666 $OPENEMR/sites/default/sqlconf.php -chown -R apache:apache $OPENEMR/sites/default/documents -chown -R apache:apache $OPENEMR/sites/default/edi -chown -R apache:apache $OPENEMR/sites/default/era -chown -R apache:apache $OPENEMR/library/freeb -chown -R apache:apache $OPENEMR/sites/default/letter_templates -chown -R apache:apache $OPENEMR/interface/main/calendar/modules/PostCalendar/pntemplates/cache -chown -R apache:apache $OPENEMR/interface/main/calendar/modules/PostCalendar/pntemplates/compiled -chown -R apache:apache $OPENEMR/gacl/admin/templates_c -# -# Run installer class for the demo (note to avoid malicious use, script is activated by removing an exit command, -# and the active script is then removed after completion. -sed -e 's@^exit;@ @' <$INST >$INSTTEMP -php -f $INSTTEMP development_translations=yes >> $LOG -rm -f $INSTTEMP -# -# Run the sql_patch.php script. Note that in the main 'master' branch this will do nothing, however in the -# branches it will install the new Globals and Database modifications (note need to copy to TEMP file etc. -# in order to work around the site variable that is required) -cd $OPENEMR -echo "" > $OPENEMR/TEMPsql_patch.php -cat $OPENEMR/sql_patch.php >> $OPENEMR/TEMPsql_patch.php -php -f TEMPsql_patch.php >> $LOG -rm -f $OPENEMR/TEMPsql_patch.php -# -#reinstitute file permissions -chmod 644 $OPENEMR/sites/default/sqlconf.php -echo "Done configuring OpenEMR" -echo "Done configuring OpenEMR" >> $LOG - -#Replace manual with newest version and add the refresh script -echo "Configuring appliance" -echo "Configuring appliance" >> $LOG -cp -f $OPENEMR/contrib/util/installScripts/cvsDemoMisc/developerApplianceManual.txt /home/openemr/docs/manual.txt -chown openemr:openemr /home/openemr/docs/manual.txt -cp -f $OPENEMR/contrib/util/installScripts/cvsDemoMisc/developerApplianceManual.txt $WEB/manual.txt -cp -f $OPENEMR/contrib/util/installScripts/cvsDemoMisc/refresh /home/openemr/git/ -chown openemr:openemr /home/openemr/git/refresh -chmod +x /home/openemr/git/refresh -echo "Done configuring appliance" -echo "Done configuring appliance" >> $LOG - -#Package the development version into a tarball and zip file to be available thru web browser -# This is basically to allow download of most recent cvs version from the cvs Demo appliance -# It will also ease transfer/testing openemr on windows systems when using the Developer appliance -echo "Creating OpenEMR Development packages" -echo "Creating OpenEMR Development packages" >> $LOG - -# Prepare the development package -mkdir -p $TMPDIR/openemr -rsync --recursive --exclude .git $GIT/* $TMPDIR/openemr/ -chmod a+w $TMPDIR/openemr/sites/default/sqlconf.php -chmod -R a+w $TMPDIR/openemr/sites/default/documents -chmod -R a+w $TMPDIR/openemr/sites/default/edi -chmod -R a+w $TMPDIR/openemr/sites/default/era -chmod -R a+w $TMPDIR/openemr/library/freeb -chmod -R a+w $TMPDIR/openemr/sites/default/letter_templates -chmod -R a+w $TMPDIR/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/cache -chmod -R a+w $TMPDIR/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/compiled -chmod -R a+w $TMPDIR/openemr/gacl/admin/templates_c - -# Create the web file directory -mkdir $WEB/files - -# Save the tar.gz cvs package -cd $TMPDIR -rm -f $WEB/files/openemr-cvs.tar.gz -tar -czf $WEB/files/openemr-cvs.tar.gz openemr -cd $WEB/files -md5sum openemr-cvs.tar.gz > openemr-linux-md5.txt - -# Save the .zip cvs package -cd $TMPDIR -rm -f $WEB/files/openemr-cvs.zip -zip -rq $WEB/files/openemr-cvs.zip openemr -cd $WEB/files -md5sum openemr-cvs.zip > openemr-windows-md5.txt - -# Create the time stamp -date > date-cvs.txt - -# Clean up -rm -fr $TMPDIR -echo "Done creating OpenEMR Development packages" -echo "Done creating OpenEMR Development packages" >> $LOG - diff --git a/contrib/util/installScripts/cvsDemoMisc/README b/contrib/util/installScripts/cvsDemoMisc/README deleted file mode 100644 index f0b5dd388..000000000 --- a/contrib/util/installScripts/cvsDemoMisc/README +++ /dev/null @@ -1,2 +0,0 @@ -This directory will hold needed files for the CVS demo Appliance -and the Developer Appliance diff --git a/contrib/util/installScripts/cvsDemoMisc/StartupDeveloperAppliance2 b/contrib/util/installScripts/cvsDemoMisc/StartupDeveloperAppliance2 deleted file mode 100644 index 81d8e7e97..000000000 --- a/contrib/util/installScripts/cvsDemoMisc/StartupDeveloperAppliance2 +++ /dev/null @@ -1,274 +0,0 @@ -#!/bin/sh -# -#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. -# -# author Brady Miller -# email brady@sparmy.com -# date 02/20/09 -# -# -#Start-up script /etc/rc.d/init.d/rc.StartupDeveloperAppliance2 -# Will download CVS version of OpenEMR. -# Will place copy of CVS versions in /home/openemr/cvs -# Then executes openemr/contrib/util/installScripts/cvsDemoInstall script -# Shows and logs errors if OpenEMR CVS versions are not downloaded -# Logs php errors - - -#BELOW IS TO SETUP MANDRIVA STARTUP SCRIPT -# StartupDeveloperAppliance2 Start/Stop the StartupDeveloperAppliance2 daemon. -# chkconfig: 345 98 8 -# description: Starts the OpenEMR Developer Appliance -# processname: StartupDeveloperAppliance2 -# Source function library. -. /etc/rc.d/init.d/functions -#ABOVE IS TO SETUP MANDRIVA STARTUP SCRIPT - - -# PATH VARIABLES -WEBROOT=/var/www/html -OPENEMR=/var/www/html/openemr -CVS=/home/openemr/cvs -LOG=/var/www/html/log/logSetup.txt - -# FUNCTIONS TO DISPLAY INTRODUCTION INSTRUCTIONS -function intro_function { - # (PENDING)Create the login screen (ALSO NEED TO CVS directory??, and rec always use 'root'??): - # welcome - echo '' > /etc/issue - echo 'Welcome to the OpenEMR Developer and Tester Appliance!!' >> /etc/issue - echo '' >> /etc/issue - # link to manual - echo 'User Manual can be found at /home/openemr/docs/manual.txt' >> /etc/issue - echo '' >> /etc/issue - echo 'For Developers: CVS directory is at /home/openemr/cvs' >> /etc/issue - echo '' >> /etc/issue - # list IP address - echo -n 'The IP address of this appliance is: ' >> /etc/issue - tempx=`/sbin/ifconfig` - tempy=${tempx#*inet addr:} - tempy=${tempy%% *} - echo $tempy >> /etc/issue - # list links to OpenEMR and logfiles - echo -n 'OpenEMR -> http://' >> /etc/issue - echo -n $tempy >> /etc/issue - echo '/openemr user: admin pass: pass' >> /etc/issue - echo -n 'Setup Log File -> http://' >> /etc/issue - echo -n $tempy >> /etc/issue - echo '/log/logSetup.txt' >> /etc/issue - echo -n 'php Log File -> http://' >> /etc/issue - echo -n $tempy >> /etc/issue - echo '/log/logPhp.txt' >> /etc/issue - echo -n 'User Manual -> http://' >> /etc/issue - echo -n $tempy >> /etc/issue - echo '/manual.txt' >> /etc/issue - echo '' >> /etc/issue - # more instructions - echo 'The HTTP(80) and SSH(22) ports are both open.' >> /etc/issue - echo '' >> /etc/issue - echo 'Login name is openemr with password openemrcool' >> /etc/issue - echo 'root password is rootcool' >> /etc/issue - echo '' >> /etc/issue - echo 'RECOMMEND using 'root' user all the time in this appliance to ensure it functions correctly' >> /etc/issue - echo '' >> /etc/issue - echo 'Software version information: Mandriva 2008, Linux kernel 2.6.22.9, MySQL 5.0.45, PHP 5.2.4 and OpenEMR CVS.' >> /etc/issue - echo '' >> /etc/issue - cp -f /etc/issue /etc/motd -} -function intro_cvsconnect_error_function { - # Create introduction screen, if user is unable to connect to CVS server - # welcome - echo '' > /etc/issue - echo 'Welcome to the OpenEMR Developer and Tester Appliance!!' >> /etc/issue - echo '' >> /etc/issue - # unable to connect to CVS error report - echo 'ERROR, you were unable to download OpenEMR from the CVS server.' >> /etc/issue - echo 'AFTER you set up internet access, RECOMMEND restarting appliance.' >> /etc/issue - echo '' >> /etc/issue - # link to manual - echo 'User Manual can be found at /home/openemr/docs/manual.txt' >> /etc/issue - echo '' >> /etc/issue - echo 'For Developers: CVS directory is at /home/openemr/cvs' >> /etc/issue - echo '' >> /etc/issue - # list IP address - echo -n 'The IP address of this appliance is: ' >> /etc/issue - tempx=`/sbin/ifconfig` - tempy=${tempx#*inet addr:} - tempy=${tempy%% *} - echo $tempy >> /etc/issue - # list links to OpenEMR and logfiles - echo -n 'OpenEMR -> http://' >> /etc/issue - echo -n $tempy >> /etc/issue - echo '/openemr user: admin pass: pass' >> /etc/issue - echo -n 'Setup Log File -> http://' >> /etc/issue - echo -n $tempy >> /etc/issue - echo '/log/logSetup.txt' >> /etc/issue - echo -n 'php Log File -> http://' >> /etc/issue - echo -n $tempy >> /etc/issue - echo '/log/logPhp.txt' >> /etc/issue - echo -n 'User Manual -> http://' >> /etc/issue - echo -n $tempy >> /etc/issue - echo '/manual.txt' >> /etc/issue - echo '' >> /etc/issue - # more instructions - echo 'The HTTP(80) and SSH(22) ports are both open.' >> /etc/issue - echo '' >> /etc/issue - echo 'Login name is openemr with password openemrcool' >> /etc/issue - echo 'root password is rootcool' >> /etc/issue - echo '' >> /etc/issue - echo 'RECOMMEND using 'root' user all the time in this appliance to ensure it functions correctly' >> /etc/issue - echo '' >> /etc/issue - echo 'Software version information: Mandriva 2008, Linux kernel 2.6.22.9, MySQL 5.0.45, PHP 5.2.4, and OpenEMR CVS.' >> /etc/issue - echo '' >> /etc/issue - cp -f /etc/issue /etc/motd -} -function intro_network_error_function { - # Create introduction screen, if user is unable to connect to CVS server - # welcome - echo '' > /etc/issue - echo 'Welcome to the OpenEMR Developer and Tester Appliance!!' >> /etc/issue - echo '' >> /etc/issue - # unable to connect to CVS error report - echo 'ERROR, there was a problem while downloading OpenEMR from the CVS server.' >> /etc/issue - echo 'RECOMMEND shutting down appliance, reverting to 'snapshot', and trying again' >> /etc/issue - echo 'RECOMMEND shutting down appliance, reverting to 'snapshot', and trying again' >> /etc/issue - echo '' >> /etc/issue - # link to manual - echo 'User Manual can be found at /home/openemr/docs/manual.txt' >> /etc/issue - echo '' >> /etc/issue - echo 'For Developers: CVS directory is at /home/openemr/cvs' >> /etc/issue - echo '' >> /etc/issue - # list IP address - echo -n 'The IP address of this appliance is: ' >> /etc/issue - tempx=`/sbin/ifconfig` - tempy=${tempx#*inet addr:} - tempy=${tempy%% *} - echo $tempy >> /etc/issue - # list links to OpenEMR and logfiles - echo -n 'OpenEMR -> http://' >> /etc/issue - echo -n $tempy >> /etc/issue - echo '/openemr user: admin pass: pass' >> /etc/issue - echo -n 'Setup Log File -> http://' >> /etc/issue - echo -n $tempy >> /etc/issue - echo '/log/logSetup.txt' >> /etc/issue - echo -n 'php Log File -> http://' >> /etc/issue - echo -n $tempy >> /etc/issue - echo '/log/logPhp.txt' >> /etc/issue - echo -n 'User Manual -> http://' >> /etc/issue - echo -n $tempy >> /etc/issue - echo '/manual.txt' >> /etc/issue - echo '' >> /etc/issue - # more instructions - echo 'The HTTP(80) and SSH(22) ports are both open.' >> /etc/issue - echo '' >> /etc/issue - echo 'Login name is openemr with password openemrcool' >> /etc/issue - echo 'root password is rootcool' >> /etc/issue - echo '' >> /etc/issue - echo 'RECOMMEND using 'root' user all the time in this appliance to ensure it functions correctly' >> /etc/issue - echo '' >> /etc/issue - echo 'Software version information: Mandriva 2008, Linux kernel 2.6.22.9, MySQL 5.0.45, PHP 5.2.4 and OpenEMR CVS.' >> /etc/issue - echo '' >> /etc/issue - cp -f /etc/issue /etc/motd -} - - -#BELOW IS TO SETUP MANDRIVA STARTUP SCRIPT -case "$1" in -start) -#ABOVE IS TO SETUP MANDRIVA STARTUP SCRIPT - - -#Report starting of script -TEMPDATE=$(date) -echo -n $TEMPDATE >> $LOG -echo ': Starting OpenEMR Developer Appliance startup script' >> $LOG -echo '' -echo 'Starting OpenEMR Developer Appliance startup script:' - -# Check whether OpenEMR has been installed yet -TEMPDIR="$CVS/openemr" -if [ -d $TEMPDIR ]; then - # OpenEMR CVS version already installed and configured - # First, put entry into logfile - TEMPDATE=$(date) - echo -n $TEMPDATE >> $LOG - echo ': OpenEMR CVS version already installed' >> $LOG - # Second, send message to screen - echo 'OpenEMR CVS version already installed.' - # Third, configure intro screen, then can exit the script - intro_function - exit -else - # Install and Configure OpenEMR CVS version. - # Put entry in log file - TEMPDATE=$(date) - echo -n $TEMPDATE >> $LOG - echo ': Will attempt to install OpenEMR CVS version' >> $LOG - # Send message to screen - echo 'Will attempt to install OpenEMR CVS version' - # Continue script below -fi -echo 'Connecting to CVS' -# Download CVS version of OpenEMR -mkdir $CVS -cd $CVS -if !(yes "" | cvs -d:pserver:anonymous:@openemr.cvs.sourceforge.net:/cvsroot/openemr login >> $LOG) -then - # unable to connect to CVS to download OpenEMR - # First, put entry into logfile - TEMPDATE=$(date) - echo -n $TEMPDATE >> $LOG - echo ': Unable to connect to CVS server at Sourceforge, so can not download OpenEMR' >> $LOG - # Second, send message to screen - echo 'Unable to connect to CVS server at Sourceforge, so can not download OpenEMR' - # Third, configure intro screen - intro_cvsconnect_error_function - # Fourth, exit from script - exit 1 -fi -echo 'Downloading OpenEMR from CVS (this could take awhile)' -if !(cvs -q -z3 -d:pserver:anonymous@openemr.cvs.sourceforge.net:/cvsroot/openemr co -P openemr >> $LOG) -then - # unable to download OpenEMR - # First, put entry into logfile - TEMPDATE=$(date) - echo -n $TEMPDATE >> $LOG - echo 'Error while downloading OpenEMR from CVS server at Sourceforge' >> $LOG - # Second, send message to screen - echo 'Error while downloading OpenEMR from CVS server at Sourceforge' - # Third, configure intro screen - intro_network_error_function - # Fourth, exit from script - exit 1 -fi - -# Copy OpenEMR and run the install script -echo 'Installing OpenEMR' -cp -r $CVS/openemr $WEBROOT -chown -Rf root:root $OPENEMR -chmod +x $OPENEMR/contrib/util/installScripts/cvsDemoInstall -. $OPENEMR/contrib/util/installScripts/cvsDemoInstall -chmod -x $OPENEMR/contrib/util/installScripts/cvsDemoInstall - -# All done, now set up the introduction screen -intro_function - -#BELOW IS TO SETUP MANDRIVA STARTUP SCRIPT -;; -stop) - # This is to fix a nasty bug with udev and vmware involving - # eth adapters and changing MAC addresses. It ensures the eth0 - # adapter is initialized on every start up to avoid udev from - # going up to eth1 which then would break VMware networking. - echo "This should only be run during shutdown. If you did this while not shutting down the computer, then may experience network problems. This can be fixed by re-starting appliance" - rm -f /etc/udev/rules.d/61-net_config.rules -;; -*) - echo "Usage: {start|stop}" - exit 1 - esac - exit $? -#ABOVE IS TO SETUP MANDRIVA STARTUP SCRIPT diff --git a/contrib/util/installScripts/cvsDemoMisc/developerApplianceManual.txt b/contrib/util/installScripts/cvsDemoMisc/developerApplianceManual.txt deleted file mode 100644 index dd1411c21..000000000 --- a/contrib/util/installScripts/cvsDemoMisc/developerApplianceManual.txt +++ /dev/null @@ -1,146 +0,0 @@ - -OpenEMR Developer Appliance Manual - -Author: Brady Miller -Email: brady@sparmy.com -Date: 10/28/2010 - - -Table of Contents -I. Introduction -II. Instructions for use - A. Start the appliance - B. Stop the appliance - C. Helpful tips - D. How this thing was built and how it works -III. User name and passwords -IV. Software Links -V. Appliance directory structure -VI. Software versions -VII. License - - -I. Introduction - - The objective of this appliance is to simplify the process of -development in OpenEMR, and allows the developer to start with the most -recent development version of OpenEMR. Think of this as a portable and -disposable OpenEMR development environment. - - When starting the appliance for the first time, it will download, -install, and configure the development version of OpenEMR. It will also place -a tarball and zip package of the development version to allow easy transfer to -other systems for testing etc. - - When shutting down the appliance, you have the option of -saving your changes or reverting back to the original state of appliance. - - -II. Instructions for use - - A. Start the appliance - Start the appliance with VMware Player. If starting - the appliance for the first time, it will download, install, - and configure the development version of OpenEMR from - Sourceforge. If it is not the first time, then it will just - startup. An intro screen will provide further instructions. - - B. Stop the appliance - When shutting down the appliance, you have the option - of saving your changes(select 'Just Power Off') or going - back to the original state of appliance(select 'Revert to - Snapshot'). Note that if you choose to 'Revert to Snapshot', - your data will be lost! - - C. Helpful tips - -Note that the installed software is separate from - the git directory. This is for a reason; active development - should not happen in the installed software directory, which is - /var/www/html/openemr. The changes should be made in your local - git repository at /home/openemr/git/openemr. The current - checked out copy of your git repository can be quickly tested - via the refresh script in the /home/openemr/git directory. - -The SSH port is open for a reason; works for - copy/paste and less awkward than using the VMWare console. - -Jed or vim text editor works well. - - D. How this thing was built and how it works - -For building instructions check out: - /home/openemr/docs/HowThisApplianceWasBuilt.txt - -On startup the /etc/rc.d/init.d/StartupDeveloperAppliance - script is run, which first downloads the cvs version. This script - then calls a script within OpenEMR openemr/contrib/util/installScripts/cvsDemoInstall - which then downloads the git development version, which it - installs and configures OpenEMR from. - - -III. User name and passwords - -Mandriva -> user: 'openemr' password: 'openemrcool' -Mandriva -> user: 'root' password: 'rootcool' -OpenEMR -> user: 'admin' password: 'pass' -MySQL -> user: 'openemr' password: 'openemr' -MySQL -> user: 'root' NO PASSWORD - - -IV. Software Links - --Note that these are listed on the intro screen -OpenEMR -> http://'IP Address'/openemr -Setup log file -> http://'IP Address'/log/logSetup.txt -Php log file -> http://'IP Address'/log/logPhp.txt -User Manual -> http://'IP Address'/manual.txt - --Note that these are not listed ont he intro screen -Packaged for linux -> http://'IP Address'/files/openemr-cvs.tar.gz -MD5 sum of linux package -> http://'IP Address'/files/openemr-linux-md5.txt -Packaged for windows -> http://'IP Address'/files/openemr-cvs.zip -MD5 sum of windows package -> http://'IP Address'/files/openemr-windows-md5.txt -Date devel version was packaged -> http://'IP Address'/files/date-cvs.txt - - -V. Appliance directory structure - -/etc/rc.d/init.d/StartupDeveloperAppliance //CORE script of appliance -/home/openemr/docs - -manual.txt - -HowThisApplianceWasBuilt.txt -/home/openemr/git - -local openemr git repository - -refresh script -/var/www/html - -manual.txt -/var/www/html/log - -logSetup.txt - -logPhp.txt -/var/www/html/files - -openemr-cvs.tar.gz - -openemr-linux-md5.txt - -openemr-cvs.zip - -openemr-windows-md5.txt - -date-cvs.txt -/var/www/html/openemr - - -VI. Software versions - -Mandriva 2008 -Linux kernel 2.6.22.9 -MySQL 5.0.45 -PHP 5.2.4 -OpenEMR CVS - - -VII. License - -Copyright (C) <2009> -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. - -Refer to file /home/openemr/docs/license.txt for license details diff --git a/contrib/util/installScripts/cvsDemoMisc/refresh b/contrib/util/installScripts/cvsDemoMisc/refresh deleted file mode 100644 index 5e443607e..000000000 --- a/contrib/util/installScripts/cvsDemoMisc/refresh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 2010 Brady Miller -# -# 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. -# -# Mandriva script to prepare a github repository for testing. This is -# specifically to allow quick testing of new code, and is not for -# production use. -# -# This script will copy the current checked git repository into -# the web directory (and remove the currently installed openemr). -# Place this script in the git directory (one level above the openemr -# directory). -# Note you need to install openemr with the mysql user 'openemr' and -# the mysql database 'openemr' for this script to completely remove -# OpenEMR. -# Also note the root mysql password needs to be blank for the mysql -# and mysqladmin commands to work. -# -# This script can also be used on your cvs checkout if you place it in -# the cvs directory (one directory above openemr) -# - -# Remove current test copy of openemr -rm -fr /var/www/html/openemr/* - -# Remove current openemr mysql database -mysqladmin -f -h localhost -u root drop openemr - -# Remove current openemr mysql user -mysql -f -u root -h localhost -e "DELETE FROM mysql.user WHERE User = 'openemr';FLUSH PRIVILEGES;" - -# Copy the new openemr version to the web directory (note need to ignore the .git directory) -rsync --recursive --exclude .git openemr/* /var/www/html/openemr/ - -# Prepare file permissions -chmod 666 /var/www/html/openemr/sites/default/sqlconf.php -chown -R apache:apache /var/www/html/openemr/sites/default/documents -chown -R apache:apache /var/www/html/openemr/sites/default/edi -chown -R apache:apache /var/www/html/openemr/sites/default/era -chown -R apache:apache /var/www/html/openemr/library/freeb -chown -R apache:apache /var/www/html/openemr/sites/default/letter_templates -chown -R apache:apache /var/www/html/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/compiled -chown -R apache:apache /var/www/html/openemr/interface/main/calendar/modules/PostCalendar/pntemplates/cache -chown -R apache:apache /var/www/html/openemr/gacl/admin/templates_c - -# Restart the mysql server -service mysqld restart diff --git a/contrib/util/ubuntu_package_scripts/development/postinst b/contrib/util/ubuntu_package_scripts/development/postinst index daf142b92..c8c677d4c 100644 --- a/contrib/util/ubuntu_package_scripts/development/postinst +++ b/contrib/util/ubuntu_package_scripts/development/postinst @@ -226,7 +226,6 @@ case "$1" in chown -R $WEB_GROUP.$WEB_USER $SITEDIR/documents chown -R $WEB_GROUP.$WEB_USER $SITEDIR/edi chown -R $WEB_GROUP.$WEB_USER $SITEDIR/era - chown -R $WEB_GROUP.$WEB_USER $OPENEMR/library/freeb chown -R $WEB_GROUP.$WEB_USER $SITEDIR/letter_templates chown -R $WEB_GROUP.$WEB_USER $OPENEMR/interface/main/calendar/modules/PostCalendar/pntemplates/cache chown -R $WEB_GROUP.$WEB_USER $OPENEMR/interface/main/calendar/modules/PostCalendar/pntemplates/compiled diff --git a/contrib/util/ubuntu_package_scripts/production/postinst b/contrib/util/ubuntu_package_scripts/production/postinst index cc197ab15..8e95e88b0 100644 --- a/contrib/util/ubuntu_package_scripts/production/postinst +++ b/contrib/util/ubuntu_package_scripts/production/postinst @@ -247,7 +247,6 @@ case "$1" in #set writable files and directories (that are not within sites directory) chown $WEB_GROUP.$WEB_USER $OPENEMR/interface/modules/zend_modules/config/application.config.php - chown -R $WEB_GROUP.$WEB_USER $OPENEMR/library/freeb chown -R $WEB_GROUP.$WEB_USER $OPENEMR/interface/main/calendar/modules/PostCalendar/pntemplates/cache chown -R $WEB_GROUP.$WEB_USER $OPENEMR/interface/main/calendar/modules/PostCalendar/pntemplates/compiled chown -R $WEB_GROUP.$WEB_USER $OPENEMR/gacl/admin/templates_c @@ -514,7 +513,6 @@ case "$1" in chown -R $WEB_GROUP.$WEB_USER $SITEDIR/default/documents chown -R $WEB_GROUP.$WEB_USER $SITEDIR/default/edi chown -R $WEB_GROUP.$WEB_USER $SITEDIR/default/era - chown -R $WEB_GROUP.$WEB_USER $OPENEMR/library/freeb chown -R $WEB_GROUP.$WEB_USER $SITEDIR/default/letter_templates chown -R $WEB_GROUP.$WEB_USER $OPENEMR/interface/main/calendar/modules/PostCalendar/pntemplates/cache chown -R $WEB_GROUP.$WEB_USER $OPENEMR/interface/main/calendar/modules/PostCalendar/pntemplates/compiled diff --git a/controllers/C_InsuranceCompany.class.php b/controllers/C_InsuranceCompany.class.php index 04201b4d9..035c9a455 100644 --- a/controllers/C_InsuranceCompany.class.php +++ b/controllers/C_InsuranceCompany.class.php @@ -3,7 +3,6 @@ require_once($GLOBALS['fileroot'] . "/library/classes/Controller.class.php"); require_once($GLOBALS['fileroot'] . "/library/classes/InsuranceCompany.class.php"); require_once($GLOBALS['fileroot'] . "/library/classes/X12Partner.class.php"); -require_once($GLOBALS['fileroot'] . "/library/classes/WSWrapper.class.php"); class C_InsuranceCompany extends Controller { @@ -69,77 +68,11 @@ class C_InsuranceCompany extends Controller { $this->icompanies[0]->persist(); $this->icompanies[0]->populate(); - // Post insurance companies as customers to the accounting system - // unless globals.php requests otherwise. - // - if (! $GLOBALS['insurance_companies_are_not_customers']) - $this->_sync_ws($this->icompanies[0]); - //echo "action processeed"; $_POST['process'] = ""; header('Location:'.$GLOBALS['webroot']."/controller.php?" . "practice_settings&insurance_company&action=list");//Z&H } - function _sync_ws($ic) { - - $db = $GLOBALS['adodb']['db']; - - $customer_info = array(); - - $sql = "SELECT foreign_id,foreign_table FROM integration_mapping where local_table = 'insurance_companies' and local_id = '" . $ic->get_id() . "'"; - $result = $db->Execute($sql); - if ($result && !$result->EOF) { - $customer_info['foreign_update'] = true; - $customer_info['foreign_id'] = $result->fields['foreign_id']; - $customer_info['foreign_table'] = $result->fields['foreign_table']; - } - - ///xml rpc code to connect to accounting package and add user to it - $customer_info['firstname'] = ""; - $customer_info['lastname'] = $ic->get_name(); - $a = $ic->get_address(); - $customer_info['address'] = $a->get_line1() . " " . $a->get_line2(); - $customer_info['suburb'] = $a->get_city(); - $customer_info['postcode'] = $a->get_zip(); - - //ezybiz wants state as a code rather than abbreviation - $customer_info['geo_zone_id'] = ""; - $sql = "SELECT zone_id from geo_zone_reference where zone_code = '" . strtoupper($a->get_state()) . "'"; - $db = $GLOBALS['adodb']['db']; - $result = $db->Execute($sql); - if ($result && !$result->EOF) { - $customer_info['geo_zone_id'] = $result->fields['zone_id']; - } - - //ezybiz wants country as a code rather than abbreviation - $customer_info['country'] = ""; - - //assume USA for insurance companies - $country_code = 223; - $sql = "SELECT countries_id from geo_country_reference where countries_iso_code_2 = '" . strtoupper($country_code) . "'"; - $db = $GLOBALS['adodb']['db']; - $result = $db->Execute($sql); - if ($result && !$result->EOF) { - $customer_info['geo_country_id'] = $result->fields['countries_id']; - } - - $customer_info['phone1'] = $ic->get_phone(); - $customer_info['phone1comment'] = "Phone Number"; - $customer_info['phone2'] = ""; - $customer_info['phone2comment'] = ""; - $customer_info['email'] = ""; - $customer_info['is_payer'] = true; - $function['ezybiz.add_customer'] = array(new xmlrpcval($customer_info,"struct")); - $ws = new WSWrapper($function); - - // if the remote patient was added make an entry in the local mapping table to that updates can be made correctly - if (is_numeric($ws->value)) { - $sql = "REPLACE INTO integration_mapping set id = '" . $db->GenID("sequences") . "', foreign_id ='" . $ws->value . "', foreign_table ='customer', local_id = '" . $ic->get_id() . "', local_table = 'insurance_companies' "; - $db->Execute($sql) or die ("error: " . $db->ErrorMsg()); - } - - } - } ?> diff --git a/custom/BillingExport.csv.php b/custom/BillingExport.csv.php index c8328ec1b..ae695489a 100644 --- a/custom/BillingExport.csv.php +++ b/custom/BillingExport.csv.php @@ -13,7 +13,6 @@ // HCFA 1500, UB-92, etc. // // To implement this feature, rename this file to BillingExport.php. -// This will cause the FreeB support in OpenEMR to be replaced. require_once (dirname(__FILE__) . "/../library/sql.inc"); diff --git a/custom/export_labworks.php b/custom/export_labworks.php index d412c3aac..1a2292f84 100644 --- a/custom/export_labworks.php +++ b/custom/export_labworks.php @@ -85,13 +85,13 @@ "i1.subscriber_fname AS fname1, i1.subscriber_mname AS mname1, i1.subscriber_lname AS lname1, " . "i1.subscriber_street AS sstreet1, i1.subscriber_city AS scity1, i1.subscriber_state AS sstate1, " . "i1.subscriber_postal_code AS szip1, i1.subscriber_relationship AS relationship1, " . - "c1.name AS name1, c1.freeb_type AS instype1, " . + "c1.name AS name1, c1.ins_type_code AS instype1, " . "a1.line1 AS street11, a1.line2 AS street21, a1.city AS city1, a1.state AS state1, " . "a1.zip AS zip1, a1.plus_four AS zip41, " . "i2.policy_number AS policy2, i2.group_number AS group2, i2.provider as provider2, " . "i2.subscriber_fname AS fname2, i2.subscriber_mname AS mname2, i2.subscriber_lname AS lname2, " . "i2.subscriber_relationship AS relationship2, " . - "c2.name AS name2, c2.freeb_type AS instype2, " . + "c2.name AS name2, c2.ins_type_code AS instype2, " . "a2.line1 AS street12, a2.line2 AS street22, a2.city AS city2, a2.state AS state2, " . "a2.zip AS zip2, a2.plus_four AS zip42 " . "FROM patient_data AS p " . diff --git a/custom/export_xml.php b/custom/export_xml.php index 77ad599b7..389444dcc 100644 --- a/custom/export_xml.php +++ b/custom/export_xml.php @@ -119,7 +119,7 @@ "i1.subscriber_employer_city AS semployer_city1, i1.subscriber_employer_state AS semployer_state1, " . "i1.subscriber_employer_postal_code AS semployer_zip1, " . "i1.subscriber_employer_country AS semployer_country1, i1.copay AS copay1, " . - "c1.name AS name1, c1.freeb_type AS instype1, " . + "c1.name AS name1, c1.ins_type_code AS instype1, " . "a1.line1 AS street11, a1.line2 AS street21, a1.city AS city1, a1.state AS state1, " . "a1.zip AS zip1, a1.plus_four AS zip41, a1.country AS country1, " . "i2.policy_number AS policy2, i2.group_number AS group2, i2.provider as provider2, " . @@ -131,7 +131,7 @@ "i2.subscriber_employer_city AS semployer_city2, i2.subscriber_employer_state AS semployer_state2, " . "i2.subscriber_employer_postal_code AS semployer_zip2, " . "i2.subscriber_employer_country AS semployer_country2, i2.copay AS copay2, " . - "c2.name AS name2, c2.freeb_type AS instype2, " . + "c2.name AS name2, c2.ins_type_code AS instype2, " . "a2.line1 AS street12, a2.line2 AS street22, a2.city AS city2, a2.state AS state2, " . "a2.zip AS zip2, a2.plus_four AS zip42, a2.country AS country2, " . "i3.policy_number AS policy3, i3.group_number AS group3, i3.provider as provider3, " . @@ -143,7 +143,7 @@ "i3.subscriber_employer_city AS semployer_city3, i3.subscriber_employer_state AS semployer_state3, " . "i3.subscriber_employer_postal_code AS semployer_zip3, " . "i3.subscriber_employer_country AS semployer_country3, i3.copay AS copay3, " . - "c3.name AS name3, c3.freeb_type AS instype3, " . + "c3.name AS name3, c3.ins_type_code AS instype3, " . "a3.line1 AS street13, a3.line2 AS street23, a3.city AS city3, a3.state AS state3, " . "a3.zip AS zip3, a3.plus_four AS zip43, a3.country AS country3 " . "FROM patient_data AS p " . diff --git a/custom/qrda_functions.php b/custom/qrda_functions.php index a7631478f..e7babe946 100644 --- a/custom/qrda_functions.php +++ b/custom/qrda_functions.php @@ -53,16 +53,16 @@ $payerCheckArr['Private Health Insurance'] = 0; $payerCheckArr['Other'] = 0; if(count($patArr) > 0){ - $insQry = "SELECT insd.*, ic.freeb_type FROM (SELECT pid, provider FROM insurance_data WHERE type = 'primary' ORDER BY id DESC) insd ". + $insQry = "SELECT insd.*, ic.ins_type_code FROM (SELECT pid, provider FROM insurance_data WHERE type = 'primary' ORDER BY id DESC) insd ". "INNER JOIN insurance_companies ic ON insd.provider = ic.id ". "WHERE insd.pid IN (".add_escape_custom(implode(",", $patArr)).")"; $insRes = sqlStatement($insQry); while($insRow = sqlFetchArray($insRes)){ - if($insRow['freeb_type'] == 8){//Self Pay (Private Insurance) + if($insRow['ins_type_code'] == 8){//Self Pay (Private Insurance) $payerCheckArr['Private Health Insurance']++; - }else if($insRow['freeb_type'] == 2){//Medicare + }else if($insRow['ins_type_code'] == 2){//Medicare $payerCheckArr['Medicare']++; - }else if($insRow['freeb_type'] == 3){//Self Pay (Private Insurance) + }else if($insRow['ins_type_code'] == 3){//Self Pay (Private Insurance) $payerCheckArr['Medicaid']++; }else{//Other $payerCheckArr['Other']++; @@ -146,16 +146,16 @@ function payerPatient($patient_id){ $payer = 'Other'; - $insQry = "SELECT insd.*, ic.freeb_type FROM (SELECT pid, provider FROM insurance_data WHERE type = 'primary' ORDER BY id DESC) insd ". + $insQry = "SELECT insd.*, ic.ins_type_code FROM (SELECT pid, provider FROM insurance_data WHERE type = 'primary' ORDER BY id DESC) insd ". "INNER JOIN insurance_companies ic ON insd.provider = ic.id ". "WHERE insd.pid = ?"; $insRes = sqlStatement($insQry, array($patient_id)); while($insRow = sqlFetchArray($insRes)){ - if($insRow['freeb_type'] == 8){//Self Pay (Private Insurance) + if($insRow['ins_type_code'] == 8){//Self Pay (Private Insurance) $payer = 'Private Health Insurance'; - }else if($insRow['freeb_type'] == 2){//Medicare + }else if($insRow['ins_type_code'] == 2){//Medicare $payer = 'Medicare'; - }else if($insRow['freeb_type'] == 3){//Self Pay (Private Insurance) + }else if($insRow['ins_type_code'] == 3){//Self Pay (Private Insurance) $payer = 'Medicaid'; }else{//Other $payer = 'Other'; diff --git a/interface/billing/billing_process.php b/interface/billing/billing_process.php index f2a7994c0..18d72646f 100644 --- a/interface/billing/billing_process.php +++ b/interface/billing/billing_process.php @@ -10,7 +10,6 @@ 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"); -include_once(dirname(__FILE__) . "/../../library/classes/WSClaim.class.php"); $EXPORT_INC = "$webserver_root/custom/BillingExport.php"; if (file_exists($EXPORT_INC)) { @@ -18,7 +17,6 @@ if (file_exists($EXPORT_INC)) { $BILLING_EXPORT = true; } -$fconfig = $GLOBALS['oer_config']['freeb']; $bill_info = array(); $bat_type = ''; // will be edi or hcfa diff --git a/interface/billing/billing_report.php b/interface/billing/billing_report.php index ebc3137bd..6f6e7395b 100644 --- a/interface/billing/billing_report.php +++ b/interface/billing/billing_report.php @@ -66,17 +66,6 @@ if (isset($_POST['mode'])) { exit; } } - - // This is obsolete. - if ($_POST['mode'] == 'process') { - if (exec("ps x | grep 'process_bills[.]php'")) { - $alertmsg = xl('Request ignored - claims processing is already running!'); - } else { - exec("cd $webserver_root/library/freeb;" . - "php -q process_bills.php bill > process_bills.log 2>&1 &"); - $alertmsg = xl('Batch processing initiated; this may take a while.'); - } - } } //global variables: diff --git a/interface/billing/freebtest.php b/interface/billing/freebtest.php deleted file mode 100644 index f34387062..000000000 --- a/interface/billing/freebtest.php +++ /dev/null @@ -1,103 +0,0 @@ -"; -echo "

"; -echo xl("Please note that this can take a very long time, up to several minutes, your web browser may not appear very active during this time but generating a bill is a -complicated process and your web browser is merely waiting for more information."); -echo "

"; -echo "

"; -echo xl("You should be running this test if this claim appeared to generate successfully but the actual claim file does not contain any data or only an unfinished portion -of the amount of data it is supposed to contain. It is obvious with HCFA claims because they are human readable, with X12 claims it is a more difficult process to determine -if the claim is properly complete."); -echo xl(" Pecularities in many browsers may mean that the output below enters your screen in sudden jerks and that there are long pauses of several seconds where it -appears as though things may have crashed. That is not the case, you will eventually see output coming out line by line. There may be sequential numbers appearing -below, this is to indicate that even though nothing else may be displaying there is activity going on. These numbers will be interspersed with the content of the -billing and that is normal."); -echo "

"; -echo "

"; -echo xl("Depending on the type of bill you are testing you will see HCFA like output on a blank page for HCFA bills, you will see many lines of somewhat garbled text -and information if you are testing an X12 claim. That garbled text is the X12 EDI 4010A format. Occasionally you will see odd characters that look like dominoes or -squiglies, these are control characters such as page feeds and are normal."); -echo "

"; -echo "

"; -echo xl("Please do NOT use your browsers stop or reload button while this page is running unless more than 10 minutes have elapsed, this will not cause the process to -stop on the server and will consume uneccesary resources."); -echo "

"; -flush(); -ob_flush; -$descriptorspec = array( - 0 => array("pipe", "r"), // stdin is a pipe that the child will read from - 1 => array("pipe", "w"), // stdout is a pipe that the child will write to - 2 => array("pipe", "w") // stderr is a file to write to -); - -$process = proc_open($execstring, $descriptorspec, $pipes); -if (is_resource($process)) { - // $pipes now looks like this: - // 0 => writeable handle connected to child stdin - // 1 => readable handle connected to child stdout - // Any error output will be appended to /tmp/error-output.txt - stream_set_blocking($pipes[1],false); - stream_set_blocking($pipes[2],false); - - echo "
";
-	$loop = true;
-	$p1 = true;
-	$p2 = true;
-	$counter = 0;
-    while($loop) {	
-    	echo sprintf("%04d",$counter) . " ";
-    	flush();
-    	
-    	if (!feof($pipes[1])) {
-    		fflush($pipes[1]); 
-    		$val =  fgets($pipes[1], 1024);
-    		if (!empty($val)) {
-    			echo $val;
-    		 	flush();
-    		}
-    	}
-    	else {
-    		$p1 = false;	
-    	}
-    	if (!feof($pipes[2])) {
-    		fflush($pipes[2]);
-    		$val = fgets($pipes[2], 1024);
-    		if (!empty($val)) {
-    			echo $val;
-    	 		flush();
-    		}
-    	}
-    	else {
-    		$p2 = false;	
-    	}
-    	if (!$p1 && !$p2) {
-    		$loop = false;
-    	}
-        $counter++;
-        usleep(1500000);
-    }	
-    fclose($pipes[0]);
-    fclose($pipes[1]);
-    fclose($pipes[2]);
-    echo "
"; - // It is important that you close any pipes before calling - // proc_close in order to avoid a deadlock - $return_value = proc_close($process); - - echo "
".xl("Claim test has completed running")."\n"; -} - -?> \ No newline at end of file diff --git a/interface/billing/get_claim_file.php b/interface/billing/get_claim_file.php index b2fea9f5a..21c911837 100644 --- a/interface/billing/get_claim_file.php +++ b/interface/billing/get_claim_file.php @@ -7,7 +7,6 @@ require_once(dirname(__FILE__) . "/../globals.php"); require_once $GLOBALS['OE_SITE_DIR'] . "/config.php"; -$fconfig = $GLOBALS['oer_config']['freeb']; $content_type = "text/plain"; $claim_file_dir = $GLOBALS['OE_SITE_DIR'] . "/edi/"; @@ -18,7 +17,6 @@ $fname = preg_replace("[\\\\]","",$fname); if (strtolower(substr($fname,(strlen($fname)-4))) == ".pdf") { $content_type = "application/pdf"; - if (!strpos($fname,'-batch')) $claim_file_dir = $fconfig['claim_file_dir']; } $fname = $claim_file_dir . $fname; @@ -26,25 +24,7 @@ $fname = $claim_file_dir . $fname; if (!file_exists($fname)) { echo xl("The claim file: ") . $_GET['key'] . xl(" could not be accessed."); } -elseif ($_GET['action'] == "print") { -?> - - - - - - -

    - -
- - -Execute($sql, array($patient_id) ); - if($result && !$result->EOF) { - $foreign_patient_id = $result->fields['foreign_id']; - } - else { - return "Patient '" . $patient_id . "' has not yet been posted to the accounting system."; - } - - // Get foreign ID (salesman) for provider. - $sql = "SELECT foreign_id from integration_mapping WHERE " . - "local_id = ? AND local_table='users' and foreign_table='salesman'"; - $result = $db->Execute($sql, array($provider_id) ); - if($result && !$result->EOF) { - $foreign_provider_id = $result->fields['foreign_id']; - } - else { - return "Provider '" . $provider_id . "' has not yet been posted to the accounting system."; - } - - // Get foreign ID (customer) for insurance payer. - if ($payer_id && ! $GLOBALS['insurance_companies_are_not_customers']) { - $sql = "SELECT foreign_id from integration_mapping WHERE " . - "local_id = ? AND local_table = 'insurance_companies' AND foreign_table='customer'"; - $result = $db->Execute($sql, array($payer_id) ); - if($result && !$result->EOF) { - $foreign_payer_id = $result->fields['foreign_id']; - } - else { - return "Payer '" . $payer_id . "' has not yet been posted to the accounting system."; - } - } else { - $foreign_payer_id = $payer_id; - } - - // Create invoice notes for the new invoice that list the patient's - // insurance plans. This is so that when payments are posted, the user - // can easily see if a secondary claim needs to be submitted. - // - $insnotes = ""; - $insno = 0; - foreach (array("primary", "secondary", "tertiary") as $instype) { - ++$insno; - $sql = "SELECT insurance_companies.name " . - "FROM insurance_data, insurance_companies WHERE " . - "insurance_data.pid = ? AND " . - "insurance_data.type = ? AND " . - "insurance_companies.id = insurance_data.provider " . - "ORDER BY insurance_data.date DESC LIMIT 1"; - $result = $db->Execute($sql, array($patient_id,$instype) ); - if ($result && !$result->EOF && $result->fields['name']) { - if ($insnotes) $insnotes .= "\n"; - $insnotes .= "Ins$insno: " . $result->fields['name']; - } - } - $invoice_info['notes'] = $insnotes; - - if (preg_match("/(\d\d\d\d)\D*(\d\d)\D*(\d\d)/", $dosdate, $matches)) { - $dosdate = $matches[2] . '-' . $matches[3] . '-' . $matches[1]; - } else { - $dosdate = date("m-d-Y"); - } - - $invoice_info['salesman'] = $foreign_provider_id; - $invoice_info['customerid'] = $foreign_patient_id; - $invoice_info['payer_id'] = $foreign_payer_id; - $invoice_info['invoicenumber'] = $patient_id . "." . $encounter; - $invoice_info['dosdate'] = $dosdate; - $invoice_info['items'] = array(); - $invoice_info['total'] = '0.00'; - - return ''; -} - -function invoice_add_line_item(& $invoice_info, $code_type, $code, - $code_text, $amount, $units=1) -{ - $units = max(1, intval(trim($units))); - $amount = sprintf("%01.2f", $amount); - $price = $amount / $units; - $tmp = sprintf("%01.2f", $price); - if (abs($price - $tmp) < 0.000001) $price = $tmp; - $tii = array(); - $tii['maincode'] = $code; - $tii['itemtext'] = "$code_type:$code"; - if ($code_text) $tii['itemtext'] .= " $code_text"; - $tii['qty'] = $units; - $tii['price'] = $price; - $tii['glaccountid'] = $GLOBALS['oer_config']['ws_accounting']['income_acct']; - $invoice_info['total'] = sprintf("%01.2f", $invoice_info['total'] + $amount); - $invoice_info['items'][] = $tii; - return ''; -} - -function invoice_post(& $invoice_info) -{ - $function['ezybiz.add_invoice'] = array(new xmlrpcval($invoice_info, "struct")); - - list($name, $var) = each($function); - $f = new xmlrpcmsg($name, $var); - - $c = new xmlrpc_client($GLOBALS['oer_config']['ws_accounting']['url'], - $GLOBALS['oer_config']['ws_accounting']['server'], - $GLOBALS['oer_config']['ws_accounting']['port']); - - $c->setCredentials($GLOBALS['oer_config']['ws_accounting']['username'], - $GLOBALS['oer_config']['ws_accounting']['password']); - - $r = $c->send($f); - if (!$r) return "XMLRPC send failed"; - - // We are not doing anything with the return value yet... should we? - $tv = $r->value(); - if (is_object($tv)) { - $value = $tv->getval(); - } - else { - $value = null; - } - - if ($r->faultCode()) { - return "Fault: Code: " . $r->faultCode() . " Reason '" . $r->faultString() . "'"; - } - - return ''; -} - -///////////// End of SQL-Ledger invoice posting functions //////////// - // Output HTML for an invoice line item. // $prevsvcdate = ''; @@ -1123,40 +975,8 @@ else if (!empty($GLOBALS['gbl_mask_invoice_number'])) {