.DKVSDIR(0)="Y",DIR("B")="YES",DIR("A",1)="You have changed the dispense drug from",DIR("A",2)=PSOBDR("NAME")_" to "_$P(^PSDRUG(+PSOY,0),"^")_".",DIR("A")="Do You want to Edit the SIG"
.D^DIRI$D(DIRUT)SOUT=1Q
.S:YPSOCSIG=1
.I'YDURXI$D(DIRUT)SOUT=1Q
DKV
CT1I$P($G(^PSDRUG(PSOY,"CLOZ1")),"^")="PSOCLO1",'$O(^YSCL(603.01,"C",PSODFN,0))SVALMSG="Patient Not Registered in Clozapine Program",VALMBCK="Q"KPSOY,PSDCQ
I'$D(CLOZPAT)IPSODRUG("DEA")["A"&(PSODRUG("DEA")'["B")!(PSODRUG("DEA")["F")SPSOX=0,PSONEW("# OF REFILLS")=0KPSDY,PSDY1,PTRFQ
I$D(CLOZPAT)S(PSOX,PSONEW("N# REF"),PSONEW("# OF REFILLS"))=$S(CLOZPAT=2&($G(PSONEW("# OF REFILLS"))>2):3,CLOZPAT&($G(PSONEW("# OF REFILLS"))>1):1,1:0),PSONEW("DAYS SUPPLY")=7,ORCHK=1KPSDY,PSDY1,PTRFQ
SPSONEW("# OF REFILLS")=$S($G(PSONEW("# OF REFILLS"))'="":$G(PSONEW("# OF REFILLS")),1:PSOX)KPSDY,PSDY1,PTRF
.W$C(7),!!,PSRF_" refills are not correct for a "_PSDAYS_" day supply.",!,"Please enter correct # of refills for a "_PSDAYS_" day supply. Max refills allowed is "_MAX_".",!
EDSTATIPSRF>PTRFW!,$C(7),PSRF_" refills are greater than "_PTRF_" allowed for "_$P(PTST,"^")_" Rx Patient Status.",!SPSTMAX=1,PSTMAX("PTRF")=PTRF,PSTMAX("PSRF")=PSRF,PSTMAX("PT")=$P(PTST,"^")
Q
OERFSDIR(0)="N^0:"_PSOX,DIR("A")="# OF REFILLS"
SDIR("B")=$S($G(POERR):PSONEW("# OF REFILLS"),$G(PSONEW("N# REF"))]"":PSONEW("N# REF"),$G(PSONEW("# OF REFILLS"))]"":PSONEW("# OF REFILLS"),$G(PSOX1)]""&(PSOX>PSOX1):PSOX1,1:PSOX)
SDIR("?")="Enter a whole number. The maximum is set by the Rx Patient Status because there is no Dispense Drug."
D^DIRG:$D(DIRUT)REFX
S(PSONEW("N# REF"),PSONEW("# OF REFILLS"))=Y
REFXS:'$D(PSONEW("# OF REFILLS"))PSONEW("# OF REFILLS")=$S($G(PSONEW("N# REF"))]"":PSONEW("N# REF"),$G(PSOX1)]""&($G(PSOX)>PSOX1):PSOX1,1:PSOX)