- APCLCAW ; IHS/CMI/LAB -CLINIC VISITS TALLY OF WALKIN&APPT ;
- ;;2.0;IHS PCC SUITE;;MAY 14, 2009
- ;
- START ;
- I '$G(DUZ(2)) W $C(7),$C(7),!!,"SITE NOT SET IN DUZ(2) - NOTIFY SITE MANAGER!!",!! K APCLSITE Q
- S APCLSITE=DUZ(2)
- D INFORM
- GETDATES ;
- BD ;get beginning date
- W ! S DIR(0)="D^:DT:EP",DIR("A")="Enter beginning Visit Date" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
- I $D(DIRUT) G XIT
- S APCLBD=Y
- ED ;get ending date
- W ! S DIR(0)="DA^"_APCLBD_":DT:EP",DIR("A")="Enter ending Visit Date: " S Y=APCLBD D DD^%DT S Y="" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
- I $D(DIRUT) G BD
- S APCLED=Y
- S X1=APCLBD,X2=-1 D C^%DTC S APCLSD=X
- ;
- LOC ;
- S APCLLOC=$$GETLOC^APCLOCCK
- I APCLLOC=-1 G BD
- ;
- CLIN ;
- S DIR(0)="YO",DIR("A")="Include visits from ALL Clinics",DIR("?")="If you wish to include visits from ALL of clinics answer Yes. If you wish to tabulate for a single clinic enter NO." D ^DIR K DIR
- G:$D(DIRUT) BD
- I Y=1 S APCLCLN="A" G ZIS ;IHS/CMI/LAB - mult clinics per california request
- CLIN1 ;
- K APCLCLN
- S X="CLINIC",DIC="^AMQQ(5,",DIC(0)="FM",DIC("S")="I $P(^(0),U,14)" D ^DIC K DIC,DA I Y=-1 W "OOPS - QMAN NOT CURRENT - QUITTING" G XIT
- D PEP^AMQQGTX0(+Y,"APCLCLN(")
- I '$D(APCLCLN) G CLIN
- I $D(APCLCLN("*")) K APCLCLN S APCLCLN="A"
- ZIS ;
- DEMO ;
- D DEMOCHK^APCLUTL(.APCLDEMO)
- I APCLDEMO=-1 G CLIN
- S XBRP="^APCLCAWP",XBRC="^APCLCAW1",XBRX="XIT^APCLCAW",XBNS="APCL"
- D ^XBDBQUE
- D XIT
- Q
- ERR W $C(7),$C(7),!,"Must be a valid date and be Today or earlier. Time not allowed!" Q
- XIT ;
- K APCL80S,APCLAPPT,APCLBD,APCLBDD,APCLCLN,APCLCLNT,APCLDT,APCLED,APCLEDD,APCLGTAP,APCLGTOT,APCLGTUN,APCLGTWI,APCLODAT,APCLPG,APCLPRNT,APCLSD,APCLSITE,APCLSORT,APCLSRT2,APCLSRT3,APCLTOT,APCLUNLT,APCLUNST,APCLAPLT
- K APCLVDFN,APCLVLOC,APCLWILT,APCLWIT,APCLBT,APCLLENG,APCLLOC,APCLLOCT,APCLLTOT,APCLQUIT,APCLJOB
- K X,Y,ZTSK,X1,X2,DIC,DA,DIG,DIH,DIR,DIRUT,DIU,DIV
- Q
- ;
- INFORM ;
- W:$D(IOF) @IOF
- W !,"***** TALLY OF APPOINTMENTS AND WALKINS FOR CLINIC VISITS *****"
- W !,"This report will generate a count of visits by clinic",!,"for a date range that you specify.",!
- W "ALL Visits in the database will be included in the tabulation with",!,"the exception of the following: "
- W !,"VISIT TYPES: Contract, VA",!,"VISIT SERVICE CATEGORIES: Chart Review, In-Hospital, Hospitalizations,",!,"Historical Events.",!
- W "Visits MUST have a Primary Provider and Purpose of Visit.",!
- W "The report will be sub-totaled by Location of Encounter.",!
- Q
- ;
- ;
- APCLCAW ; IHS/CMI/LAB -CLINIC VISITS TALLY OF WALKIN&APPT ;
- +1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
- +2 ;
- START ;
- +1 IF '$GET(DUZ(2))
- WRITE $CHAR(7),$CHAR(7),!!,"SITE NOT SET IN DUZ(2) - NOTIFY SITE MANAGER!!",!!
- KILL APCLSITE
- QUIT
- +2 SET APCLSITE=DUZ(2)
- +3 DO INFORM
- GETDATES ;
- BD ;get beginning date
- +1 WRITE !
- SET DIR(0)="D^:DT:EP"
- SET DIR("A")="Enter beginning Visit Date"
- DO ^DIR
- KILL DIR
- IF $DATA(DUOUT)
- SET DIRUT=1
- +2 IF $DATA(DIRUT)
- GOTO XIT
- +3 SET APCLBD=Y
- ED ;get ending date
- +1 WRITE !
- SET DIR(0)="DA^"_APCLBD_":DT:EP"
- SET DIR("A")="Enter ending Visit Date: "
- SET Y=APCLBD
- DO DD^%DT
- SET Y=""
- DO ^DIR
- KILL DIR
- IF $DATA(DUOUT)
- SET DIRUT=1
- +2 IF $DATA(DIRUT)
- GOTO BD
- +3 SET APCLED=Y
- +4 SET X1=APCLBD
- SET X2=-1
- DO C^%DTC
- SET APCLSD=X
- +5 ;
- LOC ;
- +1 SET APCLLOC=$$GETLOC^APCLOCCK
- +2 IF APCLLOC=-1
- GOTO BD
- +3 ;
- CLIN ;
- +1 SET DIR(0)="YO"
- SET DIR("A")="Include visits from ALL Clinics"
- SET DIR("?")="If you wish to include visits from ALL of clinics answer Yes. If you wish to tabulate for a single clinic enter NO."
- DO ^DIR
- KILL DIR
- +2 IF $DATA(DIRUT)
- GOTO BD
- +3 ;IHS/CMI/LAB - mult clinics per california request
- IF Y=1
- SET APCLCLN="A"
- GOTO ZIS
- CLIN1 ;
- +1 KILL APCLCLN
- +2 SET X="CLINIC"
- SET DIC="^AMQQ(5,"
- SET DIC(0)="FM"
- SET DIC("S")="I $P(^(0),U,14)"
- DO ^DIC
- KILL DIC,DA
- IF Y=-1
- WRITE "OOPS - QMAN NOT CURRENT - QUITTING"
- GOTO XIT
- +3 DO PEP^AMQQGTX0(+Y,"APCLCLN(")
- +4 IF '$DATA(APCLCLN)
- GOTO CLIN
- +5 IF $DATA(APCLCLN("*"))
- KILL APCLCLN
- SET APCLCLN="A"
- ZIS ;
- DEMO ;
- +1 DO DEMOCHK^APCLUTL(.APCLDEMO)
- +2 IF APCLDEMO=-1
- GOTO CLIN
- +3 SET XBRP="^APCLCAWP"
- SET XBRC="^APCLCAW1"
- SET XBRX="XIT^APCLCAW"
- SET XBNS="APCL"
- +4 DO ^XBDBQUE
- +5 DO XIT
- +6 QUIT
- ERR WRITE $CHAR(7),$CHAR(7),!,"Must be a valid date and be Today or earlier. Time not allowed!"
- QUIT
- XIT ;
- +1 KILL APCL80S,APCLAPPT,APCLBD,APCLBDD,APCLCLN,APCLCLNT,APCLDT,APCLED,APCLEDD,APCLGTAP,APCLGTOT,APCLGTUN,APCLGTWI,APCLODAT,APCLPG,APCLPRNT,APCLSD,APCLSITE,APCLSORT,APCLSRT2,APCLSRT3,APCLTOT,APCLUNLT,APCLUNST,APCLAPLT
- +2 KILL APCLVDFN,APCLVLOC,APCLWILT,APCLWIT,APCLBT,APCLLENG,APCLLOC,APCLLOCT,APCLLTOT,APCLQUIT,APCLJOB
- +3 KILL X,Y,ZTSK,X1,X2,DIC,DA,DIG,DIH,DIR,DIRUT,DIU,DIV
- +4 QUIT
- +5 ;
- INFORM ;
- +1 IF $DATA(IOF)
- WRITE @IOF
- +2 WRITE !,"***** TALLY OF APPOINTMENTS AND WALKINS FOR CLINIC VISITS *****"
- +3 WRITE !,"This report will generate a count of visits by clinic",!,"for a date range that you specify.",!
- +4 WRITE "ALL Visits in the database will be included in the tabulation with",!,"the exception of the following: "
- +5 WRITE !,"VISIT TYPES: Contract, VA",!,"VISIT SERVICE CATEGORIES: Chart Review, In-Hospital, Hospitalizations,",!,"Historical Events.",!
- +6 WRITE "Visits MUST have a Primary Provider and Purpose of Visit.",!
- +7 WRITE "The report will be sub-totaled by Location of Encounter.",!
- +8 QUIT
- +9 ;
- +10 ;