DGUTL1 ;ALB/MJK - Re-Compile Templates/x-refs ; 8/8/90;
;;5.3;Registration;;Aug 13, 1993
;
; ******* DO NOT MAP THIS ROUTINE *******
Q
;
EN ; Entry point to re-compile templates
; input: DGKIND = OUTPUT or INPUT
;
K DGLINE S U="^",$P(DGLINE,"=",81)="",DGMAX=^DD("ROU")
G ENQ:'$D(DGKIND),ENQ:"^OUTPUT^INPUT^"'[(U_DGKIND_U)
I DGKIND="OUTPUT" S DGFILE="^DIPT",DGROU="EN^DIPZ"
I DGKIND="INPUT" S DGFILE="^DIE",DGROU="EN^DIEZ"
W !,DGLINE,!?20,"Recompilation of '",DGKIND,"' Templates",!,DGLINE
;
F DGX="DFzzzz","SCzzzz" F DGI=1:1 S DGX=$O(@DGFILE@("B",DGX)) Q:DGX=""!("^DG^SD^"'[(U_$E(DGX,1,2)_U)) S Y=+$O(^(DGX,0)) I $D(@DGFILE@(Y,"ROUOLD")),^("ROUOLD")]"",$D(^(0)) S (DGEMP,Y)=Y,X=$P(^("ROUOLD"),"^"),DG0=^(0) D COMP
;
ENQ K DGROU,DG0,DGX,DGI,DGMAX,DGEMP,DGFILE,DGI,DGLINE Q
;
COMP ; re-compile
I DGKIND="INPUT",$P(DG0,U)="DG TEN" G COMPQ
I $P(DG0,U)?1"DGHI".E G COMPQ ; excludes HINQ templates
S DMAX=DGMAX D @DGROU W !!,DGLINE
COMPQ Q
;
ALL ; compile templates and x-refs
S:'$D(DTIME) DTIME=300 S U="^"
S DIR(0)="Y",DIR("A")="Re-compile all 'DG' and 'SD' templates and cross references"
S DIR("?",1)="Yes to re-compile",DIR("?",2)="No to stop recompilation process",DIR("?")=" "
D ^DIR K DIR G ALLQ:'Y
D DIEZ W !!
D DIPZ W !!
D DIKZ
W !!,"...Done.",!!,"NOTE: Recompilation should be performed on ALL systems."
ALLQ K A,C,L,O,X1,DQ,DIE,DMAX,DIEZ,DIEZDUP,DK,DR Q
;
DIEZ ; -- re-compile all DG and SD 'edit' templates
S DGKIND="INPUT" D EN K DGKIND Q
;
DIPZ ; -- re-compile all DG and SD 'print' templates
S DGKIND="OUTPUT" D EN K DGKIND Q
;
DIKZ ; -- compile x-refs
W !!,">>> Compiling cross references for PTF, PATIENT MOVEMENT,",!,"INDIVIDUAL ANNUAL INCOME, INCOME RELATION",!,"and ANNUAL MEANS TEST files:"
F DGN=45,405,408.21,408.22,408.31 S N=DGN W ! I ^DD("VERSION")>17.5,$D(^DD(+N,0,"DIK"))#2 S X=^("DIK"),Y=+N,DMAX=^DD("ROU") D EN^DIKZ
K DGN,N,DMAX
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGUTL1 1942 printed Nov 22, 2024@18:09:06 Page 2
DGUTL1 ;ALB/MJK - Re-Compile Templates/x-refs ; 8/8/90;
+1 ;;5.3;Registration;;Aug 13, 1993
+2 ;
+3 ; ******* DO NOT MAP THIS ROUTINE *******
+4 QUIT
+5 ;
EN ; Entry point to re-compile templates
+1 ; input: DGKIND = OUTPUT or INPUT
+2 ;
+3 KILL DGLINE
SET U="^"
SET $PIECE(DGLINE,"=",81)=""
SET DGMAX=^DD("ROU")
+4 if '$DATA(DGKIND)
GOTO ENQ
if "^OUTPUT^INPUT^"'[(U_DGKIND_U)
GOTO ENQ
+5 IF DGKIND="OUTPUT"
SET DGFILE="^DIPT"
SET DGROU="EN^DIPZ"
+6 IF DGKIND="INPUT"
SET DGFILE="^DIE"
SET DGROU="EN^DIEZ"
+7 WRITE !,DGLINE,!?20,"Recompilation of '",DGKIND,"' Templates",!,DGLINE
+8 ;
+9 FOR DGX="DFzzzz","SCzzzz"
FOR DGI=1:1
SET DGX=$ORDER(@DGFILE@("B",DGX))
if DGX=""!("^DG^SD^"'[(U_$EXTRACT(DGX,1,2)_U))
QUIT
SET Y=+$ORDER(^(DGX,0))
IF $DATA(@DGFILE@(Y,"ROUOLD"))
IF ^("ROUOLD")]""
IF $DATA(^(0))
SET (DGEMP,Y)=Y
SET X=$PIECE(^("ROUOLD"),"^")
SET DG0=^(0)
DO COMP
+10 ;
ENQ KILL DGROU,DG0,DGX,DGI,DGMAX,DGEMP,DGFILE,DGI,DGLINE
QUIT
+1 ;
COMP ; re-compile
+1 IF DGKIND="INPUT"
IF $PIECE(DG0,U)="DG TEN"
GOTO COMPQ
+2 ; excludes HINQ templates
IF $PIECE(DG0,U)?1"DGHI".E
GOTO COMPQ
+3 SET DMAX=DGMAX
DO @DGROU
WRITE !!,DGLINE
COMPQ QUIT
+1 ;
ALL ; compile templates and x-refs
+1 if '$DATA(DTIME)
SET DTIME=300
SET U="^"
+2 SET DIR(0)="Y"
SET DIR("A")="Re-compile all 'DG' and 'SD' templates and cross references"
+3 SET DIR("?",1)="Yes to re-compile"
SET DIR("?",2)="No to stop recompilation process"
SET DIR("?")=" "
+4 DO ^DIR
KILL DIR
if 'Y
GOTO ALLQ
+5 DO DIEZ
WRITE !!
+6 DO DIPZ
WRITE !!
+7 DO DIKZ
+8 WRITE !!,"...Done.",!!,"NOTE: Recompilation should be performed on ALL systems."
ALLQ KILL A,C,L,O,X1,DQ,DIE,DMAX,DIEZ,DIEZDUP,DK,DR
QUIT
+1 ;
DIEZ ; -- re-compile all DG and SD 'edit' templates
+1 SET DGKIND="INPUT"
DO EN
KILL DGKIND
QUIT
+2 ;
DIPZ ; -- re-compile all DG and SD 'print' templates
+1 SET DGKIND="OUTPUT"
DO EN
KILL DGKIND
QUIT
+2 ;
DIKZ ; -- compile x-refs
+1 WRITE !!,">>> Compiling cross references for PTF, PATIENT MOVEMENT,",!,"INDIVIDUAL ANNUAL INCOME, INCOME RELATION",!,"and ANNUAL MEANS TEST files:"
+2 FOR DGN=45,405,408.21,408.22,408.31
SET N=DGN
WRITE !
IF ^DD("VERSION")>17.5
IF $DATA(^DD(+N,0,"DIK"))#2
SET X=^("DIK")
SET Y=+N
SET DMAX=^DD("ROU")
DO EN^DIKZ
+3 KILL DGN,N,DMAX
+4 QUIT