BDW1VBLZ ;IHS/CMI/LAB - rerun visit backload log;
;;1.0;IHS DATA WAREHOUSE;;JAN 23, 2006
;
;
START ;
D EN^XBVK("BDW")
S BDWO("RUN")="REDO" ; Let ^BDWRDRI know this is a 'REDO'
D BASICS^BDW1VBLI
D CHKSITE^BDW1VBLI
;I $D(^BDWTMP) W !!,"^BDWTMP exists from previous run" D EOJ Q
I $D(^BDWDATA) W !!,"^BDWDATA EXISTS FROM PREVIOUS RUN" D EOJ Q ;
I BDW("QFLG")=66 W:'$D(ZTQUEUED) !,"Contact your site manager. ^BDWTMP still exists." D D EOJ Q
.S DIR(0)="EO",DIR("A")="Press any key to continue" K DA D ^DIR K DIR
I BDW("QFLG") D EOJ W !!,"Bye",!! Q
D INIT ; Get Log entry to redo
I BDW("QFLG") D EOJ W !!,"Bye",!! Q
D QUEUE^BDW1VBLI
I BDW("QFLG") D EOJ W !!,"Bye",!! Q
I $D(BDWO("QUEUE")) D EOJ W !!,"Okay your request is queued!",!! Q
D DRIVER^BDW1VBL
EOJ ;
D EN^XBVK("BDW")
Q
INIT ;EP
S DIC="^BDWBLOG(",DIC(0)="AEQ",DIC("S")="I $P(^(0),U,9)=DUZ(2)" D ^DIC K DIC
I Y<0 S BDW("QFLG")=99 Q
S BDW("RUN LOG")=+Y
;
S X=^BDWBLOG(BDW("RUN LOG"),0),BDW("RUN BEGIN")=$P(X,U),BDW("RUN END")=$P(X,U,2),BDW("COUNT")=$P(X,U,6),BDW("ORIG TX DATE")=$P($P(X,U,3),".")
S Y=BDW("RUN BEGIN") X ^DD("DD") S BDW("PRINT BEGIN")=Y
S Y=BDW("RUN END") X ^DD("DD") S BDW("PRINT END")=Y
S BDW("OLD VISITS")=$P(^BDWBLOG(BDW("RUN LOG"),0),U,6)
W !!,"Log entry ",BDW("RUN LOG")," was for date range ",BDW("PRINT BEGIN")," through",!,BDW("PRINT END")," and generated ",BDW("COUNT")," transactions from ",BDW("OLD VISITS")," visits."
;
W !!,"This routine will re-generate the Data Warehouse Encounter Records."
RDD ;
S DIR(0)="Y",DIR("A")="Do you want to regenerate the transactions for this run",DIR("B")="N" K DA D ^DIR K DIR
I $D(DIRUT)!'Y S BDW("QFLG")=99 Q
S BDW("COUNT")=0
Q
POST ;EP
NEW X S X=$$ADD^XPDMENU("BDW BACKLOAD MENU","BDW BL VISITS RERUN","RRV",98)
I 'X W "Attempt to add VISIT BACKLOAD RERUN option failed." H 3
Q
BDW1VBLZ ;IHS/CMI/LAB - rerun visit backload log;
+1 ;;1.0;IHS DATA WAREHOUSE;;JAN 23, 2006
+2 ;
+3 ;
START ;
+1 DO EN^XBVK("BDW")
+2 ; Let ^BDWRDRI know this is a 'REDO'
SET BDWO("RUN")="REDO"
+3 DO BASICS^BDW1VBLI
+4 DO CHKSITE^BDW1VBLI
+5 ;I $D(^BDWTMP) W !!,"^BDWTMP exists from previous run" D EOJ Q
+6 ;
IF $DATA(^BDWDATA)
WRITE !!,"^BDWDATA EXISTS FROM PREVIOUS RUN"
DO EOJ
QUIT
+7 IF BDW("QFLG")=66
IF '$DATA(ZTQUEUED)
WRITE !,"Contact your site manager. ^BDWTMP still exists."
Begin DoDot:1
+8 SET DIR(0)="EO"
SET DIR("A")="Press any key to continue"
KILL DA
DO ^DIR
KILL DIR
End DoDot:1
DO EOJ
QUIT
+9 IF BDW("QFLG")
DO EOJ
WRITE !!,"Bye",!!
QUIT
+10 ; Get Log entry to redo
DO INIT
+11 IF BDW("QFLG")
DO EOJ
WRITE !!,"Bye",!!
QUIT
+12 DO QUEUE^BDW1VBLI
+13 IF BDW("QFLG")
DO EOJ
WRITE !!,"Bye",!!
QUIT
+14 IF $DATA(BDWO("QUEUE"))
DO EOJ
WRITE !!,"Okay your request is queued!",!!
QUIT
+15 DO DRIVER^BDW1VBL
EOJ ;
+1 DO EN^XBVK("BDW")
+2 QUIT
INIT ;EP
+1 SET DIC="^BDWBLOG("
SET DIC(0)="AEQ"
SET DIC("S")="I $P(^(0),U,9)=DUZ(2)"
DO ^DIC
KILL DIC
+2 IF Y<0
SET BDW("QFLG")=99
QUIT
+3 SET BDW("RUN LOG")=+Y
+4 ;
+5 SET X=^BDWBLOG(BDW("RUN LOG"),0)
SET BDW("RUN BEGIN")=$PIECE(X,U)
SET BDW("RUN END")=$PIECE(X,U,2)
SET BDW("COUNT")=$PIECE(X,U,6)
SET BDW("ORIG TX DATE")=$PIECE($PIECE(X,U,3),".")
+6 SET Y=BDW("RUN BEGIN")
XECUTE ^DD("DD")
SET BDW("PRINT BEGIN")=Y
+7 SET Y=BDW("RUN END")
XECUTE ^DD("DD")
SET BDW("PRINT END")=Y
+8 SET BDW("OLD VISITS")=$PIECE(^BDWBLOG(BDW("RUN LOG"),0),U,6)
+9 WRITE !!,"Log entry ",BDW("RUN LOG")," was for date range ",BDW("PRINT BEGIN")," through",!,BDW("PRINT END")," and generated ",BDW("COUNT")," transactions from ",BDW("OLD VISITS")," visits."
+10 ;
+11 WRITE !!,"This routine will re-generate the Data Warehouse Encounter Records."
RDD ;
+1 SET DIR(0)="Y"
SET DIR("A")="Do you want to regenerate the transactions for this run"
SET DIR("B")="N"
KILL DA
DO ^DIR
KILL DIR
+2 IF $DATA(DIRUT)!'Y
SET BDW("QFLG")=99
QUIT
+3 SET BDW("COUNT")=0
+4 QUIT
POST ;EP
+1 NEW X
SET X=$$ADD^XPDMENU("BDW BACKLOAD MENU","BDW BL VISITS RERUN","RRV",98)
+2 IF 'X
WRITE "Attempt to add VISIT BACKLOAD RERUN option failed."
HANG 3
+3 QUIT