VistA-FOIAVistA/r/LAB_SERVICE-LR-LS/LR7OSMZ1.m

53 lines
2.5 KiB
Mathematica

LR7OSMZ1 ;slc/dcm - Silent Micro rpt Cont. ;8/11/97
;;5.2;LAB SERVICE;**121,244**;Sep 27, 1994
EN ;from LRMINEW2, LRMIPC, LRMIPLOG, LR7OSMZ, LRMIVER1
S LRSPEC=$P(LRLLT,U,5)
I LRONESPC'="",LRSPEC'=LRONESPC Q
D RPT
K %,A8,A,AB,B,B1,B2,B3,C,IA,LR1PASS,LR2ORMOR,LRABCNT,LRACNT,LRAO,LRADM,LRADX,LRAFS,LRAMT,LRAX,LRBN,LRBRR,LRBUG,LRCOMTAB,LRCS,LRDCOM,LRDOC,LRDRTM1,LRDRTM2,LREF,LRFMT,LRGRM,LRIFN,LRINT,LRPATLOC,LRMYC,LRNS,LRNUM
K LRORG,LRPAR,LRPC,LRPRE,LRPRINT,LRQU,LRRC,LRRES,LRSBC1,LRSBC2,LRSET,LRSIC1,LRSIC2,LRSPEC,LRSSD,LRST,LRTA,LRTB,LRTBA,LRTBC,LRTBS,LRTK,LRTS,LRTSTS,LRTUS,LRUS,LRWRD,N
Q
RPT ;
S:'$D(LRSB) LRSB=0
S LRPRINT=$S($D(^LRO(68,LRAA,1,LRAD,1,LRAN,4)):"",1:1),LRPATLOC=$P(LRLLT,U,8)
S LRCS=$S($D(^LAB(62,+$P(LRLLT,U,11),0)):$P(^(0),U),1:"")
S LRTK=$P(LRLLT,U),LRRC=$P(LRLLT,U,10),LRST=$S(LRSPEC:$P(^LAB(61,LRSPEC,0),U),1:""),Y=LRTK
D D^LRU
S LRTK=Y,Y=LRRC
D D^LRU
S LRRC=Y,X=$P(LRLLT,U,7)
D DOC^LRX
K ^TMP("LR",$J,"T"),LRTSTS
S LRBRR=0
F S LRBRR=+$O(^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRBRR)) Q:LRBRR<1 D EN1
I 'LRPRINT,LRONETST Q
S LRPG=0
D HDR^LR7OSMZU
Q:LREND
I $D(^TMP("LR",$J,"T")) D LINE^LR7OSUM4,LN S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(5,CCNT,"Test(s) ordered:") S J="" F S J=$O(^TMP("LR",$J,"T",J)) Q:J="" S X=^(J) D
. S ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(23,CCNT,$P(X,U)),Y=$P(X,U,2)
. D:$L(Y) D^LRU
. S:'$D(^TMP("LRT",$J,$P(X,"^"))) ^($P(X,"^"))="MICROBIOLOGY"_"^"_GCNT
. S:$L(Y) ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(43,CCNT," completed: "_Y)
. D LN
. S ^TMP("LRC",$J,GCNT,0)=""
K ^TMP("LR",$J,"T"),LRTSTS
I $D(^LR(LRDFN,"MI",LRIDT,14)) D FH^LR7OSMZU Q:LREND D ANTI^LR7OSMZ2
I $D(^LR(LRDFN,"MI",LRIDT,1)) D FH^LR7OSMZU Q:LREND D BACT^LR7OSMZ2 Q:LREND D REFS^LR7OSMZU Q:LREND
I $D(^LR(LRDFN,"MI",LRIDT,31)) D FH^LR7OSMZU Q:LREND D STER^LR7OSMZ3
I $D(^LR(LRDFN,"MI",LRIDT,5)) D FH^LR7OSMZU Q:LREND D PARA^LR7OSMZ3,REFS^LR7OSMZU Q:LREND
I $D(^LR(LRDFN,"MI",LRIDT,16)) D FH^LR7OSMZU Q:LREND D VIR^LR7OSMZ3,REFS^LR7OSMZU Q:LREND
I $D(^LR(LRDFN,"MI",LRIDT,11)) D FH^LR7OSMZU Q:LREND D TB^LR7OSMZ4,REFS^LR7OSMZU Q:LREND
I $D(^LR(LRDFN,"MI",LRIDT,8)) D FH^LR7OSMZU Q:LREND D FUNG^LR7OSMZ4,REFS^LR7OSMZU Q:LREND
Q
EN1 ;
S LRTS=+^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRBRR,0),LRTS(1)=$P(^(0),U,5)
Q:'$L($P($G(^LAB(60,LRTS,0)),U,3))
I '$D(LRLABKY),"BO"'[$P($G(^LAB(60,LRTS,0)),U,3) Q
S:LRTS=LRONETST LRPRINT=1
S LRTSTS=$S($D(^LAB(60,LRTS,0)):$P(^(0),U),1:"deleted test"),^TMP("LR",$J,"T",$S($D(^LAB(60,LRTS,.1)):$P(^(.1),U,6),1:"")_","_LRBRR)=LRTSTS_U_LRTS(1)
Q
LN ;Increment counter
S GCNT=GCNT+1,CCNT=1
Q