GMVHS ;HIOFO/FT-RETURN PATIENT DATA UTILITY ;10/3/07
;;5.0;GEN. MED. REC. - VITALS;**3,23**;Oct 31, 2002;Build 25
;
; This routine uses the following IAs:
; #4290 - ^PXRMINDX global (controlled)
; #10040 - FILE 44 references (supported)
; #10103 - ^XLFDT calls (supported)
; #10104 - ^XLFSTR calls (supported)
;
; This routine supports the following IAs:
; EN1 - 4791 (private)
;
EN1 ; Entry to gather patient's vital/measurement data
; Input variables
;
; DFN = Entry number of patient in Patient file. (Required)
; GMRVSTR = types of vital/measurements desired. Use the abbreviations
; found in the Vital Type (120.51) file. For multiple
; vitals, use the ; as a delimiter. (Required)
; GMRVSTR(0) = GMRVSTDT^GMRVENDT^GMRVOCC^GMRVSORD
; where GMRVSTDT = The start date/time that the utility will
; use in obtaining patient data. (Required)
; GMRVENDT = The end date/time that the utility will use
; to stop the search. (Required)
; GMRVOCC = The number of occurrences of the data that
; is desired by the search. (Required)
; GMRVSORD = The sort order desired in output. 0 will sort
; the data by vital type, then by date/time entered.
; 1 will sort the data by date/time entered, then by
; vital type. (REQUIRED)
; GMRVSTR("LT") = ^TYP1^[TYP2^...] (OPTIONAL)
; THIS VARIABLE IS AN ^ DELIMITED LIST OF HOSPITAL LOCATION
; TYPES TO EXTRACT MEASUREMENT DATA FOR. E.G., ^C^M^, WILL
; EXTRACT DATA FOR ONLY THOSE MEASUREMENTS TAKEN ON CLINICS
; OR MODULES.
;
; Output variables:
;
; The utility will create an array with the desired information. The
; array structure will be as follows if '$P(GMRVSTR(0),U,4):
; ^UTILITY($J,"GMRVD",GMRVTYP,GMRVRDT,GMRVIEN)=GMRVDATA
; or if $P(GMRVSTR(0),U,4) then the following will be returned:
; ^UTILITY($J,"GMRVD",GMRVRDT,GMRVTYP,GMRVIEN)=GMRVDATA
; where GMRVRDT = Reverse FileMan date/time.
; 9999999-Date/time vital/measurement was taken.
; GMRVTYP = The abbreviation used in the GMRVSTR string for the
; type of vital/measurement taken.
; GMRVIEN = Entry number in FILE 120.5 or
; pseudo entry number for File 704.117
;
; $P(GMRVDATA,"^",1) = date/time of the reading (FileMan internal)
; $P(GMRVDATA,"^",2) = Patient (#2) number (i.e., DFN)
; $P(GMRVDATA,"^",3) = vital type ien (File 120.51)
; $P(GMRVDATA,"^",4) = date/time of data entry (FileMan internal)
; $P(GMRVDATA,"^",5) = hospital location ien (File 44)
; $P(GMRVDATA,"^",6) = user ien (File 200)
; $P(GMRVDATA,"^",7) = always null
; $P(GMRVDATA,"^",8) = reading (e.g., 98.6, Unavailable)
; $P(GMRVDATA,"^",9) = always null
; $P(GMRVDATA,"^",10) = the first qualifier
; $P(GMRVDATA,"^",11) = the second qualifier
; $P(GMRVDATA,"^",12)= "*" for abnormal measurement, otherwise = ""
; $P(GMRVDATA,"^",13)= values in centigrade for T; kilos for WT;
; centimeters for HT and Circumference/Girth;
; and mmHg for CVP
; $P(GMRVDATA,"^",14)= Body Mass Index
; $P(GMRVDATA,"^",15)= L/Min of supplemental O2
; $P(GMRVDATA,"^",16)= % of supplemental O2
; $P(GMRVDATA,"^",17)= all qualifiers delimited by semi-colons
; The variable GMRVSTR will be killed upon exit.
;
Q:'$D(GMRVSTR(0))!'($D(GMRVSTR)#2)!'($D(DFN)#2)
Q:DFN'>0
I $G(GMRVSTR("LT"))="" S GMRVSTR("LT")="" ;hospital location list
HSKPING ; Housekeeping
K ^UTILITY($J,"GMRVD")
N GMVABNML,GMVDATA,GMVEND,GMVHTIEN,GMVID,GMVIEN,GMVLOOP,GMVMAX,GMVOCC,GMVRATE,GMVSORD,GMVSTART,GMVTIEN,GMVTYPE,GMVWTIEN
D RANGE^GMVHS1
F GMVLOOP=1:1:$L(GMRVSTR,";") D
.S GMVTYPE=$P(GMRVSTR,";",GMVLOOP)
.Q:GMVTYPE=""
.S GMVMAX(GMVTYPE)=0
.Q
S GMVOCC=$P(GMRVSTR(0),U,3) ;max # of occurrences
S GMVSORD=$P(GMRVSTR(0),U,4) ;sort order
S GMVID=0 ;substitute IEN for GUID
S GMVWTIEN=$$GETTYPEI("WT"),GMVHTIEN=$$GETTYPEI("HT")
F GMRVSTR(1)=1:1:$L(GMRVSTR,";") S GMVTYPE=$P(GMRVSTR,";",GMRVSTR(1)) I $L(GMVTYPE) S GMVSTART=$S($P(GMRVSTR(0),U,1)>0:$P(GMRVSTR(0),U,1),1:0),GMVEND=$S($P(GMRVSTR(0),U,2):$P(GMRVSTR(0),U,2)+.000001,1:$$NOW^XLFDT()) D GETDATE
K GMRVSTR
Q
GETDATE ; Loop thru PXRMINDX xref
S GMVTIEN=$O(^GMRD(120.51,"C",GMVTYPE,0)) ;vital type ien
Q:'GMVTIEN
S GMVLOOP=GMVEND
F S GMVLOOP=$O(^PXRMINDX(120.5,"PI",DFN,GMVTIEN,GMVLOOP),-1) Q:GMVLOOP<GMVSTART!(GMVLOOP'>0)!(GMVMAX(GMVTYPE)'<GMVOCC) D GETNODE
Q
GETNODE ; Get patient record
N GMVCLIO,GMVQLIST,GMVQLOOP,GMVQNAME
S GMVIEN=0
F S GMVIEN=$O(^PXRMINDX(120.5,"PI",DFN,GMVTIEN,GMVLOOP,GMVIEN)) Q:$L(GMVIEN)'>0!(GMVMAX(GMVTYPE)'<GMVOCC) D
.I GMVIEN=+GMVIEN D
..D F1205^GMVUTL(.GMVCLIO,GMVIEN)
.I GMVIEN'=+GMVIEN D
..D CLIO^GMVUTL(.GMVCLIO,GMVIEN)
.S GMVCLIO(0)=$G(GMVCLIO(0)),GMVCLIO(5)=$G(GMVCLIO(5))
.I GMVCLIO(0)=""!($P(GMVCLIO(0),U,8)="") Q
.I $L(GMRVSTR("LT")) Q:$P(GMVCLIO(0),U,5)'>0 Q:GMRVSTR("LT")'[("^"_$$GET1^DIQ(44,$P(GMVCLIO(0),U,5)_",",2,"I")_"^") ;hospital location check
.S GMVMAX(GMVTYPE)=GMVMAX(GMVTYPE)+1
.S GMVRATE=$P(GMVCLIO(0),U,8)
.D ZERONODE
.S GMVQLIST=""
.F GMVQLOOP=1:1 Q:$P($G(GMVCLIO(5)),U,GMVQLOOP)="" D
..S GMVQNAME=$$FIELD^GMVGETQL($P(GMVCLIO(5),U,GMVQLOOP),1,"E")
..I GMVQNAME=""!(GMVQNAME=-1) Q
..S GMVQLIST=GMVQLIST_$S(GMVQLIST'="":";",1:"")_GMVQNAME
.S $P(GMVDATA,U,17)=GMVQLIST
.S $P(GMVDATA,U,10)=$P(GMVQLIST,";",1)
.S $P(GMVDATA,U,11)=$P(GMVQLIST,";",2)
.I GMVTYPE="PO2" D PO2($P(GMVCLIO(0),U,10))
.D METRIC
.D:$P(GMVCLIO(0),U,3)=GMVWTIEN BMI ;calculate BMI for weight
.D:$$TEXT^GMVHS1(GMVRATE) ABNORMAL^GMVHS1
.I GMVIEN=+GMVIEN S GMVID=GMVIEN
.I GMVIEN'=+GMVIEN S GMVID=GMVID+1
.D SET
.Q
Q
GETTYPEI(GMVTIEN) ; Return vital type (120.51) ien
; GMVTIEN = vital type abbreviation
S GMVTIEN=$G(GMVTIEN)
I GMVTIEN="" Q 0
Q $O(^GMRD(120.51,"C",GMVTIEN,0))
;
ZERONODE ; Get zero node data
S GMVDATA=$P($G(GMVCLIO(0)),U,1,8)_"^^^^^^^^^"
Q
PO2(X) ; Get flow rate and liters/minute for Pulse Oximetry reading
N GMVCONC,GMVFLOW
S (GMVFLOW,GMVCONC)=""
I X["%" D
.S GMVCONC=$P(X,"%")
.I GMVCONC["l/min" S GMVCONC=$P(GMVCONC,"l/min",2)
I X["l/min" D
.S GMVFLOW=$P(X,"l/min")
.I GMVFLOW["%" S GMVFLOW=$P(GMVFLOW,"%",2)
S GMVFLOW=$$STRIP^XLFSTR(GMVFLOW," ")
S GMVCONC=$$STRIP^XLFSTR(GMVCONC," ")
S $P(GMVDATA,U,15)=GMVFLOW
S $P(GMVDATA,U,16)=GMVCONC
Q
METRIC ; Calculate metric value for temperature, height, weight and
; circumference/girth
N GMVMETRC
S GMVMETRC=""
Q:'$$TEXT^GMVHS1(GMVRATE) ;quit if not a numeric reading
I GMVTYPE="T" D
.S GMVMETRC=$J(GMVRATE-32*5/9,0,1)
.Q
I GMVTYPE="HT" D
.S GMVMETRC=$J(2.54*GMVRATE,0,2)
.Q
I GMVTYPE="WT" D
.S GMVMETRC=$J(GMVRATE*.45359237,0,2)
.Q
I GMVTYPE="CG" D
.S GMVMETRC=$J(2.54*GMVRATE,0,2)
.Q
I GMVTYPE="CVP" D
.S GMVMETRC=$J(GMVRATE/1.36,0,2)
.Q
I GMVMETRC]"" S $P(GMVDATA,U,13)=GMVMETRC
Q
BMI ; Calculate Body Mass Index
N GMVBMI
S GMVBMI=""
S GMVBMI=$$CALCBMI^GMVHS1(GMVCLIO(0))
S $P(GMVDATA,U,14)=GMVBMI
Q
SET ; Set UTILITY($J,"GMRVD") node
S:'GMVSORD ^UTILITY($J,"GMRVD",GMVTYPE,9999999-GMVLOOP,GMVID)=GMVDATA
S:GMVSORD ^UTILITY($J,"GMRVD",9999999-GMVLOOP,GMVTYPE,GMVID)=GMVDATA
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMVHS 7668 printed Dec 13, 2024@01:59:20 Page 2
GMVHS ;HIOFO/FT-RETURN PATIENT DATA UTILITY ;10/3/07
+1 ;;5.0;GEN. MED. REC. - VITALS;**3,23**;Oct 31, 2002;Build 25
+2 ;
+3 ; This routine uses the following IAs:
+4 ; #4290 - ^PXRMINDX global (controlled)
+5 ; #10040 - FILE 44 references (supported)
+6 ; #10103 - ^XLFDT calls (supported)
+7 ; #10104 - ^XLFSTR calls (supported)
+8 ;
+9 ; This routine supports the following IAs:
+10 ; EN1 - 4791 (private)
+11 ;
EN1 ; Entry to gather patient's vital/measurement data
+1 ; Input variables
+2 ;
+3 ; DFN = Entry number of patient in Patient file. (Required)
+4 ; GMRVSTR = types of vital/measurements desired. Use the abbreviations
+5 ; found in the Vital Type (120.51) file. For multiple
+6 ; vitals, use the ; as a delimiter. (Required)
+7 ; GMRVSTR(0) = GMRVSTDT^GMRVENDT^GMRVOCC^GMRVSORD
+8 ; where GMRVSTDT = The start date/time that the utility will
+9 ; use in obtaining patient data. (Required)
+10 ; GMRVENDT = The end date/time that the utility will use
+11 ; to stop the search. (Required)
+12 ; GMRVOCC = The number of occurrences of the data that
+13 ; is desired by the search. (Required)
+14 ; GMRVSORD = The sort order desired in output. 0 will sort
+15 ; the data by vital type, then by date/time entered.
+16 ; 1 will sort the data by date/time entered, then by
+17 ; vital type. (REQUIRED)
+18 ; GMRVSTR("LT") = ^TYP1^[TYP2^...] (OPTIONAL)
+19 ; THIS VARIABLE IS AN ^ DELIMITED LIST OF HOSPITAL LOCATION
+20 ; TYPES TO EXTRACT MEASUREMENT DATA FOR. E.G., ^C^M^, WILL
+21 ; EXTRACT DATA FOR ONLY THOSE MEASUREMENTS TAKEN ON CLINICS
+22 ; OR MODULES.
+23 ;
+24 ; Output variables:
+25 ;
+26 ; The utility will create an array with the desired information. The
+27 ; array structure will be as follows if '$P(GMRVSTR(0),U,4):
+28 ; ^UTILITY($J,"GMRVD",GMRVTYP,GMRVRDT,GMRVIEN)=GMRVDATA
+29 ; or if $P(GMRVSTR(0),U,4) then the following will be returned:
+30 ; ^UTILITY($J,"GMRVD",GMRVRDT,GMRVTYP,GMRVIEN)=GMRVDATA
+31 ; where GMRVRDT = Reverse FileMan date/time.
+32 ; 9999999-Date/time vital/measurement was taken.
+33 ; GMRVTYP = The abbreviation used in the GMRVSTR string for the
+34 ; type of vital/measurement taken.
+35 ; GMRVIEN = Entry number in FILE 120.5 or
+36 ; pseudo entry number for File 704.117
+37 ;
+38 ; $P(GMRVDATA,"^",1) = date/time of the reading (FileMan internal)
+39 ; $P(GMRVDATA,"^",2) = Patient (#2) number (i.e., DFN)
+40 ; $P(GMRVDATA,"^",3) = vital type ien (File 120.51)
+41 ; $P(GMRVDATA,"^",4) = date/time of data entry (FileMan internal)
+42 ; $P(GMRVDATA,"^",5) = hospital location ien (File 44)
+43 ; $P(GMRVDATA,"^",6) = user ien (File 200)
+44 ; $P(GMRVDATA,"^",7) = always null
+45 ; $P(GMRVDATA,"^",8) = reading (e.g., 98.6, Unavailable)
+46 ; $P(GMRVDATA,"^",9) = always null
+47 ; $P(GMRVDATA,"^",10) = the first qualifier
+48 ; $P(GMRVDATA,"^",11) = the second qualifier
+49 ; $P(GMRVDATA,"^",12)= "*" for abnormal measurement, otherwise = ""
+50 ; $P(GMRVDATA,"^",13)= values in centigrade for T; kilos for WT;
+51 ; centimeters for HT and Circumference/Girth;
+52 ; and mmHg for CVP
+53 ; $P(GMRVDATA,"^",14)= Body Mass Index
+54 ; $P(GMRVDATA,"^",15)= L/Min of supplemental O2
+55 ; $P(GMRVDATA,"^",16)= % of supplemental O2
+56 ; $P(GMRVDATA,"^",17)= all qualifiers delimited by semi-colons
+57 ; The variable GMRVSTR will be killed upon exit.
+58 ;
+59 if '$DATA(GMRVSTR(0))!'($DATA(GMRVSTR)#2)!'($DATA(DFN)#2)
QUIT
+60 if DFN'>0
QUIT
+61 ;hospital location list
IF $GET(GMRVSTR("LT"))=""
SET GMRVSTR("LT")=""
HSKPING ; Housekeeping
+1 KILL ^UTILITY($JOB,"GMRVD")
+2 NEW GMVABNML,GMVDATA,GMVEND,GMVHTIEN,GMVID,GMVIEN,GMVLOOP,GMVMAX,GMVOCC,GMVRATE,GMVSORD,GMVSTART,GMVTIEN,GMVTYPE,GMVWTIEN
+3 DO RANGE^GMVHS1
+4 FOR GMVLOOP=1:1:$LENGTH(GMRVSTR,";")
Begin DoDot:1
+5 SET GMVTYPE=$PIECE(GMRVSTR,";",GMVLOOP)
+6 if GMVTYPE=""
QUIT
+7 SET GMVMAX(GMVTYPE)=0
+8 QUIT
End DoDot:1
+9 ;max # of occurrences
SET GMVOCC=$PIECE(GMRVSTR(0),U,3)
+10 ;sort order
SET GMVSORD=$PIECE(GMRVSTR(0),U,4)
+11 ;substitute IEN for GUID
SET GMVID=0
+12 SET GMVWTIEN=$$GETTYPEI("WT")
SET GMVHTIEN=$$GETTYPEI("HT")
+13 FOR GMRVSTR(1)=1:1:$LENGTH(GMRVSTR,";")
SET GMVTYPE=$PIECE(GMRVSTR,";",GMRVSTR(1))
IF $LENGTH(GMVTYPE)
SET GMVSTART=$SELECT($PIECE(GMRVSTR(0),U,1)>0:$PIECE(GMRVSTR(0),U,1),1:0)
SET GMVEND=$SELECT($PIECE(GMRVSTR(0),U,2):$PIECE(GMRVSTR(0),U,2)+.000001,1:$$NOW^XLFDT())
DO GETDATE
+14 KILL GMRVSTR
+15 QUIT
GETDATE ; Loop thru PXRMINDX xref
+1 ;vital type ien
SET GMVTIEN=$ORDER(^GMRD(120.51,"C",GMVTYPE,0))
+2 if 'GMVTIEN
QUIT
+3 SET GMVLOOP=GMVEND
+4 FOR
SET GMVLOOP=$ORDER(^PXRMINDX(120.5,"PI",DFN,GMVTIEN,GMVLOOP),-1)
if GMVLOOP<GMVSTART!(GMVLOOP'>0)!(GMVMAX(GMVTYPE)'<GMVOCC)
QUIT
DO GETNODE
+5 QUIT
GETNODE ; Get patient record
+1 NEW GMVCLIO,GMVQLIST,GMVQLOOP,GMVQNAME
+2 SET GMVIEN=0
+3 FOR
SET GMVIEN=$ORDER(^PXRMINDX(120.5,"PI",DFN,GMVTIEN,GMVLOOP,GMVIEN))
if $LENGTH(GMVIEN)'>0!(GMVMAX(GMVTYPE)'<GMVOCC)
QUIT
Begin DoDot:1
+4 IF GMVIEN=+GMVIEN
Begin DoDot:2
+5 DO F1205^GMVUTL(.GMVCLIO,GMVIEN)
End DoDot:2
+6 IF GMVIEN'=+GMVIEN
Begin DoDot:2
+7 DO CLIO^GMVUTL(.GMVCLIO,GMVIEN)
End DoDot:2
+8 SET GMVCLIO(0)=$GET(GMVCLIO(0))
SET GMVCLIO(5)=$GET(GMVCLIO(5))
+9 IF GMVCLIO(0)=""!($PIECE(GMVCLIO(0),U,8)="")
QUIT
+10 ;hospital location check
IF $LENGTH(GMRVSTR("LT"))
if $PIECE(GMVCLIO(0),U,5)'>0
QUIT
if GMRVSTR("LT")'[("^"_$$GET1^DIQ(44,$PIECE(GMVCLIO(0),U,5)_",",2,"I")_"^")
QUIT
+11 SET GMVMAX(GMVTYPE)=GMVMAX(GMVTYPE)+1
+12 SET GMVRATE=$PIECE(GMVCLIO(0),U,8)
+13 DO ZERONODE
+14 SET GMVQLIST=""
+15 FOR GMVQLOOP=1:1
if $PIECE($GET(GMVCLIO(5)),U,GMVQLOOP)=""
QUIT
Begin DoDot:2
+16 SET GMVQNAME=$$FIELD^GMVGETQL($PIECE(GMVCLIO(5),U,GMVQLOOP),1,"E")
+17 IF GMVQNAME=""!(GMVQNAME=-1)
QUIT
+18 SET GMVQLIST=GMVQLIST_$SELECT(GMVQLIST'="":";",1:"")_GMVQNAME
End DoDot:2
+19 SET $PIECE(GMVDATA,U,17)=GMVQLIST
+20 SET $PIECE(GMVDATA,U,10)=$PIECE(GMVQLIST,";",1)
+21 SET $PIECE(GMVDATA,U,11)=$PIECE(GMVQLIST,";",2)
+22 IF GMVTYPE="PO2"
DO PO2($PIECE(GMVCLIO(0),U,10))
+23 DO METRIC
+24 ;calculate BMI for weight
if $PIECE(GMVCLIO(0),U,3)=GMVWTIEN
DO BMI
+25 if $$TEXT^GMVHS1(GMVRATE)
DO ABNORMAL^GMVHS1
+26 IF GMVIEN=+GMVIEN
SET GMVID=GMVIEN
+27 IF GMVIEN'=+GMVIEN
SET GMVID=GMVID+1
+28 DO SET
+29 QUIT
End DoDot:1
+30 QUIT
GETTYPEI(GMVTIEN) ; Return vital type (120.51) ien
+1 ; GMVTIEN = vital type abbreviation
+2 SET GMVTIEN=$GET(GMVTIEN)
+3 IF GMVTIEN=""
QUIT 0
+4 QUIT $ORDER(^GMRD(120.51,"C",GMVTIEN,0))
+5 ;
ZERONODE ; Get zero node data
+1 SET GMVDATA=$PIECE($GET(GMVCLIO(0)),U,1,8)_"^^^^^^^^^"
+2 QUIT
PO2(X) ; Get flow rate and liters/minute for Pulse Oximetry reading
+1 NEW GMVCONC,GMVFLOW
+2 SET (GMVFLOW,GMVCONC)=""
+3 IF X["%"
Begin DoDot:1
+4 SET GMVCONC=$PIECE(X,"%")
+5 IF GMVCONC["l/min"
SET GMVCONC=$PIECE(GMVCONC,"l/min",2)
End DoDot:1
+6 IF X["l/min"
Begin DoDot:1
+7 SET GMVFLOW=$PIECE(X,"l/min")
+8 IF GMVFLOW["%"
SET GMVFLOW=$PIECE(GMVFLOW,"%",2)
End DoDot:1
+9 SET GMVFLOW=$$STRIP^XLFSTR(GMVFLOW," ")
+10 SET GMVCONC=$$STRIP^XLFSTR(GMVCONC," ")
+11 SET $PIECE(GMVDATA,U,15)=GMVFLOW
+12 SET $PIECE(GMVDATA,U,16)=GMVCONC
+13 QUIT
METRIC ; Calculate metric value for temperature, height, weight and
+1 ; circumference/girth
+2 NEW GMVMETRC
+3 SET GMVMETRC=""
+4 ;quit if not a numeric reading
if '$$TEXT^GMVHS1(GMVRATE)
QUIT
+5 IF GMVTYPE="T"
Begin DoDot:1
+6 SET GMVMETRC=$JUSTIFY(GMVRATE-32*5/9,0,1)
+7 QUIT
End DoDot:1
+8 IF GMVTYPE="HT"
Begin DoDot:1
+9 SET GMVMETRC=$JUSTIFY(2.54*GMVRATE,0,2)
+10 QUIT
End DoDot:1
+11 IF GMVTYPE="WT"
Begin DoDot:1
+12 SET GMVMETRC=$JUSTIFY(GMVRATE*.45359237,0,2)
+13 QUIT
End DoDot:1
+14 IF GMVTYPE="CG"
Begin DoDot:1
+15 SET GMVMETRC=$JUSTIFY(2.54*GMVRATE,0,2)
+16 QUIT
End DoDot:1
+17 IF GMVTYPE="CVP"
Begin DoDot:1
+18 SET GMVMETRC=$JUSTIFY(GMVRATE/1.36,0,2)
+19 QUIT
End DoDot:1
+20 IF GMVMETRC]""
SET $PIECE(GMVDATA,U,13)=GMVMETRC
+21 QUIT
BMI ; Calculate Body Mass Index
+1 NEW GMVBMI
+2 SET GMVBMI=""
+3 SET GMVBMI=$$CALCBMI^GMVHS1(GMVCLIO(0))
+4 SET $PIECE(GMVDATA,U,14)=GMVBMI
+5 QUIT
SET ; Set UTILITY($J,"GMRVD") node
+1 if 'GMVSORD
SET ^UTILITY($JOB,"GMRVD",GMVTYPE,9999999-GMVLOOP,GMVID)=GMVDATA
+2 if GMVSORD
SET ^UTILITY($JOB,"GMRVD",9999999-GMVLOOP,GMVTYPE,GMVID)=GMVDATA
+3 QUIT