LR7OSMZ2 ;DALOI/STAFF - Silent Micro rpt - BACTERIA, SIC/SBC, MIC ;Jul 15, 2021@13:33
;;5.2;LAB SERVICE;**121,244,392,350,427,547**;Sep 27, 1994;Build 10
;
;
ANTI ;from LR7OSMZ1
I $P(^LR(LRDFN,"MI",LRIDT,14,0),U,4)>0 D
. D LINE,LINE S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(28,CCNT,"Antibiotic Level(s):")
. D LINE
. S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"ANTIBIOTIC")_$$S^LR7OS(20,CCNT,"CONC RANGE (ug/ml)")_$$S^LR7OS(42,CCNT,"DRAW TIME")
. S B=0
. F S B=$O(^LR(LRDFN,"MI",LRIDT,14,B)) Q:B<1 S X=^(B,0) D
. . D LINE
. . S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,$P(X,U))_$$S^LR7OS(20,CCNT,$P(X,U,3))_$$S^LR7OS(42,CCNT,$$EXTERNAL^DILFD(63.42,1,"",$P(X,U,2)))
. . D LINE
Q
;
MES ;LR*5.2*547: Display informational message if accession/test is currently being edited.
Q:'$G(LR7SB)
Q:'$D(^XTMP("LRMICRO EDIT",LRDFN,LRIDT,LR7SB))
N LR7AREA
S LR7AREA=$S(LR7SB=1:"Bacteriology",LR7SB=5:"Parasitology",LR7SB=8:"Mycology",LR7SB=11:"Mycobacteriology",1:"Virology")
D LINE
S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT," *** ATTENTION ***")
D LINE
S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT," The "_LR7AREA_" Report is being edited by")
D LINE
S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT," tech code "_$G(^XTMP("LRMICRO EDIT",LRDFN,LRIDT,LR7SB))_" and current results")
D LINE
S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT," may not be visible until approved.")
Q
;
BACT ;from LR7OSMZ1
;
I '$L($P(^LR(LRDFN,"MI",LRIDT,1),U)) D Q:'$D(LRWRDVEW) Q:LRSB'=1
. Q:'$D(^XTMP("LRMICRO EDIT",LRDFN,LRIDT,1))
. ;LR*5.2*547: Display informational message if accession/test is currently being edited
. ; and results had previously been verified.
. N LR7SB S LR7SB=1
. D MES
;
D BUG
I $D(^LR(LRDFN,"MI",LRIDT,2,0)) D FH^LR7OSMZU Q:LREND D GRAM
;
I $D(^LR(LRDFN,"MI",LRIDT,25,0)) D FH^LR7OSMZU Q:LREND D BSMEAR
;
I $D(^LR(LRDFN,"MI",LRIDT,3,0)) D FH^LR7OSMZU Q:LREND D BRMK Q:LREND D BACT^LR7OSMZ5 Q:LREND
;
I $O(^LR(LRDFN,"MI",LRIDT,4,0)) D Q:LREND
. D FH^LR7OSMZU Q:LREND
. D LINE S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Bacteriology Remark(s):") S B=0 D
. F S B=+$O(^LR(LRDFN,"MI",LRIDT,4,B)) Q:B<1 D LINE S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(3,CCNT,^LR(LRDFN,"MI",LRIDT,4,B,0))
;
Q
;
;
BUG ;
;
N LRNS,LRTUS,LRUS,X
;
S X=^LR(LRDFN,"MI",LRIDT,1),LRTUS=$P(X,U,2),DZ=$P(X,U,3),LRUS=$P(X,U,6),LRNS=$P(X,U,5),Y=$P(X,U)
D D^LRU,LINE
;
S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"* BACTERIOLOGY "_$S(LRTUS="F":"FINAL",LRTUS="P":"PRELIMINARY",1:"")_" REPORT => "_Y_" TECH CODE: "_DZ)
S LRPRE=19
D PRE^LR7OSMZU
;
I LRUS'="" D
. D LINE
. S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"URINE SCREEN: "_$S(LRUS="N":"Negative",LRUS="P":"Positive",1:LRUS))
. I LRNS="" D LINE
;
I LRNS'="" D
. D LINE
. S ^TMP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LRSSD,U,3),LRSIC2=$P(LRSSD,U,4),LRSBC2=$P(LRSSD,U,5),LRDRTM2=$P(LRSSD,U,6),LRSSD=1
;
I LRAX=1 D LINE S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"CULTURE RESULTS: ")
;
I LRAX>1 D LN^LR7OSMZ1 S ^TMP("LRC",$J,GCNT,0)=""
;
S ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(18,CCNT,$S(LR2ORMOR:$J(LRBUG,2)_". ",1:" ")_LRORG)
;
; Display quantity/colony count
I LRQU'="" D
. N LRX
. S LRX=" - Quantity: "_LRQU
. I (GIOM-$X-1)<$L(LRX) D LINE S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(21,CCNT,LRX) Q
. S ^TMP("LRC",$J,GCNT,0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(CCNT,CCNT,LRX)
;
I LRSSD D SSD
;
S:$D(^LR(LRDFN,"MI",LRIDT,3,LRBUG,2)) LRTSTS=LRTSTS+1
;
I $O(^LR(LRDFN,"MI",LRIDT,3,LRBUG,3,0)) D MIC
;
I $O(^LR(LRDFN,"MI",LRIDT,3,LRBUG,1,0)) D CMNT
;
Q
;
;
SSD ;
;
D LINE
S LRDRTM1=$S(LRDRTM1="P":"PEAK",LRDRTM1="T":"TROUGH",1:LRDRTM1),LRDRTM2=$S(LRDRTM2="P":"PEAK",LRDRTM2="T":"TROUGH",1:LRDRTM2)
;
I LRSIC1'="" D
. D LINE
. S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(20,CCNT,"SIT ")
. S:$L(LRDRTM1) ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(CCNT,CCNT,"("_LRDRTM1_")")
. S ^(0)=^(0)_$$S^LR7OS(CCNT,CCNT,": "_LRSIC1)
;
I LRSBC1'="" D
. D LINE
. S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(20,CCNT,"SBT ")
. S:$L(LRDRTM1) ^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I",LRIDT,3,LRBUG,1,LRPC)) Q:LRPC<1 D
. S LRX=^LR(LRDFN,"MI",LRIDT,3,LRBUG,1,LRPC,0),X=LRX
. K ^UTILITY($J,"W")
. D ^DIWP
. I A=0,$D(^UTILITY($J,"W",31,1,0)) D
. . D LN^LR7OSMZ1
. . S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(22,CCNT,"Comment: "_^UTILITY($J,"W",31,1,0))
. . K ^UTILITY($J,"W",31,1,0)
. S LRIDX=0
. F S LRIDX=$O(^UTILITY($J,"W",31,LRIDX)) Q:'LRIDX D
. . Q:'$D(^UTILITY($J,"W",31,LRIDX,0))
. . D LN^LR7OSMZ1
. . S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(22,CCNT," "_^UTILITY($J,"W",31,LRIDX,0))
. K ^UTILITY($J,"W")
Q
;
;
LINE ;
D LINE^LR7OSUM4
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLR7OSMZ2 7111 printed Dec 13, 2024@02:05:34 Page 2
LR7OSMZ2 ;DALOI/STAFF - Silent Micro rpt - BACTERIA, SIC/SBC, MIC ;Jul 15, 2021@13:33
+1 ;;5.2;LAB SERVICE;**121,244,392,350,427,547**;Sep 27, 1994;Build 10
+2 ;
+3 ;
ANTI ;from LR7OSMZ1
+1 IF $PIECE(^LR(LRDFN,"MI",LRIDT,14,0),U,4)>0
Begin DoDot:1
+2 DO LINE
DO LINE
SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(28,CCNT,"Antibiotic Level(s):")
+3 DO LINE
+4 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,"ANTIBIOTIC")_$$S^LR7OS(20,CCNT,"CONC RANGE (ug/ml)")_$$S^LR7OS(42,CCNT,"DRAW TIME")
+5 SET B=0
+6 FOR
SET B=$ORDER(^LR(LRDFN,"MI",LRIDT,14,B))
if B<1
QUIT
SET X=^(B,0)
Begin DoDot:2
+7 DO LINE
+8 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,$PIECE(X,U))_$$S^LR7OS(20,CCNT,$PIECE(X,U,3))_$$S^LR7OS(42,CCNT,$$EXTERNAL^DILFD(63.42,1,"",$PIECE(X,U,2)))
+9 DO LINE
End DoDot:2
End DoDot:1
+10 QUIT
+11 ;
MES ;LR*5.2*547: Display informational message if accession/test is currently being edited.
+1 if '$GET(LR7SB)
QUIT
+2 if '$DATA(^XTMP("LRMICRO EDIT",LRDFN,LRIDT,LR7SB))
QUIT
+3 NEW LR7AREA
+4 SET LR7AREA=$SELECT(LR7SB=1:"Bacteriology",LR7SB=5:"Parasitology",LR7SB=8:"Mycology",LR7SB=11:"Mycobacteriology",1:"Virology")
+5 DO LINE
+6 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT," *** ATTENTION ***")
+7 DO LINE
+8 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT," The "_LR7AREA_" Report is being edited by")
+9 DO LINE
+10 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT," tech code "_$GET(^XTMP("LRMICRO EDIT",LRDFN,LRIDT,LR7SB))_" and current results")
+11 DO LINE
+12 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT," may not be visible until approved.")
+13 QUIT
+14 ;
BACT ;from LR7OSMZ1
+1 ;
+2 IF '$LENGTH($PIECE(^LR(LRDFN,"MI",LRIDT,1),U))
Begin DoDot:1
+3 if '$DATA(^XTMP("LRMICRO EDIT",LRDFN,LRIDT,1))
QUIT
+4 ;LR*5.2*547: Display informational message if accession/test is currently being edited
+5 ; and results had previously been verified.
+6 NEW LR7SB
SET LR7SB=1
+7 DO MES
End DoDot:1
if '$DATA(LRWRDVEW)
QUIT
if LRSB'=1
QUIT
+8 ;
+9 DO BUG
+10 IF $DATA(^LR(LRDFN,"MI",LRIDT,2,0))
DO FH^LR7OSMZU
if LREND
QUIT
DO GRAM
+11 ;
+12 IF $DATA(^LR(LRDFN,"MI",LRIDT,25,0))
DO FH^LR7OSMZU
if LREND
QUIT
DO BSMEAR
+13 ;
+14 IF $DATA(^LR(LRDFN,"MI",LRIDT,3,0))
DO FH^LR7OSMZU
if LREND
QUIT
DO BRMK
if LREND
QUIT
DO BACT^LR7OSMZ5
if LREND
QUIT
+15 ;
+16 IF $ORDER(^LR(LRDFN,"MI",LRIDT,4,0))
Begin DoDot:1
+17 DO FH^LR7OSMZU
if LREND
QUIT
+18 DO LINE
SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,"Bacteriology Remark(s):")
SET B=0
Begin DoDot:2
End DoDot:2
+19 FOR
SET B=+$ORDER(^LR(LRDFN,"MI",LRIDT,4,B))
if B<1
QUIT
DO LINE
SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(3,CCNT,^LR(LRDFN,"MI",LRIDT,4,B,0))
End DoDot:1
if LREND
QUIT
+20 ;
+21 QUIT
+22 ;
+23 ;
BUG ;
+1 ;
+2 NEW LRNS,LRTUS,LRUS,X
+3 ;
+4 SET X=^LR(LRDFN,"MI",LRIDT,1)
SET LRTUS=$PIECE(X,U,2)
SET DZ=$PIECE(X,U,3)
SET LRUS=$PIECE(X,U,6)
SET LRNS=$PIECE(X,U,5)
SET Y=$PIECE(X,U)
+5 DO D^LRU
DO LINE
+6 ;
+7 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,"* BACTERIOLOGY "_$SELECT(LRTUS="F":"FINAL",LRTUS="P":"PRELIMINARY",1:"")_" REPORT => "_Y_" TECH CODE: "_DZ)
+8 SET LRPRE=19
+9 DO PRE^LR7OSMZU
+10 ;
+11 IF LRUS'=""
Begin DoDot:1
+12 DO LINE
+13 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,"URINE SCREEN: "_$SELECT(LRUS="N":"Negative",LRUS="P":"Positive",1:LRUS))
+14 IF LRNS=""
DO LINE
End DoDot:1
+15 ;
+16 IF LRNS'=""
Begin DoDot:1
+17 DO LINE
+18 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,"SPUTUM SCREEN: "_LRNS)
+19 DO LINE
End DoDot:1
+20 ;
+21 QUIT
+22 ;
+23 ;
GRAM ;
+1 NEW CNT,LRGRM
+2 ;
+3 DO LINE
+4 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,"GRAM STAIN:")
+5 SET (CNT,LRGRM)=0
+6 FOR
SET LRGRM=+$ORDER(^LR(LRDFN,"MI",LRIDT,2,LRGRM))
if LRGRM<1
QUIT
Begin DoDot:1
+7 SET X=^LR(LRDFN,"MI",LRIDT,2,LRGRM,0)
SET CNT=CNT+1
+8 IF CNT>1
DO LN^LR7OSMZ1
SET ^TMP("LRC",$JOB,GCNT,0)=""
+9 SET ^TMP("LRC",$JOB,GCNT,0)=^TMP("LRC",$JOB,GCNT,0)_$$S^LR7OS(13,CCNT,X)
End DoDot:1
+10 DO LINE
+11 QUIT
+12 ;
+13 ;
BSMEAR ;
+1 ;
+2 DO LINE
+3 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,"BACTERIOLOGY SMEAR/PREP:")
SET LRMYC=0
+4 FOR
SET LRMYC=+$ORDER(^LR(LRDFN,"MI",LRIDT,25,LRMYC))
if LRMYC<1
QUIT
SET X=^(LRMYC,0)
DO LINE
SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(5,CCNT,X)
+5 DO LINE
+6 QUIT
+7 ;
+8 ;
BRMK ;
+1 ;
+2 NEW LRAX,LRBUG
+3 ;
+4 SET (LRBUG,LR2ORMOR)=0
+5 FOR LRAX=1,2
SET LRBUG=+$ORDER(^LR(LRDFN,"MI",LRIDT,3,LRBUG))
if LRBUG<1
QUIT
if LRAX=2
SET LR2ORMOR=1
+6 ;
+7 IF LRAX'=1
Begin DoDot:1
+8 SET (LRBUG,LRTSTS)=0
+9 FOR LRAX=1:1
SET LRBUG=+$ORDER(^LR(LRDFN,"MI",LRIDT,3,LRBUG))
if LRBUG<1
QUIT
DO LST
DO LINE
End DoDot:1
+10 ;
+11 QUIT
+12 ;
+13 ;
LST ;
+1 ;
+2 NEW LRX
+3 SET LRX=^LR(LRDFN,"MI",LRIDT,3,LRBUG,0)
+4 SET (LRBUG(LRAX),LRORG)=$PIECE(LRX,U)
SET LRQU=$PIECE(LRX,U,2)
SET LRSSD=$PIECE(LRX,U,3,8)
SET LRORG=$PIECE(^LAB(61.2,LRORG,0),U)
+5 ;
+6 IF LRSSD'?."^"
SET LRSIC1=$PIECE(LRSSD,U)
SET LRSBC1=$PIECE(LRSSD,U,2)
SET LRDRTM1=$PIECE(LRSSD,U,3)
SET LRSIC2=$PIECE(LRSSD,U,4)
SET LRSBC2=$PIECE(LRSSD,U,5)
SET LRDRTM2=$PIECE(LRSSD,U,6)
SET LRSSD=1
+7 ;
+8 IF LRAX=1
DO LINE
SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,"CULTURE RESULTS: ")
+9 ;
+10 IF LRAX>1
DO LN^LR7OSMZ1
SET ^TMP("LRC",$JOB,GCNT,0)=""
+11 ;
+12 SET ^(0)=^TMP("LRC",$JOB,GCNT,0)_$$S^LR7OS(18,CCNT,$SELECT(LR2ORMOR:$JUSTIFY(LRBUG,2)_". ",1:" ")_LRORG)
+13 ;
+14 ; Display quantity/colony count
+15 IF LRQU'=""
Begin DoDot:1
+16 NEW LRX
+17 SET LRX=" - Quantity: "_LRQU
+18 IF (GIOM-$X-1)<$LENGTH(LRX)
DO LINE
SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(21,CCNT,LRX)
QUIT
+19 SET ^TMP("LRC",$JOB,GCNT,0)=^TMP("LRC",$JOB,GCNT,0)_$$S^LR7OS(CCNT,CCNT,LRX)
End DoDot:1
+20 ;
+21 IF LRSSD
DO SSD
+22 ;
+23 if $DATA(^LR(LRDFN,"MI",LRIDT,3,LRBUG,2))
SET LRTSTS=LRTSTS+1
+24 ;
+25 IF $ORDER(^LR(LRDFN,"MI",LRIDT,3,LRBUG,3,0))
DO MIC
+26 ;
+27 IF $ORDER(^LR(LRDFN,"MI",LRIDT,3,LRBUG,1,0))
DO CMNT
+28 ;
+29 QUIT
+30 ;
+31 ;
SSD ;
+1 ;
+2 DO LINE
+3 SET LRDRTM1=$SELECT(LRDRTM1="P":"PEAK",LRDRTM1="T":"TROUGH",1:LRDRTM1)
SET LRDRTM2=$SELECT(LRDRTM2="P":"PEAK",LRDRTM2="T":"TROUGH",1:LRDRTM2)
+4 ;
+5 IF LRSIC1'=""
Begin DoDot:1
+6 DO LINE
+7 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(20,CCNT,"SIT ")
+8 if $LENGTH(LRDRTM1)
SET ^(0)=^TMP("LRC",$JOB,GCNT,0)_$$S^LR7OS(CCNT,CCNT,"("_LRDRTM1_")")
+9 SET ^(0)=^(0)_$$S^LR7OS(CCNT,CCNT,": "_LRSIC1)
End DoDot:1
+10 ;
+11 IF LRSBC1'=""
Begin DoDot:1
+12 DO LINE
+13 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(20,CCNT,"SBT ")
+14 if $LENGTH(LRDRTM1)
SET ^(0)=^TMP("LRC",$JOB,GCNT,0)_$$S^LR7OS(CCNT,CCNT,"("_LRDRTM1_")")
+15 SET ^(0)=^(0)_$$S^LR7OS(CCNT,CCNT,": "_LRSBC1)
End DoDot:1
+16 ;
+17 IF LRSIC2'=""
Begin DoDot:1
+18 DO LINE
+19 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(20,CCNT,"SIT ")
+20 if $LENGTH(LRDRTM2)
SET ^(0)=^TMP("LRC",$JOB,GCNT,0)_$$S^LR7OS(CCNT,CCNT,"("_LRDRTM2_")")
+21 SET ^(0)=^(0)_$$S^LR7OS(CCNT,CCNT,": "_LRSIC2)
End DoDot:1
+22 ;
+23 IF LRSBC2'=""
Begin DoDot:1
+24 DO LINE
+25 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(20,CCNT,"SBT ")
+26 if $LENGTH(LRDRTM2)
SET ^(0)=^TMP("LRC",$JOB,GCNT,0)_$$S^LR7OS(CCNT,CCNT,"("_LRDRTM2_")")
+27 SET ^(0)=^(0)_$$S^LR7OS(CCNT,CCNT,": "_LRSBC2)
End DoDot:1
+28 ;
+29 QUIT
+30 ;
+31 ;
MIC ;
+1 ;
+2 DO LINE
+3 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(22,CCNT,"Antibiotic")
SET B=0
+4 FOR
SET B=+$ORDER(^LR(LRDFN,"MI",LRIDT,3,LRBUG,3,B))
if B<1
QUIT
IF $LENGTH($PIECE(^(B,0),U,2,3))>0
SET ^(0)=^TMP("LRC",$JOB,GCNT,0)_$$S^LR7OS(39,CCNT,"MIC (ug/ml)")_$$S^LR7OS(54,CCNT,"MBC (ug/ml)")
QUIT
+5 ;
+6 SET B=0
+7 FOR
SET B=+$ORDER(^LR(LRDFN,"MI",LRIDT,3,LRBUG,3,B))
if B<1
QUIT
Begin DoDot:1
+8 SET X=^LR(LRDFN,"MI",LRIDT,3,LRBUG,3,B,0)
+9 DO LINE
+10 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(22,CCNT,$PIECE(X,U))_$$S^LR7OS(39,CCNT,$JUSTIFY($PIECE(X,U,2),7))_$$S^LR7OS(54,CCNT,$JUSTIFY($PIECE(X,U,3),7))
End DoDot:1
+11 ;
+12 QUIT
+13 ;
+14 ;
CMNT ;
+1 ;
+2 NEW LRX,X,DIWL,DIWR,DIWF,LRIDX
+3 SET LRPC=0
SET DIWL=31
SET DIWR=GIOM
SET DIWF="|"
+4 FOR A=0:1
SET LRPC=+$ORDER(^LR(LRDFN,"MI",LRIDT,3,LRBUG,1,LRPC))
if LRPC<1
QUIT
Begin DoDot:1
+5 SET LRX=^LR(LRDFN,"MI",LRIDT,3,LRBUG,1,LRPC,0)
SET X=LRX
+6 KILL ^UTILITY($JOB,"W")
+7 DO ^DIWP
+8 IF A=0
IF $DATA(^UTILITY($JOB,"W",31,1,0))
Begin DoDot:2
+9 DO LN^LR7OSMZ1
+10 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(22,CCNT,"Comment: "_^UTILITY($JOB,"W",31,1,0))
+11 KILL ^UTILITY($JOB,"W",31,1,0)
End DoDot:2
+12 SET LRIDX=0
+13 FOR
SET LRIDX=$ORDER(^UTILITY($JOB,"W",31,LRIDX))
if 'LRIDX
QUIT
Begin DoDot:2
+14 if '$DATA(^UTILITY($JOB,"W",31,LRIDX,0))
QUIT
+15 DO LN^LR7OSMZ1
+16 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(22,CCNT," "_^UTILITY($JOB,"W",31,LRIDX,0))
End DoDot:2
+17 KILL ^UTILITY($JOB,"W")
End DoDot:1
+18 QUIT
+19 ;
+20 ;
LINE ;
+1 DO LINE^LR7OSUM4
+2 QUIT