APCDFC ; IHS/CMI/LAB - COUNT FORMS REPORT ;
;;2.0;IHS PCC SUITE;;MAY 14, 2009
;
START ;
S APCDSITE="" S:$D(DUZ(2)) APCDSITE=DUZ(2)
I '$D(DUZ(2)) W $C(7),$C(7),!!,"SITE NOT SET IN DUZ(2) - NOTIFY SITE MANAGER!!",!! K APCDSITE Q
I 'DUZ(2) W $C(7),$C(7),!!,"SITE NOT SET IN DUZ(2) - NOTIFY SITE MANAGER",!! K APCDSITE 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 APCDBD=Y
ED ;get ending date
W ! S DIR(0)="DA^"_APCDBD_":DT:EP",DIR("A")="Enter ending Posting Date: " S Y=APCDBD D DD^%DT S DIR("B")=Y,Y="" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
I $D(DIRUT) G BD
S APCDED=Y
S X1=APCDBD,X2=-1 D C^%DTC S APCDSD=X
;
DEC ;
I $G(APCDONE) S APCDDEC=DUZ G SORT
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 APCDDEC="ALL" G SORT
DEC1 ;enter location
S DIC("A")="Which Operator: ",DIC="^VA(200,",DIC(0)="AEMQ" D ^DIC K DIC,DA G:Y<0 DEC
S APCDDEC=+Y
SORT ;
S DIR(0)="S^1:CLINIC TYPE;2:SERVICE CATEGORY;3:VISIT TYPE;4:INCLUDE ALL VISITS",DIR("A")="Count number of Forms Processed by",DIR("B")="4" D ^DIR K DIR
I $D(DIRUT) G DEC
S APCDPROC=+Y I APCDPROC=4 S APCDSRT="" G SUB
S APCDSRT=Y(0)
SUB ;subtotal by visit date
S APCDSUBV=""
S DIR(0)="Y",DIR("A")="Subtotal by Visit Date",DIR("B")="N" KILL DA D ^DIR KILL DIR
G:$D(DIRUT) SORT
S APCDSUBV=Y
ZIS W !! S %ZIS="PQM" D ^%ZIS
I POP G XIT
I $D(IO("Q")) G TSKMN
DRIVER ; entry point for taskman
S APCDBT=$H
S U="^"
K ^XTMP("APCDFC",$J)
ZTSK ;
D ^APCDFC1
S APCDET=$H
U IO
D ^APCDFCP
S:$D(ZTQUEUED) ZTREQ="@"
D XIT
Q
ERR W $C(7),$C(7),!,"Must be a valid date and be Today or earlier. Time not allowed!" Q
TSKMN ;
S ZTIO=$S($D(ION):ION,1:IO) I $D(IOST)#2,IOST]"" S ZTIO=ZTIO_";"_IOST
I $G(IO("DOC"))]"" S ZTIO=ZTIO_";"_$G(IO("DOC"))
I $D(IOM)#2,IOM S ZTIO=ZTIO_";"_IOM I $D(IOSL)#2,IOSL S ZTIO=ZTIO_";"_IOSL
K ZTSAVE F %="APCDBD","APCDED","APCDSD","APCDBDD","APCDDEC","APCDSITE","APCDSRT","APCDPROC","APCDSUBV" S ZTSAVE(%)=""
S ZTCPU=$G(IOCPU),ZTRTN="DRIVER^APCDFC",ZTDTH="",ZTDESC="PCC DE/QA COUNTS" D ^%ZTLOAD D XIT Q
;
XIT ;
D ^%ZISC
;I '$D(ZTSK) S IOP=$I D ^%ZIS U IO(0)
K ^XTMP("APCDFC",$J)
K DIC,%DT,IO("Q"),X,Y,POP,DIRUT,ZTSK,APCDH,APCDM,APCDS,APCDTS,ZTIO
K APCD1,APCD2,APCD80S,APCDAP,APCDBD,APCDBDD,APCDBT,APCDDATE,APCDDEC,APCDDT,APCDED,APCDEDD,APCDET,APCDGOT,APCDFC,APCDVDES,APCDTDES,APCDDESU,APCDX,APCDVDAT,APCDSUBV
K APCDLENG,APCDODAT,APCDPG,APCDPROC,APCDPROV,APCDSD,APCDSITE,APCDSORT,APCDSRT,APCDSUB,APCDTOT,APCDVDFN,APCDVREC,APCDWDAT,APCDY,APCDC,APCDDFN,APCDAVG,APCDDEC
Q
;
INFORM ;
W:$D(IOF) @IOF
W !,"This report will generate a count of visits entered by a particular data entry",!,"operator or for ALL data entry operators for a date range that you specify.",!
W !,"The report can be subtotaled by CLINIC TYPE, SERVICE CATEGORY OR BY VISIT TYPE.",!
Q
;
APCDFC ; IHS/CMI/LAB - COUNT FORMS REPORT ;
+1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
+2 ;
START ;
+1 SET APCDSITE=""
IF $DATA(DUZ(2))
SET APCDSITE=DUZ(2)
+2 IF '$DATA(DUZ(2))
WRITE $CHAR(7),$CHAR(7),!!,"SITE NOT SET IN DUZ(2) - NOTIFY SITE MANAGER!!",!!
KILL APCDSITE
QUIT
+3 IF 'DUZ(2)
WRITE $CHAR(7),$CHAR(7),!!,"SITE NOT SET IN DUZ(2) - NOTIFY SITE MANAGER",!!
KILL APCDSITE
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 APCDBD=Y
ED ;get ending date
+1 WRITE !
SET DIR(0)="DA^"_APCDBD_":DT:EP"
SET DIR("A")="Enter ending Posting Date: "
SET Y=APCDBD
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 APCDED=Y
+4 SET X1=APCDBD
SET X2=-1
DO C^%DTC
SET APCDSD=X
+5 ;
DEC ;
+1 IF $GET(APCDONE)
SET APCDDEC=DUZ
GOTO SORT
+2 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
+3 IF $DATA(DIRUT)
GOTO BD
+4 IF Y=1
SET APCDDEC="ALL"
GOTO SORT
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 APCDDEC=+Y
SORT ;
+1 SET DIR(0)="S^1:CLINIC TYPE;2:SERVICE CATEGORY;3:VISIT TYPE;4:INCLUDE ALL VISITS"
SET DIR("A")="Count number of Forms Processed by"
SET DIR("B")="4"
DO ^DIR
KILL DIR
+2 IF $DATA(DIRUT)
GOTO DEC
+3 SET APCDPROC=+Y
IF APCDPROC=4
SET APCDSRT=""
GOTO SUB
+4 SET APCDSRT=Y(0)
SUB ;subtotal by visit date
+1 SET APCDSUBV=""
+2 SET DIR(0)="Y"
SET DIR("A")="Subtotal by Visit Date"
SET DIR("B")="N"
KILL DA
DO ^DIR
KILL DIR
+3 IF $DATA(DIRUT)
GOTO SORT
+4 SET APCDSUBV=Y
ZIS WRITE !!
SET %ZIS="PQM"
DO ^%ZIS
+1 IF POP
GOTO XIT
+2 IF $DATA(IO("Q"))
GOTO TSKMN
DRIVER ; entry point for taskman
+1 SET APCDBT=$HOROLOG
+2 SET U="^"
+3 KILL ^XTMP("APCDFC",$JOB)
ZTSK ;
+1 DO ^APCDFC1
+2 SET APCDET=$HOROLOG
+3 USE IO
+4 DO ^APCDFCP
+5 IF $DATA(ZTQUEUED)
SET ZTREQ="@"
+6 DO XIT
+7 QUIT
ERR WRITE $CHAR(7),$CHAR(7),!,"Must be a valid date and be Today or earlier. Time not allowed!"
QUIT
TSKMN ;
+1 SET ZTIO=$SELECT($DATA(ION):ION,1:IO)
IF $DATA(IOST)#2
IF IOST]""
SET ZTIO=ZTIO_";"_IOST
+2 IF $GET(IO("DOC"))]""
SET ZTIO=ZTIO_";"_$GET(IO("DOC"))
+3 IF $DATA(IOM)#2
IF IOM
SET ZTIO=ZTIO_";"_IOM
IF $DATA(IOSL)#2
IF IOSL
SET ZTIO=ZTIO_";"_IOSL
+4 KILL ZTSAVE
FOR %="APCDBD","APCDED","APCDSD","APCDBDD","APCDDEC","APCDSITE","APCDSRT","APCDPROC","APCDSUBV"
SET ZTSAVE(%)=""
+5 SET ZTCPU=$GET(IOCPU)
SET ZTRTN="DRIVER^APCDFC"
SET ZTDTH=""
SET ZTDESC="PCC DE/QA COUNTS"
DO ^%ZTLOAD
DO XIT
QUIT
+6 ;
XIT ;
+1 DO ^%ZISC
+2 ;I '$D(ZTSK) S IOP=$I D ^%ZIS U IO(0)
+3 KILL ^XTMP("APCDFC",$JOB)
+4 KILL DIC,%DT,IO("Q"),X,Y,POP,DIRUT,ZTSK,APCDH,APCDM,APCDS,APCDTS,ZTIO
+5 KILL APCD1,APCD2,APCD80S,APCDAP,APCDBD,APCDBDD,APCDBT,APCDDATE,APCDDEC,APCDDT,APCDED,APCDEDD,APCDET,APCDGOT,APCDFC,APCDVDES,APCDTDES,APCDDESU,APCDX,APCDVDAT,APCDSUBV
+6 KILL APCDLENG,APCDODAT,APCDPG,APCDPROC,APCDPROV,APCDSD,APCDSITE,APCDSORT,APCDSRT,APCDSUB,APCDTOT,APCDVDFN,APCDVREC,APCDWDAT,APCDY,APCDC,APCDDFN,APCDAVG,APCDDEC
+7 QUIT
+8 ;
INFORM ;
+1 IF $DATA(IOF)
WRITE @IOF
+2 WRITE !,"This report will generate a count of visits entered by a particular data entry",!,"operator or for ALL data entry operators for a date range that you specify.",!
+3 WRITE !,"The report can be subtotaled by CLINIC TYPE, SERVICE CATEGORY OR BY VISIT TYPE.",!
+4 QUIT
+5 ;