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

AMQQATR.m

Go to the documentation of this file.
AMQQATR ; IHS/CMI/THL - AMQQAT SUBROUTINE...COMPUTES DYNAMIC SEARCH RATING ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;-----
RUN N AMQQHIDE
 I +AMQQQ=33,AMQQQ[";;;NULL" S AMQQHIDE=""
 I $D(AMQQXX) S AMQQHIDE=""
 I $D(AMQQONE),AMQQONE'="" S $P(AMQQQ,U,11)=-.1 Q
 I +AMQQQ=3,$P(AMQQQ,U,8)="=" S $P(AMQQQ,U,11)=99 Q
CHECK I $P(^AMQQ(1,+AMQQQ,0),U,7),AMQQQ'[";ANY^",AMQQQ'[";NULL^",$P(AMQQQ,U,17)="" D ^AMQQATR1 G EXIT
 I '$D(^AMQQ(1,+AMQQQ,3)) S $P(AMQQQ,U,11)=-.1 Q
 S %=$P(AMQQQ,U,2)
 I %="DIAGNOSIS"!(%="RX") D DX Q
 I $P(AMQQQ,U,17)'=""!(+AMQQQ=212) D ^AMQQATR2 G EXIT
 I '$D(AMQQHIDE) W !,"Computing Search Efficiency Rating...."
 S Q=AMQQQ
 I $P(Q,U,2)="FILE ENTRY" D FILE S AMQQECPR=% D SAMPLE G EXIT
 S AMQQEXCD=^AMQQ(1,+Q,3)
 S AMQQENCO=$P(Q,U,6)
 S AMQQECPR=$P(Q,U,9)
 S AMQQESBL=$P(Q,U,8)
 S AMQQEVAL=""
 I $P(AMQQECPR,";",4)["EXIST"!($P(AMQQECPR,";",4)["NULL") S AMQQECMP="I AMQQEVAL'=""""" D SAMPLE G EXIT
 D @("FILTER"_$P(Q,U,3)_"^AMQQATR0")
 D SAMPLE
EXIT K %,Q,AMQQSER,X,Y,Z,AMQQY,AMQQEVAL,AMQQECMP,AMQQENUM,AMQQEDEN,AMQQEINC,AMQQESBL,AMQQEXCD,AMQQECNT,AMQQECPR,AMQQENCO,AMQQHIDE
 Q
 ;
SAMPLE D @("SAMPLE"_AMQQCCLS)
 S X=AMQQENUM/AMQQEDEN
 I 'X S X=.01
 I AMQQECPR["NULL" G SETSER
 S X=(1-X)/$S($D(AMQQKONG):1,$P(^AMQQ(1,+Q,0),U,8):X,+Q=40:X,+Q=176:X,1:1)
SETSER S AMQQSER=$J(X,1,2)
 S %=$P(^AMQQ(1,+AMQQQ,0),U,15)
 I %'="" S AMQQSER=AMQQSER_":"_%
 S $P(AMQQQ,U,11)=AMQQSER
 Q
 ;
SAMPLEH S %=1
 S AMQQENUM=0
 S X=$P(@AMQQ200(16)@(0),U,4)
 S AMQQEINC=$S(X<50:0,1:(X\50))
 S AMQQECNT=0
 F AMQQEDEN=0:1 S %=$O(@AMQQ200(16)@(%)) Q:%'=+%  X AMQQEXCD S:$T AMQQENUM=AMQQENUM+1 S %=%+AMQQEINC W:'$D(AMQQHIDE) "." S AMQQECNT=AMQQECNT+1 I AMQQECNT>50 Q
 Q
 ;
SAMPLEP S %=1
 S AMQQENUM=0
 S X=$P(^DPT(0),U,4)
 S AMQQEINC=$S(X<50:0,1:(X\50))
 S AMQQECNT=0
 F AMQQEDEN=0:1 S %=$O(^DPT(%)) Q:%'=+%  X AMQQEXCD S:$T AMQQENUM=AMQQENUM+1 S %=%+AMQQEINC W:'$D(AMQQHIDE) "." S AMQQECNT=AMQQECNT+1 I AMQQECNT>50 Q
 Q
 ;
SAMPLEV S %=1
 S AMQQENUM=0
 S X=$P(^AUPNVSIT(0),U,4)
 S AMQQEINC=$S(X<50:0,1:(X\50))
 S AMQQECNT=0
 F AMQQEDEN=0:1 S %=$O(^AUPNVSIT(%)) Q:%'=+%  X AMQQEXCD S:$T AMQQENUM=AMQQENUM+1 S %=%+AMQQEINC W:'$D(AMQQHIDE) "." S AMQQECNT=AMQQECNT+1 I AMQQECNT>50 Q
 Q
 ;
SAMPLED S %=1,AMQQENUM=0
 S X=$P(^AUPNVPOV(0),U,4)
 S AMQQEINC=$S(X<50:0,1:(X\50))
 S AMQQECNT=0
 F AMQQEDEN=0:1 S %=$O(^AUPNVPOV(%)) Q:%'=+%  X AMQQEXCD S:$T AMQQENUM=AMQQENUM+1 S %=%+AMQQEINC W:'$D(AMQQHIDE) "." S AMQQECNT=AMQQECNT+1 I AMQQECNT>50 Q
 Q
 ;
DX I $D(^UTILITY("AMQQ TAX",$J,AMQQURGN,"--")) S $P(AMQQQ,U,11)=-1 Q
 I '$D(AMQQHIDE) W !,"Computing Search Efficiency Rating...."
 S %=0
 F I=0:1 S %=$O(^UTILITY("AMQQ TAX",$J,AMQQURGN,%)) Q:'%  W:'$D(AMQQHIDE) "."
 S %=.99/((.01)*(4+(I/16)))
 S %=$J(%,1,2)
 S $P(AMQQQ,U,11)=%
 I $G(AMQQUSQN),'$D(^UTILITY("AMQQ",$J,"SQ",AMQQUSQN,"NULL")) S $P(AMQQQ,U,11)=%_":"_20
 Q
 ;
FILE I +Q<178 S %=$P(Q,U,9),AMQQEXCD="I "_$S(+Q=177:"'",1:"")_"$D(^"_$P(%,";")_""""_$P(%,";",2)_""",%))" Q
 S %=$P(Q,U,9)
 S AMQQEXCD="I $D(^UTILITY(""AMQQ FRAND"","_$P(%,";",3)_","_$P(%,";",6)_",%))"
 Q
 ;
KONG ; ENTRY POINT FROM AMQQCMPK
 I $D(AMQQXX) S AMQQHIDE=""
 D @("SAMPLE"_AMQQCCLS)
 S X=AMQQENUM/AMQQEDEN
 I 'X S X=.01
 S X=1-X,X=$J(X,1,2)
 K AMQQHIDE
 Q
 ;