source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LR7OSMZ5.m@ 724

Last change on this file since 724 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.6 KB
Line 
1LR7OSMZ5 ;slc/dcm - Silent Micro rpt - BACTERIA, ANTIBIOTICS ;8/11/97
2 ;;5.2;LAB SERVICE;**121,187,244**;Sep 27, 1994
3BACT ;from LR7OSMZ2
4 Q:+$O(^LR(LRDFN,"MI",LRIDT,3,0))<1
5 S LRFMT=$P(^LAB(69.9,1,0),U,11),LRFMT=$S(LRFMT="":"I",1:LRFMT)
6 K LRRES,LRINT
7 N X,LRBUG,LRABCNT,LRBN,LRAO,LRACNT
8 S (LRBUG,LRABCNT,LRBN,LRAO,LRACNT)=0
9 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
10 F S LRBN=+$O(LRRES(LRBN)) Q:LRBN<1 S LRABCNT=LRABCNT+1
11 Q:'LRABCNT!($G(LREND))
12 D LINE^LR7OSUM4,LINE^LR7OSUM4
13 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"ANTIBIOTIC SUSCEPTIBILITY TEST RESULTS:")
14 D BUGHDR
15 S LRCOMTAB=$S(LRFMT="B":A*13+17,1:A*5+17)
16 F S LRAO=$O(^LAB(62.06,"AO",LRAO)) Q:LRAO<.001!($G(LREND)) S B=$O(^LAB(62.06,"AO",LRAO,0)) I B>0,$D(^LAB(62.06,B,0)) D AB
17 D LINE^LR7OSUM4
18 K LR1PASS,LRRES,LRINT
19 Q
20CHECK ;
21 N LRBN,LR1PASS,LRFLAG,B,B1,B2,B3
22 S LRFLAG=0,LRBN=2
23 F S LRBN=+$O(^LR(LRDFN,"MI",LRIDT,3,LRBUG,LRBN)) Q:LRBN'["2."!($G(LREND)) S B=^(LRBN),B1=$P(B,U),B2=$P(B,U,2) I $L(B1),$D(^LAB(62.06,"AI",LRBN,B1)) S X=^(B1) D FIRST
24 S LRBN=2
25 F S LRBN=+$O(LR1PASS(LRBN)) Q:LRBN<1!($G(LREND)) S B=LR1PASS(LRBN),B1=$P(B,U),B2=$P(B,U,2),B3=$P(B,U,3) D LAB
26 Q
27FIRST ;
28 S B2=$S(B2]"":B2,1:X),B3=$P(B,U,3)
29 S:$E(B2)'="R"&("A"[B3) LRFLAG=1
30 S LR1PASS(LRBN)=B1_U_B2_U_B3,^LR(LRDFN,"MI",LRIDT,3,LRBUG,LRBN)=LR1PASS(LRBN)
31 Q
32LAB ;
33 I $D(^XUSEC("LRLAB",DUZ)),'$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
34 I B3=""!(B3="A")!(B3="R"&'LRFLAG) S $P(LRRES(LRBN),U,A)=B1,$P(LRINT(LRBN),U,A)=B2
35 Q
36AB ;
37 Q:$G(LREND)
38 S X=^LAB(62.06,B,0),J=$P(X,U,2)
39 I $D(LRINT(J)),LRINT(J)'?."^" D LINE^LR7OSUM4 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,$E($P(X,U),1,14)) S LRDCOM=$P(X,U,3),LRACNT=LRACNT+1 D SIR
40 Q
41BUGHDR ;
42 S LRBUG=0
43 F A=0:1 S LRBUG=+$O(^LR(LRDFN,"MI",LRIDT,3,LRBUG)) Q:LRBUG<1!($G(LREND)) 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
44 I LRFMT="B" D LN^LR7OSMZ1 S ^TMP("LRC",$J,GCNT,0)="" F J=1:1:A S ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(J-1*13+15,CCNT,":")
45 D LN^LR7OSMZ1
46 S ^TMP("LRC",$J,GCNT,0)=""
47 F J=1:1:A D
48 . I LRFMT'="B" S ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(J*5+10,CCNT,":")
49 . I LRFMT="B" S ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(J-1*13+15,CCNT,"SUSC INTP")
50 Q
51ORG ;
52 D LINE^LR7OSUM4
53 S ^TMP("LRC",$J,GCNT,0)=""
54 F J=1:1:A S ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS($S(LRFMT="B":J-1*13+15,1:J*5+10),CCNT,":") ;I A>0 BEFORE FOR LOOP
55 S ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS($S(LRFMT="B":A*13+15,1:A*5+15),CCNT,$S(LR2ORMOR:LRBUG_". ",1:"")_LRORG)
56 Q
57SIR ;
58 F II=1:1:10 D:$P(LRINT(J),U,II,10)="" DCOM Q:$P(LRINT(J),U,II,10)="" S:LRFMT'="B" ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(II*5+10,CCNT,$S(LRFMT="I":$P(LRINT(J),U,II),1:$P(LRRES(J),U,II))) I LRFMT="B" D SIR1
59 Q
60DCOM ;
61 S ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(LRCOMTAB,CCNT,LRDCOM) I $D(LRDCOM(J)) S K=0,A=0 D
62 . F S A=+$O(LRDCOM(J,A)) Q:A<1 D:'('K&(LRDCOM="")) LINE^LR7OSUM4 S ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(LRCOMTAB,CCNT,LRDCOM(J,A)) S K=1
63 Q
64SIR1 ;
65 S ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(II-1*13+15,CCNT,$S($D(LRRES(J)):$P(LRRES(J),U,II),1:""))_$$S^LR7OS(II-1*13+21,CCNT,$P(LRINT(J),U,II)_" ")
66 Q
67 D LINE^LR7OSUM4
68 S X="",$P(X,"-",GIOM)="",^TMP("LRC",$J,GCNT,0)=X
69 D LINE^LR7OSUM4
70 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"PATIENT'S IDENTIFICATION")_$$S^LR7OS(60,CCNT,"MICROBIOLOGY REPORT")
71 D LINE^LR7OSUM4
72 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"ACCESSION: "_LRACC)_$$S^LR7OS(25,CCNT,"TAKEN:"_LRTK)_$$S^LR7OS(52,CCNT,"RECEIVED:"_LRRC)
73 Q
Note: See TracBrowser for help on using the repository browser.