BPCRXSET ; IHS/OIT/MJL - FILES RX FOR BPC GUI ;
;;1.5;BPC;;MAY 26, 2005
SETDATA(BPCARRAY,BPCDATA) ;EP CALL FROM REMOTE PROC: BPC RX FILE DATA
TEST S BPCGUI=1 K ^TMP($J)
S XWBWRAP=1,BPCARRAY="^TMP("_$J_")"
;S DUZ=1
;S BPCDATA="1078269~25241~3010115~1~ADAM,ADAM~N~212~788~ACETAMINOPHEN 325MG UD~30~3~4~TIT PO TID~1~W~THIS IS A TEST~1~1"
S (CRIT,DRG,LSI,DGI,DGS,SER,SERS)=""
S PSONEW("IRXN")=$P(BPCDATA,"~",1)
S PSONEW("RX #")=$P(BPCDATA,"~",1)
S PSODFN=$P(BPCDATA,"~",2)
S PSONEW("ISSUE DATE")=$P(BPCDATA,"~",3)
S PSONEW("FILL DATE")=$P(BPCDATA,"~",3)
S PSONEW("PROVIDER")=$P(BPCDATA,"~",4)
S PSONEW("PROVIDER NAME")=$P(BPCDATA,"~",5)
S PSONEW("CM")=$P(BPCDATA,"~",6)
S PSONEW("CLINIC")=$P(BPCDATA,"~",7)
S PSODRUG("IEN")=$P(BPCDATA,"~",8)
S PSODRUG("NAME")=$P(BPCDATA,"~",9)
S PSONEW("QTY")=$P(BPCDATA,"~",10)
S PSONEW("DAYS SUPPLY")=$P(BPCDATA,"~",11)
S PSONEW("# OF REFILLS")=$P(BPCDATA,"~",12)
S PSONEW("SIG")=$P(BPCDATA,"~",13)
S PSONEW("COPIES")=$P(BPCDATA,"~",14)
S PSONEW("MAIL/WINDOW")=$P(BPCDATA,"~",15)
S PSONEW("REMARKS")=$P(BPCDATA,"~",16)
S PSONEW("CLERK CODE")=$P(BPCDATA,"~",17)
S PSONEW("STATUS")=$P(BPCDATA,"~",18)
S PSONEW("PATIENT STATUS")=+$P($G(^PS(55,PSODFN,"PS")),U,1)
I 'PSONEW("PATIENT STATUS") D
. S PSONEW("PATIENT STATUS")=1
. S X=$G(^DPT(PSODFN,.1))
. S:$L(X) PSONEW("PATIENT STATUS")=2 K X
S DGI=$P(BPCDATA,"~",19)
S SER=$P(BPCDATA,"~",20)
S PSORX("VERIFY")=1
D EN^PSON52(.PSONEW)
I $G(DGI) D
. K DIC,DLAYGO,DINUM
. S $P(^PS(52.4,PSOX("IRXN"),0),U,8)=1,$P(^(0),U,9)=DGI,$P(^(0),U,10)=SER
. K DIK,DA
. S DIK="^PS(52.4,",DA=PSOX("IRXN")
. D IX^DIK K DIK,DA
;
K BPCRX S:$D(^PSRX("B",PSONEW("RX #"))) BPCRX=PSONEW("RX #")
I 'BPCRX S ^TMP($J,1)=-1,^TMP($J,2)="ERROR: RX "_PSONEW("RX #")_" NOT FILED" Q
S ^TMP($J,1)=1,^TMP($J,2)="RX "_BPCRX_" FILED"
K BPCRX,PSONEW,PSODRUG,PSOX,PSORX,PSOEXSIG,PSODFN,BPCDATA
Q
DDTEMP S PSONEW("RX #")=$P(BPCDATA,"~",1)
S PSONEW("DFN")=$P(BPCDATA,"~",2)
S PSONEW("ISSUE DATE")=$P(BPCDATA,"~",3)
S PSODFN=$P(BPCDATA,"~",4)
S PSONEW("PATIENT STATUS")=$P(BPCDATA,"~",5)
S PSONEW("PROVIDER")=$P(BPCDATA,"~",6)
S PSONEW("CM")=$P(BPCDATA,"~",7)
S PSONEW("CLINIC")=$P(BPCDATA,"~",8)
S PSODRUG("IEN")=$P(BPCDATA,"~",9)
S PSODRUG("TRADE NAME")=$P(BPCDATA,"~",10)
S PSONEW("QTY")=$P(BPCDATA,"~",11)
S PSONEW("DAYS SUPPLY")=$P(BPCDATA,"~",12)
S PSONEW("# OF REFILLS")=$P(BPCDATA,"~",13)
S PSONEW("SIG")=$P(BPCDATA,"~",14)
S PSONEW("COPIES")=$P(BPCDATA,"~",15)
S PSONEW("MAIL/WINDOW")=$P(BPCDATA,"~",16)
S PSONEW("REMARKS")=$P(BPCDATA,"~",17)
S PSONEW("CLERK CODE")=$P(BPCDATA,"~",18)
S PSODRUG("COST")=$P(BPCDATA,"~",19)
S PSOSITE=$P(BPCDATA,"~",20)
S PSONEW("LOGIN DATE")=$P(BPCDATA,"~",21)
S PSONEW("FILL DATE")=$P(BPCDATA,"~",22)
S PSONEW("PHARMACIST")=$P(BPCDATA,"~",23)
S PSONEW("LOT #")=$P(BPCDATA,"~",24)
S PSONEW("DISPENSED DATE")=$P(BPCDATA,"~",25)
S PSONEW("STOP DATE")=$P(BPCDATA,"~",26)
S PSODRUG("NDC")=$P(BPCDATA,"~",27)
S PSONEW("NDC")=$P(BPCDATA,"~",28)
S PSONEW("MANUFACTURER")=$P(BPCDATA,"~",29)
S PSONEW("EXPIRATION DATE")=$P(BPCDATA,"~",30)
S PSONEW("GENERIC PROVIDER")=$P(BPCDATA,"~",31)
S PSONEW("RELEASED DATE/TIME")=$P(BPCDATA,"~",32)
S PSONEW("METHOD OF PICK-UP")=$P(BPCDATA,"~",33)
S PSONEW("STATUS")=$P(BPCDATA,"~",34)
S PSONEW("LAST DISPENSED DATE")=$P(BPCDATA,"~",35)
S PSONEW("NEXT POSSIBLE REFILL")=$P(BPCDATA,"~",36)
S PSONEW("COSIGNING PROVIDER")=$P(BPCDATA,"~",37)
S PSONEW("TYPE OF RX")=$P(BPCDATA,"~",38)
S PSONEW("SAND")=$P(BPCDATA,"~",39)
S PSODRUG("AWP")=$P(BPCDATA,"~",40)
S PSONEW("AWP")=$P(BPCDATA,"~",41)
S PSONEW("BST")=$P(BPCDATA,"~",42)
S PSONEW("INSURER")=$P(BPCDATA,"~",43)
BPCRXSET ; IHS/OIT/MJL - FILES RX FOR BPC GUI ;
+1 ;;1.5;BPC;;MAY 26, 2005
SETDATA(BPCARRAY,BPCDATA) ;EP CALL FROM REMOTE PROC: BPC RX FILE DATA
TEST SET BPCGUI=1
KILL ^TMP($JOB)
+1 SET XWBWRAP=1
SET BPCARRAY="^TMP("_$JOB_")"
+2 ;S DUZ=1
+3 ;S BPCDATA="1078269~25241~3010115~1~ADAM,ADAM~N~212~788~ACETAMINOPHEN 325MG UD~30~3~4~TIT PO TID~1~W~THIS IS A TEST~1~1"
+4 SET (CRIT,DRG,LSI,DGI,DGS,SER,SERS)=""
+5 SET PSONEW("IRXN")=$PIECE(BPCDATA,"~",1)
+6 SET PSONEW("RX #")=$PIECE(BPCDATA,"~",1)
+7 SET PSODFN=$PIECE(BPCDATA,"~",2)
+8 SET PSONEW("ISSUE DATE")=$PIECE(BPCDATA,"~",3)
+9 SET PSONEW("FILL DATE")=$PIECE(BPCDATA,"~",3)
+10 SET PSONEW("PROVIDER")=$PIECE(BPCDATA,"~",4)
+11 SET PSONEW("PROVIDER NAME")=$PIECE(BPCDATA,"~",5)
+12 SET PSONEW("CM")=$PIECE(BPCDATA,"~",6)
+13 SET PSONEW("CLINIC")=$PIECE(BPCDATA,"~",7)
+14 SET PSODRUG("IEN")=$PIECE(BPCDATA,"~",8)
+15 SET PSODRUG("NAME")=$PIECE(BPCDATA,"~",9)
+16 SET PSONEW("QTY")=$PIECE(BPCDATA,"~",10)
+17 SET PSONEW("DAYS SUPPLY")=$PIECE(BPCDATA,"~",11)
+18 SET PSONEW("# OF REFILLS")=$PIECE(BPCDATA,"~",12)
+19 SET PSONEW("SIG")=$PIECE(BPCDATA,"~",13)
+20 SET PSONEW("COPIES")=$PIECE(BPCDATA,"~",14)
+21 SET PSONEW("MAIL/WINDOW")=$PIECE(BPCDATA,"~",15)
+22 SET PSONEW("REMARKS")=$PIECE(BPCDATA,"~",16)
+23 SET PSONEW("CLERK CODE")=$PIECE(BPCDATA,"~",17)
+24 SET PSONEW("STATUS")=$PIECE(BPCDATA,"~",18)
+25 SET PSONEW("PATIENT STATUS")=+$PIECE($GET(^PS(55,PSODFN,"PS")),U,1)
+26 IF 'PSONEW("PATIENT STATUS")
Begin DoDot:1
+27 SET PSONEW("PATIENT STATUS")=1
+28 SET X=$GET(^DPT(PSODFN,.1))
+29 IF $LENGTH(X)
SET PSONEW("PATIENT STATUS")=2
KILL X
End DoDot:1
+30 SET DGI=$PIECE(BPCDATA,"~",19)
+31 SET SER=$PIECE(BPCDATA,"~",20)
+32 SET PSORX("VERIFY")=1
+33 DO EN^PSON52(.PSONEW)
+34 IF $GET(DGI)
Begin DoDot:1
+35 KILL DIC,DLAYGO,DINUM
+36 SET $PIECE(^PS(52.4,PSOX("IRXN"),0),U,8)=1
SET $PIECE(^(0),U,9)=DGI
SET $PIECE(^(0),U,10)=SER
+37 KILL DIK,DA
+38 SET DIK="^PS(52.4,"
SET DA=PSOX("IRXN")
+39 DO IX^DIK
KILL DIK,DA
End DoDot:1
+40 ;
+41 KILL BPCRX
IF $DATA(^PSRX("B",PSONEW("RX #")))
SET BPCRX=PSONEW("RX #")
+42 IF 'BPCRX
SET ^TMP($JOB,1)=-1
SET ^TMP($JOB,2)="ERROR: RX "_PSONEW("RX #")_" NOT FILED"
QUIT
+43 SET ^TMP($JOB,1)=1
SET ^TMP($JOB,2)="RX "_BPCRX_" FILED"
+44 KILL BPCRX,PSONEW,PSODRUG,PSOX,PSORX,PSOEXSIG,PSODFN,BPCDATA
+45 QUIT
DDTEMP SET PSONEW("RX #")=$PIECE(BPCDATA,"~",1)
+1 SET PSONEW("DFN")=$PIECE(BPCDATA,"~",2)
+2 SET PSONEW("ISSUE DATE")=$PIECE(BPCDATA,"~",3)
+3 SET PSODFN=$PIECE(BPCDATA,"~",4)
+4 SET PSONEW("PATIENT STATUS")=$PIECE(BPCDATA,"~",5)
+5 SET PSONEW("PROVIDER")=$PIECE(BPCDATA,"~",6)
+6 SET PSONEW("CM")=$PIECE(BPCDATA,"~",7)
+7 SET PSONEW("CLINIC")=$PIECE(BPCDATA,"~",8)
+8 SET PSODRUG("IEN")=$PIECE(BPCDATA,"~",9)
+9 SET PSODRUG("TRADE NAME")=$PIECE(BPCDATA,"~",10)
+10 SET PSONEW("QTY")=$PIECE(BPCDATA,"~",11)
+11 SET PSONEW("DAYS SUPPLY")=$PIECE(BPCDATA,"~",12)
+12 SET PSONEW("# OF REFILLS")=$PIECE(BPCDATA,"~",13)
+13 SET PSONEW("SIG")=$PIECE(BPCDATA,"~",14)
+14 SET PSONEW("COPIES")=$PIECE(BPCDATA,"~",15)
+15 SET PSONEW("MAIL/WINDOW")=$PIECE(BPCDATA,"~",16)
+16 SET PSONEW("REMARKS")=$PIECE(BPCDATA,"~",17)
+17 SET PSONEW("CLERK CODE")=$PIECE(BPCDATA,"~",18)
+18 SET PSODRUG("COST")=$PIECE(BPCDATA,"~",19)
+19 SET PSOSITE=$PIECE(BPCDATA,"~",20)
+20 SET PSONEW("LOGIN DATE")=$PIECE(BPCDATA,"~",21)
+21 SET PSONEW("FILL DATE")=$PIECE(BPCDATA,"~",22)
+22 SET PSONEW("PHARMACIST")=$PIECE(BPCDATA,"~",23)
+23 SET PSONEW("LOT #")=$PIECE(BPCDATA,"~",24)
+24 SET PSONEW("DISPENSED DATE")=$PIECE(BPCDATA,"~",25)
+25 SET PSONEW("STOP DATE")=$PIECE(BPCDATA,"~",26)
+26 SET PSODRUG("NDC")=$PIECE(BPCDATA,"~",27)
+27 SET PSONEW("NDC")=$PIECE(BPCDATA,"~",28)
+28 SET PSONEW("MANUFACTURER")=$PIECE(BPCDATA,"~",29)
+29 SET PSONEW("EXPIRATION DATE")=$PIECE(BPCDATA,"~",30)
+30 SET PSONEW("GENERIC PROVIDER")=$PIECE(BPCDATA,"~",31)
+31 SET PSONEW("RELEASED DATE/TIME")=$PIECE(BPCDATA,"~",32)
+32 SET PSONEW("METHOD OF PICK-UP")=$PIECE(BPCDATA,"~",33)
+33 SET PSONEW("STATUS")=$PIECE(BPCDATA,"~",34)
+34 SET PSONEW("LAST DISPENSED DATE")=$PIECE(BPCDATA,"~",35)
+35 SET PSONEW("NEXT POSSIBLE REFILL")=$PIECE(BPCDATA,"~",36)
+36 SET PSONEW("COSIGNING PROVIDER")=$PIECE(BPCDATA,"~",37)
+37 SET PSONEW("TYPE OF RX")=$PIECE(BPCDATA,"~",38)
+38 SET PSONEW("SAND")=$PIECE(BPCDATA,"~",39)
+39 SET PSODRUG("AWP")=$PIECE(BPCDATA,"~",40)
+40 SET PSONEW("AWP")=$PIECE(BPCDATA,"~",41)
+41 SET PSONEW("BST")=$PIECE(BPCDATA,"~",42)
+42 SET PSONEW("INSURER")=$PIECE(BPCDATA,"~",43)