LEXDM ;ISL/KER - Default Misc - Mod/Del Sel/Create ;04/21/2014
;;2.0;LEXICON UTILITY;**81,80**;Sep 23, 1996;Build 10
;
; Global Variables
; None
;
; External References
; ^DIR ICR 10026
;
; Entry: S X=$$MOD^LEXDM(X)
; Input X 1=Filter, 2=Display, 3=Vocabulary or 4=Context
; Returns "^^" Double up-arrow, 0 no action taken, 1 Modify
; default entry or "@" delete default entry
;
MOD(LEXX) ; Modify or Delete
;
S LEXX=+($G(LEXX)) Q:LEXX<0 0 S LEXX=LEXX\1 Q:LEXX>4 0
N DIR,X,Y,DIRUT,DTOUT,DUOUT,DIROUT
S:LEXX=1 DIR("A",1)="search filter" S:LEXX=2 DIR("A",1)="display format"
S:LEXX=3 DIR("A",1)="vocabulary" S:LEXX=4 DIR("A",1)="shortcut context"
S:$L($G(DIR("A",1))) DIR("A",1)="User default "_DIR("A",1)
S DIR("A",3)=" 1 Modify",DIR("A",4)=" 2 Delete"
S (DIR("A",2),DIR("A",5))=" "
S:LEXX=1 DIR(0)="SAO^1:Modify Default Filter;2:Delete Default Filter"
S:LEXX=2 DIR(0)="SAO^1:Modify Default Display;2:Delete Default Display"
S:LEXX=3 DIR(0)="SAO^1:Modify Default Vocabulary;2:Delete Default Vocabulary"
S:LEXX=4 DIR(0)="SAO^1:Modify Default Shortcut Context;2:Delete Default Shortcut Context"
S DIR("A")="Select: ",DIR("B")="1"
D ^DIR S LEXX=$S(X=1:1,X=2:"@",X="@":"@",1:0) S:Y="^^" LEXX=Y Q LEXX
;
;-----------------------------------------------------------------
; Entry: S X=$$MTH^LEXDM(X)
; Input X 1=Filter, 2=Display
; Returns "^^" Timeout or Double-uparrow, "^" Method not
; selected, 1 Select default from a predefined list
; or 2 Create a user defined default
;
; LEXM Method of building string
; LEXF Flag, indicates the default type
;
MTH(LEXX) ; Method - Select a predefined or Create new
Q:'$L($G(LEXX)) "" Q:+LEXX'>0 "" Q:+LEXX'<3 ""
N LEXF,LEXM S LEXF=+LEXX,LEXM=$$METH W:+LEXM=1!(+LEXM=2) !!
S LEXX=LEXM S:"12"[LEXM LEXX=LEXM
S:'$L($G(LEXM))!(LEXM="^") LEXX="^" S:LEXM="^^" LEXX="^^"
Q LEXX
METH(LEXX) ; Select method
N DIR,X,Y,DIRUT,DTOUT,DUOUT,DIROUT
I +LEXF=1 D
. S DIR("A",1)="Search filters (screens) to limit the response"
. S DIR("A",3)=" 1 Select from predefined filters"
. S DIR("A",4)=" 2 Create your own filter"
. S DIR("??")="^D HF^LEXDM"
I +LEXF=2 D
. S DIR("A",1)="Display format to be used during look-up"
. S DIR("A",3)=" 1 Select from predefined display formats"
. S DIR("A",4)=" 2 Create your own display format"
. S DIR("??")="^D HD^LEXDM"
S (DIR("A",2),DIR("A",5))=" "
S DIR(0)="SAO^1:Predefined Set;2:Create your own set"
S DIR("A")="Select: ",DIR("B")="1"
D ^DIR S LEXX=$S(+Y>0:+Y,1:Y) S:$D(DTOUT) LEXX="^^" Q LEXX
HF ; Help for filters - DIC("S")
W !!,"When conducting searches in the Lexicon, you may find that many of the"
W !,"expressions found are not reasonable in the context of intended use."
W !,"Many of these ""unreasonable"" expressions can be filtered out during the"
W !,"search, providing a much smaller and more meaningful list of expressions"
W !,"to select from. Several of these filters have been predefined and made "
W !,"available. You may select from this list of predefined filters or create"
W !,"your own." Q
HD ; Help for display - LEXSHOW
W !!,"When conducting searches in the Lexicon, you may alter the display format"
W !,"of the selection list. There are several commonly used displays which"
W !,"have been predefined and made available. You may select from this list or"
W !,"create your own." Q
LEXDM ;ISL/KER - Default Misc - Mod/Del Sel/Create ;04/21/2014
+1 ;;2.0;LEXICON UTILITY;**81,80**;Sep 23, 1996;Build 10
+2 ;
+3 ; Global Variables
+4 ; None
+5 ;
+6 ; External References
+7 ; ^DIR ICR 10026
+8 ;
+9 ; Entry: S X=$$MOD^LEXDM(X)
+10 ; Input X 1=Filter, 2=Display, 3=Vocabulary or 4=Context
+11 ; Returns "^^" Double up-arrow, 0 no action taken, 1 Modify
+12 ; default entry or "@" delete default entry
+13 ;
MOD(LEXX) ; Modify or Delete
+1 ;
+2 SET LEXX=+($GET(LEXX))
IF LEXX<0
QUIT 0
SET LEXX=LEXX\1
IF LEXX>4
QUIT 0
+3 NEW DIR,X,Y,DIRUT,DTOUT,DUOUT,DIROUT
+4 IF LEXX=1
SET DIR("A",1)="search filter"
IF LEXX=2
SET DIR("A",1)="display format"
+5 IF LEXX=3
SET DIR("A",1)="vocabulary"
IF LEXX=4
SET DIR("A",1)="shortcut context"
+6 IF $LENGTH($GET(DIR("A",1)))
SET DIR("A",1)="User default "_DIR("A",1)
+7 SET DIR("A",3)=" 1 Modify"
SET DIR("A",4)=" 2 Delete"
+8 SET (DIR("A",2),DIR("A",5))=" "
+9 IF LEXX=1
SET DIR(0)="SAO^1:Modify Default Filter;2:Delete Default Filter"
+10 IF LEXX=2
SET DIR(0)="SAO^1:Modify Default Display;2:Delete Default Display"
+11 IF LEXX=3
SET DIR(0)="SAO^1:Modify Default Vocabulary;2:Delete Default Vocabulary"
+12 IF LEXX=4
SET DIR(0)="SAO^1:Modify Default Shortcut Context;2:Delete Default Shortcut Context"
+13 SET DIR("A")="Select: "
SET DIR("B")="1"
+14 DO ^DIR
SET LEXX=$SELECT(X=1:1,X=2:"@",X="@":"@",1:0)
IF Y="^^"
SET LEXX=Y
QUIT LEXX
+15 ;
+16 ;-----------------------------------------------------------------
+17 ; Entry: S X=$$MTH^LEXDM(X)
+18 ; Input X 1=Filter, 2=Display
+19 ; Returns "^^" Timeout or Double-uparrow, "^" Method not
+20 ; selected, 1 Select default from a predefined list
+21 ; or 2 Create a user defined default
+22 ;
+23 ; LEXM Method of building string
+24 ; LEXF Flag, indicates the default type
+25 ;
MTH(LEXX) ; Method - Select a predefined or Create new
+1 IF '$LENGTH($GET(LEXX))
QUIT ""
IF +LEXX'>0
QUIT ""
IF +LEXX'<3
QUIT ""
+2 NEW LEXF,LEXM
SET LEXF=+LEXX
SET LEXM=$$METH
IF +LEXM=1!(+LEXM=2)
WRITE !!
+3 SET LEXX=LEXM
IF "12"[LEXM
SET LEXX=LEXM
+4 IF '$LENGTH($GET(LEXM))!(LEXM="^")
SET LEXX="^"
IF LEXM="^^"
SET LEXX="^^"
+5 QUIT LEXX
METH(LEXX) ; Select method
+1 NEW DIR,X,Y,DIRUT,DTOUT,DUOUT,DIROUT
+2 IF +LEXF=1
Begin DoDot:1
+3 SET DIR("A",1)="Search filters (screens) to limit the response"
+4 SET DIR("A",3)=" 1 Select from predefined filters"
+5 SET DIR("A",4)=" 2 Create your own filter"
+6 SET DIR("??")="^D HF^LEXDM"
End DoDot:1
+7 IF +LEXF=2
Begin DoDot:1
+8 SET DIR("A",1)="Display format to be used during look-up"
+9 SET DIR("A",3)=" 1 Select from predefined display formats"
+10 SET DIR("A",4)=" 2 Create your own display format"
+11 SET DIR("??")="^D HD^LEXDM"
End DoDot:1
+12 SET (DIR("A",2),DIR("A",5))=" "
+13 SET DIR(0)="SAO^1:Predefined Set;2:Create your own set"
+14 SET DIR("A")="Select: "
SET DIR("B")="1"
+15 DO ^DIR
SET LEXX=$SELECT(+Y>0:+Y,1:Y)
IF $DATA(DTOUT)
SET LEXX="^^"
QUIT LEXX
HF ; Help for filters - DIC("S")
+1 WRITE !!,"When conducting searches in the Lexicon, you may find that many of the"
+2 WRITE !,"expressions found are not reasonable in the context of intended use."
+3 WRITE !,"Many of these ""unreasonable"" expressions can be filtered out during the"
+4 WRITE !,"search, providing a much smaller and more meaningful list of expressions"
+5 WRITE !,"to select from. Several of these filters have been predefined and made "
+6 WRITE !,"available. You may select from this list of predefined filters or create"
+7 WRITE !,"your own."
QUIT
HD ; Help for display - LEXSHOW
+1 WRITE !!,"When conducting searches in the Lexicon, you may alter the display format"
+2 WRITE !,"of the selection list. There are several commonly used displays which"
+3 WRITE !,"have been predefined and made available. You may select from this list or"
+4 WRITE !,"create your own."
QUIT