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

AMQQAT.m

Go to the documentation of this file.
AMQQAT ; IHS/CMI/THL - GETS ATTRIBUTE ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
VAR D EXIT
 S AMQQQ=""
 K AMQQMULT
 I '$D(AMQQNOET),$$VERSION^%ZOSV(1)["Cache" S AMQQETRP=$ZT,X="*ATERR^AMQQAT",@^%ZOSF("TRAP")
 I '$D(AMQQNOET),$$VERSION^%ZOSV(1)'["Cache" S AMQQETRP=$ZT,X="ATERR^AMQQAT",@^%ZOSF("TRAP")
RUN D GET
EXIT ; ENTRY POINT FROM MULTIPLE ROUTINES
 I $G(AMQQETRP)]"" S $ZT=AMQQETRP K AMQQETRP
 K AMQQLINK,AMQQATNM,AMQQFTYP,AMQQCOMP,AMQQCOND,AMQQCONM,AMQQCTXS,AMQQNOCO,AMQQSYMB,AMQQVCL,I,X,Y,Z,%,Q,AMQQSQRC,AMQQNATF,AMQQLCOF
 K AMQQATN,AMQQNAR,AMQQSBCT,AMQQSQFR,AMQQCCHK,AMQQNOT,AMQQDNOT,AMQQTAX,AMQQSNOT,AMQQDICB,AMQQPRST,AMQQNVAR,AMQQFRED
 Q
 ;
GET D ^AMQQATA
 I $D(AMQQQUIT) Q
 I $D(AMQQVPF) K AMQQVPF D SET Q
 I $G(AMQQLINK)=758 D CND S AMQQATN=758
 I $G(AMQQCTXS) D CTXS Q
 I $D(AMQQSCPF) W !! Q
 I $D(AMQQRNDF) K AMQQRNDF W !! G GET
 I $D(AMQQTAX) D SETTAX Q
 I X="",$D(AMQQKONG) D KONGCK G GET
 I X="" Q
 I AMQQATNM="KONGLOMERATOR" S AMQQCOND=265,AMQQSYMB="=" S:'$D(AMQQKGNO) AMQQKGNO=0 S AMQQKGNO=AMQQKGNO+1,AMQQKONG="" W !!,"OK, I'll collect queries for OR GROUP #",AMQQKGNO,! G GET
CND K AMQQCOND
 D ^AMQQAC
 I $D(AMQQQUIT) Q
 I ($D(AMQQNULL)+$D(AMQQANYF)+$D(AMQQEXST)+$D(AMQQSVFL)) K AMQQEXST Q
 I $D(AMQQONE),'$D(AMQQMULT) Q
 I '$D(AMQQCOND) G CND
 K AMQQCOMP
 D ^AMQQAV
 I $D(AMQQQUIT) Q
 I '$D(AMQQCOMP) G CND
 D SET
 Q
 ;
CTXS ; ENTRY POINT FROM AMQQATG
 S AMQQSQAA=AMQQUATN,AMQQSQAN=AMQQATNM,AMQQSQSN=AMQQATN,AMQQSQST=AMQQFTYP
 D:$G(AMQQLINK)'=763 ^AMQQSQ
 I '$D(AMQQQUIT),'$D(AMQQXSQF) D SET
 Q
 ;
