added MEDSCODE attribute for MEDS that have codes in GPLRIMA analysis

This commit is contained in:
george 2008-09-22 21:35:23 +00:00
parent d484d7946e
commit 7dec8dda33
1 changed files with 8 additions and 2 deletions

View File

@ -99,8 +99,14 @@ SETATTR(SDFN) ; SET ATTRIBUTES BASED ON VARS
. D APOST("SATTR","RIMTBL","PROBLEMS")
. ; W "POSTING PROBLEMS",!
I $D(@SBASE@("VITALS",1)) D APOST("SATTR","RIMTBL","VITALS")
I $D(@SBASE@("MEDS",1)) D APOST("SATTR","RIMTBL","MEDS")
; D PATD^GPLRIMA(2,"MEDS","MEDPRODUCTNAMECODEVALUE") CHECK FOR MED CODES
I $D(@SBASE@("MEDS",1)) D ; IF THE PATIENT HAS MEDS VARIABLES
. D APOST("SATTR","RIMTBL","MEDS")
. N ZR,ZI
. D GETPA(.ZR,SDFN,"MEDS","MEDPRODUCTNAMECODEVALUE") ;CHECK FOR MED 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","MEDSCODE") ;CODES
. ; D PATD^GPLRIMA(2,"MEDS","MEDPRODUCTNAMECODEVALUE") CHECK FOR MED CODES
D APOST("SATTR","RIMTBL","NOTEXTRACTED") ; OUTPUT NOT YET PRODUCED
W "ATTRIBUTES: ",SATTR,!
Q SATTR