source: WorldVistAEHR/trunk/r/SAGG_PROJECT-A1B5-KMPS/KMPSLK.m@ 1579

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

initial load of WorldVistAEHR

File size: 4.8 KB
Line 
1KMPSLK ;OAK/KAK - Thru The Looking Glass ;5/1/07 10:29
2 ;;2.0;SAGG;;Jul 02, 2007
3 ;
4EN(SESSNUM,SITENUM) ;
5 ;---------------------------------------------------------------------
6 ; SESSNUM.. +$Horolog number of session
7 ; SITENUM.. site number
8 ;---------------------------------------------------------------------
9 ;
10ZER ;-- collect zeroth node information
11 ;
12 N FNUM,GNAM
13 ;
14 S ^XTMP("KMPS",SITENUM,SESSNUM,"@ZER",0)=$P(^DIC(0),U)_U_$P(^DIC(0),U,4)_"^DIC(^"
15 S ^XTMP("KMPS",SITENUM,SESSNUM,"@ZER","TM")=$S($D(^%ZTSK(-1)):^(-1),1:^%ZTSK(0))
16 S FNUM=0 F S FNUM=$O(^DIC(FNUM)) Q:'+FNUM D
17 .Q:$G(^DIC(FNUM,0))=""
18 .Q:'$D(^DIC(FNUM,0,"GL"))
19 .S GNAM=$G(^DIC(FNUM,0,"GL")) Q:GNAM=""
20 .;
21 .; file# = ^ piece 1: file_name
22 .; 2: # of entries
23 .; 3: global_name
24 .; 4: file_version
25 .; 5: last id number
26 .; 6: global_name (GNAM) has embedded '^' - no extra 'U' needed
27 .S ^XTMP("KMPS",SITENUM,SESSNUM,"@ZER",FNUM)=$P(^DIC(FNUM,0),U)_U_$P($G(@(GNAM_"0)")),U,4)_GNAM_U_$G(^DD(+$P(^DIC(FNUM,0),U,2),0,"VR"))_U_$P($G(@(GNAM_"0)")),U,3)
28 ;
29PKG ;-- collect package file information
30 ;
31 N PKNUM
32 ;
33 S PKNUM=0
34 F S PKNUM=$O(^DIC(9.4,PKNUM)) Q:'+PKNUM I $D(^DIC(9.4,PKNUM,0)) S KMPSD=$P($G(^DIC(9.4,PKNUM,0)),U,2) D
35 .I $E(KMPSD)="A" I ($A($E(KMPSD,2))>64)&($A($E(KMPSD,2))<88) I (($A($E(KMPSD,3))>64)&($A($E(KMPSD,3))<89)) Q
36 .S KMPSV=0,(KMPSVL,KMPSD)=""
37 .F S KMPSV=$O(^DIC(9.4,PKNUM,22,KMPSV)) Q:'+KMPSV S KMPSVL=KMPSV
38 .I +KMPSVL S KMPSV=$G(^DIC(9.4,PKNUM,22,KMPSVL,0)),KMPSD=$P(KMPSV,U,3),KMPSV=$P(KMPSV,U)
39 .;
40 .; pkg_name = pkg_prefix^current version^last version^install date
41 .S ^XTMP("KMPS",SITENUM,SESSNUM,"@PKG",$P(^DIC(9.4,PKNUM,0),U))=$P($G(^DIC(9.4,PKNUM,0)),U,2)_U_$G(^("VERSION"))_U_KMPSV_U_KMPSD
42 ;
43SYS ; Collect volume set (@VOL) and system (@SYS) information
44 ;
45 D EN^%ZOSVKSD(SITENUM,SESSNUM,.KMPSVOLS,OS),@OS
46 ;
47 K KMPSD,KMPSNM,KMPSV,KMPSVL
48 Q
49 ;
50CVMS ;-- for Cache for VMS platform
51 S ^XTMP("KMPS",SITENUM,SESSNUM,"@SYS")=$ZV_U
52 Q
53 ;
54CWINNT ;-- for Cache for NT platform
55 S ^XTMP("KMPS",SITENUM,SESSNUM,"@SYS")=$ZV_U_$S($ZU(100)=0:"Windows NT",$ZU(100)=1:"Windows 95",1:$ZU(100))
56 Q
57 ;
58OUT(NOWDT,OS,SESSNUM,SITENUM,XMZSENT,TEXT) ;
59 ;---------------------------------------------------------------------
60 ; Create 'successful' end-game message text
61 ; NOWDT.... FM date and time that SAGG started
62 ; OS....... type of operating system
63 ; SESSNUM.. +$Horolog number of session
64 ; SITENUM.. site number
65 ; XMZSENT.. mailman message number created by SAGG
66 ;---------------------------------------------------------------------
67 ;
68 N DOW,GBL,I,J,JEND,UCIVOL,VOLS,X
69 ;
70 ; check to see if SAGG not started over weekend (Fri - Sun)
71 S DOW=$$DOW^XLFDT(NOWDT,1)
72 I (DOW>0)&(DOW<5) D
73 .S TEXT(1)=" *** It is STRONGLY recommended that the 'SAGG Master Background Task' ***"
74 .S TEXT(2)=" *** [KMPS SAGG REPORT] be rescheduled to run over the weekend hours. ***"
75 .S TEXT(3)=""
76 ;
77 S TEXT(4)=" The SAGG Project collection routines monitored the following:"
78 S TEXT(5)=""
79 K VOLS
80 S GBL=""
81 F S GBL=$O(^XTMP("KMPS",SITENUM,SESSNUM,NOWDT,GBL)) Q:GBL="" D
82 .S UCIVOL=""
83 .F S UCIVOL=$O(^XTMP("KMPS",SITENUM,SESSNUM,NOWDT,GBL,UCIVOL)) Q:UCIVOL="" S VOLS(UCIVOL)=""
84 S X=0,UCIVOL="",JEND=$S(OS="CVMS":2,OS="CWINNT":4,1:5)
85 F I=6:1 Q:X D
86 .S TEXT(I)=" "
87 .F J=1:1:JEND S UCIVOL=$O(VOLS(UCIVOL)) S:UCIVOL="" X=1 Q:UCIVOL="" S TEXT(I)=TEXT(I)_UCIVOL_" "
88 S TEXT(I)=""
89 S TEXT(I+1)=" Please ensure that this list concurs with your present volume set"
90 S TEXT(I+2)=" configuration.",TEXT(I+3)=""
91 S TEXT(I+4)=" A local e-mail message #"_XMZSENT_" was created by the collection"
92 S TEXT(I+5)=" routines. Check the FO-ALBANY.MED.VA.GOV NetMail Queue to ensure"
93 S TEXT(I+6)=" transmission delivery."
94 ;
95 Q ""
96 ;
97MSG(STRTDT,SESSNUM,TEXT,COMPDT) ;-- send e-mail message to local KMP-CAPMAN mailgroup
98 ;---------------------------------------------------------------------
99 ; Send e-mail message to local KMP-CAPMAN mailgroup
100 ;
101 ; STRTDT... SAGG start date and time
102 ; SESSNUM.. +$Horolog number of session
103 ; TEXT..... text of message
104 ; COMPDT... (optional) SAGG completion date and time
105 ;---------------------------------------------------------------------
106 N XMSUB,XMTEXT,XMY
107 ;
108 S COMPDT=+$G(COMPDT)
109 ;
110 S:'$D(XMDUZ) XMDUZ=.5
111 S:'$D(DUZ) DUZ=.5 S U="^"
112 ;
113 S TEXT(.1)=" SAGG Session: "_SESSNUM
114 S TEXT(.2)=" Started: "_$$FMTE^XLFDT(STRTDT,"P")_" ("_$$DOW^XLFDT(STRTDT)_")"
115 S:+COMPDT TEXT(.3)=" Completed: "_$$FMTE^XLFDT(COMPDT,"P")_" ("_$$DOW^XLFDT(COMPDT)_")"
116 S TEXT(.4)=""
117 S XMSUB="SAGG Project Message (Session #"_SESSNUM_")",XMTEXT="TEXT("
118 I $D(^XMB(3.8,"B","KMP-CAPMAN")) S XMY("G.KMP-CAPMAN")=""
119 D:$D(XMY) ^XMD
120 Q
121 ;
122END ;
123 K ^XTMP("KMPS",SITENUM),^XTMP("KMPS","ERROR")
124 K ^XTMP("KMPS","START"),^XTMP("KMPS","STOP"),^XTMP("KMPS",0)
125 K X,XMDUZ
126 S ZTREQ="@"
127 L -^XTMP("KMPS")
128 Q
Note: See TracBrowser for help on using the repository browser.