- LEXNDX5 ;ISL/KER - Set/kill indexes (Part 5) Link ;04/21/2014
- ;;2.0;LEXICON UTILITY;**80**;Sep 23, 1996;Build 1
- ;
- ; Global Variables
- ; None
- ;
- ; External References
- ; YN^DICN ICR 10009
- ; ^DIR ICR 10026
- ;
- EXCL ; Is a term used with an "Exclusive" meaning?
- Q:'$D(LEXREP)!('$D(LEXBY))
- S LEXEXCL=1 I $D(^LEX(757.01,"AWRD",LEXREP)) D
- . W !,LEXREP," is used as follows: ",!
- . S (LEXCTR,LEXREC)=0 F S LEXREC=$O(^LEX(757.01,"AWRD",LEXREP,LEXREC)) Q:+LEXREC=0 D
- . . S LEXCTR=LEXCTR+1 W !,$J(LEXCTR,4),": ",^LEX(757.01,LEXREC,0)
- . . I LEXCTR#16=0 D CONT
- ASKEX . ; Ask, "is it exclusive?"
- . W !!,"Based on the reference",$S(LEXCTR>1:"s",1:"")," shown above, does ",LEXREP
- . W !,"exclusively refer to ",LEXBY
- ASKEX2 . ; Get response
- . S %=2 D YN^DICN S LEXEXCL=$S(%=2:0,%=-1:0,1:%) Q:%'=0
- . I '% D EXCLHLP G ASKEX2
- . G ASKEX
- Q
- EXCLHLP ; Help to decide if the term use is "Exclusive"
- W !!,"If ",LEXREP," exclusively refers to ",LEXBY,", answer"
- W !,"""Yes"" and ",LEXREP," will always be replaced by",LEXBY,"."
- W !!,"If ",LEXREP," refers to concepts other than",LEXBY,", answer"
- W !,"""No"" and begin linking ",LEXREP," to ",LEXBY," (in each"
- W !,"occurrence where the two terms have the same meaning)"
- W !!,"Is ",LEXREP," used exclusively"
- Q
- CONT ; Continue?
- W ! N X,Y,DTOUT,DUOUT,DIRUT,DIROUT S DIR("A")="Press <Return> to continue ",DIR("?")="Additional information is available, press <Return> to continue ",DIR(0)="EA" D ^DIR K DIR W ! Q
- ANYWAY ; Term was not found, ask to link the term anyway
- Q:'$D(LEXREP)!('$D(LEXBY)) Q:$D(^LEX(757.01,"AWRD",LEXREP)) N LEXANYW S LEXEXCL=0
- W !!,LEXREP," was not found in the Lexicon"
- ANY2 ; Get response
- W !,"Do you wish to link ",LEXREP," to terms",!,"containing ",LEXBY
- S %=1,LEXEXCL=0 D YN^DICN S:%=-1!(%=2) LEXEXCL=1 Q:%'=0
- I '% D ANYHLP G ANY2
- W ! G ANY2
- ANYHLP ; Help to decide whether to continue with the linkage
- W !!,"Linking ",LEXREP," to ",LEXREP," will cause the "
- W !,"look-up to include all linked occurences of ",LEXREP
- W !,"to be listed when searching for ",LEXREP,!
- Q
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLEXNDX5 2189 printed Feb 18, 2025@23:34:21 Page 2
- LEXNDX5 ;ISL/KER - Set/kill indexes (Part 5) Link ;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 ; YN^DICN ICR 10009
- +8 ; ^DIR ICR 10026
- +9 ;
- EXCL ; Is a term used with an "Exclusive" meaning?
- +1 if '$DATA(LEXREP)!('$DATA(LEXBY))
- QUIT
- +2 SET LEXEXCL=1
- IF $DATA(^LEX(757.01,"AWRD",LEXREP))
- Begin DoDot:1
- +3 WRITE !,LEXREP," is used as follows: ",!
- +4 SET (LEXCTR,LEXREC)=0
- FOR
- SET LEXREC=$ORDER(^LEX(757.01,"AWRD",LEXREP,LEXREC))
- if +LEXREC=0
- QUIT
- Begin DoDot:2
- +5 SET LEXCTR=LEXCTR+1
- WRITE !,$JUSTIFY(LEXCTR,4),": ",^LEX(757.01,LEXREC,0)
- +6 IF LEXCTR#16=0
- DO CONT
- End DoDot:2
- ASKEX ; Ask, "is it exclusive?"
- +1 WRITE !!,"Based on the reference",$SELECT(LEXCTR>1:"s",1:"")," shown above, does ",LEXREP
- +2 WRITE !,"exclusively refer to ",LEXBY
- ASKEX2 ; Get response
- +1 SET %=2
- DO YN^DICN
- SET LEXEXCL=$SELECT(%=2:0,%=-1:0,1:%)
- if %'=0
- QUIT
- +2 IF '%
- DO EXCLHLP
- GOTO ASKEX2
- +3 GOTO ASKEX
- End DoDot:1
- +4 QUIT
- EXCLHLP ; Help to decide if the term use is "Exclusive"
- +1 WRITE !!,"If ",LEXREP," exclusively refers to ",LEXBY,", answer"
- +2 WRITE !,"""Yes"" and ",LEXREP," will always be replaced by",LEXBY,"."
- +3 WRITE !!,"If ",LEXREP," refers to concepts other than",LEXBY,", answer"
- +4 WRITE !,"""No"" and begin linking ",LEXREP," to ",LEXBY," (in each"
- +5 WRITE !,"occurrence where the two terms have the same meaning)"
- +6 WRITE !!,"Is ",LEXREP," used exclusively"
- +7 QUIT
- CONT ; Continue?
- +1 WRITE !
- NEW X,Y,DTOUT,DUOUT,DIRUT,DIROUT
- SET DIR("A")="Press <Return> to continue "
- SET DIR("?")="Additional information is available, press <Return> to continue "
- SET DIR(0)="EA"
- DO ^DIR
- KILL DIR
- WRITE !
- QUIT
- ANYWAY ; Term was not found, ask to link the term anyway
- +1 if '$DATA(LEXREP)!('$DATA(LEXBY))
- QUIT
- if $DATA(^LEX(757.01,"AWRD",LEXREP))
- QUIT
- NEW LEXANYW
- SET LEXEXCL=0
- +2 WRITE !!,LEXREP," was not found in the Lexicon"
- ANY2 ; Get response
- +1 WRITE !,"Do you wish to link ",LEXREP," to terms",!,"containing ",LEXBY
- +2 SET %=1
- SET LEXEXCL=0
- DO YN^DICN
- if %=-1!(%=2)
- SET LEXEXCL=1
- if %'=0
- QUIT
- +3 IF '%
- DO ANYHLP
- GOTO ANY2
- +4 WRITE !
- GOTO ANY2
- ANYHLP ; Help to decide whether to continue with the linkage
- +1 WRITE !!,"Linking ",LEXREP," to ",LEXREP," will cause the "
- +2 WRITE !,"look-up to include all linked occurences of ",LEXREP
- +3 WRITE !,"to be listed when searching for ",LEXREP,!
- +4 QUIT