Facility Address missing from prescriptions

Our system just stopped showing addresses on the prescriptions. No DEA number. Nothing. We have not made any code changes to this part of the system.

Ideas?

Out of the Blue ?
The obvious checks…
Clear Browser Cache?
Check Globals->Rx…?

Yes from nowhere we logged in next day and boom! The address is no longer showing up on the prescriptions.

No code changes. It is in all browsers in all offices. I did check Global RX but there is nothing in there I see to turn off addresses.

Maybe an edit to the address is corrupt. Pull up and resave.

I was able to recreate the incident that created the trouble to begin with.
I changed the facility name from the Globals > Facilities.

When I change it from what we had in there from the start of using the system. The address vanishes from the prescriptions. When I put it back to the original, it comes back. What just happened?

Should be an error in the php log I suspect

No error message.

Then it is a javascript error. Have you tried looking in browser for error?

No console errors either.

I tried putting the address back to the original. The first time it worked. The address displayed on the prescription. Then, I took it away again to see if it would vanish again and it did. I was going to put back a little at a time to see if I can pin point where the failure was occurring. But now, no matter what the address does not show after changing it from the original.

I cleared my browsing history for the past hour and I am using chrome. Going to switch Ice Dragon now and see if it stays the same.

If I change any part of the original name, it disappears from the prescriptions without a trace.

Figured it out.

When the name of the facility is changed, you have to go over to the user account. Open the edit window and save the account information. The code checks the facility name that is saved in the user table. If it is not an exact match, the address is not retrieved. Thus, shows up blank.

Glad you found your issue but I’m confused.(no news there!). In essence whenever facility is changed any user associated with that facility has to be re-saved, Is that the jest?

That is what I have encountered.

May be an attempt at security or just a bug but, too me, I vote bug. I don’t understand the purpose of the behavior however I’m sure it will come up again. I’ll look at after fixing statements.

Agree with the bug assessment :slight_smile:

I was able to re-create and appears that it is only after you alter the facility name but, any other edits are okay so, it makes sense now. Will go ahead and auto update user table unless this may violate some clinical protocol dealing with provider credentials. Hopefully someone will let me know if this is so.

New PR #988 to resolve this issue.

Thanks for the fix and just brought it into the codebase.
-brady

Thanks for your quick solution to the issue in the future. Unfortunately, it doesn’t address it right now in the present. We are currently using 5.0.0(3). Where would this code go?

In interface/usergroup/facilities.php , could run the query directly for 5.0.0:

sqlStatement("UPDATE users SET facility=?  WHERE facility_id=?", array($newFacility['name'], $newFacility['fid']))

Brady,

I tried adding sqlStatement suggested to the facilities.php file but it did
not work for me.

Sherwin