source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LROR4A.m@ 842

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

initial load of WorldVistAEHR

File size: 3.3 KB
Line 
1LROR4A ;AVAMC/REG/SLC/CJS/BA - MICRO PATIENT REPORT - BACTERIA, SIC/SBC, MIC ; 3/16/88 2:41 PM ;
2 ;;5.2;LAB SERVICE;;Sep 27, 1994
3ANTI ;from LRMIPSZ1
4 I $P(^LR(LRDFN,"MI",LRIDT,14,0),U,4)>0 W !!,?28,"Antibiotic Level(s):",!,"ANTIBIOTIC",?20,"CONC RANGE (ug/ml)",?42,"DRAW TIME"
5 I S B=0 F I=0:0 S B=$O(^LR(LRDFN,"MI",LRIDT,14,B)) Q:B<1 W !,$P(^LR(LRDFN,"MI",LRIDT,14,B,0),U),?20,$P(^(0),U,3),?42,$S($P(^(0),U,2)="P":"PEAK",$P(^(0),U,2)="T":"TROUGH",1:"")
6 Q
7BACT ;from LRMIPSZ1
8 I '$L($P(^LR(LRDFN,"MI",LRIDT,1),U)) Q:'$D(LRWRDVEW) Q:LRSB'=1
9 D BUG
10 I $D(^LR(LRDFN,"MI",LRIDT,2,0)) D FH^LROR4 Q:LREND D GRAM
11 I $D(^LR(LRDFN,"MI",LRIDT,25,0)) D FH^LROR4 Q:LREND D BSMEAR
12 I $D(^LR(LRDFN,"MI",LRIDT,3,0)) D FH^LROR4 Q:LREND D BRMK Q:LREND D BACT^LROR4B Q:LREND
13 I $D(^LR(LRDFN,"MI",LRIDT,4,0)),$P(^(0),U,4)>0 D FH^LROR4 Q:LREND W:LRHC ! W !,"Bacteriology Remark(s):" S B=0 F I=0:0 S B=+$O(^LR(LRDFN,"MI",LRIDT,4,B)) Q:B<1 W !,?3,^LR(LRDFN,"MI",LRIDT,4,B,0)
14 Q
15BUG S LRTUS=$P(^LR(LRDFN,"MI",LRIDT,1),U,2),DZ=$P(^(1),U,3),LRUS=$P(^(1),U,6),LRNS=$P(^(1),U,5),Y=$P(^(1),U) D D^LRU
16 D:$Y>(IOSL-LRFLIP) WAIT^LROR4 Q:LREND
17 W:LRHC ! W !,"* BACTERIOLOGY ",$S(LRTUS="F":"FINAL",LRTUS="P":"PRELIMINARY",1:"")," REPORT => "_Y_" TECH CODE: "_DZ
18 S LRPRE=19 D PRE^LRMIPSU
19 I $L(LRUS) W !,"URINE SCREEN: "_$S(LRUS="N":"Negative",LRUS="P":"Positive",1:LRUS) W:LRHC !
20 I $L(LRNS) W !,"SPUTUM SCREEN: ",LRNS W:LRHC !
21 Q
22GRAM W !,"GRAM STAIN:" S LRGRM=0 F I=0:0 S LRGRM=+$O(^LR(LRDFN,"MI",LRIDT,2,LRGRM)) Q:LRGRM<1 W ?14,^(LRGRM,0),!
23 W:LRHC !
24 Q
25BSMEAR W !,"BACTERIOLOGY SMEAR/PREP:",! S LRMYC=0 F I=0:0 S LRMYC=+$O(^LR(LRDFN,"MI",LRIDT,25,LRMYC)) Q:LRMYC<1 W ?5,^(LRMYC,0),!
26 Q
27BRMK S (LRBUG,LR2ORMOR)=0 F LRAX=1,2 S LRBUG=+$O(^LR(LRDFN,"MI",LRIDT,3,LRBUG)) Q:LRBUG<1 S:LRAX=2 LR2ORMOR=1
28 I LRAX'=1 S (LRBUG,LRTSTS)=0 F LRAX=1:1 S LRBUG=+$O(^LR(LRDFN,"MI",LRIDT,3,LRBUG)) Q:LRBUG<1 D LST
29 Q
30LST S (LRBUG(LRAX),LRORG)=$P(^LR(LRDFN,"MI",LRIDT,3,LRBUG,0),U),LRQU=$P(^(0),U,2),LRSSD=$P(^(0),U,3,8),LRORG=$P(^LAB(61.2,LRORG,0),U)
31 I LRSSD'?."^" S LRSIC1=$P(LRSSD,U),LRSBC1=$P(LRSSD,U,2),LRDRTM1=$P(LRSSD,U,3),LRSIC2=$P(LRSSD,U,4),LRSBC2=$P(LRSSD,U,5),LRDRTM2=$P(LRSSD,U,6),LRSSD=1
32 W:LRHC ! W:LRAX=1 !,"CULTURE RESULTS:" W:LRAX>1 ! W ?17,$S(LR2ORMOR:LRBUG_". ",1:""),LRQU,LRORG
33 I LRSSD D FH^LROR4 Q:LREND D SSD W:LRHC !
34 S:$D(^LR(LRDFN,"MI",LRIDT,3,LRBUG,2)) LRTSTS=LRTSTS+1 I $D(^LR(LRDFN,"MI",LRIDT,3,LRBUG,3,0)),$P(^(0),U,4)>0 D MIC
35 I $D(^LR(LRDFN,"MI",LRIDT,3,LRBUG,1,0)),$P(^(0),U,4)>0 D CMNT
36 Q
37SSD W ! S LRDRTM1=$S(LRDRTM1="P":"PEAK",LRDRTM1="T":"TROUGH",1:LRDRTM1),LRDRTM2=$S(LRDRTM2="P":"PEAK",LRDRTM2="T":"TROUGH",1:LRDRTM2)
38 I $L(LRSIC1) W !,?20,"SIT " W:$L(LRDRTM1) "(",LRDRTM1,")" W ": ",LRSIC1
39 I $L(LRSBC1) W !,?20,"SBT " W:$L(LRDRTM1) "(",LRDRTM1,")" W ": ",LRSBC1
40 I $L(LRSIC2) W !,?20,"SIT " W:$L(LRDRTM2) "(",LRDRTM2,")" W ": ",LRSIC2
41 I $L(LRSBC2) W !,?20,"SBT " W:$L(LRDRTM2) "(",LRDRTM2,")" W ": ",LRSBC2
42 Q
43MIC W !,?18,"Antibiotic" S B=0 F I=0:0 S B=+$O(^LR(LRDFN,"MI",LRIDT,3,LRBUG,3,B)) Q:B<1 I $L($P(^(B,0),U,2,3))>1 W ?35,"MIC (ug/ml)",?50,"MBC (ug/ml)"
44 S B=0 F I=0:0 S B=+$O(^LR(LRDFN,"MI",LRIDT,3,LRBUG,3,B)) Q:B<1 W !,?18,$P(^(B,0),U),?35,$J($P(^(0),U,2),7),?50,$S($P(^(0),U,3):$J($P(^(0),U,3),7),1:"")
45 Q
46CMNT S LRPC=0 F A=0:1 S LRPC=+$O(^LR(LRDFN,"MI",LRIDT,3,LRBUG,1,LRPC)) Q:LRPC<1 W !?20 W:A=0 "Comment: " W ?29,^(LRPC,0)
47 Q
Note: See TracBrowser for help on using the repository browser.