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

APCLWL1.m

Go to the documentation of this file.
  1. APCLWL1 ; IHS/CMI/LAB - CLINIC HOURLY WORKLOAD REPORT ;
  1. ;;2.0;IHS PCC SUITE;;MAY 14, 2009
  1. DOC ;See INFORM section for documentation notes for this routine
  1. ;
  1. ;List of VARIABLES with brief descriptions:
  1. ;
  1. START ;Start of routine
  1. I '$G(DUZ(2)) W $C(7),$C(7),!!,"SITE NOT SET IN DUZ(2) - NOTIFY SITE MANAGER!!",!! K APCLSITE Q
  1. S APCLSITE=DUZ(2)
  1. INFORM ;
  1. W:$D(IOF) @IOF
  1. W !," ******* TALLY OF DAILY VISITS BY 24-HOUR TIME FRAMES *******"
  1. W !,"- This report will generate an hourly visit count, by clinic,",!," for a date range that you specify.",!
  1. W "- ALL visits in the database will be included in the tabulation with",!," the exception of the following: "
  1. W !," VISIT TYPES: Contract, VA",!," VISIT SERVICE CATEGORIES: Chart Review, In-Hospital, Ancillary,",!?31,"Hospitalizations, Events, Telecommunications",!
  1. W "- Visits MUST have a Primary Provider and Purpose of Visit.",!
  1. W "- The report will be totaled by hourly time frames.",!
  1. ;
  1. GETDATES ;This section gets BEGINNING and ENDING dates:
  1. BD ;Get beginning date
  1. W ! S DIR(0)="D^:DT:EP",DIR("A")="Enter Beginning Visit Date" D ^DIR
  1. K DIR S:$D(DUOUT) DIRUT=1
  1. I $D(DIRUT) G XIT
  1. S APCLBD=Y
  1. ED ;Get ending date
  1. W ! S DIR(0)="DA^"_APCLBD_":DT:EP",DIR("A")="Enter Ending Visit Date: "
  1. S Y=APCLBD D DD^%DT S Y="" D ^DIR
  1. K DIR S:$D(DUOUT) DIRUT=1
  1. I $D(DIRUT) G BD
  1. S APCLED=Y,X1=APCLBD,X2=-1
  1. S X1=APCLBD,X2=-1 D C^%DTC S APCLSD=X
  1. ;
  1. LOC ;Enter facility
  1. S DIC("A")="Select Facility: ",DIC="^AUTTLOC(",DIC(0)="AEMQ",DIC("B")=$P(^DIC(4,DUZ(2),0),U) D ^DIC K DIC,DA G:Y<0 BD
  1. S APCLLOC=+Y
  1. ;
  1. CLIN ;Select Clinic(s)
  1. S DIR(0)="YO",DIR("A")="Include visits from ALL Clinics",DIR("B")="NO",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
  1. G:$D(DIRUT) BD
  1. I Y=1 S APCLCLN="" G AGE
  1. CLIN1 ;
  1. S DIC("A")="Select Clinic: ",DIC="^DIC(40.7,",DIC(0)="AEMQ" D ^DIC K DIC,DA G:Y<0 CLIN
  1. S APCLCLN=+Y
  1. AGE ;Age Screening
  1. K APCLAGE,APCLAGET
  1. W ! S DIR(0)="YO",DIR("A")="Would you like to restrict the report by Patient age range",DIR("B")="YES"
  1. S DIR("?")="If you wish to include visits from ALL age ranges, anwser No. If you wish to include visits for only patients within a particular age range, enter Yes."
  1. D ^DIR K DIR
  1. G:$D(DIRUT) CLIN
  1. I 'Y G PROV
  1. ;
  1. AGER ;Age Screening
  1. W !
  1. S DIR(0)="FO^1:7",DIR("A")="Enter an Age Range (e.g. 5-12,1-1)" D ^DIR
  1. I Y="" W !!,"No age range entered." G AGE
  1. I Y'?1.3N1"-"1.3N W !!,$C(7),$C(7),"Enter a numeric range in the format nnn-nnn. e.g. 0-5, 0-99, 5-20." G AGER
  1. S APCLAGET=Y
  1. ;
  1. PROV ;Provider Screening
  1. ;
  1. S DIR(0)="YO",DIR("A")="Include visits from ALL Providers",DIR("B")="NO",DIR("?")="If you wish to include visits from ALL of Providers answer Yes. If you wish to tabulate for a single Provider enter NO." D ^DIR K DIR
  1. G:$D(DIRUT) BD
  1. I Y=1 S APCLPROV="" G ZIS
  1. PROV1 ;Provider Screening
  1. ;
  1. S DIC("A")="Select Provider: ",DIC=$S($P(^DD(9000010.06,.01,0),U,2)[200:"^VA(200,",1:"^DIC(6,"),DIC(0)="AEMQ" D ^DIC K DIC,DA G:Y<0 PROV
  1. S APCLPROV=+Y
  1. ZIS ;
  1. DEMO ;
  1. D DEMOCHK^APCLUTL(.APCLDEMO)
  1. I APCLDEMO=-1 G PROV
  1. W !!,$C(7),$C(7),"THIS REPORT MUST BE PRINTED ON 132 COLUMN PAPER OR ON A PRINTER THAT IS",!,"SET UP FOR CONDENSED PRINT!!!",!!,"IF YOU DO NOT HAVE SUCH A PRINTER AVAILABLE - SEE YOUR SITE MANAGER.",!!
  1. S XBRP="^APCLWL1P",XBRC="^APCLWL11",XBRX="XIT^APCLWL1",XBNS="APCL"
  1. D ^XBDBQUE
  1. D XIT
  1. Q
  1. ERR W $C(7),$C(7),!,"Must be a valid date and be Today or earlier. Time not allowed!" Q
  1. XIT ;
  1. K APCL132S,APCLBD,APCLBDD,APCLCLN,APCLCLNT,APCLDT,APCLED,APCLEDD,APCLTAB,APCLGTOT,APCLODAT,APCLPG,APCLSD,APCLSITE,APCLSRT2,APCLTIME,APCLET,APCLAGET
  1. K APCLVDFN,APCLVLOC,APCLVREC,APCLBT,APCLLENG,APCLLOC,APCLLOCT,APCLQUIT,APCLJOB,APCLDATE,APCL1,APCL2,APCLDOW,APCLCLIN,APCLPROV,APCLFILE
  1. K X,Y,ZTSK,X1,X2,XBNS,XBRC,XBRP,XBRX,DIC,DA,DIG,DIH,DIR,DIRUT,DIU,DIV
  1. Q
  1. ;