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

AMQQSQA.m

Go to the documentation of this file.
AMQQSQA ; IHS/CMI/THL - AMQQSQ SUBROUTINE GETS FUNCTIONS ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;-----
VAR K AMQQSQNT,AMQQSQQT,AMQQSQDV
 I $D(AMQQYYMI) D AUTO G F1
RUN S AMQQSQQQ=$S(AMQQSQFN=1:"First",1:"Next")_$S($D(AMQQGVF):" generic visit condition",1:(" condition of """_AMQQSQSJ_""""))_": "
FUN W:'$D(AMQQXX) ! D ^AMQQSQA0
F1 I $G(AMQQSQQT)'="QUIT",$D(Y),+Y=0 S AMQQQUIT="" W:'$D(AMQQXX) "  ??",*7
 I $D(AMQQSQQT)!$D(AMQQQUIT) G EXIT
 I ((+Y=306)&(AMQQSQSN'=253))!(+Y=307) S AMQQSQQQ="Condition: ",AMQQSQDV=+Y G FUN
 D SET
 I $D(AMQQSQVV) K AMQQSQVV G EXIT
 I AMQQSQN=306,AMQQSQSN=253 D ^AMQQSQBP S AMQQSQCT="B" G EXIT
 I AMQQSQSN=258!(AMQQSQSN=257),AMQQSQN=306 D ^AMQQSQVS S AMQQSQCT="B" G EXIT
 I "NC"[AMQQSQCT S AMQQSQCV="" G EXIT
 D ^AMQQSQA1
 I $D(AMQQQUIT) K AMQQQUIT G RUN
EXIT K %,AMQQSQDV,AMQQZSQL,AMQQSQRD,AMQQLCOF,%A,%B,A,B,C,D,I,S,Z
 Q
 ;
SET S AMQQSQN=+Y,AMQQSQNM=$P(Y,U,2),AMQQSQCT=$P(^AMQQ(5,+Y,0),U,20),AMQQSQTP=$P(^(0),U,21),AMQQSQFL=$P(^(0),U,22),AMQQSQBS=$P(^(0),U,6),AMQQSQNC=$P(^(0),U,8),%=$P(^(0),U,7),AMQQSQF1=$P(%,";"),AMQQSQF2="AMQQF"_$P(%,";",2)
 I AMQQSQN=402 S AMQQSQCT="V" ; VISIT;POV
 I $D(AMQQSQNT) S AMQQSQNM=$S(AMQQSQNM="IS":"IS NOT",1:("NOT "_AMQQSQNM))
 I '$D(AMQQXX),"TO"[AMQQSQCT,'$D(AMQQSVAL) W !,"Enter the value which goes with ",AMQQSQNM,"; e.g., ",AMQQSQNM," 3, ",AMQQSQNM," 10, etc."
 Q
 ;
AUTO ; ENTER SUBQUERY BY SCRIPT
 S AMQQYYMI=$O(@AMQQXXND@(AMQQYYMI))
 I 'AMQQYYMI S AMQQSQQT="" Q
 S AMQQMMMM=@AMQQXXND@(AMQQYYMI,1),(Y,AMQQMMCC)=$P(AMQQMMMM,";"),AMQQMMVV=$P(AMQQMMMM,";",2,3)
 N X S X=AMQQMMMM D SCK^AMQQSQA0
 I $D(AMQQYYMS) K AMQQYYMS S AMQQSQQT="" Q
 Q
 ;