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

AMQQMULP.m

Go to the documentation of this file.
AMQQMULP ; IHS/CMI/THL - PROVIDER CRITERIA ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;-----
VAR S %=AMQQX
 S AMQQSQPS=+%
 S AMQQSQP1=$P(%,";",2)
 S AMQQSQP2=$P(%,";",3)
 S AMQQSQPZ=$P(%,";",4)
 S AMQQSQPG="^UTILITY(""AMQQ"",$J,""PRO"")"
 K @AMQQSQPG
RUN K AMQP(5)
 I '$G(AMQP(1)) S AMQT(AMQQSQPZ)=0 G EXIT
 N X,A,B,C
 I '$D(^AUPNVPRV("AD",AMQP(1))) D  I 1
 .I '$D(AMQQGR) Q
 .I $G(AMQQGR)'["VMED",$G(AMQQGR)'["VLAB" D  I 1
 ..S A=0
 ..S B="^"_AMQQGR
 ..F  Q:$D(X)  S A=$O(@B@("AD",AMQP(1),A)) Q:'A  I +@B@(A,0)=AMQQVALU S X=$P(^(0),U,$S(B["VMED":9,1:7))
 .E  S X=$S(AMQQGR["VMED":$P($G(^AUPNVMED(+$G(AMQP(.11)),0)),U,9),1:$P($G(^AUPNVLAB(+$G(AMQP(.2)),0)),U,7))
 .I $G(X)]"" S @AMQQSQPG@(X)="",AMQP(5)=X
 E  F AMQQSQPD=0:0 S AMQQSQPD=$O(^AUPNVPRV("AD",AMQP(1),AMQQSQPD)) Q:'AMQQSQPD  S X=^AUPNVPRV(AMQQSQPD,0) D PASS1
 I $D(@AMQQSQPG) D PASS2
CK S AMQT(AMQQSQPZ)=$D(@AMQQSQPG)
 I AMQT(AMQQSQPZ),'$D(AMQP(5)) D PRIME
EXIT K @AMQQSQPG,AMQQSQPS,AMQQSQP1,AMQQSQP2,AMQQSQPT,AMQQSQPN,AMQQSQPG,AMQQSQPZ,AMQQSQPD
 Q
 ;
PASS1 I AMQQSQPS=3 G SET1
 S Y=$P(X,U,4)
 I AMQQSQPS=1,Y'="P" Q
 I AMQQSQPS=2,Y'="S" Q
SET1 S @AMQQSQPG@(+X)=""
 Q
 ;
PASS2 N AMQP
 S AMQQSQPN=AMQQSQP1-.001
 F  S AMQQSQPN=$O(AMQV("QQ",AMQQSQPN)) Q:'AMQQSQPN  Q:AMQQSQPN>AMQQSQP2  S AMQQSQPT=AMQV("QQ",AMQQSQPN,1) D TEST
 Q
 ;
TEST F AMQP(5)=0:0 S AMQP(5)=$O(^UTILITY("AMQQ",$J,"PRO",AMQP(5))) Q:'AMQP(5)  X AMQQSQPT I  K ^UTILITY("AMQQ",$J,"PRO",AMQP(5))
 Q
 ;
POV ; ENTRY POINT FROM METADICTIONARY
 N X,Y,Z,%,A
 S X=+AMQQX
 S Y=$P(AMQQX,";",4)
 S Z=0
 S A=$P(AMQQX,";",5)
 I $D(^UTILITY("AMQQ TAX",$J,X,"--")) D POV1 Q
 I $D(^UTILITY("AMQQ TAX",$J,X,"-")) S AMQT(Y)='$D(^AUPNVPOV("AD",AMQP(1))),AMQP(A)="-" Q
 F  S Z=$O(^AUPNVPOV("AD",AMQP(1),Z)) Q:'Z  S %=$P($G(^AUPNVPOV(Z,0)),U) I %,$D(^UTILITY("AMQQ TAX",$J,X,%))+$D(^("*")) S AMQP(A)="+" G POVEXIT
 S AMQT(Y)=0
 Q
POVEXIT S AMQT(Y)=1
 Q
 ;
POV1 F  S Z=$O(^AUPNVPOV("AD",AMQP(1),Z)) Q:'Z  S %=$P($G(^AUPNVPOV(Z,0)),U) I %,$D(^UTILITY("AMQQ TAX",$J,X,%)) G POVEXIT1
 S AMQT(Y)=1
 S AMQP(A)="-"
 Q
POVEXIT1 S AMQT(Y)=0
 Q
 ;
PRIME N %,X
 S AMQP(5)="??"
 F %=0:0 S %=$O(^AUPNVPRV("AD",AMQP(1),%)) Q:'%  S X=$G(^AUPNVPRV(%,0)) I $P(X,U,4)="P" S AMQP(5)=+X Q
 Q
 ;
PRC ; ENTRY POINT FROM METADICTIONARY
 N X,Y,Z,%,A
 S X=+AMQQX
 S Y=$P(AMQQX,";",4)
 S Z=0
 S A=$P(AMQQX,";",5)
 I $D(^UTILITY("AMQQ TAX",$J,X,"--")) D PRC1 Q
 I $D(^UTILITY("AMQQ TAX",$J,X,"-")) S AMQT(Y)='$D(^AUPNVPRC("AD",AMQP(1))),AMQP(A)="-" Q
 F  S Z=$O(^AUPNVPRC("AD",AMQP(1),Z)) Q:'Z  S %=$P($G(^AUPNVPRC(Z,0)),U) I %,$D(^UTILITY("AMQQ TAX",$J,X,%))+$D(^("*")) S AMQP(A)="+" G PRCEXIT
 S AMQT(Y)=0
 Q
PRCEXIT S AMQT(Y)=1
 Q
 ;
PRC1 F  S Z=$O(^AUPNVPRC("AD",AMQP(1),Z)) Q:'Z  S %=$P($G(^AUPNVPRC(Z,0)),U) I %,$D(^UTILITY("AMQQ TAX",$J,X,%)) G PRCEXIT1
 S AMQT(Y)=1
 S AMQP(A)="-"
 Q
PRCEXIT1 S AMQT(Y)=0
 Q
 ;
DXP ; ENTRY POINT FROM METADICTIONARY FOR V DIAGNOSTIC PROCEDURE RESULTS
 N X,Y,Z,%,A
 S X=+AMQQX
 S Y=$P(AMQQX,";",4)
 S Z=0
 S A=$P(AMQQX,";",5)
 I $D(^UTILITY("AMQQ TAX",$J,X,"--")) D DXP1 Q
 I $D(^UTILITY("AMQQ TAX",$J,X,"-")) S AMQT(Y)='$D(^AUPNVDXP("AD",AMQP(1))),AMQP(A)="-" Q
 F  S Z=$O(^AUPNVDXP("AD",AMQP(1),Z)) Q:'Z  S %=$P($G(^AUPNVDXP(Z,0)),U) I %,$D(^UTILITY("AMQQ TAX",$J,X,%))+$D(^("*")) S AMQP(A)="+" G DXPEXIT
 S AMQT(Y)=0
 Q
DXPEXIT ;
 S AMQT(Y)=1
 Q
 ;
DXP1 ;
 F  S Z=$O(^AUPNVDXP("AD",AMQP(1),Z)) Q:'Z  S %=$P($G(^AUPNVDXP(Z,0)),U) I %,$D(^UTILITY("AMQQ TAX",$J,X,%)) G DXPEXIT1
 S AMQT(Y)=1
 S AMQP(A)="-"
 Q
DXPEXIT1 ;
 S AMQT(Y)=0
 Q
 ;
CPT ;EP METADICTIONARY;
 N X,Y,Z,%,A
 S X=+AMQQX
 S Y=$P(AMQQX,";",4)
 S Z=0
 S A=$P(AMQQX,";",5)
 I $D(^UTILITY("AMQQ TAX",$J,X,"--")) D CPT1 Q
 I $D(^UTILITY("AMQQ TAX",$J,X,"-")) S AMQT(Y)='$D(^AUPNVCPT("AD",AMQP(1))),AMQP(A)="-" Q
 F  S Z=$O(^AUPNVCPT("AD",AMQP(1),Z)) Q:'Z  S %=$P($G(^AUPNVCPT(Z,0)),U) I %,$D(^UTILITY("AMQQ TAX",$J,X,%))+$D(^("*")) S AMQP(A)="+" G POVEXIT
 S AMQT(Y)=0
 Q
 ;
CPTEXIT ;
 S AMQT(Y)=1
 Q
 ;
CPT1 ;
 F  S Z=$O(^AUPNVCPT("AD",AMQP(1),Z)) Q:'Z  S %=$P($G(^AUPNVCPT(Z,0)),U) I %,$D(UTILITY("AMQQ TAX",$J,X,%)) G CPTEXIT1
 S AMQT(Y)=1
 S AMQP(A)="-"
 Q
 ;
CPTEXIT1 ;
 S AMQT(Y)=0
 Q
 ;