LEXDMGV ;ISL/KER - Defaults - Manager/Verify ;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
; LEXDICS(1) Filter - Add, Delete, No Change
; LEXSHOW Display
; LEXSHOW(0) Display name
; LEXSHOW(1) Display - Add, Delete, No Change
; LEXSUB Vocabulary
; LEXSUB(0) Vocabulary name
; LEXSUB(1) Vocabulary - Add, Delete, No Change
; LEXCTX Shortcut Context
; LEXCTX(0) Shortcut Context name
; LEXCTX(1) Shortcut Context - Add, Delete, No Change
;
; LEXUSER User (text, not pointer)
; LEXX Returned value
; LEXLIM Limits (parameter for LEXMETH)
; LEXMETH Method, singel user, by service or all users
;
VER(LEXX) ; Verify defaults before commiting to the global
W @IOF
D DDEF,DDU,OVRCHG^LEXDMGO
W ! N DIR,DTOUT,DUOUT,DIRUT,DIROUT,X,Y
S DIR("A")="Is this correct? "
S DIR("B")="Yes"
S (DIR("?"),DIR("??"))="^D VERH^LEXDMGV"
S DIR(0)="YAO" D ^DIR K DIR I X["^^" Q "^^"
Q:X[U U S LEXX=+Y Q LEXX
VERH ; Verify help
W !!,"By answering ""Yes"" you will be setting the look-up defaults for the Clinical"
W !,"Lexicon for the selected applications and users."
W !!,"Is this correct"
Q
DDEF ; Display defaults
N LEXC S LEXC=0
I (+($$ACT)) D
. W !,"Set user defaults:",!
I $D(LEXDICS(1)) D
. S LEXC=LEXC+1 W !," ",LEXC," Filter ",LEXDICS(1)
. W:$G(LEXDICS(1))["Add" ", ",$P($G(LEXDICS(0))," (",1)
I $D(LEXSHOW(1)) D
. S LEXC=LEXC+1 W !," ",LEXC," Display ",$G(LEXSHOW(1))
. W:$G(LEXSHOW(1))["Add" ", ",$P($G(LEXSHOW(0))," (",1)
I $D(LEXSUB(1)) D
. S LEXC=LEXC+1 W !," ",LEXC," Vocabulary ",$G(LEXSUB(1))
. W:$G(LEXSUB(1))["Add" ", ",$P($G(LEXSUB(0))," (",1)
I $D(LEXCTX(1)) D
. S LEXC=LEXC+1 W !," ",LEXC," Shortcuts ",$G(LEXCTX(1))
. W:$G(LEXCTX(1))["Add" ", ",$P($G(LEXCTX(0))," (",1)
W:(+($$ACT)) !
Q
ACT(LEXX) ; Check for Default Action
I $D(LEXDICS(1))!($D(LEXSHOW(1))) Q 1
I $D(LEXSUB(1))!($D(LEXCTX(1))) Q 1
Q 0
NAM(LEXX) ; Check for Default Names
I $D(LEXDICS(0))!($D(LEXSHOW(0))) Q 1
I $D(LEXSUB(0))!($D(LEXCTX(0))) Q 1
Q 0
VAL(LEXX) ; Check for Default Values
I $D(LEXDICS)!($D(LEXSHOW)) Q 1
I $D(LEXSUB)!($D(LEXCTX)) Q 1
Q 0
DDU ; Display users
Q:'$D(LEXMETH) N LEXUSER S LEXUSER=$P(LEXMETH,U,2) Q:'$L(LEXUSER)
W !,"For ",LEXUSER,! Q
DEFCK ; Check defaults
S LEXDICS(1)=$S($G(LEXDICS)="":"No Change",$G(LEXDICS)="@":"Deleted",1:"Added")
S LEXSHOW(1)=$S($G(LEXSHOW)="":"No Change",$G(LEXSHOW)="@":"Deleted",1:"Added")
S LEXSUB(1)=$S($G(LEXSUB)="":"No Change",$G(LEXSUB)="@":"Deleted",1:"Added")
S LEXCTX(1)=$S($G(LEXCTX)="":"No Change",$G(LEXCTX)="@":"Deleted",1:"Added")
Q
USERCK ; Check user
I LEXMETH="ONE",+LEXLIM>0 S $P(LEXMETH,U,2)="user: "_$P(LEXLIM,U,2)
I LEXMETH="SEV",+LEXLIM>0 S $P(LEXMETH,U,2)="users in Service/Section: "_$P(LEXLIM,U,2)
I LEXMETH="ALL",+LEXLIM>0 S $P(LEXMETH,U,2)="users: All Users"
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLEXDMGV 3135 printed Nov 22, 2024@17:18:02 Page 2
LEXDMGV ;ISL/KER - Defaults - Manager/Verify ;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 ; LEXDICS(1) Filter - Add, Delete, No Change
+12 ; LEXSHOW Display
+13 ; LEXSHOW(0) Display name
+14 ; LEXSHOW(1) Display - Add, Delete, No Change
+15 ; LEXSUB Vocabulary
+16 ; LEXSUB(0) Vocabulary name
+17 ; LEXSUB(1) Vocabulary - Add, Delete, No Change
+18 ; LEXCTX Shortcut Context
+19 ; LEXCTX(0) Shortcut Context name
+20 ; LEXCTX(1) Shortcut Context - Add, Delete, No Change
+21 ;
+22 ; LEXUSER User (text, not pointer)
+23 ; LEXX Returned value
+24 ; LEXLIM Limits (parameter for LEXMETH)
+25 ; LEXMETH Method, singel user, by service or all users
+26 ;
VER(LEXX) ; Verify defaults before commiting to the global
+1 WRITE @IOF
+2 DO DDEF
DO DDU
DO OVRCHG^LEXDMGO
+3 WRITE !
NEW DIR,DTOUT,DUOUT,DIRUT,DIROUT,X,Y
+4 SET DIR("A")="Is this correct? "
+5 SET DIR("B")="Yes"
+6 SET (DIR("?"),DIR("??"))="^D VERH^LEXDMGV"
+7 SET DIR(0)="YAO"
DO ^DIR
KILL DIR
IF X["^^"
QUIT "^^"
+8 if X[U
QUIT U
SET LEXX=+Y
QUIT LEXX
VERH ; Verify help
+1 WRITE !!,"By answering ""Yes"" you will be setting the look-up defaults for the Clinical"
+2 WRITE !,"Lexicon for the selected applications and users."
+3 WRITE !!,"Is this correct"
+4 QUIT
DDEF ; Display defaults
+1 NEW LEXC
SET LEXC=0
+2 IF (+($$ACT))
Begin DoDot:1
+3 WRITE !,"Set user defaults:",!
End DoDot:1
+4 IF $DATA(LEXDICS(1))
Begin DoDot:1
+5 SET LEXC=LEXC+1
WRITE !," ",LEXC," Filter ",LEXDICS(1)
+6 if $GET(LEXDICS(1))["Add"
WRITE ", ",$PIECE($GET(LEXDICS(0))," (",1)
End DoDot:1
+7 IF $DATA(LEXSHOW(1))
Begin DoDot:1
+8 SET LEXC=LEXC+1
WRITE !," ",LEXC," Display ",$GET(LEXSHOW(1))
+9 if $GET(LEXSHOW(1))["Add"
WRITE ", ",$PIECE($GET(LEXSHOW(0))," (",1)
End DoDot:1
+10 IF $DATA(LEXSUB(1))
Begin DoDot:1
+11 SET LEXC=LEXC+1
WRITE !," ",LEXC," Vocabulary ",$GET(LEXSUB(1))
+12 if $GET(LEXSUB(1))["Add"
WRITE ", ",$PIECE($GET(LEXSUB(0))," (",1)
End DoDot:1
+13 IF $DATA(LEXCTX(1))
Begin DoDot:1
+14 SET LEXC=LEXC+1
WRITE !," ",LEXC," Shortcuts ",$GET(LEXCTX(1))
+15 if $GET(LEXCTX(1))["Add"
WRITE ", ",$PIECE($GET(LEXCTX(0))," (",1)
End DoDot:1
+16 if (+($$ACT))
WRITE !
+17 QUIT
ACT(LEXX) ; Check for Default Action
+1 IF $DATA(LEXDICS(1))!($DATA(LEXSHOW(1)))
QUIT 1
+2 IF $DATA(LEXSUB(1))!($DATA(LEXCTX(1)))
QUIT 1
+3 QUIT 0
NAM(LEXX) ; Check for Default Names
+1 IF $DATA(LEXDICS(0))!($DATA(LEXSHOW(0)))
QUIT 1
+2 IF $DATA(LEXSUB(0))!($DATA(LEXCTX(0)))
QUIT 1
+3 QUIT 0
VAL(LEXX) ; Check for Default Values
+1 IF $DATA(LEXDICS)!($DATA(LEXSHOW))
QUIT 1
+2 IF $DATA(LEXSUB)!($DATA(LEXCTX))
QUIT 1
+3 QUIT 0
DDU ; Display users
+1 if '$DATA(LEXMETH)
QUIT
NEW LEXUSER
SET LEXUSER=$PIECE(LEXMETH,U,2)
if '$LENGTH(LEXUSER)
QUIT
+2 WRITE !,"For ",LEXUSER,!
QUIT
DEFCK ; Check defaults
+1 SET LEXDICS(1)=$SELECT($GET(LEXDICS)="":"No Change",$GET(LEXDICS)="@":"Deleted",1:"Added")
+2 SET LEXSHOW(1)=$SELECT($GET(LEXSHOW)="":"No Change",$GET(LEXSHOW)="@":"Deleted",1:"Added")
+3 SET LEXSUB(1)=$SELECT($GET(LEXSUB)="":"No Change",$GET(LEXSUB)="@":"Deleted",1:"Added")
+4 SET LEXCTX(1)=$SELECT($GET(LEXCTX)="":"No Change",$GET(LEXCTX)="@":"Deleted",1:"Added")
+5 QUIT
USERCK ; Check user
+1 IF LEXMETH="ONE"
IF +LEXLIM>0
SET $PIECE(LEXMETH,U,2)="user: "_$PIECE(LEXLIM,U,2)
+2 IF LEXMETH="SEV"
IF +LEXLIM>0
SET $PIECE(LEXMETH,U,2)="users in Service/Section: "_$PIECE(LEXLIM,U,2)
+3 IF LEXMETH="ALL"
IF +LEXLIM>0
SET $PIECE(LEXMETH,U,2)="users: All Users"
+4 QUIT