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

AMQQMUL1.m

Go to the documentation of this file.
AMQQMUL1 ; IHS/CMI/THL - COLLECT MULTIPLE VALUES FOR POVS, PROCEDURES, ETC. ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;-----
VAR F I=1:1:19 D
 .S X=$P("GR;ID;ST;FIN;LAST;VAL1;SPEC;UATN;MLT;T;NVAR;FVAR;ITR;NNA;STRT;MSS;MPC;MULZ;USQN",";",I)
 .S @("AMQQ"_X)=$P(AMQQX,";",I)
 I $D(^TMP("AMQQ",$J,+$G(AMQP(.1)),AMQP(0))) S AMQT(AMQQT)=0 Q  ;TEMP FOR REGISTER TESTING
 I '$D(AMQQAG) S AMQQAG="AG"
 I '$D(AMQQSQVN) S AMQQ=U_AMQQGR_"(""A"_$S(AMQQGR="AUPNVPRV":"C",1:"A")_""",AMQP(0))"
 E  S AMQQ=U_AMQQGR_"(""AD"","_AMQQSQVN_")",%=+^AUPNVSIT(AMQQSQVN,0) G:'% EXIT S AMQQVDAT=(9999999-%)\1,AMQQVSIT=AMQQSQVN
 S AMQQVAL1=+AMQQVAL1
 S AMQQMSS=+AMQQMSS
 S AMQQMPC=AMQQMPC+'AMQQMPC
 S AMQQHOLD=0
 S AMQT(AMQQT)=0
 S AMQQLCNT=0
 K ^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN)
 I $E(AMQQST)?1P,'$D(AMQQSQVN) D REL^AMQQMULS
 I AMQQMULZ S AMQQMUNV=AMQQNVAR,AMQQMUFV=AMQQFVAR,AMQQMULL=AMQQMULZ
 I '$D(AMQQSQVN),'$D(@AMQQ) S AMQT(AMQQT)=0 G NULL
 I $G(AMQQSPEC)="EXISTS",AMQQSTRT=2,'AMQQST,'AMQQUSQN,AMQQFIN=9999999,AMQQLAST=9999999 S ^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN,1)="+",AMQP(AMQQFVAR)="+",AMQT(AMQQT)=1 G EXIT
RUN I '$D(AMQQSQVN),AMQQGR="AUPNVHF" D HINC G SQ
 I $G(AMQP(0)),$G(AMQQONE)]""!($G(AMQV(1))["DIBT("),$G(AMQP(.1))="","^AUPNVRAD^AUPNVCPT^AUPNVDXP^AUPNVMSR^"[(U_AMQQGR_U),$D(^UTILITY("AMQQ TAX",$J)) D AMQP G SQ
 I '$D(AMQQSQVN),AMQQGR'="AUPNVPRV" D INC G SQ
 S AMQQVNO=0
 D VINC
SQ I $D(AMQV("SQ")) D ^AMQQMULS
 I $D(^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN)),AMQQSPEC="NULL"!(AMQQSPEC="INVERSE") K ^(AMQQUATN) G EXIT
 I $D(^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN)) G TRUE
NULL I AMQQSPEC'="NULL",AMQQSPEC'="ANY",AMQQSPEC'="INVERSE"
 E  S ^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN,1)="-",AMQP(AMQQFVAR)="-",AMQT(AMQQT)=1
 G EXIT
TRUE I AMQQSPEC="EXISTS",AMQQ'["AUPNVIF" K ^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN) S ^(AMQQUATN,1)="+",AMQP(AMQQFVAR)="+"
 S AMQT(AMQQT)=1
EXIT I AMQQAG="SAG" K ^UTILITY("AMQQ",$J,"SAG",AMQQUATN)
 D EXIT3^AMQQKILL
 Q
 ;
