Skip to content

Commit

Permalink
Weno Validate Fix (openemr#2657)
Browse files Browse the repository at this point in the history
* Weno Validate Fix

Weno Validate was not pulling the default facility.  It was using the first facility which may not be correct…  Swicth to use PrimaryBillingLocation.  If you need/want Rx’s from a specific facility, or always from the facility where encounter occurred, then more adjustments needed…

Signed-off-by: ophthal <[email protected]>
  • Loading branch information
ophthal authored and bradymiller committed Sep 10, 2019
1 parent 3eab4c6 commit 1b02069
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions interface/weno/validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@

use OpenEMR\Common\Csrf\CsrfUtils;
use OpenEMR\Rx\Weno\TransmitData;
use OpenEMR\Services\FacilityService;

if (!CsrfUtils::verifyCsrfToken($_GET["csrf_token_form"])) {
CsrfUtils::csrfNotVerified();
}

$facilityService = new FacilityService();
$facility = $facilityService->getPrimaryBillingLocation();

$facility = getFacilities($first = '');
$pid = $GLOBALS['pid'];
$uid = $_SESSION['authUserID'];

Expand All @@ -31,37 +34,37 @@
$patient = $validation->validatePatient($pid);
$pharmacy = $validation->patientPharmacyInfo($pid);

if (empty($facility[0]['name']) || $facility[0]['name'] == "Your clinic name here") {
if (empty($facility['name']) || $facility['name'] == "Your clinic name here") {
print xlt("Please fill out facility name properly");
exit;
}

if (empty($facility[0]['phone'])) {
if (empty($facility['phone'])) {
print xlt("Please fill out facility phone properly");
exit;
}

if (empty($facility[0]['fax'])) {
if (empty($facility['fax'])) {
print xlt("Please fill out facility fax properly");
exit;
}

if (empty($facility[0]['street'])) {
if (empty($facility['street'])) {
print xlt("Please fill out facility street properly");
exit;
}

if (empty($facility[0]['city'])) {
if (empty($facility['city'])) {
print xlt("Please fill out facility city properly");
exit;
}

if (empty($facility[0]['state'])) {
if (empty($facility['state'])) {
print xlt("Please fill out facility state properly");
exit;
}

if (empty($facility[0]['postal_code'])) {
if (empty($facility['postal_code'])) {
print xlt("Please fill out facility postal code properly");
exit;
}
Expand Down

0 comments on commit 1b02069

Please sign in to comment.