BCHFC ; IHS/CMI/LAB - COUNT FORMS REPORT ;
;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
;
START ;
S BCHSITE="" S:$D(DUZ(2)) BCHSITE=DUZ(2)
I '$D(DUZ(2)) W $C(7),$C(7),!!,"SITE NOT SET IN DUZ(2) - NOTIFY SITE MANAGER!!",!! K BCHSITE Q
I 'DUZ(2) W $C(7),$C(7),!!,"SITE NOT SET IN DUZ(2) - NOTIFY SITE MANAGER",!! K BCHSITE Q
D INFORM
GETDATES ;
BD ;get beginning date
W ! S DIR(0)="D^:DT:EP",DIR("A")="Enter beginning Posting Date" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
I $D(DIRUT) G XIT
S BCHBD=Y
ED ;get ending date
W ! S DIR(0)="D^"_BCHBD_":DT:EP",DIR("A")="Enter ending Posting Date" S Y=BCHBD D DD^%DT S DIR("B")=Y,Y="" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
I $D(DIRUT) G BD
S BCHED=Y
S X1=BCHBD,X2=-1 D C^%DTC S BCHSD=X
;
DEC ;
S DIR(0)="YO",DIR("A")="Report on ALL Operators",DIR("?")="If you wish to include visits entered by ALL Operators answer Yes. If you wish to tabulate for only one operator enter NO." D ^DIR K DIR
G:$D(DIRUT) BD
I Y=1 S BCHDEC="ALL" G ZIS
DEC1 ;enter location
S DIC("A")="Which Operator: ",DIC="^VA(200,",DIC(0)="AEMQ" D ^DIC K DIC,DA G:Y<0 DEC
S BCHDEC=+Y
ZIS ;
S XBRP="^BCHFCP",XBRC="DRIVER^BCHFC",XBRX="XIT^BCHFC",XBNS="BCH"
D ^XBDBQUE
D XIT
Q
DRIVER ; entry point for taskman
S BCHBT=$H
S U="^"
D XTMP^BCHUTIL("BCHFC","CHR FORMS COUNT")
D ^BCHFC1
Q
ERR W $C(7),$C(7),!,"Must be a valid date and be Today or earlier. Time not allowed!" Q
XIT ;
K DIC,%DT,IO("Q"),X,Y,POP,DIRUT,ZTSK,BCHH,BCHM,BCHS,BCHTS,ZTIO,%ZIS,%,DTOUT,DUOUT,X1,X2
K BCH1,BCH2,BCH80S,BCHAP,BCHBD,BCHBDD,BCHBT,BCHDATE,BCHDEC,BCHDT,BCHED,BCHEDD,BCHET,BCHGOT,BCHFC,BCHVDES,BCHTDES,BCHDESU,BCHX,BCHQUIT
K BCHLENG,BCHODAT,BCHPG,BCHPROC,BCHPROV,BCHSD,BCHSITE,BCHSORT,BCHSRT,BCHSUB,BCHTOT,BCHVSIT,BCHVREC,BCHWDAT,BCHY,BCHC,BCHDFN,BCHAVG,BCHDEC
Q
;
INFORM ;
W:$D(IOF) @IOF
W !,"This report will generate a count of forms entered by a particular data entry",!,"operator or for ALL data entry operators for a date range that you specify.",!
Q
;
BCHFC ; IHS/CMI/LAB - COUNT FORMS REPORT ;
+1 ;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
+2 ;
START ;
+1 SET BCHSITE=""
IF $DATA(DUZ(2))
SET BCHSITE=DUZ(2)
+2 IF '$DATA(DUZ(2))
WRITE $CHAR(7),$CHAR(7),!!,"SITE NOT SET IN DUZ(2) - NOTIFY SITE MANAGER!!",!!
KILL BCHSITE
QUIT
+3 IF 'DUZ(2)
WRITE $CHAR(7),$CHAR(7),!!,"SITE NOT SET IN DUZ(2) - NOTIFY SITE MANAGER",!!
KILL BCHSITE
QUIT
+4 DO INFORM
GETDATES ;
BD ;get beginning date
+1 WRITE !
SET DIR(0)="D^:DT:EP"
SET DIR("A")="Enter beginning Posting Date"
DO ^DIR
KILL DIR
IF $DATA(DUOUT)
SET DIRUT=1
+2 IF $DATA(DIRUT)
GOTO XIT
+3 SET BCHBD=Y
ED ;get ending date
+1 WRITE !
SET DIR(0)="D^"_BCHBD_":DT:EP"
SET DIR("A")="Enter ending Posting Date"
SET Y=BCHBD
DO DD^%DT
SET DIR("B")=Y
SET Y=""
DO ^DIR
KILL DIR
IF $DATA(DUOUT)
SET DIRUT=1
+2 IF $DATA(DIRUT)
GOTO BD
+3 SET BCHED=Y
+4 SET X1=BCHBD
SET X2=-1
DO C^%DTC
SET BCHSD=X
+5 ;
DEC ;
+1 SET DIR(0)="YO"
SET DIR("A")="Report on ALL Operators"
SET DIR("?")="If you wish to include visits entered by ALL Operators answer Yes. If you wish to tabulate for only one operator enter NO."
DO ^DIR
KILL DIR
+2 IF $DATA(DIRUT)
GOTO BD
+3 IF Y=1
SET BCHDEC="ALL"
GOTO ZIS
DEC1 ;enter location
+1 SET DIC("A")="Which Operator: "
SET DIC="^VA(200,"
SET DIC(0)="AEMQ"
DO ^DIC
KILL DIC,DA
IF Y<0
GOTO DEC
+2 SET BCHDEC=+Y
ZIS ;
+1 SET XBRP="^BCHFCP"
SET XBRC="DRIVER^BCHFC"
SET XBRX="XIT^BCHFC"
SET XBNS="BCH"
+2 DO ^XBDBQUE
+3 DO XIT
+4 QUIT
DRIVER ; entry point for taskman
+1 SET BCHBT=$HOROLOG
+2 SET U="^"
+3 DO XTMP^BCHUTIL("BCHFC","CHR FORMS COUNT")
+4 DO ^BCHFC1
+5 QUIT
ERR WRITE $CHAR(7),$CHAR(7),!,"Must be a valid date and be Today or earlier. Time not allowed!"
QUIT
XIT ;
+1 KILL DIC,%DT,IO("Q"),X,Y,POP,DIRUT,ZTSK,BCHH,BCHM,BCHS,BCHTS,ZTIO,%ZIS,%,DTOUT,DUOUT,X1,X2
+2 KILL BCH1,BCH2,BCH80S,BCHAP,BCHBD,BCHBDD,BCHBT,BCHDATE,BCHDEC,BCHDT,BCHED,BCHEDD,BCHET,BCHGOT,BCHFC,BCHVDES,BCHTDES,BCHDESU,BCHX,BCHQUIT
+3 KILL BCHLENG,BCHODAT,BCHPG,BCHPROC,BCHPROV,BCHSD,BCHSITE,BCHSORT,BCHSRT,BCHSUB,BCHTOT,BCHVSIT,BCHVREC,BCHWDAT,BCHY,BCHC,BCHDFN,BCHAVG,BCHDEC
+4 QUIT
+5 ;
INFORM ;
+1 IF $DATA(IOF)
WRITE @IOF
+2 WRITE !,"This report will generate a count of forms entered by a particular data entry",!,"operator or for ALL data entry operators for a date range that you specify.",!
+3 QUIT
+4 ;