From 2f9e3b9b4099af37c2de80088423b06517a132b3 Mon Sep 17 00:00:00 2001 From: bradymiller Date: Fri, 24 Jan 2014 10:55:11 -0800 Subject: [PATCH] eSign module modifications: -Turned on form esign as default -Added option to hide empty esign logs in the patient report (default is on) --- interface/patient_file/report/custom_report.php | 3 ++- library/ESign/ESign.php | 22 +++++++++++++++++----- library/globals.inc.php | 11 +++++++++-- version.php | 2 +- 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/interface/patient_file/report/custom_report.php b/interface/patient_file/report/custom_report.php index a36f0dbb5..65e5fdd2e 100644 --- a/interface/patient_file/report/custom_report.php +++ b/interface/patient_file/report/custom_report.php @@ -17,6 +17,7 @@ use ESign\Api; * * @package OpenEMR * @author Brady Miller + * @author Ken Chapple * @link http://www.open-emr.org */ @@ -956,7 +957,7 @@ foreach ($ar as $key => $val) { call_user_func($res[1] . "_report", $pid, $form_encounter, $N, $form_id); $esign = $esignApi->createFormESign( $formId, $res[1], $form_encounter ); - if ( $esign->isLogViewable() ) { + if ( $esign->isLogViewable("report") ) { $esign->renderLog(); } ?> diff --git a/library/ESign/ESign.php b/library/ESign/ESign.php index 09f62d10b..ab693007f 100644 --- a/library/ESign/ESign.php +++ b/library/ESign/ESign.php @@ -20,6 +20,7 @@ namespace ESign; * @package OpenEMR * @author Ken Chapple * @author Medical Information Integration, LLC + * @author Brady Miller * @link http://www.open-emr.org **/ @@ -55,17 +56,28 @@ class ESign return $this->_button->isViewable(); } - public function isLogViewable() + /** + * Check if the log is viewable + * @param string $mode Currently supports "default" and "report" + * @return boolean + */ + public function isLogViewable($mode="default") { $viewable = false; - // If we have signatures, always show the log, otherwise - // check the log object if ( count( $this->_signable->getSignatures() ) > 0 ) { + // If we have signatures, always show the log. $viewable = true; } else { - $viewable = $this->_log->isViewable(); + // If in report mode then hide the log if $_GLOBALS['esign_report_hide_empty_sig'] is true and there are no signatures + if ( ($mode=="report") && ($GLOBALS['esign_report_hide_empty_sig']) ) { + $viewable = false; + } + else { + // defer if viewable to the log object + $viewable = $this->_log->isViewable(); + } } - + return $viewable; } diff --git a/library/globals.inc.php b/library/globals.inc.php index c142c3c5a..4489cd21b 100644 --- a/library/globals.inc.php +++ b/library/globals.inc.php @@ -715,14 +715,14 @@ $GLOBALS_METADATA = array( 'esign_individual' => array( xl('Allows E-Signing Individual Forms'), 'bool', // data type - '0', // default = false + '1', // default = false xl('This will enable signing individual forms separately') ), 'lock_esign_individual' => array( xl('Lock an e-signed form individually'), 'bool', // data type - '0', // default = false + '1', // default = false xl('This will disable the Edit button on any form that is e-signed') ), @@ -733,6 +733,13 @@ $GLOBALS_METADATA = array( xl('This will give the user the option to lock (separate locking and signing)') ), + 'esign_report_hide_empty_sig' => array( + xl('Hide Empty E-Sign Logs On Report'), + 'bool', // data type + '1', // default = false + xl('This will hide empty e-sign logs on the patient report') + ), + ), //Documents Tab 'Documents' => array( diff --git a/version.php b/version.php index 612919aa9..73dc723d0 100644 --- a/version.php +++ b/version.php @@ -17,7 +17,7 @@ $v_realpatch = '0'; // is a database change in the course of development. It is used // internally to determine when a database upgrade is needed. // -$v_database = 103; +$v_database = 104; // Access control version identifier, this is to be incremented whenever there // is a access control change in the course of development. It is used -- 2.11.4.GIT