PSUVIT2 ;BIR/RDC - Vitals/Immunizations Mail Messages; 24 DEC 2003
;;4.0;PHARMACY BENEFITS MANAGEMENT;;MARCH, 2005
;
;DBIAs
;
VIMAIL ;ENtry point for Vitals/Immunizations Mail Message
;
S DOMSG=""
S XMCHAN=1
S XMDUZ=DUZ
S MSGTOT=$G(^XTMP("PSU_"_PSUJOB,"PSUVI","MSGTCNT"))
S:MSGTOT="" MSGTOT=1
S LINECNT=$G(^XTMP("PSU_"_PSUJOB,"PSUVI","LINECNT"))
S:LINECNT=0 LINECNT=1
; ** SET THE HEADER DATA
S X=$$VALI^PSUTL(4.3,1,217)
S PSUVFAC=+$$VAL^PSUTL(4,X,99)
;
S X=PSUVFAC,DIC=40.8,DIC(0)="X",D="C" D IX^DIC
S X=+Y S PSUVDIV=$$VAL^PSUTL(40.8,X,.01)
;
I $G(PSUMASF)!$G(PSUDUZ)!$G(PSUPBMG) S DOMSG=1 D
. I '$D(^XTMP("PSU_"_PSUJOB,"PSUVI","MSGTCNT")) D Q ; quit - no data
.. S CURMSG=1
.. S XMSUB="V. 4.0 PBMVI"_" "_PSUMON_" "_CURMSG_"/"_MSGTOT_" "_PSUVFAC_" "_PSUVDIV
.. S ^XTMP("PSU_"_PSUJOB,"PSUVI","ERR",1)="No data to report"
.. S XMTEXT="^XTMP(""PSU_"_PSUJOB_""",""PSUVI"",""ERR"","
.. M XMY=PSUXMYS1
.. D ^XMD
. ; ** there are messages - send them **
. F CURMSG=1:1:MSGTOT D
.. S XMSUB="V. 4.0 PBMVI"_" "_PSUMON_" "_CURMSG_"/"_MSGTOT_" "_PSUVFAC_" "_PSUVDIV
.. S XMTEXT="^XTMP(""PSU_"_PSUJOB_""",""PSUVI"","_CURMSG_","
.. M XMY=PSUXMYH
.. D ^XMD
I DOMSG D ; ** CONFIRMATION MESSAGE **
. S ^XTMP("PSU_"_PSUJOB,"CONFIRM",PSUVFAC,12,"L")=LINECNT
. S ^XTMP("PSU_"_PSUJOB,"CONFIRM",PSUVFAC,12,"M")=MSGTOT
;
Q
;
PSUVIT2 ;BIR/RDC - Vitals/Immunizations Mail Messages; 24 DEC 2003
+1 ;;4.0;PHARMACY BENEFITS MANAGEMENT;;MARCH, 2005
+2 ;
+3 ;DBIAs
+4 ;
VIMAIL ;ENtry point for Vitals/Immunizations Mail Message
+1 ;
+2 SET DOMSG=""
+3 SET XMCHAN=1
+4 SET XMDUZ=DUZ
+5 SET MSGTOT=$GET(^XTMP("PSU_"_PSUJOB,"PSUVI","MSGTCNT"))
+6 IF MSGTOT=""
SET MSGTOT=1
+7 SET LINECNT=$GET(^XTMP("PSU_"_PSUJOB,"PSUVI","LINECNT"))
+8 IF LINECNT=0
SET LINECNT=1
+9 ; ** SET THE HEADER DATA
+10 SET X=$$VALI^PSUTL(4.3,1,217)
+11 SET PSUVFAC=+$$VAL^PSUTL(4,X,99)
+12 ;
+13 SET X=PSUVFAC
SET DIC=40.8
SET DIC(0)="X"
SET D="C"
DO IX^DIC
+14 SET X=+Y
SET PSUVDIV=$$VAL^PSUTL(40.8,X,.01)
+15 ;
+16 IF $GET(PSUMASF)!$GET(PSUDUZ)!$GET(PSUPBMG)
SET DOMSG=1
Begin DoDot:1
+17 ; quit - no data
IF '$DATA(^XTMP("PSU_"_PSUJOB,"PSUVI","MSGTCNT"))
Begin DoDot:2
+18 SET CURMSG=1
+19 SET XMSUB="V. 4.0 PBMVI"_" "_PSUMON_" "_CURMSG_"/"_MSGTOT_" "_PSUVFAC_" "_PSUVDIV
+20 SET ^XTMP("PSU_"_PSUJOB,"PSUVI","ERR",1)="No data to report"
+21 SET XMTEXT="^XTMP(""PSU_"_PSUJOB_""",""PSUVI"",""ERR"","
+22 MERGE XMY=PSUXMYS1
+23 DO ^XMD
End DoDot:2
QUIT
+24 ; ** there are messages - send them **
+25 FOR CURMSG=1:1:MSGTOT
Begin DoDot:2
+26 SET XMSUB="V. 4.0 PBMVI"_" "_PSUMON_" "_CURMSG_"/"_MSGTOT_" "_PSUVFAC_" "_PSUVDIV
+27 SET XMTEXT="^XTMP(""PSU_"_PSUJOB_""",""PSUVI"","_CURMSG_","
+28 MERGE XMY=PSUXMYH
+29 DO ^XMD
End DoDot:2
End DoDot:1
+30 ; ** CONFIRMATION MESSAGE **
IF DOMSG
Begin DoDot:1
+31 SET ^XTMP("PSU_"_PSUJOB,"CONFIRM",PSUVFAC,12,"L")=LINECNT
+32 SET ^XTMP("PSU_"_PSUJOB,"CONFIRM",PSUVFAC,12,"M")=MSGTOT
End DoDot:1
+33 ;
+34 QUIT
+35 ;