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

AMQQSQA1.m

Go to the documentation of this file.
AMQQSQA1 ; IHS/CMI/THL - LINK SUBQUERY ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;-----
RUN N AMQQSQST,AMQQNOCO,AMQQCOMP,AMQQSYMB,AMQQFTYP,AMQQCOND
 I AMQQSQCT="R" D ^AMQQAVR Q
 I AMQQSQCT="L",'$D(AMQQSQLF) D NEW Q
 I AMQQSQCT="V" D NEW Q
 I AMQQSQCT="M"!($D(AMQQSQLF)) D ^AMQQSQA2 Q
SETCOND S AMQQNOCO=AMQQSQNC
 S AMQQSYMB=AMQQSQBS
 S AMQQFTYP=$P(^AMQQ(4,AMQQSQTP,0),U)
 S AMQQCOND=AMQQSQN
 S (AMQQSQST,AMQQFTYP)=$S("TO"[AMQQSQCT:"N",AMQQSQCT="D":"D",1:$P(^AMQQ(4,AMQQSQTP,0),U))
GETVAL K AMQQCOMP
 I $D(AMQQMMVV) S (AMQQCOMP,AMQQSQCV)=AMQQMMVV K AMQQMMVV Q
 D ^AMQQAV
 I $D(AMQQQUIT) K AMQQQUIT,AMQQCOMP S AMQQSQNV="" Q
 I '$D(AMQQCOMP) K AMQQCOMP
 I '$D(AMQQCOMP) W !!,"You must enter a value.  Try again...",!!,*7 G GETVAL
 S AMQQSQCV=AMQQCOMP
EXIT K %,Z
 Q
 ;
NEW N AMQQLINK,AMQQATNM,AMQQCTXS,AMQQCOND,AMQQCONM,AMQQVCL,AMQQSER,AMQQORTX,AMQQSQFR,AMQQNVAR,AMQQFILT,AMQQSNOT,AMQQTAX,AMQQATN,AMQQSQCT,AMQQTNAR,AMQQTDIC,AMQQTLOK,AMQQTTX
 D VAR
 I $D(AMQQQUIT) Q
 S AMQQSQQF=""
 K %
 Q
 ;
VAR S %=^AMQQ(5,+Y,0)
 S AMQQATNM=$P(Y,U,2)
 S AMQQLINK=$P(%,U,5)
 S AMQQATN=+Y
 S AMQQSBCT=$P(%,U,20)
 I AMQQLINK=9 S AMQQLINK=+Y+($J/100000)
 S Z=$P(^AMQQ(1,AMQQLINK,0),U,5)
 S Z=$P(^AMQQ(4,Z,0),U)
 I Z="L"!(Z="G") S AMQQTNAR=$P(%,U,15),AMQQTDIC=U_$P(%,U,16),AMQQTLOK=U_$P(%,U,18),AMQQTTX="" S:$D(^AMQQ(5,+Y,3)) AMQQTTX=^(3) D ^AMQQTX Q:$D(AMQQQUIT)  G:'$D(AMQQTAX) VAR
 S %=^AMQQ(1,AMQQLINK,0)
 S AMQQCTXS=$P(%,U,7)
 S AMQQVCL=$P(%,U,6)
 S AMQQFTYP=$P(^AMQQ(4,$P(%,U,5),0),U)
 I $D(AMQQTAX) D SET^AMQQAT Q
CND N AMQQCOND,AMQQMULT
 I $D(AMQQYYMI) D AUTO Q
CND1 D GETCOND^AMQQAC
 I X="" W "You must enter a condition or '^'",!,*7 S X=AMQQSQNM G CND1
 I $D(AMQQQUIT) Q
 I Y>0 S AMQQCOND=+Y,AMQQNOCO=$P(^AMQQ(5,+Y,0),U,8),AMQQCONM=$P(Y,U,2),AMQQSYMB=$P(^AMQQ(5,+Y,0),U,6) G VAL
 I Y=-1,X="NULL" S AMQQCOND="",AMQQCOMP="NULL" D SPEC Q
 I Y=-1,$E(X,1,3)="EXI" W $E("EXISTS",$L(X)+1,6) S AMQQCOND="",AMQQCOMP="EXISTS" D SPEC Q
 I Y=-1,$D(AMQQXX) S AMQQFAIL=10 Q
 I Y=-1 W "  ??",*7 G CND1
 I '$D(AMQQCOND) Q
VAL K AMQQCOMP
 D ^AMQQAV
 I $G(X)="" G CND1
 I $D(AMQQQUIT) Q
 I '$D(AMQQCOMP) G CND
 D SET^AMQQAT
 I (AMQQSQN=59!((AMQQSQN>315)&(AMQQSQN<319))) S AMQQSQCV=AMQQCOMP
 Q
 ;
SPEC S AMQQQ=AMQQLINK_U_AMQQATNM_U_AMQQFTYP_"^^^^^'=^;;;"_AMQQCOMP_"^^^^^1"
 Q
 ;
AUTO ;
 S AMQQMMLL=@AMQQXXND@(AMQQYYMI,1,1,1),Y=$P(AMQQMMLL,";")
 D EN1^AMQQAC
 S AMQQCOMP=$P(AMQQMMLL,";",2,3)
 D SET^AMQQAT
 K AMQQMMLL
 Q
 ;
SET ; ENTRY POINT FROM AMQQSQA0
 N A,B,I,S,%
 K AMQQSVAL
 S %=$P($G(^AMQQ(5,AMQQSQSN,0)),U,5)
 I % S:%=9 %=AMQQSQSN+($J/100000) S %=$P($G(^AMQQ(1,%,0)),U,6) I % S %="^DD("_%_",0)" I $D(@%) S S=$P(^(0),U,3)
 I '$D(S) Q
 F I=1:1 S A=$P(S,";",I) Q:A=""  S C=$P(A,":"),B=$P(A,":",2) I $E(B,1,$L(X))=X S AMQQSVAL=C,Y="11^IS" W:'$D(AMQQXX) $E(B,$L(X)+1,99) Q
 Q
 ;