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

ACDRLU1.m

Go to the documentation of this file.
ACDRLU1 ;IHS/ADC/EDE/KML - GEN RET UTIL;
 ;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
 ;
MCR ;display all current medicare data
 NEW ACDMIFN
 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 ACDMIFN=0 F  S ACDMIFN=$O(^AUPNMCR(P,11,ACDMIFN)) Q:ACDMIFN'=+ACDMIFN  D
 .Q:$P(^AUPNMCR(P,11,ACDMIFN,0),U)>D
 .I $P(^AUPNMCR(P,11,ACDMIFN,0),U,2)]"",$P(^(0),U,2)<ACDACE Q
 .S ACDPCNT=ACDPCNT+1,ACDPRNM(ACDPCNT)=$P(^AUPNMCR(DFN,0),U,3)_" ["_$S($P(^(0),U,4)]"":$P(^AUTTMCS($P(^(0),U,4),0),U),1:"-")_"]"
 .S ACDPCNT=ACDPCNT+1,Y=$P(^AUPNMCR(DFN,11,ACDMIFN,0),U),Z=$P(^(0),U,2),ACDPRNM(ACDPCNT)=$E(Y,4,5)_"/"_$E(Y,6,7)_"/"_$E(Y,2,3)_"-" I Z]"" S ACDPRNM(ACDPCNT)=ACDPRNM(ACDPCNT)_$E(Z,4,5)_"/"_$E(Z,6,7)_"/"_$E(Y,2,3)
 .Q
MCRX ;
 K Y,Z
 Q
 ;
MCD ;
 NEW ACDMIFN,ACDNIFN
 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 ACDMIFN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ACDMIFN,0),U,6)>D
 .I $P(^AUPNPRVT(P,11,ACDMIFN,0),U,7)]"",$P(^(0),U,7)<ACDACE Q
 .S ACDPCNT=ACDPCNT+1,ACDPRNM(ACDPCNT)=$P(^AUTNINS($P(^AUPNPRVT(P,11,ACDMIFN,0),U),0),U)
 .S ACDPCNT=ACDPCNT+1,Y=$P(^AUPNPRVT(DFN,11,ACDMIFN,0),U,6),Z=$P(^(0),U,7),ACDPRNM(ACDPCNT)=$E(Y,4,5)_"/"_$E(Y,6,7)_"/"_$E(Y,2,3)_"-" I Z]"" S ACDPRNM(ACDPCNT)=ACDPRNM(ACDPCNT)_$E(Z,4,5)_"/"_$E(Z,6,7)_"/"_$E(Z,2,3)
 .Q
PIX ;
 Q
CALLDIE ;EP
 Q:'$D(DA)
 Q:'$D(DIE)
 K DIV,DIU,DIY,DIW,DIG,DIH
 NEW ACDG S ACDG=DIE_DA_")" L +(@ACDG):10 E  W !!,"Can't lock global",! Q
 Q:'$D(DR)
 D ^DIE
 L -(@ACDG):10
 K DIE,DIC,DR,DA,D0,D,D1,DO,%X,%Y,X,A,Z,DIU,DIV,DIY,DIW,DIADD,DLAYGO,%,%E,%D,%W,DI,DIFLD,DIG,DIH,DK,DL,DISYS,ACDG
 Q
PAUSE ;EP
 Q:$E(IOST)'="C"!(IO'=IO(0))
 W ! S DIR(0)="EO",DIR("A")="Hit return to continue...." D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 Q
DONE ;ENTRY POINT - END OF REPORT TIME DISPLAY
 I $D(ACDET) S ACDTS=(86400*($P(ACDET,",")-$P(ACDBT,",")))+($P(ACDET,",",2)-$P(ACDBT,",",2)),ACDH=$P(ACDTS/3600,".") S:ACDH="" ACDH=0 D
 .S ACDTS=ACDTS-(ACDH*3600),ACDM=$P(ACDTS/60,".") S:ACDM="" ACDM=0 S ACDTS=ACDTS-(ACDM*60),ACDS=ACDTS W !!,"RUN TIME (H.M.S): ",ACDH,".",ACDM,".",ACDS
 I $E(IOST)="C",IO=IO(0) S DIR(0)="EO",DIR("A")="End of report.  HIT RETURN" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 W:$D(IOF) @IOF
 K ACDTS,ACDS,ACDH,ACDM,ACDET
 Q
 ;