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

AICDADK.m

Go to the documentation of this file.
AICDADK ; IHS/OHPRD/ACC - ADD KEYWORDS TO "OTHER KEYWORDS" FIELD IN ^ICD0/9 ;
 ;;3.51;IHS ICD/CPT lookup & grouper;;MAY 30, 1991
 W !!,*7,"AICDADK CANNOT BE ENTERED AT THE TOP -- USE DX OR OP",!!
 Q
DX S AICDGBL="^ICD9"
 G INIT
OP S AICDGBL="^ICD0"
INIT D ^%AUKVAR S AICDBB=$C(7),AICDFLD="9999999.21",AICDLAST=""
 S AICDNWS=^DD("KWIC")_"IN^OF^AN^IS^AS^AT^IF^IT^ON^OR^BY^"
 W "- - - Add keywords to ",$P(@AICDGBL@(0),U,1)," ""OTHER KEYWORDS"" field - - -",!!
MAINLP F AICDQ=0:0 R "Code: ",AICDCODE:DTIME S:'$T AICDCODE=U Q:U[AICDCODE  S:AICDCODE=" " AICDCODE=AICDLAST S AICDLAST=AICDCODE D GCODE
 W !
 K AICDCODE,AICDNUMB,AICDBB,AICDFLD,AICDGBL,AICDSQN,AICDCNT,AICDDFN,AICDCDFN,AICDL,AICDNW,AICDWT,AICDWD,AICDWC,AICDWF,AICDWSV,AICDWS,AICDW,AICDNWS,AICDQ,AICDI,AICDA,AICDLAST,AICDEXEC
 W !,"B y e . . .",!
 Q
 ;
GCODE ; GOT CODE
 D CHKCODE^AICDADK1 I AICDCODE="" W AICDBB," -- Invalid ICD code format",! Q
 S AICDCDFN=""
 I $D(@AICDGBL@("AB",AICDCODE)) S AICDCDFN=$O(^(AICDCODE,"")) W "  ",@AICDGBL@(AICDCDFN,1),! S AICDNUMB=AICDCODE D GETKWD^AICDADK1,SET^AICDADK1 Q
 S AICDNUMB=$O(@AICDGBL@("BA",AICDCODE_" "))
 I $E(AICDNUMB,1,$L(AICDCODE))'=AICDCODE S AICDCODE="" W AICDBB," -- Code does not exist and has no more specific descendents.",! Q
 W !," Code does not exist as entered, but has descendents."
 R !," Do you wish to add keywords to the more specific subcodes? Y// ",AICDA:DTIME,! S:'$T AICDA=U
 Q:"Yy"'[$E(AICDA_"Y")
 D GETKWD^AICDADK1
 S AICDNUMB=AICDCODE
 I AICDCODE'=+AICDCODE D NONCON^AICDADK1 Q
 D CANONIC^AICDADK1
 Q