PRCOVUP2 ;WCAMPUS/-GENERATE MAIL MESSAGE AT END OF CONVERSION ;3/22/95
 ;;5.1;IFCAP;;Oct 20, 2000
 ;Per VHA Directive 10-93-142, this routine should not be modified.
 ;create a message at completion of the vendor upload
 ;the message will summerize the number of active
 ;vendors on file and the number that converted
 ;
 D:'$D(DT) DT^DICRW ;set DT if undef
 ;
 ;PRVTOT = total number of active vendors in last 2 years
 ;PRVFMS = total number of active vendors that converted(fms code)
 N I,J,PRVIEN,PRVTOT,PRVFMS,PRVTXT
 S I=$$FMADD^XLFDT(DT,-730) ;date two years ago from today
 F  S I=$O(^PRC(442,"AB",I)) Q:'I  D
 . S J=0 F  S J=$O(^PRC(442,"AB",I,J)) Q:'J  S PRVIEN=+$G(^PRC(442,J,1)) I PRVIEN D
 .. I $D(^PRC(440,PRVIEN,0)) S:'$D(^TMP($J,"PRCOVUP1",PRVIEN)) ^(PRVIEN)=""
 ; ^TMP($J,"PRCOVUP1",PRVIEN) is the active vendors used last 2 yrs
 ;
 S (PRVTOT,PRVFMS)=0
 S I=0 F  S I=$O(^TMP($J,"PRCOVUP1",I)) Q:'I  S PRVTOT=PRVTOT+1 D
 . I $P($G(^PRC(440,I,3)),U,4)]"" S PRVFMS=PRVFMS+1
 ;
 S PRVTXT(1)="IFCAP Vendor conversion has run to completion."
 S PRVTXT(2)="   Summary Statistics"
 S PRVTXT(3)="      Total number of active vendors on file   : "_PRVTOT
 S PRVTXT(4)="      Total number of active vendors converted : "_PRVFMS
 ;generate mail message vendor upload complete and give stats
 S PRCMG=$S('$D(PRCMG):.5,$E(PRCMG,1,2)'="G.":"G."_PRCMG,1:.5)
 S XMY(PRCMG)="",XMDUZ=.5
 S XMSUB="IFCAP VENDOR CONVERSION SUMMARY"
 S XMTEXT="PRVTXT("
 D ^XMD
 K XMDUZ,XMSUB,XMY,^TMP($J,"PRCOVUP1")
 Q
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRCOVUP2   1531     printed  Sep 23, 2025@19:48:30                                                                                                                                                                                                    Page 2
PRCOVUP2  ;WCAMPUS/-GENERATE MAIL MESSAGE AT END OF CONVERSION ;3/22/95
 +1       ;;5.1;IFCAP;;Oct 20, 2000
 +2       ;Per VHA Directive 10-93-142, this routine should not be modified.
 +3       ;create a message at completion of the vendor upload
 +4       ;the message will summerize the number of active
 +5       ;vendors on file and the number that converted
 +6       ;
 +7       ;set DT if undef
           if '$DATA(DT)
               DO DT^DICRW
 +8       ;
 +9       ;PRVTOT = total number of active vendors in last 2 years
 +10      ;PRVFMS = total number of active vendors that converted(fms code)
 +11       NEW I,J,PRVIEN,PRVTOT,PRVFMS,PRVTXT
 +12      ;date two years ago from today
           SET I=$$FMADD^XLFDT(DT,-730)
 +13       FOR 
               SET I=$ORDER(^PRC(442,"AB",I))
               if 'I
                   QUIT 
               Begin DoDot:1
 +14               SET J=0
                   FOR 
                       SET J=$ORDER(^PRC(442,"AB",I,J))
                       if 'J
                           QUIT 
                       SET PRVIEN=+$GET(^PRC(442,J,1))
                       IF PRVIEN
                           Begin DoDot:2
 +15                           IF $DATA(^PRC(440,PRVIEN,0))
                                   if '$DATA(^TMP($JOB,"PRCOVUP1",PRVIEN))
                                       SET ^(PRVIEN)=""
                           End DoDot:2
               End DoDot:1
 +16      ; ^TMP($J,"PRCOVUP1",PRVIEN) is the active vendors used last 2 yrs
 +17      ;
 +18       SET (PRVTOT,PRVFMS)=0
 +19       SET I=0
           FOR 
               SET I=$ORDER(^TMP($JOB,"PRCOVUP1",I))
               if 'I
                   QUIT 
               SET PRVTOT=PRVTOT+1
               Begin DoDot:1
 +20               IF $PIECE($GET(^PRC(440,I,3)),U,4)]""
                       SET PRVFMS=PRVFMS+1
               End DoDot:1
 +21      ;
 +22       SET PRVTXT(1)="IFCAP Vendor conversion has run to completion."
 +23       SET PRVTXT(2)="   Summary Statistics"
 +24       SET PRVTXT(3)="      Total number of active vendors on file   : "_PRVTOT
 +25       SET PRVTXT(4)="      Total number of active vendors converted : "_PRVFMS
 +26      ;generate mail message vendor upload complete and give stats
 +27       SET PRCMG=$SELECT('$DATA(PRCMG):.5,$EXTRACT(PRCMG,1,2)'="G.":"G."_PRCMG,1:.5)
 +28       SET XMY(PRCMG)=""
           SET XMDUZ=.5
 +29       SET XMSUB="IFCAP VENDOR CONVERSION SUMMARY"
 +30       SET XMTEXT="PRVTXT("
 +31       DO ^XMD
 +32       KILL XMDUZ,XMSUB,XMY,^TMP($JOB,"PRCOVUP1")
 +33       QUIT