LRDIST4 ;SLC/DCM - GRAPH ENTRY FOR OE/RR ;8/11/97
;;5.2T9;LR;**1018**;Nov 17, 2004
;;5.2;LAB SERVICE;**121,153**;Sep 27, 1994
OERR ;OE/RR entry for lab graph
I '$D(LRPARAM) D EN^LRPARAM
D DT^LRX K DIC S LREND=0,LRDPF=+$P(@("^"_$P(ORVP,";",2)_"0)"),"^",2)_"^"_$P(ORVP,";",2) D END^LRDPA Q:LRDFN<1 D PT^LRX
D LIST^LRDIST
Q
SET ;
S LRCW=8,LRFLAG="",LRCTRL=0
K LREDT D ^LRWU3 Q:LREND
S LRNSET=80,N=LRNSET
L2 F I=0:0 W !,"How many time points? ",LRNSET,"//" R X:DTIME Q:X[U!'$L(X)!(X\1=X&(X'<1))!(X?.N) W " Enter a whole number."
Q:X[U S:X'="" LRNSET=X S N=LRNSET
L3 K ^TMP("LR",$J,"TMP"),^TMP("LR",$J,"X"),X,LRORD,DIC,ZTRTN,ZTIO,ZTDESC,ZTSAVE,ZTSK S LRSPEC=-1,DIC(0)="AEOQZ" S DIC="^LAB(61,",DIC("A")="Select SITE/SPECIMEN: ANY//" D ^DIC S LRSPEC=+Y I $D(DUOUT) S OREND=1 Q
L4 S LRSS="CH" K DIC("A") S:'LRFLAG LRSDNORM=0 IF (LRSPEC>0!LRCTRL)&'LRFLAG W !,"Plot relative to ",$S(LRCTRL:"expected",1:"normal")," values (if available)" S %=1 D YN^DICN Q:%=-1 G L4:%=0 S:%=1 LRSDNORM=1
S:N<2 N=30 S LRSSP=0,DIC="^LAB(60,",DIC("S")="I $P(^(0),U,4)=""CH"""_$S(LRCTRL:"",1:$S('$D(^XUSEC("LRLIASON",DUZ)):",""N""'[$P(^(0),U,3)",1:"")) D ^DIC Q:Y<1
IF $L($P(^LAB(60,+Y,.1),U,5)) W !,"ASK FOR TESTS INDIVIDUALLY" Q
TX S LRSSP=LRSSP+1,LRTEST(LRSSP)=+Y_U_Y(0) D ^DIC G TX:Y>0
S LRNX=0,LRPANEL=0 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OC,LRSAMP,LRSN,LRSSQ,LRSTAR
Q
LRDIST4 ;SLC/DCM - GRAPH ENTRY FOR OE/RR ;8/11/97
+1 ;;5.2T9;LR;**1018**;Nov 17, 2004
+2 ;;5.2;LAB SERVICE;**121,153**;Sep 27, 1994
OERR ;OE/RR entry for lab graph
+1 IF '$DATA(LRPARAM)
DO EN^LRPARAM
+2 DO DT^LRX
KILL DIC
SET LREND=0
SET LRDPF=+$PIECE(@("^"_$PIECE(ORVP,";",2)_"0)"),"^",2)_"^"_$PIECE(ORVP,";",2)
DO END^LRDPA
IF LRDFN<1
QUIT
DO PT^LRX
+3 DO LIST^LRDIST
+4 QUIT
SET ;
+1 SET LRCW=8
SET LRFLAG=""
SET LRCTRL=0
+2 KILL LREDT
DO ^LRWU3
IF LREND
QUIT
+3 SET LRNSET=80
SET N=LRNSET
L2 FOR I=0:0
WRITE !,"How many time points? ",LRNSET,"//"
READ X:DTIME
IF X[U!'$LENGTH(X)!(X\1=X&(X'<1))!(X?.N)
QUIT
WRITE " Enter a whole number."
+1 IF X[U
QUIT
IF X'=""
SET LRNSET=X
SET N=LRNSET
L3 KILL ^TMP("LR",$JOB,"TMP"),^TMP("LR",$JOB,"X"),X,LRORD,DIC,ZTRTN,ZTIO,ZTDESC,ZTSAVE,ZTSK
SET LRSPEC=-1
SET DIC(0)="AEOQZ"
SET DIC="^LAB(61,"
SET DIC("A")="Select SITE/SPECIMEN: ANY//"
DO ^DIC
SET LRSPEC=+Y
IF $DATA(DUOUT)
SET OREND=1
QUIT
L4 SET LRSS="CH"
KILL DIC("A")
IF 'LRFLAG
SET LRSDNORM=0
IF (LRSPEC>0!LRCTRL)&'LRFLAG
WRITE !,"Plot relative to ",$SELECT(LRCTRL:"expected",1:"normal")," values (if available)"
SET %=1
DO YN^DICN
IF %=-1
QUIT
IF %=0
GOTO L4
IF %=1
SET LRSDNORM=1
+1 IF N<2
SET N=30
SET LRSSP=0
SET DIC="^LAB(60,"
SET DIC("S")="I $P(^(0),U,4)=""CH"""_$SELECT(LRCTRL:"",1:$SELECT('$DATA(^XUSEC("LRLIASON",DUZ)):",""N""'[$P(^(0),U,3)",1:""))
DO ^DIC
IF Y<1
QUIT
+2 IF $LENGTH($PIECE(^LAB(60,+Y,.1),U,5))
WRITE !,"ASK FOR TESTS INDIVIDUALLY"
QUIT
TX SET LRSSP=LRSSP+1
SET LRTEST(LRSSP)=+Y_U_Y(0)
DO ^DIC
IF Y>0
GOTO TX
+1 SET LRNX=0
SET LRPANEL=0
KILL ^TMP("LR",$JOB,"X"),X,^TMP("LR",$JOB,"TMP"),LRORD,DIC
FOR I=1:1
IF '$DATA(LRTEST(I))
QUIT
SET X=LRTEST(I)
SET (LRNTN,LRNT,T1)=I
SET (S1,J)=0
SET LRCFL=""
DO EX2^LREXPD
+2 KILL LRTEST,T1,^TMP("LR",$JOB,"TMP")
SET I=0
FOR
SET I=$ORDER(LRORD(I))
IF I<1
QUIT
SET J=LRORD(I)
SET LRTEST(I)=$ORDER(^LAB(60,"C","CH;"_J_";1",0))_U_$PIECE(^LAB(60,$ORDER(^(0)),0),U,1)_U_J
SET LRNM=I
+3 QUIT
CLEAN ;
+1 KILL AGE,C,DFN,J,LRBLOOD,LRDFN,LRDPF,LRDT0,LREND,LRLABKY,LRMX,LRPARAM,LRPLASMA,LRSERUM,LRUNKNOW,LRURINE,S1,SEX,X,Y
+2 KILL A,A9,DFN,DIC,DOB,I,K,LAST,LRORD,LRCHM,LRCOUNT,LRCTRL,LRCW,LRDPF
+3 KILL LRCV,LREDT,LREND,LRFLAG,LRFOOT,LRHIGH,LRIDT,LRII,LRIY,LRLM1,LRLM1F,LRLM2,LRLM2F
+4 KILL LRLOW,LRM,LRTEST,LRNC,LRNEX,LRNM,LRNSET,LRNT,LRNTN,LRNX,LROK
+5 KILL LRPANEL,LRSB,LRSDNORM,LRSDT,LRSPC,LRSPEC,LRSS,LRSSP,LRSSX,LRSTEPS
+6 KILL ^TMP("LR",$JOB,"X"),LRSTS,LRSUB,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