AMHFC ; IHS/CMI/LAB - COUNT FORMS REPORT ;
;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
;
START ;
S AMHSITE="" S:$D(DUZ(2)) AMHSITE=DUZ(2)
I '$D(DUZ(2)) W $C(7),$C(7),!!,"SITE NOT SET IN DUZ(2) - NOTIFY SITE MANAGER!!",!! K AMHSITE Q
I 'DUZ(2) W $C(7),$C(7),!!,"SITE NOT SET IN DUZ(2) - NOTIFY SITE MANAGER",!! K AMHSITE 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 AMHBD=Y
ED ;get ending date
W ! S DIR(0)="D^"_AMHBD_":DT:EP",DIR("A")="Enter ending Posting Date" S Y=AMHBD D DD^%DT D ^DIR K DIR S:$D(DUOUT) DIRUT=1
I $D(DIRUT) G BD
S AMHED=Y
S X1=AMHBD,X2=-1 D C^%DTC S AMHSD=X
;
DEC ;
S DIR(0)="Y",DIR("B")="Y",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 AMHDEC="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 AMHDEC=+Y
ZIS ;
DEMO ;
D DEMOCHK^AMHUTIL1(.AMHDEMO)
I AMHDEMO=-1 G DEC
W !! S %ZIS="PQM" D ^%ZIS
I POP G XIT
I $D(IO("Q")) G TSKMN
DRIVER ; entry point for taskman
S AMHBT=$H
S U="^"
K ^XTMP("AMHFC",$J)
ZTSK ;
D ^AMHFC1
S AMHDT=$$FMTE^XLFDT(DT)
S AMHET=$H
U IO
D ^AMHFCP
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 %="AMHBD","AMHED","AMHSD","AMHBDD","AMHDEC","AMHSITE","AMHSRT","AMHPROC" S ZTSAVE(%)=""
S ZTCPU=$G(IOCPU),ZTRTN="DRIVER^AMHFC",ZTDTH="",ZTDESC="PCC DE/QA COUNTS" D ^%ZTLOAD D XIT Q
;
XIT ;
D ^%ZISC
K ^XTMP("AMHFC",$J)
K DIC,%DT,IO("Q"),X,Y,POP,DIRUT,ZTSK,AMHH,AMHM,AMHS,AMHTS,ZTIO,%ZIS,%,DTOUT,DUOUT,X1,X2
K AMH1,AMH2,AMH80S,AMHAP,AMHBD,AMHBDD,AMHBT,AMHDATE,AMHDEC,AMHDT,AMHED,AMHEDD,AMHET,AMHGOT,AMHFC,AMHVDES,AMHTDES,AMHDESU,AMHX
K AMHLENG,AMHODAT,AMHPG,AMHPROC,AMHPROV,AMHSD,AMHSITE,AMHSORT,AMHSRT,AMHSUB,AMHTOT,AMHVSIT,AMHVREC,AMHWDAT,AMHY,AMHC,AMHDFN,AMHAVG,AMHDEC
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
;
AMHFC ; IHS/CMI/LAB - COUNT FORMS REPORT ;
+1 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
+2 ;
START ;
+1 SET AMHSITE=""
IF $DATA(DUZ(2))
SET AMHSITE=DUZ(2)
+2 IF '$DATA(DUZ(2))
WRITE $CHAR(7),$CHAR(7),!!,"SITE NOT SET IN DUZ(2) - NOTIFY SITE MANAGER!!",!!
KILL AMHSITE
QUIT
+3 IF 'DUZ(2)
WRITE $CHAR(7),$CHAR(7),!!,"SITE NOT SET IN DUZ(2) - NOTIFY SITE MANAGER",!!
KILL AMHSITE
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 AMHBD=Y
ED ;get ending date
+1 WRITE !
SET DIR(0)="D^"_AMHBD_":DT:EP"
SET DIR("A")="Enter ending Posting Date"
SET Y=AMHBD
DO DD^%DT
DO ^DIR
KILL DIR
IF $DATA(DUOUT)
SET DIRUT=1
+2 IF $DATA(DIRUT)
GOTO BD
+3 SET AMHED=Y
+4 SET X1=AMHBD
SET X2=-1
DO C^%DTC
SET AMHSD=X
+5 ;
DEC ;
+1 SET DIR(0)="Y"
SET DIR("B")="Y"
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 AMHDEC="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 AMHDEC=+Y
ZIS ;
DEMO ;
+1 DO DEMOCHK^AMHUTIL1(.AMHDEMO)
+2 IF AMHDEMO=-1
GOTO DEC
+3 WRITE !!
SET %ZIS="PQM"
DO ^%ZIS
+4 IF POP
GOTO XIT
+5 IF $DATA(IO("Q"))
GOTO TSKMN
DRIVER ; entry point for taskman
+1 SET AMHBT=$HOROLOG
+2 SET U="^"
+3 KILL ^XTMP("AMHFC",$JOB)
ZTSK ;
+1 DO ^AMHFC1
+2 SET AMHDT=$$FMTE^XLFDT(DT)
+3 SET AMHET=$HOROLOG
+4 USE IO
+5 DO ^AMHFCP
+6 IF $DATA(ZTQUEUED)
SET ZTREQ="@"
+7 DO XIT
+8 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 %="AMHBD","AMHED","AMHSD","AMHBDD","AMHDEC","AMHSITE","AMHSRT","AMHPROC"
SET ZTSAVE(%)=""
+5 SET ZTCPU=$GET(IOCPU)
SET ZTRTN="DRIVER^AMHFC"
SET ZTDTH=""
SET ZTDESC="PCC DE/QA COUNTS"
DO ^%ZTLOAD
DO XIT
QUIT
+6 ;
XIT ;
+1 DO ^%ZISC
+2 KILL ^XTMP("AMHFC",$JOB)
+3 KILL DIC,%DT,IO("Q"),X,Y,POP,DIRUT,ZTSK,AMHH,AMHM,AMHS,AMHTS,ZTIO,%ZIS,%,DTOUT,DUOUT,X1,X2
+4 KILL AMH1,AMH2,AMH80S,AMHAP,AMHBD,AMHBDD,AMHBT,AMHDATE,AMHDEC,AMHDT,AMHED,AMHEDD,AMHET,AMHGOT,AMHFC,AMHVDES,AMHTDES,AMHDESU,AMHX
+5 KILL AMHLENG,AMHODAT,AMHPG,AMHPROC,AMHPROV,AMHSD,AMHSITE,AMHSORT,AMHSRT,AMHSUB,AMHTOT,AMHVSIT,AMHVREC,AMHWDAT,AMHY,AMHC,AMHDFN,AMHAVG,AMHDEC
+6 QUIT
+7 ;
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 ;