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

AMQQMUL3.m

Go to the documentation of this file.
AMQQMUL3 ;IHS/CMI/THL - ICD MATCH FROM VISIT OR PROBLEM LIST ;
 ;;2.0;IHS PCC SUITE;**5,11**;MAY 14, 2009;Build 58
 ;-----
 D MULT
 Q
 ;
ICD ; ENTRY POINT FROM METADICTIONARY
 S AMQP(3.1)=AMQP(.3)
 I '$D(AMQP("ICD")) S AMQP("ICD")=1
 I AMQP("ICD")=2 G PROB
VISIT S AMQP(.3)=$O(^AUPNVPOV("B",AMQP(.1),AMQP(.3)))
 I 'AMQP(.3) S AMQP("ICD")=2,AMQP(.2)=0 G PROB
 S %=$P($G(^AUPNVPOV(AMQP(.3),0)),U,2)
 I '% G VISIT
 I '$D(^UTILITY("AMQQ TEMP",$J,%)) S ^(%)="",AMQP(0)=% Q
 G VISIT
 ;
PROB ; ENTRY POINT FROM METADICTIONARY
 S AMQP(.2)=$O(^AUPNPROB("B",AMQP(.1),AMQP(.2)))
 I 'AMQP(.2) K AMQP("ICD") S AMQP(.3)=0 Q
 G PROB:$P($G(^AUPNPROB(AMQP(.2),0)),U,12)="D"  ;skip deleted problems
 S AMQP(3.1)=AMQP(.2),%=$P($G(^AUPNPROB(AMQP(3.1),0)),U,2)
 I '% G PROB
 I '$D(^UTILITY("AMQQ TEMP",$J,%)) S ^(%)="",AMQP(0)=%,AMQP(.3)=1 Q
 G PROB
 ;
SPEC ; ENTRY POINT FROM METADICTIONARY ;PATCH XXX
 S AMQP(.2)=$O(^BDPRECN("B",AMQP(.1),AMQP(.2)))
 I 'AMQP(.2) K AMQP("ICD") S AMQP(.3)=0 Q
 S AMQP(3.1)=AMQP(.2),%=$P($G(^BDPRECN(AMQP(3.1),0)),U,2)
 I '% G SPEC
 I '$D(^UTILITY("AMQQ TEMP",$J,%)) S ^(%)="",AMQP(0)=%,AMQP(.3)=1 Q
 G SPEC
 ;
FAMHX ; ENTRY POINT FROM METADICTIONARY
 S AMQP(.2)=$O(^AUPNFH("B",AMQP(.1),AMQP(.2)))
 I 'AMQP(.2) K AMQP("ICD") Q
 S AMQP(3.1)=AMQP(.2)
 S %=$P($G(^AUPNFH(AMQP(3.1),0)),U,2)
 I '% G FAMHX
 I '$D(^UTILITY("AMQQ TEMP",$J,%)) S ^(%)="",AMQP(0)=% Q
 G FAMHX
 Q
 ;
PERSHX ; ENTRY POINT FROM METADICTIONARY
 S AMQP(.2)=$O(^AUPNPH("B",AMQP(.1),AMQP(.2)))
 I 'AMQP(.2) K AMQP("ICD") Q
 S AMQP(3.1)=AMQP(.2)
 S %=$P($G(^AUPNPH(AMQP(3.1),0)),U,2)
 I '% G PERSHX
 I '$D(^UTILITY("AMQQ TEMP",$J,%)) S ^(%)="",AMQP(0)=% Q
 G PERSHX
 Q
 ;
HLTHSTAT ; ENTRY POINT FROM METADICTIONARY
 S AMQP(.2)=$O(^AUPNHF("B",AMQP(.1),AMQP(.2)))
 I 'AMQP(.2) Q
 S AMQP(3.1)=AMQP(.2)
 S %=$P($G(^AUPNHF(AMQP(3.1),0)),U,2)
 I '% G HLTHSTAT
 I '$D(^UTILITY("AMQQ TEMP",$J,%)) S ^(%)="",AMQP(0)=% Q
 G HLTHSTAT
 Q
 ;
