Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: APCLAP6

APCLAP6.m

Go to the documentation of this file.
  1. APCLAP6 ; IHS/CMI/LAB - APC visit counts by selected vars ;
  1. ;;2.0;IHS PCC SUITE;;MAY 14, 2009
  1. ;
  1. START ;
  1. I '$G(DUZ(2)) W $C(7),$C(7),!!,"SITE NOT SET IN DUZ(2) - NOTIFY SITE MANAGER!!",!! Q
  1. S APCLSITE=DUZ(2)
  1. S APCLJOB=$J,APCLBTH=$H
  1. D INFORM
  1. ;
  1. DY ;determine whether to run yearly (calendar) or daily report
  1. K APCLDATE,APCLDY,APCLYEAR
  1. S DIR(0)="S^D:Daily Report;Y:Yearly Report",DIR("A")="Run which Report",DIR("B")="D" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. G:$D(DIRUT) XIT
  1. S APCLDY=Y
  1. I APCLDY="Y" G Y
  1. D ;which day?
  1. W ! S DIR(0)="D^:DT:EP",DIR("A")="Enter DATE" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. I $D(DIRUT) G DY
  1. S APCLDATE=Y
  1. S X1=APCLDATE,X2=-1 D C^%DTC S APCLSD=X S (APCLBD,APCLED)=APCLDATE
  1. G CL
  1. Y ;which year
  1. S %DT="AE",%DT("A")="Enter the Calendar Year: ",%DT("B")=$E(DT,2,3) D ^%DT I $D(DTOUT) G DY
  1. I X="^" G DY
  1. I Y=-1 D ERR G Y
  1. I $E(Y,4,7)'="0000" D ERR G Y
  1. S APCLYEAR=Y,APCLBD=$E(Y,1,3)_"0101",APCLED=$E(Y,1,3)_1231,X1=APCLBD,X2=-1 D C^%DTC S APCLSD=X
  1. CL ;choose to tally by clinic or location
  1. K APCLLOC,APCLLOCT,APCLCLNT,APCLCLOC
  1. S DIR(0)="S^C:CLINIC;F:FACILITY (LOCATION)",DIR("A")="Do you wish to tally by",DIR("B")="C" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. G:$D(DIRUT) DY
  1. S APCLCLOC=Y,APCLCLOC("NAME")=Y(0)
  1. G:APCLCLOC="F" F
  1. CLINIC ;
  1. K APCLCLNT
  1. 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
  1. D PEP^AMQQGTX0(+Y,"APCLCLNT(")
  1. I '$D(APCLCLNT) G CL
  1. S C=0,X=0 F S X=$O(APCLCLNT(X)) Q:X'=+X S C=C+1
  1. I C>12 W !,$C(7),$C(7),"I can't fit ",C," clinics on this report, please select 1-12 clinics." G CLINIC
  1. LOC ;get location
  1. S APCLLOC=$$GETLOC^APCLOCCK
  1. I APCLLOC=-1 G CL
  1. G ZIS
  1. F ;enter location
  1. S X="LOCATION OF ENCOUNTER",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
  1. D PEP^AMQQGTX0(+Y,"APCLLOCT(")
  1. I '$D(APCLLOCT) G CL
  1. S C=0,X=0 F S X=$O(APCLLOCT(X)) Q:X'=+X S C=C+1
  1. I C>12 W !,$C(7),$C(7),"I can't fit ",C," facilities on this report, please select 1-12 facilities." G F
  1. ZIS ;call to XBDBQUE
  1. DEMO ;
  1. D DEMOCHK^APCLUTL(.APCLDEMO)
  1. I APCLDEMO=-1 G LOC
  1. S XBRP="^APCLAP6P",XBRC="^APCLAP61",XBRX="XIT^APCLAP6",XBNS="APCL"
  1. D ^XBDBQUE
  1. D XIT
  1. Q
  1. XIT ;
  1. K X,X1,X2,IO("Q"),%,Y,POP,DIRUT,ZTSK,ZTQUEUED,H,S,TS,M,DA,D0,DR,DIC,DIE
  1. Q
  1. ERR ;
  1. W !,$C(7),$C(7),"Enter a valid YEAR only!",!
  1. Q
  1. INFORM ;
  1. W:$D(IOF) @IOF
  1. W !!,"This report will tally the number of visits by primary care providers, by",!,"provider at the locations or to the clinics that you specify.",!
  1. W !,"This report can be run for one day (daily report) or for a year (calendar).",!!
  1. W "A total number of 6 locations or clinics will fit on an 80 column report,",!,"you may specify up to 12 if you print the report with 132 columns."
  1. Q
  1. ;