- PSUV4 ;BIR/CFL - Drug Summary & Record Summary Print Setup ;25 SEP 1998
- ;;4.0;PHARMACY BENEFITS MANAGEMENT;;MARCH, 2005
- RECSUM ;EP Generate statistical summary
- I PSUNOREC Q
- K PSULINE,J
- S Y=PSUSDT X ^DD("DD") S PSUDTS=Y
- S Y=PSUEDT X ^DD("DD") S PSUDTE=Y
- F I=1:1:17 S J(I)=$P(^XTMP(PSUIVSUB,"SUMMARY",PSUDIV,0),"^",I)
- S PSULINE(1)="IV Statistical Data Summary for "_PSUDTS_" through "_PSUDTE
- S PSULINE(2)=" "
- S X="Total IV orders:",X=$$SETSTR^VALM1(J(1),X,19,$L(J(1))),X=$$SETSTR^VALM1("Total Patients:",X,39,15)
- S X=$$SETSTR^VALM1(J(2),X,57,$L(J(2)))
- S PSULINE(3)=X
- S X="Total IV bags dispensed:",X=$$SETSTR^VALM1(J(3),X,26,$L(J(3)))
- S X=$$SETSTR^VALM1("Total Cost: $",X,39,13),X=$$SETSTR^VALM1(J(4),X,52,$L(J(4)))
- S PSULINE(4)=X
- S PSULINE(5)=" "
- S PSULINE(6)="Breakdown of IV orders:"
- S PSULINE(7)=" "
- S X="Total Outpatient IV orders:",X=$$SETSTR^VALM1(J(5),X,29,$L(J(5)))
- S X=$$SETSTR^VALM1("Total Outpatient IV bags dispensed:",X,39,35),X=$$SETSTR^VALM1(J(6),X,75,$L(J(6)))
- S PSULINE(8)=X
- S X="Total Outpatient Cost: $",X=$$SETSTR^VALM1(J(7),X,25,$L(J(7)))
- S PSULINE(9)=X
- S PSULINE(10)=" "
- S X="Total Piggybacks:",X=$$SETSTR^VALM1(J(8),X,20,$L(J(8)))
- S X=$$SETSTR^VALM1("Avg. cost per Piggyback: $",X,39,26),X=$$SETSTR^VALM1(J(9),X,65,$L(J(9)))
- S PSULINE(11)=X
- S X="Total Hyperals:",X=$$SETSTR^VALM1(J(10),X,17,$L(J(10)))
- S X=$$SETSTR^VALM1("Avg. cost per Hyperal: $",X,39,24),X=$$SETSTR^VALM1(J(11),X,63,$L(J(11)))
- S PSULINE(12)=X
- S X="Total Admixtures:",X=$$SETSTR^VALM1(J(12),X,19,$L(J(12)))
- S X=$$SETSTR^VALM1("Avg. cost per Admixture: $",X,39,26),X=$$SETSTR^VALM1(J(13),X,65,$L(J(13)))
- S PSULINE(13)=X
- S X="Total Chemotherapy:",X=$$SETSTR^VALM1(J(14),X,21,$L(J(14)))
- S X=$$SETSTR^VALM1("Avg. cost per Chemotherapy: $",X,39,29),X=$$SETSTR^VALM1(J(15),X,68,$L(J(15)))
- S PSULINE(14)=X
- S X="Total Syringes:",X=$$SETSTR^VALM1(J(16),X,17,$L(J(16)))
- S X=$$SETSTR^VALM1("Avg. cost per Syringe: $",X,39,24)
- S X=$$SETSTR^VALM1(J(17),X,63,$L(J(17)))
- S PSULINE(15)=X
- S XMCHAN=1
- S XMSUB="V. 4.0 PBMIV "_$G(PSUMON)_" "_PSUDIV_" "_PSUDIVNM
- S XMTEXT="PSULINE("
- M XMY=PSUXMYS1
- D ^XMD
- M ^XTMP(PSUIVSUB,"STATSUM",PSUDIV)=PSULINE
- Q
- DRUGSUM ; EP generate drug summary
- S Y=PSUSDT X ^DD("DD") S PSUDTS=Y
- S Y=PSUEDT X ^DD("DD") S PSUDTE=Y
- S $P(DASH,"-",79)=""
- S PSUDRG=""
- K PSULINE
- S PSULINE(1)="IV Statistical Data for "_PSUDTS_" through "_PSUDTE
- S PSULINE(2)=" "
- S X="",X=$$SETSTR^VALM1("Drug",X,42,4),X=$$SETSTR^VALM1("Total",X,54,5),X=$$SETSTR^VALM1("Number",X,67,6)
- S PSULINE(3)=X
- S X="Drug Name",X=$$SETSTR^VALM1("Strength",X,42,8),X=$$SETSTR^VALM1("Dispensed",X,54,9)
- S X=$$SETSTR^VALM1("of bags",X,67,7)
- S PSULINE(4)=X
- S PSULINE(5)=DASH
- S PSNAME="",PSLN=6,PSUGTD=0,PSUGTB=0
- F S PSNAME=$O(^XTMP(PSUIVSUB,"DRUG",PSUDIV,PSNAME)) Q:PSNAME="" D
- .S DATA=^XTMP(PSUIVSUB,"DRUG",PSUDIV,PSNAME)
- .S PSUNIT=$P(DATA,U),PSDISP=$P(DATA,U,2),PSBAGS=$P(DATA,U,3)
- .S PSUNON=$P(DATA,U,4),PSUNFI=$P(DATA,U,5)
- .S PSNAME=PSNAME_" "_$S(PSUNON="N/F":"*",1:"")_$S(PSUNFI=0:"#",1:"")
- .S LINE=""
- .S $E(LINE,1,41)=PSNAME
- .S $E(LINE,42,50)=PSUNIT
- .S $E(LINE,51,66)=$J(PSDISP,12,2)
- .S $E(LINE,67,80)=$J(PSBAGS,5,0)
- .S PSULINE(PSLN)=LINE
- .S PSLN=PSLN+1,PSUGTD=PSUGTD+PSDISP,PSUGTB=PSUGTB+PSBAGS
- S PSULINE(PSLN)=DASH
- S PSLN=PSLN+1
- S LINE=""
- S $E(LINE,1,41)="Totals:"
- S $E(LINE,51,66)=$J(PSUGTD,12,2)
- S $E(LINE,67,80)=$J(PSUGTB,5,0)
- S PSULINE(PSLN)=LINE
- S PSLN=PSLN+1
- S PSULINE(PSLN)=""
- S PSLN=PSLN+1
- S PSULINE(PSLN)="* Non Formulary"
- S PSLN=PSLN+1
- S PSULINE(PSLN)="# Not on National Formulary"
- S XMCHAN=1
- S XMSUB="V. 4.0 PBMIV "_$G(PSUMON)_" "_PSUDIV_" "_PSUDIVNM
- M XMY=PSUXMYS2
- S XMTEXT="PSULINE("
- D ^XMD
- M ^XTMP(PSUIVSUB,"DRUGSUM",PSUDIV)=PSULINE
- Q
- PSUV4 ;BIR/CFL - Drug Summary & Record Summary Print Setup ;25 SEP 1998
- +1 ;;4.0;PHARMACY BENEFITS MANAGEMENT;;MARCH, 2005
- RECSUM ;EP Generate statistical summary
- +1 IF PSUNOREC
- QUIT
- +2 KILL PSULINE,J
- +3 SET Y=PSUSDT
- XECUTE ^DD("DD")
- SET PSUDTS=Y
- +4 SET Y=PSUEDT
- XECUTE ^DD("DD")
- SET PSUDTE=Y
- +5 FOR I=1:1:17
- SET J(I)=$PIECE(^XTMP(PSUIVSUB,"SUMMARY",PSUDIV,0),"^",I)
- +6 SET PSULINE(1)="IV Statistical Data Summary for "_PSUDTS_" through "_PSUDTE
- +7 SET PSULINE(2)=" "
- +8 SET X="Total IV orders:"
- SET X=$$SETSTR^VALM1(J(1),X,19,$LENGTH(J(1)))
- SET X=$$SETSTR^VALM1("Total Patients:",X,39,15)
- +9 SET X=$$SETSTR^VALM1(J(2),X,57,$LENGTH(J(2)))
- +10 SET PSULINE(3)=X
- +11 SET X="Total IV bags dispensed:"
- SET X=$$SETSTR^VALM1(J(3),X,26,$LENGTH(J(3)))
- +12 SET X=$$SETSTR^VALM1("Total Cost: $",X,39,13)
- SET X=$$SETSTR^VALM1(J(4),X,52,$LENGTH(J(4)))
- +13 SET PSULINE(4)=X
- +14 SET PSULINE(5)=" "
- +15 SET PSULINE(6)="Breakdown of IV orders:"
- +16 SET PSULINE(7)=" "
- +17 SET X="Total Outpatient IV orders:"
- SET X=$$SETSTR^VALM1(J(5),X,29,$LENGTH(J(5)))
- +18 SET X=$$SETSTR^VALM1("Total Outpatient IV bags dispensed:",X,39,35)
- SET X=$$SETSTR^VALM1(J(6),X,75,$LENGTH(J(6)))
- +19 SET PSULINE(8)=X
- +20 SET X="Total Outpatient Cost: $"
- SET X=$$SETSTR^VALM1(J(7),X,25,$LENGTH(J(7)))
- +21 SET PSULINE(9)=X
- +22 SET PSULINE(10)=" "
- +23 SET X="Total Piggybacks:"
- SET X=$$SETSTR^VALM1(J(8),X,20,$LENGTH(J(8)))
- +24 SET X=$$SETSTR^VALM1("Avg. cost per Piggyback: $",X,39,26)
- SET X=$$SETSTR^VALM1(J(9),X,65,$LENGTH(J(9)))
- +25 SET PSULINE(11)=X
- +26 SET X="Total Hyperals:"
- SET X=$$SETSTR^VALM1(J(10),X,17,$LENGTH(J(10)))
- +27 SET X=$$SETSTR^VALM1("Avg. cost per Hyperal: $",X,39,24)
- SET X=$$SETSTR^VALM1(J(11),X,63,$LENGTH(J(11)))
- +28 SET PSULINE(12)=X
- +29 SET X="Total Admixtures:"
- SET X=$$SETSTR^VALM1(J(12),X,19,$LENGTH(J(12)))
- +30 SET X=$$SETSTR^VALM1("Avg. cost per Admixture: $",X,39,26)
- SET X=$$SETSTR^VALM1(J(13),X,65,$LENGTH(J(13)))
- +31 SET PSULINE(13)=X
- +32 SET X="Total Chemotherapy:"
- SET X=$$SETSTR^VALM1(J(14),X,21,$LENGTH(J(14)))
- +33 SET X=$$SETSTR^VALM1("Avg. cost per Chemotherapy: $",X,39,29)
- SET X=$$SETSTR^VALM1(J(15),X,68,$LENGTH(J(15)))
- +34 SET PSULINE(14)=X
- +35 SET X="Total Syringes:"
- SET X=$$SETSTR^VALM1(J(16),X,17,$LENGTH(J(16)))
- +36 SET X=$$SETSTR^VALM1("Avg. cost per Syringe: $",X,39,24)
- +37 SET X=$$SETSTR^VALM1(J(17),X,63,$LENGTH(J(17)))
- +38 SET PSULINE(15)=X
- +39 SET XMCHAN=1
- +40 SET XMSUB="V. 4.0 PBMIV "_$GET(PSUMON)_" "_PSUDIV_" "_PSUDIVNM
- +41 SET XMTEXT="PSULINE("
- +42 MERGE XMY=PSUXMYS1
- +43 DO ^XMD
- +44 MERGE ^XTMP(PSUIVSUB,"STATSUM",PSUDIV)=PSULINE
- +45 QUIT
- DRUGSUM ; EP generate drug summary
- +1 SET Y=PSUSDT
- XECUTE ^DD("DD")
- SET PSUDTS=Y
- +2 SET Y=PSUEDT
- XECUTE ^DD("DD")
- SET PSUDTE=Y
- +3 SET $PIECE(DASH,"-",79)=""
- +4 SET PSUDRG=""
- +5 KILL PSULINE
- +6 SET PSULINE(1)="IV Statistical Data for "_PSUDTS_" through "_PSUDTE
- +7 SET PSULINE(2)=" "
- +8 SET X=""
- SET X=$$SETSTR^VALM1("Drug",X,42,4)
- SET X=$$SETSTR^VALM1("Total",X,54,5)
- SET X=$$SETSTR^VALM1("Number",X,67,6)
- +9 SET PSULINE(3)=X
- +10 SET X="Drug Name"
- SET X=$$SETSTR^VALM1("Strength",X,42,8)
- SET X=$$SETSTR^VALM1("Dispensed",X,54,9)
- +11 SET X=$$SETSTR^VALM1("of bags",X,67,7)
- +12 SET PSULINE(4)=X
- +13 SET PSULINE(5)=DASH
- +14 SET PSNAME=""
- SET PSLN=6
- SET PSUGTD=0
- SET PSUGTB=0
- +15 FOR
- SET PSNAME=$ORDER(^XTMP(PSUIVSUB,"DRUG",PSUDIV,PSNAME))
- IF PSNAME=""
- QUIT
- Begin DoDot:1
- +16 SET DATA=^XTMP(PSUIVSUB,"DRUG",PSUDIV,PSNAME)
- +17 SET PSUNIT=$PIECE(DATA,U)
- SET PSDISP=$PIECE(DATA,U,2)
- SET PSBAGS=$PIECE(DATA,U,3)
- +18 SET PSUNON=$PIECE(DATA,U,4)
- SET PSUNFI=$PIECE(DATA,U,5)
- +19 SET PSNAME=PSNAME_" "_$SELECT(PSUNON="N/F":"*",1:"")_$SELECT(PSUNFI=0:"#",1:"")
- +20 SET LINE=""
- +21 SET $EXTRACT(LINE,1,41)=PSNAME
- +22 SET $EXTRACT(LINE,42,50)=PSUNIT
- +23 SET $EXTRACT(LINE,51,66)=$JUSTIFY(PSDISP,12,2)
- +24 SET $EXTRACT(LINE,67,80)=$JUSTIFY(PSBAGS,5,0)
- +25 SET PSULINE(PSLN)=LINE
- +26 SET PSLN=PSLN+1
- SET PSUGTD=PSUGTD+PSDISP
- SET PSUGTB=PSUGTB+PSBAGS
- End DoDot:1
- +27 SET PSULINE(PSLN)=DASH
- +28 SET PSLN=PSLN+1
- +29 SET LINE=""
- +30 SET $EXTRACT(LINE,1,41)="Totals:"
- +31 SET $EXTRACT(LINE,51,66)=$JUSTIFY(PSUGTD,12,2)
- +32 SET $EXTRACT(LINE,67,80)=$JUSTIFY(PSUGTB,5,0)
- +33 SET PSULINE(PSLN)=LINE
- +34 SET PSLN=PSLN+1
- +35 SET PSULINE(PSLN)=""
- +36 SET PSLN=PSLN+1
- +37 SET PSULINE(PSLN)="* Non Formulary"
- +38 SET PSLN=PSLN+1
- +39 SET PSULINE(PSLN)="# Not on National Formulary"
- +40 SET XMCHAN=1
- +41 SET XMSUB="V. 4.0 PBMIV "_$GET(PSUMON)_" "_PSUDIV_" "_PSUDIVNM
- +42 MERGE XMY=PSUXMYS2
- +43 SET XMTEXT="PSULINE("
- +44 DO ^XMD
- +45 MERGE ^XTMP(PSUIVSUB,"DRUGSUM",PSUDIV)=PSULINE
- +46 QUIT