BDWSR ; IHS/CMI/LAB - DW REPORT ;
;;1.0;IHS DATA WAREHOUSE;;JAN 23, 2006
;IHS/CMI/LAB - changed TMP to XTMP
;
START ;
W:$D(IOF) @IOF
W !,"********** DATA WAREHOUSE EXPORT SUMMARY REPORT **********",!
W !!,"This report presents a summary of data for a single Data Warehouse ",!,"Export Log entry.",!!
LOG ;
S BDWSR("LOG")=""
K DIC S DIC="^BDWXLOG(",DIC(0)="AEQM" D ^DIC I Y<0 G XIT
S BDWSR("LOG")=+Y
I $P(^BDWXLOG(BDWSR("LOG"),0),U,7)'="R" W !!,"This report can only be run on regular exports, not date range exports.",! G LOG
I '$D(^BDWXLOG(BDWSR("LOG"),21)) W !!,"Visit data has already been purged!!" G LOG
S X=^BDWXLOG(BDWSR("LOG"),0),BDWSR("RUN BEGIN")=$P(X,U),BDWSR("RUN END")=$P(X,U,2),BDWSR("COUNT")=$P(X,U,6),BDWSR("ORIG TX DATE")=$P($P(X,U,3),".")
S Y=BDWSR("RUN BEGIN") X ^DD("DD") S BDWSR("PRINT BEGIN")=Y
S Y=BDWSR("RUN END") X ^DD("DD") S BDWSR("PRINT END")=Y
S BDWSR("VISITS")=$P(^BDWXLOG(BDWSR("LOG"),21,0),U,4)
W !!,"Log entry ",BDWSR("LOG"),", was for date range ",BDWSR("PRINT BEGIN")," through",!,BDWSR("PRINT END")," and exported the following:",!
W ?5,"Patient Registration updates: ",$P(^BDWXLOG(BDWSR("LOG"),0),U,11)
W !?5," PCC Encounters: ",$P(^BDWXLOG(BDWSR("LOG"),0),U,18)
W !?5," Total transactions exported: ",$P(^BDWXLOG(BDWSR("LOG"),0),U,6)
S Y=DT D DD^%DT S BDWSR("DTP")=Y
S BDWS("PROV FILE")=$S($P(^DD(9000010.06,.01,0),U,2)[200:200,1:6)
ZIS ;call to XBDBQUE
S XBRP="PRINT^BDWSR",XBRC="PROCESS^BDWSR",XBRX="XIT^BDWSR",XBNS="BDW"
D ^XBDBQUE
D XIT
Q
PROCESS ; Entry point for Taskman
S BDWJOB=$J,BDWBTH=$H
K ^XTMP("BDWSR",BDWJOB,BDWBTH),^XTMP("BDWSRP",BDWJOB,BDWBTH)
S ^XTMP("BDWSR",0)=$$FMADD^XLFDT(DT,14)_"^"_DT_"^"_"DATA WAREHOUSE SUM REPORT"
S BDWSR("BT")=$H
;D CHKSITE^BDWRDRI
S APCDOVRR=1,BDWSR="BDWSR"
D V^BDWSR1
D SET
S BDWSR("ET")=$H
Q
PRINT ;EP
D ^BDWSRP
K ^XTMP("BDWSR",BDWJOB,BDWBTH),^XTMP("BDWSRP",BDWJOB,BDWBTH)
Q
XIT ;
K DA,DIE,DIC,POP,DIR
D EN^XBVK("BDW")
Q
SET ;EP
S BDWSR("1")="ERRORSC",BDWSR("3")="ERRORS" D SET1
S BDWSR("1")="PROVC",BDWSR("3")="PROV" D SET2
S BDWSR("1")="TYPEC",BDWSR("3")="TYPE" D SET2
S BDWSR("1")="SCC",BDWSR("3")="SC" D SET2
S BDWSR("1")="CLINICC",BDWSR("3")="CLINIC" D SET2
S BDWSR("1")="LOCC",BDWSR("3")="LOC" D SET2
S BDWSR("1")="PROV REM CC",BDWSR("3")="PROV REM" D SET1
S BDWSR("1")="CLINIC REM CC",BDWSR("3")="CLINIC REM" D SET1
S BDWSR("1")="LOC REM CC",BDWSR("3")="LOC REM" D SET1
S BDWSR("1")="SC REM CC",BDWSR("3")="SC REM" D SET1
S BDWSR("1")="TYPE REM CC",BDWSR("3")="TYPE REM" D SET1
S BDWSR("1")="PROV CHA CC",BDWSR("3")="PROV CHA" D SET2
S BDWSR("1")="CLINIC CHA CC",BDWSR("3")="CLINIC CHA" D SET2
S BDWSR("1")="LOC CHA CC",BDWSR("3")="LOC CHA" D SET2
S BDWSR("1")="SC CHA CC",BDWSR("3")="SC CHA" D SET2
S BDWSR("1")="TYPE CHA CC",BDWSR("3")="TYPE CHA" D SET2
S BDWSR("1")="PROV STATDB CC",BDWSR("3")="PROV STATDB" D SET2
S BDWSR("1")="CLINIC STATDB CC",BDWSR("3")="CLINIC STATDB" D SET2
S BDWSR("1")="LOC STATDB CC",BDWSR("3")="LOC STATDB" D SET2
S BDWSR("1")="SC STATDB CC",BDWSR("3")="SC STATDB" D SET2
S BDWSR("1")="TYPE STATDB CC",BDWSR("3")="TYPE STATDB" D SET2
S BDWSR("1")="TYPE ERROR CC",BDWSR("3")="TYPE ERROR" D SET1
S BDWSR("1")="CLINIC ERROR CC",BDWSR("3")="CLINIC ERROR" D SET1
S BDWSR("1")="PROV HOSP CC",BDWSR("3")="PROV HOSP" D SET2
S BDWSR("1")="TYPE HOSP CC",BDWSR("3")="TYPE HOSP" D SET2
S BDWSR("1")="SC HOSP CC",BDWSR("3")="SC HOSP" D SET2
S BDWSR("1")="LOC HOSP CC",BDWSR("3")="LOC HOSP" D SET2
S BDWSR("1")="SC ERROR CC",BDWSR("3")="SC ERROR" D SET1
Q
SET1 ;
S BDWSR("PROC")=""""_BDWSR_""",BDWJOB,BDWBTH,"_""""_"SKIPPED"_""""
S BDWSR("2")="^XTMP("_BDWSR("PROC")_","""_BDWSR("3")_""",X)"
S X="" F S X=$O(@BDWSR("2")) Q:X="" S %=^(X) S ^XTMP("BDWSR",BDWJOB,BDWBTH,"SKIPPED",BDWSR("1"),9999999-%,X)=%
Q
SET2 ;
S BDWSR("PROC")=""""_BDWSR_""",BDWJOB,BDWBTH,"_""""_"GEN"_""""
S BDWSR("2")="^XTMP("_BDWSR("PROC")_","""_BDWSR("3")_""",X)"
S X="" F S X=$O(@BDWSR("2")) Q:X="" S %=^(X) S ^XTMP("BDWSR",BDWJOB,BDWBTH,"GEN",BDWSR("1"),9999999-%,X)=%
Q
BDWSR ; IHS/CMI/LAB - DW REPORT ;
+1 ;;1.0;IHS DATA WAREHOUSE;;JAN 23, 2006
+2 ;IHS/CMI/LAB - changed TMP to XTMP
+3 ;
START ;
+1 IF $DATA(IOF)
WRITE @IOF
+2 WRITE !,"********** DATA WAREHOUSE EXPORT SUMMARY REPORT **********",!
+3 WRITE !!,"This report presents a summary of data for a single Data Warehouse ",!,"Export Log entry.",!!
LOG ;
+1 SET BDWSR("LOG")=""
+2 KILL DIC
SET DIC="^BDWXLOG("
SET DIC(0)="AEQM"
DO ^DIC
IF Y<0
GOTO XIT
+3 SET BDWSR("LOG")=+Y
+4 IF $PIECE(^BDWXLOG(BDWSR("LOG"),0),U,7)'="R"
WRITE !!,"This report can only be run on regular exports, not date range exports.",!
GOTO LOG
+5 IF '$DATA(^BDWXLOG(BDWSR("LOG"),21))
WRITE !!,"Visit data has already been purged!!"
GOTO LOG
+6 SET X=^BDWXLOG(BDWSR("LOG"),0)
SET BDWSR("RUN BEGIN")=$PIECE(X,U)
SET BDWSR("RUN END")=$PIECE(X,U,2)
SET BDWSR("COUNT")=$PIECE(X,U,6)
SET BDWSR("ORIG TX DATE")=$PIECE($PIECE(X,U,3),".")
+7 SET Y=BDWSR("RUN BEGIN")
XECUTE ^DD("DD")
SET BDWSR("PRINT BEGIN")=Y
+8 SET Y=BDWSR("RUN END")
XECUTE ^DD("DD")
SET BDWSR("PRINT END")=Y
+9 SET BDWSR("VISITS")=$PIECE(^BDWXLOG(BDWSR("LOG"),21,0),U,4)
+10 WRITE !!,"Log entry ",BDWSR("LOG"),", was for date range ",BDWSR("PRINT BEGIN")," through",!,BDWSR("PRINT END")," and exported the following:",!
+11 WRITE ?5,"Patient Registration updates: ",$PIECE(^BDWXLOG(BDWSR("LOG"),0),U,11)
+12 WRITE !?5," PCC Encounters: ",$PIECE(^BDWXLOG(BDWSR("LOG"),0),U,18)
+13 WRITE !?5," Total transactions exported: ",$PIECE(^BDWXLOG(BDWSR("LOG"),0),U,6)
+14 SET Y=DT
DO DD^%DT
SET BDWSR("DTP")=Y
+15 SET BDWS("PROV FILE")=$SELECT($PIECE(^DD(9000010.06,.01,0),U,2)[200:200,1:6)
ZIS ;call to XBDBQUE
+1 SET XBRP="PRINT^BDWSR"
SET XBRC="PROCESS^BDWSR"
SET XBRX="XIT^BDWSR"
SET XBNS="BDW"
+2 DO ^XBDBQUE
+3 DO XIT
+4 QUIT
PROCESS ; Entry point for Taskman
+1 SET BDWJOB=$JOB
SET BDWBTH=$HOROLOG
+2 KILL ^XTMP("BDWSR",BDWJOB,BDWBTH),^XTMP("BDWSRP",BDWJOB,BDWBTH)
+3 SET ^XTMP("BDWSR",0)=$$FMADD^XLFDT(DT,14)_"^"_DT_"^"_"DATA WAREHOUSE SUM REPORT"
+4 SET BDWSR("BT")=$HOROLOG
+5 ;D CHKSITE^BDWRDRI
+6 SET APCDOVRR=1
SET BDWSR="BDWSR"
+7 DO V^BDWSR1
+8 DO SET
+9 SET BDWSR("ET")=$HOROLOG
+10 QUIT
PRINT ;EP
+1 DO ^BDWSRP
+2 KILL ^XTMP("BDWSR",BDWJOB,BDWBTH),^XTMP("BDWSRP",BDWJOB,BDWBTH)
+3 QUIT
XIT ;
+1 KILL DA,DIE,DIC,POP,DIR
+2 DO EN^XBVK("BDW")
+3 QUIT
SET ;EP
+1 SET BDWSR("1")="ERRORSC"
SET BDWSR("3")="ERRORS"
DO SET1
+2 SET BDWSR("1")="PROVC"
SET BDWSR("3")="PROV"
DO SET2
+3 SET BDWSR("1")="TYPEC"
SET BDWSR("3")="TYPE"
DO SET2
+4 SET BDWSR("1")="SCC"
SET BDWSR("3")="SC"
DO SET2
+5 SET BDWSR("1")="CLINICC"
SET BDWSR("3")="CLINIC"
DO SET2
+6 SET BDWSR("1")="LOCC"
SET BDWSR("3")="LOC"
DO SET2
+7 SET BDWSR("1")="PROV REM CC"
SET BDWSR("3")="PROV REM"
DO SET1
+8 SET BDWSR("1")="CLINIC REM CC"
SET BDWSR("3")="CLINIC REM"
DO SET1
+9 SET BDWSR("1")="LOC REM CC"
SET BDWSR("3")="LOC REM"
DO SET1
+10 SET BDWSR("1")="SC REM CC"
SET BDWSR("3")="SC REM"
DO SET1
+11 SET BDWSR("1")="TYPE REM CC"
SET BDWSR("3")="TYPE REM"
DO SET1
+12 SET BDWSR("1")="PROV CHA CC"
SET BDWSR("3")="PROV CHA"
DO SET2
+13 SET BDWSR("1")="CLINIC CHA CC"
SET BDWSR("3")="CLINIC CHA"
DO SET2
+14 SET BDWSR("1")="LOC CHA CC"
SET BDWSR("3")="LOC CHA"
DO SET2
+15 SET BDWSR("1")="SC CHA CC"
SET BDWSR("3")="SC CHA"
DO SET2
+16 SET BDWSR("1")="TYPE CHA CC"
SET BDWSR("3")="TYPE CHA"
DO SET2
+17 SET BDWSR("1")="PROV STATDB CC"
SET BDWSR("3")="PROV STATDB"
DO SET2
+18 SET BDWSR("1")="CLINIC STATDB CC"
SET BDWSR("3")="CLINIC STATDB"
DO SET2
+19 SET BDWSR("1")="LOC STATDB CC"
SET BDWSR("3")="LOC STATDB"
DO SET2
+20 SET BDWSR("1")="SC STATDB CC"
SET BDWSR("3")="SC STATDB"
DO SET2
+21 SET BDWSR("1")="TYPE STATDB CC"
SET BDWSR("3")="TYPE STATDB"
DO SET2
+22 SET BDWSR("1")="TYPE ERROR CC"
SET BDWSR("3")="TYPE ERROR"
DO SET1
+23 SET BDWSR("1")="CLINIC ERROR CC"
SET BDWSR("3")="CLINIC ERROR"
DO SET1
+24 SET BDWSR("1")="PROV HOSP CC"
SET BDWSR("3")="PROV HOSP"
DO SET2
+25 SET BDWSR("1")="TYPE HOSP CC"
SET BDWSR("3")="TYPE HOSP"
DO SET2
+26 SET BDWSR("1")="SC HOSP CC"
SET BDWSR("3")="SC HOSP"
DO SET2
+27 SET BDWSR("1")="LOC HOSP CC"
SET BDWSR("3")="LOC HOSP"
DO SET2
+28 SET BDWSR("1")="SC ERROR CC"
SET BDWSR("3")="SC ERROR"
DO SET1
+29 QUIT
SET1 ;
+1 SET BDWSR("PROC")=""""_BDWSR_""",BDWJOB,BDWBTH,"_""""_"SKIPPED"_""""
+2 SET BDWSR("2")="^XTMP("_BDWSR("PROC")_","""_BDWSR("3")_""",X)"
+3 SET X=""
FOR
SET X=$ORDER(@BDWSR("2"))
IF X=""
QUIT
SET %=^(X)
SET ^XTMP("BDWSR",BDWJOB,BDWBTH,"SKIPPED",BDWSR("1"),9999999-%,X)=%
+4 QUIT
SET2 ;
+1 SET BDWSR("PROC")=""""_BDWSR_""",BDWJOB,BDWBTH,"_""""_"GEN"_""""
+2 SET BDWSR("2")="^XTMP("_BDWSR("PROC")_","""_BDWSR("3")_""",X)"
+3 SET X=""
FOR
SET X=$ORDER(@BDWSR("2"))
IF X=""
QUIT
SET %=^(X)
SET ^XTMP("BDWSR",BDWJOB,BDWBTH,"GEN",BDWSR("1"),9999999-%,X)=%
+4 QUIT