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

APCDFQC1.m

Go to the documentation of this file.
APCDFQC1 ; IHS/CMI/LAB - DE FQA ;
 ;;2.0;IHS PCC SUITE;**11**;MAY 14, 2009;Build 58
M ; Run by posting date
 S APCDVCNT=0,APCDODAT=APCDSD_".9999"
 F  S APCDODAT=$O(^AUPNVSIT(APCDXREF,APCDODAT)) Q:APCDODAT=""!((APCDODAT\1)>APCDED)  D V1
 Q
V1 ;
 S APCDVDFN=0
 F  S APCDVDFN=$O(^AUPNVSIT(APCDXREF,APCDODAT,APCDVDFN)) Q:APCDVDFN'=+APCDVDFN  D PROC
 Q
PROC ;
 S APCDVREC=^AUPNVSIT(APCDVDFN,0)
 Q:'$P(APCDVREC,U,9)
 Q:$P(APCDVREC,U,11)
 Q:'$D(^AUPNVPOV("AD",APCDVDFN))  ;NO VPOVS
 I $D(APCDSCT),'$D(APCDSCT($P(^AUPNVSIT(APCDVDFN,0),U,7))) Q  ;SERVICE CATEGORY CHECK
 I APCDCLN]"",APCDCLN'=$P(APCDVREC,U,8) Q  ;CLINIC CHECK
 I APCDPROV,'$$PROVCHK(APCDVDFN,APCDPROV) Q
 I APCDRVC="R" Q:'$$RC(APCDVDFN)
 D CHKPOV
 Q
RC(V) ;
 I $$VALI^XBDIQ1(9000010,V,1111)="R" Q 1
 ; NEW H
 ;S H=$O(^AUPNVINP("AD",V,0))
 ;I 'H Q ""
 ;I '$$VALI^XBDIQ1(9000010.02,H,.15) Q 1
 Q ""
PROVCHK(V,P) ;
 I $$LASTRC(V,P) Q 1  ;was this person the one last marked it rev/compl
 I $$POVLM(V,P) Q 1
 Q ""
POVLM(V,P) ;WAS ANY POV LAST MODIFIED BY THIS CODER
 NEW X,G
 S (X,G)=0
 F  S X=$O(^AUPNVPOV("AD",V,X)) Q:X'=+X!(G)  D
 .Q:$$VALI^XBDIQ1(9000010.07,X,1219)'=P
 .S G=1
 Q G
 ;
LASTRC(V,P) ;EP
 I '$D(^AUPNVSIT(V,0)) Q ""
 I '$D(^AUPNVCA("AD",V)) Q ""
 NEW X,G
 S G=""
 S X=0 F  S X=$O(^AUPNVCA("AD",V,X)) Q:X'=+X  D
 .Q:'$D(^AUPNVCA(X,0))
 .Q:$P(^AUPNVCA(X,0),U,4)'="R"
 .S G=$P(^AUPNVCA(X,0),U,5)  ;USER
 I G=P Q 1
 Q ""
CHKPOV ;
 I $D(^XTMP("APCDFQA",APCDJOB,APCDBT,"DEPOV","ALL")) D CNT Q
 S (APCD1,APCD2)=0 F  S APCD1=$O(^AUPNVPOV("AD",APCDVDFN,APCD1)) Q:APCD1'=+APCD1  S APCDICDP=$P(^AUPNVPOV(APCD1,0),U) I $D(^XTMP("APCDFQA",APCDJOB,APCDBT,"DEPOV","ICDDFN",APCDICDP)) S APCD2=APCD2+1
 I APCD2>0 D CNT
 Q
CNT ;
 S APCDVCNT=APCDVCNT+1,^XTMP("APCDFQA",APCDJOB,APCDBT,"DEQAV",APCDVCNT,APCDVDFN)=""
 Q
 ;
 ;