@@ -116,14 +121,6 @@ function PrintForm() {
$("input").keydown(function() { $(".printform").attr("disabled","disabled"); });
$("select").change(function() { $(".printform").attr("disabled","disabled"); });
$("textarea").keydown(function() { $(".printform").attr("disabled","disabled"); });
-
- $('.datepicker').datetimepicker({
-
-
-
-
-
- });
});
diff --git a/interface/modules/custom_modules/oe-module-weno/README.md b/interface/modules/custom_modules/oe-module-weno/README.md
index 051042f2bf7..a8341ad175a 100644
--- a/interface/modules/custom_modules/oe-module-weno/README.md
+++ b/interface/modules/custom_modules/oe-module-weno/README.md
@@ -6,7 +6,7 @@
- **Important to note that The Primary Admin Section** will require using the Validate and Save button after completing this section. All other sections will auto save when values are changed.
## Setup Summary
-- There are three sections. After entering the required Admin credentials, Weno User ID for all prescribers and the Weno Location ID for the appropriate facility, all of which was received when a Weno account was created, click the **Enable** button to enable the module allowing the start of initial pharmacies download. You may then go to the User Settings page to enter the provider/prescribers credentials. For yourself in this case.
+- There are three sections. After entering the required Admin credentials, Weno User ID for all prescribers and the Weno Location ID for the appropriate facility, all of which was received when a Weno account was created, click the **Enable** button to enable the module allowing the start of initial pharmacies download. You may then go to the User Settings page to enter the prescribers credentials. For yourself in this case.
All providers that will be prescribing using Weno eRx must also have their credentials set otherwise the Weno eRx widget will not display.
- After a log out and in or by clicking the **Restart OpenEMR** button in config panel the Weno menu items of **Admin->Other->Weno Management** and **Reports->Clients->Prescription Log** will be enabled.
## Weno Required and Ancillary Setup for OpenEMR
@@ -24,12 +24,12 @@ There are three sections within the Weno eRx Service Admin Setup that allow the
- If the encryption key is deemed invalid an alert will show and a new Encryption Reset button enabled. First try re-entering the key but if that doesn't work clicking the Reset button will create a new key. This change will also be reflected in the Admins main Weno account and no other actions are needed by the user. You may look on the key as an API token which may be a more familiar term to the reader.
### The Map Weno User Id`s (Required) Section.
- This section presents a table of all authorised users showing their default facility if assigned and an input field to enter their Weno user id Uxxxx. This value is important in order to form a relationship between Weno and the OpenEMR user for tracking prescriptions.
-- All values are automatically saved for the user whenever the Weno Provider ID is entered or changed.
-- As a convenience, an edit button is supplied to present a dialog containing the Users settings in edit mode. From here user may edit any setting such as assigning a default facility. This would be the same as accessing Users from top menu Admin->Users selected provider.
+- All values are automatically saved for the user whenever the Weno User ID is entered or changed.
+- As a convenience, an edit button is supplied to present a dialog containing the Users settings in edit mode. From here user may edit any setting such as assigning a default facility. This would be the same as accessing Users from top menu Admin->Users selected Weno Prescriber.
### The Map Weno Facility Id`s (Required) Section.
- This section is pretty self explanatory with perhaps noting this same data may be accessed from top menu Admin->Other->Weno Management as explained below.
- This section also auto saves for convenience.
### Other methods for various set up items accessed from top menu.
-- Open **Admin->Users** and select the user associated with the weno user id Uxxx and enter and save the weno user id in the **Weno Provider ID** field.
+- Open **Admin->Users** and select the user associated with the weno user id Uxxx and enter and save the weno user id in the **Weno User ID** field.
- Next open **Admin->Other->Weno Management** and enter the assigned Location Id Lxxxxx for the locations facilities.
-- Lastly from the top patient bar user icon click **Settings**. Scroll down or find the Weno button and click. Enter your username(email) and password in the **Weno Provider Email and Weno Provider Password** fields and **Save**. **Note** If these credentials are absent or wrong, you will not be able to prescribe prescriptions.
+- Lastly from the top patient bar user icon click **Settings**. Scroll down or find the Weno button and click. Enter your username(email) and password in the **Weno User Email and Weno User Password** fields and **Save**. **Note** If these credentials are absent or wrong, you will not be able to prescribe prescriptions.
diff --git a/interface/modules/custom_modules/oe-module-weno/src/Services/LogImportBuild.php b/interface/modules/custom_modules/oe-module-weno/src/Services/LogImportBuild.php
index 3f09d77aeb5..1b208d81e10 100644
--- a/interface/modules/custom_modules/oe-module-weno/src/Services/LogImportBuild.php
+++ b/interface/modules/custom_modules/oe-module-weno/src/Services/LogImportBuild.php
@@ -33,7 +33,7 @@ public function getUserIdByWenoId($external_provider_id)
return $provider['id'];
} else {
// logged in user is auth weno user so let's ensure a user is set.
- return "REQED:{users}" . xlt("Weno Provider Id missing. Select Admin then Users and edit the user to add Weno Provider Id");
+ return "REQED:{users}" . xlt("Weno User Id missing. Select Admin then Users and edit the user to add Weno User Id");
}
}
diff --git a/interface/modules/custom_modules/oe-module-weno/src/Services/LogProperties.php b/interface/modules/custom_modules/oe-module-weno/src/Services/LogProperties.php
index a023e4055ad..70f5946fb3b 100644
--- a/interface/modules/custom_modules/oe-module-weno/src/Services/LogProperties.php
+++ b/interface/modules/custom_modules/oe-module-weno/src/Services/LogProperties.php
@@ -213,7 +213,7 @@ public function getProviderEmail(): string|array
if (!empty($provider_info['email'])) {
return $provider_info;
} else {
- $error = xlt("Provider email address is missing. Go to User settings Email to add provider's weno registered email address");
+ $error = xlt("Weno Prescriber email address is missing. Go to User settings Email to add Weno Prescriber's weno registered email address");
error_log(errorLogEscape($error));
TransmitProperties::echoError($error);
}
@@ -221,7 +221,7 @@ public function getProviderEmail(): string|array
$provider_info["email"] = $GLOBALS['weno_admin_username'];
return $provider_info;
} else {
- $error = xlt("Provider email address is missing. Go to User settings Weno tab to add provider's weno registered email address");
+ $error = xlt("Weno Prescriber email address is missing. Go to User settings Weno tab to add Weno Prescriber's weno registered email address");
error_log($error);
echo TransmitProperties::styleErrors($error);
exit;
@@ -238,7 +238,7 @@ public function getProviderPassword(): mixed
if (!empty($GLOBALS['weno_admin_password'])) {
return $this->cryptoGen->decryptStandard($GLOBALS['weno_admin_password']);
} else {
- echo xlt('Provider Password is missing');
+ echo xlt('Weno Prescriber Password is missing');
die;
}
} elseif ($GLOBALS['weno_admin_password']) {
diff --git a/interface/modules/custom_modules/oe-module-weno/src/Services/TransmitProperties.php b/interface/modules/custom_modules/oe-module-weno/src/Services/TransmitProperties.php
index 55c2f7d9c86..8124b4471b2 100644
--- a/interface/modules/custom_modules/oe-module-weno/src/Services/TransmitProperties.php
+++ b/interface/modules/custom_modules/oe-module-weno/src/Services/TransmitProperties.php
@@ -266,7 +266,7 @@ public static function getAge($dob, $as_of = ''): string
}
$a1 = explode('-', substr($dob, 0, 10));
$a2 = explode('-', substr($as_of, 0, 10));
- $age = $a2[0] - $a1[0];
+ $age = (int)$a2[0] - (int)$a1[0];
if ($a2[1] < $a1[1] || ($a2[1] == $a1[1] && $a2[2] < $a1[2])) {
--$age;
}
@@ -294,7 +294,7 @@ public function getProviderEmail(): array|string
{
$provider_info = ['email' => ($GLOBALS['weno_provider_email'] ?? '')];
if (empty($provider_info['email'])) {
- return "REQED:{user_settings}" . (xlt('Provider Email is missing. Go to User Settings Weno Tab and enter your Weno Provider Email'));
+ return "REQED:{user_settings}" . (xlt('Weno Prescriber Email is missing. Go to User Settings Weno Tab and enter your Weno User Email'));
} else {
return $provider_info;
}
@@ -326,7 +326,7 @@ public function getFacilityInfo(): array|null|false
}
if (empty($default_facility['weno_id'])) {
// still no joy so let user know and get it set!
- $default_facility['error'] = "REQED:{weno_manage}" . xlt('Facility ID is missing. From Admin select Weno eRx Tools then Weno eRx Service Setup. Enter the Weno ID of your facility');
+ $default_facility['error'] = "REQED:{weno_manage}" . xlt('Facility ID is missing. From Admin select Weno eRx Tools then Weno eRx Service Setup. Enter the Weno Location ID of your facility');
}
return $default_facility;
}
@@ -429,11 +429,11 @@ public function getProviderPassword(): mixed
if (!empty($GLOBALS['weno_provider_password'])) {
$ret = $this->cryptoGen->decryptStandard($GLOBALS['weno_provider_password']);
if (!$ret) {
- return ("REQED:{user_settings}" . xlt('Your Provider Password fails decryption. Go to User Settings Weno Tab and reenter your Weno Provider Password'));
+ return ("REQED:{user_settings}" . xlt('Your Weno Prescriber Password fails decryption. Go to User Settings Weno Tab and reenter your Weno User Password'));
}
return $ret;
} else {
- return "REQED:{user_settings}" . xlt('Your Provider Password is missing. Go to User Settings Weno Tab and enter your Weno Provider Password');
+ return "REQED:{user_settings}" . xlt('Your Weno Prescriber Password is missing. Go to User Settings Weno Tab and enter your Weno User Password');
}
}
@@ -469,7 +469,7 @@ private function getSubscriber(): mixed
$relation = sqlQuery("select subscriber_relationship from insurance_data where pid = ? and type = 'primary'", [$_SESSION['pid']]);
$relation = $relation ?? ['subscriber_relationship' => ''];
- return $relation['subscriber_relationship'];
+ return $relation['subscriber_relationship'] ?? '';
}
/**
@@ -533,20 +533,22 @@ public function getWenoProviderId($id = null): mixed
if (empty($id)) {
$id = $_SESSION['authUserID'] ?? '';
}
- // get the weno provider id from the user table (weno_prov_id)
+ // get the Weno User id from the user table (weno_prov_id)
$provider = sqlQuery("SELECT weno_prov_id FROM users WHERE id = ?", [$id]);
if ((!empty($GLOBALS['weno_provider_uid'])) && !empty($provider['weno_prov_id'])) {
$doIt = ($GLOBALS['weno_provider_uid']) != trim($provider['weno_prov_id']);
if ($doIt) {
- $GLOBALS['weno_provider_uid'] = $provider['weno_prov_id'];
+ $provider['weno_prov_id'] = $GLOBALS['weno_provider_uid'];
$sql = "INSERT INTO `user_settings` (`setting_value`, `setting_user`, `setting_label`)
VALUES (?, ?, 'global:weno_provider_uid')
ON DUPLICATE KEY UPDATE `setting_value` = ?";
sqlQuery($sql, [$provider['weno_prov_id'], $id, $provider['weno_prov_id']]);
}
- $GLOBALS['weno_provider_uid'] = $GLOBALS['weno_prov_id'] = $provider['weno_prov_id']; // update globals
+ $GLOBALS['weno_provider_uid'] = $GLOBALS['weno_prov_id'] = $provider['weno_prov_id']; // update users
+ $sql = "INSERT INTO `users` (`weno_prov_id`, `id`) VALUES (?, ?) ON DUPLICATE KEY UPDATE `weno_prov_id` = ?";
+ sqlQuery($sql, [$GLOBALS['weno_provider_uid'], $id, $GLOBALS['weno_provider_uid']]);
return $provider['weno_prov_id'];
} elseif (!empty($provider['weno_prov_id'] ?? '') && empty($GLOBALS['weno_provider_uid'])) {
$sql = "INSERT INTO `user_settings` (`setting_value`, `setting_user`, `setting_label`)
@@ -557,14 +559,13 @@ public function getWenoProviderId($id = null): mixed
$GLOBALS['weno_provider_uid'] = $GLOBALS['weno_prov_id'] = $provider['weno_prov_id'];
return $provider['weno_prov_id'];
} elseif (empty($provider['weno_prov_id'] ?? '') && !empty($GLOBALS['weno_provider_uid'])) {
- $sql = "INSERT INTO `users` (`weno_prov_id`, `id`) VALUES (?, ?)
- ON DUPLICATE KEY UPDATE `weno_prov_id` = ?";
+ $sql = "INSERT INTO `users` (`weno_prov_id`, `id`) VALUES (?, ?) ON DUPLICATE KEY UPDATE `weno_prov_id` = ?";
sqlQuery($sql, [$GLOBALS['weno_provider_uid'], $id, $GLOBALS['weno_provider_uid']]);
$provider['weno_prov_id'] = $GLOBALS['weno_prov_id'] = $GLOBALS['weno_provider_uid'];
return $provider['weno_prov_id'];
} else {
- return "REQED:{users}" . xlt("Weno Provider Id missing. Select Admin then Users and edit the user to add Weno Provider Id");
+ return "REQED:{users}" . xlt("Weno User Id missing. Select Admin then Users and edit the user to add Weno User Id");
}
}
}
diff --git a/interface/modules/custom_modules/oe-module-weno/src/WenoGlobalConfig.php b/interface/modules/custom_modules/oe-module-weno/src/WenoGlobalConfig.php
index 281d18c392b..aae1b09d6fd 100644
--- a/interface/modules/custom_modules/oe-module-weno/src/WenoGlobalConfig.php
+++ b/interface/modules/custom_modules/oe-module-weno/src/WenoGlobalConfig.php
@@ -85,22 +85,22 @@ public function getGlobalSettingSectionConfiguration(): array
, 'user_setting' => false
]*/
self::WENO_PROVIDER_EMAIL => [
- 'title' => xl('Weno Provider Email')
+ 'title' => xl('Weno Prescriber Email')
, 'description' => xl('')
, 'type' => GlobalSetting::DATA_TYPE_TEXT
, 'default' => ''
, 'user_setting' => true
]
, self::WENO_PROVIDER_PASSWORD => [
- 'title' => xl('Weno Provider Password')
+ 'title' => xl('Weno Prescriber Password')
, 'description' => xl('')
, 'type' => GlobalSetting::DATA_TYPE_ENCRYPTED
, 'default' => ''
, 'user_setting' => true
]
, self::WENO_PROVIDER_UID => [
- 'title' => xl('Weno Provider ID')
- , 'description' => xl('When a Weno eRx provider, please enter your Weno provider ID here or in your Users setting. If you are not a Weno provider, please leave this field blank.')
+ 'title' => xl('Weno Prescriber ID')
+ , 'description' => xl('When a Weno eRx Prescriber, please enter your Weno User ID here or in your Users setting. If you are not a Weno Prescriber, please leave this field blank.')
, 'type' => GlobalSetting::DATA_TYPE_TEXT
, 'default' => ''
, 'user_setting' => true
diff --git a/interface/modules/custom_modules/oe-module-weno/templates/setup_facilities.php b/interface/modules/custom_modules/oe-module-weno/templates/setup_facilities.php
index b7cd45b1914..e8038650abc 100644
--- a/interface/modules/custom_modules/oe-module-weno/templates/setup_facilities.php
+++ b/interface/modules/custom_modules/oe-module-weno/templates/setup_facilities.php
@@ -76,7 +76,7 @@
-
+
getWenoProviderId(), 'Weno User Id missing') !== false) {
+ echo xlt("Not Authorized! Missing Weno Prescriber Id. See User Settings to configure Weno Prescriber Id.");
+ return "Fail";
+}
+
$logService = new WenoLogService();
$pharmacyLog = $logService->getLastPharmacyDownloadStatus('Success');
@@ -52,7 +59,7 @@ function getProviderByWenoId($external_id, $provider_id = ''): string
if ($provider) {
return $provider['fname'] . " " . $provider['mname'] . " " . $provider['lname'];
} else {
- return xlt("Weno Provider Id missing.");
+ return xlt("Weno User Id missing.");
}
}
diff --git a/interface/modules/custom_modules/oe-module-weno/templates/weno_setup.php b/interface/modules/custom_modules/oe-module-weno/templates/weno_setup.php
index 9a41c025a6f..30a4f959f2d 100644
--- a/interface/modules/custom_modules/oe-module-weno/templates/weno_setup.php
+++ b/interface/modules/custom_modules/oe-module-weno/templates/weno_setup.php
@@ -199,11 +199,11 @@ function togglePasswordVisibility(inputField) {
- All values must be entered and validated.
- If validation fails because either email and/or password are invalid an alert will be shown stating such.
- If the encryption key is deemed invalid then an alert will show and the Encryption Reset button is enabled. First try re-entering the key but if that doesn't work then clicking the Reset button will create a new key. This change will also be reflected in the Admins main Weno account and no other actions are required by the user. You may look on the key as an API token which may be a more familiar term to the reader.
-- The optional User Setting Credentials Subsection is a short cut to save time by entering the Weno Provider credentials for the user. This is the same as the Weno Provider ID in the Config Users Settings.\n
+- The optional User Setting Credentials Subsection is a short cut to save time by entering the Weno User credentials for the user. This is the same as the Weno User ID in the Config Users Settings.\n
*** The Map Weno User Id`s (Required) Section.
- This section presents a table of all authorised users showing their default facility if assigned and an input field to enter their Weno user id Uxxxx. This value is important in order to form a relationship between Weno and the OpenEMR user for tracking prescriptions.
-- All values are automatically saved for the user whenever the Weno Provider ID is entered or changed.
-- As a convenience, an edit button is supplied to present a dialog containing the Users settings in edit mode. From here user may edit any setting such as assigning a default facility. This would be the same as accessing Users from top menu Admin->Users selected provider.\n
+- All values are automatically saved for the user whenever the Weno User ID is entered or changed.
+- As a convenience, an edit button is supplied to present a dialog containing the Users settings in edit mode. From here user may edit any setting such as assigning a default facility. This would be the same as accessing Users from top menu Admin->Users selected Weno Prescriber.\n
*** The Map Weno Facility Id`s (Required) Section.
- This section is pretty self explanatory with perhaps noting this same data may be accessed from top menu Admin->Weno eRx Tools->Weno eRx Service.
- It is important to note that the prescribing user should have their default facility set in their User settings. This is the same as the Weno User ID section in that it is required to form a relationship between Weno and the OpenEMR facility for tracking prescriptions.
@@ -296,16 +296,6 @@ function togglePasswordVisibility(inputField) {
-
-
-
-
-
- (' . xlt('Required') . ')'; ?>
-
-
-
-
@@ -316,6 +306,16 @@ function togglePasswordVisibility(inputField) {