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

ACMRLU.m

Go to the documentation of this file.
ACMRLU ; IHS/TUCSON/TMJ - GEN RETR UTILITIES ;
 ;;2.0;ACM CASE MANAGEMENT SYSTEM;;JAN 10, 1996
 ;
RZERO(V,L) ;ep right zero fill 
 NEW %,I
 S %=$L(V),Z=L-% F I=1:1:Z S V=V_"0"
 Q V
LZERO(V,L) ;left zero fill
 NEW %,I
 S %=$L(V),Z=L-% F I=1:1:Z S V="0"_V
 Q V
LBLK(V,L) ;left blank fill
 NEW %,I
 S %=$L(V),Z=L-% F I=1:1:Z S V=" "_V
 Q V
MCR(P,D) ;is patient medicare eligible on this date
 NEW ACMMIFN,ACMFLG
 S ACMFLG=0
 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 ACMMIFN=0 F  S ACMMIFN=$O(^AUPNMCR(P,11,ACMMIFN)) Q:ACMMIFN'=+ACMMIFN  D
 .Q:$P(^AUPNMCR(P,11,ACMMIFN,0),U)>D
 .I $P(^AUPNMCR(P,11,ACMMIFN,0),U,2)]"",$P(^(0),U,2)<D Q
 .S ACMFLG=1
 .Q
MCRX ;
 Q ACMFLG
 ;
MCD(P,D) ;
 NEW ACMMIFN,ACMNIFN,ACMFLG
 S ACMFLG=0
 I '$D(^DPT(P,0)) G MCRX
 I $P(^DPT(P,0),U,19) G MCRX
 I '$D(^AUPNPAT(P,0)) G MCDX
 I $D(^DPT(P,.35)),$P(^(.35),U)]"",$P(^(.35),U)<D G MCRX
 S ACMMIFN=0 F  S ACMMIFN=$O(^AUPNMCD("B",P,ACMMIFN)) Q:ACMMIFN'=+ACMMIFN  D
 .Q:'$D(^AUPNMCD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