GMRAZDSF ;IHS/MSC/PLS - Patch support;01-May-2012 09:07;DU
;;4.0;Adverse Reaction Tracking;**1004**;Mar 29, 1996;Build 20
;
EN ;EP -
N AIEN,REACT,GMRAAR,GMRAPA,ING,CLS
S AIEN=0 F S AIEN=$O(^GMR(120.8,AIEN)) Q:'+AIEN D
.S REACT=$P($G(^GMR(120.8,AIEN,0)),U,2)
.I REACT'="" D
..S (ING,CLS)=""
..S ING=$O(^GMR(120.8,AIEN,2,0))
..S CLS=$O(^GMR(120.8,AIEN,3,0))
..I +CLS=0&(+ING=0) D
...S GMRAAR=$P($G(^GMR(120.8,AIEN,0)),U,3)
...S GMRAPA=AIEN
...D EN1^GMRAOR9
Q
GMRAZDSF ;IHS/MSC/PLS - Patch support;01-May-2012 09:07;DU
+1 ;;4.0;Adverse Reaction Tracking;**1004**;Mar 29, 1996;Build 20
+2 ;
EN ;EP -
+1 NEW AIEN,REACT,GMRAAR,GMRAPA,ING,CLS
+2 SET AIEN=0
FOR
SET AIEN=$ORDER(^GMR(120.8,AIEN))
IF '+AIEN
QUIT
Begin DoDot:1
+3 SET REACT=$PIECE($GET(^GMR(120.8,AIEN,0)),U,2)
+4 IF REACT'=""
Begin DoDot:2
+5 SET (ING,CLS)=""
+6 SET ING=$ORDER(^GMR(120.8,AIEN,2,0))
+7 SET CLS=$ORDER(^GMR(120.8,AIEN,3,0))
+8 IF +CLS=0&(+ING=0)
Begin DoDot:3
+9 SET GMRAAR=$PIECE($GET(^GMR(120.8,AIEN,0)),U,3)
+10 SET GMRAPA=AIEN
+11 DO EN1^GMRAOR9
End DoDot:3
End DoDot:2
End DoDot:1
+12 QUIT