BDWSR1 ; IHS/CMI/LAB - DW REPORT 1 ;
;;1.0;IHS DATA WAREHOUSE;;JAN 23, 2006
V ;EP
S BDWSR("V")=0 F S BDWSR("V")=$O(^BDWXLOG(BDWSR("LOG"),21,BDWSR("V"))) Q:BDWSR("V")'=+BDWSR("V") D PROC
Q
PROC ;
Q:'$D(^AUPNVSIT(BDWSR("V"),0))
I '$P(^BDWXLOG(BDWSR("LOG"),21,BDWSR("V"),0),U,2) Q
D STATDB
Q
STATDB ;
S BDWSR("PROC")=""""_BDWSR_""",BDWJOB,BDWBTH,"_""""_"GEN"_""""
S BDWVAR="TYPE STATDB" D TYPE^BDWSR2 S BDWVAR="SC STATDB" D SC^BDWSR2 S BDWVAR="CLINIC STATDB" D CLINIC^BDWSR2 S BDWVAR="LOC STATDB" D LOC^BDWSR2 S BDWVAR="PROV STATDB" D PROV^BDWSR2 S BDWVAR="V DATE STATDB" D VD^BDWSR2
Q
COUNT ;
I '$D(@X) S @X=0
S %=@X,%=%+1,@X=%
Q
BDWSR1 ; IHS/CMI/LAB - DW REPORT 1 ;
+1 ;;1.0;IHS DATA WAREHOUSE;;JAN 23, 2006
V ;EP
+1 SET BDWSR("V")=0
FOR
SET BDWSR("V")=$ORDER(^BDWXLOG(BDWSR("LOG"),21,BDWSR("V")))
IF BDWSR("V")'=+BDWSR("V")
QUIT
DO PROC
+2 QUIT
PROC ;
+1 IF '$DATA(^AUPNVSIT(BDWSR("V"),0))
QUIT
+2 IF '$PIECE(^BDWXLOG(BDWSR("LOG"),21,BDWSR("V"),0),U,2)
QUIT
+3 DO STATDB
+4 QUIT
STATDB ;
+1 SET BDWSR("PROC")=""""_BDWSR_""",BDWJOB,BDWBTH,"_""""_"GEN"_""""
+2 SET BDWVAR="TYPE STATDB"
DO TYPE^BDWSR2
SET BDWVAR="SC STATDB"
DO SC^BDWSR2
SET BDWVAR="CLINIC STATDB"
DO CLINIC^BDWSR2
SET BDWVAR="LOC STATDB"
DO LOC^BDWSR2
SET BDWVAR="PROV STATDB"
DO PROV^BDWSR2
SET BDWVAR="V DATE STATDB"
DO VD^BDWSR2
+3 QUIT
COUNT ;
+1 IF '$DATA(@X)
SET @X=0
+2 SET %=@X
SET %=%+1
SET @X=%
+3 QUIT