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

BNITAXT.m

Go to the documentation of this file.
BNITAXT ; IHS/CMI/LAB - DISPLAY TAX ;
 ;;1.0;BNI CPHD ACTIVITY DATASYSTEM;;DEC 20, 2006
 ;; ;
EP ;EP - CALLED FROM OPTION
 S BNITAXT=$O(^ATXTYPE("B","COMMUNITY",0)),BNIFILE=9999999.05,BNITAXF=9999999.05
 D EN
 Q
 ;; ;
EN ;EP -- main entry point for 
 D EN^VALM("BNI TAXONOMY GENERIC LIST")
 D CLEAR^VALM1
 D FULL^VALM1
 W:$D(IOF) @IOF
 K BNILIST,J,C
 D ^XBFMK
 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)="ADD OR EDIT "_$P(^ATXTYPE(BNITAXT,0),U)_" TAXONOMIES"
 S VALMHDR(2)="TAXONOMY NAME",$E(VALMHDR(2),38)="DESCRIPTION",$E(VALMHDR(2),70)="FILE"
 Q
 ;
INIT ; -- init variables and list array
 I BNIFILE=60 D LABINIT Q
 K BNILIST S BNIHIGH="",C=0
 S J=0 F  S J=$O(^ATXAX(J)) Q:J'=+J  D
 .I $P(^ATXAX(J,0),U,15)'=BNIFILE Q
 .S C=C+1
 .S D=$P(^ATXAX(J,0),U,2)
 .S BNILIST(C,0)=C_")  "_$P(^ATXAX(J,0),U),$E(BNILIST(C,0),38)=D,$E(BNILIST(C,0),70)=BNIFILE
 .S BNILIST("IDX",C,C)=J
 .Q
 S (VALMCNT,BNIHIGH)=C
 Q
LABINIT ;
 K BNILIST S BNIHIGH="",C=0
 S J=0 F  S J=$O(^ATXLAB(J)) Q:J'=+J  D
 .S C=C+1
 .S D=$P(^ATXLAB(J,0),U,2)
 .S BNILIST(C,0)=C_")  "_$P(^ATXLAB(J,0),U),$E(BNILIST(C,0),38)=D,$E(BNILIST(C,0),70)=BNIFILE
 .S BNILIST("IDX",C,C)=J
 .Q
 S (VALMCNT,BNIHIGH)=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
 ;
SEL ;EP - add an item to the selected list - called from a protocol
 D FULL^VALM1
 W !
 S DIR(0)="NO^1:"_BNIHIGH,DIR("A")="Which Taxonomy"
 D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I Y="" W !,"No taxonomy selected." G ADDX
 I $D(DIRUT) W !,"No taxonomy selected." G ADDX
 S BNITAXI=$P(BNILIST("IDX",Y,Y),U,1),BNITAXN=$S(BNIFILE=60:$P(^ATXLAB(BNITAXI,0),U),1:$P(^ATXAX(BNITAXI,0),U))
 D FULL^VALM1 W:$D(IOF) @IOF
 D EP^BNITAXE
ADDX ;
 D BACK
 Q
ADDNEW ;EP  add new taxonomy of this type
 I BNIFILE=60 D LABADD G ADDNEWX
 S ATXADD=1,ATXFLG=1
 K DIC
 S DIC="^ATXAX(",DIC("DR")=".02",DIC(0)="AEMLQ" D ^DIC K DIC
 I Y=-1 G ADDNEWX
 S BNITAXI=+Y
 S DA=BNITAXI,DIE="^ATXAX("
 S DR=".09////"_DT_";.12////"_$P(^ATXTYPE(BNITAXT,0),U,3)_";.13////"_$S(BNIFILE=80:1,BNIFILE=80.1:1,BNIFILE=81:1,1:"")_";.15////"_$P(^ATXTYPE(BNITAXT,0),U,2)
 D ^DIE K DIE,DA,DR
 I $D(Y) W !!,"error creating taxonomy........" S DA=BNITAXI,DIK="^ATXAX(" D ^DIK K DIK,DA D PAUSE G ADDNEWX
 S BNITAXN=$P(^ATXAX(BNITAXI,0),U)
 D EP^BNITAXE
ADDNEWX ;
 D BACK
 Q
LABADD ;
 K DIC
 S DIC="^ATXLAB(",DIC("DR")=".02",DIC(0)="AEMLQ" D ^DIC K DIC
 I Y=-1 G ADDNEWX
 S BNITAXI=+Y
 S DA=BNITAXI,DIE="^ATXLAB("
 S DR=".09////"_DT
 D ^DIE K DIE,DA,DR
 I $D(Y) W !!,"error creating taxonomy........" S DA=BNITAXI,DIK="^ATXAX(" D ^DIK K DIK,DA D PAUSE G ADDNEWX
 S BNITAXN=$P(^ATXLAB(BNITAXI,0),U)
 D EP^BNITAXE
 G ADDNEWX