PSODGAL3 ; BIR/LC,SAB,CMF - enhanced DRUG ALLERGY REACTION CHECKING continued ;12/09/07 02:22
;;7.0;OUTPATIENT PHARMACY;**411,458**;DEC 1997;Build 2
;External reference to ^XTMP("ORRDI" supported by DBIA 4659
;
SORTN ;
N STYP,INGLOC,ZALL,ZLOC,ZCDATE,PSOSYM,PSOCDATE,PSOCA2,INGREDS,PSOREACT,PSOSDATA,SEVT,PSOAFLG,INGRED,PSOACNT,PSOAFEND
N INGREDS,INGREDZ,ZXX,PSOSSITE,PSOSARRY,SETTMP,PSOLOC,ZCNT,ZING,ZMSG,PSOATYPE,PSODGCLS,PSODGCL,PSODGCL1 K ZGMRA
S ZCNT=0
;
I $G(PSOTSTMD) D TSTREM
;
K PSOSORT,PSOSEV,PSOSEVP,PSOSTYP,PSOCAGNT,PSOCA
S (ZALL,ZING,ZMSG,PSOSYMS)=""
;DRUG INGREDIENTS
F S ZMSG=$O(GMRARSLT(ZMSG)) Q:ZMSG="" D
.S ZALL=$$GMSGPTR^PSODGAL1(ZMSG)
.Q:ZALL=""
.S PSODRCL=0
.S PSOATYPE=2
.S:$D(GMRARSLT(ZMSG,"MESSAGE","OFFENDERS","CLS")) PSODRCL=1,PSOATYPE=1
.D SORTM
.Q
D TMP
Q
;
SORTM ;
N SITEARY,PSOONEA,ZSITES,ZSITE,ZYALL
S (PSOSEV,PSOSEVT,PSOSTYP,PSOLOC,PSOSYM,INGREDS,PSOREACT,INGLOC,PSOSDATA,PSOSSITE,PSOSITT)=""
S PSOSSITE=$P(GMRARSLT(ZMSG,ZALL),U)
S PSOLOC=PSOSSITE_"|"_$P(GMRARSLT(ZMSG,ZALL),U)
S PSOSEV=$$GETSEV(PSOSSITE,ZMSG,.GMRARSLT)
S PSOSEVT=$S(PSOSEV="SEVERE":1,PSOSEV="MODERATE":2,PSOSEV="MILD":3,1:99)
S PSOSEVP=PSOSEV
S PSOSTYP=PSOSEVT
S:PSOSEVT=1 PSOSEVT1("S")=1
S ZSITES=GMRARSLT(ZMSG,"MESSAGE",1)
S PSOSDATA=""
S ZYALL=""
F ZSITE=1:1:ZSITES D
.S ZYALL=$$GMSGPTR^PSODGAL1(ZMSG,ZYALL)
.S INGLOC=$S($P(GMRARSLT(ZMSG,ZYALL),U,2)="L":"L",1:"R")
.S PSOCDATE=$P($P(GMRARSLT(ZMSG,ZYALL),U,3),".")
.S PSOCDATE=$E(PSOCDATE,4,5)_"/"_$E(PSOCDATE,6,7)_"/"_$E(PSOCDATE,2,3)
.S PSOSYM=$P(GMRARSLT(ZMSG,ZYALL),U,5)
.S PSOREACT=$P(GMRARSLT(ZMSG,"MESSAGE",2),U,2)
.S PSOSITT=$P(GMRARSLT(ZMSG,ZYALL),U)
.S PSOSDATA=ZMSG_"|"_PSOCDATE_"|"_INGLOC_"|"_PSOSITT
.;S PSOSDATA=PSOSDATA_$S(ZSITE=1:"",1:U)_ZMSG_"|"_PSOCDATE_"|"_INGLOC_"|"_PSOSITT
.S SITEARY=""
.S SITEARY=INGLOC_"|"_$E(PSOSSITE,1,16)_"|"_PSOSITT_"|"_$S($D(^DIC(4,PSOSITT)):PSOSITT,1:"")
.S PSOSARRY(PSOSTYP,SITEARY,PSOATYPE,PSOREACT,ZMSG)=$S(PSOATYPE=1:PSOREACT,1:"")
.;
.D:$D(PSOCAGNT(PSOSTYP,PSOREACT,PSOATYPE))
..S (OLDDATA,PSOCA)=""
..S OLDDATA=PSOCAGNT(PSOSTYP,PSOREACT,PSOATYPE)
..D:OLDDATA'[PSOSDATA
...S PSOCA=PSOCAGNT(PSOSTYP,PSOREACT,PSOATYPE)_"^"_PSOSDATA
...S PSOCAGNT(PSOSTYP,PSOREACT,PSOATYPE)=PSOCA
.D:'$D(PSOCAGNT(PSOSTYP,PSOREACT,PSOATYPE))
..S PSOCAGNT(PSOSTYP,PSOREACT,PSOATYPE)=PSOSDATA
.D SYM
.;
.F INGREDZ="CLS","ING" D
..S (INGRED,INGREDS)="",INGREDS=$G(GMRARSLT(ZMSG,"MESSAGE","OFFENDERS",INGREDZ))
..N III F III=1:1 S INGRED=$P(INGREDS,"~",III) Q:INGRED="" D
...S PSOCAGNT(PSOSTYP,PSOREACT,PSOATYPE,INGRED)=""
...Q:INGREDZ="ING"
...I $G(PSODRCL) S PSODRCL1(PSOSTYP,PSOREACT,PSOATYPE,INGRED)="" K PSOCAGNT(PSOSTYP,PSOREACT,PSOATYPE,INGRED)
Q
;
SYM ;
I PSOSYM'["~"&(PSOSYM'="")&(PSOSYM'="|") D Q
.S PSOSYM("Name")=$$GETSYMNM(ZYALL,PSOSYM,1)
.Q:PSOSYM("Name")=""
.S PSOSYMS(PSOSTYP,PSOREACT,PSOATYPE,"ZZZSYMPTOMS",PSOSYM("Name"))=PSOSYM
.S PSOSARRY(PSOSTYP,SITEARY,PSOATYPE,PSOREACT,ZMSG,"ZZZSYMPTOMS",PSOSYM("Name"))=PSOSYM
Q:PSOSYM="|"
N PSOQX,PSOY
I $E(PSOSYM,1)="~" S PSOSYM=$E(PSOSYM,2,9999)
F PSOQX=1:1:$L(PSOSYM,"~") D
.S PSOY=$P(PSOSYM,"~",PSOQX)
.Q:PSOY=""
.S PSOSYM("Name")=$$GETSYMNM(ZYALL,PSOY,PSOQX)
.Q:PSOSYM("Name")=""
.S PSOSYMS(PSOSTYP,PSOREACT,PSOATYPE,"ZZZSYMPTOMS",PSOSYM("Name"))=PSOY
.S PSOSARRY(PSOSTYP,SITEARY,PSOATYPE,PSOREACT,ZMSG,"ZZZSYMPTOMS",PSOSYM("Name"))=PSOY
Q
;
TMP ;
;PSOPAIEN - IEN TO PATIENT ALLERGY FILE 120.8
N PSOSEVER,OLDDATA,PSOLCLAC,PSOPAIEN,TYPE,SITENM,PSOLCLAS,PSOLOCAL,PSOREACT,ZCNT2,DACNT,LOCREM,PSOATYP
N PSOINSTL,PSOSTA,PSOHIS,PSOHISI,PSOASEV,PSOSEVI,PSOSEVT,PSOSTYP,PSOSTYPI,PSOMEDL,PSODGCL,PSOLOCI,SITE
N PSOREACT,ZMSG
S (TYPE,SITENM,PSOPAIEN,ZALL,PSOSYM,PSOLCLAC,PSOATYP,PSOSEVER,PSOATYPE,PSOREACT)="",(ZCNT2,DACNT)=0
F S PSOSEVER=$O(PSOSARRY(PSOSEVER)) Q:PSOSEVER="" S TYPE="" F S TYPE=$O(PSOSARRY(PSOSEVER,TYPE)) Q:TYPE="" D
.S PSOATYPE=""
.F S PSOATYPE=$O(PSOSARRY(PSOSEVER,TYPE,PSOATYPE)) Q:PSOATYPE="" S PSOREACT="" F S PSOREACT=$O(PSOSARRY(PSOSEVER,TYPE,PSOATYPE,PSOREACT)) Q:PSOREACT="" D
..S ZMSG=""
..S ZMSG=$O(PSOSARRY(PSOSEVER,TYPE,PSOATYPE,PSOREACT,ZMSG))
..Q:ZMSG=""
..S PSOPAIEN=$$GMSGPTR^PSODGAL1(ZMSG) Q:PSOPAIEN="" D
...S (PSODRCL,ZALL,SITE,SITENM,LOCREM)=""
...S SITE=$P(TYPE,"|",3),LOCREM=$P(TYPE,"|"),SITENM=$P(TYPE,"|",2)
...S ZALL=GMRARSLT(ZMSG,PSOPAIEN)
...I PSOATYPE=2 S PSOATYP=2
...I PSOATYPE=1 S PSOATYP=1,PSODRCL=1
...Q:ZALL=""
...D TMPSET
Q
;
TMPSET ;
S DACNT=DACNT+1 N II,III,PTR,DATEI K SETTMP
S PSOHISI=$P(ZALL,U,8)
S PSOSEVI=$$GETSEVI(ZALL)
S PSODGCL="",PSOLOCAL=$P(ZALL,"^",3),PSOLOCI=$P($P(ZALL,"^",3),"|",2)
S DATEI=$P(ZALL,U,3)
S PTR=$P(ZALL,U,7)
;ZERO NODE OF DRUG ALLERGY MULTIPLE
S SETTMP(DACNT,0)=$E(PSOREACT,1,64)_U_PTR_U_LOCREM_U_SITE
S SETTMP(DACNT,0)=SETTMP(DACNT,0)_U_DATEI_U_$$UPPER(PSOHISI)_U_PSOSEVI
S ^TMP("PSODAOC",$J,"ALLERGY",PSJALGCT,4,DACNT,0)=SETTMP(DACNT,0)
;DRUG CLASS
I PSOATYP'=1 D
.S PSODGCL=$G(GMRARSLT(ZMSG,PSOPAIEN,"CLS"))
.I $E(PSODGCL,1)="~" S PSODGCL=$E(PSODGCL,2,999)
I PSOATYP=1 D
.S PSODGCLS=$G(GMRARSLT(ZMSG,PSOPAIEN,"CLS"))
.I $E(PSODGCLS,1)="~" S PSODGCLS=$E(PSODGCLS,2,999)
.S PSODGCL=""
.N II
.F II=1:1 S PSODGCL=$P(PSODGCLS,"~",II) Q:PSODGCL="" D
..S ^TMP("PSODAOC",$J,"ALLERGY",PSJALGCT,4,DACNT,1,II,0)=PSODGCL
..Q
;DRUG INGREDIENT
D:$D(GMRARSLT(ZMSG,PSOPAIEN,"ING"))
.S INGREDS=GMRARSLT(ZMSG,PSOPAIEN,"ING")
.I $E(INGREDS,1)="~" S INGREDS=$E(INGREDS,2,999)
.N II
.F II=1:1 S INGRED=$P(INGREDS,"~",II) Q:INGRED="" D
..S ^TMP("PSODAOC",$J,"ALLERGY",PSJALGCT,4,DACNT,2,II,0)=INGRED
..Q
;SIGN/SYMPTOM
N PSOSYMN,SYMCNT S SYMCNT=0,PSOSYMN=""
F S PSOSYMN=$O(PSOSARRY(PSOSEVER,TYPE,PSOATYPE,PSOREACT,ZMSG,"ZZZSYMPTOMS",PSOSYMN)) Q:PSOSYMN="" D
.S SYMCNT=SYMCNT+1
.S ^TMP("PSODAOC",$J,"ALLERGY",PSJALGCT,4,DACNT,3,SYMCNT,0)=PSOSARRY(PSOSEVER,TYPE,PSOATYPE,PSOREACT,ZMSG,"ZZZSYMPTOMS",PSOSYMN)
;DISPENSE DRUG
S ^TMP("PSODAOC",$J,"ALLERGY",PSJALGCT,"ALLERGY DD",5,1,0)=$S(PSOATYP=1!(PSOATYP=2):$G(PSODRUG("IEN")),PSOATYP=3:$P(ZALL,"^",2),1:"")
S ^TMP("PSODAOC",$J,"ALLERGY",PSJALGCT,"ALLERGY PKG")=$S($G(PSJAOC):"IP",1:"OP")
S ^TMP("PSODAOC",$J,"ALLERGY","PROVR")=""
END ;
Q
;
GETSEV(PSOSSITE,ZMSG,GMRARSLT) ; return external highest severity for possible local multiple
N RESULT,ARRAY,I,SEV
S RESULT=""
Q:'$D(GMRARSLT) RESULT
Q:'$D(PSOSSITE) RESULT
Q:'$D(GMRARSLT(ZMSG)) RESULT
S I=0
F S I=$O(GMRARSLT(ZMSG,"MESSAGE",1,PSOSSITE,1,I)) Q:'I D
.S SEV=$P($G(GMRARSLT(ZMSG,"MESSAGE",1,PSOSSITE,1,I)),U,2)
.S ARRAY($S(SEV="SEVERE":1,SEV="MODERATE":2,SEV="MILD":3,1:99))=SEV
.Q
I $D(ARRAY) S I=$O(ARRAY("")),RESULT=ARRAY(I)
Q RESULT
;;
GETSEVI(ZALL) ; return internal highest severity for possible local multiple
N RESULT,ARRAY,I,J,K,SEV
S RESULT=""
S SEV=$P($G(ZALL),U,4)
I $E(SEV,1)="~" S SEV=$E(SEV,2,999)
Q:SEV="" RESULT
F I=1:1 S J=$P(SEV,"~",I) Q:J="" D
.S K=$P(J,"|",2)
.S:K'="" ARRAY(K)=J
.Q
I $D(ARRAY) S I=$O(ARRAY(""),-1),RESULT=I
Q RESULT
;;
GETSYMNM(ZYALL,SYMIEN,SYMINC) ; getSymptomName(allergyResultIEN,symptomIEN,symptomIncrement)
N RESULT
S RESULT=""
Q:$G(ZYALL)="" RESULT
Q:$G(SYMIEN)="" RESULT
Q:$G(SYMINC)="" RESULT
Q:+SYMIEN'=30 $$GET1^DIQ(120.83,SYMIEN,.01)
I +ZYALL=0 D Q RESULT
.;look at ^xtmp("orrdi","art" here for remote data 'OTHER REACTION' text
.N ORRDIEN
.S ORRDIEN=$P(ZYALL,"R",2)
.Q:ORRDIEN=""
.S:+$G(DFN) RESULT=$P($G(^XTMP("ORRDI","ART",DFN,ORRDIEN,"SIGNS/SYMPTOMS",SYMINC)),U,2)
.Q
I +ZYALL>0 D Q RESULT
.;call GMRADPT here, look at GMRAL for local data 'OTHER REACTION' text
.N GMRAL
.D ^GMRADPT
.S RESULT=$P($G(GMRAL(ZYALL,"S",SYMINC)),";")
.K GMRAL
Q RESULT
;
UPPER(PSOUCS) ;
Q $TR(PSOUCS,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
;
TSTREM ;For remote developer testing
;1. complex mix of local/remote results: set a break at SORTN^PSODGAL3, results will not match the order but will be the complex dummy for all, at the break set S PSOTSTMD=1, type G for Go.
;2. Multiple Ingredient allergy: set a break at SORTN^PSODGAL3, order PROPOFOL, and at the break set S PSOTSTMD=3, type G for Go.
;3. Drug class allergy: set up allergy by drug class ANTILIPEMIC AGENTS and order LIPITOR and at the break set S PSOTSTMD=2, type G for Go.
;
Q:'$G(PSOTSTMD)
I PSOTSTMD=1 G BIGARRAY
I PSOTSTMD=2 G DRGCLASS
I PSOTSTMD=3 G MULTI
;
SINGLE ;Test Remote with a single ingredient
;ICR: IEN NAME 1 2 3 4 5 6 7 8 9 10 11
;PIECE: 1 2 3 4 5 6 7 8 9 10 11 12 13
S GMRAING("R1")="GUAIFENESIN|744^MARTINSBURG VAMC|613^REMOTE|R^Jun 20, 2013@15:52|3130620.1552^SEVERE|3^DROWSINESS|66~HIVES|1~ANXIETY|39^GUAIFENESIN^GUAIFENESIN|1671;PSNDF(50.6,^HISTORICAL|h^VISTA|V"
S GMRAING("R2")="GUAIFENESIN|744^HEARTLAND WEST VAMC|589^REMOTE|R^Aug 28, 2012@11:52|3120828.1552^SEVERE|3^DROWSINESS|66~HIVES|1^GUAIFENESIN^GUAIFENESIN|1671;PSNDF(50.6,^HISTORICAL|h^VISTA|V"
S GMRAING("R3")="GUAIFENESIN|744^NEW ORLEANS, LA.|629^REMOTE|R^Oct 25, 2013@09:54|3131025.0954^MODERATE|2^DROWSINESS|66~HIVES|1^GUAIFENESIN^GUAIFENESIN|1671;PSNDF(50.6,^HISTORICAL|h^VISTA|V"
S GMRAING("R4")="GUAIFENESIN|744^NEW YORK, NY|630^REMOTE|R^Apr 9, 2013@15:43|3130409.1143^MILD|1^DROWSINESS|66~HIVES|1^GUAIFENESIN^GUAIFENESIN|1671;PSNDF(50.6,^HISTORICAL|h^VISTA|V"
Q
;
MULTI ;Test Remote with multiple ingredients
S GMRAING("R7")="SODIUM METABISULFITE|69~PROPOFOL|2114~EGG|2361~SOYBEAN|3156~PEANUT|4048^HEARTLAND WEST VAMC|589^REMOTE|R^Oct 25, 2013@09:52|3131025.0952^SEVERVE|3^ANXIETY|39^PROPOFOL^PROPOFOL|2145;PSNDF(50.6,^OBSERVED|o^VISTA|V"
S GMRAING("R8")="SODIUM METABISULFITE|69~PROPOFOL|2114~EGG|2361~SOYBEAN|3156~PEANUT|4048^MARTINSBURG VAMC|613^REMOTE|R^SEP 30, 2013@01:52|3130930.1352^SEVERVE|3^ANXIETY|39^PROPOFOL^PROPOFOL|2145;PSNDF(50.6,^OBSERVED|o^VISTA|V"
S GMRAING("R10")="SODIUM METABISULFITE|69~PROPOFOL|2114~EGG|2361~SOYBEAN|3156~PEANUT|4048^NEW ORLEANS, LA.|629^REMOTE|R^Aug 15, 2013@11:52|3130515.1152^MODERATE|2^ANXIETY|39^PROPOFOL^PROPOFOL|2145;PSNDF(50.6,^OBSERVED|o^VISTA|V"
S GMRAING("R11")="SODIUM METABISULFITE|69~PROPOFOL|2114~EGG|2361~SOYBEAN|3156~PEANUT|4048^NEW YORK, NY|630^REMOTE|R^Aug 15, 2013@11:52|3130515.1152^MILD|1^ANXIETY|39^PROPOFOL^PROPOFOL|2145;PSNDF(50.6,^OBSERVED|o^VISTA|V"
S GMRAING("R12")="SODIUM METABISULFITE|69~PROPOFOL|2114~EGG|2361~SOYBEAN|3156~PEANUT|4048^MARTINSBURG VAMC|613^REMOTE|R^DEC 15, 2013@12:52|3131215.1252^MILD|1^ANXIETY|39^PROPOFOL^PROPOFOL|2145;PSNDF(50.6,OBSERVED|o^VISTA|V"
Q
;
DRGCLASS ;Test Remote Interaction by drug class
K GMRAING,GMRADRCL,GMRAREAC
S GMRADRCL("R1")="ANTILIPEMIC AGENTS|58^HEARTLAND WEST VAMC|589^REMOTE|R^Jan 28, 2014@10:56|3140128.1056^SEVERE|3^DIARRHEA|9~DROWSINESS|66~DRY NOSE|69^ANTILIPEMIC AGENTS^ANTILIPEMIC AGENTS|58;PS(50.605,^OBSERVED|o^VISTA|V"
S GMRADRCL("R2")="ANTILIPEMIC AGENTS|58^MARTINSBURG VAMC|613^REMOTE|R^Jan 15, 2014@09:56|3140115.0956^SEVERE|3^DIARRHEA|9~DROWSINESS|66~DRY NOSE|69^ANTILIPEMIC AGENTS^ANTILIPEMIC AGENTS|58;PS(50.605,^OBSERVED|o^VISTA|V"
Q
;
BIGARRAY ;dummy big array with complex local/remote combinations. Will not match drugs passed in
K GMRARSLT
S GMRARSLT=7
S GMRARSLT(1,106534)="10881^L^3150528.1606^^^AMPICILLIN^79;PSNDF(50.6,^h^V"
S GMRARSLT(1,106534,"CLS")=249
S GMRARSLT(1,"MESSAGE",1)=1
S GMRARSLT(1,"MESSAGE",1,10881)="CLE13 TEST LAB^LOCAL^MAY 28, 2015@16:06^HISTORICAL"
S GMRARSLT(1,"MESSAGE",2)="^AMPICILLIN^AMPICILLIN"
S GMRARSLT(1,"MESSAGE","OFFENDERS","CLS")="AM111 PENICILLINS,AMINO DERIVATIVES"
S GMRARSLT(2,106535)="10881^L^3150528.1607^^^MEROPENEM^3391;PSNDF(50.6,^h^V"
S GMRARSLT(2,106535,"CLS")=335
S GMRARSLT(2,"MESSAGE",1)=2
S GMRARSLT(2,"MESSAGE",1,10881)="CLE13 TEST LAB^LOCAL^MAY 28, 2015@16:07^HISTORICAL"
S GMRARSLT(2,"MESSAGE",1,10882)="CHEYENNE HDR SQA^REMOTE^MAY 28, 2015@16:02^HISTORICAL"
S GMRARSLT(2,"MESSAGE",2)="^MEROPENEM^MEROPENEM"
S GMRARSLT(2,"MESSAGE","OFFENDERS","CLS")="AM119 BETA-LACTAMS ANTIMICROBIALS,OTHER"
S GMRARSLT(2,"R9")="10882^R^3150528.1602^^^MEROPENEM^3391;PSNDF(50.6,^h^V"
S GMRARSLT(2,"R9","CLS")=335
S GMRARSLT(3,"MESSAGE",1)=1
S GMRARSLT(3,"MESSAGE",1,10882)="CHEYENNE HDR SQA^REMOTE^MAY 28, 2015@16:03^OBSERVED"
S GMRARSLT(3,"MESSAGE",2)="RASH^CEPHALEXIN^CEPHALEXIN"
S GMRARSLT(3,"MESSAGE","OFFENDERS","CLS")="AM115 CEPHALOSPORIN 1ST GENERATION"
S GMRARSLT(3,"R11")="10882^R^3150528.1603^^133^CEPHALEXIN^1290;PSNDF(50.6,^o^V"
S GMRARSLT(3,"R11","CLS")=12
S GMRARSLT(4,"MESSAGE",1)=1
S GMRARSLT(4,"MESSAGE",1,613)="MARTINSBURG VAMC^REMOTE^MAY 28, 2015@15:46^OBSERVED"
S GMRARSLT(4,"MESSAGE",2)="ANAPHYLAXIS and DYSPNEA^CEFAZOLIN^CEFAZOLIN"
S GMRARSLT(4,"MESSAGE","OFFENDERS","CLS")="AM115 CEPHALOSPORIN 1ST GENERATION"
S GMRARSLT(4,"MESSAGE","OFFENDERS","ING")="CEFAZOLIN"
S GMRARSLT(4,"R13")="613^R^3150528.1546^^5~70^CEFAZOLIN^30;PSNDF(50.6,^o^V"
S GMRARSLT(4,"R13","CLS")=12
S GMRARSLT(4,"R13","ING")=2278
S GMRARSLT(5,"MESSAGE",1)=1
S GMRARSLT(5,"MESSAGE",1,10882)="CHEYENNE HDR SQA^REMOTE^MAY 28, 2015@16:01^HISTORICAL"
S GMRARSLT(5,"MESSAGE",2)="ITCHING OF EYE and WHEEZING^PENICILLIN^PENICILLIN"
S GMRARSLT(5,"MESSAGE","OFFENDERS","CLS")="AM110 PENICILLIN-G RELATED PENICILLINS"
S GMRARSLT(5,"R2")="10882^R^3150528.1601^^20~311^PENICILLIN^16;PSNDF(50.6,^h^V"
S GMRARSLT(5,"R2","CLS")=248
S GMRARSLT(6,"MESSAGE",1)=1
S GMRARSLT(6,"MESSAGE",1,613)="MARTINSBURG VAMC^REMOTE^MAY 28, 2015@15:50^OBSERVED"
S GMRARSLT(6,"MESSAGE",2)="ANAPHYLAXIS^PENICILLIN^PENICILLIN"
S GMRARSLT(6,"MESSAGE","OFFENDERS","CLS")="AM110 PENICILLIN-G RELATED PENICILLINS"
S GMRARSLT(6,"R4")="613^R^3150528.155^^5~30^PENICILLIN^16;PSNDF(50.6,^o^V"
S GMRARSLT(6,"R4","CLS")=248
S ^XTMP("ORRDI","ART",DFN,4,"SIGNS/SYMPTOMS",2)="^Giggles^"
S GMRARSLT(7,"MESSAGE",1)=1
S GMRARSLT(7,"MESSAGE",1,613)="MARTINSBURG VAMC^REMOTE^MAY 28, 2015@15:50^HISTORICAL"
S GMRARSLT(7,"MESSAGE",2)="^CEFEPIME^CEFEPIME"
S GMRARSLT(7,"MESSAGE","OFFENDERS","CLS")="AM118 CEPHALOSPORIN 4TH GENERATION"
S GMRARSLT(7,"R5")="613^R^3150528.155^^^CEFEPIME^3392;PSNDF(50.6,^h^V"
S GMRARSLT(7,"R5","CLS")=524
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSODGAL3 14573 printed Oct 16, 2024@18:27:33 Page 2
PSODGAL3 ; BIR/LC,SAB,CMF - enhanced DRUG ALLERGY REACTION CHECKING continued ;12/09/07 02:22
+1 ;;7.0;OUTPATIENT PHARMACY;**411,458**;DEC 1997;Build 2
+2 ;External reference to ^XTMP("ORRDI" supported by DBIA 4659
+3 ;
SORTN ;
+1 NEW STYP,INGLOC,ZALL,ZLOC,ZCDATE,PSOSYM,PSOCDATE,PSOCA2,INGREDS,PSOREACT,PSOSDATA,SEVT,PSOAFLG,INGRED,PSOACNT,PSOAFEND
+2 NEW INGREDS,INGREDZ,ZXX,PSOSSITE,PSOSARRY,SETTMP,PSOLOC,ZCNT,ZING,ZMSG,PSOATYPE,PSODGCLS,PSODGCL,PSODGCL1
KILL ZGMRA
+3 SET ZCNT=0
+4 ;
+5 IF $GET(PSOTSTMD)
DO TSTREM
+6 ;
+7 KILL PSOSORT,PSOSEV,PSOSEVP,PSOSTYP,PSOCAGNT,PSOCA
+8 SET (ZALL,ZING,ZMSG,PSOSYMS)=""
+9 ;DRUG INGREDIENTS
+10 FOR
SET ZMSG=$ORDER(GMRARSLT(ZMSG))
if ZMSG=""
QUIT
Begin DoDot:1
+11 SET ZALL=$$GMSGPTR^PSODGAL1(ZMSG)
+12 if ZALL=""
QUIT
+13 SET PSODRCL=0
+14 SET PSOATYPE=2
+15 if $DATA(GMRARSLT(ZMSG,"MESSAGE","OFFENDERS","CLS"))
SET PSODRCL=1
SET PSOATYPE=1
+16 DO SORTM
+17 QUIT
End DoDot:1
+18 DO TMP
+19 QUIT
+20 ;
SORTM ;
+1 NEW SITEARY,PSOONEA,ZSITES,ZSITE,ZYALL
+2 SET (PSOSEV,PSOSEVT,PSOSTYP,PSOLOC,PSOSYM,INGREDS,PSOREACT,INGLOC,PSOSDATA,PSOSSITE,PSOSITT)=""
+3 SET PSOSSITE=$PIECE(GMRARSLT(ZMSG,ZALL),U)
+4 SET PSOLOC=PSOSSITE_"|"_$PIECE(GMRARSLT(ZMSG,ZALL),U)
+5 SET PSOSEV=$$GETSEV(PSOSSITE,ZMSG,.GMRARSLT)
+6 SET PSOSEVT=$SELECT(PSOSEV="SEVERE":1,PSOSEV="MODERATE":2,PSOSEV="MILD":3,1:99)
+7 SET PSOSEVP=PSOSEV
+8 SET PSOSTYP=PSOSEVT
+9 if PSOSEVT=1
SET PSOSEVT1("S")=1
+10 SET ZSITES=GMRARSLT(ZMSG,"MESSAGE",1)
+11 SET PSOSDATA=""
+12 SET ZYALL=""
+13 FOR ZSITE=1:1:ZSITES
Begin DoDot:1
+14 SET ZYALL=$$GMSGPTR^PSODGAL1(ZMSG,ZYALL)
+15 SET INGLOC=$SELECT($PIECE(GMRARSLT(ZMSG,ZYALL),U,2)="L":"L",1:"R")
+16 SET PSOCDATE=$PIECE($PIECE(GMRARSLT(ZMSG,ZYALL),U,3),".")
+17 SET PSOCDATE=$EXTRACT(PSOCDATE,4,5)_"/"_$EXTRACT(PSOCDATE,6,7)_"/"_$EXTRACT(PSOCDATE,2,3)
+18 SET PSOSYM=$PIECE(GMRARSLT(ZMSG,ZYALL),U,5)
+19 SET PSOREACT=$PIECE(GMRARSLT(ZMSG,"MESSAGE",2),U,2)
+20 SET PSOSITT=$PIECE(GMRARSLT(ZMSG,ZYALL),U)
+21 SET PSOSDATA=ZMSG_"|"_PSOCDATE_"|"_INGLOC_"|"_PSOSITT
+22 ;S PSOSDATA=PSOSDATA_$S(ZSITE=1:"",1:U)_ZMSG_"|"_PSOCDATE_"|"_INGLOC_"|"_PSOSITT
+23 SET SITEARY=""
+24 SET SITEARY=INGLOC_"|"_$EXTRACT(PSOSSITE,1,16)_"|"_PSOSITT_"|"_$SELECT($DATA(^DIC(4,PSOSITT)):PSOSITT,1:"")
+25 SET PSOSARRY(PSOSTYP,SITEARY,PSOATYPE,PSOREACT,ZMSG)=$SELECT(PSOATYPE=1:PSOREACT,1:"")
+26 ;
+27 if $DATA(PSOCAGNT(PSOSTYP,PSOREACT,PSOATYPE))
Begin DoDot:2
+28 SET (OLDDATA,PSOCA)=""
+29 SET OLDDATA=PSOCAGNT(PSOSTYP,PSOREACT,PSOATYPE)
+30 if OLDDATA'[PSOSDATA
Begin DoDot:3
+31 SET PSOCA=PSOCAGNT(PSOSTYP,PSOREACT,PSOATYPE)_"^"_PSOSDATA
+32 SET PSOCAGNT(PSOSTYP,PSOREACT,PSOATYPE)=PSOCA
End DoDot:3
End DoDot:2
+33 if '$DATA(PSOCAGNT(PSOSTYP,PSOREACT,PSOATYPE))
Begin DoDot:2
+34 SET PSOCAGNT(PSOSTYP,PSOREACT,PSOATYPE)=PSOSDATA
End DoDot:2
+35 DO SYM
+36 ;
+37 FOR INGREDZ="CLS","ING"
Begin DoDot:2
+38 SET (INGRED,INGREDS)=""
SET INGREDS=$GET(GMRARSLT(ZMSG,"MESSAGE","OFFENDERS",INGREDZ))
+39 NEW III
FOR III=1:1
SET INGRED=$PIECE(INGREDS,"~",III)
if INGRED=""
QUIT
Begin DoDot:3
+40 SET PSOCAGNT(PSOSTYP,PSOREACT,PSOATYPE,INGRED)=""
+41 if INGREDZ="ING"
QUIT
+42 IF $GET(PSODRCL)
SET PSODRCL1(PSOSTYP,PSOREACT,PSOATYPE,INGRED)=""
KILL PSOCAGNT(PSOSTYP,PSOREACT,PSOATYPE,INGRED)
End DoDot:3
End DoDot:2
End DoDot:1
+43 QUIT
+44 ;
SYM ;
+1 IF PSOSYM'["~"&(PSOSYM'="")&(PSOSYM'="|")
Begin DoDot:1
+2 SET PSOSYM("Name")=$$GETSYMNM(ZYALL,PSOSYM,1)
+3 if PSOSYM("Name")=""
QUIT
+4 SET PSOSYMS(PSOSTYP,PSOREACT,PSOATYPE,"ZZZSYMPTOMS",PSOSYM("Name"))=PSOSYM
+5 SET PSOSARRY(PSOSTYP,SITEARY,PSOATYPE,PSOREACT,ZMSG,"ZZZSYMPTOMS",PSOSYM("Name"))=PSOSYM
End DoDot:1
QUIT
+6 if PSOSYM="|"
QUIT
+7 NEW PSOQX,PSOY
+8 IF $EXTRACT(PSOSYM,1)="~"
SET PSOSYM=$EXTRACT(PSOSYM,2,9999)
+9 FOR PSOQX=1:1:$LENGTH(PSOSYM,"~")
Begin DoDot:1
+10 SET PSOY=$PIECE(PSOSYM,"~",PSOQX)
+11 if PSOY=""
QUIT
+12 SET PSOSYM("Name")=$$GETSYMNM(ZYALL,PSOY,PSOQX)
+13 if PSOSYM("Name")=""
QUIT
+14 SET PSOSYMS(PSOSTYP,PSOREACT,PSOATYPE,"ZZZSYMPTOMS",PSOSYM("Name"))=PSOY
+15 SET PSOSARRY(PSOSTYP,SITEARY,PSOATYPE,PSOREACT,ZMSG,"ZZZSYMPTOMS",PSOSYM("Name"))=PSOY
End DoDot:1
+16 QUIT
+17 ;
TMP ;
+1 ;PSOPAIEN - IEN TO PATIENT ALLERGY FILE 120.8
+2 NEW PSOSEVER,OLDDATA,PSOLCLAC,PSOPAIEN,TYPE,SITENM,PSOLCLAS,PSOLOCAL,PSOREACT,ZCNT2,DACNT,LOCREM,PSOATYP
+3 NEW PSOINSTL,PSOSTA,PSOHIS,PSOHISI,PSOASEV,PSOSEVI,PSOSEVT,PSOSTYP,PSOSTYPI,PSOMEDL,PSODGCL,PSOLOCI,SITE
+4 NEW PSOREACT,ZMSG
+5 SET (TYPE,SITENM,PSOPAIEN,ZALL,PSOSYM,PSOLCLAC,PSOATYP,PSOSEVER,PSOATYPE,PSOREACT)=""
SET (ZCNT2,DACNT)=0
+6 FOR
SET PSOSEVER=$ORDER(PSOSARRY(PSOSEVER))
if PSOSEVER=""
QUIT
SET TYPE=""
FOR
SET TYPE=$ORDER(PSOSARRY(PSOSEVER,TYPE))
if TYPE=""
QUIT
Begin DoDot:1
+7 SET PSOATYPE=""
+8 FOR
SET PSOATYPE=$ORDER(PSOSARRY(PSOSEVER,TYPE,PSOATYPE))
if PSOATYPE=""
QUIT
SET PSOREACT=""
FOR
SET PSOREACT=$ORDER(PSOSARRY(PSOSEVER,TYPE,PSOATYPE,PSOREACT))
if PSOREACT=""
QUIT
Begin DoDot:2
+9 SET ZMSG=""
+10 SET ZMSG=$ORDER(PSOSARRY(PSOSEVER,TYPE,PSOATYPE,PSOREACT,ZMSG))
+11 if ZMSG=""
QUIT
+12 SET PSOPAIEN=$$GMSGPTR^PSODGAL1(ZMSG)
if PSOPAIEN=""
QUIT
Begin DoDot:3
+13 SET (PSODRCL,ZALL,SITE,SITENM,LOCREM)=""
+14 SET SITE=$PIECE(TYPE,"|",3)
SET LOCREM=$PIECE(TYPE,"|")
SET SITENM=$PIECE(TYPE,"|",2)
+15 SET ZALL=GMRARSLT(ZMSG,PSOPAIEN)
+16 IF PSOATYPE=2
SET PSOATYP=2
+17 IF PSOATYPE=1
SET PSOATYP=1
SET PSODRCL=1
+18 if ZALL=""
QUIT
+19 DO TMPSET
End DoDot:3
End DoDot:2
End DoDot:1
+20 QUIT
+21 ;
TMPSET ;
+1 SET DACNT=DACNT+1
NEW II,III,PTR,DATEI
KILL SETTMP
+2 SET PSOHISI=$PIECE(ZALL,U,8)
+3 SET PSOSEVI=$$GETSEVI(ZALL)
+4 SET PSODGCL=""
SET PSOLOCAL=$PIECE(ZALL,"^",3)
SET PSOLOCI=$PIECE($PIECE(ZALL,"^",3),"|",2)
+5 SET DATEI=$PIECE(ZALL,U,3)
+6 SET PTR=$PIECE(ZALL,U,7)
+7 ;ZERO NODE OF DRUG ALLERGY MULTIPLE
+8 SET SETTMP(DACNT,0)=$EXTRACT(PSOREACT,1,64)_U_PTR_U_LOCREM_U_SITE
+9 SET SETTMP(DACNT,0)=SETTMP(DACNT,0)_U_DATEI_U_$$UPPER(PSOHISI)_U_PSOSEVI
+10 SET ^TMP("PSODAOC",$JOB,"ALLERGY",PSJALGCT,4,DACNT,0)=SETTMP(DACNT,0)
+11 ;DRUG CLASS
+12 IF PSOATYP'=1
Begin DoDot:1
+13 SET PSODGCL=$GET(GMRARSLT(ZMSG,PSOPAIEN,"CLS"))
+14 IF $EXTRACT(PSODGCL,1)="~"
SET PSODGCL=$EXTRACT(PSODGCL,2,999)
End DoDot:1
+15 IF PSOATYP=1
Begin DoDot:1
+16 SET PSODGCLS=$GET(GMRARSLT(ZMSG,PSOPAIEN,"CLS"))
+17 IF $EXTRACT(PSODGCLS,1)="~"
SET PSODGCLS=$EXTRACT(PSODGCLS,2,999)
+18 SET PSODGCL=""
+19 NEW II
+20 FOR II=1:1
SET PSODGCL=$PIECE(PSODGCLS,"~",II)
if PSODGCL=""
QUIT
Begin DoDot:2
+21 SET ^TMP("PSODAOC",$JOB,"ALLERGY",PSJALGCT,4,DACNT,1,II,0)=PSODGCL
+22 QUIT
End DoDot:2
End DoDot:1
+23 ;DRUG INGREDIENT
+24 if $DATA(GMRARSLT(ZMSG,PSOPAIEN,"ING"))
Begin DoDot:1
+25 SET INGREDS=GMRARSLT(ZMSG,PSOPAIEN,"ING")
+26 IF $EXTRACT(INGREDS,1)="~"
SET INGREDS=$EXTRACT(INGREDS,2,999)
+27 NEW II
+28 FOR II=1:1
SET INGRED=$PIECE(INGREDS,"~",II)
if INGRED=""
QUIT
Begin DoDot:2
+29 SET ^TMP("PSODAOC",$JOB,"ALLERGY",PSJALGCT,4,DACNT,2,II,0)=INGRED
+30 QUIT
End DoDot:2
End DoDot:1
+31 ;SIGN/SYMPTOM
+32 NEW PSOSYMN,SYMCNT
SET SYMCNT=0
SET PSOSYMN=""
+33 FOR
SET PSOSYMN=$ORDER(PSOSARRY(PSOSEVER,TYPE,PSOATYPE,PSOREACT,ZMSG,"ZZZSYMPTOMS",PSOSYMN))
if PSOSYMN=""
QUIT
Begin DoDot:1
+34 SET SYMCNT=SYMCNT+1
+35 SET ^TMP("PSODAOC",$JOB,"ALLERGY",PSJALGCT,4,DACNT,3,SYMCNT,0)=PSOSARRY(PSOSEVER,TYPE,PSOATYPE,PSOREACT,ZMSG,"ZZZSYMPTOMS",PSOSYMN)
End DoDot:1
+36 ;DISPENSE DRUG
+37 SET ^TMP("PSODAOC",$JOB,"ALLERGY",PSJALGCT,"ALLERGY DD",5,1,0)=$SELECT(PSOATYP=1!(PSOATYP=2):$GET(PSODRUG("IEN")),PSOATYP=3:$PIECE(ZALL,"^",2),1:"")
+38 SET ^TMP("PSODAOC",$JOB,"ALLERGY",PSJALGCT,"ALLERGY PKG")=$SELECT($GET(PSJAOC):"IP",1:"OP")
+39 SET ^TMP("PSODAOC",$JOB,"ALLERGY","PROVR")=""
END ;
+1 QUIT
+2 ;
GETSEV(PSOSSITE,ZMSG,GMRARSLT) ; return external highest severity for possible local multiple
+1 NEW RESULT,ARRAY,I,SEV
+2 SET RESULT=""
+3 if '$DATA(GMRARSLT)
QUIT RESULT
+4 if '$DATA(PSOSSITE)
QUIT RESULT
+5 if '$DATA(GMRARSLT(ZMSG))
QUIT RESULT
+6 SET I=0
+7 FOR
SET I=$ORDER(GMRARSLT(ZMSG,"MESSAGE",1,PSOSSITE,1,I))
if 'I
QUIT
Begin DoDot:1
+8 SET SEV=$PIECE($GET(GMRARSLT(ZMSG,"MESSAGE",1,PSOSSITE,1,I)),U,2)
+9 SET ARRAY($SELECT(SEV="SEVERE":1,SEV="MODERATE":2,SEV="MILD":3,1:99))=SEV
+10 QUIT
End DoDot:1
+11 IF $DATA(ARRAY)
SET I=$ORDER(ARRAY(""))
SET RESULT=ARRAY(I)
+12 QUIT RESULT
+13 ;;
GETSEVI(ZALL) ; return internal highest severity for possible local multiple
+1 NEW RESULT,ARRAY,I,J,K,SEV
+2 SET RESULT=""
+3 SET SEV=$PIECE($GET(ZALL),U,4)
+4 IF $EXTRACT(SEV,1)="~"
SET SEV=$EXTRACT(SEV,2,999)
+5 if SEV=""
QUIT RESULT
+6 FOR I=1:1
SET J=$PIECE(SEV,"~",I)
if J=""
QUIT
Begin DoDot:1
+7 SET K=$PIECE(J,"|",2)
+8 if K'=""
SET ARRAY(K)=J
+9 QUIT
End DoDot:1
+10 IF $DATA(ARRAY)
SET I=$ORDER(ARRAY(""),-1)
SET RESULT=I
+11 QUIT RESULT
+12 ;;
GETSYMNM(ZYALL,SYMIEN,SYMINC) ; getSymptomName(allergyResultIEN,symptomIEN,symptomIncrement)
+1 NEW RESULT
+2 SET RESULT=""
+3 if $GET(ZYALL)=""
QUIT RESULT
+4 if $GET(SYMIEN)=""
QUIT RESULT
+5 if $GET(SYMINC)=""
QUIT RESULT
+6 if +SYMIEN'=30
QUIT $$GET1^DIQ(120.83,SYMIEN,.01)
+7 IF +ZYALL=0
Begin DoDot:1
+8 ;look at ^xtmp("orrdi","art" here for remote data 'OTHER REACTION' text
+9 NEW ORRDIEN
+10 SET ORRDIEN=$PIECE(ZYALL,"R",2)
+11 if ORRDIEN=""
QUIT
+12 if +$GET(DFN)
SET RESULT=$PIECE($GET(^XTMP("ORRDI","ART",DFN,ORRDIEN,"SIGNS/SYMPTOMS",SYMINC)),U,2)
+13 QUIT
End DoDot:1
QUIT RESULT
+14 IF +ZYALL>0
Begin DoDot:1
+15 ;call GMRADPT here, look at GMRAL for local data 'OTHER REACTION' text
+16 NEW GMRAL
+17 DO ^GMRADPT
+18 SET RESULT=$PIECE($GET(GMRAL(ZYALL,"S",SYMINC)),";")
+19 KILL GMRAL
End DoDot:1
QUIT RESULT
+20 QUIT RESULT
+21 ;
UPPER(PSOUCS) ;
+1 QUIT $TRANSLATE(PSOUCS,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
+2 ;
TSTREM ;For remote developer testing
+1 ;1. complex mix of local/remote results: set a break at SORTN^PSODGAL3, results will not match the order but will be the complex dummy for all, at the break set S PSOTSTMD=1, type G for Go.
+2 ;2. Multiple Ingredient allergy: set a break at SORTN^PSODGAL3, order PROPOFOL, and at the break set S PSOTSTMD=3, type G for Go.
+3 ;3. Drug class allergy: set up allergy by drug class ANTILIPEMIC AGENTS and order LIPITOR and at the break set S PSOTSTMD=2, type G for Go.
+4 ;
+5 if '$GET(PSOTSTMD)
QUIT
+6 IF PSOTSTMD=1
GOTO BIGARRAY
+7 IF PSOTSTMD=2
GOTO DRGCLASS
+8 IF PSOTSTMD=3
GOTO MULTI
+9 ;
SINGLE ;Test Remote with a single ingredient
+1 ;ICR: IEN NAME 1 2 3 4 5 6 7 8 9 10 11
+2 ;PIECE: 1 2 3 4 5 6 7 8 9 10 11 12 13
+3 SET GMRAING("R1")="GUAIFENESIN|744^MARTINSBURG VAMC|613^REMOTE|R^Jun 20, 2013@15:52|3130620.1552^SEVERE|3^DROWSINESS|66~HIVES|1~ANXIETY|39^GUAIFENESIN^GUAIFENESIN|1671;PSNDF(50.6,^HISTORICAL|h^VISTA|V"
+4 SET GMRAING("R2")="GUAIFENESIN|744^HEARTLAND WEST VAMC|589^REMOTE|R^Aug 28, 2012@11:52|3120828.1552^SEVERE|3^DROWSINESS|66~HIVES|1^GUAIFENESIN^GUAIFENESIN|1671;PSNDF(50.6,^HISTORICAL|h^VISTA|V"
+5 SET GMRAING("R3")="GUAIFENESIN|744^NEW ORLEANS, LA.|629^REMOTE|R^Oct 25, 2013@09:54|3131025.0954^MODERATE|2^DROWSINESS|66~HIVES|1^GUAIFENESIN^GUAIFENESIN|1671;PSNDF(50.6,^HISTORICAL|h^VISTA|V"
+6 SET GMRAING("R4")="GUAIFENESIN|744^NEW YORK, NY|630^REMOTE|R^Apr 9, 2013@15:43|3130409.1143^MILD|1^DROWSINESS|66~HIVES|1^GUAIFENESIN^GUAIFENESIN|1671;PSNDF(50.6,^HISTORICAL|h^VISTA|V"
+7 QUIT
+8 ;
MULTI ;Test Remote with multiple ingredients
+1 SET GMRAING("R7")="SODIUM METABISULFITE|69~PROPOFOL|2114~EGG|2361~SOYBEAN|3156~PEANUT|4048^HEARTLAND WEST VAMC|589^REMOTE|R^Oct 25, 2013@09:52|3131025.0952^SEVERVE|3^ANXIETY|39^PROPOFOL^PROPOFOL|2145;PSNDF(50.6,^OBSERVED|o^VISTA|V"
+2 SET GMRAING("R8")="SODIUM METABISULFITE|69~PROPOFOL|2114~EGG|2361~SOYBEAN|3156~PEANUT|4048^MARTINSBURG VAMC|613^REMOTE|R^SEP 30, 2013@01:52|3130930.1352^SEVERVE|3^ANXIETY|39^PROPOFOL^PROPOFOL|2145;PSNDF(50.6,^OBSERVED|o^VISTA|V"
+3 SET GMRAING("R10")="SODIUM METABISULFITE|69~PROPOFOL|2114~EGG|2361~SOYBEAN|3156~PEANUT|4048^NEW ORLEANS, LA.|629^REMOTE|R^Aug 15, 2013@11:52|3130515.1152^MODERATE|2^ANXIETY|39^PROPOFOL^PROPOFOL|2145;PSNDF(50.6,^OBSERVED|o^VISTA|V"
+4 SET GMRAING("R11")="SODIUM METABISULFITE|69~PROPOFOL|2114~EGG|2361~SOYBEAN|3156~PEANUT|4048^NEW YORK, NY|630^REMOTE|R^Aug 15, 2013@11:52|3130515.1152^MILD|1^ANXIETY|39^PROPOFOL^PROPOFOL|2145;PSNDF(50.6,^OBSERVED|o^VISTA|V"
+5 SET GMRAING("R12")="SODIUM METABISULFITE|69~PROPOFOL|2114~EGG|2361~SOYBEAN|3156~PEANUT|4048^MARTINSBURG VAMC|613^REMOTE|R^DEC 15, 2013@12:52|3131215.1252^MILD|1^ANXIETY|39^PROPOFOL^PROPOFOL|2145;PSNDF(50.6,OBSERVED|o^VISTA|V"
+6 QUIT
+7 ;
DRGCLASS ;Test Remote Interaction by drug class
+1 KILL GMRAING,GMRADRCL,GMRAREAC
+2 SET GMRADRCL("R1")="ANTILIPEMIC AGENTS|58^HEARTLAND WEST VAMC|589^REMOTE|R^Jan 28, 2014@10:56|3140128.1056^SEVERE|3^DIARRHEA|9~DROWSINESS|66~DRY NOSE|69^ANTILIPEMIC AGENTS^ANTILIPEMIC AGENTS|58;PS(50.605,^OBSERVED|o^VISTA|V"
+3 SET GMRADRCL("R2")="ANTILIPEMIC AGENTS|58^MARTINSBURG VAMC|613^REMOTE|R^Jan 15, 2014@09:56|3140115.0956^SEVERE|3^DIARRHEA|9~DROWSINESS|66~DRY NOSE|69^ANTILIPEMIC AGENTS^ANTILIPEMIC AGENTS|58;PS(50.605,^OBSERVED|o^VISTA|V"
+4 QUIT
+5 ;
BIGARRAY ;dummy big array with complex local/remote combinations. Will not match drugs passed in
+1 KILL GMRARSLT
+2 SET GMRARSLT=7
+3 SET GMRARSLT(1,106534)="10881^L^3150528.1606^^^AMPICILLIN^79;PSNDF(50.6,^h^V"
+4 SET GMRARSLT(1,106534,"CLS")=249
+5 SET GMRARSLT(1,"MESSAGE",1)=1
+6 SET GMRARSLT(1,"MESSAGE",1,10881)="CLE13 TEST LAB^LOCAL^MAY 28, 2015@16:06^HISTORICAL"
+7 SET GMRARSLT(1,"MESSAGE",2)="^AMPICILLIN^AMPICILLIN"
+8 SET GMRARSLT(1,"MESSAGE","OFFENDERS","CLS")="AM111 PENICILLINS,AMINO DERIVATIVES"
+9 SET GMRARSLT(2,106535)="10881^L^3150528.1607^^^MEROPENEM^3391;PSNDF(50.6,^h^V"
+10 SET GMRARSLT(2,106535,"CLS")=335
+11 SET GMRARSLT(2,"MESSAGE",1)=2
+12 SET GMRARSLT(2,"MESSAGE",1,10881)="CLE13 TEST LAB^LOCAL^MAY 28, 2015@16:07^HISTORICAL"
+13 SET GMRARSLT(2,"MESSAGE",1,10882)="CHEYENNE HDR SQA^REMOTE^MAY 28, 2015@16:02^HISTORICAL"
+14 SET GMRARSLT(2,"MESSAGE",2)="^MEROPENEM^MEROPENEM"
+15 SET GMRARSLT(2,"MESSAGE","OFFENDERS","CLS")="AM119 BETA-LACTAMS ANTIMICROBIALS,OTHER"
+16 SET GMRARSLT(2,"R9")="10882^R^3150528.1602^^^MEROPENEM^3391;PSNDF(50.6,^h^V"
+17 SET GMRARSLT(2,"R9","CLS")=335
+18 SET GMRARSLT(3,"MESSAGE",1)=1
+19 SET GMRARSLT(3,"MESSAGE",1,10882)="CHEYENNE HDR SQA^REMOTE^MAY 28, 2015@16:03^OBSERVED"
+20 SET GMRARSLT(3,"MESSAGE",2)="RASH^CEPHALEXIN^CEPHALEXIN"
+21 SET GMRARSLT(3,"MESSAGE","OFFENDERS","CLS")="AM115 CEPHALOSPORIN 1ST GENERATION"
+22 SET GMRARSLT(3,"R11")="10882^R^3150528.1603^^133^CEPHALEXIN^1290;PSNDF(50.6,^o^V"
+23 SET GMRARSLT(3,"R11","CLS")=12
+24 SET GMRARSLT(4,"MESSAGE",1)=1
+25 SET GMRARSLT(4,"MESSAGE",1,613)="MARTINSBURG VAMC^REMOTE^MAY 28, 2015@15:46^OBSERVED"
+26 SET GMRARSLT(4,"MESSAGE",2)="ANAPHYLAXIS and DYSPNEA^CEFAZOLIN^CEFAZOLIN"
+27 SET GMRARSLT(4,"MESSAGE","OFFENDERS","CLS")="AM115 CEPHALOSPORIN 1ST GENERATION"
+28 SET GMRARSLT(4,"MESSAGE","OFFENDERS","ING")="CEFAZOLIN"
+29 SET GMRARSLT(4,"R13")="613^R^3150528.1546^^5~70^CEFAZOLIN^30;PSNDF(50.6,^o^V"
+30 SET GMRARSLT(4,"R13","CLS")=12
+31 SET GMRARSLT(4,"R13","ING")=2278
+32 SET GMRARSLT(5,"MESSAGE",1)=1
+33 SET GMRARSLT(5,"MESSAGE",1,10882)="CHEYENNE HDR SQA^REMOTE^MAY 28, 2015@16:01^HISTORICAL"
+34 SET GMRARSLT(5,"MESSAGE",2)="ITCHING OF EYE and WHEEZING^PENICILLIN^PENICILLIN"
+35 SET GMRARSLT(5,"MESSAGE","OFFENDERS","CLS")="AM110 PENICILLIN-G RELATED PENICILLINS"
+36 SET GMRARSLT(5,"R2")="10882^R^3150528.1601^^20~311^PENICILLIN^16;PSNDF(50.6,^h^V"
+37 SET GMRARSLT(5,"R2","CLS")=248
+38 SET GMRARSLT(6,"MESSAGE",1)=1
+39 SET GMRARSLT(6,"MESSAGE",1,613)="MARTINSBURG VAMC^REMOTE^MAY 28, 2015@15:50^OBSERVED"
+40 SET GMRARSLT(6,"MESSAGE",2)="ANAPHYLAXIS^PENICILLIN^PENICILLIN"
+41 SET GMRARSLT(6,"MESSAGE","OFFENDERS","CLS")="AM110 PENICILLIN-G RELATED PENICILLINS"
+42 SET GMRARSLT(6,"R4")="613^R^3150528.155^^5~30^PENICILLIN^16;PSNDF(50.6,^o^V"
+43 SET GMRARSLT(6,"R4","CLS")=248
+44 SET ^XTMP("ORRDI","ART",DFN,4,"SIGNS/SYMPTOMS",2)="^Giggles^"
+45 SET GMRARSLT(7,"MESSAGE",1)=1
+46 SET GMRARSLT(7,"MESSAGE",1,613)="MARTINSBURG VAMC^REMOTE^MAY 28, 2015@15:50^HISTORICAL"
+47 SET GMRARSLT(7,"MESSAGE",2)="^CEFEPIME^CEFEPIME"
+48 SET GMRARSLT(7,"MESSAGE","OFFENDERS","CLS")="AM118 CEPHALOSPORIN 4TH GENERATION"
+49 SET GMRARSLT(7,"R5")="613^R^3150528.155^^^CEFEPIME^3392;PSNDF(50.6,^h^V"
+50 SET GMRARSLT(7,"R5","CLS")=524
+51 QUIT
+52 ;