ATXTAXO ; IHS/CMI/LAB - EXTENSION OF ROUTINE ATXCODE ;
;;5.1;TAXONOMY;**11**;FEB 04, 1997;Build 48
;
;cmi/anch/maw 9/12/2007 code set versioning in LOOK
;
LOOK ; ENTRY POINT - LOOKUP USER RESPONSE; SET UTILITY NODES
S DIC="^ICPT(",DIC(0)="EMF" D ^DIC K DIC,DR
I Y<0 S ATXA=1 W $C(7)," ??" S ATX("NO DISPLAY")=1 G X3
;S:ATXTYP="LOW" ATX("LOW")=$P(^ICPT(+Y,0),U)_" " ;cmi/anch/maw 9/12/2007 orig line
S:ATXTYP="LOW" ATX("LOW")=$P($$CPT^ICPTCOD(+Y),U,2)_" " ;cmi/anch/maw 9/12/2007 csv
I ATXTYP="LOW",ATXONE S ATX("HI")=ATX("LOW") D ^ATXTAXN
;I ATXTYP="HI" S ATX("HI")=$P(^ICPT(+Y,0),U)_" " D I 'ATX("NO DISPLAY") D DISPLAY^ATXTAXM,^ATXTAXN ;cmi/anch/maw 9/12/2007 orig line
I ATXTYP="HI" S ATX("HI")=$P($$CPT^ICPTCOD(+Y),U,2)_" " D I 'ATX("NO DISPLAY") D DISPLAY^ATXTAXM,^ATXTAXN ;cmi/anch/maw 9/12/2007 csv
. I $E(ATX("HI"))?1N&($E(ATX("LOW"))?1N)!($E(ATX("LOW"))'?1N&($E(ATX("HI"))'?1N))
. E W !,$C(7),"Low and high codes of range must both start either with a letter or a number.",! S ATX("NO DISPLAY")=1
. I 'ATX("NO DISPLAY") I ATX("LOW")]ATX("HI") W !,$C(7),"Low code is higher than high code.",! S ATX("NO DISPLAY")=1
X3 Q
;
SETDIR ; ENTRY POINT - SETS HELP AND DIR FOR INIT SUBROUTINE OF ATXCODE
S DIR(0)="FO",DIR("?",1)="Enter cpt code or narrative. You may enter a range of",DIR("?",2)="codes by placing a ""-"" between two codes. Codes in a range will"
S DIR("?",3)="include the first and last codes indicated and all codes that fall",DIR("?",4)="between. Only one code or one range of codes at a time. You may"
S DIR("?",5)="also enter ""[TAXONOMY NAME"" to select codes already within a taxonomy."
S DIR("?",6)="You can also ""de-select"" a code or range of codes by placing a ""-"" in",DIR("?",7)="front of it. (e.g. '-250.00' or '-250.01-250.91') Enter ""??"" to see"
S DIR("?")="code ranges selected so far."
S DIR("??")="^D ASK2^ATXTAX0"
Q
;
ASK2 ;ASKS USER IF WANTS TO DISPLAY/PRINT RESULTS TO THIS POINT
I '$D(ATXTBLE) W !!,"A code range has yet to be selected. A display cannot be generated.",! Q
W !!,"Do you want to display the codes from a range you have already selected" S %=1 D YN^DICN I %=1 D SHOW^ATXTAXM
I %=2!(%=-1) Q
I %=0 W !!,"A table of ranges you have selected is displayed above. You may ask for the",!,"codes in one of the ranges to be displayed.",! G ASK2
Q
;
ATXTAXO ; IHS/CMI/LAB - EXTENSION OF ROUTINE ATXCODE ;
+1 ;;5.1;TAXONOMY;**11**;FEB 04, 1997;Build 48
+2 ;
+3 ;cmi/anch/maw 9/12/2007 code set versioning in LOOK
+4 ;
LOOK ; ENTRY POINT - LOOKUP USER RESPONSE; SET UTILITY NODES
+1 SET DIC="^ICPT("
SET DIC(0)="EMF"
DO ^DIC
KILL DIC,DR
+2 IF Y<0
SET ATXA=1
WRITE $CHAR(7)," ??"
SET ATX("NO DISPLAY")=1
GOTO X3
+3 ;S:ATXTYP="LOW" ATX("LOW")=$P(^ICPT(+Y,0),U)_" " ;cmi/anch/maw 9/12/2007 orig line
+4 ;cmi/anch/maw 9/12/2007 csv
IF ATXTYP="LOW"
SET ATX("LOW")=$PIECE($$CPT^ICPTCOD(+Y),U,2)_" "
+5 IF ATXTYP="LOW"
IF ATXONE
SET ATX("HI")=ATX("LOW")
DO ^ATXTAXN
+6 ;I ATXTYP="HI" S ATX("HI")=$P(^ICPT(+Y,0),U)_" " D I 'ATX("NO DISPLAY") D DISPLAY^ATXTAXM,^ATXTAXN ;cmi/anch/maw 9/12/2007 orig line
+7 ;cmi/anch/maw 9/12/2007 csv
IF ATXTYP="HI"
SET ATX("HI")=$PIECE($$CPT^ICPTCOD(+Y),U,2)_" "
Begin DoDot:1
+8 IF $EXTRACT(ATX("HI"))?1N&($EXTRACT(ATX("LOW"))?1N)!($EXTRACT(ATX("LOW"))'?1N&($EXTRACT(ATX("HI"))'?1N))
+9 IF '$TEST
WRITE !,$CHAR(7),"Low and high codes of range must both start either with a letter or a number.",!
SET ATX("NO DISPLAY")=1
+10 IF 'ATX("NO DISPLAY")
IF ATX("LOW")]ATX("HI")
WRITE !,$CHAR(7),"Low code is higher than high code.",!
SET ATX("NO DISPLAY")=1
End DoDot:1
IF 'ATX("NO DISPLAY")
DO DISPLAY^ATXTAXM
DO ^ATXTAXN
X3 QUIT
+1 ;
SETDIR ; ENTRY POINT - SETS HELP AND DIR FOR INIT SUBROUTINE OF ATXCODE
+1 SET DIR(0)="FO"
SET DIR("?",1)="Enter cpt code or narrative. You may enter a range of"
SET DIR("?",2)="codes by placing a ""-"" between two codes. Codes in a range will"
+2 SET DIR("?",3)="include the first and last codes indicated and all codes that fall"
SET DIR("?",4)="between. Only one code or one range of codes at a time. You may"
+3 SET DIR("?",5)="also enter ""[TAXONOMY NAME"" to select codes already within a taxonomy."
+4 SET DIR("?",6)="You can also ""de-select"" a code or range of codes by placing a ""-"" in"
SET DIR("?",7)="front of it. (e.g. '-250.00' or '-250.01-250.91') Enter ""??"" to see"
+5 SET DIR("?")="code ranges selected so far."
+6 SET DIR("??")="^D ASK2^ATXTAX0"
+7 QUIT
+8 ;
ASK2 ;ASKS USER IF WANTS TO DISPLAY/PRINT RESULTS TO THIS POINT
+1 IF '$DATA(ATXTBLE)
WRITE !!,"A code range has yet to be selected. A display cannot be generated.",!
QUIT
+2 WRITE !!,"Do you want to display the codes from a range you have already selected"
SET %=1
DO YN^DICN
IF %=1
DO SHOW^ATXTAXM
+3 IF %=2!(%=-1)
QUIT
+4 IF %=0
WRITE !!,"A table of ranges you have selected is displayed above. You may ask for the",!,"codes in one of the ranges to be displayed.",!
GOTO ASK2
+5 QUIT
+6 ;