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

AMQQSQL1.m

Go to the documentation of this file.
AMQQSQL1 ; IHS/CMI/THL - GETS OVERFLOW FROM AMQQSQL ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;-----
DT ; ENTRY POINT FROM AMQQSQL
 S X=AMQQCOMP
 G D1
DATE ; ENTRY POINT FROM AMQQSQL
 N AMQQSQCV,AMQQSQBS
 S AMQQSQCV=$P(AMQQQ,U,9),AMQQSQBS=$P(AMQQQ,U,8)
 N X,Y
 S X=AMQQSQCV
D1 I X="" Q
 S AMQQSQLS=AMQQSQLS_$P(AMQQQ,U,2)_" "
 I $D(AMQQSQNT) S AMQQSQLS=AMQQSQLS_"NOT "
 I AMQQSQBS="<" S Y=+AMQQSQCV X ^DD("DD") S AMQQSQLS=AMQQSQLS_"BEFORE "_Y Q
 I AMQQSQBS=">" S Y=+AMQQSQCV X ^DD("DD") S AMQQSQLS=AMQQSQLS_"AFTER "_Y Q
 I AMQQSQBS="=" S Y=+AMQQSQCV X ^DD("DD") S AMQQSQLS=AMQQSQLS_"ON "_Y Q
 I AMQQSQBS="%" S AMQQSQLS=AMQQSQLS_"RELATIVE TO VISIT DATE" Q
 S Y=$P(AMQQSQCV,";",2)
 X ^DD("DD")
 S Z=Y
 S Y=$P(AMQQSQCV,";")
 X ^DD("DD")
 S AMQQSQLS=AMQQSQLS_"BETWEEN "_Y_" and "_Z
 Q
 ;
FREE ; ENTRY POINT FROM AMQQSQL
 N AMQQSQCV,AMQQSQBS,X,AMQQSQSP
 S AMQQSQCV=$P(AMQQQ,U,9)
 S AMQQSQBS=$P(AMQQQ,U,8)
 S %=$P(AMQQSQCV,";",4)
 I %="NULL"!(%="EXISTS")!(%="ALL") S AMQQSQSP=%
 I $D(AMQQSQNT),$G(AMQQSQSP)="NULL" K AMQQSQNT S AMQQSQSP="EXISTS"
 I $D(AMQQSQNT),$G(AMQQSQSP)="EXISTS" K AMQQSQNT S AMQQSQSP="NULL"
 S AMQQSQLS=AMQQSQLS_$P(AMQQQ,U,2)_" "
 I $G(AMQQSQSP)'="" S AMQQSQLS=AMQQSQLS_$S(AMQQSQSP="NULL":"IS NULL",1:AMQQSQSP) Q
 I $D(AMQQSQNT) S AMQQSQLS=AMQQSQLS_"NOT "
 I AMQQSQBS'="-" S X=$F("[]=$#?",AMQQSQBS)-1,X=$P("CONTAINS^FOLLOWS^IS^STARTS WITH^ENDS WITH^MATCHES",U,X)_" "_AMQQSQCV,AMQQSQLS=AMQQSQLS_X Q
 Q
 ;
SET ; ENTRY POINT FROM AMQQSQL
 N X,%
 S %=$G(^AMQQ(1,+AMQQQ,4,1,1)),X=$P(AMQQQ,U,9)
 I %'="",X X % S AMQQSQLS=AMQQSQLS_$P(AMQQQ,U,2)_" "_$P(AMQQQ,U,8)_" "_X
 Q
 ;