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

APCLAUD1.m

Go to the documentation of this file.
APCLAUD1 ; IHS/CMI/LAB - more audit report ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;PRINT AUDIT SEARCH PCC VISITS
START ;
 S APCL80D="--------------------------------------------------------------------------------" ;80 DASHES
 S Y=APCLBD X ^DD("DD") S APCLBDY=Y S Y=APCLED X ^DD("DD") S APCLEDY=Y S Y=DT X ^DD("DD") S APCLDTP=Y
SITE S APCLSITE=DUZ(2)
 S (APCLPG,APCLCNT)=0
 I $D(^XTMP("APCLAUD",APCLJOB,APCLBT,"PROV","ALL")) S APCLALLP=""
 I $D(^XTMP("APCLAUD",APCLJOB,APCLBT,"ICDDFN","ALL")) S APCLALLI=""
 I $D(^XTMP("APCLAUD",APCLJOB,APCLBT,"RAND","ALL")) S APCLALLR=""
 I $D(^XTMP("APCLAUD",APCLJOB,APCLBT,"PROV","NOSORT")) S (APCLNOSP,APCLALLP)=""
 S APCLLIM=$O(^XTMP("APCLAUD",APCLJOB,APCLBT,"RAND",""))
 S APCLS=APCLBD-.0001
 F I=0:0 S APCLS=$O(^AUPNVSIT("B",APCLS)) Q:APCLS=""!(APCLS>(APCLED+.2359))  D C1
 S APCLET=$H G DONE
C1 S APCLVDFN=0 F J=0:0 S APCLVDFN=$O(^AUPNVSIT("B",APCLS,APCLVDFN)) Q:APCLVDFN=""  D C2
 Q
C2 Q:'$D(^AUPNVSIT(APCLVDFN,0))
 S APCLVN0=^AUPNVSIT(APCLVDFN,0)
 S APCLPNUM=$P(APCLVN0,U,5)
 Q:$$DEMO^APCLUTL(APCLPNUM,$G(APCLDEMO))
 I $D(APCLSC),APCLSC'=$P(APCLVN0,U,7) Q
 Q:$P(APCLVN0,"^",11)
 I $D(APCLTYPE),$P(APCLVN0,U,3)'=APCLTYPE Q
 I $D(APCLCLN),APCLCLN'=$P(APCLVN0,U,8) Q
 I $D(APCLLOC),APCLLOC'=$P(APCLVN0,U,6) Q
 I $D(APCLSEX),APCLSEX'=$P(^DPT(APCLPNUM,0),U,2) Q
 G:'$D(APCLLAG) PRVCK
 S APCLPDYS=$S($D(^DPT($P(APCLVN0,"^",5),0)):$P(^(0),"^",3),1:"") Q:APCLPDYS=""  S X1=$P(APCLS,"."),X2=APCLPDYS D ^%DTC S APCLPDYS=X
 Q:APCLPDYS<APCLLAG  Q:APCLPDYS>APCLHAG
PRVCK S APCLPDFN="" F K=0:0 S APCLPDFN=$O(^AUPNVPRV("AD",APCLVDFN,APCLPDFN)) Q:APCLPDFN=""  D P1
 Q
P1 Q:'$D(^AUPNVPRV(APCLPDFN,0))
 S APCLPN0=^AUPNVPRV(APCLPDFN,0),APCLPNO=+APCLPN0,APCLPPR=$P(APCLPN0,"^",4),APCLPNO1=APCLPNO
 Q:APCLPPR'="P"
 G:$D(APCLALLP) ICDCK
 Q:'$D(^XTMP("APCLAUD",APCLJOB,APCLBT,"PROV",APCLPNO))
ICDCK S APCLIDFN="" F  S APCLIDFN=$O(^AUPNVPOV("AD",APCLVDFN,APCLIDFN)) Q:APCLIDFN=""  D I1
 Q
I1 Q:'$D(^AUPNVPOV(APCLIDFN,0))
 S APCLINO=+^AUPNVPOV(APCLIDFN,0)
 I $D(APCLALLI) S APCLIRNG=0 G I11
 Q:'$D(^XTMP("APCLAUD",APCLJOB,APCLBT,"ICDDFN",APCLINO))
 S APCLIRNG=$O(^XTMP("APCLAUD",APCLJOB,APCLBT,"ICDDFN",APCLINO,""))
I11 S:$D(APCLNOSP) APCLPNO="ALL"
 S ^XTMP("APCLAUD2",APCLJOB,APCLBT,APCLPNO,APCLIRNG,APCLINO,APCLVDFN)=APCLPNO1_U_APCLIDFN
 Q:$D(APCLALLR)
 S ^XTMP("APCLAUD2",APCLJOB,APCLBT,APCLPNO,APCLIRNG,0)=$S($D(^XTMP("APCLAUD2",APCLJOB,APCLBT,APCLPNO,APCLIRNG,0)):^(0)+1,1:1)
 Q
DONE Q