added Alerts to GPLRIMA

This commit is contained in:
george 2008-10-29 00:14:30 +00:00
parent 24d3d37874
commit 8d0ca1dfa5
2 changed files with 19 additions and 3 deletions

View File

@ -88,8 +88,12 @@ EXTRACT(ALTXML,DFN,ALTOUTXML) ; EXTRACT ALERTS INTO PROVIDED XML TEMPLATE
. . S ARDES=$P(ARTMP,";",1)
. . S ARVUID=$$GET1^DIQ(120.83,ARIEN,"VUID")
. S @ALTVMAP@("ALERTREACTIOINDESCRIPTIONTEXT")=ARDES
. S @ALTVMAP@("ALERTREACTIONCODEVALUE")=ARVUID
. S @ALTVMAP@("ALERTREACTIONCODESYSTEM")="VUID"
. I ARVUID'="" D ; IF REACTION VUID IS NOT NULL
. . S @ALTVMAP@("ALERTREACTIONCODEVALUE")=ARVUID
. . S @ALTVMAP@("ALERTREACTIONCODESYSTEM")="VUID"
. E D ; IF IT IS NULL DON'T SET CODE SYSTEM
. . S @ALTVMAP@("ALERTREACTIONCODEVALUE")=""
. . S @ALTVMAP@("ALERTREACTIONCODESYSTEM")=""
. S ALTARYTMP=$NA(@ALTTARYTMP@(ALTCNT))
. K @ALTARYTMP
. D MAP^GPLXPATH(ALTXML,ALTVMAP,ALTARYTMP)

View File

@ -64,6 +64,9 @@ ANALYZE(BEGDFN,DFNCNT) ; RIM COHERANCE ANALYSIS ROUTINE
. . M @RIMBASE@("VARS",RIMDFN,"VITALS")=^TMP("GPLCCR",$J,"VITALS")
. I $D(^TMP("GPLCCR",$J,"MEDMAP",1)) D ; MEDS VARS EXISTS
. . M @RIMBASE@("VARS",RIMDFN,"MEDS")=^TMP("GPLCCR",$J,"MEDMAP")
. I $D(^TMP("GPLALERT",$J,"ALERTS",1,"ALERTOBJECTID")) D ; ALERTS EXIST
. . W "FOUND ALERT VARS",!
. . M @RIMBASE@("VARS",RIMDFN,"ALERTS")=^TMP("GPLALERT",$J,"ALERTS")
. K ^TMP("GPLCCR",$J) ; KILL WORK AREA FOR CCR BUILDING
. ;
. ; EVALUATE THE VARIABLES AND CREATE AN ATTRIBUTE MAP
@ -107,7 +110,14 @@ SETATTR(SDFN) ; SET ATTRIBUTES BASED ON VARS
. . F ZI=1:1:ZR(0) D ; LOOP THROUGH RETURNED VAR^VALUE PAIRS
. . . I $P(ZR(ZI),"^",2)'="" D APOST("SATTR","RIMTBL","MEDSCODE") ;CODES
. ; D PATD^GPLRIMA(2,"MEDS","MEDPRODUCTNAMECODEVALUE") CHECK FOR MED CODES
D APOST("SATTR","RIMTBL","NOTEXTRACTED") ; OUTPUT NOT YET PRODUCED
I $D(@SBASE@("ALERTS",1)) D ; IF THE PATIENT HAS ALERTS
. D APOST("SATTR","RIMTBL","ALERTS")
. N ZR,ZI
. D GETPA(.ZR,SDFN,"ALERTS","ALERTAGENTPRODUCTCODEVALUE") ;REACTANT CODES
. I ZR(0)>0 D ; VAR LOOKUP WAS GOOD, CHECK FOR NON=NULL RETURN
. . F ZI=1:1:ZR(0) D ; LOOP THROUGH RETURNED VAR^VALUE PAIRS
. . . I $P(ZR(ZI),"^",2)'="" D APOST("SATTR","RIMTBL","ALERTSSCODE") ;CODES
; D APOST("SATTR","RIMTBL","NOTEXTRACTED") ; OUTPUT NOT YET PRODUCED
W "ATTRIBUTES: ",SATTR,!
Q SATTR
;
@ -285,6 +295,8 @@ AINIT ; INITIALIZE ATTRIBUTE TABLE
D APUSH(RIMTBL,"MEDSNOCODE")
D APUSH(RIMTBL,"MEDSDATE")
D APUSH(RIMTBL,"MEDSNODATE")
D APUSH(RIMTBL,"ALERTS")
D APUSH(RIMTBL,"ALERTSCODE")
Q
;
APOST(PRSLT,PTBL,PVAL) ; POST AN ATTRIBUTE PVAL TO PRSLT USING PTBL