BCHFC1 ; IHS/CMI/LAB - FORMS COUNT (FILE) report process ;
;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
;IHS/CMI/LAB - tmp to xtmp
P ; Run by posting date
S BCHH=$H,BCHJOB=$J
S BCHODAT=BCHSD_".9999" F S BCHODAT=$O(^BCHR("AD",BCHODAT)) Q:BCHODAT=""!((BCHODAT\1)>BCHED) D V1
S BCHET=$H
D EOJ
Q
V1 ;
S BCHVSIT="" F S BCHVSIT=$O(^BCHR("AD",BCHODAT,BCHVSIT)) Q:BCHVSIT'=+BCHVSIT I $D(^BCHR(BCHVSIT,0)) D PROC
Q
PROC ;
I BCHDEC'="ALL",BCHDEC'=$P(^BCHR(BCHVSIT,0),U,16) Q
Q:$P(^BCHR(BCHVSIT,0),U,16)=""
Q:'$D(^VA(200,$P(^BCHR(BCHVSIT,0),U,16),0))
S BCHAP=$P(^VA(200,$P(^BCHR(BCHVSIT,0),U,16),0),U)
S BCHVREC=^BCHR(BCHVSIT,0)
S BCHDATE=$P(BCHODAT,".")
SET S ^(BCHDATE)=$S($D(^XTMP("BCHFC",BCHJOB,BCHH,BCHAP,BCHDATE)):^(BCHDATE)+1,1:1)
Q
EOJ ; clean up and exit
K BCHVREC,BCHCLIN,BCHSKIP,BCH1,BCH2,BCHAP,BCHX,BCHY,BCHVDES,BCHDATE,BCHPROV,BCHSEC,BCHZ
Q
;
;
BCHFC1 ; IHS/CMI/LAB - FORMS COUNT (FILE) report process ;
+1 ;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
+2 ;IHS/CMI/LAB - tmp to xtmp
P ; Run by posting date
+1 SET BCHH=$HOROLOG
SET BCHJOB=$JOB
+2 SET BCHODAT=BCHSD_".9999"
FOR
SET BCHODAT=$ORDER(^BCHR("AD",BCHODAT))
IF BCHODAT=""!((BCHODAT\1)>BCHED)
QUIT
DO V1
+3 SET BCHET=$HOROLOG
+4 DO EOJ
+5 QUIT
V1 ;
+1 SET BCHVSIT=""
FOR
SET BCHVSIT=$ORDER(^BCHR("AD",BCHODAT,BCHVSIT))
IF BCHVSIT'=+BCHVSIT
QUIT
IF $DATA(^BCHR(BCHVSIT,0))
DO PROC
+2 QUIT
PROC ;
+1 IF BCHDEC'="ALL"
IF BCHDEC'=$PIECE(^BCHR(BCHVSIT,0),U,16)
QUIT
+2 IF $PIECE(^BCHR(BCHVSIT,0),U,16)=""
QUIT
+3 IF '$DATA(^VA(200,$PIECE(^BCHR(BCHVSIT,0),U,16),0))
QUIT
+4 SET BCHAP=$PIECE(^VA(200,$PIECE(^BCHR(BCHVSIT,0),U,16),0),U)
+5 SET BCHVREC=^BCHR(BCHVSIT,0)
+6 SET BCHDATE=$PIECE(BCHODAT,".")
SET SET ^(BCHDATE)=$SELECT($DATA(^XTMP("BCHFC",BCHJOB,BCHH,BCHAP,BCHDATE)):^(BCHDATE)+1,1:1)
+1 QUIT
EOJ ; clean up and exit
+1 KILL BCHVREC,BCHCLIN,BCHSKIP,BCH1,BCH2,BCHAP,BCHX,BCHY,BCHVDES,BCHDATE,BCHPROV,BCHSEC,BCHZ
+2 QUIT
+3 ;
+4 ;