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

AMQQMUL4.m

Go to the documentation of this file.
AMQQMUL4 ; IHS/CMI/THL - HOSPITALIZATIONS ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;-----
VAR F I=1:1:19 D
 .S X=$P("GR;ID;ST;FIN;LAST;VAL1;VAL2;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="^AUPNVSIT(""AAH"","_AMQP(0)_")"
 S AMQQMSS=+AMQQMSS
 S AMQQMPC=AMQQMPC+'AMQQMPC
 S AMQQHOLD=0
 S AMQT(AMQQT)=0
 S AMQQLCNT=0
 S AMQQSPEC=""
 S AMQQSPEC=""
 I AMQQVAL1["~~" S AMQQSPEC=AMQQVAL2,AMQQVAL2=$P(AMQQVAL1,"~~",2),AMQQVAL1=$P(AMQQVAL1,"~~")
 I '$D(AMQQAG) S AMQQAG="AG"
 K ^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN)
 I '$D(@AMQQ) S AMQT(AMQQT)=0 G NULL
 I $E(AMQQST)?1P,'$D(AMQQSQVN) D REL^AMQQMULS
 I AMQQMULZ S AMQQMUNV=AMQQNVAR,AMQQMUFV=AMQQFVAR,AMQQMULL=AMQQMULZ
RUN D INC
SQ I $D(AMQV("SQ")) D ^AMQQMULS
 I $D(^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN)),AMQQSPEC="NULL" K ^(AMQQUATN) G EXIT
 I $D(^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN,1)) S AMQP(AMQQFVAR)=$P(^(1),U)
 I $D(^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN)) G TRUE
NULL I AMQQSPEC="NULL"!(AMQQSPEC="ANY") 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 S AMQQVDAT=9999999-AMQQFIN
INCDATE S AMQQVDAT=$O(@AMQQ@(AMQQVDAT))
 I AMQQVDAT'=+AMQQVDAT Q
 I (9999999-AMQQVDAT)'>AMQQST Q
 S AMQQVSIT=0
INCVIS S AMQQVSIT=$O(@AMQQ@(AMQQVDAT,AMQQVSIT))
 I 'AMQQVSIT G INCDATE
 I '$D(^AUPNVSIT(AMQQVSIT)) G INCVIS
 S AMQQVNO=0
INCINP S AMQQVNO=$O(^AUPNVINP("AD",AMQQVSIT,AMQQVNO))
 S AMQQVALU=9999999-(AMQQVDAT\1)
 S AMQQLCNT=AMQQLCNT+1
 S AMQQHOLD=AMQQHOLD+1
 S ^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN,AMQQHOLD)=AMQQVALU_U_(9999999-AMQQVDAT)_U_AMQQVSIT_U_$G(AMQQVNO)
CNT I AMQQLCNT=AMQQLAST D LASTEVAL^AMQQMULT I $D(AMQQQUIT) K AMQQQUIT Q
 I AMQQSPEC="EXISTS"!(AMQQSPEC="NULL"),AMQQLCNT,'$D(AMQV("SQ")) S AMQQLCNT=-1 Q
 G INCDATE
 G INCINP
 ;
SUMMARY ; ENTRY POINT FROM METADICTIONARY
 I '$D(AMQQAG) S AMQQAG="AG"
 N Y,Z,% S X=""
 S %=^UTILITY("AMQQ",$J,AMQQAG,AMQQUATN,AMQQHOLD)
 S Y=+%
 I Y S Z(1)=Y X ^DD("DD")
 I Y=0 S Y="??"
 S X=X_Y_"=>"
 S Y=$P(%,U,4)
 S Y=+$G(^AUPNVINP(+Y,0))
 I Y S Z(2)=Y X ^DD("DD")
 I Y=0 S Y="NULL"
 S X=X_Y
 I $G(Z(2))]"",$G(Z(1))]"" D LOS I 1
 E  G SERVICE
 S X=X_" ("_Y_" days)  "
SERVICE S Y=$P(%,U,4)
 S Y=$P($G(^AUPNVINP(+Y,0)),U,4)
 I Y S Y=$P($G(^DIC(45.7,Y,0)),U) S Y=$E(Y,1,20)
 S X=X_Y
 Q
 ;
LOS N X,%H,%T,%Y,%
 S X=Z(1)
 D H^%DTC
 S Z=+%H
 S X=Z(2)
 D H^%DTC
 S Y=+%H-Z
 Q
 ;