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

APCLCAW1.m

Go to the documentation of this file.
APCLCAW1 ; IHS/CMI/LAB -CLINIC VISITS CONT. APCLCAW ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 S APCLJOB=$J,APCLBT=$H
 D XTMP^APCLOSUT("APCLCAW","PCC - APPT/WI TALLY")
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 ;
 K APCLSKIP
 Q:$$DEMO^APCLUTL($P(APCLVREC,U,5),$G(APCLDEMO))
 Q:"XECIHD"[$P(APCLVREC,U,7)
 Q:$D(^APCLCNTL(4,11,"B",$P(APCLVREC,U,3)))
 S APCLVLOC=$P(APCLVREC,U,6) Q:APCLVLOC=""
 Q:$P(APCLVREC,U,8)=""
 I $$CHKLOC^APCLOCCK(APCLLOC,APCLVLOC)=0 Q
 ;I APCLCLN]"",$P(APCLVREC,U,8)'=APCLCLN Q
 I $G(APCLCLN)'="A",'$D(APCLCLN($P(APCLVREC,U,8))) Q  ;IHS/CMI/LAB
 S APCLCLIN=$P(APCLVREC,U,8)
 Q:'$D(^AUPNVPOV("AD",APCLVDFN))
 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,APCLAP=$P(^(0),U)
 I APCL1=0 Q
 I APCL1>1 Q
 D CLIN
 S ^(APCLSRT3)=$S($D(^XTMP("APCLCAW",APCLJOB,APCLBT,"LOCTOT",APCLVLOC,APCLCLIN,APCLSRT2,APCLSRT3)):^(APCLSRT3)+1,1:1)
 Q
EOJ K APCLVLOC,APCLVREC,APCLCLIN,APCLSKIP,APCL1,APCL2,APCLAP,APCLDISC,APCLPPOV,APCLX,APCLHIGH,APCLDX,APCLLOW,APCLICD,APCLDA1,APCLDA2,APCLY,APCLSRT2,APCLDATE,APCLPROV,APCLSEC,APCLZ
 Q
 ;
CLIN S APCLSRT2=$P(^DIC(40.7,APCLCLIN,0),U,2),APCLCLIN=$P(^DIC(40.7,APCLCLIN,0),U),APCLSRT3=$S($P(APCLVREC,U,16)="":"U",1:$P(APCLVREC,U,16))
 Q
 ;