SET ; ENTRY POINT FROM AMQQSQA1 AND OTHERS
 ; SET "Q" VARIABLE FOR ^UTILITY("AMQQ",$J,"Q"...
 I AMQQCTXS S:'$D(AMQQMULX) AMQQMULX="" S AMQQMULX=AMQQMULX_AMQQUATN_U
 S Y=0
 F Z=0:0 S Z=$O(^AMQQ(1,AMQQLINK,4,Z)) Q:Z'=+Z  S Y=Y+1
 S AMQQNVAR=Y
 I $D(AMQQTAX) S %=$P($G(AMQQNATF),";",2) S:% AMQQCOMP=";;;"_% S %=$P(AMQQCOMP,";",5) I %="NULL"!(%="EXISTS") S AMQQNVAR=1
 E  I $G(AMQQSQFR)>4 S AMQQNVAR=1
 I AMQQCOMP[";NULL" S AMQQNVAR=1
 I $D(AMQQNOT),'$G(AMQQCTXS) S AMQQSYMB="'"_AMQQSYMB,AMQQCONM=$S(AMQQCONM="IS":"IS NOT",1:("NOT "_AMQQCONM))
 S AMQQSNOT=$D(AMQQNOT)+(2*$D(AMQQDNOT))
 S %="",X="LINK^ATNM^FTYP^CTXS^COND^NOCO^CONM^SYMB^COMP^VCL^SER^ORTX^FRED^NVAR^FILT^SNOT^TAX"
 F I=1:1:17 S Y="AMQQ"_$P(X,U,I) I $D(@Y) S $P(%,U,I)=@Y
DEBUG S AMQQQ=%
 I $D(AMQQKONG) S ^UTILITY("AMQQ OR",$J,1,AMQQKGNO,AMQQUATN)=""
 Q
 ;
SETTAX S (AMQQSYMB,AMQQCONM)=""
 D SET
 I $D(AMQQONE),'AMQQCTXS D ^AMQQAC
 I AMQQCTXS S:'$D(AMQQMULX) AMQQMULX="" S AMQQMULX=AMQQMULX_AMQQUATN_U
 I $D(AMQQONE),'$D(AMQQPRST) S AMQQTXMT=""
 Q
 ;
ATERR I '$D(AMQQNOET) X "I $P($ZE,"">"")=""<INTERRUPT""!($ZE[""-CTRAP"")" I  W !!,"Attribute Session terminated...",!! H 2 S AMQQQUIT="" G EXIT       ;TASSC/MFD added line for Cache, added attribute to see level you're at
 W !!,"WHOOPS!!!!!!!!!!!!!"
 W !,"Something just happened which caused me to come to a grinding halt."
 W !,"Try to enter the ATTRIBUTE again, but if this problem persists you must"
 W !,"take a different approach."
 W !!!,*7
 D EXIT
 G VAR
 ;
KONGCK S I=0
 F X=0:0 S X=$O(^UTILITY("AMQQ OR",$J,1,AMQQKGNO,X)) Q:'X  I X S I=I+1 Q:I=2
 K AMQQKONG I I>1 Q
 K ^UTILITY("AMQQ OR",$J,1,AMQQKGNO)
 S AMQQKGNO=AMQQKGNO-1
 I 'I W !,"OR GROUP #",(AMQQKGNO+1)," Cancelled",*7,! Q
 W !,"Since the OR GROUP has only 1 member, I will treat it as an ordinary attribute.",*7,!
 S %=^UTILITY("AMQQ",$J,"LIST",AMQQILIN)
 S X="[OR #"_(AMQQKGNO+1)_"] "
 S %=$P(%,X)_$P(%,X,2)
 S ^UTILITY("AMQQ",$J,"LIST",AMQQILIN)=%
 Q
 ;
VIEW ; DEBUGGING UTILITY
 N X,Y,Z,I,%
 S X="LINK^ATNM^FTYP^CTXS^COND^NOCO^CONM^SYMB^COMP^VCL^SER^ORTX^FRED^NVAR^FILT^SNOT^TAX"
 S Y="LINK IEN^ATTRIBUTE NAME^DATA TYPE^SUBQUERY^CONDITION (TERM) IEN^NO. OF CONDITIONS^CONDITION NAME^BOOLEAN SYMBOL^COMPARISON VALUE^VALIDITY CODE LOCATION^SEARCH EFFICIENCY^XXX^SINGULARITY^NO. OF VARIABLES^YYY^INVERTED SUBQUERY FLAG^TAXONOMY"
 F I=1:1 S %=$P(X,U,I) Q:%=""  S Z="AMQQ"_% I $G(@Z)]"" W !,I,?4,$P(Y,U,I),": ",$S(((I=4)!(I=16)):$S(@Z:"YES",1:"NO"),1:@Z)
 Q