LRMIV4 ;SLC/DLG - MICRO DISPLAY ANTIBIOTICS FOR VERIFY ; 12/8/88 23:02 ;
;;5.2;LAB SERVICE;;Sep 27, 1994
BACT ;from LRMIV1
Q:+$O(^LR(LRDFN,"MI",LRIDT,3,0))<1
S LRFMT=$P(^LAB(69.9,1,0),U,11),LRFMT=$S(LRFMT="":"I",1:LRFMT)
K LRRES,LRINT
S LRBUG=0 F A=1:1 S LRBUG=+$O(^LR(LRDFN,"MI",LRIDT,3,LRBUG)) Q:LRBUG<1 S:+$O(^(LRBUG,2))'["2." A=A-1 I +$O(^(2))["2." D CHECK
S (LRABCNT,LRBN)=0 F I=0:0 S LRBN=+$O(LRRES(LRBN)) Q:LRBN<1 S LRABCNT=LRABCNT+1
Q:'LRABCNT Q:LREND W !!,"ANTIBIOTIC SUSCEPTIBILITY TEST RESULTS:" W:$D(LRLABKY)&'$D(LRWRDVEW) " ('*' indcates display is suppressed)" W ! D BUGHDR
S LRCOMTAB=$S(LRFMT="B":A*13+17,1:A*5+17)
S (LRAO,LRACNT)=0 F I=0:0 S LRAO=$O(^LAB(62.06,"AO",LRAO)) Q:LRAO<.001 S B=$O(^LAB(62.06,"AO",LRAO,0)) I B>0,$D(^LAB(62.06,B,0)) D AB
W ! K LR1PASS,LRRES,LRINT,LRBN
Q
CHECK S LRFLAG=0,LRBN=2 K LR1PASS
F I=0:0 S LRBN=+$O(^LR(LRDFN,"MI",LRIDT,3,LRBUG,LRBN)) Q:LRBN'["2." S B=^(LRBN),B1=$P(B,U),B2=$P(B,U,2),B3=$P(B,U,3) I $L(B1),$D(^LAB(62.06,"AI",LRBN,B1)) D FIRST
S LRBN=2 F I=0:0 S LRBN=+$O(LR1PASS(LRBN)) Q:LRBN<1 S B=LR1PASS(LRBN),B1=$P(B,U),B2=$P(B,U,2),B3=$P(B,U,3) D LAB
K LRBN,LR1PASS,LRFLAG,B,B1,B2,B3
Q
FIRST S B2=$S(B2]"":B2,1:^(B1)) S:$E(B2)'="R"&("A"[B3) LRFLAG=1 S LR1PASS(LRBN)=B1_U_B2_U_B3,^LR(LRDFN,"MI",LRIDT,3,LRBUG,LRBN)=LR1PASS(LRBN)
Q
LAB I $D(LRLABKY),'$D(LRWRDVEW) S $P(LRRES(LRBN),U,A)=$S(B3="N"!(B3="R"&LRFLAG):B1_"*",1:B1),$P(LRINT(LRBN),U,A)=$S(B3="N"!(B3="R"&LRFLAG):B2_"*",1:B2) Q
I B3=""!(B3="A")!(B3="R"&'LRFLAG) S $P(LRRES(LRBN),U,A)=B1,$P(LRINT(LRBN),U,A)=B2
Q
AB S J=$P(^LAB(62.06,B,0),U,2) I $D(LRINT(J)),LRINT(J)'?."^" W !,$E($P(^(0),U),1,14) S LRDCOM=$P(^(0),U,3),LRACNT=LRACNT+1 D SIR
Q
BUGHDR S LRBUG=0 F A=0:1 S LRBUG=+$O(^LR(LRDFN,"MI",LRIDT,3,LRBUG)) Q:LRBUG<1 S LRORG=$P(^(LRBUG,0),U),LRORG=$P(^LAB(61.2,LRORG,0),U) S:+$O(^LR(LRDFN,"MI",LRIDT,3,LRBUG,2))'["2." A=A-1 I +$O(^(2))["2." D ORG
I LRFMT="B" W ! F J=1:1:A W ?J-1*13+15,":"
W ! F J=1:1:A W:LRFMT'="B" ?(J*5+10),":" I LRFMT="B" W ?J-1*13+15,"SUSC INTP"
Q
ORG W ! I A>0 F J=1:1:A W ?($S(LRFMT="B":J-1*13+15,1:J*5+10)),":"
W ?($S(LRFMT="B":A*13+15,1:A*5+15)),$S(LR2ORMOR:LRBUG_". ",1:""),LRORG
Q
SIR F II=1:1:10 D:$P(LRINT(J),U,II,10)="" DCOM Q:$P(LRINT(J),U,II,10)="" W:LRFMT'="B" ?(II*5+10),$S(LRFMT="I":$P(LRINT(J),U,II),1:$P(LRRES(J),U,II)) I LRFMT="B" D SIR1
Q
DCOM W ?LRCOMTAB,LRDCOM I $D(LRDCOM(J)) S K=0,A=0 F I=0:0 S A=+$O(LRDCOM(J,A)) Q:A<1 W:'('K&(LRDCOM="")) ! W ?LRCOMTAB,LRDCOM(J,A) S K=1
Q
SIR1 W ?(II-1*13+15),$S($D(LRRES(J)):$P(LRRES(J),U,II),1:""),?(II-1*13+21),$P(LRINT(J),U,II)," "
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLRMIV4 2612 printed Oct 16, 2024@18:18:31 Page 2
LRMIV4 ;SLC/DLG - MICRO DISPLAY ANTIBIOTICS FOR VERIFY ; 12/8/88 23:02 ;
+1 ;;5.2;LAB SERVICE;;Sep 27, 1994
BACT ;from LRMIV1
+1 if +$ORDER(^LR(LRDFN,"MI",LRIDT,3,0))<1
QUIT
+2 SET LRFMT=$PIECE(^LAB(69.9,1,0),U,11)
SET LRFMT=$SELECT(LRFMT="":"I",1:LRFMT)
+3 KILL LRRES,LRINT
+4 SET LRBUG=0
FOR A=1:1
SET LRBUG=+$ORDER(^LR(LRDFN,"MI",LRIDT,3,LRBUG))
if LRBUG<1
QUIT
if +$ORDER(^(LRBUG,2))'["2."
SET A=A-1
IF +$ORDER(^(2))["2."
DO CHECK
+5 SET (LRABCNT,LRBN)=0
FOR I=0:0
SET LRBN=+$ORDER(LRRES(LRBN))
if LRBN<1
QUIT
SET LRABCNT=LRABCNT+1
+6 if 'LRABCNT
QUIT
if LREND
QUIT
WRITE !!,"ANTIBIOTIC SUSCEPTIBILITY TEST RESULTS:"
if $DATA(LRLABKY)&'$DATA(LRWRDVEW)
WRITE " ('*' indcates display is suppressed)"
WRITE !
DO BUGHDR
+7 SET LRCOMTAB=$SELECT(LRFMT="B":A*13+17,1:A*5+17)
+8 SET (LRAO,LRACNT)=0
FOR I=0:0
SET LRAO=$ORDER(^LAB(62.06,"AO",LRAO))
if LRAO<.001
QUIT
SET B=$ORDER(^LAB(62.06,"AO",LRAO,0))
IF B>0
IF $DATA(^LAB(62.06,B,0))
DO AB
+9 WRITE !
KILL LR1PASS,LRRES,LRINT,LRBN
+10 QUIT
CHECK SET LRFLAG=0
SET LRBN=2
KILL LR1PASS
+1 FOR I=0:0
SET LRBN=+$ORDER(^LR(LRDFN,"MI",LRIDT,3,LRBUG,LRBN))
if LRBN'["2."
QUIT
SET B=^(LRBN)
SET B1=$PIECE(B,U)
SET B2=$PIECE(B,U,2)
SET B3=$PIECE(B,U,3)
IF $LENGTH(B1)
IF $DATA(^LAB(62.06,"AI",LRBN,B1))
DO FIRST
+2 SET LRBN=2
FOR I=0:0
SET LRBN=+$ORDER(LR1PASS(LRBN))
if LRBN<1
QUIT
SET B=LR1PASS(LRBN)
SET B1=$PIECE(B,U)
SET B2=$PIECE(B,U,2)
SET B3=$PIECE(B,U,3)
DO LAB
+3 KILL LRBN,LR1PASS,LRFLAG,B,B1,B2,B3
+4 QUIT
FIRST SET B2=$SELECT(B2]"":B2,1:^(B1))
if $EXTRACT(B2)'="R"&("A"[B3)
SET LRFLAG=1
SET LR1PASS(LRBN)=B1_U_B2_U_B3
SET ^LR(LRDFN,"MI",LRIDT,3,LRBUG,LRBN)=LR1PASS(LRBN)
+1 QUIT
LAB IF $DATA(LRLABKY)
IF '$DATA(LRWRDVEW)
SET $PIECE(LRRES(LRBN),U,A)=$SELECT(B3="N"!(B3="R"&LRFLAG):B1_"*",1:B1)
SET $PIECE(LRINT(LRBN),U,A)=$SELECT(B3="N"!(B3="R"&LRFLAG):B2_"*",1:B2)
QUIT
+1 IF B3=""!(B3="A")!(B3="R"&'LRFLAG)
SET $PIECE(LRRES(LRBN),U,A)=B1
SET $PIECE(LRINT(LRBN),U,A)=B2
+2 QUIT
AB SET J=$PIECE(^LAB(62.06,B,0),U,2)
IF $DATA(LRINT(J))
IF LRINT(J)'?."^"
WRITE !,$EXTRACT($PIECE(^(0),U),1,14)
SET LRDCOM=$PIECE(^(0),U,3)
SET LRACNT=LRACNT+1
DO SIR
+1 QUIT
BUGHDR SET LRBUG=0
FOR A=0:1
SET LRBUG=+$ORDER(^LR(LRDFN,"MI",LRIDT,3,LRBUG))
if LRBUG<1
QUIT
SET LRORG=$PIECE(^(LRBUG,0),U)
SET LRORG=$PIECE(^LAB(61.2,LRORG,0),U)
if +$ORDER(^LR(LRDFN,"MI",LRIDT,3,LRBUG,2))'["2."
SET A=A-1
IF +$ORDER(^(2))["2."
DO ORG
+1 IF LRFMT="B"
WRITE !
FOR J=1:1:A
WRITE ?J-1*13+15,":"
+2 WRITE !
FOR J=1:1:A
if LRFMT'="B"
WRITE ?(J*5+10),":"
IF LRFMT="B"
WRITE ?J-1*13+15,"SUSC INTP"
+3 QUIT
ORG WRITE !
IF A>0
FOR J=1:1:A
WRITE ?($SELECT(LRFMT="B":J-1*13+15,1:J*5+10)),":"
+1 WRITE ?($SELECT(LRFMT="B":A*13+15,1:A*5+15)),$SELECT(LR2ORMOR:LRBUG_". ",1:""),LRORG
+2 QUIT
SIR FOR II=1:1:10
if $PIECE(LRINT(J),U,II,10)=""
DO DCOM
if $PIECE(LRINT(J),U,II,10)=""
QUIT
if LRFMT'="B"
WRITE ?(II*5+10),$SELECT(LRFMT="I":$PIECE(LRINT(J),U,II),1:$PIECE(LRRES(J),U,II))
IF LRFMT="B"
DO SIR1
+1 QUIT
DCOM WRITE ?LRCOMTAB,LRDCOM
IF $DATA(LRDCOM(J))
SET K=0
SET A=0
FOR I=0:0
SET A=+$ORDER(LRDCOM(J,A))
if A<1
QUIT
if '('K&(LRDCOM=""))
WRITE !
WRITE ?LRCOMTAB,LRDCOM(J,A)
SET K=1
+1 QUIT
SIR1 WRITE ?(II-1*13+15),$SELECT($DATA(LRRES(J)):$PIECE(LRRES(J),U,II),1:""),?(II-1*13+21),$PIECE(LRINT(J),U,II)," "
+1 QUIT