AMQQAC1 ; IHS/CMI/THL - AMQQAC SUBROUTINE...GETS "ALL" CONDITION FOR QUERIES ;
;;2.0;IHS PCC SUITE;;MAY 14, 2009
;-----
ONE S AMQQILIN=$G(AMQQILIN)+1
S AMQQPRST=""
S ^UTILITY("AMQQ",$J,"WEIGHT",0,AMQQUATN)=""
I AMQQFTYP="F" S AMQQQ=AMQQLINK_U_AMQQATNM_U_"F^^^^^'=^;;;ANY^^9^W ?6,"""_AMQQATNM_"""^1^1^'=;;",^UTILITY("AMQQ",$J,"LIST",AMQQILIN)="W ?6,"""_AMQQATNM_"""",^UTILITY("AMQQ",$J,"Q",AMQQUATN)=AMQQQ Q
I AMQQFTYP="S" S AMQQQ=AMQQLINK_U_AMQQATNM_U_"S^^^^^'=^;;;ANY^^9^W ?6,"""_AMQQATNM_"""^1^1^'=;;",^UTILITY("AMQQ",$J,"LIST",AMQQILIN)="W ?6,"""_AMQQATNM_"""",^UTILITY("AMQQ",$J,"Q",AMQQUATN)=AMQQQ Q
I AMQQFTYP="A" S AMQQQ=AMQQLINK_"^AGE^A^^38^^^^^^9^W ?6,""AGE""^1^1^-1;99999999999;ANY",^UTILITY("AMQQ",$J,"LIST",AMQQILIN)="W ?6,""AGE""",^UTILITY("AMQQ",$J,"Q",AMQQUATN)=AMQQQ Q
I AMQQFTYP="D" S AMQQQ=AMQQLINK_U_AMQQATNM_"^D^^^^^^^^9^W ?6,"""_AMQQATNM_"""^1^1^-1;99999999999;ANY",^UTILITY("AMQQ",$J,"LIST",AMQQILIN)="W ?6,"""_AMQQATNM_"""",^UTILITY("AMQQ",$J,"Q",AMQQUATN)=AMQQQ Q
I AMQQFTYP="L"!(AMQQFTYP="G") N % S %="W ?6,"""_AMQQATNM_"""",$P(AMQQQ,U,12)=%,$P(AMQQQ,U,15)=";"_AMQQURGN,^UTILITY("AMQQ",$J,"LIST",AMQQILIN)=% D Q
. I AMQQQ["ALL" S AMQQQ=$P(AMQQQ,"ALL")_"ANY"_$P(AMQQQ,"ALL",2)
. S ^UTILITY("AMQQ",$J,"Q",AMQQUATN)=AMQQQ
I AMQQFTYP="B" S AMQQQ=AMQQLINK_U_AMQQATNM_U_"B^^^^^^-2;9^^9^^^1^-2;9",%="W ?6,"""_AMQQATNM_"""",$P(AMQQQ,U,12)=%,^UTILITY("AMQQ",$J,"LIST",AMQQILIN)=%,^UTILITY("AMQQ",$J,"Q",AMQQUATN)=AMQQQ Q
Q
;
AMQQAC1 ; IHS/CMI/THL - AMQQAC SUBROUTINE...GETS "ALL" CONDITION FOR QUERIES ;
+1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
+2 ;-----
ONE SET AMQQILIN=$GET(AMQQILIN)+1
+1 SET AMQQPRST=""
+2 SET ^UTILITY("AMQQ",$JOB,"WEIGHT",0,AMQQUATN)=""
+3 IF AMQQFTYP="F"
SET AMQQQ=AMQQLINK_U_AMQQATNM_U_"F^^^^^'=^;;;ANY^^9^W ?6,"""_AMQQATNM_"""^1^1^'=;;"
SET ^UTILITY("AMQQ",$JOB,"LIST",AMQQILIN)="W ?6,"""_AMQQATNM_""""
SET ^UTILITY("AMQQ",$JOB,"Q",AMQQUATN)=AMQQQ
QUIT
+4 IF AMQQFTYP="S"
SET AMQQQ=AMQQLINK_U_AMQQATNM_U_"S^^^^^'=^;;;ANY^^9^W ?6,"""_AMQQATNM_"""^1^1^'=;;"
SET ^UTILITY("AMQQ",$JOB,"LIST",AMQQILIN)="W ?6,"""_AMQQATNM_""""
SET ^UTILITY("AMQQ",$JOB,"Q",AMQQUATN)=AMQQQ
QUIT
+5 IF AMQQFTYP="A"
SET AMQQQ=AMQQLINK_"^AGE^A^^38^^^^^^9^W ?6,""AGE""^1^1^-1;99999999999;ANY"
SET ^UTILITY("AMQQ",$JOB,"LIST",AMQQILIN)="W ?6,""AGE"""
SET ^UTILITY("AMQQ",$JOB,"Q",AMQQUATN)=AMQQQ
QUIT
+6 IF AMQQFTYP="D"
SET AMQQQ=AMQQLINK_U_AMQQATNM_"^D^^^^^^^^9^W ?6,"""_AMQQATNM_"""^1^1^-1;99999999999;ANY"
SET ^UTILITY("AMQQ",$JOB,"LIST",AMQQILIN)="W ?6,"""_AMQQATNM_""""
SET ^UTILITY("AMQQ",$JOB,"Q",AMQQUATN)=AMQQQ
QUIT
+7 IF AMQQFTYP="L"!(AMQQFTYP="G")
NEW %
SET %="W ?6,"""_AMQQATNM_""""
SET $PIECE(AMQQQ,U,12)=%
SET $PIECE(AMQQQ,U,15)=";"_AMQQURGN
SET ^UTILITY("AMQQ",$JOB,"LIST",AMQQILIN)=%
Begin DoDot:1
+8 IF AMQQQ["ALL"
SET AMQQQ=$PIECE(AMQQQ,"ALL")_"ANY"_$PIECE(AMQQQ,"ALL",2)
+9 SET ^UTILITY("AMQQ",$JOB,"Q",AMQQUATN)=AMQQQ
End DoDot:1
QUIT
+10 IF AMQQFTYP="B"
SET AMQQQ=AMQQLINK_U_AMQQATNM_U_"B^^^^^^-2;9^^9^^^1^-2;9"
SET %="W ?6,"""_AMQQATNM_""""
SET $PIECE(AMQQQ,U,12)=%
SET ^UTILITY("AMQQ",$JOB,"LIST",AMQQILIN)=%
SET ^UTILITY("AMQQ",$JOB,"Q",AMQQUATN)=AMQQQ
QUIT
+11 QUIT
+12 ;