diff --git a/interface/forms/note/new.php b/interface/forms/note/new.php index afa1bf76e1f..860fddc67a2 100644 --- a/interface/forms/note/new.php +++ b/interface/forms/note/new.php @@ -36,8 +36,8 @@ $(function () { $('.datepicker').datetimepicker({ - - + + @@ -83,9 +83,9 @@ - ' - title='' /> + ' + title='' /> diff --git a/interface/forms/note/print.php b/interface/forms/note/print.php index 4f20ac599cc..87fc10d708f 100644 --- a/interface/forms/note/print.php +++ b/interface/forms/note/print.php @@ -29,11 +29,6 @@ $obj = formFetch("form_" . $form_name, $_GET["id"]); } -/* remove the time-of-day from the date fields */ -if ($obj['date_of_signature'] != "") { - $dateparts = explode(" ", $obj['date_of_signature']); - $obj['date_of_signature'] = $dateparts[0]; -} ?> <?php echo "Form: note"?> @@ -67,7 +62,7 @@ ' + value='' /> diff --git a/interface/forms/note/report.php b/interface/forms/note/report.php index da08aa1669f..7b3953884c5 100644 --- a/interface/forms/note/report.php +++ b/interface/forms/note/report.php @@ -47,6 +47,8 @@ function note_report($pid, $encounter, $cols, $id) print("\n"); if ($key == "Note Type") { print "" . xlt($key) . ": " . xlt($value) . ""; + } elseif ($key == "Date Of Signature") { + print "" . xlt($key) . ": " . oeFormatShortDate($value) . ""; } else { print "" . xlt($key) . ": " . text($value) . ""; } diff --git a/interface/forms/note/save.php b/interface/forms/note/save.php index c9be03c925a..c9992263b66 100644 --- a/interface/forms/note/save.php +++ b/interface/forms/note/save.php @@ -32,8 +32,10 @@ $encounter = date("Ymd"); } +$_POST['date_of_signature'] = DateToYYYYMMDD($_POST['date_of_signature']); + if ($_GET["mode"] == "new") { - $newid = formSubmit($table_name, $_POST, $_GET["id"], $userauthorized); + $newid = formSubmit($table_name, $_POST, $_GET["id"] ?? '', $userauthorized); addForm($encounter, "Work/School Note", $newid, "note", $pid, $userauthorized); } elseif ($_GET["mode"] == "update") { $success = formUpdate($table_name, $_POST, $_GET["id"], $userauthorized); diff --git a/interface/forms/note/view.php b/interface/forms/note/view.php index 9191befd058..ba66cbe38c7 100644 --- a/interface/forms/note/view.php +++ b/interface/forms/note/view.php @@ -32,11 +32,6 @@ $obj = formFetch("form_" . $form_name, $_GET["id"]); } -/* remove the time-of-day from the date fields */ -if ($obj['date_of_signature'] != "") { - $dateparts = explode(" ", $obj['date_of_signature']); - $obj['date_of_signature'] = $dateparts[0]; -} ?> @@ -46,6 +41,16 @@ // required for textbox date verification var mypcc = ; +$(function () { + $('.datepicker').datetimepicker({ + + + + + + }); + }); + function PrintForm() { newwin = window.open(,"mywin"); } @@ -86,8 +91,8 @@ function PrintForm() { ' - title='' /> + value='' + title='' /> @@ -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) {
+ +
+
+
+
+ (' . xlt('Required') . ')'; ?> +
+
+ +
diff --git a/interface/modules/custom_modules/oe-module-weno/templates/weno_users.php b/interface/modules/custom_modules/oe-module-weno/templates/weno_users.php index 37d447726b7..772d8ece470 100644 --- a/interface/modules/custom_modules/oe-module-weno/templates/weno_users.php +++ b/interface/modules/custom_modules/oe-module-weno/templates/weno_users.php @@ -83,7 +83,7 @@ - + @@ -98,14 +98,14 @@ - " value=""> + " value=""> , event)' role='button' class='fas fa-pen text-warning'> - + diff --git a/interface/new/new_comprehensive.php b/interface/new/new_comprehensive.php index 7a47faac943..4a2c4f0803e 100644 --- a/interface/new/new_comprehensive.php +++ b/interface/new/new_comprehensive.php @@ -666,7 +666,7 @@ function end_group()
- ' /> + ' />
diff --git a/interface/patient_file/history/encounters.php b/interface/patient_file/history/encounters.php index fa697db8df2..06d668821e2 100644 --- a/interface/patient_file/history/encounters.php +++ b/interface/patient_file/history/encounters.php @@ -314,7 +314,7 @@ function changePageSize() { $name = getPatientNameFirstLast($pid); $dob = text(oeFormatShortDate(getPatientData($pid, "DOB")['DOB'])); $external_id = getPatientData($pid, "pubpid")['pubpid']; - echo $name . " (" . $external_id . ")" . "    DOB: " . $dob ; + echo text($name) . " (" . text($external_id) . ")" . "    DOB: " . $dob ; } ?> @@ -437,7 +437,8 @@ function changePageSize() { if (($pagesize > 0) && ($pagestart > 0)) { generatePageElement($pagestart - $pagesize, $pagesize, $billing_view, $issue, "⇐" . htmlspecialchars(xl("Prev"), ENT_NOQUOTES) . " "); } - echo ($pagestart + 1) . "-" . $upper . " " . htmlspecialchars(xl('of'), ENT_NOQUOTES) . " " . $numRes; + echo (($pagesize > 0) ? ($pagestart + 1) : "1") . "-" . $upper . " " . htmlspecialchars(xl('of'), ENT_NOQUOTES) . " " . $numRes; + if (($pagesize > 0) && ($pagestart + $pagesize <= $numRes)) { generatePageElement($pagestart + $pagesize, $pagesize, $billing_view, $issue, " " . htmlspecialchars(xl("Next"), ENT_NOQUOTES) . "⇒"); } diff --git a/interface/patient_file/report/custom_report.php b/interface/patient_file/report/custom_report.php index 193496032b8..6cedb8aa9b2 100644 --- a/interface/patient_file/report/custom_report.php +++ b/interface/patient_file/report/custom_report.php @@ -782,9 +782,10 @@ function zip_content($source, $destination, $content = '', $create = true) echo "
"; echo "

" . text(xl_form_title($formres["form_name"])) . "

"; } - + if (!empty($dateres['date'])) { // show the encounter's date - echo "(" . text(oeFormatSDFT(strtotime($dateres["date"]))) . ") "; + echo "(" . text(oeFormatSDFT(strtotime($dateres["date"]))) . ") "; + } if ($res[1] == 'newpatient') { // display the provider info echo ' ' . xlt('Provider') . ': ' . text(getProviderName(getProviderIdOfEncounter($form_encounter))); diff --git a/interface/patient_file/summary/immunizations.php b/interface/patient_file/summary/immunizations.php index be2ce51f79d..e7581315c1f 100644 --- a/interface/patient_file/summary/immunizations.php +++ b/interface/patient_file/summary/immunizations.php @@ -822,7 +822,7 @@ function saveImmunizationObservationResults($id, $immunizationdata) echo ""; - echo ""; + echo ""; echo ""; } ?> diff --git a/interface/reports/amc_full_report.php b/interface/reports/amc_full_report.php index e749a7c9c46..1ccd3c604f6 100644 --- a/interface/reports/amc_full_report.php +++ b/interface/reports/amc_full_report.php @@ -46,12 +46,12 @@ function formatPatientReportData($report_id, &$data, $type_report, $amc_report_t $failed_items = $row['pass_filter'] - $row['pass_target'] - $row['excluded']; } $row['display_field_sub'] = ($displayFieldSubHeader != "") ? "($displayFieldSubHeader)" : null; - } else if (isset($row['is_sub'])) { + } elseif (isset($row['is_sub'])) { $row['display_field'] = generate_display_field(array('data_type' => '1', 'list_id' => 'rule_action_category'), $row['action_category']) . ': ' . generate_display_field(array('data_type' => '1', 'list_id' => 'rule_action'), $row['action_item']); // Excluded is not part of denominator in standard rules so do not use in calculation $failed_items = $main_pass_filter - $row['pass_target']; - } else if (isset($row['is_plan'])) { + } elseif (isset($row['is_plan'])) { $row['display_field'] = generate_display_field(array('data_type' => '1', 'list_id' => 'clinical_plans'), $row['id']); } @@ -201,7 +201,7 @@ function getRuleObjectForId($ruleId) $subTitle = ''; if ($report_view['provider'] == "group_calculation") { $subTitle = xl("Group Calculation Method"); - } else if (is_numeric($report_view['provider'])) { + } elseif (is_numeric($report_view['provider'])) { // grab the provider $userService = new \OpenEMR\Services\UserService(); $provider = $userService->getUser($report_view['provider']); diff --git a/interface/reports/amc_tracking.php b/interface/reports/amc_tracking.php index 3599e6f1737..926911a3990 100644 --- a/interface/reports/amc_tracking.php +++ b/interface/reports/amc_tracking.php @@ -202,7 +202,7 @@ function provide_sum_pat(patient_id,encounter_id) { : - + @@ -211,7 +211,7 @@ function provide_sum_pat(patient_id,encounter_id) { : - + diff --git a/interface/reports/audit_log_tamper_report.php b/interface/reports/audit_log_tamper_report.php index 9b1d35c3c59..d818292d261 100644 --- a/interface/reports/audit_log_tamper_report.php +++ b/interface/reports/audit_log_tamper_report.php @@ -142,12 +142,12 @@ function setpatient(pid, lname, fname, dob) { : - + : - + diff --git a/interface/reports/cdr_log.php b/interface/reports/cdr_log.php index c208f98338f..32bd513aef9 100644 --- a/interface/reports/cdr_log.php +++ b/interface/reports/cdr_log.php @@ -105,7 +105,7 @@ : - @@ -115,7 +115,7 @@ class='datepicker form-control'> : - diff --git a/interface/reports/clinical_reports.php b/interface/reports/clinical_reports.php index 7882a5f46e1..19b8741d7d7 100644 --- a/interface/reports/clinical_reports.php +++ b/interface/reports/clinical_reports.php @@ -238,13 +238,13 @@ function submitForm() { : : - + : ' value='' size='10' maxlength='20' /> : - + : diff --git a/interface/reports/cqm.php b/interface/reports/cqm.php index 7e104b2ca4f..67fd7f0ba0b 100644 --- a/interface/reports/cqm.php +++ b/interface/reports/cqm.php @@ -104,13 +104,13 @@ $show_help = false; if ($type_report == "standard") { $heading_title = xl('Standard Measures'); -} else if ($type_report == "cqm") { +} elseif ($type_report == "cqm") { $heading_title = xl('Clinical Quality Measures (CQM)'); -} else if ($type_report == 'cqm_2011') { +} elseif ($type_report == 'cqm_2011') { $heading_title = 'Clinical Quality Measures (CQM) - 2011'; -} else if ($type_report == "cqm_2014") { +} elseif ($type_report == "cqm_2014") { $heading_title = 'Clinical Quality Measures (CQM) - 2014'; -} else if ($is_amc_report) { +} elseif ($is_amc_report) { $heading_title = $amc_report_types[$type_report]['title']; $show_help = true; $help_file_name = "cqm_amc_help.php"; @@ -179,7 +179,7 @@ ,['value' => 'cqm_2011', 'selected' => $plan_filter == 'cqm_2011', 'label' => xl('2011 Official Clinical Quality Measures (CQM) Measure Groups')] ,['value' => 'cqm_2014', 'selected' => $plan_filter == 'cqm_2014', 'label' => xl('2014 Official Clinical Quality Measures (CQM) Measure Groups')] ]; -} else if ($is_amc_report) { +} elseif ($is_amc_report) { // latest AMC doesn't have collate options if (empty($report_id)) { // truncate to just the first option @@ -205,7 +205,7 @@ } $formData['providerReportOptions'][] = ['value' => 'group_calculation', 'selected' => $provider == 'group_calculation' , 'label' => xl('All EP/EC Group Calculation')]; -} else if ($type_report == 'standard') { +} elseif ($type_report == 'standard') { $formData['rule_filters'] = [ ['value' => 'passive_alert', 'selected' => $type_report == 'passive_alert', 'label' => xl('Passive Alert Rules')] ,['value' => 'active_alert', 'selected' => $type_report == 'active_alert', 'label' => xl('Active Alert Rules')] diff --git a/interface/reports/inventory_list.php b/interface/reports/inventory_list.php index 220ca40c11d..3093ff4ae7c 100644 --- a/interface/reports/inventory_list.php +++ b/interface/reports/inventory_list.php @@ -286,7 +286,7 @@ function write_report_line(&$row) "s.sale_date > DATE_SUB(NOW(), INTERVAL " . escape_limit($form_days) . " DAY) " . "AND s.pid != 0 $fwcond"; $srow = sqlQuery($query, array_merge(array($drug_id, $facility_id), $fwbind)); - } else if ($form_details == 2) { // warehouse details + } elseif ($form_details == 2) { // warehouse details $query = "SELECT " . "SUM(s.quantity) AS sale_quantity " . "FROM drug_sales AS s " . @@ -428,7 +428,7 @@ function write_report_line(&$row) $expdays = (int) ((strtotime($irow['expiration']) - time()) / (60 * 60 * 24)); if ($expdays <= 0) { addWarning(xl('Lot') . " '$lotno' " . xl('has expired')); - } else if ($expdays <= $gbl_expired_lot_warning_days) { + } elseif ($expdays <= $gbl_expired_lot_warning_days) { addWarning(xl('Lot') . " '$lotno' " . xl('expires in') . " $expdays " . xl('days')); } } @@ -621,7 +621,7 @@ function write_report_line(&$row) "pw.pw_warehouse = di.warehouse_id " . "WHERE 1 = 1 $fwcond $actcond " . "GROUP BY d.name, d.drug_id, lo.option_value ORDER BY $orderby, lo.option_value"; -} else if ($form_details == 2) { +} elseif ($form_details == 2) { // Query for the main loop if warehouse/lot details are wanted. $query = "SELECT d.*, di.on_hand, di.inventory_id, di.lot_number, " . "di.expiration, di.warehouse_id, lo.title, fac.name AS facname, " . diff --git a/interface/reports/report_results.php b/interface/reports/report_results.php index 03a1c63fa02..2041dd417dc 100644 --- a/interface/reports/report_results.php +++ b/interface/reports/report_results.php @@ -108,7 +108,7 @@ : - @@ -118,7 +118,7 @@ class='datepicker form-control' /> : - diff --git a/interface/super/manage_document_templates.php b/interface/super/manage_document_templates.php index acd986b3056..5dcf9dc74d4 100644 --- a/interface/super/manage_document_templates.php +++ b/interface/super/manage_document_templates.php @@ -99,8 +99,32 @@ die(xlt('Cannot determine a destination filename')); } $path_parts = pathinfo($form_dest_filename); - if (!in_array(strtolower($path_parts['extension'] ?? ''), array('odt', 'txt', 'docx', 'zip'))) { - die(text(strtolower($path_parts['extension'] ?? '')) . ' ' . xlt('filetype is not accepted')); + $extension = strtolower($path_parts['extension'] ?? ''); + + if (!in_array($extension, array('odt', 'txt', 'docx', 'zip'))) { + die(text($extension) . ' ' . xlt('filetype is not accepted')); + } + + // Check if the uploaded file is a zip file + if ($extension === 'zip') { + $maxZipSize = 1048576; // 1 MB (adjust the size as needed) + if ($_FILES['form_file']['size'] > $maxZipSize) { + die(xlt('Zip file size exceeds the maximum allowed size')); + } + + // Check for nested zip files + $zip = new ZipArchive(); + if ($zip->open($tmp_name) === true) { + for ($i = 0; $i < $zip->numFiles; $i++) { + $nestedFile = $zip->getNameIndex($i); + if (pathinfo($nestedFile, PATHINFO_EXTENSION) === 'zip') { + die(xlt('Nested zip files are not allowed')); + } + } + $zip->close(); + } else { + die(xlt('Failed to open the zip file')); + } } $templatepath = "$templatedir/$form_dest_filename"; diff --git a/library/forms.inc.php b/library/forms.inc.php index 7b05bf6672d..1fa906963c6 100644 --- a/library/forms.inc.php +++ b/library/forms.inc.php @@ -43,7 +43,7 @@ function addForm( } //print_r($_SESSION['therapy_group']);die; - $arraySqlBind = array(); + $arraySqlBind = array(); $sql = "insert into forms (date, encounter, form_name, form_id, pid, " . "user, groupname, authorized, formdir, therapy_group_id) values ("; if ($date == "NOW()") { diff --git a/library/js/xl/jquery-datetimepicker-2-5-4.js.php b/library/js/xl/jquery-datetimepicker-2-5-4.js.php index a92400c16d8..4b3f2b74999 100644 --- a/library/js/xl/jquery-datetimepicker-2-5-4.js.php +++ b/library/js/xl/jquery-datetimepicker-2-5-4.js.php @@ -41,6 +41,8 @@ * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 */ +use OpenEMR\Services\Utils\DateFormatterUtils; + ?> i18n:{ en: { @@ -85,22 +87,27 @@ - - format: ' H:i:s', + + format: '', + formatTime: '', + validateOnBlur: false, format: 'Y-m-d H:i:s', + formatTime: 'H:i:s', - - format: ' g:i a', - formatTime:'g:i a', + + format: '', + formatTime: '', validateOnBlur: false, format: 'Y-m-d H:i', timepicker:true, - step: '30' + step: 30 format: '',