source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRMITSPO.m@ 841

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

initial load of WorldVistAEHR

File size: 2.8 KB
RevLine 
[613]1LRMITSPO ;SLC/STAFF - MICRO TREND PROCESS ORGANISMS ;3/4/93 14:54
2 ;;5.2;LAB SERVICE;**96,116**;Sep 27, 1994
3 ; from LRMITSPE
4 ;
5 ; bacteria
6 I $D(LROTYPE("B")),+$G(^LR(LRDFN,"MI",LRIDT,1)),$O(^(3,0)) S LROTYPE="B" D
7 .S LRSUBN=0 F S LRSUBN=$O(^LR(LRDFN,"MI",LRIDT,3,LRSUBN)) Q:LRSUBN="" S LRORGN=+^(LRSUBN,0) D
8 ..; if specific organisms required and not valid quit
9 ..I $D(LRSORG),'$D(LRSORG(LROTYPE,LRORGN)) Q
10 ..S LRORGNM=$E($P($G(^LAB(61.2,+LRORGN,0)),U),1,30) I '$L(LRORGNM) S LRORGNM=LRUNK
11 ..; if antibiotic pattern required and not valid quit
12 ..I $D(LRAP) S LROK=1 D Q:'LROK
13 ...S LRDN=0 F S LRDN=$O(LRAP(LRDN)) Q:LRDN="" S LRX=$G(^LR(LRDFN,"MI",LRIDT,3,LRSUBN,LRDN)) D Q:'LROK
14 ....S LRX=$$SENS(LRDN,LRX)
15 ....I '$L(LRX) S LROK=0 Q
16 ....I LRX=LRAP(LRDN) Q
17 ....I LRX'=LRAP(LRDN) S LROK=0
18 ..K LRANTIM S LRDN=0 F S LRDN=$O(^LR(LRDFN,"MI",LRIDT,3,LRSUBN,LRDN)) Q:LRDN="" S LRX=$G(^(LRDN)) I $L(LRX) D
19 ...S LRINTERP=$$SENS(LRDN,LRX) I $L(LRINTERP) S LRANTIM(LRDN)=LRINTERP_U_LRX
20 ..S LRORGNM="("_LROTYPE_") "_LRORGNM D ^LRMITSPS
21 K LRANTIM
22 ; fungus
23 I $D(LROTYPE("F")),+$G(^LR(LRDFN,"MI",LRIDT,8)),$O(^(9,0)) S LROTYPE="F" D
24 .S LRSUBN=0 F S LRSUBN=$O(^LR(LRDFN,"MI",LRIDT,9,LRSUBN)) Q:LRSUBN<1 S LRORGN=+^(LRSUBN,0) D SETUP
25 ; mycobacteria
26 I $D(LROTYPE("M")),+$G(^LR(LRDFN,"MI",LRIDT,11)),$O(^(12,0)) S LROTYPE="M" D
27 .S LRSUBN=0 F S LRSUBN=$O(^LR(LRDFN,"MI",LRIDT,12,LRSUBN)) Q:LRSUBN<1 S LRORGN=+^(LRSUBN,0) D
28 ..K LRTB S LRDN=2 F S LRDN=$O(^LR(LRDFN,"MI",LRIDT,12,LRSUBN,LRDN)) Q:LRDN="" S LRTB(LRDN)=$P(^(LRDN),U)
29 ..D SETUP
30 K LRTB
31 ; parasite
32 I $D(LROTYPE("P")),+$G(^LR(LRDFN,"MI",LRIDT,5)),$O(^(6,0)) S LROTYPE="P" D
33 .S LRSUBN=0 F S LRSUBN=$O(^LR(LRDFN,"MI",LRIDT,6,LRSUBN)) Q:LRSUBN<1 S LRORGN=+^(LRSUBN,0) D SETUP
34 ; virus
35 I $D(LROTYPE("V")),+$G(^LR(LRDFN,"MI",LRIDT,16)),$O(^(17,0)) S LROTYPE="V" D
36 .S LRSUBN=0 F S LRSUBN=$O(^LR(LRDFN,"MI",LRIDT,17,LRSUBN)) Q:LRSUBN<1 S LRORGN=+^(LRSUBN,0) D SETUP
37 ; Expanded Search
38 I '$D(LROTYPE("B")),+$G(^LR(LRDFN,"MI",LRIDT,0)),$O(^(3,0)) D
39 .S LROTYPE=$S($D(LROTYPE("V")):"V",$D(LROTYPE("P")):"P",$D(LROTYPE("F")):"F",$D(LROTYPE("M")):"M",1:"")
40 .Q:LROTYPE=""
41 .S LRSUBN=0 F S LRSUBN=$O(^LR(LRDFN,"MI",LRIDT,3,LRSUBN)) Q:LRSUBN<1 S LRORGN=+^(LRSUBN,0) D:LROTYPE=$P(^LAB(61.2,+LRORGN,0),U,5) SETUP
42 Q
43SETUP ; if specific organisms are required, do not setup unless valid organism
44 I $D(LRSORG),'$D(LRSORG(LROTYPE,LRORGN)) Q
45 S LRORGNM=$E($P($G(^LAB(61.2,+LRORGN,0)),U),1,30) I '$L(LRORGNM) S LRORGNM=LRUNK
46 S LRORGNM="("_LROTYPE_") "_LRORGNM
47 ; setup data on isolate
48 D ^LRMITSPS
49 Q
50SENS(DRUGNODE,VALUES) ; $$(antibiotic,susceptibility) -> "S","R" or ""
51 N INTERP,RESULT
52 S INTERP=$P(VALUES,U,2),RESULT=$P(VALUES,U)
53 I '$L(INTERP),$L(RESULT) S INTERP=$G(^LAB(62.06,"AI",DRUGNODE,RESULT))
54 I '$L(INTERP) S INTERP=RESULT
55 I '$L(INTERP) Q ""
56 I $D(LRSUSS(INTERP)) Q "S"
57 I $D(LRSUSR(INTERP)) Q "R"
58 I INTERP["S" Q "S"
59 Q ""
Note: See TracBrowser for help on using the repository browser.