APCHTAXE ; IHS/CMI/LAB - DISPLAY IND LISTS ;
;;2.0;IHS PCC SUITE;;MAY 14, 2009
;; ;
EP ;EP - CALLED FROM OPTION
D EN
Q
MAJPROC ;EP
W:$D(IOF) @IOF
W !!,"This option is used to update the list of CPT codes that"
W !,"should be included in the History of Surgery component of the"
W !,"health summary. This taxonomy should contain only CPT codes"
W !,"for procedures/surgeries that you would expect to see on the"
W !,"history of surgery section of the health summary.",!!
D PAUSE
S APCHTAXI=$O(^ATXAX("B","APCH HS MAJOR PROCEDURE CPTS",0))
S APCHFILE=81
S APCHTAXN=$P(^ATXAX(APCHTAXI,0),U)
D EN
Q
MINPROC ;EP
W:$D(IOF) @IOF
W !!,"This option is used to update the list of CPT codes that"
W !,"should be included in the History of MINOR Surgery component of the"
W !,"health summary. This taxonomy should contain only CPT codes"
W !,"for procedures/surgeries that you would expect to see on the"
W !,"MINOR surgery section of the health summary.",!!
D PAUSE
S APCHTAXI=$O(^ATXAX("B","APCH HS MINOR PROCEDURE CPTS",0))
S APCHFILE=81
S APCHTAXN=$P(^ATXAX(APCHTAXI,0),U)
D EN
Q
EOJ ;EP
D ^XBFMK
K APCHITEM,APCHX,APCHTAXI,APCHITMI,APCHHIGH,APCHTXLI,APCHFILE,APCHTAXN
Q
;; ;
EN ;EP -- main entry point for
D EN^VALM("APCH TAXONOMY EDIT")
D CLEAR^VALM1
D FULL^VALM1
W:$D(IOF) @IOF
D EOJ
Q
;
PAUSE ;EP
Q:$E(IOST)'="C"!(IO'=IO(0))
W ! S DIR(0)="EO",DIR("A")="Press enter to continue...." D ^DIR K DIR S:$D(DUOUT) DIRUT=1
Q
HDR ; -- header code
S VALMHDR(1)="Updating the "_APCHTAXN_" taxonomy"
Q
;
INIT ; -- init variables and list array
I APCHFILE=60 D LAB Q
I $P(^ATXAX(APCHTAXI,0),U,13) D CANDISP Q
K APCHITEM S APCHHIGH="",C=0
S APCHX=0 F S APCHX=$O(^ATXAX(APCHTAXI,21,APCHX)) Q:APCHX'=+APCHX D
.S C=C+1
.S APCHITMI=$P(^ATXAX(APCHTAXI,21,APCHX,0),U)
.I APCHFILE=9999999.05 S APCHITEM(C,0)=C_") "_APCHITMI I 1
.E S APCHITEM(C,0)=C_") "_$$VAL^XBDIQ1($P(^ATXAX(APCHTAXI,0),U,15),APCHITMI,.01)
.S APCHITEM("IDX",C,C)=APCHITMI
.Q
S (VALMCNT,APCHHIGH)=C
Q
CANDISP ;
K APCHITEM S APCHHIGH="",C=0
S APCHX=0 F S APCHX=$O(^ATXAX(APCHTAXI,21,APCHX)) Q:APCHX'=+APCHX D
.S C=C+1
.S APCHITEM(C,0)=C_") "_$P(^ATXAX(APCHTAXI,21,APCHX,0),U)_"-"_$P(^ATXAX(APCHTAXI,21,APCHX,0),U,2)
.S APCHITEM("IDX",C,C)=APCHX
.Q
S (VALMCNT,APCHHIGH)=C
Q
LAB ;
K APCHITEM S APCHHIGH="",C=0
S APCHX=0 F S APCHX=$O(^ATXLAB(APCHTAXI,21,APCHX)) Q:APCHX'=+APCHX D
.S C=C+1
.S APCHITMI=$P(^ATXLAB(APCHTAXI,21,APCHX,0),U)
.S APCHITEM(C,0)=C_") "_$P($G(^LAB(60,APCHITMI,0)),U)
.S APCHITEM("IDX",C,C)=APCHITMI
.Q
S (VALMCNT,APCHHIGH)=C
Q
;
HELP ; -- help code
S X="?" D DISP^XQORM1 W !!
Q
;
EXIT ; -- exit code
Q
;
EXPND ; -- expand code
Q
;
BACK ;go back to listman
D TERM^VALM0
S VALMBCK="R"
D INIT
D HDR
K DIR
K X,Y,Z,I
Q
;
REM ;
D FULL^VALM1
W !!,IORVON,"Please NOTE:",IORVOFF
W !,"To remove a CPT code from the list you must put a minus sign before"
W !,"the code. For example, to remove code 56011 from this taxonomy you must type"
W !,"-56011 at the ENTER ANOTHER CPT prompt."
W !
D PAUSE
I APCHFILE=60,$P(^ATXLAB(APCHTAXI,0),U,22) W !!,"The ",$P(^ATXLAB(APCHTAXI,0),U)," Taxonomy is READ ONLY.",!,"You can not update it." D PAUSE G REMX
I APCHFILE'=60,$P(^ATXAX(APCHTAXI,0),U,22) W !!,"The ",$P(^ATXAX(APCHTAXI,0),U)," Taxonomy is READ ONLY.",!,"You can not update it." D PAUSE G REMX
W ! K DIR
I APCHFILE=80 D ICD9ADD G REMX
I APCHFILE=80.1 D ICD0ADD G REMX
I APCHFILE=81 D ICPTADD G REMX
;I APCHFILE'=60,$P(^ATXTYPE(APCHTAXT,0),U,4)=1 D ICD9ADD G REMX
S DIR(0)="NO^1:"_APCHHIGH,DIR("A")="Remove Which Item"
D ^DIR K DIR S:$D(DUOUT) DIRUT=1
I Y="" W !,"No item selected." G REMX
I $D(DIRUT) W !,"No item selected." G REMX
S APCHITMI=APCHITEM("IDX",Y,Y)
;sure
I APCHFILE=60 K DIR S DIR(0)="Y",DIR("A")="Are you sure you want to remove the "_$P(^LAB(60,APCHITMI,0),U)_" lab test",DIR("B")="N" KILL DA D ^DIR KILL DIR
I APCHFILE'=60,APCHTAXT K DIR D
.S DIR(0)="Y",DIR("A")="Are you sure you want to remove the "_$S(APCHFILE'=9999999.05:$$VAL^XBDIQ1($P(^ATXAX(APCHTAXI,0),U,15),APCHITMI,.01),1:APCHITMI)_" "_$$VAL^XBDIQ1(9002226,APCHTAXI,.15),DIR("B")="N" KILL DA D ^DIR KILL DIR
I 'Y G REM
I $D(DIRUT) G REMX
D ^XBFMK
I APCHFILE=60 S DA(1)=APCHTAXI,DA=$O(^ATXLAB(APCHTAXI,21,"B",APCHITMI,0)),DIE="^ATXLAB("_APCHTAXI_",21,",DR=".01///@" D ^DIE
I APCHFILE'=60 S DA(1)=APCHTAXI,DA=$O(^ATXAX(APCHTAXI,21,"B",APCHITMI,0)),DIE="^ATXAX("_APCHTAXI_",21,",DR=".01///@" D ^DIE
REMX ;
D ^XBFMK
D BACK
Q
ADD ;EP - add an item to the selected list - called from a protocol
D FULL^VALM1
W !
I APCHFILE=60,$P(^ATXLAB(APCHTAXI,0),U,22) W !!,"The ",$P(^ATXLAB(APCHTAXI,0),U)," is READ ONLY.",!,"You can not update it." D PAUSE G ADDX
I APCHFILE'=60,$P(^ATXAX(APCHTAXI,0),U,22) W !!,"The ",$P(^ATXAX(APCHTAXI,0),U)," is READ ONLY.",!,"You can not update it." D PAUSE G ADDX
I APCHFILE=60 D LABADD G ADDX
I APCHFILE=80 D ICD9ADD G ADDX
I APCHFILE=80.1 D ICD0ADD G ADDX
I APCHFILE=81 D ICPTADD G ADDX
K DIC
S DIC(0)="AEMQ",DIC=$P(^ATXAX(APCHTAXI,0),U,15) D ^DIC
I Y=-1 G ADDX
I $D(^ATXAX(APCHTAXI,21,"B",$S(APCHFILE'=9999999.05:+Y,1:$P(^AUTTCOM(+Y,0),U,1)))) W !!,"That item is already in the taxonomy." H 2 G ADD
S DA=APCHTAXI
S (X,APCHTXLI)=+Y
I APCHFILE=9999999.05 S (X,APCHTXLI)=$P(^AUTTCOM(+Y,0),U) ;special processing for community
S APCHFILE=$P(^ATXAX(APCHTAXI,0),U,15)
S DA(1)=APCHTAXI
S DIC="^ATXAX("_DA_",21,"
S DIC(0)="L",DIC("DR")=".02////"_APCHTXLI K DD,DO
S:'$D(^ATXAX(DA,21,0)) ^ATXAX(DA,21,0)="^9002226.02101A"
D FILE^DICN
I '$D(^ATXAX(APCHTAXI,21,"B",APCHTXLI)) W !!,"adding ITEM failed." H 2 G ADD
G ADDX
LABADD ;
K DIC
S DIC(0)="AEMQ",DIC="^LAB(60,",DIC("A")="Which LAB Test: " D ^DIC
I Y=-1 G ADDX
I $D(^ATXLAB(APCHTAXI,21,"B",+Y)) W !!,"Lab test ",$P(^LAB(60,+Y,0),U)," is already in the taxonomy." H 2 G ADD
S DA=APCHTAXI
S (X,APCHTXLI)=+Y
S DA(1)=APCHTAXI
S DIC="^ATXLAB("_DA_",21,"
S DIC(0)="L" K DD,DO
S:'$D(^ATXLAB(DA,21,0)) ^ATXLAB(DA,21,0)="^9002228.02101PA"
D FILE^DICN
I '$D(^ATXLAB(APCHTAXI,21,"B",APCHTXLI)) W !!,"adding lab test failed." H 2 G ADD
ADDX ;
K DIC,DA,DR,APCHTXLI,DD,DO
D BACK
Q
ICD9ADD ;
;D ICD9ADD^APCHTAXF
Q
ICD0ADD ;
;D ICD0ADD^APCHTAXH
Q
ICPTADD ;
D ICPTADD^APCHTAXL
Q
APCHTAXE ; IHS/CMI/LAB - DISPLAY IND LISTS ;
+1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
+2 ;; ;
EP ;EP - CALLED FROM OPTION
+1 DO EN
+2 QUIT
MAJPROC ;EP
+1 IF $DATA(IOF)
WRITE @IOF
+2 WRITE !!,"This option is used to update the list of CPT codes that"
+3 WRITE !,"should be included in the History of Surgery component of the"
+4 WRITE !,"health summary. This taxonomy should contain only CPT codes"
+5 WRITE !,"for procedures/surgeries that you would expect to see on the"
+6 WRITE !,"history of surgery section of the health summary.",!!
+7 DO PAUSE
+8 SET APCHTAXI=$ORDER(^ATXAX("B","APCH HS MAJOR PROCEDURE CPTS",0))
+9 SET APCHFILE=81
+10 SET APCHTAXN=$PIECE(^ATXAX(APCHTAXI,0),U)
+11 DO EN
+12 QUIT
MINPROC ;EP
+1 IF $DATA(IOF)
WRITE @IOF
+2 WRITE !!,"This option is used to update the list of CPT codes that"
+3 WRITE !,"should be included in the History of MINOR Surgery component of the"
+4 WRITE !,"health summary. This taxonomy should contain only CPT codes"
+5 WRITE !,"for procedures/surgeries that you would expect to see on the"
+6 WRITE !,"MINOR surgery section of the health summary.",!!
+7 DO PAUSE
+8 SET APCHTAXI=$ORDER(^ATXAX("B","APCH HS MINOR PROCEDURE CPTS",0))
+9 SET APCHFILE=81
+10 SET APCHTAXN=$PIECE(^ATXAX(APCHTAXI,0),U)
+11 DO EN
+12 QUIT
EOJ ;EP
+1 DO ^XBFMK
+2 KILL APCHITEM,APCHX,APCHTAXI,APCHITMI,APCHHIGH,APCHTXLI,APCHFILE,APCHTAXN
+3 QUIT
+4 ;; ;
EN ;EP -- main entry point for
+1 DO EN^VALM("APCH TAXONOMY EDIT")
+2 DO CLEAR^VALM1
+3 DO FULL^VALM1
+4 IF $DATA(IOF)
WRITE @IOF
+5 DO EOJ
+6 QUIT
+7 ;
PAUSE ;EP
+1 IF $EXTRACT(IOST)'="C"!(IO'=IO(0))
QUIT
+2 WRITE !
SET DIR(0)="EO"
SET DIR("A")="Press enter to continue...."
DO ^DIR
KILL DIR
IF $DATA(DUOUT)
SET DIRUT=1
+3 QUIT
HDR ; -- header code
+1 SET VALMHDR(1)="Updating the "_APCHTAXN_" taxonomy"
+2 QUIT
+3 ;
INIT ; -- init variables and list array
+1 IF APCHFILE=60
DO LAB
QUIT
+2 IF $PIECE(^ATXAX(APCHTAXI,0),U,13)
DO CANDISP
QUIT
+3 KILL APCHITEM
SET APCHHIGH=""
SET C=0
+4 SET APCHX=0
FOR
SET APCHX=$ORDER(^ATXAX(APCHTAXI,21,APCHX))
IF APCHX'=+APCHX
QUIT
Begin DoDot:1
+5 SET C=C+1
+6 SET APCHITMI=$PIECE(^ATXAX(APCHTAXI,21,APCHX,0),U)
+7 IF APCHFILE=9999999.05
SET APCHITEM(C,0)=C_") "_APCHITMI
IF 1
+8 IF '$TEST
SET APCHITEM(C,0)=C_") "_$$VAL^XBDIQ1($PIECE(^ATXAX(APCHTAXI,0),U,15),APCHITMI,.01)
+9 SET APCHITEM("IDX",C,C)=APCHITMI
+10 QUIT
End DoDot:1
+11 SET (VALMCNT,APCHHIGH)=C
+12 QUIT
CANDISP ;
+1 KILL APCHITEM
SET APCHHIGH=""
SET C=0
+2 SET APCHX=0
FOR
SET APCHX=$ORDER(^ATXAX(APCHTAXI,21,APCHX))
IF APCHX'=+APCHX
QUIT
Begin DoDot:1
+3 SET C=C+1
+4 SET APCHITEM(C,0)=C_") "_$PIECE(^ATXAX(APCHTAXI,21,APCHX,0),U)_"-"_$PIECE(^ATXAX(APCHTAXI,21,APCHX,0),U,2)
+5 SET APCHITEM("IDX",C,C)=APCHX
+6 QUIT
End DoDot:1
+7 SET (VALMCNT,APCHHIGH)=C
+8 QUIT
LAB ;
+1 KILL APCHITEM
SET APCHHIGH=""
SET C=0
+2 SET APCHX=0
FOR
SET APCHX=$ORDER(^ATXLAB(APCHTAXI,21,APCHX))
IF APCHX'=+APCHX
QUIT
Begin DoDot:1
+3 SET C=C+1
+4 SET APCHITMI=$PIECE(^ATXLAB(APCHTAXI,21,APCHX,0),U)
+5 SET APCHITEM(C,0)=C_") "_$PIECE($GET(^LAB(60,APCHITMI,0)),U)
+6 SET APCHITEM("IDX",C,C)=APCHITMI
+7 QUIT
End DoDot:1
+8 SET (VALMCNT,APCHHIGH)=C
+9 QUIT
+10 ;
HELP ; -- help code
+1 SET X="?"
DO DISP^XQORM1
WRITE !!
+2 QUIT
+3 ;
EXIT ; -- exit code
+1 QUIT
+2 ;
EXPND ; -- expand code
+1 QUIT
+2 ;
BACK ;go back to listman
+1 DO TERM^VALM0
+2 SET VALMBCK="R"
+3 DO INIT
+4 DO HDR
+5 KILL DIR
+6 KILL X,Y,Z,I
+7 QUIT
+8 ;
REM ;
+1 DO FULL^VALM1
+2 WRITE !!,IORVON,"Please NOTE:",IORVOFF
+3 WRITE !,"To remove a CPT code from the list you must put a minus sign before"
+4 WRITE !,"the code. For example, to remove code 56011 from this taxonomy you must type"
+5 WRITE !,"-56011 at the ENTER ANOTHER CPT prompt."
+6 WRITE !
+7 DO PAUSE
+8 IF APCHFILE=60
IF $PIECE(^ATXLAB(APCHTAXI,0),U,22)
WRITE !!,"The ",$PIECE(^ATXLAB(APCHTAXI,0),U)," Taxonomy is READ ONLY.",!,"You can not update it."
DO PAUSE
GOTO REMX
+9 IF APCHFILE'=60
IF $PIECE(^ATXAX(APCHTAXI,0),U,22)
WRITE !!,"The ",$PIECE(^ATXAX(APCHTAXI,0),U)," Taxonomy is READ ONLY.",!,"You can not update it."
DO PAUSE
GOTO REMX
+10 WRITE !
KILL DIR
+11 IF APCHFILE=80
DO ICD9ADD
GOTO REMX
+12 IF APCHFILE=80.1
DO ICD0ADD
GOTO REMX
+13 IF APCHFILE=81
DO ICPTADD
GOTO REMX
+14 ;I APCHFILE'=60,$P(^ATXTYPE(APCHTAXT,0),U,4)=1 D ICD9ADD G REMX
+15 SET DIR(0)="NO^1:"_APCHHIGH
SET DIR("A")="Remove Which Item"
+16 DO ^DIR
KILL DIR
IF $DATA(DUOUT)
SET DIRUT=1
+17 IF Y=""
WRITE !,"No item selected."
GOTO REMX
+18 IF $DATA(DIRUT)
WRITE !,"No item selected."
GOTO REMX
+19 SET APCHITMI=APCHITEM("IDX",Y,Y)
+20 ;sure
+21 IF APCHFILE=60
KILL DIR
SET DIR(0)="Y"
SET DIR("A")="Are you sure you want to remove the "_$PIECE(^LAB(60,APCHITMI,0),U)_" lab test"
SET DIR("B")="N"
KILL DA
DO ^DIR
KILL DIR
+22 IF APCHFILE'=60
IF APCHTAXT
KILL DIR
Begin DoDot:1
+23 SET DIR(0)="Y"
SET DIR("A")="Are you sure you want to remove the "_$SELECT(APCHFILE'=9999999.05:$$VAL^XBDIQ1($PIECE(^ATXAX(APCHTAXI,0),U,15),APCHITMI,.01),1:APCHITMI)_" "_$$VAL^XBDIQ1(9002226,APCHTAXI,.15)
SET DIR("B")="N"
KILL DA
DO ^DIR
KILL DIR
End DoDot:1
+24 IF 'Y
GOTO REM
+25 IF $DATA(DIRUT)
GOTO REMX
+26 DO ^XBFMK
+27 IF APCHFILE=60
SET DA(1)=APCHTAXI
SET DA=$ORDER(^ATXLAB(APCHTAXI,21,"B",APCHITMI,0))
SET DIE="^ATXLAB("_APCHTAXI_",21,"
SET DR=".01///@"
DO ^DIE
+28 IF APCHFILE'=60
SET DA(1)=APCHTAXI
SET DA=$ORDER(^ATXAX(APCHTAXI,21,"B",APCHITMI,0))
SET DIE="^ATXAX("_APCHTAXI_",21,"
SET DR=".01///@"
DO ^DIE
REMX ;
+1 DO ^XBFMK
+2 DO BACK
+3 QUIT
ADD ;EP - add an item to the selected list - called from a protocol
+1 DO FULL^VALM1
+2 WRITE !
+3 IF APCHFILE=60
IF $PIECE(^ATXLAB(APCHTAXI,0),U,22)
WRITE !!,"The ",$PIECE(^ATXLAB(APCHTAXI,0),U)," is READ ONLY.",!,"You can not update it."
DO PAUSE
GOTO ADDX
+4 IF APCHFILE'=60
IF $PIECE(^ATXAX(APCHTAXI,0),U,22)
WRITE !!,"The ",$PIECE(^ATXAX(APCHTAXI,0),U)," is READ ONLY.",!,"You can not update it."
DO PAUSE
GOTO ADDX
+5 IF APCHFILE=60
DO LABADD
GOTO ADDX
+6 IF APCHFILE=80
DO ICD9ADD
GOTO ADDX
+7 IF APCHFILE=80.1
DO ICD0ADD
GOTO ADDX
+8 IF APCHFILE=81
DO ICPTADD
GOTO ADDX
+9 KILL DIC
+10 SET DIC(0)="AEMQ"
SET DIC=$PIECE(^ATXAX(APCHTAXI,0),U,15)
DO ^DIC
+11 IF Y=-1
GOTO ADDX
+12 IF $DATA(^ATXAX(APCHTAXI,21,"B",$SELECT(APCHFILE'=9999999.05:+Y,1:$PIECE(^AUTTCOM(+Y,0),U,1))))
WRITE !!,"That item is already in the taxonomy."
HANG 2
GOTO ADD
+13 SET DA=APCHTAXI
+14 SET (X,APCHTXLI)=+Y
+15 ;special processing for community
IF APCHFILE=9999999.05
SET (X,APCHTXLI)=$PIECE(^AUTTCOM(+Y,0),U)
+16 SET APCHFILE=$PIECE(^ATXAX(APCHTAXI,0),U,15)
+17 SET DA(1)=APCHTAXI
+18 SET DIC="^ATXAX("_DA_",21,"
+19 SET DIC(0)="L"
SET DIC("DR")=".02////"_APCHTXLI
KILL DD,DO
+20 IF '$DATA(^ATXAX(DA,21,0))
SET ^ATXAX(DA,21,0)="^9002226.02101A"
+21 DO FILE^DICN
+22 IF '$DATA(^ATXAX(APCHTAXI,21,"B",APCHTXLI))
WRITE !!,"adding ITEM failed."
HANG 2
GOTO ADD
+23 GOTO ADDX
LABADD ;
+1 KILL DIC
+2 SET DIC(0)="AEMQ"
SET DIC="^LAB(60,"
SET DIC("A")="Which LAB Test: "
DO ^DIC
+3 IF Y=-1
GOTO ADDX
+4 IF $DATA(^ATXLAB(APCHTAXI,21,"B",+Y))
WRITE !!,"Lab test ",$PIECE(^LAB(60,+Y,0),U)," is already in the taxonomy."
HANG 2
GOTO ADD
+5 SET DA=APCHTAXI
+6 SET (X,APCHTXLI)=+Y
+7 SET DA(1)=APCHTAXI
+8 SET DIC="^ATXLAB("_DA_",21,"
+9 SET DIC(0)="L"
KILL DD,DO
+10 IF '$DATA(^ATXLAB(DA,21,0))
SET ^ATXLAB(DA,21,0)="^9002228.02101PA"
+11 DO FILE^DICN
+12 IF '$DATA(^ATXLAB(APCHTAXI,21,"B",APCHTXLI))
WRITE !!,"adding lab test failed."
HANG 2
GOTO ADD
ADDX ;
+1 KILL DIC,DA,DR,APCHTXLI,DD,DO
+2 DO BACK
+3 QUIT
ICD9ADD ;
+1 ;D ICD9ADD^APCHTAXF
+2 QUIT
ICD0ADD ;
+1 ;D ICD0ADD^APCHTAXH
+2 QUIT
ICPTADD ;
+1 DO ICPTADD^APCHTAXL
+2 QUIT