XTLKKWL ; IHS/OHPRD/ACC,ALB/JLU,SFISC/JC - LOOKUP DRIVER PROGRAM FOR "AND"ING INVERTED SEARCH ;07/22/93  15:46
 ;;7.3;TOOLKIT;;Apr 25, 1995
 ; ASSUMES XTLKKSCH("TYPE"),("GBL"),("INDEX") AND XTLKX
 S XTLKXSAV=XTLKX
 K Y
 S XTLKGBL=XTLKKSCH("GBL"),XTLKL=XTLKX
 S XTLKASK=$S('$D(DIC(0)):1,DIC(0)["E":1,1:0)
 I $G(XTLKSAY)="" S XTLKSAY=1
INIT I XTLKGBL'["^",XTLKGBL'?1N.N,XTLKGBL'?1N.N1"."1N.N S XTLKGBL=$O(^DIC("B",XTLKGBL,""))
 S:XTLKGBL'["^" XTLKGBL=^DIC(XTLKGBL,0,"GL")
 S XTLKREF=XTLKGBL_""""_XTLKKSCH("INDEX")_""",XTLKWD)"
 S XTLKREF1=XTLKGBL
 S XTLKREF2=$E(XTLKREF,1,$L(XTLKREF)-1)_","""")"
 S XTLKREF3=XTLKGBL_"^TMP(""XTLKHITS"",$J,XTLKH),0)"
 S XTLKREF4=$E(XTLKREF,1,$L(XTLKREF)-1)_",XTLKD)"
 ; NOTE: CHKSHRT HAS BEEN CHANGED TO USE "AB" BECAUSE THE
 ;       B INDEX NO LONGER EXISTS FOR ICD FILES -- NEEDS TO
 ;       BE IMPROVED TO PRESERVE GENERALITY OF LOOKUP!!!
CHKSHRT G:'$D(^XT(8984.2,"AC",$P(XTLKREF1,U,2),XTLKL)) NOTSHRT S XTLKI=$O(^(XTLKL,"")),XTLKL=$P($P(^XT(8984.2,XTLKI,0),U,2),";") S Y=$S(XTLKREF1'[$P($P(^XT(8984.2,XTLKI,0),U,2),";",2):-1,$D(@(XTLKREF1_"XTLKL,0)")):XTLKL,1:-1)
 G:Y<1 NOTSHRT
 I $D(@(XTLKREF1_"Y,0)")) X:$D(DIC("S")) DIC("S") E  S Y=-1
 G:Y<1 NOTSHRT
 K ^TMP("XTLKHITS",$J) S ^TMP("XTLKHITS",$J)=1,^TMP("XTLKHITS",$J,1)=Y G VERIFY
NOTSHRT ;
 G NOTSHRT^XTLKKWL1
VERIFY ;
 G VERIFY^XTLKKWL1
