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

AMQQATR2.m

Go to the documentation of this file.
AMQQATR2 ; IHS/CMI/THL - DSO FOR TAX ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;-----
 I '$D(AMQQHIDE) W !,"Computing Search Efficiency Rating...."
 S Q=AMQQQ
 S S=^AMQQ(1,+Q,3)
 K AMQQOK
 S %=$P(Q,U,9)
 I $P(%,";",5)="ANY" S AMQQSER=-1 G EXIT
 S AMQQSERF="^AUPNPAT"
 S AMQQDSCF=1
 I $P(^AMQQ(1,+Q,0),U,12) S AMQQDSCF=$P(^(0),U,12)
 I AMQQCCLS="V" D VISIT
 I AMQQCCLS="H" D PROV
 S AMQQTAX=$P(Q,U,17)
 S %=$P(Q,U,9)
 S N=9999999.999999
 S X=N-$P(%,";",2)
 S AMQQD1=X-.0000001
 S AMQQD2=N-(+%)
 S AMQQTDFN=1
 S AMQQENUM=0
 S X=$P(@AMQQSERF@(0),U,4)
 S AMQQEINC=$S(X<50:0,1:(X\50))
 S AMQQECNT=0
SAMPLE F AMQQEDEN=0:1 S AMQQTDFN=$O(@AMQQSERF@(AMQQTDFN)) Q:AMQQTDFN'=+AMQQTDFN  S AMQQECMP=$G(AMQQECMP) X S S AMQQTDFN=AMQQTDFN+AMQQEINC,AMQQECNT=AMQQECNT+1 W:'$D(AMQQHIDE) "." I AMQQECNT>50 Q
SER S X=AMQQENUM/AMQQEDEN
 I X=0 S X=.01
 I $D(^UTILITY("AMQQ TAX",$J,AMQQURGN,"NULL")) S X=1-X G SETSER
 S X=(1-X)/$S($P(^AMQQ(1,+Q,0),U,8):X,1:1)
 S X=X/AMQQDSCF
SETSER S X=$J(X,1,2)
 I $P(AMQQQ,U,3)="G",+AMQQQ>689.9999,+AMQQQ<706 S X=X_":900" G SS1
SS1 S AMQQSER=X
 S $P(AMQQQ,U,11)=X
EXIT K AMQQTAX,AMQQTPFN,%,X,Y,Z,A,B,C,D,N,I,AMQQD1,AMQQD2,AMQQTDFN,S,AMQQDSCF,AMQQENUM,AMQQEDEN,AMQQEINC,AMQQECNT,AMQQETGB,AMQQETAX,AMQQSERF
 Q
 ;
MTEST F X=AMQQD1:0 S X=$O(@AMQQETGB@(X)) Q:'X  Q:X>AMQQD2  F AMQQTPFN=0:0 S AMQQTPFN=$O(@AMQQETGB@(X,AMQQTPFN)) Q:'AMQQTPFN  I (($D(^UTILITY("AMQQ TAX",$J,AMQQURGN,+$G(@AMQQETAX)))=10)+($P(Q,U,18)=3))=1 S AMQQENUM=AMQQENUM+1 G MEXIT
MEXIT Q
 ;
TTEST I $D(^UTILITY("AMQQ TAX",$J,AMQQURGN,"*")),AMQQETGB'="" S AMQQENUM=AMQQENUM+1 Q
 I $D(^UTILITY("AMQQ TAX",$J,AMQQURGN,"-")),AMQQETGB="" S AMQQENUM=AMQQENUM+1 Q
 I AMQQETGB'="",$D(^UTILITY("AMQQ TAX",$J,AMQQURGN,AMQQETGB)),'$D(^("--")) S AMQQENUM=AMQQENUM+1 Q
 I '$D(^UTILITY("AMQQ TAX",$J,AMQQURGN,"--")) Q
 I AMQQETGB="" S AMQQENUM=AMQQENUM+1 Q
 I AMQQETGB'="",'$D(^UTILITY("AMQQ TAX",$J,AMQQURGN,AMQQETGB)) S AMQQENUM=AMQQENUM+1
 Q
 ;
VFILE ; ENTRY POINT FROM AMMQATR1
 D VSET
RINCI S I=I+1
 W:'$D(AMQQHIDE) "."
 I I>50 G RSET
 S B=B+A
 S B=$O(@G@(B))
 G RSET:'B
 S D=0
RINCD S D=$O(@G@(B,D))
 G RINCI:'D
 S C=-999999999
RINCC S C=$O(@G@(B,D,C))
 G RINCD:'C
 S R=$P(@F@(C,S),U,T)
 I $D(AMQQLTR) X AMQQLTR S Y=AMQQLTB1_AMQQLTR1,Z=AMQQLTB2_AMQQLTR2
 I $D(AMQQRTXT) X AMQQRTXT G INCJ
 I Z="" S %="I R"_Y X % G INCJ
 S %="I R"_Y_",R"_Z
 X %
INCJ I  S J=J+1 G RINCI
 G RINCC
RSET S:'K K=1
 S %=(J/I)
 S:'% %=.01
 S %=(1-%)/(%*K)
 S %=$J(%,1,2)
 S AMQQSER=%
REXIT K %,A,B,C,D,E,F,G,H,I,J,K,M,N,P,R,S,T
 Q
 ;
VSET S %=^AMQQ(1,+AMQQQ,0)
 S F=U_$P(%,U,10)
 S G=F_"(""AA"")"
 S P=$P(^DPT(0),U,4)
 S (B,I,J)=0
 S A=(P\50)+(P<50)
 S S=$P(%,U,11)
 S T=$P(S,";",2)
 S S=+S
 S K=$P(%,U,12)
 S %=$P(AMQQQ,U,9)
 S Y=$P(%,";",4)
 S Y=$P(Y,":")_$P(Y,":",2)
 S Z=$P(%,";",5)
 S Z=$P(Z,":")_$P(Z,":",2)
 Q
 ;
VISIT N %,X,Y
 S AMQQSERF="^AUPNVSIT"
 S %=^AMQQ(1,+Q,0)
 S %=$P(%,U,3)
 I %=9000010 Q
 S %=^DIC(%,0,"GL")
 S X=$E(%,$L(%))
 S Y=$E(%,1,$L(%)-1)
 S AMQQSERF=Y_$S(X=",":")",1:"")
 S X=$P(^AUPNVSIT(0),U,4)
 S Y=$P(@AMQQSERF@(0),U,4)
 I X,Y S AMQQDSCF=(X/Y)*AMQQDSCF
 Q
 ;
PROV S AMQQSERF=AMQQ200(6)
 Q
 ;