added REACTION variables to alert processing
This commit is contained in:
parent
4ed2788c39
commit
e7ffaf3c16
16
p/GPLALERT.m
16
p/GPLALERT.m
|
@ -25,11 +25,11 @@ EXTRACT(ALTXML,DFN,ALTOUTXML) ; EXTRACT ALERTS INTO PROVIDED XML TEMPLATE
|
||||||
; ALTXML AND ALTOUTXML ARE PASSED BY NAME SO GLOBALS CAN BE USED
|
; ALTXML AND ALTOUTXML ARE PASSED BY NAME SO GLOBALS CAN BE USED
|
||||||
;
|
;
|
||||||
; GET ADVERSE REACTIONS AND ALLERGIES
|
; GET ADVERSE REACTIONS AND ALLERGIES
|
||||||
N GMRA,GMRAL S GMRA="0^0^111"
|
; N GMRA,GMRAL ; FOR DEBUGGING, DON'T NEW THESE VARIABLES
|
||||||
|
S GMRA="0^0^111"
|
||||||
D EN1^GMRADPT
|
D EN1^GMRADPT
|
||||||
I $G(GMRAL)'=1 D Q ; NO ALLERGIES FOUND THUS *QUIT*
|
I $G(GMRAL)'=1 D Q ; NO ALLERGIES FOUND THUS *QUIT*
|
||||||
. S @ALTOUTXML@(0)=0
|
. S @ALTOUTXML@(0)=0
|
||||||
|
|
||||||
; DEFINE MAPPING
|
; DEFINE MAPPING
|
||||||
N ALTTVMAP,ALTVMAP,ALTTARYTMP,ALTARYTMP
|
N ALTTVMAP,ALTVMAP,ALTTARYTMP,ALTARYTMP
|
||||||
S ALTTVMAP=$NA(^TMP("GPLALERT",$J,"ALERTS"))
|
S ALTTVMAP=$NA(^TMP("GPLALERT",$J,"ALERTS"))
|
||||||
|
@ -41,10 +41,10 @@ EXTRACT(ALTXML,DFN,ALTOUTXML) ; EXTRACT ALERTS INTO PROVIDED XML TEMPLATE
|
||||||
. S ALTVMAP=$NA(@ALTTVMAP@(ALTCNT))
|
. S ALTVMAP=$NA(@ALTTVMAP@(ALTCNT))
|
||||||
. K @ALTVMAP
|
. K @ALTVMAP
|
||||||
. S @ALTVMAP@("ALERTOBJECTID")="ALERT"_ALTCNT
|
. S @ALTVMAP@("ALERTOBJECTID")="ALERT"_ALTCNT
|
||||||
. N ALERTDESCRIPTIONTEXT S ALERTDESCRIPTIONTEXT="Patient has an " ; X $ZINT H 5
|
. N ADT S ADT="Patient has an " ; X $ZINT H 5
|
||||||
. S ALERTDESCRIPTIONTEXT=ALERTDESCRIPTIONTEXT_$S($P(@ALTTMP,U,4)=1:"ADVERSE",$P(@ALTTMP,U,5)=1:"ALLERGIC",1:"UNKNOWN")
|
. S ADT=ADT_$S($P(@ALTTMP,U,4)=1:"ADVERSE",$P(@ALTTMP,U,5)=1:"ALLERGIC",1:"UNKNOWN")
|
||||||
. S ALERTDESCRIPTIONTEXT=ALERTDESCRIPTIONTEXT_" reaction to "_$P(@ALTTMP,U,2)_"."
|
. S ADT=ADT_" reaction to "_$P(@ALTTMP,U,2)_"."
|
||||||
. S @ALTVMAP@("ALERTDESCRIPTIONTEXT")=ALERTDESCRIPTIONTEXT
|
. S @ALTVMAP@("ALERTDESCRIPTIONTEXT")=ADT
|
||||||
. S @ALTVMAP@("ALERTCODEVALUE")="ALERT CODE VALUE"
|
. S @ALTVMAP@("ALERTCODEVALUE")="ALERT CODE VALUE"
|
||||||
. S @ALTVMAP@("ALERTCODESYSTEM")="ALERT CODE SYSTEM"
|
. S @ALTVMAP@("ALERTCODESYSTEM")="ALERT CODE SYSTEM"
|
||||||
. S @ALTVMAP@("ALERTSTATUSTEXT")="ALERT STATUS TEXT"
|
. S @ALTVMAP@("ALERTSTATUSTEXT")="ALERT STATUS TEXT"
|
||||||
|
@ -54,12 +54,14 @@ EXTRACT(ALTXML,DFN,ALTOUTXML) ; EXTRACT ALERTS INTO PROVIDED XML TEMPLATE
|
||||||
. S @ALTVMAP@("ALERTAGENTPRODUCTNAMETEXT")="B"
|
. S @ALTVMAP@("ALERTAGENTPRODUCTNAMETEXT")="B"
|
||||||
. S @ALTVMAP@("ALERTAGENTPRODUCTCODEVALUE")="C"
|
. S @ALTVMAP@("ALERTAGENTPRODUCTCODEVALUE")="C"
|
||||||
. S @ALTVMAP@("ALERTAGENTPRODUCTCODESYSTEM")="D"
|
. S @ALTVMAP@("ALERTAGENTPRODUCTCODESYSTEM")="D"
|
||||||
|
. S @ALTVMAP@("ALERTREACTIOINDESCRIPTIONTEXT")="E"
|
||||||
|
. S @ALTVMAP@("ALERTREACTIONCODEVALUE")="F"
|
||||||
|
. S @ALTVMAP@("ALERTREACTIONCODESYSTEM")="G"
|
||||||
. S ALTARYTMP=$NA(@ALTTARYTMP@(ALTCNT))
|
. S ALTARYTMP=$NA(@ALTTARYTMP@(ALTCNT))
|
||||||
. K @ALTARYTMP
|
. K @ALTARYTMP
|
||||||
. D MAP^GPLXPATH(ALTXML,ALTVMAP,ALTARYTMP)
|
. D MAP^GPLXPATH(ALTXML,ALTVMAP,ALTARYTMP)
|
||||||
. I ALTCNT=1 D CP^GPLXPATH(ALTARYTMP,ALTOUTXML)
|
. I ALTCNT=1 D CP^GPLXPATH(ALTARYTMP,ALTOUTXML)
|
||||||
. I ALTCNT>1 D INSINNER^GPLXPATH(ALTOUTXML,ALTARYTMP)
|
. I ALTCNT>1 D INSINNER^GPLXPATH(ALTOUTXML,ALTARYTMP)
|
||||||
. S ALTCNT=ALTCNT+1
|
. S ALTCNT=ALTCNT+1
|
||||||
|
|
||||||
Q
|
Q
|
||||||
|
|
||||||
|
|
21
p/GPLSNOA.m
21
p/GPLSNOA.m
|
@ -174,3 +174,24 @@ CPUSH(CATRTN,CBASE,CTBL,CDFN,CATTR) ; ADD PATIENTS TO CATEGORIES
|
||||||
;
|
;
|
||||||
Q
|
Q
|
||||||
;
|
;
|
||||||
|
REUSE ; GET SAVED VALUES FROM ^TMP("GPLSAV") AND PUT THEM IN A DATABASE
|
||||||
|
;
|
||||||
|
D ASETUP
|
||||||
|
D AINIT
|
||||||
|
N SNOI,SNOJ,SNOK,SNOSNO,SNOSEC,SNOIEN,SNOOLD,SNOSRCH
|
||||||
|
S SAVBASE=$NA(^TMP("GPLSAV","VARS"))
|
||||||
|
S SNOI=""
|
||||||
|
F D Q:$O(@SAVBASE@(SNOI))="" ;THE WHOLE LIST
|
||||||
|
. S SNOI=$O(@SAVBASE@(SNOI))
|
||||||
|
. S SNOJ=@SAVBASE@(SNOI)
|
||||||
|
. S SNOK=$P($P(SNOJ,"^",1)," ALLERGY",1)
|
||||||
|
. S SNOSRCH=$P(SNOJ,"^",1) ;SEARCH TERM USED TO OBTAIN SNOMED CODE
|
||||||
|
. S SNOIEN=$P(SNOJ,"^",3) ; IEN OF ELEMENT IN LEXICON
|
||||||
|
. S SNOSNO=$P(SNOJ,"^",4) ; SNOMED CODE
|
||||||
|
. S SNOSEC=$P(SNOJ,"^",5) ; SECTION OF SNOMED FOR THIS CODE
|
||||||
|
. S SNOOLD=$P(SNOJ,"^",7) ; OLD NUMBER FOR THIS CODE
|
||||||
|
. W "SEARCH:",SNOSRCH," IEN:",SNOIEN," CODE:",SNOSNO," SEC:",SNOSEC," OLD:",SNOOLD,!
|
||||||
|
. W SNOK,!
|
||||||
|
. W SNOJ,!
|
||||||
|
Q
|
||||||
|
;
|
Loading…
Reference in New Issue