fixing Alerts

This commit is contained in:
george 2008-10-27 15:42:09 +00:00
parent 57a8360aee
commit 3ba3f81e8f
1 changed files with 3 additions and 3 deletions

View File

@ -44,14 +44,14 @@ EXTRACT(ALTXML,DFN,ALTOUTXML) ; EXTRACT ALERTS INTO PROVIDED XML TEMPLATE
. K @ALTVMAP
. S @ALTVMAP@("ALERTOBJECTID")="ALERT"_ALTCNT
. N A1 S A1=@ALTG@(ALTTMP) ; ALL THE PIECES
. N A2 S A2=$P(A1,U,4) ; ALLERGIC FLAG
. N A2 S A2=$$GET1^DIQ(120.8,ALTTMP,"MECHANISM","I") ; MECHANISM
. N A3 S A3=$P(A1,U,5) ; ADVERSE FLAG
. N ADT S ADT="Patient has an " ; X $ZINT H 5
. S ADT=ADT_$S(A1=1:"ADVERSE",A2=1:"ALLERGIC",1:"UNKNOWN")
. S ADT=ADT_$S(A2="P":"ADVERSE",A2="A":"ALLERGIC",1:"UNKNOWN")
. S ADT=ADT_" reaction to "_$P(@ALTG@(ALTTMP),U,2)_"."
. S @ALTVMAP@("ALERTDESCRIPTIONTEXT")=ADT
. N ALTCDE ; SNOMED CODE THE THE ALERT
. S ALTCDE=$S(A2=1:"282100009",1:"418634005") ; IF NOT ADVERSE, IT IS ALLERGIC
. S ALTCDE=$S(A2="P":"282100009",A2="A":"418634005",1:"") ; IF NOT ADVERSE, IT IS ALLERGIC
. S @ALTVMAP@("ALERTCODEVALUE")=ALTCDE ;
. ; WILL USE 418634005 FOR ALLERGIC REACTION TO A SUBSTANCE
. ; AND 282100009 FOR ADVERSE REACTION TO A SUBSTANCE