AMQQMULS ; IHS/CMI/THL - SUBQUERIES ;
;;2.0;IHS PCC SUITE;;MAY 14, 2009
;-----
RUN I '$D(^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN)) S:$D(AMQV("SQ",0,"NULL"))!($D(AMQV("SQ",+$G(AMQQUSQN),"NULL"))) ^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN,1)="-" Q
I $D(AMQV("SQ",0,1)) X AMQV("SQ",0,1) I $D(AMQV("SQ",0,"NULL")),'$D(^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN)) S ^(AMQQUATN,1)="-" Q
I '$G(AMQQUSQN) Q
I $D(^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN)),$D(AMQV("SQ",AMQQUSQN,1)) X AMQV("SQ",AMQQUSQN,1)
I $D(AMQV("SQ",AMQQUSQN,"NULL")),$D(^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN)) K ^(AMQQUATN) Q
NULL I $D(AMQV("SQ",AMQQUSQN,"NULL")) S ^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN,1)="-"
Q
;
REL ; ENTRY POINT FROM AMQQMUL ROUTINES
S AMQQBASE=+^AUPNVSIT(AMQQSQVS,0)
I 'AMQQBASE S AMQQST=9999999,AMQQFIN=9999999 Q
S X1=AMQQBASE
S X2=AMQQST
D C^%DTC
S AMQQST=X
S X1=AMQQBASE
S X2=AMQQFIN
D C^%DTC
S AMQQFIN=X
EXIT K X,AMQQBASE,%H,X1,X2
Q
;
AMQQMULS ; IHS/CMI/THL - SUBQUERIES ;
+1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
+2 ;-----
RUN IF '$DATA(^UTILITY("AMQQ",$JOB,AMQQAG,AMQQUATN))
IF $DATA(AMQV("SQ",0,"NULL"))!($DATA(AMQV("SQ",+$GET(AMQQUSQN),"NULL")))
SET ^UTILITY("AMQQ",$JOB,AMQQAG,AMQQUATN,1)="-"
QUIT
+1 IF $DATA(AMQV("SQ",0,1))
XECUTE AMQV("SQ",0,1)
IF $DATA(AMQV("SQ",0,"NULL"))
IF '$DATA(^UTILITY("AMQQ",$JOB,AMQQAG,AMQQUATN))
SET ^(AMQQUATN,1)="-"
QUIT
+2 IF '$GET(AMQQUSQN)
QUIT
+3 IF $DATA(^UTILITY("AMQQ",$JOB,AMQQAG,AMQQUATN))
IF $DATA(AMQV("SQ",AMQQUSQN,1))
XECUTE AMQV("SQ",AMQQUSQN,1)
+4 IF $DATA(AMQV("SQ",AMQQUSQN,"NULL"))
IF $DATA(^UTILITY("AMQQ",$JOB,AMQQAG,AMQQUATN))
KILL ^(AMQQUATN)
QUIT
NULL IF $DATA(AMQV("SQ",AMQQUSQN,"NULL"))
SET ^UTILITY("AMQQ",$JOB,AMQQAG,AMQQUATN,1)="-"
+1 QUIT
+2 ;
REL ; ENTRY POINT FROM AMQQMUL ROUTINES
+1 SET AMQQBASE=+^AUPNVSIT(AMQQSQVS,0)
+2 IF 'AMQQBASE
SET AMQQST=9999999
SET AMQQFIN=9999999
QUIT
+3 SET X1=AMQQBASE
+4 SET X2=AMQQST
+5 DO C^%DTC
+6 SET AMQQST=X
+7 SET X1=AMQQBASE
+8 SET X2=AMQQFIN
+9 DO C^%DTC
+10 SET AMQQFIN=X
EXIT KILL X,AMQQBASE,%H,X1,X2
+1 QUIT
+2 ;