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

AMQQCMPS.m

Go to the documentation of this file.
AMQQCMPS ; IHS/CMI/THL - SAVE AND RESTORE Q-MAN SEARCH CODE FROM THE SCRIPT FILE ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;-----
SAVE S AMQQCPLN=0
 K ^AMQQ(2,+AMQQYY,2)
 S X="AMQV("""")"
 F  S X=$Q(@X) Q:$E(X,1,4)'="AMQV"  S Z="C;"_X_";"_@X D SET
 F X=0:0 S X=$O(^UTILITY("AMQQ TAX",$J,X)) Q:'X  S Y="" F  S Y=$O(^UTILITY("AMQQ TAX",$J,X,Y)) Q:Y=""  S Z="T;"_X_";"_Y D SET
 F X=0:0 S X=$O(^UTILITY("AMQQ",$J,"VAR NAME",X)) Q:'X  S Z="V;"_X_";"_^(X) D SET
 F X=0:0 S X=$O(^UTILITY("AMQQ",$J,"LIST",X)) Q:'X  S Z="L;"_X_";"_^(X) D SET
 S ^AMQQ(2,+AMQQYY,2,0)=U_U_+AMQQCPLN_U_AMQQCPLN_U_DT_U_U
EXIT K X,Y,Z,AMQQCPLN,%,A,I
 Q
 ;
SET S AMQQCPLN=AMQQCPLN+1
 S ^AMQQ(2,+AMQQYY,2,AMQQCPLN,0)=Z
 Q
 ;
RESTORE ; ENTRY POINT FROM AMQQQE
 F AMQQCPLN=0:0 S AMQQCPLN=$O(^AMQQ(2,+AMQQYY,2,AMQQCPLN)) Q:'AMQQCPLN  S Z=^(AMQQCPLN,0) D @$P(Z,";")
REXIT K AMQQCPLN,X,Y,Z
 Q
 ;
C S @$P(Z,";",2)=$P(Z,";",3,99)
 Q
 ;
T S ^UTILITY("AMQQ TAX",$J,$P(Z,";",2),$P(Z,";",3))=""
 Q
 ;
V S ^UTILITY("AMQQ",$J,"VAR NAME",$P(Z,";",2))=$P(Z,";",3,99)
 Q
 ;
L S ^UTILITY("AMQQ",$J,"LIST",$P(Z,";",2))=$P(Z,";",3,99)
 Q
 ;
M S @("^AMQQ(1,"_$P(Z,";",2))=$P(Z,";",3,99)
 Q
 ;
OUTPUT ; - EP -
 N X,Y,Z,%,A,I,AMQQYYI,AMQQYYX
 I $D(@(AMQQYY_"0)")) G LIST
 S AMQQYYN=0
 S AMQQYYG=AMQQYY_"AMQQYYN)"
 S %="DFN"
 S X=0
 F  S X=$O(^UTILITY("AMQQ",$J,"VAR NAME",X)) Q:'X  S Y=^(X),%=%_U_$P(^AMQQ(1,+Y,4,$P(Y,U,2),0),U)
 S @AMQQYYG=%
LIST I '$D(^DPT(AMQP(0),0)) Q
 S AMQQYYS=AMQP(0)
 I $G(AMQQMULL),$D(^UTILITY("AMQQ",$J,"AG",AMQQMULL)) D MLIST Q
 D LSET
 Q
 ;
LSET F AMQQYYI=9:0 S AMQQYYI=$O(^UTILITY("AMQQ",$J,"VAR NAME",AMQQYYI)) Q:'AMQQYYI  S Y=^(AMQQYYI),X=AMQP(AMQQYYI) D TRANS S AMQQYYS=AMQQYYS_U_X
 S AMQQYYN=AMQQYYN+1
 S @AMQQYYG=AMQQYYS
 Q
 ;
TRANS I X="+"!(X="-")!(X="") Q
 I +Y=7 S X=(DT-X)\10000 Q
 I +Y,$P(Y,U,2),$D(^AMQQ(1,+Y,4,$P(Y,U,2),1)) N % X ^(1)
 Q
 ;
MLIST F AMQQHOLD=0:0 S AMQQHOLD=$O(^UTILITY("AMQQ",$J,"AG",AMQQMULL,AMQQHOLD)) Q:'AMQQHOLD  S AMQQYYAG=^(AMQQHOLD) D M1
 K AMQQHOLD,^UTILITY("AMQQ",$J,"AG",AMQQMULL),X,Y,A,I,%,AMQQYYAG
 Q
 ;
M1 S AMQQYYX=AMQQMUFV-1
 F AMQQYYI=1:1:AMQQMUNV S AMQQYYX=$O(^UTILITY("AMQQ",$J,"VAR NAME",AMQQYYX)) Q:'AMQQYYX  S Y=^(AMQQYYX),A=$P(Y,U,2) I A S AMQP(AMQQYYX)=$P(AMQQYYAG,U,A)
 S AMQQYYS=AMQP(0)
 D LSET
 Q
 ;