PSOCAN2 ;BHAM ISC/JMB - modular rx cancel with speed ability drug check ; 10/23/06 11:30am
;;7.0;OUTPATIENT PHARMACY;**8,18,62,46,88,164,235,148,259**;DEC 1997;Build 5
;External reference to ^PSDRUG supported by dbia 221
REINS N DODR
I $P(^PSRX(DA,2),"^",6)
DT W $S('RFCNT:"Filled",1:"Refilled # "_LREF)_": "_XFDT,?32,"Printed: "_$S(LREF=RFCNT:XLPDT,1:"")
I W ?56,"Released:" I '$G(DODR) W !?5,"Placing Rx on suspense. Please wait..." D SUS
K DODR
Q
SUS ;Adds rec to suspense
S ACT=1,RXN=DA,RX0=^PSRX(DA,0),RXS=$O(^PS(52.5,"B",DA,0)) I RXS S DA=RXS,DIK="^PS(52.5," D ^DIK S DA=RXN
S RXP=$S($D(RXP):RXP,1:0),DIC="^PS(52.5,",DIC(0)="L",X=RXN,DIC("DR")=".02///"_FDT_";.03///"_$P(RX0,"^",2)_";.04///M;.05///"_RXP_";.06////"_$G(PSOSITE)_";2///0" K DD,DO D FILE^DICN
I +$G(Y),$G(RFCNT)'="" S $P(^PS(52.5,+Y,0),"^",13)=$G(RFCNT)
S DA=RXN,$P(^PSRX(DA,"STA"),"^")=5,LFD=$E($P(^PSRX(DA,3),"^"),4,5)_"-"_$E($P(^(3),"^"),6,7)_"-"_$E($P(^(3),"^"),2,3)
S ACOM="RX Placed on Suspense until "_LFD D AREC^PSOCAN1 S ST="SC",PHST="ZS" D EN^PSOHLSN1(DA,ST,PHST,ACOM) K ST,PHST
Q
DRGDRG ;Checks for drug/drug interaction, duplicate drug and class
Q:$P(^PSRX(DA,2),"^",6)5 RFCNT=$G(RFCNT)+1
S ACNT=$G(ACNT)+1
D NOW^%DTC S ^PSRX(DA,"A",0)="^52.3DA^"_ACNT_"^"_ACNT S ^PSRX(DA,"A",ACNT,0)=%_"^R^"_DUZ_"^"_RFCNT_"^"_ACOM
K ^PSRX("APSOD",PSODFN,DA),ACNT,RFCNT,RF,%
S $P(^PSRX(DA,3),"^")=$P(^PSRX(DA,3),"^",5),$P(^(3),"^",2)=$P(^(3),"^",8)
S $P(^PSRX(DA,3),"^",5)="",$P(^(3),"^",8)=""
Q
NVER ;Called from PSOCAN3, needs DA defined
N PSONVC,PSONVCP,PSONVCC
S PSONVC="SC",PSONVCP="IP",PSONVCC="Put in non-verified status" D EN^PSOHLSN1(DA,PSONVC,PSONVCP,PSONVCC)
Q
RMB(IDX) ;remove Rx if found in array BBRX() (Bingo Board)
N ST4,ST5,ST6,K
S ST4=BBRX(IDX) Q:ST4'[(DA_",")
S ST6=""
F K=1:1 S ST5=$P(ST4,",",K) Q:'ST5 D
. S:ST5'=DA ST6=ST6_$S('ST6:"",1:",")_ST5
. S:ST6]"" BBRX(IDX)=ST6_"," K:ST6="" BBRX(IDX)
I '$D(BBRX) K BINGCRT
Q