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

AMQQAC.m

Go to the documentation of this file.
AMQQAC ; IHS/CMI/THL - GETS CONDITIONS ; [ 07/26/2011  3:56 PM ]
 ;;2.0;IHS PCC SUITE;**7**;MAY 14, 2009
 ;-----
CONDP I $D(AMQQONE) D ^AMQQAC1 S AMQQUATN=AMQQUATN+1 Q
 I AMQQATNM="ALIVE" S AMQQCOND=7,AMQQNOT="",AMQQSYMB="<",AMQQNOCO=1,AMQQCONM="BEFORE" Q
 I AMQQATNM="COHORT" S AMQQCOND=238,AMQQSYMB="=",AMQQNOCO=1,AMQQCONM="IS A MEMBER OF" Q
 I AMQQATNM="FILE ENTRY" S AMQQCOND=264,AMQQSYMB="=",AMQQNOCO=1,AMQQCONM="IS ENTERED IN" Q
COND K AMQQSVAL
 D GETCOND
 I $E($G(X))=U K Y Q
Y I Y=-1 D SPEC I '$D(Y) Q
 I Y=-1 W "  ??",*7 G COND
 I $D(AMQQLINK) S %=^AMQQ(1,AMQQLINK,0) I $P(%,U,5)=13,$D(AMQQNOT),+Y>106,+Y<109 S Y=-1 W "  ??",*7 G COND
EN1 ; ENTRY POINT FROM AMQQQ2
 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)
 Q
 ;
