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

AMQQQ0.m

Go to the documentation of this file.
AMQQQ0 ; IHS/CMI/THL - AMQQQ SUBROUTINE PARSES SCRIPTS ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 S AMQQXXII=0
RUN F AMQQXXGN=0:0 S AMQQXXGN=$O(@AMQQXXGG) Q:'AMQQXXGN  S AMQQXXXX=@AMQQXXGI D ANAL,CHECK I  Q
EXIT K AMQQXXGN,^UTILITY("AMQQ",$J,"XXTAX"),%,A,I
 Q
 ;
ANAL S AMQQXXXX=$P(AMQQXXXX,"**")
 I "*+"[$E(AMQQXXXX) Q
 K AMQQXXAA,AMQQXXCC,AMQQXXVV
 I $E(AMQQXXXX)="-" S AMQQXXNN="",AMQQXXXX=$E(AMQQXXXX,2,999),A=AMQQXXXX D STRIP^AMQQQ S AMQQXXXX=A
 I AMQQXXXX["!" D KONG Q
 D ATT
 D CHECK
 I  Q
 I $D(AMQQXXNF) K AMQQXXNF G A1
 I AMQQCTXS D MULT Q
 I AMQQFTYP="G"!(AMQQFTYP="L") D TAX,CHECK Q:$T  S AMQQXXCC="TAX" G A1
 I $D(AMQQONE) S (AMQQXXVV,AMQQXXCC)="" D SET Q
 D COND
 D CHECK
 I  Q
 D VAL
 D CHECK
 I  Q
A1 D SET
 Q
 ;
ATT S X=$P(AMQQXXXX,";")
 D AUTO^AMQQATA
 I Y=-1,AMQQXXXX'[";" D NATL Q
 I Y'=-1 D ^AMQQSEC
 I Y=-1 K AMQQXXNN S AMQQFAIL=6 Q
SETATT S AMQQXXAA=Y
 S %=^AMQQ(5,+Y,0)
 S AMQQLINK=$P(%,U,5)
 S AMQQATN=+Y
 I AMQQLINK=9 S AMQQATNM=$P(Y,U,2) D ^AMQQATAL
 S %=^AMQQ(1,AMQQLINK,0)
 S AMQQCTXS=$P(%,U,7)
 S AMQQFTYP=$P(^AMQQ(4,$P(%,U,5),0),U)
 Q
 ;
COND S X=$P(AMQQXXXX,";",2)
 K AMQQCOND
 I X="" S (AMQQCOND,AMQQXXCC)="" Q
 I "^NULL^ALL^ANY^EXISTS^"[(U_X_U) S:X="ALL" X="EXISTS" S AMQQXXCC=X,AMQQCOND=";;;"_X Q
 D AUTO^AMQQAC
 I Y=-1 S AMQQFAIL=7 Q
SETCOND S AMQQCOND=+Y
 S AMQQNOCO=$P(^AMQQ(5,+Y,0),U,8)
 S AMQQCONM=$P(Y,U,2)
 S AMQQSYMB=$P(^AMQQ(5,+Y,0),U,6)
 S AMQQXXCC=Y
 Q
 ;
VAL S (AMQQXXVV,X)=$P(AMQQXXXX,";",3)
 K AMQQCOMP
 I X="",$G(AMQQCOND) S AMQQFAIL=8 Q
 D ^AMQQAV
 I '$D(AMQQCOMP) S AMQQFAIL=8 Q
 S AMQQXXVV=AMQQCOMP
 Q
 ;
SET S AMQQXXII=$G(AMQQXXII)+1
 S AMQQXX(AMQQXXII,1)=AMQQXXAA_";"_$G(AMQQXXCC)_";"_AMQQXXVV
 Q
 ;
TAX ; ENTRY POINT FROM AMQQ1
 I $P(AMQQXXXX,";",2)="=" G T1
 I $P(AMQQXXXX,";",2)="'=" S AMQQXXNT="INVERSE" G T1
 I $D(AMQQONE) G T2
 S AMQQFAIL=9 Q
T1 I $P(AMQQXXXX,";",3)="" S AMQQFAIL=8 Q
 D TGRP
 I $D(AMQQFAIL) Q
T2 K AMQQTAX
 S %=^AMQQ(5,AMQQATN,0)
 S AMQQTNAR=$P(%,U,15)
 S AMQQTDIC=U_$P(%,U,16)
 S AMQQTLOK=U_$P(%,U,18)
 S AMQQTTX=$G(^AMQQ(5,AMQQATN,3))
 S AMQQXXN=0
 D ^AMQQTX
 K AMQQXXTT,AMQQXXTN
 I '$D(AMQQTAX) S AMQQFAIL=8 Q
 I $D(AMQQXXNT) S AMQQSCMP=AMQQXXNT K AMQQXXNT D SCMP^AMQQTX S AMQQXXVV=AMQQCOMP I 1
 E  S AMQQXXVV=AMQQTAX
 K AMQQTAX
 Q
 ;
TGRP S %=$P(AMQQXXXX,";",3)
 I $E(%)="[" S X=$E(%,2,999),X=$P(X,"]") I $D(^UTILITY("AMQQ",$J,"XXTAX",X)) S AMQQXXTT=X Q
 S AMQQXXI=AMQQXXGN
 S AMQQXXX1=%
 D TG1
 K AMQQXXX1
 Q
 ;
TG1 N AMQQXXGN
 S AMQQXXGN=AMQQXXI
 S AMQQXXTT="XXTEMP"
 S AMQQXXTN=0
 K ^UTILITY("AMQQ",$J,"XXTAX",AMQQXXTT)
TG11 F I=1:1 S %=$P(AMQQXXX1,",",I) Q:%=""  S AMQQXXTN=AMQQXXTN+1,^UTILITY("AMQQ",$J,"XXTAX",AMQQXXTT,AMQQXXTN)=%
 S AMQQXXGN=$O(@AMQQXXGG)
 I 'AMQQXXGN Q
 S %=@AMQQXXGI
 I $E(%)="+" S AMQQXXX1=$E(%,2,999) G TG11
 Q
 ;
CHECK I $D(AMQQQUIT)!($D(AMQQFAIL))
 Q
 ;
KONG F AMQQXXXI=1:1 S AMQQXXX1=$P(AMQQXXXX,"!",AMQQXXXI) Q:AMQQXXX1=""  D OR,CHECK I  Q
 K AMQQXXX1,AMQQXXXI
 Q
 ;
OR N AMQQXXXX
 S AMQQXXXX=AMQQXXX1
 D ATT,CHECK
 I  Q
 I AMQQCTXS S AMQQFAIL=9 Q
 I AMQQFTYP="G"!(AMQQFTYP="L") D TAX G OR1
 D COND
 D CHECK
 I  Q
 D VAL
 D CHECK
 I  Q
OR1 I AMQQXXXI=1 S AMQQXXII=$G(AMQQXXII)+1
 S AMQQXX(AMQQXXII,AMQQXXXI)=AMQQXXAA_";"_$G(AMQQXXCC)_";"_AMQQXXVV
 Q
 ;
MULT S AMQQXXII=$G(AMQQXXII)+1
 S AMQQXX(AMQQXXII,1)=Y_";MULT"
 S AMQQXXLV=1
 S AMQQXXND="AMQQXX("_AMQQXXII_",1)"
 D ^AMQQQ1
 Q
 ;
NATL K AMQQTAX D ^AMQQN2
 I $D(AMQQFAIL) S Y=-1 K AMQQXXNN G NEXIT
 I $D(AMQQTAX) S AMQQXXAA=AMQQNATT,AMQQXXCC=AMQQNCND,AMQQXXVV=AMQQTAX,AMQQXXNF="" S:$D(^UTILITY("AMQQ TAX",$J,AMQQTAX,"--")) AMQQXXVV=AMQQXXVV_";INVERSE" G NEXIT
 S Y=AMQQNATT
 D SETATT
 S Y=AMQQNCND
 D SETCOND
 S AMQQXXVV=AMQQNVAL,AMQQXXNF=""
NEXIT K AMQQNATT,AMQQNCND,AMQQNVAL,AMQQNTYP,AMQQTNAR,AMQQTDIC,AMQQTAX,AMQQTLOK,AMQQTTX,AMQQXXN,AMQQXXNT
 Q
 ;