BDW1VBLR ;IHS/CMI/LAB - RESET visit backload log;
;;1.0;IHS DATA WAREHOUSE;;JAN 23, 2006
;IHS/CMI/LAB - XTMP
W !!,"This routine will reset the Data Warehouse Export Log. You must be",!,"absolutely sure that you have corrected the underlying problem that caused ","the Export process to fail in the first place!",!!
W "The Data Warehouse Export log entry you choose will be REMOVED from the log",!,"log file and all Utility and Data globals associated with that run will ",!,"be killed!!",!!
W "You must now select the Log Entry to be RESET. <<< SELECT CAREFULLY >>>",!
S DIC="^BDWBLOG(",DIC(0)="AEMQ",DIC("S")="I $P(^BDWBLOG(Y,0),U,15)'=""C"",$P(^BDWBLOG(Y,0),U,15)'=""P""" D ^DIC K DIC I Y=-1 W !!,"Goodbye" G EOJ
S BDW("RUN LOG")=+Y
D DISP
S DIR(0)="Y",DIR("A")="Are you sure you want to do this",DIR("B")="N" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
I Y'=1 D EOJ Q
S BDWTM=$$DW1TRLR^BHLEVENT(90214,BDW("RUN LOG"))
S BDW("RUN START")=$P(^BDWBLOG(BDW("RUN LOG"),0),U,3),BDW("RUN STOP")=$P(^BDWBLOG(BDW("RUN LOG"),0),U,4)
S BDW1L=$P(^BDWBLOG(BDW("RUN LOG"),0),U,19),BDWED=$P($P(^AUPNVSIT(BDW1L,0),U),"."),BDWED=$$FMADD^XLFDT(BDWED,-1)
D RUNTIME
S DA=BDW("RUN LOG"),DIE="^BDWBLOG(",DR=".02////"_BDWED_";.13////"_BDWRT_";.14////"_BDWTM_";.15////C" D ^DIE
W !!,"Log has been reset",!
D EOJ
Q
DIK ;
S DA=BDW("RUN LOG"),DIK="^BDWBLOG(" D ^DIK
K ^XTMP("BDWBLOG")
K ^BDWTMP
K ^BDWDATA
D EOJ
Q
DISP ;
DIQ ; CALL TO DIQ
W !!,"Information for Log Entry ",BDW("RUN LOG"),!
S DIC="^BDWBLOG(",DA=BDW("RUN LOG"),DR="0;31",DIQ(0)="C" D EN^DIQ
K DIC,DIQ,DR,DA
Q
EOJ ;
D EN^XBVK("BDW")
K DA,DIK,BDW("RUN LOG"),Y,X,DIR,DIRUT
Q
RUNTIME ;
S B=BDW("RUN START")
S E=BDW("RUN STOP")
S T=(86400*($P(E,",")-$P(B,",")))+($P(E,",",2)-$P(B,",",2)),H=$P(T/3600,".")
S:H="" H=0
S T=T-(H*3600),M=$P(T/60,".")
S:M="" M=0
S T=T-(M*60),S=T
;W:$D(ZTQUEUED) !!,"RUN TIME (H.M.S): ",H,".",M,".",S
S BDWRT=H_"."_M_"."_S
K B,E,H,M,S,T
Q
BDW1VBLR ;IHS/CMI/LAB - RESET visit backload log;
+1 ;;1.0;IHS DATA WAREHOUSE;;JAN 23, 2006
+2 ;IHS/CMI/LAB - XTMP
+3 WRITE !!,"This routine will reset the Data Warehouse Export Log. You must be",!,"absolutely sure that you have corrected the underlying problem that caused ","the Export process to fail in the first place!",!!
+4 WRITE "The Data Warehouse Export log entry you choose will be REMOVED from the log",!,"log file and all Utility and Data globals associated with that run will ",!,"be killed!!",!!
+5 WRITE "You must now select the Log Entry to be RESET. <<< SELECT CAREFULLY >>>",!
+6 SET DIC="^BDWBLOG("
SET DIC(0)="AEMQ"
SET DIC("S")="I $P(^BDWBLOG(Y,0),U,15)'=""C"",$P(^BDWBLOG(Y,0),U,15)'=""P"""
DO ^DIC
KILL DIC
IF Y=-1
WRITE !!,"Goodbye"
GOTO EOJ
+7 SET BDW("RUN LOG")=+Y
+8 DO DISP
+9 SET DIR(0)="Y"
SET DIR("A")="Are you sure you want to do this"
SET DIR("B")="N"
DO ^DIR
KILL DIR
IF $DATA(DUOUT)
SET DIRUT=1
+10 IF Y'=1
DO EOJ
QUIT
+11 SET BDWTM=$$DW1TRLR^BHLEVENT(90214,BDW("RUN LOG"))
+12 SET BDW("RUN START")=$PIECE(^BDWBLOG(BDW("RUN LOG"),0),U,3)
SET BDW("RUN STOP")=$PIECE(^BDWBLOG(BDW("RUN LOG"),0),U,4)
+13 SET BDW1L=$PIECE(^BDWBLOG(BDW("RUN LOG"),0),U,19)
SET BDWED=$PIECE($PIECE(^AUPNVSIT(BDW1L,0),U),".")
SET BDWED=$$FMADD^XLFDT(BDWED,-1)
+14 DO RUNTIME
+15 SET DA=BDW("RUN LOG")
SET DIE="^BDWBLOG("
SET DR=".02////"_BDWED_";.13////"_BDWRT_";.14////"_BDWTM_";.15////C"
DO ^DIE
+16 WRITE !!,"Log has been reset",!
+17 DO EOJ
+18 QUIT
DIK ;
+1 SET DA=BDW("RUN LOG")
SET DIK="^BDWBLOG("
DO ^DIK
+2 KILL ^XTMP("BDWBLOG")
+3 KILL ^BDWTMP
+4 KILL ^BDWDATA
+5 DO EOJ
+6 QUIT
DISP ;
DIQ ; CALL TO DIQ
+1 WRITE !!,"Information for Log Entry ",BDW("RUN LOG"),!
+2 SET DIC="^BDWBLOG("
SET DA=BDW("RUN LOG")
SET DR="0;31"
SET DIQ(0)="C"
DO EN^DIQ
+3 KILL DIC,DIQ,DR,DA
+4 QUIT
EOJ ;
+1 DO EN^XBVK("BDW")
+2 KILL DA,DIK,BDW("RUN LOG"),Y,X,DIR,DIRUT
+3 QUIT
RUNTIME ;
+1 SET B=BDW("RUN START")
+2 SET E=BDW("RUN STOP")
+3 SET T=(86400*($PIECE(E,",")-$PIECE(B,",")))+($PIECE(E,",",2)-$PIECE(B,",",2))
SET H=$PIECE(T/3600,".")
+4 IF H=""
SET H=0
+5 SET T=T-(H*3600)
SET M=$PIECE(T/60,".")
+6 IF M=""
SET M=0
+7 SET T=T-(M*60)
SET S=T
+8 ;W:$D(ZTQUEUED) !!,"RUN TIME (H.M.S): ",H,".",M,".",S
+9 SET BDWRT=H_"."_M_"."_S
+10 KILL B,E,H,M,S,T
+11 QUIT