DDGF ;SFISC/MKO-FORM BUILDING TOOL ;09DEC2015
;;22.2;VA FileMan;;Jan 05, 2016;Build 42
;;Per VA Directive 6402, this routine should not be modified.
;;Submitted to OSEHRA 5 January 2015 by the VISTA Expertise Network.
;;Based on Medsphere Systems Corporation's MSC FileMan 1051.
;;Licensed under the terms of the Apache License, Version 2.0.
;
;Program-wide variables
; DDGFILE = File number^File name
; DDGFFM = Form number^Form name
; DDGFPG = Page number
; DDGFWID = Window id for given page
; DDGFWIDB = Window id for block displayer for a given page
; DDGFREF = Global reference where data is stored
; DDGFLIM = Boundaries within which cursor can be moved
; $Y1^$X1^$Y2^$X2
; DDGFBV = If defined, we're in the block view page
; DDGFMSG = Indicates there's a message on the message line.
;
N %,%W,%X,%Y,C,D,D0,DI,DIC,DIEQ,DIW,DIZ,DQ,I,X,Y,DIOVRD
I '$D(DIFM) N DIFM S DIFM=1 D INIZE^DIEFU
D ^DDGF0 G:$G(DIERR) END^DDGF0
D SEL^DDGFFM G:$D(DDGFFM)[0 END^DDGF0
D ALL^DDGFASUB,^DDGF1,END^DDGF0
Q
;
REFRESH ;Repaint all windows, status line
D REPALL^DDGLIBW(),STATUS
Q
;
STATUS ;Paint status line
N DX,DY,N,S
K DDGFMSG
S DY=IOSL-7,DX=0 X IOXY
W $P(DDGLCLR,DDGLDEL,3)_$TR($J("",IOM-1)," ","_")
;
S DY=IOSL-6 X IOXY
W "File: "_$P(DDGFFILE,U,2)_" (#"_$P(DDGFFILE,U)_")"
I $D(DDGFBV)#2 S DX=46 X IOXY W "BLOCK VIEWER"
W !,"Form: "_$P(DDGFFM,U,2)_" (#"_+DDGFFM_")"
S N=$G(@DDGFREF@("F",+$G(DDGFPG)))
W !,"Page: "_$S(N]"":$P(N,U,6)_" ("_$P(N,U,5)_")",1:""),!!!
I $D(DDGFBV)#2 W $P(DDGLVID,DDGLDEL)_"<PF1>V=Main Screen <PF1>H=Help"_$P(DDGLVID,DDGLDEL,10)
E W $P(DDGLVID,DDGLDEL)_"<PF1>Q=Quit <PF1>E=Exit <PF1>S=Save <PF1>V=Block Viewer <PF1>H=Help"_$P(DDGLVID,DDGLDEL,10)
Q
;
MSG(M) ;Print message
N DDGFDY,DDGFDX
S DDGFDY=DY,DDGFDX=DX S:$D(M)[0 M=""
S DY=IOSL-2,DX=0 X IOXY
;
W $E(M,1,79)_$P(DDGLCLR,DDGLDEL)
S:M]"" DDGFMSG=1 K:M="" DDGFMSG
S DY=DDGFDY,DX=DDGFDX X IOXY
Q
;
RESET ;Reset terminal and cleanup
S DDGFREF="^TMP(""DDGF"",$J)",DDGLREF="^TMP(""DDGL"",$J)"
K DDSFILE,DDSPAGE,DDSPARM,DR
G KILL^DDGF0
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDDGF 2143 printed Oct 16, 2024@18:42:44 Page 2
DDGF ;SFISC/MKO-FORM BUILDING TOOL ;09DEC2015
+1 ;;22.2;VA FileMan;;Jan 05, 2016;Build 42
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;;Submitted to OSEHRA 5 January 2015 by the VISTA Expertise Network.
+4 ;;Based on Medsphere Systems Corporation's MSC FileMan 1051.
+5 ;;Licensed under the terms of the Apache License, Version 2.0.
+6 ;
+7 ;Program-wide variables
+8 ; DDGFILE = File number^File name
+9 ; DDGFFM = Form number^Form name
+10 ; DDGFPG = Page number
+11 ; DDGFWID = Window id for given page
+12 ; DDGFWIDB = Window id for block displayer for a given page
+13 ; DDGFREF = Global reference where data is stored
+14 ; DDGFLIM = Boundaries within which cursor can be moved
+15 ; $Y1^$X1^$Y2^$X2
+16 ; DDGFBV = If defined, we're in the block view page
+17 ; DDGFMSG = Indicates there's a message on the message line.
+18 ;
+19 NEW %,%W,%X,%Y,C,D,D0,DI,DIC,DIEQ,DIW,DIZ,DQ,I,X,Y,DIOVRD
+20 IF '$DATA(DIFM)
NEW DIFM
SET DIFM=1
DO INIZE^DIEFU
+21 DO ^DDGF0
if $GET(DIERR)
GOTO END^DDGF0
+22 DO SEL^DDGFFM
if $DATA(DDGFFM)[0
GOTO END^DDGF0
+23 DO ALL^DDGFASUB
DO ^DDGF1
DO END^DDGF0
+24 QUIT
+25 ;
REFRESH ;Repaint all windows, status line
+1 DO REPALL^DDGLIBW()
DO STATUS
+2 QUIT
+3 ;
STATUS ;Paint status line
+1 NEW DX,DY,N,S
+2 KILL DDGFMSG
+3 SET DY=IOSL-7
SET DX=0
XECUTE IOXY
+4 WRITE $PIECE(DDGLCLR,DDGLDEL,3)_$TRANSLATE($JUSTIFY("",IOM-1)," ","_")
+5 ;
+6 SET DY=IOSL-6
XECUTE IOXY
+7 WRITE "File: "_$PIECE(DDGFFILE,U,2)_" (#"_$PIECE(DDGFFILE,U)_")"
+8 IF $DATA(DDGFBV)#2
SET DX=46
XECUTE IOXY
WRITE "BLOCK VIEWER"
+9 WRITE !,"Form: "_$PIECE(DDGFFM,U,2)_" (#"_+DDGFFM_")"
+10 SET N=$GET(@DDGFREF@("F",+$GET(DDGFPG)))
+11 WRITE !,"Page: "_$SELECT(N]"":$PIECE(N,U,6)_" ("_$PIECE(N,U,5)_")",1:""),!!!
+12 IF $DATA(DDGFBV)#2
WRITE $PIECE(DDGLVID,DDGLDEL)_"<PF1>V=Main Screen <PF1>H=Help"_$PIECE(DDGLVID,DDGLDEL,10)
+13 IF '$TEST
WRITE $PIECE(DDGLVID,DDGLDEL)_"<PF1>Q=Quit <PF1>E=Exit <PF1>S=Save <PF1>V=Block Viewer <PF1>H=Help"_$PIECE(DDGLVID,DDGLDEL,10)
+14 QUIT
+15 ;
MSG(M) ;Print message
+1 NEW DDGFDY,DDGFDX
+2 SET DDGFDY=DY
SET DDGFDX=DX
if $DATA(M)[0
SET M=""
+3 SET DY=IOSL-2
SET DX=0
XECUTE IOXY
+4 ;
+5 WRITE $EXTRACT(M,1,79)_$PIECE(DDGLCLR,DDGLDEL)
+6 if M]""
SET DDGFMSG=1
if M=""
KILL DDGFMSG
+7 SET DY=DDGFDY
SET DX=DDGFDX
XECUTE IOXY
+8 QUIT
+9 ;
RESET ;Reset terminal and cleanup
+1 SET DDGFREF="^TMP(""DDGF"",$J)"
SET DDGLREF="^TMP(""DDGL"",$J)"
+2 KILL DDSFILE,DDSPAGE,DDSPARM,DR
+3 GOTO KILL^DDGF0