op.care.bhp.PnlBHP
This Panel is handling the BHPs for the daily access by the nursery staff. The user can apply, refuse, refuse (with discarding the medication), undo the several BHPs presented.
Security
Internal module ID: nursingrecords.bhp
ACL | effect |
---|---|
print the daily plan of all BHPs | |
UPDATE | necessary to generally modify the several BHPs. this should only be granted to trained personell. |
isChangeable()
Besides the ACLs there are further professional reasons to allow or prevent the access to the BHPs. To tell if a BHP may be changed, it is vital to consider the state of the BHPs and some other issues.
There is one method that has a very important role in the authorization chain: BHPTools.isChangeable(BHP bhp)
. This method is only useful for BHPs, that are not open anymore.
It returns true
(hence empowering the user to change the BHP) when the following conditions are satisfied:
- the time (in minutes) between confirming (apply) the BHP and now doesn't exceed
SYSPropsTools.BHP_MAX_MINUTES_TO_WITHDRAW
, which is currently hardcoded in the connected database tablesysprops
. - the underlying prescription is not closed
- this BHP must not be open, and the user trying to change it now, is the same one who confirmed it in the first place.
- the resident is active in the system and not currently absent
- if there is medication involved, there must not be any trouble with it. meaning:
- if the medication's stocks should be calculated, the there must be an accessable stock in use.
- it is way to complex to undo withdrawals for more than one stock1). Therefore the user CANNOT undo them.
Confirming, refusing or discarding an open BHP
the user can apply, refuse or refuse (discard) a BHP if:
- it is still open (of course)
- the underlying prescription is not closed
- the method
BHPTools.isChangeable(BHP bhp)
returnstrue
.
undoing a confirmed BHP
a user can reset a BHP to the open state if:
- it is NOT open
- the underlying prescription is not closed
- the method
BHPTools.isChangeable(BHP bhp)
returnstrue
.