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

APCLPVC1.m

Go to the documentation of this file.
APCLPVC1 ; IHS/CMI/LAB - POV GROUPED BY APC CODES - 6/21/89 11:11 AM ;
 ;;2.0;IHS PCC SUITE;**11**;MAY 14, 2009;Build 58
 ;FIND PCC AMBULATORY VISITS FOR DATE RANGE, RECODE TO APC CODES, AND TOTAL
 ;
 ;cmi/anch/maw 9/10/2007 code set versioning in I1
 ;
 S APCLBT=$H,APCLJOB=$J
 D XTMP^APCLOSUT("APCLPVC","PCC - VISITS BY APC RECODE")
 S APCLS=APCLSD-.0001
 F I=0:0 S APCLS=$O(^AUPNVSIT("B",APCLS)) Q:APCLS=""!(APCLS>(APCLFD+.2359))  D C1
 Q
C1 S APCLVDFN=0 F J=0:0 S APCLVDFN=$O(^AUPNVSIT("B",APCLS,APCLVDFN)) Q:APCLVDFN=""  D C2
 S APCLET=$H
 Q
C2 Q:'$D(^AUPNVSIT(APCLVDFN,0))
 S APCLVN0=^AUPNVSIT(APCLVDFN,0)
 Q:$$DEMO^APCLUTL($P(APCLVN0,U,5),$G(APCLDEMO))
 Q:$P(APCLVN0,"^",7)'="A"
 Q:'$P(APCLVN0,U,9)
 Q:"C"[$P(APCLVN0,"^",3)
 Q:$P(APCLVN0,"^",11)
 G:'$D(APCLCOM) ICDCK
 S APCLPDFN=$P(APCLVN0,"^",5) S APCLPCOM=$S($D(^AUPNPAT(APCLPDFN,11)):$P(^(11),"^",18),1:"NOCOM")
 Q:APCLPCOM="NOCOM"
 Q:APCLPCOM'=APCLCOM
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)
 ;S APCLX=$P(^ICD9(APCLINO,0),"^") D ^APCLRAPC G:'$D(APCLY) I11 G:APCLY="" I11 S APCLAPC=APCLY  ;cmi/anch/maw 9/10/2007 orig line
 S APCLX=$P($$ICDDX^ICDEX(APCLINO),"^",2) D ^APCLRAPC G:'$D(APCLY) I11 G:APCLY="" I11 S APCLAPC=APCLY  ;cmi/anch/maw 9/10/2007 csv
 S ^(0)=$S($D(^XTMP("APCLPVC",APCLJOB,APCLBT,APCLAPC,0)):^(0)+1,1:1)
 Q:'APCLLIM  S ^(APCLINO)=$S($D(^XTMP("APCLPVC",APCLJOB,APCLBT,APCLAPC,APCLINO)):^(APCLINO)+1,1:1) G I12
I11 S ^("NOCODE")=$S($D(^XTMP("APCLPVC",APCLJOB,APCLBT,"NOCODE")):^("NOCODE"),1:1)
I12 Q