PSOCIDC4 ;BIR/LE - continuation of Copay Correction of erroneous billed copays ;11/08/05 1:56pm
;;7.0;OUTPATIENT PHARMACY;**226**;DEC 1997
;
MAIL ;user mail message
N TOTAMT,TOTUAMT,TOTCAMT,PSOCXPDA,PSOCHRG
D NOW^%DTC S Y=% D DD^%DT S PSOEND=Y
S PSOEND2=$$FMTE^XLFDT(%,"1PS")
I $G(DUZ) S XMY(DUZ)=""
S XMDUZ="PSO*7*226 "_JOBN
S XMSUB="Outpatient Pharmacy PSO*7*226 "_JOBN
S XMY("ELLZEY.LINDA@FORUM.VA.GOV")=""
F PSOCXPDA=0:0 S PSOCXPDA=$O(^XUSEC("PSO COPAY",PSOCXPDA)) Q:'PSOCXPDA S XMY(PSOCXPDA)=""
I $O(XMY(""))="" Q ; no recipients for mail message
S PSOTEXT(1)="The Rx "_JOBN_" job for the Outpatient Pharmacy patch (PSO*7*226)"
S PSOTEXT(2)="started "_PSOSTART_" and completed "_PSOEND_"."
S PSOTEXT(3)=" "
I PSOCCNT=0 S PSOTEXT(4)="No erroneously billed copay fills were found."
I PSOCNT=0 S PSOTEXT(5)="No released prescriptions were found that needed IBQ node corrections."
I PSOUCNT=0 S PSOTEXT(6)="No un-released prescription were found that needed IBQ node corrections."
I PSOCNT>0!(PSOUCNT>0)!(PSOCCNT>0) D
. S (TOTUAMT,TOTAMT,TOTCAMT)=0
. F XX="YR2004","YR2005","YR2006" D
.. S PSOCHRG=7 S:XX="YR2006" PSOCHRG=8
.. F YY=1:1:3 S PSOAMT(XX,YY)=PSOCNT(XX,YY)*YY*PSOCHRG,TOTAMT=TOTAMT+PSOAMT(XX,YY)
.. F YY=1:1:3 S PSOUAMT(XX,YY)=PSOUCNT(XX,YY)*YY*PSOCHRG,TOTUAMT=TOTUAMT+PSOUAMT(XX,YY)
.. F YY=1:1:3 S PSOCAMT(XX,YY)=PSOCCNT(XX,YY)*YY*PSOCHRG,TOTCAMT=TOTCAMT+PSOCAMT(XX,YY)
. S PSOTEXT(4)="Erroneously billed prescriptions and copay related fields have been corrected."
. S PSOTEXT(5)="There were "_$FN(PSOCNT,",")_" released fills successfully updated for "_$FN(PSOVETS,",")_" veterans."
. S PSOTEXT(6)=" "
. S PSOTEXT(7)="Released fills corrected by year:"
. S PSOTEXT(8)="2004 30-DAY EQUIVALENT FILLS: "_$J(PSOCNT("YR2004",1),6)
. S PSOTEXT(8)=PSOTEXT(8)_" $"_$J($FN(PSOAMT("YR2004",1),","),9)
. S PSOTEXT(9)="2004 60-DAY EQUIVALENT FILLS: "_$J(PSOCNT("YR2004",2),6)
. S PSOTEXT(9)=PSOTEXT(9)_" $"_$J($FN(PSOAMT("YR2004",2),","),9)
. S PSOTEXT(10)="2004 90-DAY EQUIVALENT FILLS: "_$J(PSOCNT("YR2004",3),6)
. S PSOTEXT(10)=PSOTEXT(10)_" $"_$J($FN(PSOAMT("YR2004",3),","),9)
. S PSOTEXT(11)=""
. S PSOTEXT(12)="2005 30-DAY EQUIVALENT FILLS: "_$J(PSOCNT("YR2005",1),6)
. S PSOTEXT(12)=PSOTEXT(12)_" $"_$J($FN(PSOAMT("YR2005",1),","),9)
. S PSOTEXT(13)="2005 60-DAY EQUIVALENT FILLS: "_$J(PSOCNT("YR2005",2),6)
. S PSOTEXT(13)=PSOTEXT(13)_" $"_$J($FN(PSOAMT("YR2005",2),","),9)
. S PSOTEXT(14)="2005 90-DAY EQUIVALENT FILLS: "_$J(PSOCNT("YR2005",3),6)
. S PSOTEXT(14)=PSOTEXT(14)_" $"_$J($FN(PSOAMT("YR2005",3),","),9)
. S PSOTEXT(15)=""
. S PSOTEXT(16)="2006 30-DAY EQUIVALENT FILLS: "_$J(PSOCNT("YR2006",1),6)
. S PSOTEXT(16)=PSOTEXT(16)_" $"_$J($FN(PSOAMT("YR2006",1),","),9)
. S PSOTEXT(17)="2006 60-DAY EQUIVALENT FILLS: "_$J(PSOCNT("YR2006",2),6)
. S PSOTEXT(17)=PSOTEXT(17)_" $"_$J($FN(PSOAMT("YR2006",2),","),9)
. S PSOTEXT(18)="2006 90-DAY EQUIVALENT FILLS: "_$J(PSOCNT("YR2006",3),6)
. S PSOTEXT(18)=PSOTEXT(18)_" $"_$J($FN(PSOAMT("YR2006",3),","),9)
. S PSOTEXT(19)=" =========="
. S PSOTEXT(20)=" TOTAL $"_$J($FN(TOTAMT,","),9)
. S PSOTEXT(21)=" "
. S PSOTEXT(22)="Out of the above total, there were "_$FN(PSOCCNT,",")_" cancelled copays for "_$FN(PSOCVETS,",")_" veterans."
. S PSOTEXT(23)=" "
. S PSOTEXT(24)="COPAY cancelled fills by year:"
. S PSOTEXT(25)="2004 30-DAY EQUIVALENT FILLS: "_$J(PSOCCNT("YR2004",1),6)
. S PSOTEXT(25)=PSOTEXT(25)_" $"_$J($FN(PSOCAMT("YR2004",1),","),9)
. S PSOTEXT(26)="2004 60-DAY EQUIVALENT FILLS: "_$J(PSOCCNT("YR2004",2),6)
. S PSOTEXT(26)=PSOTEXT(26)_" $"_$J($FN(PSOCAMT("YR2004",2),","),9)
. S PSOTEXT(27)="2004 90-DAY EQUIVALENT FILLS: "_$J(PSOCCNT("YR2004",3),6)
. S PSOTEXT(27)=PSOTEXT(27)_" $"_$J($FN(PSOCAMT("YR2004",3),","),9)
. S PSOTEXT(28)=""
. S PSOTEXT(29)="2005 30-DAY EQUIVALENT FILLS: "_$J(PSOCCNT("YR2005",1),6)
. S PSOTEXT(29)=PSOTEXT(29)_" $"_$J($FN(PSOCAMT("YR2005",1),","),9)
. S PSOTEXT(30)="2005 60-DAY EQUIVALENT FILLS: "_$J(PSOCCNT("YR2005",2),6)
. S PSOTEXT(30)=PSOTEXT(30)_" $"_$J($FN(PSOCAMT("YR2005",2),","),9)
. S PSOTEXT(31)="2005 90-DAY EQUIVALENT FILLS: "_$J(PSOCCNT("YR2005",3),6)
. S PSOTEXT(31)=PSOTEXT(31)_" $"_$J($FN(PSOCAMT("YR2005",3),","),9)
. S PSOTEXT(32)=" "
. S PSOTEXT(33)="2006 30-DAY EQUIVALENT FILLS: "_$J(PSOCCNT("YR2006",1),6)
. S PSOTEXT(33)=PSOTEXT(33)_" $"_$J($FN(PSOCAMT("YR2006",1),","),9)
. S PSOTEXT(34)="2006 60-DAY EQUIVALENT FILLS: "_$J(PSOCCNT("YR2006",2),6)
. S PSOTEXT(34)=PSOTEXT(34)_" $"_$J($FN(PSOCAMT("YR2006",2),","),9)
. S PSOTEXT(35)="2006 90-DAY EQUIVALENT FILLS: "_$J(PSOCCNT("YR2006",3),6)
. S PSOTEXT(35)=PSOTEXT(35)_" $"_$J($FN(PSOCAMT("YR2006",3),","),9)
. S PSOTEXT(36)=" =========="
. S PSOTEXT(37)=" TOTAL $"_$J($FN(TOTCAMT,","),9)
. S PSOTEXT(38)=" "
. S PSOTEXT(39)="There were "_$FN(PSOUCNT,",")_" unreleased fills successfully updated for "_$FN(PSOUVETS,",")_" veterans."
. S PSOTEXT(40)=" "
. S PSOTEXT(41)="Unreleased fills corrected by year:"
. S PSOTEXT(42)="2004 30-DAY EQUIVALENT FILLS: "_$J(PSOUCNT("YR2004",1),6)
. S PSOTEXT(42)=PSOTEXT(42)_" $"_$J($FN(PSOUAMT("YR2004",1),","),9)
. S PSOTEXT(43)="2004 60-DAY EQUIVALENT FILLS: "_$J(PSOUCNT("YR2004",2),6)
. S PSOTEXT(43)=PSOTEXT(43)_" $"_$J($FN(PSOUAMT("YR2004",2),","),9)
. S PSOTEXT(44)="2004 90-DAY EQUIVALENT FILLS: "_$J(PSOUCNT("YR2004",3),6)
. S PSOTEXT(44)=PSOTEXT(44)_" $"_$J($FN(PSOUAMT("YR2004",3),","),9)
. S PSOTEXT(45)=""
. S PSOTEXT(46)="2005 30-DAY EQUIVALENT FILLS: "_$J(PSOUCNT("YR2005",1),6)
. S PSOTEXT(46)=PSOTEXT(46)_" $"_$J($FN(PSOUAMT("YR2005",1),","),9)
. S PSOTEXT(47)="2005 60-DAY EQUIVALENT FILLS: "_$J(PSOUCNT("YR2005",2),6)
. S PSOTEXT(47)=PSOTEXT(47)_" $"_$J($FN(PSOUAMT("YR2005",2),","),9)
. S PSOTEXT(48)="2005 90-DAY EQUIVALENT FILLS: "_$J(PSOUCNT("YR2005",3),6)
. S PSOTEXT(48)=PSOTEXT(48)_" $"_$J($FN(PSOUAMT("YR2005",3),","),9)
. S PSOTEXT(49)=" "
. S PSOTEXT(50)="2006 30-DAY EQUIVALENT FILLS: "_$J(PSOUCNT("YR2006",1),6)
. S PSOTEXT(50)=PSOTEXT(50)_" $"_$J($FN(PSOUAMT("YR2006",1),","),9)
. S PSOTEXT(51)="2006 60-DAY EQUIVALENT FILLS: "_$J(PSOUCNT("YR2006",2),6)
. S PSOTEXT(51)=PSOTEXT(51)_" $"_$J($FN(PSOUAMT("YR2006",2),","),9)
. S PSOTEXT(52)="2006 90-DAY EQUIVALENT FILLS: "_$J(PSOUCNT("YR2006",3),6)
. S PSOTEXT(52)=PSOTEXT(52)_" $"_$J($FN(PSOUAMT("YR2006",3),","),9)
. S PSOTEXT(53)=" =========="
. S PSOTEXT(54)=" TOTAL $"_$J($FN(TOTUAMT,","),9)
. S PSOTEXT(55)=" "
. S PSOTEXT(56)="To get a report of patients/prescriptions that were affected as"
. S PSOTEXT(57)="part of this process, contact your IRM to enter D RPT^PSOCIDC3 at"
. S PSOTEXT(58)="the programmer's prompt."
;
S XMTEXT="PSOTEXT(" N DIFROM D ^XMD K XMDUZ,XMTEXT,XMSUB
Q
;
MAIL2 ;management mail message
N J,I,LIN
S LIN="",$P(LIN," ",85)=""
D NOW^%DTC S PSOTIME=$$FMDIFF^XLFDT(%,$G(PSOS1),2)
S PSOINST=$P($G(^DIC(4,+$P($G(^XMB(1,1,"XUS")),"^",17),99)),"^")
S PSOSTNM=$P($G(^DIC(4,PSOINST,0)),"^")
K PSOTEXT
K PSOUTC,PSOTC,PSOCTC,PSOUCNTS,PSOCCNTS,PSOCNTS
I $G(DUZ) S XMY(DUZ)=""
S (PSOUTC,PSOTC,PSOCTC)=0,(PSOUCNTS,PSOCNTS,PSOCCNTS)=""
F J="YR2004","YR2005","YR2006" F I=1:1:3 D
.S PSOTC=PSOTC+$G(PSOCNT(J,I))
.S PSOCNTS=PSOCNTS_","_$G(PSOCNT(J,I))
F J="YR2004","YR2005","YR2006" F I=1:1:3 D
.S PSOUTC=PSOUTC+$G(PSOUCNT(J,I))
.S PSOUCNTS=PSOUCNTS_","_$G(PSOUCNT(J,I))
F J="YR2004","YR2005","YR2006" F I=1:1:3 D
.S PSOCTC=PSOCTC+$G(PSOCCNT(J,I))
.S PSOCCNTS=PSOCCNTS_","_$G(PSOCCNT(J,I))
S XMY("ELLZEY.LINDA@FORUM.VA.GOV")=""
S:$$PROD^XUPROD(1) XMY("ELLZEY.LINDA@FORUM.VA.GOV")=""
S:$$PROD^XUPROD(1) XMY("G.BILLING AWARENESS@FORUM.VA.GOV")=""
S:$$PROD^XUPROD(1) XMY("G.PATCHES@FORUM.VA.GOV")=""
S XMDUZ="PSO*7*226 "_JOBN
S XMSUB="STATION "_$G(PSOINST)
S XMSUB=XMSUB_$S($$PROD^XUPROD(1):" (Prod)",1:" (Test)")
S XMSUB=XMSUB_" Summary of updates FOR PRESCRIPTION FILLS"
S PSOTEXT(1)=" Start time: "_PSOSTRT2
S PSOTEXT(2)=" Completed time: "_PSOEND2
S PSOTEXT(3)=" Elapsed Time: "_$$ETIME^PSOCIDC3(PSOTIME)
S PSOTEXT(4)=""
S PSOTEXT(5)=" Total RX's processed: "_$J($FN(PSOTRX,","),8)
S PSOTEXT(6)=" Total Refills processed: "_$J($FN(PSOTRF,","),8)
S PSOTEXT(7)=" Total released fills corrected: "_$J($FN(PSOTC,","),8)
S PSOTEXT(8)=" Total cancelled refills: "_$J($FN(PSOCTC,","),8)
S PSOTEXT(9)=" Total unreleased fills corrected: "_$J($FN(PSOUTC,","),8)
S PSOTEXT(10)=" Total number of vets: "_$J($FN(PSOVETS,","),8)
S PSOTEXT(11)=""
S PSOTEXT(12)=""
S PSOTEXT(13)="Excel comma delimited data below, Two heading, three data line"
S PSOTEXT(14)=""
S PSOTEXT(15)=$E(("Type of,Station,Station,,2004,,,2005,,,2006"_LIN),1,85)
S PSOTEXT(16)=$E(("Rx,Name,#,30 days,60 days,90 days,30 days,60 days,90 days,30 days,60 days,90 days"_LIN),1,85)
S PSOTEXT(17)=$E(("Released"_","_PSOSTNM_","_PSOINST_PSOCNTS_LIN),1,85)
S PSOTEXT(18)=$E(("Cancelled Copays"_","_PSOSTNM_","_PSOINST_PSOCCNTS_LIN),1,85)
S PSOTEXT(19)=$E(("Un-released"_","_PSOSTNM_","_PSOINST_PSOUCNTS_LIN),1,85)
S PSOTEXT(20)=""
S XMTEXT="PSOTEXT(" N DIFROM D ^XMD K XMDUZ,XMTEXT,XMSUB
Q
;
PSOCIDC4 ;BIR/LE - continuation of Copay Correction of erroneous billed copays ;11/08/05 1:56pm
+1 ;;7.0;OUTPATIENT PHARMACY;**226**;DEC 1997
+2 ;
MAIL ;user mail message
+1 NEW TOTAMT,TOTUAMT,TOTCAMT,PSOCXPDA,PSOCHRG
+2 DO NOW^%DTC
SET Y=%
DO DD^%DT
SET PSOEND=Y
+3 SET PSOEND2=$$FMTE^XLFDT(%,"1PS")
+4 IF $GET(DUZ)
SET XMY(DUZ)=""
+5 SET XMDUZ="PSO*7*226 "_JOBN
+6 SET XMSUB="Outpatient Pharmacy PSO*7*226 "_JOBN
+7 SET XMY("ELLZEY.LINDA@FORUM.VA.GOV")=""
+8 FOR PSOCXPDA=0:0
SET PSOCXPDA=$ORDER(^XUSEC("PSO COPAY",PSOCXPDA))
IF 'PSOCXPDA
QUIT
SET XMY(PSOCXPDA)=""
+9 ; no recipients for mail message
IF $ORDER(XMY(""))=""
QUIT
+10 SET PSOTEXT(1)="The Rx "_JOBN_" job for the Outpatient Pharmacy patch (PSO*7*226)"
+11 SET PSOTEXT(2)="started "_PSOSTART_" and completed "_PSOEND_"."
+12 SET PSOTEXT(3)=" "
+13 IF PSOCCNT=0
SET PSOTEXT(4)="No erroneously billed copay fills were found."
+14 IF PSOCNT=0
SET PSOTEXT(5)="No released prescriptions were found that needed IBQ node corrections."
+15 IF PSOUCNT=0
SET PSOTEXT(6)="No un-released prescription were found that needed IBQ node corrections."
+16 IF PSOCNT>0!(PSOUCNT>0)!(PSOCCNT>0)
Begin DoDot:1
+17 SET (TOTUAMT,TOTAMT,TOTCAMT)=0
+18 FOR XX="YR2004","YR2005","YR2006"
Begin DoDot:2
+19 SET PSOCHRG=7
IF XX="YR2006"
SET PSOCHRG=8
+20 FOR YY=1:1:3
SET PSOAMT(XX,YY)=PSOCNT(XX,YY)*YY*PSOCHRG
SET TOTAMT=TOTAMT+PSOAMT(XX,YY)
+21 FOR YY=1:1:3
SET PSOUAMT(XX,YY)=PSOUCNT(XX,YY)*YY*PSOCHRG
SET TOTUAMT=TOTUAMT+PSOUAMT(XX,YY)
+22 FOR YY=1:1:3
SET PSOCAMT(XX,YY)=PSOCCNT(XX,YY)*YY*PSOCHRG
SET TOTCAMT=TOTCAMT+PSOCAMT(XX,YY)
End DoDot:2
+23 SET PSOTEXT(4)="Erroneously billed prescriptions and copay related fields have been corrected."
+24 SET PSOTEXT(5)="There were "_$FNUMBER(PSOCNT,",")_" released fills successfully updated for "_$FNUMBER(PSOVETS,",")_" veterans."
+25 SET PSOTEXT(6)=" "
+26 SET PSOTEXT(7)="Released fills corrected by year:"
+27 SET PSOTEXT(8)="2004 30-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOCNT("YR2004",1),6)
+28 SET PSOTEXT(8)=PSOTEXT(8)_" $"_$JUSTIFY($FNUMBER(PSOAMT("YR2004",1),","),9)
+29 SET PSOTEXT(9)="2004 60-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOCNT("YR2004",2),6)
+30 SET PSOTEXT(9)=PSOTEXT(9)_" $"_$JUSTIFY($FNUMBER(PSOAMT("YR2004",2),","),9)
+31 SET PSOTEXT(10)="2004 90-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOCNT("YR2004",3),6)
+32 SET PSOTEXT(10)=PSOTEXT(10)_" $"_$JUSTIFY($FNUMBER(PSOAMT("YR2004",3),","),9)
+33 SET PSOTEXT(11)=""
+34 SET PSOTEXT(12)="2005 30-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOCNT("YR2005",1),6)
+35 SET PSOTEXT(12)=PSOTEXT(12)_" $"_$JUSTIFY($FNUMBER(PSOAMT("YR2005",1),","),9)
+36 SET PSOTEXT(13)="2005 60-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOCNT("YR2005",2),6)
+37 SET PSOTEXT(13)=PSOTEXT(13)_" $"_$JUSTIFY($FNUMBER(PSOAMT("YR2005",2),","),9)
+38 SET PSOTEXT(14)="2005 90-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOCNT("YR2005",3),6)
+39 SET PSOTEXT(14)=PSOTEXT(14)_" $"_$JUSTIFY($FNUMBER(PSOAMT("YR2005",3),","),9)
+40 SET PSOTEXT(15)=""
+41 SET PSOTEXT(16)="2006 30-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOCNT("YR2006",1),6)
+42 SET PSOTEXT(16)=PSOTEXT(16)_" $"_$JUSTIFY($FNUMBER(PSOAMT("YR2006",1),","),9)
+43 SET PSOTEXT(17)="2006 60-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOCNT("YR2006",2),6)
+44 SET PSOTEXT(17)=PSOTEXT(17)_" $"_$JUSTIFY($FNUMBER(PSOAMT("YR2006",2),","),9)
+45 SET PSOTEXT(18)="2006 90-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOCNT("YR2006",3),6)
+46 SET PSOTEXT(18)=PSOTEXT(18)_" $"_$JUSTIFY($FNUMBER(PSOAMT("YR2006",3),","),9)
+47 SET PSOTEXT(19)=" =========="
+48 SET PSOTEXT(20)=" TOTAL $"_$JUSTIFY($FNUMBER(TOTAMT,","),9)
+49 SET PSOTEXT(21)=" "
+50 SET PSOTEXT(22)="Out of the above total, there were "_$FNUMBER(PSOCCNT,",")_" cancelled copays for "_$FNUMBER(PSOCVETS,",")_" veterans."
+51 SET PSOTEXT(23)=" "
+52 SET PSOTEXT(24)="COPAY cancelled fills by year:"
+53 SET PSOTEXT(25)="2004 30-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOCCNT("YR2004",1),6)
+54 SET PSOTEXT(25)=PSOTEXT(25)_" $"_$JUSTIFY($FNUMBER(PSOCAMT("YR2004",1),","),9)
+55 SET PSOTEXT(26)="2004 60-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOCCNT("YR2004",2),6)
+56 SET PSOTEXT(26)=PSOTEXT(26)_" $"_$JUSTIFY($FNUMBER(PSOCAMT("YR2004",2),","),9)
+57 SET PSOTEXT(27)="2004 90-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOCCNT("YR2004",3),6)
+58 SET PSOTEXT(27)=PSOTEXT(27)_" $"_$JUSTIFY($FNUMBER(PSOCAMT("YR2004",3),","),9)
+59 SET PSOTEXT(28)=""
+60 SET PSOTEXT(29)="2005 30-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOCCNT("YR2005",1),6)
+61 SET PSOTEXT(29)=PSOTEXT(29)_" $"_$JUSTIFY($FNUMBER(PSOCAMT("YR2005",1),","),9)
+62 SET PSOTEXT(30)="2005 60-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOCCNT("YR2005",2),6)
+63 SET PSOTEXT(30)=PSOTEXT(30)_" $"_$JUSTIFY($FNUMBER(PSOCAMT("YR2005",2),","),9)
+64 SET PSOTEXT(31)="2005 90-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOCCNT("YR2005",3),6)
+65 SET PSOTEXT(31)=PSOTEXT(31)_" $"_$JUSTIFY($FNUMBER(PSOCAMT("YR2005",3),","),9)
+66 SET PSOTEXT(32)=" "
+67 SET PSOTEXT(33)="2006 30-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOCCNT("YR2006",1),6)
+68 SET PSOTEXT(33)=PSOTEXT(33)_" $"_$JUSTIFY($FNUMBER(PSOCAMT("YR2006",1),","),9)
+69 SET PSOTEXT(34)="2006 60-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOCCNT("YR2006",2),6)
+70 SET PSOTEXT(34)=PSOTEXT(34)_" $"_$JUSTIFY($FNUMBER(PSOCAMT("YR2006",2),","),9)
+71 SET PSOTEXT(35)="2006 90-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOCCNT("YR2006",3),6)
+72 SET PSOTEXT(35)=PSOTEXT(35)_" $"_$JUSTIFY($FNUMBER(PSOCAMT("YR2006",3),","),9)
+73 SET PSOTEXT(36)=" =========="
+74 SET PSOTEXT(37)=" TOTAL $"_$JUSTIFY($FNUMBER(TOTCAMT,","),9)
+75 SET PSOTEXT(38)=" "
+76 SET PSOTEXT(39)="There were "_$FNUMBER(PSOUCNT,",")_" unreleased fills successfully updated for "_$FNUMBER(PSOUVETS,",")_" veterans."
+77 SET PSOTEXT(40)=" "
+78 SET PSOTEXT(41)="Unreleased fills corrected by year:"
+79 SET PSOTEXT(42)="2004 30-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOUCNT("YR2004",1),6)
+80 SET PSOTEXT(42)=PSOTEXT(42)_" $"_$JUSTIFY($FNUMBER(PSOUAMT("YR2004",1),","),9)
+81 SET PSOTEXT(43)="2004 60-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOUCNT("YR2004",2),6)
+82 SET PSOTEXT(43)=PSOTEXT(43)_" $"_$JUSTIFY($FNUMBER(PSOUAMT("YR2004",2),","),9)
+83 SET PSOTEXT(44)="2004 90-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOUCNT("YR2004",3),6)
+84 SET PSOTEXT(44)=PSOTEXT(44)_" $"_$JUSTIFY($FNUMBER(PSOUAMT("YR2004",3),","),9)
+85 SET PSOTEXT(45)=""
+86 SET PSOTEXT(46)="2005 30-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOUCNT("YR2005",1),6)
+87 SET PSOTEXT(46)=PSOTEXT(46)_" $"_$JUSTIFY($FNUMBER(PSOUAMT("YR2005",1),","),9)
+88 SET PSOTEXT(47)="2005 60-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOUCNT("YR2005",2),6)
+89 SET PSOTEXT(47)=PSOTEXT(47)_" $"_$JUSTIFY($FNUMBER(PSOUAMT("YR2005",2),","),9)
+90 SET PSOTEXT(48)="2005 90-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOUCNT("YR2005",3),6)
+91 SET PSOTEXT(48)=PSOTEXT(48)_" $"_$JUSTIFY($FNUMBER(PSOUAMT("YR2005",3),","),9)
+92 SET PSOTEXT(49)=" "
+93 SET PSOTEXT(50)="2006 30-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOUCNT("YR2006",1),6)
+94 SET PSOTEXT(50)=PSOTEXT(50)_" $"_$JUSTIFY($FNUMBER(PSOUAMT("YR2006",1),","),9)
+95 SET PSOTEXT(51)="2006 60-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOUCNT("YR2006",2),6)
+96 SET PSOTEXT(51)=PSOTEXT(51)_" $"_$JUSTIFY($FNUMBER(PSOUAMT("YR2006",2),","),9)
+97 SET PSOTEXT(52)="2006 90-DAY EQUIVALENT FILLS: "_$JUSTIFY(PSOUCNT("YR2006",3),6)
+98 SET PSOTEXT(52)=PSOTEXT(52)_" $"_$JUSTIFY($FNUMBER(PSOUAMT("YR2006",3),","),9)
+99 SET PSOTEXT(53)=" =========="
+100 SET PSOTEXT(54)=" TOTAL $"_$JUSTIFY($FNUMBER(TOTUAMT,","),9)
+101 SET PSOTEXT(55)=" "
+102 SET PSOTEXT(56)="To get a report of patients/prescriptions that were affected as"
+103 SET PSOTEXT(57)="part of this process, contact your IRM to enter D RPT^PSOCIDC3 at"
+104 SET PSOTEXT(58)="the programmer's prompt."
End DoDot:1
+105 ;
+106 SET XMTEXT="PSOTEXT("
NEW DIFROM
DO ^XMD
KILL XMDUZ,XMTEXT,XMSUB
+107 QUIT
+108 ;
MAIL2 ;management mail message
+1 NEW J,I,LIN
+2 SET LIN=""
SET $PIECE(LIN," ",85)=""
+3 DO NOW^%DTC
SET PSOTIME=$$FMDIFF^XLFDT(%,$GET(PSOS1),2)
+4 SET PSOINST=$PIECE($GET(^DIC(4,+$PIECE($GET(^XMB(1,1,"XUS")),"^",17),99)),"^")
+5 SET PSOSTNM=$PIECE($GET(^DIC(4,PSOINST,0)),"^")
+6 KILL PSOTEXT
+7 KILL PSOUTC,PSOTC,PSOCTC,PSOUCNTS,PSOCCNTS,PSOCNTS
+8 IF $GET(DUZ)
SET XMY(DUZ)=""
+9 SET (PSOUTC,PSOTC,PSOCTC)=0
SET (PSOUCNTS,PSOCNTS,PSOCCNTS)=""
+10 FOR J="YR2004","YR2005","YR2006"
FOR I=1:1:3
Begin DoDot:1
+11 SET PSOTC=PSOTC+$GET(PSOCNT(J,I))
+12 SET PSOCNTS=PSOCNTS_","_$GET(PSOCNT(J,I))
End DoDot:1
+13 FOR J="YR2004","YR2005","YR2006"
FOR I=1:1:3
Begin DoDot:1
+14 SET PSOUTC=PSOUTC+$GET(PSOUCNT(J,I))
+15 SET PSOUCNTS=PSOUCNTS_","_$GET(PSOUCNT(J,I))
End DoDot:1
+16 FOR J="YR2004","YR2005","YR2006"
FOR I=1:1:3
Begin DoDot:1
+17 SET PSOCTC=PSOCTC+$GET(PSOCCNT(J,I))
+18 SET PSOCCNTS=PSOCCNTS_","_$GET(PSOCCNT(J,I))
End DoDot:1
+19 SET XMY("ELLZEY.LINDA@FORUM.VA.GOV")=""
+20 IF $$PROD^XUPROD(1)
SET XMY("ELLZEY.LINDA@FORUM.VA.GOV")=""
+21 IF $$PROD^XUPROD(1)
SET XMY("G.BILLING AWARENESS@FORUM.VA.GOV")=""
+22 IF $$PROD^XUPROD(1)
SET XMY("G.PATCHES@FORUM.VA.GOV")=""
+23 SET XMDUZ="PSO*7*226 "_JOBN
+24 SET XMSUB="STATION "_$GET(PSOINST)
+25 SET XMSUB=XMSUB_$SELECT($$PROD^XUPROD(1):" (Prod)",1:" (Test)")
+26 SET XMSUB=XMSUB_" Summary of updates FOR PRESCRIPTION FILLS"
+27 SET PSOTEXT(1)=" Start time: "_PSOSTRT2
+28 SET PSOTEXT(2)=" Completed time: "_PSOEND2
+29 SET PSOTEXT(3)=" Elapsed Time: "_$$ETIME^PSOCIDC3(PSOTIME)
+30 SET PSOTEXT(4)=""
+31 SET PSOTEXT(5)=" Total RX's processed: "_$JUSTIFY($FNUMBER(PSOTRX,","),8)
+32 SET PSOTEXT(6)=" Total Refills processed: "_$JUSTIFY($FNUMBER(PSOTRF,","),8)
+33 SET PSOTEXT(7)=" Total released fills corrected: "_$JUSTIFY($FNUMBER(PSOTC,","),8)
+34 SET PSOTEXT(8)=" Total cancelled refills: "_$JUSTIFY($FNUMBER(PSOCTC,","),8)
+35 SET PSOTEXT(9)=" Total unreleased fills corrected: "_$JUSTIFY($FNUMBER(PSOUTC,","),8)
+36 SET PSOTEXT(10)=" Total number of vets: "_$JUSTIFY($FNUMBER(PSOVETS,","),8)
+37 SET PSOTEXT(11)=""
+38 SET PSOTEXT(12)=""
+39 SET PSOTEXT(13)="Excel comma delimited data below, Two heading, three data line"
+40 SET PSOTEXT(14)=""
+41 SET PSOTEXT(15)=$EXTRACT(("Type of,Station,Station,,2004,,,2005,,,2006"_LIN),1,85)
+42 SET PSOTEXT(16)=$EXTRACT(("Rx,Name,#,30 days,60 days,90 days,30 days,60 days,90 days,30 days,60 days,90 days"_LIN),1,85)
+43 SET PSOTEXT(17)=$EXTRACT(("Released"_","_PSOSTNM_","_PSOINST_PSOCNTS_LIN),1,85)
+44 SET PSOTEXT(18)=$EXTRACT(("Cancelled Copays"_","_PSOSTNM_","_PSOINST_PSOCCNTS_LIN),1,85)
+45 SET PSOTEXT(19)=$EXTRACT(("Un-released"_","_PSOSTNM_","_PSOINST_PSOUCNTS_LIN),1,85)
+46 SET PSOTEXT(20)=""
+47 SET XMTEXT="PSOTEXT("
NEW DIFROM
DO ^XMD
KILL XMDUZ,XMTEXT,XMSUB
+48 QUIT
+49 ;