GMRVEE3 ;HIRMFO/YH-ENTERED IN ERROR EDIT (cont.) ;12/12/96
;;4.0;Vitals/Measurements;;Apr 25, 1997
QUALIFY ;EXTRACT QULIFIERS FROM OLD RECORDS
Q:$D(GMRCHC(2)) K GMRINF N II,IJ,GMRCHAR,GYES
S GTYPE=+$P(^GMR(120.5,GMRDA,0),"^",3),GTYPE(1)=$P($G(^GMRD(120.51,GTYPE,0)),"^",2) Q:GTYPE=""
I $P($G(^GMR(120.5,GMRDA,5,0)),"^",4)>0 S (GYES,II)=0 F S II=$O(^GMR(120.5,GMRDA,5,II)) Q:II'>0 D
. S GMRCHAR=^GMR(120.5,GMRDA,5,II,0)
. I GYES=0 S GMRSITE(GTYPE(1))=$P(^GMRD(120.52,+GMRCHAR,0),"^")_"^"_GMRCHAR,GYES=1 Q
. I GYES=1 S GMRINF(GTYPE(1),II,$P(^GMRD(120.52,+GMRCHAR,0),"^"))=GMRCHAR_"^"_II
. Q
Q
GMRVEE3 ;HIRMFO/YH-ENTERED IN ERROR EDIT (cont.) ;12/12/96
+1 ;;4.0;Vitals/Measurements;;Apr 25, 1997
QUALIFY ;EXTRACT QULIFIERS FROM OLD RECORDS
+1 IF $DATA(GMRCHC(2))
QUIT
KILL GMRINF
NEW II,IJ,GMRCHAR,GYES
+2 SET GTYPE=+$PIECE(^GMR(120.5,GMRDA,0),"^",3)
SET GTYPE(1)=$PIECE($GET(^GMRD(120.51,GTYPE,0)),"^",2)
IF GTYPE=""
QUIT
+3 IF $PIECE($GET(^GMR(120.5,GMRDA,5,0)),"^",4)>0
SET (GYES,II)=0
FOR
SET II=$ORDER(^GMR(120.5,GMRDA,5,II))
IF II'>0
QUIT
Begin DoDot:1
+4 SET GMRCHAR=^GMR(120.5,GMRDA,5,II,0)
+5 IF GYES=0
SET GMRSITE(GTYPE(1))=$PIECE(^GMRD(120.52,+GMRCHAR,0),"^")_"^"_GMRCHAR
SET GYES=1
QUIT
+6 IF GYES=1
SET GMRINF(GTYPE(1),II,$PIECE(^GMRD(120.52,+GMRCHAR,0),"^"))=GMRCHAR_"^"_II
+7 QUIT
End DoDot:1
+8 QUIT