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

LRACM1.m

Go to the documentation of this file.
LRACM1 ; IHS/DIR/AAB - MENU FOR CUMULATIVE REPORTS CONT. 2/20/91 08:36 ; [ 07/22/2002  12:29 PM ]
 ;;5.2;LR;**1006,1013**;JUL 15, 2002
 ;
 ;;5.2;LAB SERVICE;**201**;Sep 27, 1994
END D A D:LRNOT MSG^LRACM D LOOP,END^LRACM Q
LOOP D ASK S LRRE=1 K X1
 S DIC("A")="START WITH " D DIC Q:LRLLOC<0!(".^"[LRLLOC)  I '$D(^LRO(69,LRDT,1,"AR",LRLLOC)) W $C(7),!!,"NO DATA IN THE CROSS-REFERENCE FOR THIS LOCATION!" Q
 K ^TMP($J,"LRIF") S:$D(L(X)) X1=X S LRPPT="",LRIF=0
 F  S LRPPT=$O(^LRO(69,LRDT,1,"AR",LRLLOC,LRPPT)) Q:LRPPT=""  S LRDFN=0 F  S LRDFN=$O(^LRO(69,LRDT,1,"AR",LRLLOC,LRPPT,LRDFN)) Q:LRDFN<1  S LRIF=LRIF+1,^TMP($J,"LRIF",LRIF)=$S(LRLLOC'["FILE ROOM":LRPPT,1:$P(^(LRDFN),U,2)_U_LRPPT)
N W ! F I=1:1:LRIF W:I#2 ! W:'(I#2) ?40 W I_"."_" ",$P(^TMP($J,"LRIF",I),U,1)
NUM R !!,"Start with patient #: ",X:DTIME Q:".^"[X  G:X["?" N G:X'?.N!(X>LRIF)!(X<1) NUM S LRNM=^TMP($J,"LRIF",X),X2=X,LRNM=$S(LRLLOC'["FILE ROOM":$P(LRNM,U,1),1:$P(LRNM,U,2))
 S K=-1 F I=0:0 S K=$O(^LRO(69,LRDT,1,"AR",K)) Q:K=""  S LREN=K
LRLOCA S LRLOCA=LRLLOC,DIC("A")="END WITH " D DIC Q:LRLLOC<0!(".^"[LRLLOC)  I $D(L(X)),X1>X K X1
 I '$D(^LRO(69,LRDT,1,"AR",LRLLOC)) W $C(7),!!,"NO DATA IN THE CROSS-REFERENCE FOR THIS LOCATION!" Q
 K:LREN=LRLLOC LREN S LRPPT="" G:LRLLOC=LRLOCA N1 S LRIF=0
 F  S LRPPT=$O(^LRO(69,LRDT,1,"AR",LRLLOC,LRPPT)) Q:LRPPT=""  S LRDFN=0 F  S LRDFN=$O(^LRO(69,LRDT,1,"AR",LRLLOC,LRPPT,LRDFN)) Q:LRDFN<1  S LRIF=LRIF+1,^TMP($J,"LRIF",LRIF)=$S(LRLLOC'["FILE ROOM":LRPPT,1:$P(^(LRDFN),U,2)_U_LRPPT)
N1 W ! F I=1:1:LRIF W:I#2 ! W:'(I#2) ?40 W I_"."_" ",$P(^TMP($J,"LRIF",I),U,1)
NUM1 R !!,"End with patient #: ",X:DTIME Q:".^"[X  G:X["?" N1 G:X'?.NP!(X>LRIF)!(X<1) NUM1 S LRNMA=^TMP($J,"LRIF",X),LRNMA=$S(LRLLOC'["FILE ROOM":$P(LRNMA,U,1),1:$P(LRNMA,U,2))
 I LRLLOC=LRLOCA,X2>X S X=LRNM,LRNM=LRNMA,LRNMA=X
 I '$D(X1) S X=LRLLOC,LRLLOC=LRLOCA,LRLOCA=X,X=LRNM,LRNM=LRNMA,LRNMA=X
 S LRLOCB=LRLLOC,LRLLOC=LRLOCA,LRSUB=0,LRDFN=0
 K IO("Q") S %ZIS="QM" D ^%ZIS Q:POP  I $D(IO("Q")) K IO("Q") S ZTRTN="END1^LRACM1",ZTSAVE("DT")="",ZTSAVE("DUZ")="",ZTSAVE("LR*")="",ZTSAVE("U")="" D ^%ZTLOAD D ^%ZISC K ZTRTN,ZTIO,ZTDESC,ZTSAVE,ZTSK Q
 U IO
END1 K X2 S:$D(ZTQUEUED) ZTREQ="@" S LRTRUE=1
 D ENT^LRAC1
 K LREN,LRRE,LRAC,LRLOCA,LRLOCB,LRNMA,LRTRUE D END^LRACM Q
EN ;
DIC S LRLLOC="",Y=LRDT S Y=$$Y2K^LRX(Y) W !!,"        LOCATION LIST OF CUMULATIVE FOR ",Y S L="" F I=1:1 S L=$O(^LRO(69,LRDT,1,"AR",L)) Q:L=""  W:I#2 ! W:'(I#2) ?40 W I_"."_" ",L S L(I)=L
 I $D(L)'=11 W " is empty." Q
 W !,DIC("A") R "LOCATION #: ",X:DTIME Q:"^."[X  G:X'?.NP!(X>I)!(X<1) DIC
 I '$D(L(X)) W !,$C(7),"LOCATION NOT DEFINED!" G DIC
 S LRLLOC=L(X)
DIC1 K DIC
 Q
 K ZTSK S LRYDT=DT,LRRE=1
 S Y=$P(^LAB(64.5,1,0),U,3) S Y=$$Y2K^LRX(Y) W !!,"Last run:  ",Y
 Q
A ;from LRACM, LRACM3
 S LRNOT=0
 S LRIG=0 F  S LRIG=$O(^LAB(64.5,1,3,LRIG)) Q:LRIG<1  I '$L($P(^(LRIG,0),U,8)) S LRNOT=1 Q
 I LRNOT W !,"DO NOT try to reprint reports that have not finished!",!
 K X2,LRIG Q
ASK ;from LRACM, LRACM3
 S LRDT=$P(^LAB(64.5,1,0),U,3),LRXLR="LRAC",LRBOT=$P(^LAB(64.5,1,0),U,2),LRPERM=0 D DT^LRX S Y=$$Y2K^LRX(DT) S LRCDT=Y I LRDT="" S X="T-1",%DT="" D ^%DT S LRDT=Y
 K ZTSK S LRYDT=DT,LRRE=1
 S Y=$P(^LAB(64.5,1,0),U,3) S Y=$$Y2K^LRX(Y) W !!,"Last run: ",Y
 Q