APCDFQA1 ; IHS/CMI/LAB - DE FQA ;
;;2.0;IHS PCC SUITE;**11**;MAY 14, 2009;Build 58
P ; Run by posting date
S APCDVCNT=0,APCDODAT=APCDSD_".9999" F S APCDODAT=$O(^APCDFORM("B",APCDODAT)) Q:APCDODAT=""!((APCDODAT\1)>APCDED) S APCDDFN=$O(^APCDFORM("B",APCDODAT,"")) D V1
Q
V1 ;
S APCDC=0 F S APCDC=$O(^APCDFORM(APCDDFN,11,APCDC)) Q:APCDC'=+APCDC S APCDVDFN=$P(^APCDFORM(APCDDFN,11,APCDC,0),U) I APCDVDFN]"",$D(^AUPNVSIT(APCDVDFN,0)) D PROC
Q
PROC ;
I APCDPROV'=$P(^APCDFORM(APCDDFN,11,APCDC,0),U,2) Q
S APCDVREC=^AUPNVSIT(APCDVDFN,0)
Q:'$P(APCDVREC,U,9)
Q:$P(APCDVREC,U,11)
Q:'$D(^AUPNVPOV("AD",APCDVDFN))
I APCDCLN]"",APCDCLN'=$P(APCDVREC,U,8) Q
D CHKPOV
I $D(APCDSCT),'$D(APCDSCT($P(^AUPNVSIT(APCDVDFN,0),U,7))) Q
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
;
;
APCDFQA1 ; IHS/CMI/LAB - DE FQA ;
+1 ;;2.0;IHS PCC SUITE;**11**;MAY 14, 2009;Build 58
P ; Run by posting date
+1 SET APCDVCNT=0
SET APCDODAT=APCDSD_".9999"
FOR
SET APCDODAT=$ORDER(^APCDFORM("B",APCDODAT))
IF APCDODAT=""!((APCDODAT\1)>APCDED)
QUIT
SET APCDDFN=$ORDER(^APCDFORM("B",APCDODAT,""))
DO V1
+2 QUIT
V1 ;
+1 SET APCDC=0
FOR
SET APCDC=$ORDER(^APCDFORM(APCDDFN,11,APCDC))
IF APCDC'=+APCDC
QUIT
SET APCDVDFN=$PIECE(^APCDFORM(APCDDFN,11,APCDC,0),U)
IF APCDVDFN]""
IF $DATA(^AUPNVSIT(APCDVDFN,0))
DO PROC
+2 QUIT
PROC ;
+1 IF APCDPROV'=$PIECE(^APCDFORM(APCDDFN,11,APCDC,0),U,2)
QUIT
+2 SET APCDVREC=^AUPNVSIT(APCDVDFN,0)
+3 IF '$PIECE(APCDVREC,U,9)
QUIT
+4 IF $PIECE(APCDVREC,U,11)
QUIT
+5 IF '$DATA(^AUPNVPOV("AD",APCDVDFN))
QUIT
+6 IF APCDCLN]""
IF APCDCLN'=$PIECE(APCDVREC,U,8)
QUIT
+7 DO CHKPOV
+8 IF $DATA(APCDSCT)
IF '$DATA(APCDSCT($PIECE(^AUPNVSIT(APCDVDFN,0),U,7)))
QUIT
+9 QUIT
CHKPOV ;
+1 IF $DATA(^XTMP("APCDFQA",APCDJOB,APCDBT,"DEPOV","ALL"))
DO CNT
QUIT
+2 SET (APCD1,APCD2)=0
FOR
SET APCD1=$ORDER(^AUPNVPOV("AD",APCDVDFN,APCD1))
IF APCD1'=+APCD1
QUIT
SET APCDICDP=$PIECE(^AUPNVPOV(APCD1,0),U)
IF $DATA(^XTMP("APCDFQA",APCDJOB,APCDBT,"DEPOV","ICDDFN",APCDICDP))
SET APCD2=APCD2+1
+3 IF APCD2>0
DO CNT
+4 QUIT
CNT ;
+1 SET APCDVCNT=APCDVCNT+1
SET ^XTMP("APCDFQA",APCDJOB,APCDBT,"DEQAV",APCDVCNT,APCDVDFN)=""
+2 QUIT
+3 ;
+4 ;