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

APCLTAXE.m

Go to the documentation of this file.
APCLTAXE ; IHS/CMI/LAB - DISPLAY IND LISTS ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;; ;
EP ;EP - CALLED FROM OPTION
 D EN
 Q
EOJ ;EP
 D ^XBFMK
 K APCLITEM,APCLX,APCLTAXI,APCLITMI,APCLHIGH,APCLTXLI
 Q
 ;; ;
EN ;EP -- main entry point for 
 D EN^VALM("APCL TAXONOMY GENERIC 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 "_APCLTAXN_" taxonomy"
 Q
 ;
INIT ; -- init variables and list array
 I APCLFILE=60 D LAB Q
 I $P(^ATXAX(APCLTAXI,0),U,13) D CANDISP Q
 K APCLITEM S APCLHIGH="",C=0
 S APCLX=0 F  S APCLX=$O(^ATXAX(APCLTAXI,21,APCLX)) Q:APCLX'=+APCLX  D
 .S C=C+1
 .S APCLITMI=$P(^ATXAX(APCLTAXI,21,APCLX,0),U)
 .I APCLFILE=9999999.05 S APCLITEM(C,0)=C_")  "_APCLITMI I 1
 .E  S APCLITEM(C,0)=C_")  "_$$VAL^XBDIQ1($P(^ATXAX(APCLTAXI,0),U,15),APCLITMI,.01)
 .S APCLITEM("IDX",C,C)=APCLITMI
 .Q
 S (VALMCNT,APCLHIGH)=C
 Q
CANDISP ;
 K APCLITEM S APCLHIGH="",C=0
 S APCLX=0 F  S APCLX=$O(^ATXAX(APCLTAXI,21,APCLX)) Q:APCLX'=+APCLX  D
 .S C=C+1
 .S APCLITEM(C,0)=C_")  "_$P(^ATXAX(APCLTAXI,21,APCLX,0),U)_"-"_$P(^ATXAX(APCLTAXI,21,APCLX,0),U,2)
 .S APCLITEM("IDX",C,C)=APCLX
 .Q
 S (VALMCNT,APCLHIGH)=C
 Q
LAB ;
 K APCLITEM S APCLHIGH="",C=0
 S APCLX=0 F  S APCLX=$O(^ATXLAB(APCLTAXI,21,APCLX)) Q:APCLX'=+APCLX  D
 .S C=C+1
 .S APCLITMI=$P(^ATXLAB(APCLTAXI,21,APCLX,0),U)
 .S APCLITEM(C,0)=C_")  "_$P($G(^LAB(60,APCLITMI,0)),U)
 .S APCLITEM("IDX",C,C)=APCLITMI
 .Q
 S (VALMCNT,APCLHIGH)=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 !
 I APCLFILE=60,$P(^ATXLAB(APCLTAXI,0),U,22) W !!,"The ",$P(^ATXLAB(APCLTAXI,0),U)," Taxonomy is READ ONLY.",!,"You can not update it." D PAUSE G REMX
 I APCLFILE'=60,$P(^ATXAX(APCLTAXI,0),U,22) W !!,"The ",$P(^ATXAX(APCLTAXI,0),U)," Taxonomy is READ ONLY.",!,"You can not update it." D PAUSE G REMX
 W ! K DIR
 I APCLFILE=80 D ICD9ADD G REMX
 I APCLFILE=80.1 D ICD0ADD G REMX
 I APCLFILE=81 D ICPTADD G REMX
 ;I APCLFILE'=60,$P(^ATXTYPE(APCLTAXT,0),U,4)=1 D ICD9ADD G REMX
 S DIR(0)="NO^1:"_APCLHIGH,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 APCLITMI=APCLITEM("IDX",Y,Y)
 ;sure
 I APCLFILE=60 K DIR S DIR(0)="Y",DIR("A")="Are you sure you want to remove the "_$P(^LAB(60,APCLITMI,0),U)_" lab test",DIR("B")="N" KILL DA D ^DIR KILL DIR
 I APCLFILE'=60,APCLTAXT K DIR D
 .S DIR(0)="Y",DIR("A")="Are you sure you want to remove the "_$S(APCLFILE'=9999999.05:$$VAL^XBDIQ1($P(^ATXAX(APCLTAXI,0),U,15),APCLITMI,.01),1:APCLITMI)_" "_$$VAL^XBDIQ1(9002226,APCLTAXI,.15),DIR("B")="N" KILL DA D ^DIR KILL DIR
 I 'Y G REM
 I $D(DIRUT) G REMX
 D ^XBFMK
 I APCLFILE=60 S DA(1)=APCLTAXI,DA=$O(^ATXLAB(APCLTAXI,21,"B",APCLITMI,0)),DIE="^ATXLAB("_APCLTAXI_",21,",DR=".01///@" D ^DIE
 I APCLFILE'=60 S DA(1)=APCLTAXI,DA=$O(^ATXAX(APCLTAXI,21,"B",APCLITMI,0)),DIE="^ATXAX("_APCLTAXI_",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 APCLFILE=60,$P(^ATXLAB(APCLTAXI,0),U,22) W !!,"The ",$P(^ATXLAB(APCLTAXI,0),U)," is READ ONLY.",!,"You can not update it." D PAUSE G ADDX
 I APCLFILE'=60,$P(^ATXAX(APCLTAXI,0),U,22) W !!,"The ",$P(^ATXAX(APCLTAXI,0),U)," is READ ONLY.",!,"You can not update it." D PAUSE G ADDX
 I APCLFILE=60 D LABADD G ADDX
 I APCLFILE=80 D ICD9ADD G ADDX
 I APCLFILE=80.1 D ICD0ADD G ADDX
 I APCLFILE=81 D ICPTADD G ADDX
 K DIC
 S DIC(0)="AEMQ",DIC=$P(^ATXAX(APCLTAXI,0),U,15) D ^DIC
 I Y=-1 G ADDX
 I $D(^ATXAX(APCLTAXI,21,"B",$S(APCLFILE'=9999999.05:+Y,1:$P(^AUTTCOM(+Y,0),U,1)))) W !!,"That item is already in the taxonomy." H 2 G ADD
 S DA=APCLTAXI
 S (X,APCLTXLI)=+Y
 I APCLFILE=9999999.05 S (X,APCLTXLI)=$P(^AUTTCOM(+Y,0),U)  ;special processing for community
 S APCLFILE=$P(^ATXAX(APCLTAXI,0),U,15)
 S DA(1)=APCLTAXI
 S DIC="^ATXAX("_DA_",21,"
 S DIC(0)="L",DIC("DR")=".02////"_APCLTXLI K DD,DO
 S:'$D(^ATXAX(DA,21,0)) ^ATXAX(DA,21,0)="^9002226.02101A"
 D FILE^DICN
 I '$D(^ATXAX(APCLTAXI,21,"B",APCLTXLI)) 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
 S APCLTXLI=+Y
 I '$P(^ATXLAB(APCLTAXI,0),U,11),$O(^LAB(60,APCLTXLI,2,0)) S APCLYN="" D  G:'APCLYN ADDX
 .W !!,"This lab test, ",$P(^LAB(60,APCLTXLI,0),U),", is a panel test and the"
 .W !,"taxonomy ",$P(^ATXLAB(APCLTAXI,0),U)," should not contain panel tests.",!
 .S DIR(0)="Y",DIR("A")="Do you still want to add this lab test to this taxonomy",DIR("B")="N" KILL DA D ^DIR KILL DIR
 .Q:$D(DIRUT)
 .S APCLYN=Y
 I $D(^ATXLAB(APCLTAXI,21,"B",APCLTXLI)) W !!,"Lab test ",$P(^LAB(60,APCLTXLI,0),U)," is already in the taxonomy." H 2 G ADD
 S DA=APCLTAXI
 S X=APCLTXLI
 S DA(1)=APCLTAXI
 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(APCLTAXI,21,"B",APCLTXLI)) W !!,"adding lab test failed." H 2 G ADD
ADDX ;
 K DIC,DA,DR,APCLTXLI,DD,DO
 D BACK
 Q
ICD9ADD ;
 D ICD9ADD^APCLTAXF
 Q
ICD0ADD ;
 D ICD0ADD^APCLTAXH
 Q
ICPTADD ;
 D ICPTADD^APCLTAXL
 Q