SCCVEGD2 ;ALB/MJK - Estimate Summary ; 30-NOV-1998
;;5.3;Scheduling;**211**;Aug 13, 1993
;
EN ; -- main entry point for SCCV GLOBAL ESTIMATE SUMMARY
N SCDET,DIR
S DIR(0)="YA",DIR("B")="No",DIR("A")="Include CST Detail? "
D ^DIR
K DIR
IF $D(DIRUT) G ENQ
S SCDET=+Y
D EN^VALM("SCCV CONV ESTIMATE SUMMARY")
ENQ Q
;
HDR ; -- header code
;S VALMHDR(1)=" "
Q
;
INIT ; -- init variables and list array
N SCLINE,SCNT
S (SCNT,SCLINE)=0
D GLOBAL
D ENTRY
D MOD
D PER
D FOOTER
S VALMCNT=SCNT,VALMBG=1
IF 'SCDET D
. D CHGCAP^VALM("CST"," ")
. D CHGCAP^VALM("START DATE"," ")
Q
;
SET(STR) ; -- set line in array
S SCLINE=SCLINE+1
S SCNT=SCNT+1
D SET^VALM10(SCLINE,STR)
Q
;
SECT(STR) ; -- set section hdr in array
N Y
S Y=""
S Y=$$SETSTR^VALM1(STR,Y,2,$L(STR))
D SET(Y)
D CNTRL^VALM10(SCLINE,2,$L(STR),IORVON,IORVOFF)
Q
;
GLOBAL ; -- build global growth lines
N SCI,DIC,DR,DIQ,DA,X,Y,Z,SCTOT,SCSTDT,FLD
S DIC=404.98,DR=".03;207:211",DIQ="SCDATA",DIQ(0)="IE"
S SCI=0
;
D SECT("Global Block Growth")
;
S SCSTDT=0
F S SCSTDT=$O(^SD(404.98,"C",SCSTDT)) Q:'SCSTDT D
. F S SCI=$O(^SD(404.98,"C",SCSTDT,SCI)) Q:'SCI S X=$G(^SD(404.98,SCI,0)) D
. . N SCDATA
. . IF $P(X,U,9) Q ; -- canceled
. . S DA=SCI D EN^DIQ1
. . S Y=""
. . S Y=$$SETFLD^VALM1($J(SCI,4),Y,"CST")
. . S Y=$$SETFLD^VALM1($$FMTE^XLFDT(SCDATA(404.98,SCI,.03,"I"),"5ZD"),Y,"START DATE")
. . D FLDUPD("SCE",207,.Y)
. . D FLDUPD("AUPNVSIT",208,.Y)
. . D FLDUPD("AUPNVPRV",209,.Y)
. . D FLDUPD("AUPNVPOV",210,.Y)
. . D FLDUPD("AUPNVCPT",211,.Y)
. . IF SCDET D SET(Y)
;
S Y=" Total Blocks"
D TOTUPD("SCE",207,.Y)
D TOTUPD("AUPNVSIT",208,.Y)
D TOTUPD("AUPNVPRV",209,.Y)
D TOTUPD("AUPNVPOV",210,.Y)
D TOTUPD("AUPNVCPT",211,.Y)
D SET(Y)
D CNTRL^VALM10(SCLINE,1,79,IOINHI,IOINORM)
;
S Z=0 F FLD=207:1:211 S Z=Z+$G(SCTOT(FLD))
D SET(" (Grand Total: "_$FN(Z,",")_")")
D CNTRL^VALM10(SCLINE,1,79,IOINHI,IOINORM)
D SET(" ")
Q
;
ENTRY ; -- build new entry lines
N SCI,DIC,DR,DIQ,DA,X,Y,Z,SCTOT,SCSTDT
S DIC=404.98,DR=".03;2.07:2.11",DIQ="SCDATA",DIQ(0)="IE"
S SCI=0
;
D SECT("New Entries")
;
S SCSTDT=0
F S SCSTDT=$O(^SD(404.98,"C",SCSTDT)) Q:'SCSTDT D
. F S SCI=$O(^SD(404.98,"C",SCSTDT,SCI)) Q:'SCI S X=$G(^SD(404.98,SCI,0)) D
. . N SCDATA
. . IF $P(X,U,9) Q ; -- canceled
. . S DA=SCI D EN^DIQ1
. . S Y=""
. . S Y=$$SETFLD^VALM1($J(SCI,4),Y,"CST")
. . S Y=$$SETFLD^VALM1($$FMTE^XLFDT(SCDATA(404.98,SCI,.03,"I"),"5ZD"),Y,"START DATE")
. . D FLDUPD("SCE",2.07,.Y)
. . D FLDUPD("AUPNVSIT",2.08,.Y)
. . D FLDUPD("AUPNVPRV",2.09,.Y)
. . D FLDUPD("AUPNVPOV",2.10,.Y)
. . D FLDUPD("AUPNVCPT",2.11,.Y)
. . IF SCDET D SET(Y)
;
S Y=" Total Entries"
D TOTUPD("SCE",2.07,.Y)
D TOTUPD("AUPNVSIT",2.08,.Y)
D TOTUPD("AUPNVPRV",2.09,.Y)
D TOTUPD("AUPNVPOV",2.10,.Y)
D TOTUPD("AUPNVCPT",2.11,.Y)
D SET(Y)
D CNTRL^VALM10(SCLINE,1,79,IOINHI,IOINORM)
D SET(" ")
Q
MOD ; -- build modified entry lines
N SCI,DIC,DR,DIQ,DA,X,Y,Z,SCTOT,SCSTDT
S DIC=404.98,DR=".03;2.07:2.08",DIQ="SCDATA",DIQ(0)="IE"
S SCI=0
;
D SECT("Modified Entries")
;
S SCSTDT=0
F S SCSTDT=$O(^SD(404.98,"C",SCSTDT)) Q:'SCSTDT D
. F S SCI=$O(^SD(404.98,"C",SCSTDT,SCI)) Q:'SCI S X=$G(^SD(404.98,SCI,0)) D
. . N SCDATA,Z
. . IF $P(X,U,9) Q ; -- canceled
. . S DA=SCI D EN^DIQ1
. . S Y=""
. . S Y=$$SETFLD^VALM1($J(SCI,4),Y,"CST")
. . S Y=$$SETFLD^VALM1($$FMTE^XLFDT(SCDATA(404.98,SCI,.03,"I"),"5ZD"),Y,"START DATE")
. . S Z=SCDATA(404.98,SCI,2.08,"E")-SCDATA(404.98,SCI,2.07,"E")
. . S Y=$$SETFLD^VALM1($J($FN(Z,","),11),Y,"SCE")
. . S SCTOT(2.07)=$G(SCTOT(2.07))+Z
. . IF SCDET D SET(Y)
;
S Y=" Total Entries"
D TOTUPD("SCE",2.07,.Y)
D SET(Y)
D CNTRL^VALM10(SCLINE,1,79,IOINHI,IOINORM)
D SET(" ")
Q
;
PER ; -- build blocks per records lines
N Y,SCDATA
D ESTGROW^SCCVEGU1("SCDATA")
;
D SECT("Global Block Estimates per Entry")
;
S Y=" New Entries"
S Y=$$SETFLD^VALM1($J(SCDATA("SCE","NEW"),11),Y,"SCE")
S Y=$$SETFLD^VALM1($J(SCDATA("AUPNVSIT"),11),Y,"AUPNVSIT")
S Y=$$SETFLD^VALM1($J(SCDATA("AUPNVPRV"),11),Y,"AUPNVPRV")
S Y=$$SETFLD^VALM1($J(SCDATA("AUPNVPOV"),11),Y,"AUPNVPOV")
S Y=$$SETFLD^VALM1($J(SCDATA("AUPNVCPT"),11),Y,"AUPNVCPT")
D SET(Y)
D CNTRL^VALM10(SCLINE,1,79,IOINHI,IOINORM)
;
S Y=" Updated Entries"
S Y=$$SETFLD^VALM1($J(SCDATA("SCE","UPD"),11),Y,"SCE")
D SET(Y)
D CNTRL^VALM10(SCLINE,1,79,IOINHI,IOINORM)
Q
;
D SET(" ")
D SET(" ")
D SET(" Note: Estimates are assuming the following:")
D SET(" Block Size: "_$$BLKSIZE^SCCVEGU1()_" bytes")
D SET(" Global Efficiency: 70%")
Q
;
FLDUPD(NAME,FLD,STR) ; -- update line with field info
N Z
S Z=SCDATA(404.98,SCI,FLD,"E")
S STR=$$SETFLD^VALM1($J($FN(Z,","),11),STR,NAME)
S SCTOT(FLD)=$G(SCTOT(FLD))+Z
Q
;
TOTUPD(NAME,FLD,STR) ; -- update total line with field total
S STR=$$SETFLD^VALM1($J($FN(+$G(SCTOT(FLD)),","),11),STR,NAME)
Q
;
HELP ; -- help code
S X="?" D DISP^XQORM1 W !!
Q
;
EXIT ; -- exit code
K ^TMP("SCCV GESTIMATE",$J)
Q
;
EXPND ; -- expand code
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSCCVEGD2 5268 printed Dec 13, 2024@02:38:53 Page 2
SCCVEGD2 ;ALB/MJK - Estimate Summary ; 30-NOV-1998
+1 ;;5.3;Scheduling;**211**;Aug 13, 1993
+2 ;
EN ; -- main entry point for SCCV GLOBAL ESTIMATE SUMMARY
+1 NEW SCDET,DIR
+2 SET DIR(0)="YA"
SET DIR("B")="No"
SET DIR("A")="Include CST Detail? "
+3 DO ^DIR
+4 KILL DIR
+5 IF $DATA(DIRUT)
GOTO ENQ
+6 SET SCDET=+Y
+7 DO EN^VALM("SCCV CONV ESTIMATE SUMMARY")
ENQ QUIT
+1 ;
HDR ; -- header code
+1 ;S VALMHDR(1)=" "
+2 QUIT
+3 ;
INIT ; -- init variables and list array
+1 NEW SCLINE,SCNT
+2 SET (SCNT,SCLINE)=0
+3 DO GLOBAL
+4 DO ENTRY
+5 DO MOD
+6 DO PER
+7 DO FOOTER
+8 SET VALMCNT=SCNT
SET VALMBG=1
+9 IF 'SCDET
Begin DoDot:1
+10 DO CHGCAP^VALM("CST"," ")
+11 DO CHGCAP^VALM("START DATE"," ")
End DoDot:1
+12 QUIT
+13 ;
SET(STR) ; -- set line in array
+1 SET SCLINE=SCLINE+1
+2 SET SCNT=SCNT+1
+3 DO SET^VALM10(SCLINE,STR)
+4 QUIT
+5 ;
SECT(STR) ; -- set section hdr in array
+1 NEW Y
+2 SET Y=""
+3 SET Y=$$SETSTR^VALM1(STR,Y,2,$LENGTH(STR))
+4 DO SET(Y)
+5 DO CNTRL^VALM10(SCLINE,2,$LENGTH(STR),IORVON,IORVOFF)
+6 QUIT
+7 ;
GLOBAL ; -- build global growth lines
+1 NEW SCI,DIC,DR,DIQ,DA,X,Y,Z,SCTOT,SCSTDT,FLD
+2 SET DIC=404.98
SET DR=".03;207:211"
SET DIQ="SCDATA"
SET DIQ(0)="IE"
+3 SET SCI=0
+4 ;
+5 DO SECT("Global Block Growth")
+6 ;
+7 SET SCSTDT=0
+8 FOR
SET SCSTDT=$ORDER(^SD(404.98,"C",SCSTDT))
if 'SCSTDT
QUIT
Begin DoDot:1
+9 FOR
SET SCI=$ORDER(^SD(404.98,"C",SCSTDT,SCI))
if 'SCI
QUIT
SET X=$GET(^SD(404.98,SCI,0))
Begin DoDot:2
+10 NEW SCDATA
+11 ; -- canceled
IF $PIECE(X,U,9)
QUIT
+12 SET DA=SCI
DO EN^DIQ1
+13 SET Y=""
+14 SET Y=$$SETFLD^VALM1($JUSTIFY(SCI,4),Y,"CST")
+15 SET Y=$$SETFLD^VALM1($$FMTE^XLFDT(SCDATA(404.98,SCI,.03,"I"),"5ZD"),Y,"START DATE")
+16 DO FLDUPD("SCE",207,.Y)
+17 DO FLDUPD("AUPNVSIT",208,.Y)
+18 DO FLDUPD("AUPNVPRV",209,.Y)
+19 DO FLDUPD("AUPNVPOV",210,.Y)
+20 DO FLDUPD("AUPNVCPT",211,.Y)
+21 IF SCDET
DO SET(Y)
End DoDot:2
End DoDot:1
+22 ;
+23 SET Y=" Total Blocks"
+24 DO TOTUPD("SCE",207,.Y)
+25 DO TOTUPD("AUPNVSIT",208,.Y)
+26 DO TOTUPD("AUPNVPRV",209,.Y)
+27 DO TOTUPD("AUPNVPOV",210,.Y)
+28 DO TOTUPD("AUPNVCPT",211,.Y)
+29 DO SET(Y)
+30 DO CNTRL^VALM10(SCLINE,1,79,IOINHI,IOINORM)
+31 ;
+32 SET Z=0
FOR FLD=207:1:211
SET Z=Z+$GET(SCTOT(FLD))
+33 DO SET(" (Grand Total: "_$FNUMBER(Z,",")_")")
+34 DO CNTRL^VALM10(SCLINE,1,79,IOINHI,IOINORM)
+35 DO SET(" ")
+36 QUIT
+37 ;
ENTRY ; -- build new entry lines
+1 NEW SCI,DIC,DR,DIQ,DA,X,Y,Z,SCTOT,SCSTDT
+2 SET DIC=404.98
SET DR=".03;2.07:2.11"
SET DIQ="SCDATA"
SET DIQ(0)="IE"
+3 SET SCI=0
+4 ;
+5 DO SECT("New Entries")
+6 ;
+7 SET SCSTDT=0
+8 FOR
SET SCSTDT=$ORDER(^SD(404.98,"C",SCSTDT))
if 'SCSTDT
QUIT
Begin DoDot:1
+9 FOR
SET SCI=$ORDER(^SD(404.98,"C",SCSTDT,SCI))
if 'SCI
QUIT
SET X=$GET(^SD(404.98,SCI,0))
Begin DoDot:2
+10 NEW SCDATA
+11 ; -- canceled
IF $PIECE(X,U,9)
QUIT
+12 SET DA=SCI
DO EN^DIQ1
+13 SET Y=""
+14 SET Y=$$SETFLD^VALM1($JUSTIFY(SCI,4),Y,"CST")
+15 SET Y=$$SETFLD^VALM1($$FMTE^XLFDT(SCDATA(404.98,SCI,.03,"I"),"5ZD"),Y,"START DATE")
+16 DO FLDUPD("SCE",2.07,.Y)
+17 DO FLDUPD("AUPNVSIT",2.08,.Y)
+18 DO FLDUPD("AUPNVPRV",2.09,.Y)
+19 DO FLDUPD("AUPNVPOV",2.10,.Y)
+20 DO FLDUPD("AUPNVCPT",2.11,.Y)
+21 IF SCDET
DO SET(Y)
End DoDot:2
End DoDot:1
+22 ;
+23 SET Y=" Total Entries"
+24 DO TOTUPD("SCE",2.07,.Y)
+25 DO TOTUPD("AUPNVSIT",2.08,.Y)
+26 DO TOTUPD("AUPNVPRV",2.09,.Y)
+27 DO TOTUPD("AUPNVPOV",2.10,.Y)
+28 DO TOTUPD("AUPNVCPT",2.11,.Y)
+29 DO SET(Y)
+30 DO CNTRL^VALM10(SCLINE,1,79,IOINHI,IOINORM)
+31 DO SET(" ")
+32 QUIT
MOD ; -- build modified entry lines
+1 NEW SCI,DIC,DR,DIQ,DA,X,Y,Z,SCTOT,SCSTDT
+2 SET DIC=404.98
SET DR=".03;2.07:2.08"
SET DIQ="SCDATA"
SET DIQ(0)="IE"
+3 SET SCI=0
+4 ;
+5 DO SECT("Modified Entries")
+6 ;
+7 SET SCSTDT=0
+8 FOR
SET SCSTDT=$ORDER(^SD(404.98,"C",SCSTDT))
if 'SCSTDT
QUIT
Begin DoDot:1
+9 FOR
SET SCI=$ORDER(^SD(404.98,"C",SCSTDT,SCI))
if 'SCI
QUIT
SET X=$GET(^SD(404.98,SCI,0))
Begin DoDot:2
+10 NEW SCDATA,Z
+11 ; -- canceled
IF $PIECE(X,U,9)
QUIT
+12 SET DA=SCI
DO EN^DIQ1
+13 SET Y=""
+14 SET Y=$$SETFLD^VALM1($JUSTIFY(SCI,4),Y,"CST")
+15 SET Y=$$SETFLD^VALM1($$FMTE^XLFDT(SCDATA(404.98,SCI,.03,"I"),"5ZD"),Y,"START DATE")
+16 SET Z=SCDATA(404.98,SCI,2.08,"E")-SCDATA(404.98,SCI,2.07,"E")
+17 SET Y=$$SETFLD^VALM1($JUSTIFY($FNUMBER(Z,","),11),Y,"SCE")
+18 SET SCTOT(2.07)=$GET(SCTOT(2.07))+Z
+19 IF SCDET
DO SET(Y)
End DoDot:2
End DoDot:1
+20 ;
+21 SET Y=" Total Entries"
+22 DO TOTUPD("SCE",2.07,.Y)
+23 DO SET(Y)
+24 DO CNTRL^VALM10(SCLINE,1,79,IOINHI,IOINORM)
+25 DO SET(" ")
+26 QUIT
+27 ;
PER ; -- build blocks per records lines
+1 NEW Y,SCDATA
+2 DO ESTGROW^SCCVEGU1("SCDATA")
+3 ;
+4 DO SECT("Global Block Estimates per Entry")
+5 ;
+6 SET Y=" New Entries"
+7 SET Y=$$SETFLD^VALM1($JUSTIFY(SCDATA("SCE","NEW"),11),Y,"SCE")
+8 SET Y=$$SETFLD^VALM1($JUSTIFY(SCDATA("AUPNVSIT"),11),Y,"AUPNVSIT")
+9 SET Y=$$SETFLD^VALM1($JUSTIFY(SCDATA("AUPNVPRV"),11),Y,"AUPNVPRV")
+10 SET Y=$$SETFLD^VALM1($JUSTIFY(SCDATA("AUPNVPOV"),11),Y,"AUPNVPOV")
+11 SET Y=$$SETFLD^VALM1($JUSTIFY(SCDATA("AUPNVCPT"),11),Y,"AUPNVCPT")
+12 DO SET(Y)
+13 DO CNTRL^VALM10(SCLINE,1,79,IOINHI,IOINORM)
+14 ;
+15 SET Y=" Updated Entries"
+16 SET Y=$$SETFLD^VALM1($JUSTIFY(SCDATA("SCE","UPD"),11),Y,"SCE")
+17 DO SET(Y)
+18 DO CNTRL^VALM10(SCLINE,1,79,IOINHI,IOINORM)
+19 QUIT
+20 ;
+1 DO SET(" ")
+2 DO SET(" ")
+3 DO SET(" Note: Estimates are assuming the following:")
+4 DO SET(" Block Size: "_$$BLKSIZE^SCCVEGU1()_" bytes")
+5 DO SET(" Global Efficiency: 70%")
+6 QUIT
+7 ;
FLDUPD(NAME,FLD,STR) ; -- update line with field info
+1 NEW Z
+2 SET Z=SCDATA(404.98,SCI,FLD,"E")
+3 SET STR=$$SETFLD^VALM1($JUSTIFY($FNUMBER(Z,","),11),STR,NAME)
+4 SET SCTOT(FLD)=$GET(SCTOT(FLD))+Z
+5 QUIT
+6 ;
TOTUPD(NAME,FLD,STR) ; -- update total line with field total
+1 SET STR=$$SETFLD^VALM1($JUSTIFY($FNUMBER(+$GET(SCTOT(FLD)),","),11),STR,NAME)
+2 QUIT
+3 ;
HELP ; -- help code
+1 SET X="?"
DO DISP^XQORM1
WRITE !!
+2 QUIT
+3 ;
EXIT ; -- exit code
+1 KILL ^TMP("SCCV GESTIMATE",$JOB)
+2 QUIT
+3 ;
EXPND ; -- expand code
+1 QUIT
+2 ;