source: FOIAVistA/trunk/r/SCHEDULING-SD-SC/SCCVEGD2.m@ 1123

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

initial load of FOIAVistA 6/30/08 version

File size: 5.0 KB
Line 
1SCCVEGD2 ;ALB/MJK - Estimate Summary ; 30-NOV-1998
2 ;;5.3;Scheduling;**211**;Aug 13, 1993
3 ;
4EN ; -- main entry point for SCCV GLOBAL ESTIMATE SUMMARY
5 N SCDET,DIR
6 S DIR(0)="YA",DIR("B")="No",DIR("A")="Include CST Detail? "
7 D ^DIR
8 K DIR
9 IF $D(DIRUT) G ENQ
10 S SCDET=+Y
11 D EN^VALM("SCCV CONV ESTIMATE SUMMARY")
12ENQ Q
13 ;
14HDR ; -- header code
15 ;S VALMHDR(1)=" "
16 Q
17 ;
18INIT ; -- init variables and list array
19 N SCLINE,SCNT
20 S (SCNT,SCLINE)=0
21 D GLOBAL
22 D ENTRY
23 D MOD
24 D PER
25 D FOOTER
26 S VALMCNT=SCNT,VALMBG=1
27 IF 'SCDET D
28 . D CHGCAP^VALM("CST"," ")
29 . D CHGCAP^VALM("START DATE"," ")
30 Q
31 ;
32SET(STR) ; -- set line in array
33 S SCLINE=SCLINE+1
34 S SCNT=SCNT+1
35 D SET^VALM10(SCLINE,STR)
36 Q
37 ;
38SECT(STR) ; -- set section hdr in array
39 N Y
40 S Y=""
41 S Y=$$SETSTR^VALM1(STR,Y,2,$L(STR))
42 D SET(Y)
43 D CNTRL^VALM10(SCLINE,2,$L(STR),IORVON,IORVOFF)
44 Q
45 ;
46GLOBAL ; -- build global growth lines
47 N SCI,DIC,DR,DIQ,DA,X,Y,Z,SCTOT,SCSTDT,FLD
48 S DIC=404.98,DR=".03;207:211",DIQ="SCDATA",DIQ(0)="IE"
49 S SCI=0
50 ;
51 D SECT("Global Block Growth")
52 ;
53 S SCSTDT=0
54 F S SCSTDT=$O(^SD(404.98,"C",SCSTDT)) Q:'SCSTDT D
55 . F S SCI=$O(^SD(404.98,"C",SCSTDT,SCI)) Q:'SCI S X=$G(^SD(404.98,SCI,0)) D
56 . . N SCDATA
57 . . IF $P(X,U,9) Q ; -- canceled
58 . . S DA=SCI D EN^DIQ1
59 . . S Y=""
60 . . S Y=$$SETFLD^VALM1($J(SCI,4),Y,"CST")
61 . . S Y=$$SETFLD^VALM1($$FMTE^XLFDT(SCDATA(404.98,SCI,.03,"I"),"5ZD"),Y,"START DATE")
62 . . D FLDUPD("SCE",207,.Y)
63 . . D FLDUPD("AUPNVSIT",208,.Y)
64 . . D FLDUPD("AUPNVPRV",209,.Y)
65 . . D FLDUPD("AUPNVPOV",210,.Y)
66 . . D FLDUPD("AUPNVCPT",211,.Y)
67 . . IF SCDET D SET(Y)
68 ;
69 S Y=" Total Blocks"
70 D TOTUPD("SCE",207,.Y)
71 D TOTUPD("AUPNVSIT",208,.Y)
72 D TOTUPD("AUPNVPRV",209,.Y)
73 D TOTUPD("AUPNVPOV",210,.Y)
74 D TOTUPD("AUPNVCPT",211,.Y)
75 D SET(Y)
76 D CNTRL^VALM10(SCLINE,1,79,IOINHI,IOINORM)
77 ;
78 S Z=0 F FLD=207:1:211 S Z=Z+$G(SCTOT(FLD))
79 D SET(" (Grand Total: "_$FN(Z,",")_")")
80 D CNTRL^VALM10(SCLINE,1,79,IOINHI,IOINORM)
81 D SET(" ")
82 Q
83 ;
84ENTRY ; -- build new entry lines
85 N SCI,DIC,DR,DIQ,DA,X,Y,Z,SCTOT,SCSTDT
86 S DIC=404.98,DR=".03;2.07:2.11",DIQ="SCDATA",DIQ(0)="IE"
87 S SCI=0
88 ;
89 D SECT("New Entries")
90 ;
91 S SCSTDT=0
92 F S SCSTDT=$O(^SD(404.98,"C",SCSTDT)) Q:'SCSTDT D
93 . F S SCI=$O(^SD(404.98,"C",SCSTDT,SCI)) Q:'SCI S X=$G(^SD(404.98,SCI,0)) D
94 . . N SCDATA
95 . . IF $P(X,U,9) Q ; -- canceled
96 . . S DA=SCI D EN^DIQ1
97 . . S Y=""
98 . . S Y=$$SETFLD^VALM1($J(SCI,4),Y,"CST")
99 . . S Y=$$SETFLD^VALM1($$FMTE^XLFDT(SCDATA(404.98,SCI,.03,"I"),"5ZD"),Y,"START DATE")
100 . . D FLDUPD("SCE",2.07,.Y)
101 . . D FLDUPD("AUPNVSIT",2.08,.Y)
102 . . D FLDUPD("AUPNVPRV",2.09,.Y)
103 . . D FLDUPD("AUPNVPOV",2.10,.Y)
104 . . D FLDUPD("AUPNVCPT",2.11,.Y)
105 . . IF SCDET D SET(Y)
106 ;
107 S Y=" Total Entries"
108 D TOTUPD("SCE",2.07,.Y)
109 D TOTUPD("AUPNVSIT",2.08,.Y)
110 D TOTUPD("AUPNVPRV",2.09,.Y)
111 D TOTUPD("AUPNVPOV",2.10,.Y)
112 D TOTUPD("AUPNVCPT",2.11,.Y)
113 D SET(Y)
114 D CNTRL^VALM10(SCLINE,1,79,IOINHI,IOINORM)
115 D SET(" ")
116 Q
117MOD ; -- build modified entry lines
118 N SCI,DIC,DR,DIQ,DA,X,Y,Z,SCTOT,SCSTDT
119 S DIC=404.98,DR=".03;2.07:2.08",DIQ="SCDATA",DIQ(0)="IE"
120 S SCI=0
121 ;
122 D SECT("Modified Entries")
123 ;
124 S SCSTDT=0
125 F S SCSTDT=$O(^SD(404.98,"C",SCSTDT)) Q:'SCSTDT D
126 . F S SCI=$O(^SD(404.98,"C",SCSTDT,SCI)) Q:'SCI S X=$G(^SD(404.98,SCI,0)) D
127 . . N SCDATA,Z
128 . . IF $P(X,U,9) Q ; -- canceled
129 . . S DA=SCI D EN^DIQ1
130 . . S Y=""
131 . . S Y=$$SETFLD^VALM1($J(SCI,4),Y,"CST")
132 . . S Y=$$SETFLD^VALM1($$FMTE^XLFDT(SCDATA(404.98,SCI,.03,"I"),"5ZD"),Y,"START DATE")
133 . . S Z=SCDATA(404.98,SCI,2.08,"E")-SCDATA(404.98,SCI,2.07,"E")
134 . . S Y=$$SETFLD^VALM1($J($FN(Z,","),11),Y,"SCE")
135 . . S SCTOT(2.07)=$G(SCTOT(2.07))+Z
136 . . IF SCDET D SET(Y)
137 ;
138 S Y=" Total Entries"
139 D TOTUPD("SCE",2.07,.Y)
140 D SET(Y)
141 D CNTRL^VALM10(SCLINE,1,79,IOINHI,IOINORM)
142 D SET(" ")
143 Q
144 ;
145PER ; -- build blocks per records lines
146 N Y,SCDATA
147 D ESTGROW^SCCVEGU1("SCDATA")
148 ;
149 D SECT("Global Block Estimates per Entry")
150 ;
151 S Y=" New Entries"
152 S Y=$$SETFLD^VALM1($J(SCDATA("SCE","NEW"),11),Y,"SCE")
153 S Y=$$SETFLD^VALM1($J(SCDATA("AUPNVSIT"),11),Y,"AUPNVSIT")
154 S Y=$$SETFLD^VALM1($J(SCDATA("AUPNVPRV"),11),Y,"AUPNVPRV")
155 S Y=$$SETFLD^VALM1($J(SCDATA("AUPNVPOV"),11),Y,"AUPNVPOV")
156 S Y=$$SETFLD^VALM1($J(SCDATA("AUPNVCPT"),11),Y,"AUPNVCPT")
157 D SET(Y)
158 D CNTRL^VALM10(SCLINE,1,79,IOINHI,IOINORM)
159 ;
160 S Y=" Updated Entries"
161 S Y=$$SETFLD^VALM1($J(SCDATA("SCE","UPD"),11),Y,"SCE")
162 D SET(Y)
163 D CNTRL^VALM10(SCLINE,1,79,IOINHI,IOINORM)
164 Q
165 ;
166FOOTER ; -- build general info footer
167 D SET(" ")
168 D SET(" ")
169 D SET(" Note: Estimates are assuming the following:")
170 D SET(" Block Size: "_$$BLKSIZE^SCCVEGU1()_" bytes")
171 D SET(" Global Efficiency: 70%")
172 Q
173 ;
174FLDUPD(NAME,FLD,STR) ; -- update line with field info
175 N Z
176 S Z=SCDATA(404.98,SCI,FLD,"E")
177 S STR=$$SETFLD^VALM1($J($FN(Z,","),11),STR,NAME)
178 S SCTOT(FLD)=$G(SCTOT(FLD))+Z
179 Q
180 ;
181TOTUPD(NAME,FLD,STR) ; -- update total line with field total
182 S STR=$$SETFLD^VALM1($J($FN(+$G(SCTOT(FLD)),","),11),STR,NAME)
183 Q
184 ;
185HELP ; -- help code
186 S X="?" D DISP^XQORM1 W !!
187 Q
188 ;
189EXIT ; -- exit code
190 K ^TMP("SCCV GESTIMATE",$J)
191 Q
192 ;
193EXPND ; -- expand code
194 Q
195 ;
Note: See TracBrowser for help on using the repository browser.