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

BCHRLU1.m

Go to the documentation of this file.
BCHRLU1 ; IHS/CMI/LAB - GEN RET UTIL ; 
 ;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
 ;IHS/CMI/LAB - patch 7 Y2K
 ;
 ;IHS/CMI/LAB - PATCH 6 9/21/98
 ;IHS/CMI/LAB - patch 9 fixes variable Y to Z
MCR ;display all current medicare data
 NEW BCHMIFN
 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 BCHMIFN=0 F  S BCHMIFN=$O(^AUPNMCR(P,11,BCHMIFN)) Q:BCHMIFN'=+BCHMIFN  D
 .Q:$P(^AUPNMCR(P,11,BCHMIFN,0),U)>D
 .I $P(^AUPNMCR(P,11,BCHMIFN,0),U,2)]"",$P(^(0),U,2)<D Q  ;IHS/CMI/LAB - patch 6 replaced BCHACE with D 9/21/98
 .S BCHPCNT=BCHPCNT+1,BCHPRNM(BCHPCNT)=$P(^AUPNMCR(DFN,0),U,3)_" ["_$S($P(^(0),U,4)]"":$P(^AUTTMCS($P(^(0),U,4),0),U),1:"-")_"]"
 .;begin Y2K
 .;S BCHPCNT=BCHPCNT+1,Y=$P(^AUPNMCR(DFN,11,BCHMIFN,0),U),Z=$P(^(0),U,2),BCHPRNM(BCHPCNT)=$E(Y,4,5)_"/"_$E(Y,6,7)_"/"_$E(Y,2,3)_"-" I Z]"" S BCHPRNM(BCHPCNT)=BCHPRNM(BCHPCNT)_$E(Z,4,5)_"/"_$E(Z,6,7)_"/"_$E(Y,2,3) ;Y2000
 .S BCHPCNT=BCHPCNT+1,Y=$P(^AUPNMCR(DFN,11,BCHMI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