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

APCLWL11.m

Go to the documentation of this file.
APCLWL11 ; IHS/CMI/LAB - CLINIC HOURLY WORKLOAD REPORT ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
DOC ;This is the "processing" routine for the Clinic Hourly Workload
 ;report.  Called from the APCLWL1 routine.
 ;
 ;List of VARIABLES with brief descriptions:
 ;
START ;Start of routine
 S APCLJOB=$J,APCLBT=$H
 D XTMP^APCLOSUT("APCLWL1","PCC CLINIC HOURLY WORKLOAD RPT")
V ;Run by visit date
 S APCLODAT=$O(^AUPNVSIT("B",APCLSD)) I APCLODAT="" S APCLET=$H Q
 S APCLODAT=APCLSD_".9999" F  S APCLODAT=$O(^AUPNVSIT("B",APCLODAT)) Q:APCLODAT=""!((APCLODAT\1)>APCLED)  D V1
 S APCLET=$H
 Q
V1 ;
 S APCLVDFN="" F  S APCLVDFN=$O(^AUPNVSIT("B",APCLODAT,APCLVDFN)) Q:APCLVDFN'=+APCLVDFN  I $D(^AUPNVSIT(APCLVDFN,0)),$P(^(0),U,9),'$P(^(0),U,11) S APCLVREC=^(0) D PROC,EOJ
 Q
PROC ;
 Q:"XECIHRT"[$P(APCLVREC,U,7)
 Q:$$DEMO^APCLUTL($P(APCLVREC,U,5),$G(APCLDEMO))
 Q:$D(^APCLCNTL(4,11,"B",$P(APCLVREC,U,3)))
 S APCLVLOC=$P(APCLVREC,U,6) Q:APCLVLOC=""
 Q:$P(APCLVREC,U,8)=""
 I APCLLOC]"",APCLLOC'=APCLVLOC Q
 I APCLCLN]"",$P(APCLVREC,U,8)'=APCLCLN Q
 S APCLCLIN=$P(APCLVREC,U,8)
 S X=$$AGE^AUPNPAT($P(APCLVREC,U,5),$P($P(APCLVREC,U),"."))
 I $D(APCLAGET),X>$P(APCLAGET,"-",2) Q
 I $D(APCLAGET),X<$P(APCLAGET,"-") Q
 Q:'$D(^AUPNVPRV("AD",APCLVDFN))
 S (APCL1,APCL2)=0 F  S APCL2=$O(^AUPNVPRV("AD",APCLVDFN,APCL2)) Q:APCL2=""  I $P(^AUPNVPRV(APCL2,0),U,4)="P" S APCL1=APCL1+1
 I APCLPROV]"",$$PRIMPROV^APCLV(APCLVDFN,"I")'=APCLPROV Q
 I APCL1=0 Q
 I APCL1>1 Q
 S APCLDATE=$P($P(APCLVREC,U),".")
 S APCLSRT2=$E($P($P(APCLVREC,U),".",2),1,2) S:APCLSRT2="" APCLSRT2=12 S APCLSRT2=$S(APCLSRT2=1:10,APCLSRT2=2:20,1:APCLSRT2) S APCLSRT2=+APCLSRT2 S:APCLSRT2=24 APCLSRT2=0
 S ^(APCLSRT2)=$S($D(^XTMP("APCLWL1",APCLJOB,APCLBT,"DATE",APCLDATE,APCLSRT2)):^(APCLSRT2)+1,1:1)
 S ^(APCLSRT2)=$S($D(^XTMP("APCLWL1",APCLJOB,APCLBT,"TIME TOTALS",APCLSRT2)):^(APCLSRT2)+1,1:1)
 Q
EOJ K APCLVLOC,APCLVREC,APCLCLIN,APCL1,APCL2,APCLSRT2,APCLDATE
 Q