GETCOND ; ENTRY POINT FORM AMQQSQA1
 I AMQQATN=783 S I=5 D S1 S Y=11,AMQQFTYP="S" Q  ;PATCH XXX
 I AMQQATN=368!(AMQQATN=415)!(AMQQATN=454) S X="ALL" G AUTO
 I $D(AMQQNATF),$P(AMQQNATF,";")'="" S Y=$P(AMQQNATF,";") Q
 S %=AMQQATN
 I "^59^316^317^318^"[(U_%_U) S %=$S(%=316:"AFTER",%=317:"BEFORE",1:"BETWEEN") G CONDIC
 I AMQQFTYP="S" D SET G CONDIC
 I AMQQFTYP="F",'$D(AMQQFIFL),'$D(AMQQSQTP) S AMQQDICB="ANY"
 I "Q"[AMQQFTYP,$D(AMQQFIFL) S AMQQDICB="IS"
 K AMQQNOT
 I AMQQLINK>764,AMQQLINK<768 D STARSTOP Q
 I AMQQLINK=699 D STARSTOP Q
 W !,"Condition: "
 W:$D(AMQQDICB) AMQQDICB,"// "
 R X:DTIME E  S X=U
 I $E(X)=U S AMQQQUIT="" Q
 I X="",$D(AMQQDICB) S X=AMQQDICB
 K AMQQDICB,AMQQFIFL
 I X="" D ACA Q:X=4  I X="~~~COND"[X G GETCOND
 I X="" W !! K AMQQCOND Q
 I X="??" S X="AD^"_$O(^AMQQ(4,"B",AMQQFTYP,"")) D ^AMQQHELP G GETCOND
 I X?1."?" N %A,%B S XQH=$O(^DIC(9.2,"B","AMQQCONDITION","")) D EN1^XQH G GETCOND
 I X[" ",$E(X,$L(X))?1N S AMQQSVAL=$P(X," ",$L(X," ")),X=$P(X," ",1,$L(X," ")-1)
AUTO ; ENTRY POINT FROM AMQQQ
 I X["NOT"!(X["'") D NOT
CONDIC ; ENTRY POINT FROM AMQQ1
 S DIC="^AMQQ(5,"
 S DIC(0)="ES"
 S DIC("S")="I $P(^(0),U,3)="_$O(^AMQQ(4,"B",AMQQFTYP,""))
 S D="C"
 I AMQQFTYP="S"!($D(AMQQXX)) S DIC(0)=""
 I $D(AMQQSQRD) S DIC("S")=DIC("S")_"!(Y=363)"
 D IX^DIC
 K DIC
 I +Y'=363 K AMQQSQRD
STARSTOP ;SET CONDITION FOR FORMULA/SOLIDS STARTED AND BREAST STOPPED ATTRIBUTES
 I AMQQLINK=766!(AMQQLINK=767) S X="ON OR AFTER",Y="16^ON OR AFTER"
 I AMQQLINK=765 S X="ON OR BEFORE",Y="17^ON OR BEFORE"
 I AMQQLINK=699 S X="CONTAINS",Y="13^CONTAINS"
 Q
 ;
SPEC I X="*" S X="ALL" W "  (List all values)"
 S Z="ANY;SAVE;ALL;EXISTS;BLANK;EMPTY;NULL;@"
 F I=1:1 S %=$P(Z,";",I) Q:%=""  I X=$E(%,1,$L(X)) W $E(%,$L(X)+1,99) S X=% D S1 Q
 Q
 ;
S1 I $D(AMQQMULT) Q
 I I>2,$D(AMQQNOT) S I=$S(I>4:4,1:5) K AMQQNOT
 S X=$S(I>4:"NULL",I>2:"EXISTS",I=1:"ANY",1:"SAVE")
 S AMQQCOMP=X
 I I>2 S AMQQQ=AMQQLINK_U_AMQQATNM_U_AMQQFTYP_"^^^^^'=^;;;"_X_"^^^^^1",AMQQEXST="" K Y Q
 I I=2 S AMQQSVFL="" D ^AMQQAC1 S AMQQUATN=AMQQUATN+1 K Y Q
ANY ; ENTRY POINT FROM AMQQAV0
 S Y=" (ANY VALUE INCLUDING 'NULL')"
 S AMQQILIN=AMQQILIN+1
 S ^UTILITY("AMQQ",$J,"LIST",AMQQILIN)="W ?6,"""_AMQQATNM_Y_""""
 S ^UTILITY("AMQQ",$J,"WEIGHT",9,AMQQUATN)=""
 S AMQQQ=AMQQLINK_U_AMQQATNM_U_AMQQFTYP_"^^^^^=^;;;ANY^^9^W ?6,"""_AMQQATNM_"""^1^1^1"
 S ^UTILITY("AMQQ",$J,"Q",AMQQUATN)=AMQQQ
 S AMQQUATN=AMQQUATN+1
 S AMQQANYF=""
 K Y
 Q
 ;
ACA ; ENTRY POINT FROM AMQQAV0 AND THE AMQQTAX* ROUTINES
 I $D(AMQQSQTP) S X="" Q
 I '$D(AMQQATNM) S X="" Q
 I "^DX^RX^PROC^"[(U_AMQQATNM_U),'$D(AMQQONE) S X="" Q
 W !!,"Since you did not specify a condition, select one of the following =>",!
 W !,?5,"1) Whoops...Let me try again"
 W !,?5,"2) List every ",AMQQATNM
 W !,?5,"3) List any ",AMQQATNM," including 'NULL'"
 W !,?5,"4) Exit",!
ACAR R !,"YOUR CHOICE (1-4): 1// ",X:DTIME E  S X=U
 I X=U S AMQQQUIT="",X="" Q
 I X=4 S AMQQQUIT="" Q
 I X?1."?" W !!,"Enter a number from 1 to 4 or '^' to exit",!! G ACAR
 I X="" S X=1 W "  (1)"
 I X,X<4 G ACAA
 W "  ??",*7 G ACAR
ACAA S X=$P("^ALL^ANY",U,X)
 Q
 ;
SET N A,Y,Z,%,I
 S X=$P(^AMQQ(1,AMQQLINK,0),U,6)
 S Y=+X
 S Z=$P(X,",",2)
 S %=";"_$P(^DD(Y,Z,0),U,3)
 W !,"CHOOSE FROM: "
 F I=2:1 S A=$P(%,";",I) Q:A=""  W !,?7,$P(A,":"),?15,$P(A,":",2)
 S X="IS"
 Q
 ;
NOT S Y="AMQQNOT"
 G NOTX
DNOT S Y="AMQQDNOT"
NOTX I $E(X,1,4)="NOT " S X=$E(X,5,99),@Y="" Q
 I $E(X)="'" S X=$E(X,2,99),@Y="" Q
 S %=$L(X)
 I $E(X,%-3,%)=" NOT" S X=$E(X,1,%-4),@Y=""
 Q
 ;-----