VistA-WorldVistAEHR/r/AUTOMATED_LAB_INSTRUMENTS-LA/LA7UTL1B.m

142 lines
6.0 KiB
Mathematica

LA7UTL1B ;HOIFO/BH - Microbilogy Antibiotics & and Output global arragment ; 3/11/03 10:45am
;;5.2;AUTOMATED LAB INSTRUMENTS;**69**;Sep 27, 1994
;
; Pass back field name of Organism Antibiotic field. If the Antibiotic
; field node is lonnger than six characters it is site specific and
; is not returned.
;
DECODE(VAL) ;
N STR,MVAL,M1VAL
S STR=""
I $E(VAL,1,4)'="2.00" Q ""
I 'VAL Q ""
I $L(VAL)>6 Q ""
S VAL=$P(VAL,".",2)
I $L(VAL)=3 D
. S MVAL=+VAL
. S STR=$P($T(MCODE+MVAL),";;",2)
I $L(VAL)=4 D
. S M1VAL=+VAL
. S STR=$P($T(MCODE1+M1VAL),";;",2)
Q STR
;
MCODE ;
;;2.001^50~CEFAZOLIN^50.1~CEFAZOLIN INTERP^50.2~CEFAZOLIN SCREEN
;;2.002^145~PIPERACILLIN^145.1~PIPERACILLIN INTERP^145.2~PIPERACILLIN SCREEN
;;2.003^150~OXACILLIN^150.1~OXACILLIN INTERP^150.2~OXACILLIN SCREEN
;;2.004^160~TRIMETHOPRIM^160.1~TRIMETHOPRIM INTERP^160.2~TRIMETHOPRIM SCREEN
;
;
MCODE1 ;
;;2.0001^5~NEOMYCIN^5.1~NEOMYCIN INTERP^5.2~NEOMYCIN SCREEN
;;2.0002^10~BACITRACIN^10.1~BACITRACIN INTERP^10.2~BACITRACIN SCREEN
;;2.0003^15~PENICILLIN^15.1~PENICILLIN INTERP^15.2~PENICILLIN SCREEN
;;2.0004^20~CLINDAMYCIN^20.1~CLINDAMYCIN INTERP^20.2~CLINDAMYCIN SCREEN
;;2.0005^25~METHICILLIN^25.1~METHICILLIN INTERP^25.2~METHICILLIN SCREEN
;;2.0006^30~VANCOMYCIN^30.1~VANCOMYCIN INTERP^30.2~VANCOMYCIN SCREEN
;;2.0007^35~GENTAMICIN^35.1~GENTAMICIN INTERP^35.2~GENTAMICIN SCREEN
;;2.0008^40~CHLORAMPHENICOL^40.1~CHLORAMPHENICOL INTERP^40.2~CHLORAMPHENICOL SCREEN
;;2.0009^45~KANAMYCIN^45.1~KANAMYCIN INTERP^45.2~KANAMYCIN SCREEN
;;
;;2.0011^55~TETRACYCLINE^55.1~TETRACYCLINE INTERP^55.2~TETRACYCLINE SCREEN
;;2.0012^60~AMPICILLIN^60.1~AMPICILLIN INTERP^60.2~AMPICILLIN SCREEN
;;2.0013^65~CARBENICILLIN^65.1~CARBENICILLIN INTERP^65.2~CARBENICILLIN SCREEN
;;2.0014^70~TOBRAMYCIN^70.1~TOBRAMYCIN INTERP^70.2~TOBRAMYCIN SCREEN
;;2.0015^75~TRIMETHAPRIM/SULFAMETHOXAZOLE^75.1~TRIMETHAPRIM/SULFA INTERP^75.2~TRIMETHAPRIM/SULFA SCREEN
;;2.0016^80~AMIKACIN^80.1~AMIKACIN INTERP^80.2~AMIKACIN SCREEN
;;2.0017^85~CEFAMANDOLE^85.1~CEFAMANDOLE INTERP^85.2~CEFAMANDOLE SCREEN
;;2.0018^90~CEFOXITIN^90.1~CEFOXITIN INTERP^90.2~CEFOXITIN SCREEN
;;2.0019^110~ERYTHROMYCIN^110.1~ERYTHROMYCIN INTERP^110.2~ERYTHROMYCIN SCREEN
;;
;;2.0021^95~CEFOTAXIME^95.1~CEFOTAXIME INTERP^95.2~CEFOTAXIME SCREEN
;;2.0022^100~NITROFURANTOIN^100.1~NITROFURANTOIN NTERP^100.2~NITROFURANTOIN SCREEN
;;2.0023^105~POLYMYXIN B^105.1~POLYMYXIN B INTERP^105.2~POLYMYXIN B SCREEN
;;2.0024^115~RIFAMPIN^115.1~RIFAMPIN INTERP^115.2~RIFAMPIN SCREEN
;;2.0025^120~NOVOBIOCIN^120.1~NOVOBIOCIN INTERP^120.2~NOVOBIOCIN SCREEN
;;2.0026^125~CEFOPERAZONE^125.1~CEFOPERAZONE INTERP^125.2~CEFOPERAZONE SCREEN
;;2.0027^130~MEZLOCILLIN^130.1~MEZLOCILLIN INTERP^130.2~MEZLOCILLIN SCREEN
;;2.0028^135~MOXALACTAM^135.1~MOXALACTAM INTERP^135.2~MOXALACTAM SCREEN
;;2.0029^140~NETILMICIN^140.1~NETILMICIN INTERP^140.2~NETILMICIN SCREEN
;;
;;2.0031^151~SULFISOXAZOLE^151.1~SULFISOXAZOLE INTERP^151.2~SULFISOXAZOLE SCREEN
;;2.0032^152~NAFCILLIN^152.1~NAFCILLIN INTERP^152.2~NAFCILLIN SCREEN
;;2.0033^153~NALIDIXIC ACID^153.1~NALIDIXIC ACID INTERP^153.2~NALIDIXIC ACID SCREEN
;;2.0034^154~CEPHALOTHIN^154.1~CEPHALOTHIN INTERP^154.2~CEPHALOTHIN SCREEN
;;2.0035^155~COLISTIN^155.1~COLISTIN INTERP^155.2~COLISTIN SCREEN
;;2.0036^156~METRONIDAZOLE^156.1~METRONIDAZOLE INTERP^156.2~METRONIDAZOLE SCREEN
;;2.0037^157~CEFUROXIME^157.1~CEFUROXIME INTERP^157.2~CEFUROXIME SCREEN
;;2.0038^158~CEFTIZOXIME^158.1~CEFTIZOXIME INTERP^158.2~CEFTIZOXIME SCREEN
;;2.0039^159~SPECTINOMYCIN^159.1~SPECTINOMYCIN INTERP^159.2~SPECTINOMYCIN SCREEN
Q
;
;Pass back field name of Mycobacterium Antibiotic field. If the
; Antibiotic field node is lonnger than six characters it is site
; specific and is not returned.
;
DECODEMB(VAL) ; ---Decode Mycobacterium antibiotics
;
N STR,MVAL,M1VAL
S STR=""
I $E(VAL,1,4)'="2.00" Q ""
I 'VAL Q ""
I $L(VAL)>6 Q ""
S VAL=$P(VAL,".",2)
I VAL="001" D
. S STR="2.001^50~PYRAZINAMIDE"
I $L(VAL)=4 D
. S M1VAL=+VAL
. S STR=$P($T(MBCODE+M1VAL),";;",2)
Q STR
;
MBCODE ;
;;2.0001^5~STR
;;2.0002^10~PAS
;;2.0003^15~INH
;;2.0004^20~ETH
;;2.0005^25~RIF
;;2.0006^30~KANAMYCIN
;;2.0007^35~CAPREOMYCIN
;;2.0008^40~CYCLOSERINE
;;2.0009^45~ETHIONAMIDE
;;
;;2.0011^55~MIOMYCIN
Q
;
;
;
ARRANGE(LAARRAY,LAARRET) ; Re-set the global to the passed in reference and re-arrage for easier processing.
;
F LASET="63.05","63.29","63.3","63.31","63.32","63.33","63.34","63.35","63.351","63.36","63.37","63.372","63.39","63.4","63.43","63.341","63.291","63.371","63.44" D
. S LACD=""
. F S LACD=$O(@LAARRAY@(LASET,LACD)) Q:LACD="" D
. . S LACDFLD=""
. . F S LACDFLD=$O(@LAARRAY@(LASET,LACD,LACDFLD)) Q:LACDFLD="" D
. . . S LACDTYP=""
. . . F S LACDTYP=$O(@LAARRAY@(LASET,LACD,LACDFLD,LACDTYP)) Q:LACDTYP="" D
. . . . S LADATA=@LAARRAY@(LASET,LACD,LACDFLD,LACDTYP)
. . . . ;
. . . . I LASET="63.05" D Q
. . . . . S @LAARRET@($P(LACD,",",2),$P(LACD,",",1),"0",LACDFLD,LACDTYP)=LADATA Q
. . . . ;
. . . . I LASET="63.351" D Q
. . . . . S @LAARRET@($P(LACD,",",5),$P(LACD,",",4),"6",$P(LACD,",",3),"1",$P(LACD,",",2),"1",$P(LACD,",",1),"0",LACDFLD,LACDTYP)=LADATA Q
. . . . ;
. . . . I LASET="63.32" D Q
. . . . . S @LAARRET@($P(LACD,",",4),$P(LACD,",",3),3,$P(LACD,",",2),3,$P(LACD,",",1),"0",LACDFLD,LACDTYP)=LADATA Q
. . . . ;
. . . . I LASET="63.31"!(LASET="63.35")!(LASET="63.372")!(LASET="63.4") D Q
. . . . . S LASUB=$S(LASET="63.31":"3",LASET="63.35":"6",LASET="63.372":"9",LASET="63.4":"12",1:"")
. . . . . I LASUB="" Q
. . . . . S @LAARRET@($P(LACD,",",4),$P(LACD,",",3),LASUB,$P(LACD,",",2),"1",$P(LACD,",",1),"0",LACDFLD,LACDTYP)=LADATA Q
. . . . ;
. . . . S LASUB=$S(LASET="63.29":"2",LASET="63.3":"3",LASET="63.33":"4",LASET="63.34":"6",LASET="63.36":"7",LASET="63.37":"9",1:"")
. . . . I LASUB="" S LASUB=$S(LASET="63.39":"12",LASET="63.43":"17",LASET="63.341":"24",LASET="63.291":"25",LASET="63.371":"15",LASET="63.44":"18",1:"")
. . . . I LASUB="" Q
. . . . S @LAARRET@($P(LACD,",",3),$P(LACD,",",2),LASUB,$P(LACD,",",1),0,LACDFLD,LACDTYP)=LADATA
;
; - Kill local array
K @LAARRAY
Q
;
;