source: FOIAVistA/tag/r/CAPACITY_MANAGEMENT_TOOLS-KMPD-KMPL/KMPDUTL.m@ 628

Last change on this file since 628 was 628, checked in by George Lilly, 14 years ago

initial load of FOIAVistA 6/30/08 version

File size: 3.8 KB
Line 
1KMPDUTL ;OAK/RAK - CM Tools Utility ;5/1/07 15:08
2 ;;2.0;CAPACITY MANAGEMENT TOOLS;**1,2,3,4,5,6**;Mar 22, 2002;Build 3
3 ;
4QUEBKG(KMPDOPT,KMPDTIME,KMPDFREQ,KMPDDEL) ;-- queue background job
5 ;-----------------------------------------------------------------------
6 ; KMPDOPT.... Option name to queue (free text name in .01 field of
7 ; OPTION file)
8 ; KMPDTIME... Date/time to queue option (T@1400, etc)
9 ; KMPDFREQ... Scheduling frequency (1D, etc)
10 ; KMPDDEL.... Delete option if it already exists in file 19.2
11 ; 0 - do not delete (quit if already scheduled)
12 ; 1 - delete if already in file 19.2
13 ;
14 ; This API will queue an option from file #19 (OPTION) to run in file
15 ; 19.2 (OPTION SCHEDULE).
16 ;-----------------------------------------------------------------------
17 Q:$G(KMPDOPT)=""
18 Q:$G(KMPDTIME)=""
19 Q:$G(KMPDFREQ)=""
20 S KMPDDEL=+$G(KMPDDEL)
21 N DA,DIFROM,DIK,FDA,ERROR,IEN,IEN1,IENZ,TEXT,X,Y,Z
22 ; Newing DIFROM will force reschedule when installing from KIDS
23 S:'$G(DT) DT=$$DT^XLFDT
24 ; change to internal format
25 D FMDTI^KMPDU(.Z,KMPDTIME)
26 Q:Z(0)="^"!(Z(0)="")
27 S KMPDTIME=Z(0) K Z
28 S TEXT=KMPDOPT
29 ; quit if not in file 19
30 S IEN=$O(^DIC(19,"B",TEXT,0)) Q:'IEN
31 S IEN1=$O(^DIC(19.2,"B",IEN,0))
32 ; quit if already in file 19.2 and not KMPDDEL
33 Q:IEN1&('KMPDDEL)
34 ; delete if in file 19.2
35 I IEN1 S DIK="^DIC(19.2,",DA=IEN1 D ^DIK
36 ; add entry
37 S FDA($J,19.2,"+1,",.01)=IEN
38 ; queued to run at what time
39 S FDA($J,19.2,"+1,",2)=KMPDTIME
40 ; rescheduling frequency.
41 S FDA($J,19.2,"+1,",6)=KMPDFREQ
42 D UPDATE^DIE("","FDA($J)",.IENZ,"ERROR")
43 I $D(ERROR) D MSG^DIALOG("W","",60,10,"ERROR")
44 S IEN1=$O(^DIC(19.2,"B",IEN,0))
45 I '$G(^DIC(19.2,+IEN1,1)) D
46 .D MES^XPDUTL(" ERROR - Not able to reschedule "_KMPDOPT)
47 .D MES^XPDUTL(" Use 'Schedule/Unschedule Options' [XUTM SCHEDULE] to reschedule.")
48 ;
49 Q
50 ;
51VERSION() ;-- extrinsic - return current version.
52 Q $P($T(+2^KMPDUTL),";",3)_"^"_$P($T(+2^KMPDUTL),";",5)
53 ;
54VRSNGET(KMPDAPPL) ;-- extrinsic function - get version^patches
55 ;-----------------------------------------------------------------------
56 ; KMPDAPPL... application:
57 ; 0 - CM Tools
58 ; 1 - SAGG
59 ; 2 - RUM
60 ;
61 ; Return: Version^Patch^VersionInstallDate^PatchInstallDate
62 ; null = no application
63 ;-----------------------------------------------------------------------
64 ;
65 Q:$G(KMPDAPPL)="" ""
66 Q:KMPDAPPL<0!(KMPDAPPL>2) ""
67 ;
68 N DATA,VERSION S VERSION=""
69 ;
70 ; cm tools
71 I KMPDAPPL=0 D
72 .S DATA=$G(^KMPD(8973,1,KMPDAPPL))
73 .S VERSION=$P(DATA,U,2)_U_$P(DATA,U,4)_U_$P(DATA,U,3)_U_$P(DATA,U,5)
74 ;
75 ; all other applications
76 E D
77 .S DATA=$G(^KMPD(8973,1,KMPDAPPL))
78 .S VERSION=$P(DATA,U)_U_$P(DATA,U,3)_U_$P(DATA,U,2)_U_$P(DATA,U,4)
79 ;
80 Q VERSION
81 ;
82PTCHINFO ; -- patch information: routine name ^ current version ^ current patch(es)
83 ;;KMPDBD01^2.0^**2**
84 ;;KMPDECH^2.0^**5**
85 ;;KMPDHU01^2.0^**4**
86 ;;KMPDHU02^2.0
87 ;;KMPDHU03^2.0
88 ;;KMPDHUA^2.0
89 ;;KMPDPOST^2.0^**1,2,5**
90 ;;KMPDSS^2.0^**3**
91 ;;KMPDSS1^2.0^**3**
92 ;;KMPDSSD^2.0^**3**
93 ;;KMPDSSD1^2.0^**3,6**
94 ;;KMPDSSR^2.0^**3**
95 ;;KMPDSSS^2.0^**3,6**
96 ;;KMPDTM^2.0^**1,4**
97 ;;KMPDTP1^2.0^**4**
98 ;;KMPDTP2^2.0^**4**
99 ;;KMPDTP3^2.0^**4**
100 ;;KMPDTP4^2.0^**4**
101 ;;KMPDTP5^2.0^**4**
102 ;;KMPDTP6^2.0^**4**
103 ;;KMPDTP7^2.0^**4**
104 ;;KMPDTU01^2.0^**4,5**
105 ;;KMPDTU02^2.0
106 ;;KMPDTU10^2.0^**4**
107 ;;KMPDTU11^2.0^**6**
108 ;;KMPDU^2.0^**2**
109 ;;KMPDU1^2.0
110 ;;KMPDU2^2.0^**2**
111 ;;KMPDU3^2.0^**2**
112 ;;KMPDU4^2.0
113 ;;KMPDU5^2.0^**2**
114 ;;KMPDU11^2.0
115 ;;KMPDUG^2.0
116 ;;KMPDUG1^2.0
117 ;;KMPDUG2^2.0
118 ;;KMPDUGV^2.0
119 ;;KMPDUT^2.0
120 ;;KMPDUT1^2.0^**4**
121 ;;KMPDUT2^2.0
122 ;;KMPDUT4^2.0
123 ;;KMPDUT4A^2.0
124 ;;KMPDUT4B^2.0
125 ;;KMPDUT4C^2.0
126 ;;KMPDUT5^2.0
127 ;;KMPDUTL^2.0^**1,2,3,4,5,6**
128 ;;KMPDUTL1^2.0^**3**
129 ;;KMPDUTL2^2.0^**4**
130 ;;KMPDUTL3^2.0
131 ;;KMPDUTL4^2.0
132 ;;KMPDUTL5^2.0
133 ;;KMPDUTL6^2.0
134 ;;KMPDUTL7^2.0^**2,5**
135 ;;KMPDUTL8^2.0^**2**
Note: See TracBrowser for help on using the repository browser.