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

BWGRVLU1.m

Go to the documentation of this file.
BWGRVLU1 ; IHS/CMI/LAB - GEN RETR UTILITIES ;15-Feb-2003 21:54;PLS
 ;;2.0;WOMEN'S HEALTH;**6,7,8**;MAY 16, 1996
 ;
MCR ;MCR display all current medicare data
 NEW BWGRMIFN
 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 BWGRPCNT=1,BWGRPRNM(BWGRPCNT)=$P(^AUPNMCR(DFN,0),U,3)_" ["_$S($P(^(0),U,4)]"":$P(^AUTTMCS($P(^(0),U,4),0),U),1:"-")_"]"
 S BWGRMIFN=0 F  S BWGRMIFN=$O(^AUPNMCR(P,11,BWGRMIFN)) Q:BWGRMIFN'=+BWGRMIFN  D
 .Q:$P(^AUPNMCR(P,11,BWGRMIFN,0),U)>D
 .I $P(^AUPNMCR(P,11,BWGRMIFN,0),U,2)]"",$P(^(0),U,2)<D Q
 .S BWGRPCNT=BWGRPCNT+1,Y=$P(^AUPNMCR(DFN,11,BWGRMIFN,0),U),Z=$P(^(0),U,2),BWGRPRNM(BWGRPCNT)=$P(^(0),U,3)_" "_$E(Y,4,5)_"/"_$E(Y,6,7)_"/"_$E(Y,2,3)_"-" I Z]"" S BWGRPRNM(BWGRPCNT)=BWGRPRNM(BWGRPCNT)_$E(Z,4,5)_"/"_$E(Z,6,7)_"/"_$E(Z,2,3)
 .Q
MCRX ;
 K Y,Z
 Q
 ;
MCD ;EP
 NEW BWGRMIFN,BWGRNIFN
 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(^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RPRNT=$$FMTE^XLFDT(BWGRPRNT,"2D")
 .Q
PIVX ;
 Q
 ;
ML ;EP - set up mailing address print array
 S BWGRPCNT=0 K BWGRPRNM
 F X=1:1:3 S Y=$P($G(^DPT(DFN,.11)),U,X) I Y]"" S BWGRPCNT=BWGRPCNT+1,BWGRPRNM(BWGRPCNT)=Y
 S X=$P($G(^DPT(DFN,.11)),U,4)_", "
 S Y="",Y=$P($G(^DPT(DFN,.11)),U,5) I Y S Y=$P(^DIC(5,Y,0),U)
 S X=X_$S(Y]"":Y,1:"  ")
 S X=X_" "_$P($G(^DPT(DFN,.11)),U,6)
 S BWGRPCNT=BWGRPCNT+1,BWGRPRNM(BWGRPCNT)=X
 Q