DDBRZIS ;SFISC/DCL-BROWSER DEVICE UTILITIES ;18NOV2012
;;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.
;
OPEN ;
;DDBRZIS AND DDBDMSG ARE KILLED IN POST
S DDBRZIS=1,DDBDMSG=$G(DDBDMSG)
U IO(0)
I $G(DDBDMSG)="" D Q:DDBDMSG="$$DTOUT$$"
.N DIR,X,Y
.S DIR(0)="FUO^0:78",DIR("A")="BROWSER TITLE (optional)"
.S DIR("B")="VA FileMan Browser"
.S DIR("?")="Enter any free text, which will appear in the Title Bar"
.D ^DIR
.I $G(DTOUT) S DDBDMSG="$$DTOUT$$" K DTOUT,DUOUT,DIRUT,DIROUT Q
.S DDBDMSG=$S(Y="":DDBDMSG,1:Y)
.Q
W !,"...one moment..."
U IO
Q:DDBDMSG]""
I $G(DHD)="W """" D ^DIDH" S DDBDMSG="DATA DICTIONARY" Q
S DDBDMSG="VA FileMan Browser"
Q
;
CLOSE ;
Q:$G(DDBDMSG)="$$DTOUT$$"
S DDBRZIS=$G(DDBRZIS,1)
N C,CHAR,EOF,X
K ^TMP("DDB",$J)
S EOF="EOF-End Of File"
S CHAR="" F I=1:1:31 S CHAR=CHAR_$C(I)
U IO W !,EOF,!
S DDBRZIS("REWIND")=$$REWIND^%ZIS(IO,IOT,IOPAR)
I 'DDBRZIS("REWIND") S DDBRZIS=0 U IO(0) W $C(7),!!?5,"<< UNABLE TO REWIND FILE>>",! H 3 Q
U IO
S C=0
F R X:2 Q:X="EOF-End Of File" D
.S X=$TR(X,CHAR)
.S:X']"" X=" "
.S C=C+1,^TMP("DDB",$J,C)=$E(X,1,255) Q
IHS I C=1,^TMP("DDB",$J,C)=" " S ^TMP("DDB",$J,2)="BROWSER: No display data sent"
Q
;
POST ;
I $G(DDBDMSG)="$$DTOUT$$" K DDBDMSG,DDBRZIS W $C(7) Q
I $G(DDBRZIS) D BROWSE^DDBR("^TMP(""DDB"",$J)","NR",$G(DDBDMSG))
K DDBRZIS,DDBDMSG
Q
;
DEVICE(MSG) ;TEST IF BROWSER IS BEING INVOKED VIA DEVICE HANDLER
;EXTRINSIC FUNCTION
I $D(DDBRZIS)#2,$G(MSG)]"" S DDBDMSG=MSG Q 1
Q 0
;
MSG(TXT) ;PASS TEXT FOR BROWSER TITLE WHEN BROWSER INVOKED VIA DEVICE HANDLER
;PROCEDURE CALL
S DDBDMSG=$G(TXT)
Q
STR(X) ; Remove windows
N I,Y
I $L(X,"|")'>2 Q X
I X["|WRAP|"!(X["| NO WRAP|")!(X["|NOWRAP|") S Y="" F I=1:1:$L(X,"|") S:(I#2) Y=Y_$P(X,"|",I)
Q $S(X'["|":X,1:$G(Y))
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDDBRZIS 2092 printed Dec 13, 2024@02:41:58 Page 2
DDBRZIS ;SFISC/DCL-BROWSER DEVICE UTILITIES ;18NOV2012
+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 ;
OPEN ;
+1 ;DDBRZIS AND DDBDMSG ARE KILLED IN POST
+2 SET DDBRZIS=1
SET DDBDMSG=$GET(DDBDMSG)
+3 USE IO(0)
+4 IF $GET(DDBDMSG)=""
Begin DoDot:1
+5 NEW DIR,X,Y
+6 SET DIR(0)="FUO^0:78"
SET DIR("A")="BROWSER TITLE (optional)"
+7 SET DIR("B")="VA FileMan Browser"
+8 SET DIR("?")="Enter any free text, which will appear in the Title Bar"
+9 DO ^DIR
+10 IF $GET(DTOUT)
SET DDBDMSG="$$DTOUT$$"
KILL DTOUT,DUOUT,DIRUT,DIROUT
QUIT
+11 SET DDBDMSG=$SELECT(Y="":DDBDMSG,1:Y)
+12 QUIT
End DoDot:1
if DDBDMSG="$$DTOUT$$"
QUIT
+13 WRITE !,"...one moment..."
+14 USE IO
+15 if DDBDMSG]""
QUIT
+16 IF $GET(DHD)="W """" D ^DIDH"
SET DDBDMSG="DATA DICTIONARY"
QUIT
+17 SET DDBDMSG="VA FileMan Browser"
+18 QUIT
+19 ;
CLOSE ;
+1 if $GET(DDBDMSG)="$$DTOUT$$"
QUIT
+2 SET DDBRZIS=$GET(DDBRZIS,1)
+3 NEW C,CHAR,EOF,X
+4 KILL ^TMP("DDB",$JOB)
+5 SET EOF="EOF-End Of File"
+6 SET CHAR=""
FOR I=1:1:31
SET CHAR=CHAR_$CHAR(I)
+7 USE IO
WRITE !,EOF,!
+8 SET DDBRZIS("REWIND")=$$REWIND^%ZIS(IO,IOT,IOPAR)
+9 IF 'DDBRZIS("REWIND")
SET DDBRZIS=0
USE IO(0)
WRITE $CHAR(7),!!?5,"<< UNABLE TO REWIND FILE>>",!
HANG 3
QUIT
+10 USE IO
+11 SET C=0
+12 FOR
READ X:2
if X="EOF-End Of File"
QUIT
Begin DoDot:1
+13 SET X=$TRANSLATE(X,CHAR)
+14 if X']""
SET X=" "
+15 SET C=C+1
SET ^TMP("DDB",$JOB,C)=$EXTRACT(X,1,255)
QUIT
End DoDot:1
IHS IF C=1
IF ^TMP("DDB",$JOB,C)=" "
SET ^TMP("DDB",$JOB,2)="BROWSER: No display data sent"
+1 QUIT
+2 ;
POST ;
+1 IF $GET(DDBDMSG)="$$DTOUT$$"
KILL DDBDMSG,DDBRZIS
WRITE $CHAR(7)
QUIT
+2 IF $GET(DDBRZIS)
DO BROWSE^DDBR("^TMP(""DDB"",$J)","NR",$GET(DDBDMSG))
+3 KILL DDBRZIS,DDBDMSG
+4 QUIT
+5 ;
DEVICE(MSG) ;TEST IF BROWSER IS BEING INVOKED VIA DEVICE HANDLER
+1 ;EXTRINSIC FUNCTION
+2 IF $DATA(DDBRZIS)#2
IF $GET(MSG)]""
SET DDBDMSG=MSG
QUIT 1
+3 QUIT 0
+4 ;
MSG(TXT) ;PASS TEXT FOR BROWSER TITLE WHEN BROWSER INVOKED VIA DEVICE HANDLER
+1 ;PROCEDURE CALL
+2 SET DDBDMSG=$GET(TXT)
+3 QUIT
STR(X) ; Remove windows
+1 NEW I,Y
+2 IF $LENGTH(X,"|")'>2
QUIT X
+3 IF X["|WRAP|"!(X["| NO WRAP|")!(X["|NOWRAP|")
SET Y=""
FOR I=1:1:$LENGTH(X,"|")
if (I#2)
SET Y=Y_$PIECE(X,"|",I)
+4 QUIT $SELECT(X'["|":X,1:$GET(Y))