source: FOIAVistA/tag/r/TOOLKIT-AWCM-XD-XIN-XPAR-XQAB-XT-XUC-XUR-ZIN-ZTED/XTLKKWL1.m@ 1424

Last change on this file since 1424 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 3.5 KB
Line 
1XTLKKWL1 ; IHS/ISC STAFF/JC-PART 2 OF LOOKUP CONTROL PROGRAM FOR "AND"ING INVERTED SEARCH ;01/20/95 10:27
2 ;;7.3;TOOLKIT;;Apr 25, 1995
3NOTSHRT D ^XTLKTOKN
4 K XTLKWORD,XTLKDFN,XTLKAWRD,XTLKADFN,XTLKNUSE S XTLKNUSE=0
5 D PREPSCH^XTLKKWL2
6 I XTLKNWDS=0 W:XTLKSAY=1 "MTLU found no usable words.",! G:'XTLKNUSE NOTSHRTX
7 I XTLKNUSE>0 W:XTLKSAY=1 !,"The following word",$S(XTLKNUSE=1:" was",1:"s were")," not used in this search:",! S XTLKWD="" F XTLKQ=0:0 S XTLKWD=$O(XTLKNUSE(XTLKWD)) Q:XTLKWD="" W:XTLKSAY=1 ?5,XTLKWD,!
8NOTSHRTX K XTLKNUSE
9 K ^TMP("XTLKHITS",$J) S ^TMP("XTLKHITS",$J)=0 D:XTLKNWDS ^XTLKKSCH
10 I ^TMP("XTLKHITS",$J)=0 S Y=-1 D EXIT Q
11VERIFY ;
12 S:'XTLKASK Y=-1 N XTLKHELP
13 I XTLKSAY'=-1 D:XTLKASK ASKONE:^TMP("XTLKHITS",$J)=1,ASKSEL:^TMP("XTLKHITS",$J)>1
14 I $D(DTOUT)!($D(DUOUT))!($D(DIROUT)) S Y=-1 G EXIT
15 I +Y>0,$D(^DD(+$P(@(XTLKGBL_"0)"),U,2),0,"ACT")) X ^("ACT")
16 I +Y>0,$D(@(XTLKREF1_(+Y)_",0)"))#2 S Y=+Y_U_$P(^(0),U,1)
17EXIT ;
18 K ^TMP($J,"ADFN"),^TMP($J,"AWRD")
19 K XTLKWD,XTLKNWDS,XTLKKWCT,XTLKI,XTLKQ,XTLKHLP
20 K XTLKREF,XTLKREF0,XTLKREF1,XTLKREF2,XTLKREF3,XTLKREF4
21 K XTLKGBL,XTLKT,XTLKL,XTLKASK,XTLKPC
22 S X=XTLKXSAV K XTLKXSAV
23 Q
24 ;
25ASKONE ; ASK IF SINGLE HIT IS ACCEPTABLE
26 ;;;G:@(XTLKKSCH("GBL")_"0)")'["O" ASKONEX
27 S XTLKH=1,XTLKMULT=0
28 I XTLKSAY'=-1 D
29 .W !
30 .D DSPLY S Y=-1
31 .N DIR S DIR("?")="^D XHELP^XTLKKWL1",DIR(0)="Y",DIR("A")=" OK",DIR("B")="Y" D ^DIR K DIR
32 I $D(DTOUT)!($D(DUOUT))!($D(DIROUT))!(Y=0) S Y=-1 D ASKONEX Q
33 I $D(^TMP("XTLKHITS",$J)) S X=$O(^($J,0)) I +X S Y=^(X) I $D(DIC(0))#2,DIC(0)["Z" S Y(0)=@XTLKREF3
34ASKONEX K XTLKH,XTLKMULT,XTLKDESC,XTLKF
35 Q
36 ;
37ASKSEL ; ASK FOR SELECTION AMONG HITS
38 Q:XTLKSAY=-1
39 W !!,"The following ",^TMP("XTLKHITS",$J)," matches were found:",!!
40 S XTLKMULT=1,XTLKGRP=1
41DSPGRP S XTLKH2=$S((XTLKGRP+4)'>^TMP("XTLKHITS",$J):XTLKGRP+4,1:^TMP("XTLKHITS",$J))
42 F XTLKH=XTLKGRP:1:XTLKH2 D DSPLY
43 N DIR
44 S DIR("A")="Press <RET> or Select 1-"_XTLKH_": "
45 S DIR("?")="^D XHELP^XTLKKWL1"
46 S DIR(0)="FAO" D ^DIR K DIR W !
47 I X?1"^"1N.N K DUOUT
48 I $D(DTOUT)!($D(DUOUT))!($D(DIROUT)) S Y=-1 D EXSEL Q
49 I X["?" D XHELP G DSPGRP
50 I X="" S XTLKGRP=$S((XTLKGRP+5)'>^TMP("XTLKHITS",$J):XTLKGRP+5,1:0) G:XTLKGRP DSPGRP I 'XTLKGRP S Y=-1 D EXSEL Q
51 I X="-" S XTLKGRP=$S(XTLKGRP'=1:XTLKGRP-5,1:^TMP("XTLKHITS",$J)-1\5*5+1) G DSPGRP
52 I X?1"^"1N.N S XTLKI=($E(X,2,255)-1)\5*5+1 I XTLKI'>^TMP("XTLKHITS",$J) S XTLKGRP=XTLKI G DSPGRP
53 I X?1"^"1N.N S XTLKI=($E(X,2,255)-1)\5*5+1 I XTLKI>^TMP("XTLKHITS",$J) S XTLKHELP=$S('$D(XTLKHLP):"W $C(7) D SELQ",1:XTLKHLP) X XTLKHELP G DSPGRP
54 G:'$D(^TMP("XTLKHITS",$J,X)) DSPGRP
55 S XTLKH=X,Y=^TMP("XTLKHITS",$J,XTLKH) I $D(DIC(0))#2,DIC(0)["Z" S Y(0)=@XTLKREF3
56EXSEL K XTLKH,XTLKMULT,XTLKH2,XTLKGRP,XTLKDESC,XTLKF
57 Q
58 ;
59DSPLY ; DISPLAY CODE AND TEXT
60 Q:XTLKSAY=-1
61 S (Y,XTLKI)=^TMP("XTLKHITS",$J,XTLKH)
62 S XTLKREF0=XTLKREF1_XTLKI_",0)"
63 I $D(XTLKKSCH("DSPLY")) D @XTLKKSCH("DSPLY") Q
64 W:XTLKMULT $J(XTLKH,4),": "
65 W $P(@(XTLKREF1_"XTLKI,0)"),"^",1),!
66 S XTLKDESC="<display protocol not provided>"
67DSPDESC F XTLKPC=0:0 Q:XTLKDESC="" D GETFRAG W:XTLKMULT ?7 W XTLKF,!
68 W !
69 K XTLKC,XTLKF
70 Q
71GETFRAG I $L(XTLKDESC)<72 S XTLKF=XTLKDESC,XTLKDESC="" Q
72 F XTLKC=73:-1:1 Q:$E(XTLKDESC,XTLKC)=" "
73 S XTLKF=$E(XTLKDESC,1,XTLKC-1),XTLKDESC=$E(XTLKDESC,XTLKC+1,255)
74 Q
75XHELP ;
76 I X["?" S XTLKHELP=$S('$D(XTLKHLP):"W $C(7) D SELQ",1:XTLKHLP) X XTLKHELP
77 Q
78SELQ W !,"Answer with a number from 1 to ",XTLKH," or"
79 W !,"'^' to quit the MTLU search and attempt a FILEMAN search, or"
80 W !,"'^^' to quit and return to your menu, or"
81 W !,"'^#' if you want to jump to any of the ",^TMP("XTLKHITS",$J)," allowable choices.",!
82 Q
Note: See TracBrowser for help on using the repository browser.