Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: AICDKWL

AICDKWL.m

Go to the documentation of this file.
AICDKWL ; IHS/OHPRD/ACC - LOOKUP DRIVER PROGRAM FOR "AND"ING INVERTED SEARCH ;
 ;;4.0;AICD;;DEC 03, 2014;Build 7
 ; ASSUMES AICDKSCH("TYPE"),("GBL"),("INDEX") AND AICDX
 ;IHS/CMI/LAB - CSV changed CHKSHRT to $$ICDDX
 S AICDXSAV=AICDX
 K Y
 S AICDT=AICDKSCH("TYPE"),AICDGBL=AICDKSCH("GBL"),AICDL=AICDX
 S AICDASK=$S('$D(DIC(0)):1,DIC(0)["E":1,1:0)
 I $D(^AICDKWLC("B",AICDT)) S AICDKWCT=$O(^AICDKWLC("B",AICDT,""))
 E  S AICDKWCT=0 W:AICDASK *7,"<WARNING: SYNONYM/REPLACEMENT TABLE MISSING>",!
INIT I AICDGBL'["^",AICDGBL'?1N.N,AICDGBL'?1N.N1"."1N.N S AICDGBL=$O(^DIC("B",AICDGBL,""))
 S:AICDGBL'["^" AICDGBL=^DIC(AICDGBL,0,"GL")
 S AICDREF=AICDGBL_""""_AICDKSCH("INDEX")_""",AICDWD)"
 S AICDREF1=AICDGBL
 S AICDREF2=$E(AICDREF,1,$L(AICDREF)-1)_","""")"
 S AICDREF3=AICDGBL_"^UTILITY(""AICDHITS"",$J,AICDH),0)"
 S AICDREF4=$E(AICDREF,1,$L(AICDREF)-1)_",AICDD)"
 ; 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:$L(AICDL)>40 NOTSHRT G:'$D(^AICDKWLC(AICDKWCT,3,"B",$E(AICDL,1,30))) NOTSHRT
 F AICDI=0:0 S AICDI=$O(^AICDKWLC(AICDKWCT,3,"B",$E(AICDL,1,30),AICDI)) Q:AICDI=""  Q:$P(^AICDKWLC(AICDKWCT,3,AICDI,0),U,1)=AICDL
 G:'AICDI NOTSHRT
 ;IHS/CMI/LAB - CSV commented line below and replaced
 ;S AICDL=$P(^AICDKWLC(AICDKWCT,3,AICDI,0),"^",2) S Y=$S($D(@(AICDREF1_"""AB"",AICDL)")):$O(^(AICDL,"")),1:-1)
 S AICDL=$P(^AICDKWLC(AICDKWCT,3,AICDI,0),"^",2) S Y=$P($$ICDDX^ICDCODE(AICDL,,,1),"^")
 G:Y<1 NOTSHRT
 I $D(@(AICDREF1_"Y,0)")) X:$D(DIC("S")) DIC("S") E  S Y=-1
 G:Y<1 NOTSHRT
 K ^UTILITY("AICDHITS",$J) S ^UTILITY("AICDHITS",$J)=1,^UTILITY("AICDHITS",$J,1)=Y G VERIFY
NOTSHRT ;
 G NOTSHRT^AICDKWL1
VERIFY ;
 G VERIFY^AICDKWL1