Skip to content

Commit

Permalink
It is working now.
Browse files Browse the repository at this point in the history
  • Loading branch information
juggernautsei committed May 21, 2024
1 parent 1dc24a6 commit 22c5ff3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 200 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
*/

use OpenEMR\Core\AbstractModuleActionListener;
use OpenEMR\Modules\ClaimRevConnector\Services\ModuleServices;

/* Allows maintenance of background tasks depending on Module Manager action. */

Expand Down Expand Up @@ -82,23 +81,6 @@ public static function initListenerSelf(): ModuleManagerListener
return new self();
}

/**
* @param $modId
* @param $currentActionStatus
* @return mixed
*/
private function install($modId, $currentActionStatus): mixed
{
$modService = new ModuleServices();
/* setting the active ui flag here will allow the config button to show
* before enable. This is a good thing because it allows the user to
* configure the module before enabling it. However, if the module is disabled
* this flag is reset by MM.
*/
$modService::setModuleState($modId, '0', '1');
return $currentActionStatus;
}

/**
* @param $modId
* @param $currentActionStatus
Expand All @@ -114,30 +96,14 @@ private function help_requested($modId, $currentActionStatus): mixed
return $currentActionStatus;
}

/**
* @param $modId
* @param $currentActionStatus
* @return mixed
*/
private function preenable($modId, $currentActionStatus): mixed
{
return $currentActionStatus;
}

/**
* @param $modId
* @param $currentActionStatus
* @return mixed
*/
private function enable($modId, $currentActionStatus): mixed
{
$modService = new ModuleServices();
if ($modService->isClaimRevConfigured()) {
$modService::setModuleState($modId, '1', '0');
return $currentActionStatus;
}
$modService::setModuleState($modId, '1', '1');
return xlt("Claim Rev Service is not configured. Please configure Claim Rev Service in the Admin Config.");
return $currentActionStatus;
}

/**
Expand All @@ -148,7 +114,6 @@ private function enable($modId, $currentActionStatus): mixed
private function disable($modId, $currentActionStatus): mixed
{
// allow config button to show before enable.
ModuleServices::setModuleState($modId, '0', '1');
return $currentActionStatus;
}

Expand All @@ -163,70 +128,4 @@ private function unregister($modId, $currentActionStatus): mixed
sqlQuery($sql, array('ClaimRev_Send', 'ClaimRev_Receive', 'ClaimRev_Elig_Send_Receive'));
return $currentActionStatus;
}

/**
* @param $modId
* @param $currentActionStatus
* @return mixed
*/
private function reset_module($modId, $currentActionStatus): mixed
{
$rtn = true;
$modService = new ModuleServices();
$logMessage = ''; // Initialize an empty string to store log messages

if (!$modService::getModuleState($modId)) {
$sql = "DELETE FROM `globals` WHERE `gl_name` LIKE 'oe_claimrev%'";
$rtn = sqlQuery($sql);
$logMessage .= "DELETE FROM `globals`: " . (empty($rtn) ? "Success" : "Failed") . "\n";

$sql = "DROP TABLE IF EXISTS `mod_claimrev_eligibility`";
$rtn = sqlQuery($sql);
$logMessage .= "DROP TABLE `mod_claimrev_eligibility`: " . (empty($rtn) ? "Success" : "Failed") . "\n";

error_log(text($logMessage));
}

// return log messages to the MM to show user.
return text($logMessage);
}

/**
* @param $modId
* @param $currentActionStatus
* @return mixed
*/
private function install_sql($modId, $currentActionStatus): mixed
{
return $currentActionStatus;
}

/**
* @param $modId
* @param $currentActionStatus
* @return mixed
*/
private function upgrade_sql($modId, $currentActionStatus): mixed
{
return $currentActionStatus;
}

/**
* Grab all Module setup or columns values.
*
* @param $modId
* @param string $col
* @return array
*/
function getModuleRegistry($modId, $col = '*'): array
{
$registry = [];
$sql = "SELECT $col FROM modules WHERE mod_id = ?";
$results = sqlQuery($sql, array($modId));
foreach ($results as $k => $v) {
$registry[$k] = trim((preg_replace('/\R/', '', $v)));
}

return $registry;
}
}

This file was deleted.

0 comments on commit 22c5ff3

Please sign in to comment.