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

AMHRLU1.m

Go to the documentation of this file.
AMHRLU1 ; IHS/CMI/LAB - GEN RET UTIL ;
 ;;4.0;IHS BEHAVIORAL HEALTH;**8**;JUN 02, 2010;Build 7
 ;
 ;
MCR ;display all current medicare data
 NEW AMHMIFN
 I '$D(^DPT(P,0)) G MCRX
 I $P(^DPT(P,0),U,19) G MCRX
 I '$D(^AUPNPAT(P,0)) G MCRX
 I '$D(^AUPNMCR(P,11)) G MCRX
 I $D(^DPT(P,.35)),$P(^(.35),U)]"",$P(^(.35),U)<D G MCRX
 S AMHMIFN=0 F  S AMHMIFN=$O(^AUPNMCR(P,11,AMHMIFN)) Q:AMHMIFN'=+AMHMIFN  D
 .Q:$P(^AUPNMCR(P,11,AMHMIFN,0),U)>D
 .I $P(^AUPNMCR(P,11,AMHMIFN,0),U,2)]"",$P(^(0),U,2)<D Q
 .S AMHPCNT=AMHPCNT+1,AMHPRNM(AMHPCNT)=$P(^AUPNMCR(DFN,0),U,3)_" ["_$S($P(^(0),U,4)]"":$P(^AUTTMCS($P(^(0),U,4),0),U),1:"-")_"]"
 .S AMHPCNT=AMHPCNT+1,Y=$P(^AUPNMCR(DFN,11,AMHMIFN,0),U),Z=$P(^(0),U,2),AMHPRNM(AMHPCNT)=$E(Y,4,5)_"/"_$E(Y,6,7)_"/"_$E(Y,2,3)_"-" I Z]"" S AMHPRNM(AMHPCNT)=AMHPRNM(AMHPCNT)_$E(Z,4,5)_"/"_$E(Z,6,7)_"/"_$E(Y,2,3)
 .Q
MCRX ;
 K Y,Z
 Q
 ;
MCD ;
 NEW AMHMIFN,AMHNIFN
 I '$D(^DPT(P,0)) G MCDX
 I $P(^DPT(P,0),U,19) G MCDX
 I '$D(^AUPNPAT(P,0)) G MCDX
 I $D(^DPT(P,.35)),$P(^(.35),U)]"",$P(^(.35),U)<D G MCDX
 S AM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