PSUAA2 ;BIR/RDC - ALLERGY/ADVERSE EVENT Mail Messages; 23 FEB 2004
;;4.0;PHARMACY BENEFITS MANAGEMENT;;MARCH, 2005
;
; Reference to file #4.3 supported by DBIA 2496
;
EN1 ;ENtry point for ALLERGY/ADVERSE EVENT Mail Message
;
S DOMSG=""
S XMCHAN=1
S XMDUZ=DUZ
S MSGTOT=$G(^XTMP("PSU_"_PSUJOB,"PSUAA","MSGTCNT"))
S:MSGTOT="" MSGTOT=1
S LINECNT=$G(^XTMP("PSU_"_PSUJOB,"PSUAA","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,"PSUAA","MSGTCNT")) D Q ; quit - no data
.. S CURMSG=1
.. S XMSUB="V. 4.0 PBMAA"_" "_PSUMON_" "_CURMSG_"/"_MSGTOT_" "_PSUVFAC_" "_PSUVDIV
.. S ^XTMP("PSU_"_PSUJOB,"PSUAA","ERR",1)="No data to report"
.. S XMTEXT="^XTMP(""PSU_"_PSUJOB_""",""PSUAA"",""ERR"","
.. M XMY=PSUXMYS1
.. D ^XMD
. ; ** there are messages - send them **
. F CURMSG=1:1:MSGTOT D
.. S XMSUB="V. 4.0 PBMAA"_" "_PSUMON_" "_CURMSG_"/"_MSGTOT_" "_PSUVFAC_" "_PSUVDIV
.. S XMTEXT="^XTMP(""PSU_"_PSUJOB_""",""PSUAA"","_CURMSG_","
.. M XMY=PSUXMYH
.. D ^XMD
I DOMSG D ; ** CONFIRMATION MESSAGE **
. S ^XTMP("PSU_"_PSUJOB,"CONFIRM",PSUVFAC,11,"L")=LINECNT
. S ^XTMP("PSU_"_PSUJOB,"CONFIRM",PSUVFAC,11,"M")=MSGTOT
;
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSUAA2 1508 printed Dec 13, 2024@02:27:17 Page 2
PSUAA2 ;BIR/RDC - ALLERGY/ADVERSE EVENT Mail Messages; 23 FEB 2004
+1 ;;4.0;PHARMACY BENEFITS MANAGEMENT;;MARCH, 2005
+2 ;
+3 ; Reference to file #4.3 supported by DBIA 2496
+4 ;
EN1 ;ENtry point for ALLERGY/ADVERSE EVENT Mail Message
+1 ;
+2 SET DOMSG=""
+3 SET XMCHAN=1
+4 SET XMDUZ=DUZ
+5 SET MSGTOT=$GET(^XTMP("PSU_"_PSUJOB,"PSUAA","MSGTCNT"))
+6 if MSGTOT=""
SET MSGTOT=1
+7 SET LINECNT=$GET(^XTMP("PSU_"_PSUJOB,"PSUAA","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,"PSUAA","MSGTCNT"))
Begin DoDot:2
+18 SET CURMSG=1
+19 SET XMSUB="V. 4.0 PBMAA"_" "_PSUMON_" "_CURMSG_"/"_MSGTOT_" "_PSUVFAC_" "_PSUVDIV
+20 SET ^XTMP("PSU_"_PSUJOB,"PSUAA","ERR",1)="No data to report"
+21 SET XMTEXT="^XTMP(""PSU_"_PSUJOB_""",""PSUAA"",""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 PBMAA"_" "_PSUMON_" "_CURMSG_"/"_MSGTOT_" "_PSUVFAC_" "_PSUVDIV
+27 SET XMTEXT="^XTMP(""PSU_"_PSUJOB_""",""PSUAA"","_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,11,"L")=LINECNT
+32 SET ^XTMP("PSU_"_PSUJOB,"CONFIRM",PSUVFAC,11,"M")=MSGTOT
End DoDot:1
+33 ;
+34 QUIT
+35 ;