SCCVEGD1 ;ALB/JRP,TMP - DSPLY RSLTS 4 ENCNTR CNVRSN GLBL ESTMTR;15-JAN-96
;;5.3;Scheduling;**211,1015**;Aug 13, 1993;Build 21
DSPGLBL(PTRLOG,OUTARRAY,STARTLN) ;BUILD DISPLAY FOR GLOBAL ESTIMATES
;INPUT : PTRLOG - Pointer to entry in SCHEDULING CONVERSION LOG
; file (#404.98) that estimation is for
; OUTARRAY - Array to build display into (full global reference)
; Defaults to ^TMP("SCCVEG",$J,"DISPLAY")
; STARTLN - The line # in the display where this portion starts
; [optional]
;OUTPUT : N - Number of lines in this display
; OUTARRAY will be returned as follows
; OUTARRAY(x,0) = Line x of display
;
N ESTGLBL,GLOBAL,INFO,EQUALS,LINE,HEADER,FOOTER,TMP,DASHES,SD0,TOTAL
N DIC,X,DA,DR,DIQ,SCBLK,SC207
;
Q:('$D(^SD(404.98,+$G(PTRLOG),0))) 0
;
S:$G(OUTARRAY)="" OUTARRAY="^TMP(""SCCVEG"","_$J_",""DISPLAY"")"
S LINE=+$G(STARTLN)
S DASHES="",$P(DASHES,"-",81)="",EQUALS="",$P(EQUALS,"=",81)=""
;
S TMP=$G(^SD(404.98,PTRLOG,2)),SD0=$G(^(0))
S TOTAL("SCE","NEW")=+$P(TMP,"^",7)
S TOTAL("SCE","UPD")=$P(TMP,"^",8)-$P(TMP,"^",7)
S TOTAL("AUPNVSIT")=+$P(TMP,"^",8)
S TOTAL("AUPNVPRV")=+$P(TMP,"^",9)
S TOTAL("AUPNVPOV")=+$P(TMP,"^",10)
S TOTAL("AUPNVCPT")=+$P(TMP,"^",11)
;
;Get estimated global growths
S DIC=404.98,DR="207:211",DIQ="ESTGLBL",DIQ(0)="IE",DA=PTRLOG
D EN^DIQ1
;
S HEADER(1)="+"_$E(EQUALS,1,54)_"+"
S TMP=$$CENTER^SCCVEGU0("ESTIMATED GLOBAL BLOCK GROWTH",54)
S HEADER(2)="|"_TMP_"|"
S TMP=$$CENTER^SCCVEGU0($$FMTE^XLFDT($P(SD0,U,3),"5Z")_" - "_$$FMTE^XLFDT($P(SD0,U,4),"5Z"),54)
S HEADER(3)="|"_TMP_"|",HEADER(4)="|"_$E(DASHES,1,54)_"|",HEADER(5)="|"
S HEADER(6)="+"
F TMP=1:1:5 S HEADER(6)=HEADER(6)_$E(EQUALS,1,10)_"+"
;
S FOOTER(1)="+"
F TMP=1:1:5 S FOOTER(1)=FOOTER(1)_$E(EQUALS,1,10)_"+"
;
;Build display for global estimates
S INFO="|"
F X=207:1:211 D
. S INFO=INFO_" "_$J(+$G(ESTGLBL(404.98,PTRLOG,X,"E")),8,0)_" |"
F X="SCE","AUPNVSIT","AUPNVPRV","AUPNVPOV","AUPNVCPT" D
. S HEADER(5)=HEADER(5)_$$CENTER^SCCVEGU0(X,10)_"|"
;
;Put lines into display
F TMP=1:1 Q:('$D(HEADER(TMP))) S LINE=LINE+1,@OUTARRAY@(LINE,0)=HEADER(TMP)
S LINE=LINE+1,@OUTARRAY@(LINE,0)=INFO
F TMP=1:1 Q:('$D(FOOTER(TMP))) S LINE=LINE+1,@OUTARRAY@(LINE,0)=FOOTER(TMP)
;
; ending text
;
S FOOTER="**"_$J("",52)_"**"
S TMP=" The estimate algorithm factors in global"
S LINE=LINE+1,@OUTARRAY@(LINE,0)=$$INSERT^SCCVEGU0(TMP,FOOTER,5)
S TMP=" pointer data and data requirements (including"
S LINE=LINE+1,@OUTARRAY@(LINE,0)=$$INSERT^SCCVEGU0(TMP,FOOTER,5)
S TMP=" cross references) at a 70% efficiency level."
S LINE=LINE+1,@OUTARRAY@(LINE,0)=$$INSERT^SCCVEGU0(TMP,FOOTER,5)
S SCBLK=$$BLKSIZE^SCCVEGU1()
S SC207=+$G(ESTGLBL(404.98,PTRLOG,207,"E"))
S TMP=" Each block represents "_SCBLK_" bytes."
S LINE=LINE+1,@OUTARRAY@(LINE,0)=$$INSERT^SCCVEGU0(TMP,FOOTER,5)
S TMP=" SCE Example: "_SC207_" x "_SCBLK_" = "_$FN(SC207*SCBLK,",")_" bytes."
S LINE=LINE+1,@OUTARRAY@(LINE,0)=$$INSERT^SCCVEGU0(TMP,FOOTER,5)
S LINE=LINE+1,@OUTARRAY@(LINE,0)="+"_$E(EQUALS,1,54)_"+"
;
Q (LINE-STARTLN)
;
SCCVEGD1 ;ALB/JRP,TMP - DSPLY RSLTS 4 ENCNTR CNVRSN GLBL ESTMTR;15-JAN-96
+1 ;;5.3;Scheduling;**211,1015**;Aug 13, 1993;Build 21
DSPGLBL(PTRLOG,OUTARRAY,STARTLN) ;BUILD DISPLAY FOR GLOBAL ESTIMATES
+1 ;INPUT : PTRLOG - Pointer to entry in SCHEDULING CONVERSION LOG
+2 ; file (#404.98) that estimation is for
+3 ; OUTARRAY - Array to build display into (full global reference)
+4 ; Defaults to ^TMP("SCCVEG",$J,"DISPLAY")
+5 ; STARTLN - The line # in the display where this portion starts
+6 ; [optional]
+7 ;OUTPUT : N - Number of lines in this display
+8 ; OUTARRAY will be returned as follows
+9 ; OUTARRAY(x,0) = Line x of display
+10 ;
+11 NEW ESTGLBL,GLOBAL,INFO,EQUALS,LINE,HEADER,FOOTER,TMP,DASHES,SD0,TOTAL
+12 NEW DIC,X,DA,DR,DIQ,SCBLK,SC207
+13 ;
+14 IF ('$DATA(^SD(404.98,+$GET(PTRLOG),0)))
QUIT 0
+15 ;
+16 IF $GET(OUTARRAY)=""
SET OUTARRAY="^TMP(""SCCVEG"","_$JOB_",""DISPLAY"")"
+17 SET LINE=+$GET(STARTLN)
+18 SET DASHES=""
SET $PIECE(DASHES,"-",81)=""
SET EQUALS=""
SET $PIECE(EQUALS,"=",81)=""
+19 ;
+20 SET TMP=$GET(^SD(404.98,PTRLOG,2))
SET SD0=$GET(^(0))
+21 SET TOTAL("SCE","NEW")=+$PIECE(TMP,"^",7)
+22 SET TOTAL("SCE","UPD")=$PIECE(TMP,"^",8)-$PIECE(TMP,"^",7)
+23 SET TOTAL("AUPNVSIT")=+$PIECE(TMP,"^",8)
+24 SET TOTAL("AUPNVPRV")=+$PIECE(TMP,"^",9)
+25 SET TOTAL("AUPNVPOV")=+$PIECE(TMP,"^",10)
+26 SET TOTAL("AUPNVCPT")=+$PIECE(TMP,"^",11)
+27 ;
+28 ;Get estimated global growths
+29 SET DIC=404.98
SET DR="207:211"
SET DIQ="ESTGLBL"
SET DIQ(0)="IE"
SET DA=PTRLOG
+30 DO EN^DIQ1
+31 ;
+32 SET HEADER(1)="+"_$EXTRACT(EQUALS,1,54)_"+"
+33 SET TMP=$$CENTER^SCCVEGU0("ESTIMATED GLOBAL BLOCK GROWTH",54)
+34 SET HEADER(2)="|"_TMP_"|"
+35 SET TMP=$$CENTER^SCCVEGU0($$FMTE^XLFDT($PIECE(SD0,U,3),"5Z")_" - "_$$FMTE^XLFDT($PIECE(SD0,U,4),"5Z"),54)
+36 SET HEADER(3)="|"_TMP_"|"
SET HEADER(4)="|"_$EXTRACT(DASHES,1,54)_"|"
SET HEADER(5)="|"
+37 SET HEADER(6)="+"
+38 FOR TMP=1:1:5
SET HEADER(6)=HEADER(6)_$EXTRACT(EQUALS,1,10)_"+"
+39 ;
+40 SET FOOTER(1)="+"
+41 FOR TMP=1:1:5
SET FOOTER(1)=FOOTER(1)_$EXTRACT(EQUALS,1,10)_"+"
+42 ;
+43 ;Build display for global estimates
+44 SET INFO="|"
+45 FOR X=207:1:211
Begin DoDot:1
+46 SET INFO=INFO_" "_$JUSTIFY(+$GET(ESTGLBL(404.98,PTRLOG,X,"E")),8,0)_" |"
End DoDot:1
+47 FOR X="SCE","AUPNVSIT","AUPNVPRV","AUPNVPOV","AUPNVCPT"
Begin DoDot:1
+48 SET HEADER(5)=HEADER(5)_$$CENTER^SCCVEGU0(X,10)_"|"
End DoDot:1
+49 ;
+50 ;Put lines into display
+51 FOR TMP=1:1
IF ('$DATA(HEADER(TMP)))
QUIT
SET LINE=LINE+1
SET @OUTARRAY@(LINE,0)=HEADER(TMP)
+52 SET LINE=LINE+1
SET @OUTARRAY@(LINE,0)=INFO
+53 FOR TMP=1:1
IF ('$DATA(FOOTER(TMP)))
QUIT
SET LINE=LINE+1
SET @OUTARRAY@(LINE,0)=FOOTER(TMP)
+54 ;
+55 ; ending text
+56 ;
+57 SET FOOTER="**"_$JUSTIFY("",52)_"**"
+58 SET TMP=" The estimate algorithm factors in global"
+59 SET LINE=LINE+1
SET @OUTARRAY@(LINE,0)=$$INSERT^SCCVEGU0(TMP,FOOTER,5)
+60 SET TMP=" pointer data and data requirements (including"
+61 SET LINE=LINE+1
SET @OUTARRAY@(LINE,0)=$$INSERT^SCCVEGU0(TMP,FOOTER,5)
+62 SET TMP=" cross references) at a 70% efficiency level."
+63 SET LINE=LINE+1
SET @OUTARRAY@(LINE,0)=$$INSERT^SCCVEGU0(TMP,FOOTER,5)
+64 SET SCBLK=$$BLKSIZE^SCCVEGU1()
+65 SET SC207=+$GET(ESTGLBL(404.98,PTRLOG,207,"E"))
+66 SET TMP=" Each block represents "_SCBLK_" bytes."
+67 SET LINE=LINE+1
SET @OUTARRAY@(LINE,0)=$$INSERT^SCCVEGU0(TMP,FOOTER,5)
+68 SET TMP=" SCE Example: "_SC207_" x "_SCBLK_" = "_$FNUMBER(SC207*SCBLK,",")_" bytes."
+69 SET LINE=LINE+1
SET @OUTARRAY@(LINE,0)=$$INSERT^SCCVEGU0(TMP,FOOTER,5)
+70 SET LINE=LINE+1
SET @OUTARRAY@(LINE,0)="+"_$EXTRACT(EQUALS,1,54)_"+"
+71 ;
+72 QUIT (LINE-STARTLN)
+73 ;