INC S AMQQVDAT=9999999-AMQQFIN
INCDATE I "^AUPNVRAD^AUPNVCPT^AUPNVDXP^AUPNVMSR^"'[(U_AMQQGR_U) S AMQQVDAT=$O(@AMQQ@(AMQQVDAT))
 E  S AMQQVDAT=$O(@AMQQ@($S('$G(AMQP(99.1)):AMQP(.1),1:AMQP(99.1)),AMQQVDAT))
 I AMQQVDAT'=+AMQQVDAT Q
 I (9999999-AMQQVDAT)'>AMQQST Q
 S AMQQVNO=0
INCITEM S AMQQVNO=$S(AMQQGR'["AUPNVRAD"&(AMQQGR'["AUPNVCPT")&(AMQQGR'["VDXP")&(AMQQGR'["VMSR"):$O(@AMQQ@(AMQQVDAT,AMQQVNO)),1:$O(@AMQQ@($S('$G(AMQP(99.1)):AMQP(.1),1:AMQP(99.1)),AMQQVDAT,AMQQVNO)))
 I 'AMQQVNO G INCDATE
 I AMQQGR="AUPNVPOV",'$D(AMQP(3)) S AMQP(3)=AMQQVNO
 S %=U_AMQQGR_"("_AMQQVNO_","_AMQQMSS_")"
 I $D(@%),$D(^(0)) S AMQQVALU=$P(^(AMQQMSS),U,AMQQMPC),AMQQVSIT=$P(^(0),U,3) D SET I 1
 E  G INCITEM
 I AMQQLCNT=AMQQLAST D LASTEVAL^AMQQMULT I $D(AMQQQUIT) K AMQQQUIT Q
 I AMQQSPEC="EXISTS"&(AMQQ'["AUPNVIF")!(AMQQSPEC="NULL"),AMQQLCNT,'$D(AMQV("SQ")) S AMQQLCNT=-1 Q
 G INCITEM
 ;
SET I AMQQVALU="" Q
 I '$D(^UTILITY("AMQQ TAX",$J,AMQQVAL1,AMQQVALU)),'$D(^("*")),'$D(^("-")) Q
S1 S AMQQHOLD=AMQQHOLD+1
 S AMQQLCNT=AMQQLCNT+1
 S ^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN,AMQQHOLD)=AMQQVALU_U_(9999999-AMQQVDAT)_U_AMQQVSIT_U_AMQQVNO
 K AMQQOK
 Q
 ;
VINC S AMQQVNO=$O(@AMQQ@(AMQQVNO))
 I 'AMQQVNO Q
 S %=U_AMQQGR_"("_AMQQVNO_","_AMQQMSS_")"
 I $D(@%),$D(^(0)) S AMQQVALU=$P(^(AMQQMSS),U,AMQQMPC) S:AMQQGR="AUPNVPRV" AMQQVSIT=$P(^(0),U,3),AMQQVDAT=9999999-(+^AUPNVSIT(AMQQVSIT,0)) D SET I 1
 E  G VINC
 I AMQQLCNT=AMQQLAST Q
 I AMQQSPEC="NULL"!(AMQQSPEC="EXISTS")!(AMQQSPEC="INVERSE") Q
 G VINC
 ;
HINC N AMQQHFNO,AMQQOLD
 S AMQQOLD=AMQQ
 N AMQQ
 S AMQQ=U_AMQQGR_"(""AA"",AMQP(0),AMQQHFNO)"
 F AMQQHFNO=0:0 S AMQQHFNO=$O(@AMQQOLD@(AMQQHFNO)) Q:'AMQQHFNO  D INC
 Q
 ;
CHS ; ENTRY POINT FROM METADICTIONARY
 I '$D(AMQQAG) S AMQQAG="AG"
 N Y,Z,%
 S X=""
 S %=^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN,AMQQHOLD)
 S Z=^AUPNVCHS($P(%,U,4),0)
 I %=""!(Z="") S X="??" Q
 S Y=$P(%,U,4)
 I Y'="" S X="#"_Y_" "
 S Y=$P(%,U,2)
 I Y X ^DD("DD") S X=X_Y_" "
 S Y=$P(Z,U,14)
 I Y S Y=$P(^AUTTVNDR(Y,0),U),Y=$E(Y,1,12) I Y'="" S X=X_Y_"  "
 D LOS
 I Y'="" S X=X_"("_Y_" days) "
 S Y=$P(Z,U,6)
 I Y'="" S X=X_"$"_Y
 Q
 ;
LOS S Y=%
 N H,%,%H,%Y,%T,X,Z
 S %=Y
 S Y=$P(%,U,2)
 S Z=$P(%,U,4)
 S Z=$P(^AUPNVCHS(Z,0),U,7)
 I 'Z!('Y) S Y="" Q
 F X=Z,Y D H^%DTC S:$D(Z) H=+%H S:'$D(Z) Y=H-(+%H) K Z
 Q
AMQP ;
 N XXX,YYY
 S XXX=0
 F  S XXX=$O(^UTILITY("AMQQ TAX",$J,XXX)) Q:'XXX  D
 .S AMQP(.1)=$O(^UTILITY("AMQQ TAX",$J,XXX,""))
 .I AMQP(.1)="*" D AMQPALL Q
 .S AMQP(.1)=0
 .F  S AMQP(.1)=$O(^UTILITY("AMQQ TAX",$J,XXX,AMQP(.1))) Q:'AMQP(.1)  D INC
 Q
AMQPALL ;
 S YYY=U_AMQQGR_"(""B"")"
 S AMQP(.1)=0
 F  S AMQP(.1)=$O(@YYY@(AMQP(.1))) Q:'AMQP(.1)  D INC
 Q