IX'>PSDLW!!,"High dispensing # must be larger than your low dispensing # "_PSDL_".",!!SPSDFLAG=1Q
IPSDH,X'<PSDHDMSGSPSDFLAG=1
W:$D(PSDFLAG)" Select another range.",!KPSD,PSDH,PSDL
Q
;
MSG;printsmessageifrangealreadyinuse
W$C(7),!!,?12," => Dispensing Site "_$S($P(^PSD(58.8,PSD,0),"^")]"":$P(^(0),"^"),1:"NAME MISSING")_" <=",!,"has set aside the range "_$P($G(^PSD(58.8,PSD,2)),"^",2)_" through "_$P($G(^(2)),"^",3)_"."
Q
;
LAST;checksrangefor'lastdispensed'
I'$D(X)SPSDFLAG=1Q
I$D(PSDEN)DLAST1KLOW,HIGH,PSDCHKQ
IX<$P($G(^PSD(58.8,DA,2)),"^",2)DMSG1SPSDFLAG=1Q
IX>$P($G(^PSD(58.8,DA,2)),"^",3)DMSG1SPSDFLAG=1
Q
;
MSG1;printsmessageifnotindispensingrange
W$C(7),!!,"Last number dispensed must be within the range "_$P($G(^PSD(58.8,DA,2)),"^",2)_" to "_$S($P($G(^(2)),"^",3):$P($G(^(2)),"^",3),1:999999999)_".",!
Q
LAST1;checksLOW/HIGHrangeandLASTdispensed
IX<LOWDMSG2SPSDFLAG=1Q
IX>HIGHDMSG2SPSDFLAG=1
Q
MSG2;printsmsgifnotindispensingrange
SPSDCHK=1
W$C(7),!!,"Last number dispensed must be within the range ",LOW," to ",HIGH,".",!