LEXDFST ;ISL/KER - Default Filter - Semantic Types ;04/21/2014
;;2.0;LEXICON UTILITY;**80**;Sep 23, 1996;Build 1
;
; Global Variables
; None
;
; External References
; ^DIR ICR 10026
;
; Entry: S X=$$EN^LEXDFST
;
; LEXFIL Filter (executable)
; LEXNAM Filter Name
; LEXPRO Y/N response to proceed with building filter
; LEXSTR Filter parameters (string)
; LEXX Filter returned
;
EN(LEXX) ; Entry point S X=$$EN^LEXDFST
N LEXFIL,LEXPRO S LEXFIL=0 D INTRO S LEXPRO=$$PRO
Q:LEXPRO["^" LEXPRO Q:LEXPRO'=1 "^No filter selected"
S LEXX=$$EN^LEXDFSB Q:LEXX["^^" "^^"
Q:$P(LEXX,"^",1)="" "^No filter selected"
D:$P(LEXX,"^",1)'="" ASSEM
Q LEXX
INTRO ; Introduction/Proceed
W @IOF
W !!,"You will be provided with ",($P(^LEX(757.11,0),U,4))-1," semantic classes. By selecting a semantic"
W !,"class, each term which is found during a search of the Lexicon, and belongs"
W !,"to that class will be displayed for your selection. Additionally, each"
W !,"semantic class contains semantic types (or sub-category) which may be excluded"
W !,"during the search. Terms belonging to an ""included"" semantic class will be"
W !,"displayed unless they also belong to an ""excluded"" semantic type."
Q
PRO(LEXX) ; OK to proceed Y/N
N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT W !!
S DIR("A")="Do you wish to continue: ",DIR("B")="YES"
S DIR("?")="Answer Yes or No",DIR("??")="^D PROH^LEXDFST"
S DIR(0)="YAO" D ^DIR S LEXX=Y Q LEXX
PROH ; Proceed help
W !!,?2,"Answer"
W !!,?4,"Yes Continue to build a filter based on Semantic Types"
W !,?4,"No Exit without building a filter",! Q
ASSEM ; Assemble the return value FILTER^NAME
N LEXNAM,LEXFIL S (LEXNAM,LEXFIL)="",LEXFIL=$P(LEXX,"^",1)
I $L($G(LEXFIL)) S LEXFIL="I $$SC^LEXU(Y,"_""""_LEXFIL_""""_")"
I LEXFIL[U S LEXNAM=$$NAME^LEXDM3 I LEXNAM="^^" S LEXX="^^"
S:LEXX["^^" LEXFIL="",LEXNAM="^" S LEXX=LEXFIL_"^"_LEXNAM Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLEXDFST 2023 printed Oct 16, 2024@18:08:27 Page 2
LEXDFST ;ISL/KER - Default Filter - Semantic Types ;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 ; Entry: S X=$$EN^LEXDFST
+10 ;
+11 ; LEXFIL Filter (executable)
+12 ; LEXNAM Filter Name
+13 ; LEXPRO Y/N response to proceed with building filter
+14 ; LEXSTR Filter parameters (string)
+15 ; LEXX Filter returned
+16 ;
EN(LEXX) ; Entry point S X=$$EN^LEXDFST
+1 NEW LEXFIL,LEXPRO
SET LEXFIL=0
DO INTRO
SET LEXPRO=$$PRO
+2 if LEXPRO["^"
QUIT LEXPRO
if LEXPRO'=1
QUIT "^No filter selected"
+3 SET LEXX=$$EN^LEXDFSB
if LEXX["^^"
QUIT "^^"
+4 if $PIECE(LEXX,"^",1)=""
QUIT "^No filter selected"
+5 if $PIECE(LEXX,"^",1)'=""
DO ASSEM
+6 QUIT LEXX
INTRO ; Introduction/Proceed
+1 WRITE @IOF
+2 WRITE !!,"You will be provided with ",($PIECE(^LEX(757.11,0),U,4))-1," semantic classes. By selecting a semantic"
+3 WRITE !,"class, each term which is found during a search of the Lexicon, and belongs"
+4 WRITE !,"to that class will be displayed for your selection. Additionally, each"
+5 WRITE !,"semantic class contains semantic types (or sub-category) which may be excluded"
+6 WRITE !,"during the search. Terms belonging to an ""included"" semantic class will be"
+7 WRITE !,"displayed unless they also belong to an ""excluded"" semantic type."
+8 QUIT
PRO(LEXX) ; OK to proceed Y/N
+1 NEW DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
WRITE !!
+2 SET DIR("A")="Do you wish to continue: "
SET DIR("B")="YES"
+3 SET DIR("?")="Answer Yes or No"
SET DIR("??")="^D PROH^LEXDFST"
+4 SET DIR(0)="YAO"
DO ^DIR
SET LEXX=Y
QUIT LEXX
PROH ; Proceed help
+1 WRITE !!,?2,"Answer"
+2 WRITE !!,?4,"Yes Continue to build a filter based on Semantic Types"
+3 WRITE !,?4,"No Exit without building a filter",!
QUIT
ASSEM ; Assemble the return value FILTER^NAME
+1 NEW LEXNAM,LEXFIL
SET (LEXNAM,LEXFIL)=""
SET LEXFIL=$PIECE(LEXX,"^",1)
+2 IF $LENGTH($GET(LEXFIL))
SET LEXFIL="I $$SC^LEXU(Y,"_""""_LEXFIL_""""_")"
+3 IF LEXFIL[U
SET LEXNAM=$$NAME^LEXDM3
IF LEXNAM="^^"
SET LEXX="^^"
+4 if LEXX["^^"
SET LEXFIL=""
SET LEXNAM="^"
SET LEXX=LEXFIL_"^"_LEXNAM
QUIT