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

AUKD3.m

Go to the documentation of this file.
AUKD3 ; KILLS DICs and GLOBALS (PART 3) [ 08/10/88  9:16 AM ]
 ;
 ; Upon entry into this routine ^DIC(file #,0) must contain
 ; the file name, and, if the data global is to be deleted
 ; piece 3 of ^UTILITY("AUDSET",$J,file #) must be a valid
 ; global reference.
 ;
 W !!
 K ^UTILITY("AUKD",$J)
 S (AUKDFILE,AUKDFLG)=0 F AUKDL=0:0 S AUKDFILE=$O(^UTILITY("AUDSET",$J,AUKDFILE)) Q:AUKDFILE=""  S AUKDDEL=$P(^(AUKDFILE),U,1),AUKDTMP=$P(^(AUKDFILE),U,2),AUKDG=$P(^(AUKDFILE),U,3) D KILL Q:AUKDFLG
 Q
 ;
KILL ;
 S AUKDG="^"_$E(AUKDG,1,$L(AUKDG)-1)_$S($E(AUKDG,$L(AUKDG))=",":")",1:"")
 S AUKDNDIC=$P(^DIC(AUKDFILE,0),U,1)
 W AUKDFILE,?14,$P(^DIC(AUKDFILE,0),U,1),"  <WAIT>"
 ;I AUKDDEL'="D",AUKDDEL'="?" D SAVE
 I AUKDTMP'="D" D SAVE
 K AUKDSFL S AUKDC=1,AUKDSFL(AUKDC)=AUKDFILE
 D SBTRACE
 K AUKDC,AUKDI,AUKDSF,AUKDSFL
 K ^DD("ACOMP",AUKDFILE)
 K ^DIC(AUKDFILE,"%"),^("%A"),^("%D"),^DIC("B",AUKDNDIC,AUKDFILE) I AUKDG'["DIC(",AUKDTMP="D" K ^DIC(AUKDFILE,0)
 K:AUKDDEL="D" @AUKDG
 I AUKDTMP="D" F DIK="^DIE(","^DIPT(","^DIBT(" W "." K @(DIK_"""F""_AUKDFILE)") F DA=.9:0 S DA=$N(@(DIK_"DA)")) Q:DA'>0  I $D(^(DA,0)) S %=$P(^(0),U,4) I %=""!'$D(^DD(+%)) W "." D ^DIK
 W !!
 Q
 ;
SBTRACE ; DELETE ALL SUB-FILES
 F AUKDL=0:0 S AUKDI=$O(AUKDSFL("")) Q:AUKDI=""  S AUKDSF=AUKDSFL(AUKDI) D SBTRACE2 S AUKDI=$O(AUKDSFL("")) W "." K ^DD(AUKDSFL(AUKDI)),AUKDSFL(AUKDI)
 Q
SBTRACE2 ;
 S AUKDI=0 F AUKDL=0:0 S AUKDI=$O(^DD(AUKDSF,"SB",AUKDI)) Q:AUKDI=""  S AUKDC=AUKDC+1,AUKDSFL(AUKDC)=AUKDI
 Q
 ;
SAVE ; SAVE "PT", "TRB", AND "ACOMP" NODE FROM ^DD
 S AUKDFLD="" F AUKDL=0:0 S AUKDFLD=$O(^DD("ACOMP",AUKDFILE,AUKDFLD)) Q:AUKDFLD=""  S AUKDFLE2="" F AUKDL=0:0 S AUKDFLE2=$O(^DD("ACOMP",AUKDFILE,AUKDFLD,AUKDFLE2)) Q:AUKDFLE2=""  D SAVE2
 K ^DD(AUKDFILE,0,"PT",AUKDFILE)
 W "." S FROM="^DD("_AUKDFILE_",0,""PT"",",TO="^UTILITY(""AUKD"",$J,"_AUKDFILE_",0,""PT""," D ^%AUGXFR
 K ^DD(AUKDFILE,"TRB",AUKDFILE)
 W "." S FROM="^DD("_AUKDFILE_",""TRB"",",TO="^UTILITY(""AUKD"",$J,"_AUKDFILE_",""TRB""," D ^%AUGXFR
 W "." S FROM="^DD(""ACOMP"","_AUKDFILE_",",TO="^UTILITY(""AUKD"",$J,""ACOMP"","_AUKDFILE_"," D ^%AUGXFR
 Q
SAVE2 ;
 I '$D(^DIC(AUKDFLE2))!(AUKDFILE=AUKDFLE2) W "." K ^DD("ACOMP",AUKDFILE,AUKDFLD,AUKDFLE2)
 Q