GMRAOR8 ;HIRMFO/WAA-OERR HL7 UTILITY ;7/3/97 15:48
;;4.0;Adverse Reaction Tracking;**4**;Mar 29, 1996
COMM(GMRAPA,GMRAL) ;Add comments
;INPUT
; GMRAPA = The entry in file 120.8 that is being modified
; GMRAL = The entry in the GMRAL array that is being added
;
N GMRASN,GMRASNN
S GMRASN=0 F S GMRASN=$O(GMRAL(GMRAL,"N",GMRASN)) D Q:GMRASN<1
.I GMRASN<1 S GMRASN=$O(GMRAL(GMRAL,"N",""),-1),^GMR(120.8,GMRAPA,26,0)=U_"120.826D"_U_GMRASN_U_GMRASN S GMRASN="" Q
.N GMRALN
.S ^GMR(120.8,GMRAPA,26,GMRASN,0)=$P(GMRAL(GMRAL),U,5)_U_$P(GMRAL(GMRAL),U,7)_U_"O"
.I $G(GMRAL(GMRAL,"N",GMRASN,1))'="" S GMRASNN="" F S GMRASNN=$O(GMRAL(GMRAL,"N",GMRASN,GMRASNN)) D Q:GMRASNN<1
..I GMRASNN<1 S GMRASNN=$O(GMRAL(GMRAL,"N",GMRASN,""),-1),^GMR(120.8,GMRAPA,26,GMRASN,2,0)=U_U_GMRASNN_U_GMRASNN S GMRASNN="" Q
..S ^GMR(120.8,GMRAPA,26,GMRASN,2,GMRASNN,0)=GMRAL(GMRAL,"N",GMRASN,GMRASNN)
..Q
.Q
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRAOR8 920 printed Nov 22, 2024@16:49:58 Page 2
GMRAOR8 ;HIRMFO/WAA-OERR HL7 UTILITY ;7/3/97 15:48
+1 ;;4.0;Adverse Reaction Tracking;**4**;Mar 29, 1996
COMM(GMRAPA,GMRAL) ;Add comments
+1 ;INPUT
+2 ; GMRAPA = The entry in file 120.8 that is being modified
+3 ; GMRAL = The entry in the GMRAL array that is being added
+4 ;
+5 NEW GMRASN,GMRASNN
+6 SET GMRASN=0
FOR
SET GMRASN=$ORDER(GMRAL(GMRAL,"N",GMRASN))
Begin DoDot:1
+7 IF GMRASN<1
SET GMRASN=$ORDER(GMRAL(GMRAL,"N",""),-1)
SET ^GMR(120.8,GMRAPA,26,0)=U_"120.826D"_U_GMRASN_U_GMRASN
SET GMRASN=""
QUIT
+8 NEW GMRALN
+9 SET ^GMR(120.8,GMRAPA,26,GMRASN,0)=$PIECE(GMRAL(GMRAL),U,5)_U_$PIECE(GMRAL(GMRAL),U,7)_U_"O"
+10 IF $GET(GMRAL(GMRAL,"N",GMRASN,1))'=""
SET GMRASNN=""
FOR
SET GMRASNN=$ORDER(GMRAL(GMRAL,"N",GMRASN,GMRASNN))
Begin DoDot:2
+11 IF GMRASNN<1
SET GMRASNN=$ORDER(GMRAL(GMRAL,"N",GMRASN,""),-1)
SET ^GMR(120.8,GMRAPA,26,GMRASN,2,0)=U_U_GMRASNN_U_GMRASNN
SET GMRASNN=""
QUIT
+12 SET ^GMR(120.8,GMRAPA,26,GMRASN,2,GMRASNN,0)=GMRAL(GMRAL,"N",GMRASN,GMRASNN)
+13 QUIT
End DoDot:2
if GMRASNN<1
QUIT
+14 QUIT
End DoDot:1
if GMRASN<1
QUIT
+15 QUIT