- APCLCV ; IHS/CMI/LAB - Indian Beneficiary Calendar Year Visit Summary ;
- ;;2.0;IHS PCC SUITE;;MAY 14, 2009
- ;IHS/CMI/LAB - fixed per California Area
- START ;
- D INFORM
- K DUOUT,DTOUT
- YEAR ;Calendar Year Default
- S APCLYEAR="01/01/"_(1700+$E(DT,1,3)) ;IHS/CMI/LAB - fixed to 4 digit year
- BD ;get beginning date
- W ! K DIR,X,Y S DIR(0)="D^:DT:EP",DIR("A")="Enter Beginning Visit Date for search" S DIR("B")=APCLYEAR D ^DIR K DIR S:$D(DUOUT) DIRUT=1
- I $D(DIRUT) D EOJ Q
- S APCLBD=Y
- ED ;get ending date
- W ! K DIR,X,Y S DIR(0)="DA^"_APCLBD_":DT:EP",DIR("A")="Enter Ending Visit Date for search: " D ^DIR K DIR S:$D(DUOUT) DIRUT=1
- I $D(DIRUT) G BD
- G:Y="" BD
- S APCLED=Y
- S X1=APCLBD,X2=-1 D C^%DTC S APCLSD=X S Y=APCLBD D DD^%DT S APCLBDD=Y S Y=APCLED D DD^%DT S APCLEDD=Y
- I $D(DIRUT) G YEAR
- ;
- W !!,"This report will be run for ",APCLBDD," to ",APCLEDD,".",!
- F ;
- S APCLLOC=""
- S DIR(0)="S^A:All Locations;O:One Location: ",DIR("A")="Do you want to include Visits to",DIR("B")="A" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
- G:$D(DIRUT) YEAR
- S APCLVFL=Y
- I APCLVFL="A" G CLINIC
- S DIC("A")="Run for which Facility of Encounter: ",DIC="^AUTTLOC(",DIC(0)="AEMQ" D ^DIC K DIC,DA G:Y<0 F
- S APCLLOC=+Y
- ;
- CLINIC ;
- W !!
- S APCLCL="" S APCLCLIN=""
- S DIR(0)="Y",DIR("A")="Print for ALL clinics",DIR("B")="Y" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
- G:$D(DIRUT) F
- I Y=1 G ZIS
- ;
- CLINIC1 ;Get Multiple Clinics in Search
- K APCLCLNT
- ;
- 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 "OPPS - QMAN NOT CURRENT - QUITTING" G EOJ
- D PEP^AMQQGTX0(+Y,"APCLCLNT(")
- I '$D(APCLCLNT) G CLINIC
- I $D(APCLCLNT("*")) K APCLCLNT
- ;K DIC S DIC=40.7,DIC(0)="AEQMZ",DIC("A")="Which Clinic: " D ^DIC
- G CLINIC:Y<1
- ;S APCLCL=+Y
- ;
- ZIS ;
- DEMO ;
- D DEMOCHK^APCLUTL(.APCLDEMO)
- I APCLDEMO=-1 G CLINIC
- S XBRP="^APCLCVP",XBRC="^APCLCV1",XBRX="EOJ^APCLCV",XBNS="APCL"
- D ^XBDBQUE
- D EOJ
- Q
- ERR W $C(7),$C(7),!,"Must be a valid Year. Enter a year only!!" Q
- EOJ K APCLFY,APCLLOC,APCLSD,APCLVDFN,APCLVREC,APCLSKIP,APCL1,APCL2,APCLDISC,APCLAP,APCLPPOV,APCLX,APCLDPTR,APCLVLOC,APCLMOL,APCLFYD,APCLMOS,APCLBT,APCLJOB,APCLTRIB,APCL1N,APCL2N,APCL3N,APCL4N,APCLGN,APCLSDD ;IHS/CMI/LAB
- K APCLDT,APCLAREA,APCLLOCP,APCLLOC,APCLAREC,APCLSU,APCLSUC,APCLGRAN,APCLPG,APCLQUIT,APCLMON,APCLTAB,APCLJ,APCLDISN,APCLPRIM,APCLP,APCLT,APCLPRIT,APCL132,APCLFYE,APCLLOCC,DFN
- K X,X1,X2,IO("Q"),%,Y,%DT,%Y,%W,%T,%H,DUOUT,DTOUT,POP,ZTSK,ZTQUEUED,H,S,TS,M
- K APCLFAC,APCLLOC,APCLBD,APCLBDD,APCLCLAS,APCLDTE,APCLED,APCLEDD,APCLET,APCLVFL,APCLVIEN,APCLCL,APCLCLIN,APCLCLNT,APCLCLP,APCLLOCP,APCLYEAR
- Q
- ;
- INFORM ;
- W:$D(IOF) @IOF
- W !,?10,"********** INDIAN/ALASKA NATIVE VISIT COUNTSS **********",!
- W !,"This report will print Visit Counts for the Facility and Clinic and",!,"Time Frame that you select. Visit Counts are summarized according to"
- W !,"Indian/Alaska Native and All Other Beneficiaries.",! W !,"Each Classification is Sub-Totaled by the following: "
- W "(1) New Patient's 1st",!,"(2) Established Patient's 1st and (3) All additional Patient's Visits.",!
- W !,"NOTE: Calendar Year Reports must be inclusive & begin with the 1st Day of the",!,?7,"the desired Calendar Year.",!
- Q
- ;
- ;
- APCLCV ; IHS/CMI/LAB - Indian Beneficiary Calendar Year Visit Summary ;
- +1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
- +2 ;IHS/CMI/LAB - fixed per California Area
- START ;
- +1 DO INFORM
- +2 KILL DUOUT,DTOUT
- YEAR ;Calendar Year Default
- +1 ;IHS/CMI/LAB - fixed to 4 digit year
- SET APCLYEAR="01/01/"_(1700+$EXTRACT(DT,1,3))
- BD ;get beginning date
- +1 WRITE !
- KILL DIR,X,Y
- SET DIR(0)="D^:DT:EP"
- SET DIR("A")="Enter Beginning Visit Date for search"
- SET DIR("B")=APCLYEAR
- DO ^DIR
- KILL DIR
- IF $DATA(DUOUT)
- SET DIRUT=1
- +2 IF $DATA(DIRUT)
- DO EOJ
- QUIT
- +3 SET APCLBD=Y
- ED ;get ending date
- +1 WRITE !
- KILL DIR,X,Y
- SET DIR(0)="DA^"_APCLBD_":DT:EP"
- SET DIR("A")="Enter Ending Visit Date for search: "
- DO ^DIR
- KILL DIR
- IF $DATA(DUOUT)
- SET DIRUT=1
- +2 IF $DATA(DIRUT)
- GOTO BD
- +3 IF Y=""
- GOTO BD
- +4 SET APCLED=Y
- +5 SET X1=APCLBD
- SET X2=-1
- DO C^%DTC
- SET APCLSD=X
- SET Y=APCLBD
- DO DD^%DT
- SET APCLBDD=Y
- SET Y=APCLED
- DO DD^%DT
- SET APCLEDD=Y
- +6 IF $DATA(DIRUT)
- GOTO YEAR
- +7 ;
- +8 WRITE !!,"This report will be run for ",APCLBDD," to ",APCLEDD,".",!
- F ;
- +1 SET APCLLOC=""
- +2 SET DIR(0)="S^A:All Locations;O:One Location: "
- SET DIR("A")="Do you want to include Visits to"
- SET DIR("B")="A"
- DO ^DIR
- KILL DIR
- IF $DATA(DUOUT)
- SET DIRUT=1
- +3 IF $DATA(DIRUT)
- GOTO YEAR
- +4 SET APCLVFL=Y
- +5 IF APCLVFL="A"
- GOTO CLINIC
- +6 SET DIC("A")="Run for which Facility of Encounter: "
- SET DIC="^AUTTLOC("
- SET DIC(0)="AEMQ"
- DO ^DIC
- KILL DIC,DA
- IF Y<0
- GOTO F
- +7 SET APCLLOC=+Y
- +8 ;
- CLINIC ;
- +1 WRITE !!
- +2 SET APCLCL=""
- SET APCLCLIN=""
- +3 SET DIR(0)="Y"
- SET DIR("A")="Print for ALL clinics"
- SET DIR("B")="Y"
- DO ^DIR
- KILL DIR
- IF $DATA(DUOUT)
- SET DIRUT=1
- +4 IF $DATA(DIRUT)
- GOTO F
- +5 IF Y=1
- GOTO ZIS
- +6 ;
- CLINIC1 ;Get Multiple Clinics in Search
- +1 KILL APCLCLNT
- +2 ;
- +3 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 "OPPS - QMAN NOT CURRENT - QUITTING"
- GOTO EOJ
- +4 DO PEP^AMQQGTX0(+Y,"APCLCLNT(")
- +5 IF '$DATA(APCLCLNT)
- GOTO CLINIC
- +6 IF $DATA(APCLCLNT("*"))
- KILL APCLCLNT
- +7 ;K DIC S DIC=40.7,DIC(0)="AEQMZ",DIC("A")="Which Clinic: " D ^DIC
- +8 IF Y<1
- GOTO CLINIC
- +9 ;S APCLCL=+Y
- +10 ;
- ZIS ;
- DEMO ;
- +1 DO DEMOCHK^APCLUTL(.APCLDEMO)
- +2 IF APCLDEMO=-1
- GOTO CLINIC
- +3 SET XBRP="^APCLCVP"
- SET XBRC="^APCLCV1"
- SET XBRX="EOJ^APCLCV"
- SET XBNS="APCL"
- +4 DO ^XBDBQUE
- +5 DO EOJ
- +6 QUIT
- ERR WRITE $CHAR(7),$CHAR(7),!,"Must be a valid Year. Enter a year only!!"
- QUIT
- EOJ ;IHS/CMI/LAB
- KILL APCLFY,APCLLOC,APCLSD,APCLVDFN,APCLVREC,APCLSKIP,APCL1,APCL2,APCLDISC,APCLAP,APCLPPOV,APCLX,APCLDPTR,APCLVLOC,APCLMOL,APCLFYD,APCLMOS,APCLBT,APCLJOB,APCLTRIB,APCL1N,APCL2N,APCL3N,APCL4N,APCLGN,APCLSDD
- +1 KILL APCLDT,APCLAREA,APCLLOCP,APCLLOC,APCLAREC,APCLSU,APCLSUC,APCLGRAN,APCLPG,APCLQUIT,APCLMON,APCLTAB,APCLJ,APCLDISN,APCLPRIM,APCLP,APCLT,APCLPRIT,APCL132,APCLFYE,APCLLOCC,DFN
- +2 KILL X,X1,X2,IO("Q"),%,Y,%DT,%Y,%W,%T,%H,DUOUT,DTOUT,POP,ZTSK,ZTQUEUED,H,S,TS,M
- +3 KILL APCLFAC,APCLLOC,APCLBD,APCLBDD,APCLCLAS,APCLDTE,APCLED,APCLEDD,APCLET,APCLVFL,APCLVIEN,APCLCL,APCLCLIN,APCLCLNT,APCLCLP,APCLLOCP,APCLYEAR
- +4 QUIT
- +5 ;
- INFORM ;
- +1 IF $DATA(IOF)
- WRITE @IOF
- +2 WRITE !,?10,"********** INDIAN/ALASKA NATIVE VISIT COUNTSS **********",!
- +3 WRITE !,"This report will print Visit Counts for the Facility and Clinic and",!,"Time Frame that you select. Visit Counts are summarized according to"
- +4 WRITE !,"Indian/Alaska Native and All Other Beneficiaries.",!
- WRITE !,"Each Classification is Sub-Totaled by the following: "
- +5 WRITE "(1) New Patient's 1st",!,"(2) Established Patient's 1st and (3) All additional Patient's Visits.",!
- +6 WRITE !,"NOTE: Calendar Year Reports must be inclusive & begin with the 1st Day of the",!,?7,"the desired Calendar Year.",!
- +7 QUIT
- +8 ;
- +9 ;