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

APCLPCT3.m

Go to the documentation of this file.
APCLPCT3 ; IHS/CMI/LAB - continuation of APCLPCT2 ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;
 ;
VISITS ;
 K APCLGOTA,APCLGOTB,APCLSKIP,APCLLOCC
 S APCLV=0 F  S APCLV=$O(^AUPNVSIT("AA",APCLDFN,APCLV)) Q:APCLV'=+APCLV!($D(APCLGOTA)&($D(APCLGOTB)))!($P(APCLV,".")>APCLSDI)  S APCLVD=$P(APCLV,".") D PROC
 Q
PROC ;
 S APCLVDFN=0 F  S APCLVDFN=$O(^AUPNVSIT("AA",APCLDFN,APCLV,APCLVDFN)) Q:APCLVDFN'=+APCLVDFN  S APCLVREC=^AUPNVSIT(APCLVDFN,0) D SEEN
 Q
SEEN ;determine if patient was seen in FYs
 K APCLSKIP
 G:$D(APCLGOTA) ALL
 Q:APCLVD>APCLSDI
 Q:APCLVD<APCLEDI
 I APCLVFL="L",APCLSU'=$P(APCLVREC,U,6) Q
 Q:"DXE"[$P(APCLVREC,U,7)
 Q:$P(APCLVREC,U,11)
 Q:'$P(APCLVREC,U,9)
 S APCLGOTA="",$P(^XTMP("APCLPCT",APCLJOB,APCLBT,@APCLMAJ,@APCLMIN),U,2)=$P(^XTMP("APCLPCT",APCLJOB,APCLBT,@APCLMAJ,@APCLMIN),U,2)+1
ALL ;
 Q:$D(APCLGOTB)
 Q:"DXE"[$P(APCLVREC,U,7)
 I APCLVFL="L",APCLSU'=$P(APCLVREC,U,6) Q
 Q:$P(APCLVREC,U,11)
 Q:'$P(APCLVREC,U,9)
 I APCLVD>APCLSDI S APCLGOTB="" Q
 Q:APCLVD<APCLEDI
 S $P(^XTMP("APCLPCT",APCLJOB,APCLBT,@APCLMAJ,@APCLMIN),U,3)=$P(^XTMP("APCLPCT",APCLJOB,APCLBT,@APCLMAJ,@APCLMIN),U,3)+1
APC ;
 ;Q:"AORS"'[$P(APCLVREC,U,7)
 ;Q:$D(^APCLCNTL(4,11,"B",$P(APCLVREC,U,3)))
 ;Q:'$D(^AUPNVPOV("AD",APCLVDFN))
 ;Q:'$D(^AUPNVPRV("AD",APCLVDFN))
 S APCLVLOC=$P(APCLVREC,U,6) Q:APCLVLOC=""
 Q:'$D(^DIC(4,APCLVLOC))
 Q:'$D(^AUTTLOC(APCLVLOC))
 ;S APCLCLIN=$P(APCLVREC,U,8) I APCLCLIN="" G PCP
CHKCL ;
 ;S X=$S(APCLCLIN="":"",$D(^DIC(40.7,APCLCLIN,0)):$P(^DIC(40.7,APCLCLIN,0),U,2),1:"")
 ;Q:X=""
 ;I X=56,'$D(^AUPNVMED("AD",APCLVDFN)) Q
 ;I $D(^APCLCNTL(2,11,"B",X)) Q
PCP ;
 Q:'$$APCWL^APCLV(APCLVDFN)
 S $P(^XTMP("APCLPCT",APCLJOB,APCLBT,@APCLMAJ,@APCLMIN),U,4)=$P(^XTMP("APCLPCT",APCLJOB,APCLBT,@APCLMAJ,@APCLMIN),U,4)+1
 ;I APCLDISC>69,APCLDISC<91,APCLDISC'=88 G PCP1
 ;S X="P"_APCLDISC I $T(@X)="" Q
 S D=$$PRIMPROV^APCLV(APCLVDFN,"F")
 I D="" Q
 I 'D Q
 Q:$P(^DIC(7,D,9999999),U,3)'="Y"
PCP1 S $P(^XTMP("APCLPCT",APCLJOB,APCLBT,@APCLMAJ,@APCLMIN),U,5)=$P(^XTMP("APCLPCT",APCLJOB,APCLBT,@APCLMAJ,@APCLMIN),U,5)+1
 Q
DISC ;
 I $P(^DD(9000010.06,.01,0),U,2)[6 G DISC6
 S APCLDISC=$$PROVCLSC^XBFUNC1(APCLAP)
 I APCLDISC'?.N S APCLSKIP="" Q
 S APCLLOCC=$E($P(^AUTTLOC(APCLVLOC,0),U,10),5,6)
 I (APCLDISC=13!(APCLDISC=32))&((APCLLOCC>49)!(APCLLOCC'=+APCLLOCC)) S APCLSKIP=1
 Q
DISC6 ;
 I '$D(^DIC(6,APCLAP)) S APCLSKIP="" Q
 S APCLY=$P(^DIC(6,APCLAP,0),U,4)
 I APCLY="" S APCLSKIP="" Q
 I '$D(^DIC(7,APCLY,9999999)) S APCLSKIP="" Q
 S APCLDISC=$P(^DIC(7,APCLY,9999999),U) I APCLDISC="" S APCLSKIP="" Q
 S APCLLOCC=$E($P(^AUTTLOC(APCLVLOC,0),U,10),5,6)
 I (APCLDISC=13!(APCLDISC=32))&((APCLLOCC>49)!(APCLLOCC'=+APCLLOCC)) S APCLSKIP=1
 Q
P00 ;;
P11 ;;
P16 ;;
P17 ;;
P18 ;;
P21 ;;
P41 ;;
P44 ;;
P25 ;;
P33 ;;