LEXDMG ;ISL/KER - Defaults - Manager Options ;04/21/2014
;;2.0;LEXICON UTILITY;**80**;Sep 23, 1996;Build 1
;
; Global Variables
; None
;
; External References
; ^DIR ICR 10026
;
; LEXDICS Filter
; LEXDICS(0) Filter name
; LEXSHOW Display
; LEXSHOW(0) Display name
; LEXSUB Vocabulary
; LEXSUB(0) Vocabulary name
; LEXCTX Shortcut Context
; LEXCTX(0) Shortcut Context name
;
; LEXAP Application
; LEXCHG Flag for 1) defaults changed 0) not changed
; LEXDNAM Default name
; LEXDVAL Default value
; LEXGET Executable code which gets the default values
; LEXMAX Maximum number of defaults
; LEXMGR Flag - Manager
; LEXRTN Routine name which sets the defaults values
; LEXSEL User input/selection
;
W @IOF
N LEXDICS,LEXSHOW,LEXSUB,LEXCTX,LEXMAX
N LEXAP,LEXCHG,LEXDNAM,LEXDVAL,LEXGET
N LEXRTN,LEXSEL,LEXMGR
S (LEXMGR,LEXSEL,LEXDICS,LEXDICS(0),LEXSHOW,LEXSHOW(0))=""
S (LEXSUB,LEXSUB(0),LEXCTX,LEXCTX(0))="",LEXMAX=4
APPS ; Defaults for an application
S LEXCHG=0
APP ; Get the application(s) - $$FI^LEXDM4
S LEXAP=$$FI^LEXDM4
I LEXAP="" W !!,"No application(s) selected",! G EXIT
D DEFMENU G DEFOPT
W !!,"Lexicon Defaults:"
W !!," 1 Filter "
W $S($L($G(LEXDICS(0))):"- ",1:""),$G(LEXDICS(0))
W:'$L($G(LEXDICS(0))) " Unselected"
W !," 2 Display "
W $S($L($G(LEXSHOW(0))):"- ",1:""),$G(LEXSHOW(0))
W:'$L($G(LEXSHOW(0))) " Unselected"
W !," 3 Vocabulary "
W $S($L($G(LEXSUB(0))):"- ",1:""),$G(LEXSUB(0))
W:'$L($G(LEXSUB(0))) " Unselected"
W !," 4 Shortcuts "
W $S($L($G(LEXCTX(0))):"- ",1:""),$G(LEXCTX(0))
W:'$L($G(LEXCTX(0))) " Unselected"
W ! Q
DEFOPT ; Get user input LEXSEL from ^DIR
N DIR,DTOUT,DUOUT,DIRUT,DIROUT,X,Y
G:$G(LEXSEL)["^^" EXIT
S DIR("A")="Select default to modify (1-"_LEXMAX_"): "
S DIR("?")="^D DEFHLP^LEXDMG"
S DIR(0)="NAO^1:"_LEXMAX_":0" D ^DIR
S LEXSEL=$S($D(DTOUT):"",X["^^":"^^",X[U&(X'["^^"):U,1:X) K DIR
G:LEXSEL=U APPS G:LEXSEL="^^" EXIT
G:+LEXSEL=0&(LEXCHG=0) EXIT G:+LEXSEL=0&(LEXCHG>0) USR
; Get Filter - $$MGR^LEXDFL
I +LEXSEL=1 D G DEFOPT
. D GETDEF("LEXDICS","LEXDICS(0)","$$MGR^LEXDFL")
; Get Display - $$MGR^LEXDCC
I +LEXSEL=2 D G DEFOPT
. D GETDEF("LEXSHOW","LEXSHOW(0)","$$MGR^LEXDCC")
; Get Vocabulary - $$MGR^LEXDVO
I +LEXSEL=3 D G DEFOPT
. D GETDEF("LEXSUB","LEXSUB(0)","$$MGR^LEXDVO")
; Get Shortcut Context - $$MGR^LEXDCX
I +LEXSEL=4 D G DEFOPT
. D GETDEF("LEXCTX","LEXCTX(0)","$$MGR^LEXDCX")
Q
DEFHLP ; Help
W !!,"Enter 1-",LEXMAX," to modify defaults, ""^"" for previous menu,"
W:'LEXCHG " or ""^^""/<Return> to exit"
W:LEXCHG " ""^^"" to exit, or",!,"<Return> to continue."
D DEFMENU Q
GETDEF(LEXDVAL,LEXDNAM,LEXRTN) ; Get the default values - X LEXGET
N LEXGET S LEXGET="S "_LEXDVAL_"="_LEXRTN X LEXGET
S:@LEXDVAL="^^" LEXSEL="^^"
S @LEXDNAM=$P(@LEXDVAL,U,$L(@LEXDVAL,U))
S @LEXDVAL=$P(@LEXDVAL,U,1,($L(@LEXDVAL,U)-1))
S:@LEXDVAL="" @LEXDNAM="No Change"
S:@LEXDVAL'="" LEXCHG=1 D:LEXSEL'["^^" DEFMENU Q
USR ; Set defaults for a User or User Group - $$USER^LEXDMGU
S LEXSEL=$$USER^LEXDMGU
I $D(LEXSEL),LEXSEL=U D DEFMENU G DEFOPT
EXIT ; Cleanup and quit
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLEXDMG 3366 printed Dec 13, 2024@02:07:50 Page 2
LEXDMG ;ISL/KER - Defaults - Manager Options ;04/21/2014
+1 ;;2.0;LEXICON UTILITY;**80**;Sep 23, 1996;Build 1
+2 ;
+3 ; Global Variables
+4 ; None
+5 ;
+6 ; External References
+7 ; ^DIR ICR 10026
+8 ;
+9 ; LEXDICS Filter
+10 ; LEXDICS(0) Filter name
+11 ; LEXSHOW Display
+12 ; LEXSHOW(0) Display name
+13 ; LEXSUB Vocabulary
+14 ; LEXSUB(0) Vocabulary name
+15 ; LEXCTX Shortcut Context
+16 ; LEXCTX(0) Shortcut Context name
+17 ;
+18 ; LEXAP Application
+19 ; LEXCHG Flag for 1) defaults changed 0) not changed
+20 ; LEXDNAM Default name
+21 ; LEXDVAL Default value
+22 ; LEXGET Executable code which gets the default values
+23 ; LEXMAX Maximum number of defaults
+24 ; LEXMGR Flag - Manager
+25 ; LEXRTN Routine name which sets the defaults values
+26 ; LEXSEL User input/selection
+27 ;
+28 WRITE @IOF
+29 NEW LEXDICS,LEXSHOW,LEXSUB,LEXCTX,LEXMAX
+30 NEW LEXAP,LEXCHG,LEXDNAM,LEXDVAL,LEXGET
+31 NEW LEXRTN,LEXSEL,LEXMGR
+32 SET (LEXMGR,LEXSEL,LEXDICS,LEXDICS(0),LEXSHOW,LEXSHOW(0))=""
+33 SET (LEXSUB,LEXSUB(0),LEXCTX,LEXCTX(0))=""
SET LEXMAX=4
APPS ; Defaults for an application
+1 SET LEXCHG=0
APP ; Get the application(s) - $$FI^LEXDM4
+1 SET LEXAP=$$FI^LEXDM4
+2 IF LEXAP=""
WRITE !!,"No application(s) selected",!
GOTO EXIT
+3 DO DEFMENU
GOTO DEFOPT
+1 WRITE !!,"Lexicon Defaults:"
+2 WRITE !!," 1 Filter "
+3 WRITE $SELECT($LENGTH($GET(LEXDICS(0))):"- ",1:""),$GET(LEXDICS(0))
+4 if '$LENGTH($GET(LEXDICS(0)))
WRITE " Unselected"
+5 WRITE !," 2 Display "
+6 WRITE $SELECT($LENGTH($GET(LEXSHOW(0))):"- ",1:""),$GET(LEXSHOW(0))
+7 if '$LENGTH($GET(LEXSHOW(0)))
WRITE " Unselected"
+8 WRITE !," 3 Vocabulary "
+9 WRITE $SELECT($LENGTH($GET(LEXSUB(0))):"- ",1:""),$GET(LEXSUB(0))
+10 if '$LENGTH($GET(LEXSUB(0)))
WRITE " Unselected"
+11 WRITE !," 4 Shortcuts "
+12 WRITE $SELECT($LENGTH($GET(LEXCTX(0))):"- ",1:""),$GET(LEXCTX(0))
+13 if '$LENGTH($GET(LEXCTX(0)))
WRITE " Unselected"
+14 WRITE !
QUIT
DEFOPT ; Get user input LEXSEL from ^DIR
+1 NEW DIR,DTOUT,DUOUT,DIRUT,DIROUT,X,Y
+2 if $GET(LEXSEL)["^^"
GOTO EXIT
+3 SET DIR("A")="Select default to modify (1-"_LEXMAX_"): "
+4 SET DIR("?")="^D DEFHLP^LEXDMG"
+5 SET DIR(0)="NAO^1:"_LEXMAX_":0"
DO ^DIR
+6 SET LEXSEL=$SELECT($DATA(DTOUT):"",X["^^":"^^",X[U&(X'["^^"):U,1:X)
KILL DIR
+7 if LEXSEL=U
GOTO APPS
if LEXSEL="^^"
GOTO EXIT
+8 if +LEXSEL=0&(LEXCHG=0)
GOTO EXIT
if +LEXSEL=0&(LEXCHG>0)
GOTO USR
+9 ; Get Filter - $$MGR^LEXDFL
+10 IF +LEXSEL=1
Begin DoDot:1
+11 DO GETDEF("LEXDICS","LEXDICS(0)","$$MGR^LEXDFL")
End DoDot:1
GOTO DEFOPT
+12 ; Get Display - $$MGR^LEXDCC
+13 IF +LEXSEL=2
Begin DoDot:1
+14 DO GETDEF("LEXSHOW","LEXSHOW(0)","$$MGR^LEXDCC")
End DoDot:1
GOTO DEFOPT
+15 ; Get Vocabulary - $$MGR^LEXDVO
+16 IF +LEXSEL=3
Begin DoDot:1
+17 DO GETDEF("LEXSUB","LEXSUB(0)","$$MGR^LEXDVO")
End DoDot:1
GOTO DEFOPT
+18 ; Get Shortcut Context - $$MGR^LEXDCX
+19 IF +LEXSEL=4
Begin DoDot:1
+20 DO GETDEF("LEXCTX","LEXCTX(0)","$$MGR^LEXDCX")
End DoDot:1
GOTO DEFOPT
+21 QUIT
DEFHLP ; Help
+1 WRITE !!,"Enter 1-",LEXMAX," to modify defaults, ""^"" for previous menu,"
+2 if 'LEXCHG
WRITE " or ""^^""/<Return> to exit"
+3 if LEXCHG
WRITE " ""^^"" to exit, or",!,"<Return> to continue."
+4 DO DEFMENU
QUIT
GETDEF(LEXDVAL,LEXDNAM,LEXRTN) ; Get the default values - X LEXGET
+1 NEW LEXGET
SET LEXGET="S "_LEXDVAL_"="_LEXRTN
XECUTE LEXGET
+2 if @LEXDVAL="^^"
SET LEXSEL="^^"
+3 SET @LEXDNAM=$PIECE(@LEXDVAL,U,$LENGTH(@LEXDVAL,U))
+4 SET @LEXDVAL=$PIECE(@LEXDVAL,U,1,($LENGTH(@LEXDVAL,U)-1))
+5 if @LEXDVAL=""
SET @LEXDNAM="No Change"
+6 if @LEXDVAL'=""
SET LEXCHG=1
if LEXSEL'["^^"
DO DEFMENU
QUIT
USR ; Set defaults for a User or User Group - $$USER^LEXDMGU
+1 SET LEXSEL=$$USER^LEXDMGU
+2 IF $DATA(LEXSEL)
IF LEXSEL=U
DO DEFMENU
GOTO DEFOPT
EXIT ; Cleanup and quit
+1 QUIT