source: WorldVistAEHR/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/XUSNPIX5.m@ 1141

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

revised back to 6/30/08 version

File size: 3.4 KB
RevLine 
[623]1XUSNPIX5 ;OAK_BP/CMW - NPI EXTRACT REPORT ;01-OCT-06
2 ;;8.0;KERNEL;**453**; Jul 10, 1995;Build 36
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 ; NPI Extract Report Mailer routine
6 ;
7 ; Input parameter: XUSRTN
8 ;
9 ; Other relevant variables:
10 ; XUSRTN="XUSNPIX1" (current routine name, used for ^XTMP and ^TMP
11 ; storage subscript)
12 ; Storage Global:
13 ; ^XTMP("XUSNPIX1",0) = Piece 1^Piece 2^Piece 3^Piece 4^Piece 5^Piece 6
14 ; where:
15 ; Piece 1 => Purge Date - 1 year in future
16 ; Piece 2 => Create Date - Today
17 ; Piece 3 => Description
18 ; Piece 4 => Last Date Compiled
19 ; Piece 5 => $H last run start time
20 ; Piece 6 => $H last run completion time
21 ;
22 ; ^XTMP("XUSNPIX1",1) = DATA
23 ;
24 ; XUSNPI => Unique NPI of entry
25 ; LDT => Last Date Run, VA Fileman Format
26 ;
27 Q
28 ;
29EMAIL(XUSRTN) ; EMAIL THE MESSAGE
30 ; Add domain name if it does not exist
31 N XUSFOC,DLAYGO,DA,DIC,DIE,DR,X,Y
32 I '$$FIND1^DIC(4.2,,"QX","Q-NPS.VA.GOV","B") D
33 . S XUSFOC=$O(^DIC(4.2,"B","FOC-AUSTIN.VA.GOV",0)) I 'XUSFOC Q
34 . I XUSFOC=$O(^DIC(4.2,"B","FOC-AUSTIN.VA.GOV",""),-1) D
35 . . S DIC="^DIC(4.2,",X="Q-NPS.VA.GOV",DIC(0)="L",DLAYGO=4.2 D ^DIC K DLAYGO
36 . . S DIE=DIC,DA=+Y
37 . . S DR="1///NS;2///^S X=XUSFOC;1.7///YES;6.2///NPS;"
38 . . D ^DIE
39 ;
40 N XMY
41 ; Send email to designated recipient for live release
42 S XMY("XXX@Q-NPS.VA.GOV")=""
43 ;S XMY(DUZ)="" ;use for testing - remove before live
44 D ESEND
45 Q
46 ;
47VMAIL(XUSRTN) ; Verification email
48 N TMP
49 S TMP=^TMP(XUSRTN,$J,1)
50 K ^TMP(XUSRTN,$J)
51 S ^TMP(XUSRTN,$J,1)=$P(TMP,U,1,4)
52 S ^TMP(XUSRTN,$J,2)=""
53 S ^TMP(XUSRTN,$J,3)="TYPE 1 : NEW PERSON FILE (#200)"
54 S ^TMP(XUSRTN,$J,4)=""
55 S ^TMP(XUSRTN,$J,5)="Date/Time of Extract: "_$P(TMP,U,9)
56 S ^TMP(XUSRTN,$J,6)=""
57 S ^TMP(XUSRTN,$J,7)="Message number: "_MSGCNT_" Total NPI records: "_(COUNT-2)
58 S ^TMP(XUSRTN,$J,8)=""
59 S ^TMP(XUSRTN,$J,9)="Programmer Notes: "_XUSVER_" - "_$P(TMP,U,10)
60 ;
61 ; Send verification email to local mail group and VA Outlook mail group.
62 S XMY("G.NPI EXTRACT VERIFICATION")=""
63 D ESEND
64 K ^TMP(XUSRTN)
65 Q
66 ;
67SMAIL(XUSRTN) ; Summary email
68 N TMP,T1,T2,T1NV,T2NV
69 K ^TMP(XUSRTN,$J)
70 S T1=$G(^XTMP(XUSRTN,1))
71 S T2=$G(^XTMP(XUSRTN,2))
72 S T1NV=$G(^XTMP(XUSRTN,"1NV"))
73 S T2NV=$G(^XTMP(XUSRTN,"2NV"))
74 S ^TMP(XUSRTN,$J,1)=^XTMP(XUSRTN,"H")_" - SUMMARY for "_DTTM
75 S ^TMP(XUSRTN,$J,2)=""
76 S ^TMP(XUSRTN,$J,3)="NEW PERSON FILE (#200) "_+$P(T1,U)_" Message(s) Totaling "_+$P(T1,U,2)_" NPI records."
77 S ^TMP(XUSRTN,$J,4)=""
78 S ^TMP(XUSRTN,$J,5)="INSITUTION FILE (#4) "_+$P(T2,U)_" Message(s) Totaling "_+$P(T2,U,2)_" NPI records."
79 S ^TMP(XUSRTN,$J,6)=""
80 S ^TMP(XUSRTN,$J,7)="NON VA Individual (#355.93) "_+$P(T1NV,U)_" Message(s) Totaling "_+$P(T1NV,U,2)_" NPI records."
81 S ^TMP(XUSRTN,$J,8)=""
82 S ^TMP(XUSRTN,$J,9)="NON VA Facility/Group (#355.93) "_+$P(T2NV,U)_" Message(s) Totaling "_+$P(T2NV,U,2)_" NPI records."
83 S ^TMP(XUSRTN,$J,10)=""
84 S ^TMP(XUSRTN,$J,11)="Programmer Notes: "_XUSVER_" - "_$G(XUSPROD)
85 ;
86 ; Send verification email to local mail group and VA Outlook mail group
87 S XMY("G.NPI EXTRACT VERIFICATION")=""
88 N XMTEXT,XMSUB,XMDUN,XMDUZ,XMZ
89 S XMTEXT="^TMP("""_XUSRTN_""","_$J_","
90 S XMSUB=$TR($P($G(^TMP(XUSRTN,$J,1)),U),":")_"("_$G(XUSPROD)_") NPI EXTRACT SUMMARY "
91 D ^XMD
92 Q
93 K ^TMP(XUSRTN)
94 Q
95 ;
96ESEND N XMTEXT,XMSUB,XMDUN,XMDUZ,XMZ
97 S XMTEXT="^TMP("""_XUSRTN_""","_$J_","
98 S XMSUB=$TR($P($G(^TMP(XUSRTN,$J,1)),U),":")_"("_$G(XUSPROD)_") NPI EXTRACT TYPE 1 "
99 D ^XMD
100 Q
Note: See TracBrowser for help on using the repository browser.