TEST ; ENTRY POINT FROM METADICTIONARY
 F AMQQY="^AUPNPROB","^AUPNVPOV" Q:$D(AMQQSTP)  F AMQP(3.1)=0:0 Q:$D(AMQQSTP)  S AMQP(3.1)=$O(@AMQQY@("AC",AMQP(0),AMQP(3.1))) Q:'AMQP(3.1)  S %=+@AMQQY@(AMQP(3.1),0) I % D
 .I $D(^UTILITY("AMQQ TAX",$J,AMQQX,%))+$D(^("*")),'$D(^("--")) S AMQQSTP=1 Q
 .I $D(^UTILITY("AMQQ TAX",$J,AMQQX,%)),$D(^("--")) S AMQQSTP=0 Q
 I '$D(AMQQSTP),$D(^UTILITY("AMQQ TAX",$J,AMQQX,"--")) S AMQQSTP=1
 I $G(AMQQSTP)
TEXIT K AMQQX,AMQQY,AMQQSTP
 Q
 ;
WEED ; ENTRY POINT FROM METADICTIONARY
 S AMQQY="^AUPNPROB"
 F AMQP(3.1)=0:0 Q:$D(AMQQSTP)  S AMQP(3.1)=$O(@AMQQY@("AC",AMQP(0),AMQP(3.1))) Q:'AMQP(3.1)  S %=+@AMQQY@(AMQP(3.1),0) I % D
 .Q:$P(@AMQQY@(AMQP(3.1),0),U,12)="D"
 .I $D(^UTILITY("AMQQ TAX",$J,AMQQX,%))+$D(^("*")),'$D(^("--")) S AMQQSTP=1 Q
 .I $D(^UTILITY("AMQQ TAX",$J,AMQQX,%)),$D(^("--")) S AMQQSTP=0 Q
 I '$D(AMQQSTP),$D(^UTILITY("AMQQ TAX",$J,AMQQX,"--")) S AMQQSTP=1
 I $G(AMQQSTP)
WEXIT K AMQQX,AMQQY,AMQQSTP
 Q
 ;
MULT ;
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(AMQQAG) S AMQQAG="AG"
 S AMQQ="^"_$S($P(AMQQX,";")="AUPNPROB":"AUPNPROB",$P(AMQQX,";")="AUPNPH":"AUPNPH",$P(AMQQX,";")="AUPNHF":"AUPNHF",$P(AMQQX,";")="BDPRECN":"BDPRECN",1:"AUPNFH")_$S(AMQQX'["BDPRECN":"(""AC"",AMQP(0))",1:"(""C"",AMQP(0))") ;PATCH XXX
 S AMQQVAL1=+AMQQVAL1
 S AMQQMSS=+AMQQMSS
 S AMQQMPC=AMQQMPC+'AMQQMPC
 S AMQQAG="AG"
 S AMQQHOLD=0
 S AMQT(AMQQT)=0
 S AMQQLCNT=0
 K ^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN)
 I AMQQMULZ S AMQQMUNV=AMQQNVAR,AMQQMUFV=AMQQFVAR,AMQQMULL=AMQQMULZ
 I '$D(@AMQQ) S AMQT(AMQQT)=0 G NULL
 I AMQQSPEC="NULL" G EXIT
RUN D INC
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" 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 F AMQQVNO=0:0 S (AMQQVNO,AMQP(3.1))=$O(@AMQQ@(AMQQVNO)) Q:'AMQQVNO  D SETAG I AMQQLCNT=-1 Q
 Q
 ;
SETAG S AMQQGLOR="^"_$P(AMQQX,";")
 S %=+@AMQQGLOR@(AMQQVNO,0)
 I $D(^UTILITY("AMQQ TAX",$J,AMQQVAL1,%))+$D(^("*"))+$D(^("-")) S AMQQHOLD=AMQQHOLD+1,AMQQLCNT=AMQQLCNT+1,^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN,AMQQHOLD)=AMQQVNO_U_$S(AMQQGLOR["BDPRECN":$P(@AMQQGLOR@(AMQQVNO,0),U,3),1:"")_"^^"_AMQQVNO
 I AMQQSPEC="NULL"!(AMQQSPEC="EXISTS"),AMQQLCNT,'$D(AMQV("SQ")) S AMQQLCNT=-1
 Q
 ;
NARR ; ENTRY POINT FROM METADICTIONARY
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S X=$O(^AUPNPROB(AMQP(S),11,X)) Q:'X  D
 .S Y=0
 .F  S Y=$O(^AUPNPROB(AMQP(S),11,X,11,Y)) Q:'Y  S Z=$P(^(Y,0),U,3) D  I AMQT(L) S (X,Y)="~" Q
 ..X ("I Z"_C_""""_V_""" S AMQT(L)=1")
 Q