source: WorldVistAEHR/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOCIDC4.m@ 619

Last change on this file since 619 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 9.2 KB
Line 
1PSOCIDC4 ;BIR/LE - continuation of Copay Correction of erroneous billed copays ;11/08/05 1:56pm
2 ;;7.0;OUTPATIENT PHARMACY;**226**;DEC 1997
3 ;
4MAIL ;user mail message
5 N TOTAMT,TOTUAMT,TOTCAMT,PSOCXPDA,PSOCHRG
6 D NOW^%DTC S Y=% D DD^%DT S PSOEND=Y
7 S PSOEND2=$$FMTE^XLFDT(%,"1PS")
8 I $G(DUZ) S XMY(DUZ)=""
9 S XMDUZ="PSO*7*226 "_JOBN
10 S XMSUB="Outpatient Pharmacy PSO*7*226 "_JOBN
11 S XMY("ELLZEY.LINDA@FORUM.VA.GOV")=""
12 F PSOCXPDA=0:0 S PSOCXPDA=$O(^XUSEC("PSO COPAY",PSOCXPDA)) Q:'PSOCXPDA S XMY(PSOCXPDA)=""
13 I $O(XMY(""))="" Q ; no recipients for mail message
14 S PSOTEXT(1)="The Rx "_JOBN_" job for the Outpatient Pharmacy patch (PSO*7*226)"
15 S PSOTEXT(2)="started "_PSOSTART_" and completed "_PSOEND_"."
16 S PSOTEXT(3)=" "
17 I PSOCCNT=0 S PSOTEXT(4)="No erroneously billed copay fills were found."
18 I PSOCNT=0 S PSOTEXT(5)="No released prescriptions were found that needed IBQ node corrections."
19 I PSOUCNT=0 S PSOTEXT(6)="No un-released prescription were found that needed IBQ node corrections."
20 I PSOCNT>0!(PSOUCNT>0)!(PSOCCNT>0) D
21 . S (TOTUAMT,TOTAMT,TOTCAMT)=0
22 . F XX="YR2004","YR2005","YR2006" D
23 .. S PSOCHRG=7 S:XX="YR2006" PSOCHRG=8
24 .. F YY=1:1:3 S PSOAMT(XX,YY)=PSOCNT(XX,YY)*YY*PSOCHRG,TOTAMT=TOTAMT+PSOAMT(XX,YY)
25 .. F YY=1:1:3 S PSOUAMT(XX,YY)=PSOUCNT(XX,YY)*YY*PSOCHRG,TOTUAMT=TOTUAMT+PSOUAMT(XX,YY)
26 .. F YY=1:1:3 S PSOCAMT(XX,YY)=PSOCCNT(XX,YY)*YY*PSOCHRG,TOTCAMT=TOTCAMT+PSOCAMT(XX,YY)
27 . S PSOTEXT(4)="Erroneously billed prescriptions and copay related fields have been corrected."
28 . S PSOTEXT(5)="There were "_$FN(PSOCNT,",")_" released fills successfully updated for "_$FN(PSOVETS,",")_" veterans."
29 . S PSOTEXT(6)=" "
30 . S PSOTEXT(7)="Released fills corrected by year:"
31 . S PSOTEXT(8)="2004 30-DAY EQUIVALENT FILLS: "_$J(PSOCNT("YR2004",1),6)
32 . S PSOTEXT(8)=PSOTEXT(8)_" $"_$J($FN(PSOAMT("YR2004",1),","),9)
33 . S PSOTEXT(9)="2004 60-DAY EQUIVALENT FILLS: "_$J(PSOCNT("YR2004",2),6)
34 . S PSOTEXT(9)=PSOTEXT(9)_" $"_$J($FN(PSOAMT("YR2004",2),","),9)
35 . S PSOTEXT(10)="2004 90-DAY EQUIVALENT FILLS: "_$J(PSOCNT("YR2004",3),6)
36 . S PSOTEXT(10)=PSOTEXT(10)_" $"_$J($FN(PSOAMT("YR2004",3),","),9)
37 . S PSOTEXT(11)=""
38 . S PSOTEXT(12)="2005 30-DAY EQUIVALENT FILLS: "_$J(PSOCNT("YR2005",1),6)
39 . S PSOTEXT(12)=PSOTEXT(12)_" $"_$J($FN(PSOAMT("YR2005",1),","),9)
40 . S PSOTEXT(13)="2005 60-DAY EQUIVALENT FILLS: "_$J(PSOCNT("YR2005",2),6)
41 . S PSOTEXT(13)=PSOTEXT(13)_" $"_$J($FN(PSOAMT("YR2005",2),","),9)
42 . S PSOTEXT(14)="2005 90-DAY EQUIVALENT FILLS: "_$J(PSOCNT("YR2005",3),6)
43 . S PSOTEXT(14)=PSOTEXT(14)_" $"_$J($FN(PSOAMT("YR2005",3),","),9)
44 . S PSOTEXT(15)=""
45 . S PSOTEXT(16)="2006 30-DAY EQUIVALENT FILLS: "_$J(PSOCNT("YR2006",1),6)
46 . S PSOTEXT(16)=PSOTEXT(16)_" $"_$J($FN(PSOAMT("YR2006",1),","),9)
47 . S PSOTEXT(17)="2006 60-DAY EQUIVALENT FILLS: "_$J(PSOCNT("YR2006",2),6)
48 . S PSOTEXT(17)=PSOTEXT(17)_" $"_$J($FN(PSOAMT("YR2006",2),","),9)
49 . S PSOTEXT(18)="2006 90-DAY EQUIVALENT FILLS: "_$J(PSOCNT("YR2006",3),6)
50 . S PSOTEXT(18)=PSOTEXT(18)_" $"_$J($FN(PSOAMT("YR2006",3),","),9)
51 . S PSOTEXT(19)=" =========="
52 . S PSOTEXT(20)=" TOTAL $"_$J($FN(TOTAMT,","),9)
53 . S PSOTEXT(21)=" "
54 . S PSOTEXT(22)="Out of the above total, there were "_$FN(PSOCCNT,",")_" cancelled copays for "_$FN(PSOCVETS,",")_" veterans."
55 . S PSOTEXT(23)=" "
56 . S PSOTEXT(24)="COPAY cancelled fills by year:"
57 . S PSOTEXT(25)="2004 30-DAY EQUIVALENT FILLS: "_$J(PSOCCNT("YR2004",1),6)
58 . S PSOTEXT(25)=PSOTEXT(25)_" $"_$J($FN(PSOCAMT("YR2004",1),","),9)
59 . S PSOTEXT(26)="2004 60-DAY EQUIVALENT FILLS: "_$J(PSOCCNT("YR2004",2),6)
60 . S PSOTEXT(26)=PSOTEXT(26)_" $"_$J($FN(PSOCAMT("YR2004",2),","),9)
61 . S PSOTEXT(27)="2004 90-DAY EQUIVALENT FILLS: "_$J(PSOCCNT("YR2004",3),6)
62 . S PSOTEXT(27)=PSOTEXT(27)_" $"_$J($FN(PSOCAMT("YR2004",3),","),9)
63 . S PSOTEXT(28)=""
64 . S PSOTEXT(29)="2005 30-DAY EQUIVALENT FILLS: "_$J(PSOCCNT("YR2005",1),6)
65 . S PSOTEXT(29)=PSOTEXT(29)_" $"_$J($FN(PSOCAMT("YR2005",1),","),9)
66 . S PSOTEXT(30)="2005 60-DAY EQUIVALENT FILLS: "_$J(PSOCCNT("YR2005",2),6)
67 . S PSOTEXT(30)=PSOTEXT(30)_" $"_$J($FN(PSOCAMT("YR2005",2),","),9)
68 . S PSOTEXT(31)="2005 90-DAY EQUIVALENT FILLS: "_$J(PSOCCNT("YR2005",3),6)
69 . S PSOTEXT(31)=PSOTEXT(31)_" $"_$J($FN(PSOCAMT("YR2005",3),","),9)
70 . S PSOTEXT(32)=" "
71 . S PSOTEXT(33)="2006 30-DAY EQUIVALENT FILLS: "_$J(PSOCCNT("YR2006",1),6)
72 . S PSOTEXT(33)=PSOTEXT(33)_" $"_$J($FN(PSOCAMT("YR2006",1),","),9)
73 . S PSOTEXT(34)="2006 60-DAY EQUIVALENT FILLS: "_$J(PSOCCNT("YR2006",2),6)
74 . S PSOTEXT(34)=PSOTEXT(34)_" $"_$J($FN(PSOCAMT("YR2006",2),","),9)
75 . S PSOTEXT(35)="2006 90-DAY EQUIVALENT FILLS: "_$J(PSOCCNT("YR2006",3),6)
76 . S PSOTEXT(35)=PSOTEXT(35)_" $"_$J($FN(PSOCAMT("YR2006",3),","),9)
77 . S PSOTEXT(36)=" =========="
78 . S PSOTEXT(37)=" TOTAL $"_$J($FN(TOTCAMT,","),9)
79 . S PSOTEXT(38)=" "
80 . S PSOTEXT(39)="There were "_$FN(PSOUCNT,",")_" unreleased fills successfully updated for "_$FN(PSOUVETS,",")_" veterans."
81 . S PSOTEXT(40)=" "
82 . S PSOTEXT(41)="Unreleased fills corrected by year:"
83 . S PSOTEXT(42)="2004 30-DAY EQUIVALENT FILLS: "_$J(PSOUCNT("YR2004",1),6)
84 . S PSOTEXT(42)=PSOTEXT(42)_" $"_$J($FN(PSOUAMT("YR2004",1),","),9)
85 . S PSOTEXT(43)="2004 60-DAY EQUIVALENT FILLS: "_$J(PSOUCNT("YR2004",2),6)
86 . S PSOTEXT(43)=PSOTEXT(43)_" $"_$J($FN(PSOUAMT("YR2004",2),","),9)
87 . S PSOTEXT(44)="2004 90-DAY EQUIVALENT FILLS: "_$J(PSOUCNT("YR2004",3),6)
88 . S PSOTEXT(44)=PSOTEXT(44)_" $"_$J($FN(PSOUAMT("YR2004",3),","),9)
89 . S PSOTEXT(45)=""
90 . S PSOTEXT(46)="2005 30-DAY EQUIVALENT FILLS: "_$J(PSOUCNT("YR2005",1),6)
91 . S PSOTEXT(46)=PSOTEXT(46)_" $"_$J($FN(PSOUAMT("YR2005",1),","),9)
92 . S PSOTEXT(47)="2005 60-DAY EQUIVALENT FILLS: "_$J(PSOUCNT("YR2005",2),6)
93 . S PSOTEXT(47)=PSOTEXT(47)_" $"_$J($FN(PSOUAMT("YR2005",2),","),9)
94 . S PSOTEXT(48)="2005 90-DAY EQUIVALENT FILLS: "_$J(PSOUCNT("YR2005",3),6)
95 . S PSOTEXT(48)=PSOTEXT(48)_" $"_$J($FN(PSOUAMT("YR2005",3),","),9)
96 . S PSOTEXT(49)=" "
97 . S PSOTEXT(50)="2006 30-DAY EQUIVALENT FILLS: "_$J(PSOUCNT("YR2006",1),6)
98 . S PSOTEXT(50)=PSOTEXT(50)_" $"_$J($FN(PSOUAMT("YR2006",1),","),9)
99 . S PSOTEXT(51)="2006 60-DAY EQUIVALENT FILLS: "_$J(PSOUCNT("YR2006",2),6)
100 . S PSOTEXT(51)=PSOTEXT(51)_" $"_$J($FN(PSOUAMT("YR2006",2),","),9)
101 . S PSOTEXT(52)="2006 90-DAY EQUIVALENT FILLS: "_$J(PSOUCNT("YR2006",3),6)
102 . S PSOTEXT(52)=PSOTEXT(52)_" $"_$J($FN(PSOUAMT("YR2006",3),","),9)
103 . S PSOTEXT(53)=" =========="
104 . S PSOTEXT(54)=" TOTAL $"_$J($FN(TOTUAMT,","),9)
105 . S PSOTEXT(55)=" "
106 . S PSOTEXT(56)="To get a report of patients/prescriptions that were affected as"
107 . S PSOTEXT(57)="part of this process, contact your IRM to enter D RPT^PSOCIDC3 at"
108 . S PSOTEXT(58)="the programmer's prompt."
109 ;
110 S XMTEXT="PSOTEXT(" N DIFROM D ^XMD K XMDUZ,XMTEXT,XMSUB
111 Q
112 ;
113MAIL2 ;management mail message
114 N J,I,LIN
115 S LIN="",$P(LIN," ",85)=""
116 D NOW^%DTC S PSOTIME=$$FMDIFF^XLFDT(%,$G(PSOS1),2)
117 S PSOINST=$P($G(^DIC(4,+$P($G(^XMB(1,1,"XUS")),"^",17),99)),"^")
118 S PSOSTNM=$P($G(^DIC(4,PSOINST,0)),"^")
119 K PSOTEXT
120 K PSOUTC,PSOTC,PSOCTC,PSOUCNTS,PSOCCNTS,PSOCNTS
121 I $G(DUZ) S XMY(DUZ)=""
122 S (PSOUTC,PSOTC,PSOCTC)=0,(PSOUCNTS,PSOCNTS,PSOCCNTS)=""
123 F J="YR2004","YR2005","YR2006" F I=1:1:3 D
124 .S PSOTC=PSOTC+$G(PSOCNT(J,I))
125 .S PSOCNTS=PSOCNTS_","_$G(PSOCNT(J,I))
126 F J="YR2004","YR2005","YR2006" F I=1:1:3 D
127 .S PSOUTC=PSOUTC+$G(PSOUCNT(J,I))
128 .S PSOUCNTS=PSOUCNTS_","_$G(PSOUCNT(J,I))
129 F J="YR2004","YR2005","YR2006" F I=1:1:3 D
130 .S PSOCTC=PSOCTC+$G(PSOCCNT(J,I))
131 .S PSOCCNTS=PSOCCNTS_","_$G(PSOCCNT(J,I))
132 S XMY("ELLZEY.LINDA@FORUM.VA.GOV")=""
133 S:$$PROD^XUPROD(1) XMY("ELLZEY.LINDA@FORUM.VA.GOV")=""
134 S:$$PROD^XUPROD(1) XMY("G.BILLING AWARENESS@FORUM.VA.GOV")=""
135 S:$$PROD^XUPROD(1) XMY("G.PATCHES@FORUM.VA.GOV")=""
136 S XMDUZ="PSO*7*226 "_JOBN
137 S XMSUB="STATION "_$G(PSOINST)
138 S XMSUB=XMSUB_$S($$PROD^XUPROD(1):" (Prod)",1:" (Test)")
139 S XMSUB=XMSUB_" Summary of updates FOR PRESCRIPTION FILLS"
140 S PSOTEXT(1)=" Start time: "_PSOSTRT2
141 S PSOTEXT(2)=" Completed time: "_PSOEND2
142 S PSOTEXT(3)=" Elapsed Time: "_$$ETIME^PSOCIDC3(PSOTIME)
143 S PSOTEXT(4)=""
144 S PSOTEXT(5)=" Total RX's processed: "_$J($FN(PSOTRX,","),8)
145 S PSOTEXT(6)=" Total Refills processed: "_$J($FN(PSOTRF,","),8)
146 S PSOTEXT(7)=" Total released fills corrected: "_$J($FN(PSOTC,","),8)
147 S PSOTEXT(8)=" Total cancelled refills: "_$J($FN(PSOCTC,","),8)
148 S PSOTEXT(9)=" Total unreleased fills corrected: "_$J($FN(PSOUTC,","),8)
149 S PSOTEXT(10)=" Total number of vets: "_$J($FN(PSOVETS,","),8)
150 S PSOTEXT(11)=""
151 S PSOTEXT(12)=""
152 S PSOTEXT(13)="Excel comma delimited data below, Two heading, three data line"
153 S PSOTEXT(14)=""
154 S PSOTEXT(15)=$E(("Type of,Station,Station,,2004,,,2005,,,2006"_LIN),1,85)
155 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)
156 S PSOTEXT(17)=$E(("Released"_","_PSOSTNM_","_PSOINST_PSOCNTS_LIN),1,85)
157 S PSOTEXT(18)=$E(("Cancelled Copays"_","_PSOSTNM_","_PSOINST_PSOCCNTS_LIN),1,85)
158 S PSOTEXT(19)=$E(("Un-released"_","_PSOSTNM_","_PSOINST_PSOUCNTS_LIN),1,85)
159 S PSOTEXT(20)=""
160 S XMTEXT="PSOTEXT(" N DIFROM D ^XMD K XMDUZ,XMTEXT,XMSUB
161 Q
162 ;
Note: See TracBrowser for help on using the repository browser.