IBDFLST ;ALM/MAF - Maintenance Utility Invalid Codes List - MAY 17 1995
;;3.0;AUTOMATED INFO COLLECTION SYS;**9,38**;APR 24, 1997
;
;
START ; -- Ask what invalid code you want to display CPT/ ICD9/ Visit
N IBDFDIS
D FULL^VALM1
S DIR("B")="CPT",DIR(0)="SBM^C:CPT;I:ICD9;V:VISIT",DIR("A")="Display invalid codes for [C]PT, [I]CD9, [V]ISIT" D ^DIR
K DIR I $D(DIRUT)!(Y<0) G QUIT
;W !!,"Display invalid codes for CPT// " D ZSET1^IBDFLST1 S X="" R X:DTIME G QUIT:X="^"!('$T) I X=""!("Cc"[X) S X="1"
S X=$S("Ii"[X:2,"Vv"[X:3,1:1)
;I X="?" D ZSET1^IBDFLST1,HELP1^IBDFLST1 G START
S IBDFTYP=$E(X) ; D IN^DGHELP W ! I %=-1 D ZSET1^IBDFLST1,HELP1^IBDFLST1 G START
S IBDFDIS=$S(IBDFTYP=1:"CPT",IBDFTYP=2:"ICD9",IBDFTYP=3:"VISIT",1:"QUIT")
D WAIT^DICD
D EN^VALM("IBDF UTIL COMPLETE LIST TEMP")
Q
;
;
HDR ; -- header code
S VALMHDR(1)="This screen displays the most current invalid codes for the "_IBDFDIS_" file."
Q
;
;
SETSTR(S,V,X,L) ; -- insert text(S) into variable(V)
; S := string
; V := destination
; X := @ col X
; L := # of chars
;
Q $E(V_$J("",X-1),1,X-1)_$E(S_$J("",L),1,L)_$E(V,X+L,999)
;
;
INIT ; -- Set up list for display
N IBDFCODE,IBDFDESC,IBDFIFN,IBDFCAT
S (IBDCNT,VALMCNT,IBDCNT1)=0
D @(IBDFDIS)
Q
;
; -- Gets CPT listing of invalid codes
CPT D FULL^VALM1 F IBDFIFN=0:0 S IBDFIFN=$O(^ICPT(IBDFIFN)) Q:'IBDFIFN D
.;; --change to api cpt ; dhh
.;; --note: 7th piece is status 0-inactive 1-active
. S IBDFNODE=$$CPT^ICPTCOD(IBDFIFN),IBDFNODE=$G(IBDFNODE)
. I $P(IBDFNODE,"^",7)=0 D
.. S IBDFCODE=$P(IBDFNODE,"^",2),IBDFDESC=$P(IBDFNODE,"^",3)
.. S IBDFCAT=$S($P(IBDFNODE,"^",4)]"":$P(^DIC(81.1,$P(IBDFNODE,"^",4),0),"^",1),1:"UNKNOWN") D ALPHA
D LOOP
Q
;
; -- Gets ICD9 listing onf invalid codes
ICD9 F IBDFIFN=0:0 S IBDFIFN=$O(^ICD9(IBDFIFN)) Q:'IBDFIFN S IBDFNODE=$G(^ICD9(IBDFIFN,0)) I $P(IBDFNODE,"^",9)]"" D
.S IBDFCODE=$P(IBDFNODE,"^",1),IBDFDESC=$P(IBDFNODE,"^",3),IBDFCAT=$S($P(IBDFNODE,"^",5)]""&($G(^ICM(+$P(IBDFNODE,"^",5),0))]""):$P(^ICM($P(IBDFNODE,"^",5),0),"^",1),1:"UNKNOWN") D ALPHA
D LOOP
Q
;
;
VISIT ; -- Gets visit code listing of invalid codes
N IEN
F IBDFVST=0:0 S IBDFVST=$O(^IBE(357.69,"B",IBDFVST)) Q:'IBDFVST D
. S IEN=$O(^IBE(357.69,"B",IBDFVST,0))
. Q:'IEN
. S IBDFNODE=$$CPT^ICPTCOD(IBDFVST)
. Q:+IBDFNODE=-1
. S IBDFIFN=+IBDFNODE
. S IBDFCODE=$P(IBDFNODE,"^",2)
. S IBDFDESC=$P(IBDFNODE,"^",3)
. S IBDFCAT=$S($P(IBDFNODE,"^",4)]"":$P(^DIC(81.1,$P(IBDFNODE,"^",4),0),"^",1),1:"UNKNOWN")
. D ALPHA
D LOOP
Q
;
;
LOOP ; -- Loop thru global ^TMP("ALPHA",$J) alphabetic by category
S IBDFCAT=0
F IBDCAT=0:0 S IBDFCAT=$O(^TMP("ALPHA",$J,IBDFCAT)) Q:IBDFCAT']"" F IBDFIFN=0:0 S IBDFIFN=$O(^TMP("ALPHA",$J,IBDFCAT,IBDFIFN)) Q:'IBDFIFN S IBDFNODE=$G(^TMP("ALPHA",$J,IBDFCAT,IBDFIFN)) D
.S IBDFIFN=$P(IBDFNODE,"^",1)
.S IBDFCODE=$P(IBDFNODE,"^",2)
.S IBDFCAT=$P(IBDFNODE,"^",3)
.S IBDFDESC=$P(IBDFNODE,"^",4)
.D:'$D(IBDFC(IBDFCAT)) HEADER^IBDFLST1 D SET
Q
;
;
SET ; -- Set up list array
S IBDCNT1=IBDCNT1+1
S IBDCNT=IBDCNT+1,VALMCNT=VALMCNT+1
S X=""
S IBDFVAL=$J(IBDCNT1_")",5)
S X=$$SETSTR(IBDFVAL,X,1,5)
S IBDFVAL=IBDFCODE
S X=$$SETSTR(IBDFVAL,X,7,8)
S IBDFVAL=IBDFDESC
S X=$$SETSTR(IBDFVAL,X,17,20)
S IBDFVAL=IBDFCAT
S X=$$SETSTR(IBDFVAL,X,39,20)
;
;
TMP ; -- Set up Array
S ^TMP("CODE",$J,IBDCNT,0)=$$LOWER^VALM1(X),^TMP("CODE",$J,"IDX",VALMCNT,IBDCNT1)=""
S ^TMP("CODEIDX",$J,IBDCNT1)=VALMCNT_"^"_IBDFIFN_"^"_IBDFCODE_"^"_IBDFCAT_"^"_IBDFDESC
Q
;
;
ALPHA ; - Alphabetize by category
S ^TMP("ALPHA",$J,IBDFCAT,IBDFIFN)=IBDFIFN_"^"_IBDFCODE_"^"_IBDFCAT_"^"_IBDFDESC
Q
;
;
QUIT ; -- Kill variables and reset to last display if no change has been taken place.
;
;
EXIT K ^TMP("CODE",$J),^TMP("CODEIDX",$J),^TMP("ALPHA",$J)
K IBDFC,IBDFTYP,IBDFCNT1,IBDCAT
Q
;
;
JUMP ; -- Jump action to display a specific category on the screen.
D FULL^VALM1
I $D(XQORNOD(0)),$P(XQORNOD(0),"^",4)]"" S X=$P(XQORNOD(0),"^",4) S X=$P(X,"=",2) I X]"" D:X?1.6N JSEL S DIC=$S(IBDFDIS="ICD9":"^ICM(",1:"^DIC(81.1,"),DIC(0)="QEZ" D ^DIC K DIC G:Y<0 JMP S Y=+Y D JUMP1 Q
JMP S DIC=$S(IBDFDIS="ICD9":"^ICM(",1:"^DIC(81.1,"),DIC(0)="AEMN",DIC("A")="Select "_$S(IBDFDIS="ICD9":"ICD9",1:"CPT")_" category you wish to move to: "
D ^DIC K DIC
I X["^" S VALMBG=1,VALMBCK="R" Q
;
;
JUMP1 I Y<0 G JUMP
N IBDFCAT
S IBDFCAT=$S(IBDFDIS="ICD9":$P(^ICM(+Y,0),"^",1),1:$P(^DIC(81.1,+Y,0),"^",1))
I '$D(IBDFC(IBDFCAT)) W !!,"There is no data listed for this Clinic Group" G JMP
S VALMBG=+IBDFC(IBDFCAT) S VALMBCK="R" Q
Q
;
;
JSEL ; -- Convert number selected to name
S IBDVALM=X I $D(^TMP("CGIDX",$J,IBDVALM)) S X=$P(^TMP("CGIDX",$J,IBDVALM),"^",2),X=$P(^IBD(357.99,X,0),"^",1)
Q
HLP ; -- help code
S X="?" D DISP^XQORM1 W !!
Q
;
IBDFLST ;ALM/MAF - Maintenance Utility Invalid Codes List - MAY 17 1995
+1 ;;3.0;AUTOMATED INFO COLLECTION SYS;**9,38**;APR 24, 1997
+2 ;
+3 ;
START ; -- Ask what invalid code you want to display CPT/ ICD9/ Visit
+1 NEW IBDFDIS
+2 DO FULL^VALM1
+3 SET DIR("B")="CPT"
SET DIR(0)="SBM^C:CPT;I:ICD9;V:VISIT"
SET DIR("A")="Display invalid codes for [C]PT, [I]CD9, [V]ISIT"
DO ^DIR
+4 KILL DIR
IF $DATA(DIRUT)!(Y<0)
GOTO QUIT
+5 ;W !!,"Display invalid codes for CPT// " D ZSET1^IBDFLST1 S X="" R X:DTIME G QUIT:X="^"!('$T) I X=""!("Cc"[X) S X="1"
+6 SET X=$SELECT("Ii"[X:2,"Vv"[X:3,1:1)
+7 ;I X="?" D ZSET1^IBDFLST1,HELP1^IBDFLST1 G START
+8 ; D IN^DGHELP W ! I %=-1 D ZSET1^IBDFLST1,HELP1^IBDFLST1 G START
SET IBDFTYP=$EXTRACT(X)
+9 SET IBDFDIS=$SELECT(IBDFTYP=1:"CPT",IBDFTYP=2:"ICD9",IBDFTYP=3:"VISIT",1:"QUIT")
+10 DO WAIT^DICD
+11 DO EN^VALM("IBDF UTIL COMPLETE LIST TEMP")
+12 QUIT
+13 ;
+14 ;
HDR ; -- header code
+1 SET VALMHDR(1)="This screen displays the most current invalid codes for the "_IBDFDIS_" file."
+2 QUIT
+3 ;
+4 ;
SETSTR(S,V,X,L) ; -- insert text(S) into variable(V)
+1 ; S := string
+2 ; V := destination
+3 ; X := @ col X
+4 ; L := # of chars
+5 ;
+6 QUIT $EXTRACT(V_$JUSTIFY("",X-1),1,X-1)_$EXTRACT(S_$JUSTIFY("",L),1,L)_$EXTRACT(V,X+L,999)
+7 ;
+8 ;
INIT ; -- Set up list for display
+1 NEW IBDFCODE,IBDFDESC,IBDFIFN,IBDFCAT
+2 SET (IBDCNT,VALMCNT,IBDCNT1)=0
+3 DO @(IBDFDIS)
+4 QUIT
+5 ;
+6 ; -- Gets CPT listing of invalid codes
CPT DO FULL^VALM1
FOR IBDFIFN=0:0
SET IBDFIFN=$ORDER(^ICPT(IBDFIFN))
IF 'IBDFIFN
QUIT
Begin DoDot:1
+1 ;; --change to api cpt ; dhh
+2 ;; --note: 7th piece is status 0-inactive 1-active
+3 SET IBDFNODE=$$CPT^ICPTCOD(IBDFIFN)
SET IBDFNODE=$GET(IBDFNODE)
+4 IF $PIECE(IBDFNODE,"^",7)=0
Begin DoDot:2
+5 SET IBDFCODE=$PIECE(IBDFNODE,"^",2)
SET IBDFDESC=$PIECE(IBDFNODE,"^",3)
+6 SET IBDFCAT=$SELECT($PIECE(IBDFNODE,"^",4)]"":$PIECE(^DIC(81.1,$PIECE(IBDFNODE,"^",4),0),"^",1),1:"UNKNOWN")
DO ALPHA
End DoDot:2
End DoDot:1
+7 DO LOOP
+8 QUIT
+9 ;
+10 ; -- Gets ICD9 listing onf invalid codes
ICD9 FOR IBDFIFN=0:0
SET IBDFIFN=$ORDER(^ICD9(IBDFIFN))
IF 'IBDFIFN
QUIT
SET IBDFNODE=$GET(^ICD9(IBDFIFN,0))
IF $PIECE(IBDFNODE,"^",9)]""
Begin DoDot:1
+1 SET IBDFCODE=$PIECE(IBDFNODE,"^",1)
SET IBDFDESC=$PIECE(IBDFNODE,"^",3)
SET IBDFCAT=$SELECT($PIECE(IBDFNODE,"^",5)]""&($GET(^ICM(+$PIECE(IBDFNODE,"^",5),0))]""):$PIECE(^ICM($PIECE(IBDFNODE,"^",5),0),"^",1),1:"UNKNOWN")
DO ALPHA
End DoDot:1
+2 DO LOOP
+3 QUIT
+4 ;
+5 ;
VISIT ; -- Gets visit code listing of invalid codes
+1 NEW IEN
+2 FOR IBDFVST=0:0
SET IBDFVST=$ORDER(^IBE(357.69,"B",IBDFVST))
IF 'IBDFVST
QUIT
Begin DoDot:1
+3 SET IEN=$ORDER(^IBE(357.69,"B",IBDFVST,0))
+4 IF 'IEN
QUIT
+5 SET IBDFNODE=$$CPT^ICPTCOD(IBDFVST)
+6 IF +IBDFNODE=-1
QUIT
+7 SET IBDFIFN=+IBDFNODE
+8 SET IBDFCODE=$PIECE(IBDFNODE,"^",2)
+9 SET IBDFDESC=$PIECE(IBDFNODE,"^",3)
+10 SET IBDFCAT=$SELECT($PIECE(IBDFNODE,"^",4)]"":$PIECE(^DIC(81.1,$PIECE(IBDFNODE,"^",4),0),"^",1),1:"UNKNOWN")
+11 DO ALPHA
End DoDot:1
+12 DO LOOP
+13 QUIT
+14 ;
+15 ;
LOOP ; -- Loop thru global ^TMP("ALPHA",$J) alphabetic by category
+1 SET IBDFCAT=0
+2 FOR IBDCAT=0:0
SET IBDFCAT=$ORDER(^TMP("ALPHA",$JOB,IBDFCAT))
IF IBDFCAT']""
QUIT
FOR IBDFIFN=0:0
SET IBDFIFN=$ORDER(^TMP("ALPHA",$JOB,IBDFCAT,IBDFIFN))
IF 'IBDFIFN
QUIT
SET IBDFNODE=$GET(^TMP("ALPHA",$JOB,IBDFCAT,IBDFIFN))
Begin DoDot:1
+3 SET IBDFIFN=$PIECE(IBDFNODE,"^",1)
+4 SET IBDFCODE=$PIECE(IBDFNODE,"^",2)
+5 SET IBDFCAT=$PIECE(IBDFNODE,"^",3)
+6 SET IBDFDESC=$PIECE(IBDFNODE,"^",4)
+7 IF '$DATA(IBDFC(IBDFCAT))
DO HEADER^IBDFLST1
DO SET
End DoDot:1
+8 QUIT
+9 ;
+10 ;
SET ; -- Set up list array
+1 SET IBDCNT1=IBDCNT1+1
+2 SET IBDCNT=IBDCNT+1
SET VALMCNT=VALMCNT+1
+3 SET X=""
+4 SET IBDFVAL=$JUSTIFY(IBDCNT1_")",5)
+5 SET X=$$SETSTR(IBDFVAL,X,1,5)
+6 SET IBDFVAL=IBDFCODE
+7 SET X=$$SETSTR(IBDFVAL,X,7,8)
+8 SET IBDFVAL=IBDFDESC
+9 SET X=$$SETSTR(IBDFVAL,X,17,20)
+10 SET IBDFVAL=IBDFCAT
+11 SET X=$$SETSTR(IBDFVAL,X,39,20)
+12 ;
+13 ;
TMP ; -- Set up Array
+1 SET ^TMP("CODE",$JOB,IBDCNT,0)=$$LOWER^VALM1(X)
SET ^TMP("CODE",$JOB,"IDX",VALMCNT,IBDCNT1)=""
+2 SET ^TMP("CODEIDX",$JOB,IBDCNT1)=VALMCNT_"^"_IBDFIFN_"^"_IBDFCODE_"^"_IBDFCAT_"^"_IBDFDESC
+3 QUIT
+4 ;
+5 ;
ALPHA ; - Alphabetize by category
+1 SET ^TMP("ALPHA",$JOB,IBDFCAT,IBDFIFN)=IBDFIFN_"^"_IBDFCODE_"^"_IBDFCAT_"^"_IBDFDESC
+2 QUIT
+3 ;
+4 ;
QUIT ; -- Kill variables and reset to last display if no change has been taken place.
+1 ;
+2 ;
EXIT KILL ^TMP("CODE",$JOB),^TMP("CODEIDX",$JOB),^TMP("ALPHA",$JOB)
+1 KILL IBDFC,IBDFTYP,IBDFCNT1,IBDCAT
+2 QUIT
+3 ;
+4 ;
JUMP ; -- Jump action to display a specific category on the screen.
+1 DO FULL^VALM1
+2 IF $DATA(XQORNOD(0))
IF $PIECE(XQORNOD(0),"^",4)]""
SET X=$PIECE(XQORNOD(0),"^",4)
SET X=$PIECE(X,"=",2)
IF X]""
IF X?1.6N
DO JSEL
SET DIC=$SELECT(IBDFDIS="ICD9":"^ICM(",1:"^DIC(81.1,")
SET DIC(0)="QEZ"
DO ^DIC
KILL DIC
IF Y<0
GOTO JMP
SET Y=+Y
DO JUMP1
QUIT
JMP SET DIC=$SELECT(IBDFDIS="ICD9":"^ICM(",1:"^DIC(81.1,")
SET DIC(0)="AEMN"
SET DIC("A")="Select "_$SELECT(IBDFDIS="ICD9":"ICD9",1:"CPT")_" category you wish to move to: "
+1 DO ^DIC
KILL DIC
+2 IF X["^"
SET VALMBG=1
SET VALMBCK="R"
QUIT
+3 ;
+4 ;
JUMP1 IF Y<0
GOTO JUMP
+1 NEW IBDFCAT
+2 SET IBDFCAT=$SELECT(IBDFDIS="ICD9":$PIECE(^ICM(+Y,0),"^",1),1:$PIECE(^DIC(81.1,+Y,0),"^",1))
+3 IF '$DATA(IBDFC(IBDFCAT))
WRITE !!,"There is no data listed for this Clinic Group"
GOTO JMP
+4 SET VALMBG=+IBDFC(IBDFCAT)
SET VALMBCK="R"
QUIT
+5 QUIT
+6 ;
+7 ;
JSEL ; -- Convert number selected to name
+1 SET IBDVALM=X
IF $DATA(^TMP("CGIDX",$JOB,IBDVALM))
SET X=$PIECE(^TMP("CGIDX",$JOB,IBDVALM),"^",2)
SET X=$PIECE(^IBD(357.99,X,0),"^",1)
+2 QUIT
HLP ; -- help code
+1 SET X="?"
DO DISP^XQORM1
WRITE !!
+2 QUIT
+3 ;