GMVGR1 ;HIOFO/YH,FT-SET ^TMP($J) GLOBAL ;11/29/02 13:34
;;5.0;GEN. MED. REC. - VITALS;**1**;Oct 31, 2002
;
; This routine uses the following IAs:
; #10061 - ^VADPT calls (supported)
; #10104 - ^XLFSTR calls (supported)
;
GRAPH ;CONTINUTATION OF GMVGR0
S (GCNT,GCNTD,GPG)=0 D DEM^VADPT,INP^VADPT,SETV
F GK="H","W","T","P","R","B","I","O","PO2","CVP","CG","PN" D
. S ^TMP($J,"GTNM",GK)=0 F GI=0:0 S GI=$O(^TMP($J,"GMRVG",GK,GI)) Q:GI'>0 S GJ="" F X=0:0 S GJ=$O(^TMP($J,"GMRVG",GK,GI,GJ)) Q:GJ="" S ^TMP($J,"GTNM",GK)=^TMP($J,"GTNM",GK)+1,^TMP($J,"GDT",GI)=""
S GTNM=0 F X=0:0 S X=$O(^TMP($J,"GDT",X)) Q:X'>0 S GTNM=GTNM+1
S GPG=$S(GTNM=0:1,1:GTNM\10+''(GTNM#10)),GDT1=0
F GPGS=1:1:GPG D
. F GI=1:1:200 S ^TMP($J,"GMRK","G"_GI)=""
. K GMRQUAL S ^TMP($J,"GMRK","G199")="Page "_GPGS D SETP,DATE S ^TMP($J,"GMRK","G200")=GMRRMBD
. D PAGE,EN1^GMVGR2,EN2^GMVGR3,EN3^GMVGR4,EN4^GMVGR6 S ^TMP($J,"GMRK","G50M")=0.2,^TMP($J,"GMRK","G82M")=0.6
D KVAR^VADPT K VA Q
PAGE ;Set temp. and pulse starting point in the graph
D SETV
I ^TMP($J,"GMRK","G50")="" F GI=51:1:59 S ^TMP($J,"GMRK","G50")=^TMP($J,"GMRK","G"_GI),^TMP($J,"GMRK","G50M")=0.2+(1.6*(GI-50)) Q:^TMP($J,"GMRK","G50")'=""
I ^TMP($J,"GMRK","G82")="" F GI=83:1:91 S ^TMP($J,"GMRK","G82")=^TMP($J,"GMRK","G"_GI),^TMP($J,"GMRK","G82M")=0.6+(1.6*(GI-82)) Q:^TMP($J,"GMRK","G82")'=""
I $D(GMRQUAL) D LEGEND^GMVLGQU
K GG,GI,GMRVJ,GSYNO Q
SETV ;Set patient data in ^TMP($J,"GMRK" global
S ^TMP($J,"GMRK","G194")=$S(VADM(1)'="":VADM(1),1:" ")_" "_$S(VADM(2)'="":$P(VADM(2),"^",2),1:" "),GDOB=$S($D(VADM(3)):$P(VADM(3),"^",2),1:" "),GAGE=$S($D(VADM(4)):VADM(4),1:" ")
S ^TMP($J,"GMRK","G197")=$S($D(VADM(5)):$P(VADM(5),"^",2),1:" "),^TMP($J,"GMRK","G198")=$S($D(GMRWARD(1)):"Unit: "_GMRWARD(1),1:"Unit: ")
S GMRRMBD=$S('(VAIN(5)=""):"Room: "_$P(VAIN(5),"-",1,2),1:"Room: "),^TMP($J,"GMRK","G196")=$S($D(GDOB)&($D(GAGE)):GDOB_" ("_GAGE_")",1:" ")
I '$D(GMRVHLOC) S GMRVHLOC=$$HOSPLOC^GMVUTL1(+$G(VAIN(4)))
S GMRDIV="Division: "_$$DIVISION^GMVUTL1(+GMRVHLOC)
Q
DATE F GCNTD=1:1:10 S:$L(GDT1) GDT1=$O(^TMP($J,"GDT",GDT1)) S ^TMP($J,"GMRK","G"_GCNTD)=$S($L(GDT1):$E(GDT1,4,5)_"-"_$E(GDT1,6,7)_"-"_$E(GDT1,2,3),1:"") D DATE1
Q
DATE1 S Y=$E($P(GDT1,".",2)_"0000",1,4),^TMP($J,"GMRK","G"_(GCNTD+16))=$S($L(GDT1):$E(Y,1,2)_":"_$E(Y,3,4),1:"") D SETD
Q
SETD F GI="H","W","T","P","R","B","I","O","C","PN" S GJ=$F("WTXPXRBIOCH",GI),GK=$S($L(GDT1):$O(^TMP($J,"GMRVG",GI,GDT1,"")),1:"") D SETA
F GI="PO2","CVP","CG" S GJ=0,GK=$S($L(GDT1):$O(^TMP($J,"GMRVG",GI,GDT1,"")),1:"") D SETA
Q
SETA ;Store measurements in ^TMP($J,"GMRK" global
I GK="Unavailable" S GK="Unavail"
I GI="PN" S ^TMP($J,"GMRK","G"_(1660+GCNTD))=GK Q
S (GMRSITE,GMRSITE(1),GMRINF,GMRVJ)=""
I GK'="" D
. S GMRSITE(1)=$P($G(^TMP($J,"GMRVG",GI,GDT1,GK)),"^"),GMRVJ=$P($G(^(GK)),"^",2),GMRINF=$P($G(^(GK)),"^",4)
. I GMRSITE(1)'="" D SYNOARY^GMVLGQU
I GI="H" D Q
. S ^TMP($J,"GMRK","G"_(270+GCNTD))=GK_" "_GMRSITE,^TMP($J,"GMRK","G"_(290+GCNTD))=$S(GK>0:$J(GK*2.54,0,2),1:"") S:GK>0 GMRHT=(GK*2.54)/100
I GI="C" S ^TMP($J,"GMRK","G"_(1640+GCNTD))=GK_" "_^TMP($J,"GMRK","G"_(1640+GCNTD)) Q
I GI="PO2"!(GI="CVP")!(GI="CG") D Q
. I GI="PO2" D
. . S (GMRINF(1),GMRINF(2))="" I GMRINF'="" D PO2^GMVLGQU(.GMRINF)
. . S ^TMP($J,"GMRK","G"_(1100+GCNTD))=GK_$S(GMRVJ=1:"*",1:" ")
. . S ^TMP($J,"GMRK","G"_(1130+GCNTD))=GMRINF(1)
. . S ^TMP($J,"GMRK","G"_(1150+GCNTD))=GMRINF(2)
. . S ^TMP($J,"GMRK","G"_(1170+GCNTD))=GMRSITE
. . Q
. I GI="CVP" D
. . S ^TMP($J,"GMRK","G"_(1200+GCNTD))=$S(GK>0!(GK<0):$J(GK,0,1),1:GK)_$S(GMRVJ=1:"*",1:" ")
. . S ^TMP($J,"GMRK","G"_(1230+GCNTD))=$S(GK>0!(GK<0)!($E(GK)="0"):$J(GK/1.36,0,1),1:"")_$S(GMRVJ=1:"*",1:" ")
. . Q
. I GI="CG" D
. . S ^TMP($J,"GMRK","G"_(1250+GCNTD))=GK_" "_GMRSITE,^TMP($J,"GMRK","G"_(1320+GCNTD))=$S(GK>0:$J(GK/.3937,0,2),1:"")
. . Q
I GI="B",GK'="" S ^TMP($J,"GMRK","G"_(250+GCNTD))=$S($L(GMRSITE," ")>3:$P(GMRSITE," ",2,4),1:GMRSITE) S:$L(GMRSITE," ")>3 ^TMP($J,"GMRK","G"_(1640+GCNTD))=$P(GMRSITE," ")
I '(GI="T"!(GI="P")) D Q
. I GI="C" S GMRSITE=$S($L(GMRSITE," ")>3:" "_$P(GMRSITE," "),1:"")
. S ^TMP($J,"GMRK","G"_(GJ*16+GCNTD+1))=GK_$S(GMRVJ=1&(GI'="C"):"*",1:" ")_$S(GI="B":"",1:GMRSITE) S:GI="W" ^TMP($J,"GMRK","G"_(310+GCNTD))=$S(GK>0:$J(GK/2.2,0,2),1:"")
. I GK>0,GI="W" D
. . S GMRBMI="",GMRBMI(1)=GDT1,GMRBMI(2)=GK D CALBMI^GMVBMI(.GMRBMI)
. . S ^TMP($J,"GMRK","G"_(330+GCNTD))=GMRBMI K GMRBMI
I GI="T",GK>0 S ^TMP($J,"GMRK","G"_(GJ*16+GCNTD+1))=106-GK
I GK'="",GI="P","UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GK) D
. I GMRSITE(1)["RADIAL"!(GMRSITE(1)["APICAL")!(GMRSITE(1)["BRACHIAL") D
. . S ^TMP($J,"GMRK","G"_(GJ*16+GCNTD+1))=170-GK/10
S ^TMP($J,"GMRK","G"_(GJ+1*16+GCNTD+1))=GK_$S(GMRVJ=1:"*",1:" ")_$S(GI="T":GMRSITE,GI="P"&($L(GMRSITE," ")>3):" "_$P(GMRSITE," "),1:"")
I GI="T",GK>0 S ^TMP($J,"GMRK","G"_(210+GCNTD))=$S(GMRVJ=1:"T*",1:"T")
I GI="P",GK'="","UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GK) D
. I GMRSITE(1)["RADIAL"!(GMRSITE(1)["APICAL")!(GMRSITE(1)["BRACHIAL") S ^TMP($J,"GMRK","G"_(230+GCNTD))=$S(GMRVJ=1:"P*",1:"P")
. S ^TMP($J,"GMRK","G"_(1300+GCNTD))=$S($L(GMRSITE," ")>3:$P(GMRSITE," ",2,4),1:GMRSITE)
I GK>0,GI="T" S ^TMP($J,"GMRK","G"_(GJ*16+GCNTD+1))=$S(^("G"_(GJ*16+GCNTD+1))<1.5:1.5,^("G"_(GJ*16+GCNTD+1))>12.7:12.7,1:^("G"_(GJ*16+GCNTD+1))) S:^("G"_(GJ*16+GCNTD+1))<1.6!(^("G"_(GJ*16+GCNTD+1))>12.6) ^TMP($J,"GMRK","G"_(210+GCNTD))="T**"
I GK'="",GI="P","UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GK) D
. I GMRSITE(1)["RADIAL"!(GMRSITE(1)["APICAL")!(GMRSITE(1)["BRACHIAL") D
. . S ^TMP($J,"GMRK","G"_(GJ*16+GCNTD+1))=$S(^("G"_(GJ*16+GCNTD+1))<1.5:1.5,^("G"_(GJ*16+GCNTD+1))>12.7:12.7,1:^("G"_(GJ*16+GCNTD+1)))
. . S:^TMP($J,"GMRK","G"_(GJ*16+GCNTD+1))<1.6!(^("G"_(GJ*16+GCNTD+1))>12.6) ^TMP($J,"GMRK","G"_(230+GCNTD))="P**"
Q
SETP ;INITIALIZE ^TMP FOR HEIGHT, WEIGHT AND V/M QUALIFIERS
;250+I: BP QUALIFIER 270+I: HEIGHT IN INCH 290+I: HEIGHT IN CM
;310+I:WEIGHT IN KG 330+I: BMI
;1100+I: PULSE OXIMETRY DATA 1130+I: PULSE OX. L/MIN
;1150+I: PULSE OX. % 1170+I: PULSE OX. METHOD
;1200+I: CVP DATA IN CM H2O 1230+I: CVP DATA IN MMHG
;1250+I: C/G DATA IN INCH 1270+I: C/G QUALIFIER 1300+I: PULSE QUALIFIER
;1320+I: C/G DATA IN CM 1640+I: THIRD PIECE OF BP 1660+I: PAIN
F I=1:1:10 D
. S (^TMP($J,"GMRK","G"_(210+I)),^("G"_(230+I)),^("G"_(250+I)),^("G"_(270+I)),^("G"_(290+I)),^("G"_(310+I)),^("G"_(330+I)),^("G"_(1300+I)))=""
. S (^TMP($J,"GMRK","G"_(1100+I)),^("G"_(1130+I)),^("G"_(1150+I)),^("G"_(1170+I)),^("G"_(1200+I)),^("G"_(1230+I)),^("G"_(1250+I)),^("G"_(1270+I)))=""
. S (^TMP($J,"GMRK","G"_(1320+I)),^("G"_(1640+I)),^("G"_(1660+I)))=""
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMVGR1 6752 printed Dec 13, 2024@01:58:57 Page 2
GMVGR1 ;HIOFO/YH,FT-SET ^TMP($J) GLOBAL ;11/29/02 13:34
+1 ;;5.0;GEN. MED. REC. - VITALS;**1**;Oct 31, 2002
+2 ;
+3 ; This routine uses the following IAs:
+4 ; #10061 - ^VADPT calls (supported)
+5 ; #10104 - ^XLFSTR calls (supported)
+6 ;
GRAPH ;CONTINUTATION OF GMVGR0
+1 SET (GCNT,GCNTD,GPG)=0
DO DEM^VADPT
DO INP^VADPT
DO SETV
+2 FOR GK="H","W","T","P","R","B","I","O","PO2","CVP","CG","PN"
Begin DoDot:1
+3 SET ^TMP($JOB,"GTNM",GK)=0
FOR GI=0:0
SET GI=$ORDER(^TMP($JOB,"GMRVG",GK,GI))
if GI'>0
QUIT
SET GJ=""
FOR X=0:0
SET GJ=$ORDER(^TMP($JOB,"GMRVG",GK,GI,GJ))
if GJ=""
QUIT
SET ^TMP($JOB,"GTNM",GK)=^TMP($JOB,"GTNM",GK)+1
SET ^TMP($JOB,"GDT",GI)=""
End DoDot:1
+4 SET GTNM=0
FOR X=0:0
SET X=$ORDER(^TMP($JOB,"GDT",X))
if X'>0
QUIT
SET GTNM=GTNM+1
+5 SET GPG=$SELECT(GTNM=0:1,1:GTNM\10+''(GTNM#10))
SET GDT1=0
+6 FOR GPGS=1:1:GPG
Begin DoDot:1
+7 FOR GI=1:1:200
SET ^TMP($JOB,"GMRK","G"_GI)=""
+8 KILL GMRQUAL
SET ^TMP($JOB,"GMRK","G199")="Page "_GPGS
DO SETP
DO DATE
SET ^TMP($JOB,"GMRK","G200")=GMRRMBD
+9 DO PAGE
DO EN1^GMVGR2
DO EN2^GMVGR3
DO EN3^GMVGR4
DO EN4^GMVGR6
SET ^TMP($JOB,"GMRK","G50M")=0.2
SET ^TMP($JOB,"GMRK","G82M")=0.6
End DoDot:1
+10 DO KVAR^VADPT
KILL VA
QUIT
PAGE ;Set temp. and pulse starting point in the graph
+1 DO SETV
+2 IF ^TMP($JOB,"GMRK","G50")=""
FOR GI=51:1:59
SET ^TMP($JOB,"GMRK","G50")=^TMP($JOB,"GMRK","G"_GI)
SET ^TMP($JOB,"GMRK","G50M")=0.2+(1.6*(GI-50))
if ^TMP($JOB,"GMRK","G50")'=""
QUIT
+3 IF ^TMP($JOB,"GMRK","G82")=""
FOR GI=83:1:91
SET ^TMP($JOB,"GMRK","G82")=^TMP($JOB,"GMRK","G"_GI)
SET ^TMP($JOB,"GMRK","G82M")=0.6+(1.6*(GI-82))
if ^TMP($JOB,"GMRK","G82")'=""
QUIT
+4 IF $DATA(GMRQUAL)
DO LEGEND^GMVLGQU
+5 KILL GG,GI,GMRVJ,GSYNO
QUIT
SETV ;Set patient data in ^TMP($J,"GMRK" global
+1 SET ^TMP($JOB,"GMRK","G194")=$SELECT(VADM(1)'="":VADM(1),1:" ")_" "_$SELECT(VADM(2)'="":$PIECE(VADM(2),"^",2),1:" ")
SET GDOB=$SELECT($DATA(VADM(3)):$PIECE(VADM(3),"^",2),1:" ")
SET GAGE=$SELECT($DATA(VADM(4)):VADM(4),1:" ")
+2 SET ^TMP($JOB,"GMRK","G197")=$SELECT($DATA(VADM(5)):$PIECE(VADM(5),"^",2),1:" ")
SET ^TMP($JOB,"GMRK","G198")=$SELECT($DATA(GMRWARD(1)):"Unit: "_GMRWARD(1),1:"Unit: ")
+3 SET GMRRMBD=$SELECT('(VAIN(5)=""):"Room: "_$PIECE(VAIN(5),"-",1,2),1:"Room: ")
SET ^TMP($JOB,"GMRK","G196")=$SELECT($DATA(GDOB)&($DATA(GAGE)):GDOB_" ("_GAGE_")",1:" ")
+4 IF '$DATA(GMRVHLOC)
SET GMRVHLOC=$$HOSPLOC^GMVUTL1(+$GET(VAIN(4)))
+5 SET GMRDIV="Division: "_$$DIVISION^GMVUTL1(+GMRVHLOC)
+6 QUIT
DATE FOR GCNTD=1:1:10
if $LENGTH(GDT1)
SET GDT1=$ORDER(^TMP($JOB,"GDT",GDT1))
SET ^TMP($JOB,"GMRK","G"_GCNTD)=$SELECT($LENGTH(GDT1):$EXTRACT(GDT1,4,5)_"-"_$EXTRACT(GDT1,6,7)_"-"_$EXTRACT(GDT1,2,3),1:"")
DO DATE1
+1 QUIT
DATE1 SET Y=$EXTRACT($PIECE(GDT1,".",2)_"0000",1,4)
SET ^TMP($JOB,"GMRK","G"_(GCNTD+16))=$SELECT($LENGTH(GDT1):$EXTRACT(Y,1,2)_":"_$EXTRACT(Y,3,4),1:"")
DO SETD
+1 QUIT
SETD FOR GI="H","W","T","P","R","B","I","O","C","PN"
SET GJ=$FIND("WTXPXRBIOCH",GI)
SET GK=$SELECT($LENGTH(GDT1):$ORDER(^TMP($JOB,"GMRVG",GI,GDT1,"")),1:"")
DO SETA
+1 FOR GI="PO2","CVP","CG"
SET GJ=0
SET GK=$SELECT($LENGTH(GDT1):$ORDER(^TMP($JOB,"GMRVG",GI,GDT1,"")),1:"")
DO SETA
+2 QUIT
SETA ;Store measurements in ^TMP($J,"GMRK" global
+1 IF GK="Unavailable"
SET GK="Unavail"
+2 IF GI="PN"
SET ^TMP($JOB,"GMRK","G"_(1660+GCNTD))=GK
QUIT
+3 SET (GMRSITE,GMRSITE(1),GMRINF,GMRVJ)=""
+4 IF GK'=""
Begin DoDot:1
+5 SET GMRSITE(1)=$PIECE($GET(^TMP($JOB,"GMRVG",GI,GDT1,GK)),"^")
SET GMRVJ=$PIECE($GET(^(GK)),"^",2)
SET GMRINF=$PIECE($GET(^(GK)),"^",4)
+6 IF GMRSITE(1)'=""
DO SYNOARY^GMVLGQU
End DoDot:1
+7 IF GI="H"
Begin DoDot:1
+8 SET ^TMP($JOB,"GMRK","G"_(270+GCNTD))=GK_" "_GMRSITE
SET ^TMP($JOB,"GMRK","G"_(290+GCNTD))=$SELECT(GK>0:$JUSTIFY(GK*2.54,0,2),1:"")
if GK>0
SET GMRHT=(GK*2.54)/100
End DoDot:1
QUIT
+9 IF GI="C"
SET ^TMP($JOB,"GMRK","G"_(1640+GCNTD))=GK_" "_^TMP($JOB,"GMRK","G"_(1640+GCNTD))
QUIT
+10 IF GI="PO2"!(GI="CVP")!(GI="CG")
Begin DoDot:1
+11 IF GI="PO2"
Begin DoDot:2
+12 SET (GMRINF(1),GMRINF(2))=""
IF GMRINF'=""
DO PO2^GMVLGQU(.GMRINF)
+13 SET ^TMP($JOB,"GMRK","G"_(1100+GCNTD))=GK_$SELECT(GMRVJ=1:"*",1:" ")
+14 SET ^TMP($JOB,"GMRK","G"_(1130+GCNTD))=GMRINF(1)
+15 SET ^TMP($JOB,"GMRK","G"_(1150+GCNTD))=GMRINF(2)
+16 SET ^TMP($JOB,"GMRK","G"_(1170+GCNTD))=GMRSITE
+17 QUIT
End DoDot:2
+18 IF GI="CVP"
Begin DoDot:2
+19 SET ^TMP($JOB,"GMRK","G"_(1200+GCNTD))=$SELECT(GK>0!(GK<0):$JUSTIFY(GK,0,1),1:GK)_$SELECT(GMRVJ=1:"*",1:" ")
+20 SET ^TMP($JOB,"GMRK","G"_(1230+GCNTD))=$SELECT(GK>0!(GK<0)!($EXTRACT(GK)="0"):$JUSTIFY(GK/1.36,0,1),1:"")_$SELECT(GMRVJ=1:"*",1:" ")
+21 QUIT
End DoDot:2
+22 IF GI="CG"
Begin DoDot:2
+23 SET ^TMP($JOB,"GMRK","G"_(1250+GCNTD))=GK_" "_GMRSITE
SET ^TMP($JOB,"GMRK","G"_(1320+GCNTD))=$SELECT(GK>0:$JUSTIFY(GK/.3937,0,2),1:"")
+24 QUIT
End DoDot:2
End DoDot:1
QUIT
+25 IF GI="B"
IF GK'=""
SET ^TMP($JOB,"GMRK","G"_(250+GCNTD))=$SELECT($LENGTH(GMRSITE," ")>3:$PIECE(GMRSITE," ",2,4),1:GMRSITE)
if $LENGTH(GMRSITE," ")>3
SET ^TMP($JOB,"GMRK","G"_(1640+GCNTD))=$PIECE(GMRSITE," ")
+26 IF '(GI="T"!(GI="P"))
Begin DoDot:1
+27 IF GI="C"
SET GMRSITE=$SELECT($LENGTH(GMRSITE," ")>3:" "_$PIECE(GMRSITE," "),1:"")
+28 SET ^TMP($JOB,"GMRK","G"_(GJ*16+GCNTD+1))=GK_$SELECT(GMRVJ=1&(GI'="C"):"*",1:" ")_$SELECT(GI="B":"",1:GMRSITE)
if GI="W"
SET ^TMP($JOB,"GMRK","G"_(310+GCNTD))=$SELECT(GK>0:$JUSTIFY(GK/2.2,0,2),1:"")
+29 IF GK>0
IF GI="W"
Begin DoDot:2
+30 SET GMRBMI=""
SET GMRBMI(1)=GDT1
SET GMRBMI(2)=GK
DO CALBMI^GMVBMI(.GMRBMI)
+31 SET ^TMP($JOB,"GMRK","G"_(330+GCNTD))=GMRBMI
KILL GMRBMI
End DoDot:2
End DoDot:1
QUIT
+32 IF GI="T"
IF GK>0
SET ^TMP($JOB,"GMRK","G"_(GJ*16+GCNTD+1))=106-GK
+33 IF GK'=""
IF GI="P"
IF "UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GK)
Begin DoDot:1
+34 IF GMRSITE(1)["RADIAL"!(GMRSITE(1)["APICAL")!(GMRSITE(1)["BRACHIAL")
Begin DoDot:2
+35 SET ^TMP($JOB,"GMRK","G"_(GJ*16+GCNTD+1))=170-GK/10
End DoDot:2
End DoDot:1
+36 SET ^TMP($JOB,"GMRK","G"_(GJ+1*16+GCNTD+1))=GK_$SELECT(GMRVJ=1:"*",1:" ")_$SELECT(GI="T":GMRSITE,GI="P"&($LENGTH(GMRSITE," ")>3):" "_$PIECE(GMRSITE," "),1:"")
+37 IF GI="T"
IF GK>0
SET ^TMP($JOB,"GMRK","G"_(210+GCNTD))=$SELECT(GMRVJ=1:"T*",1:"T")
+38 IF GI="P"
IF GK'=""
IF "UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GK)
Begin DoDot:1
+39 IF GMRSITE(1)["RADIAL"!(GMRSITE(1)["APICAL")!(GMRSITE(1)["BRACHIAL")
SET ^TMP($JOB,"GMRK","G"_(230+GCNTD))=$SELECT(GMRVJ=1:"P*",1:"P")
+40 SET ^TMP($JOB,"GMRK","G"_(1300+GCNTD))=$SELECT($LENGTH(GMRSITE," ")>3:$PIECE(GMRSITE," ",2,4),1:GMRSITE)
End DoDot:1
+41 IF GK>0
IF GI="T"
SET ^TMP($JOB,"GMRK","G"_(GJ*16+GCNTD+1))=$SELECT(^("G"_(GJ*16+GCNTD+1))<1.5:1.5,^("G"_(GJ*16+GCNTD+1))>12.7:12.7,1:^("G"_(GJ*16+GCNTD+1)))
if ^("G"_(GJ*16+GCNTD+1))<1.6!(^("G"_(GJ*16+GCNTD+1))>12.6)
SET ^TMP($JOB,"GMRK","G"_(210+GCNTD))="T**"
+42 IF GK'=""
IF GI="P"
IF "UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GK)
Begin DoDot:1
+43 IF GMRSITE(1)["RADIAL"!(GMRSITE(1)["APICAL")!(GMRSITE(1)["BRACHIAL")
Begin DoDot:2
+44 SET ^TMP($JOB,"GMRK","G"_(GJ*16+GCNTD+1))=$SELECT(^("G"_(GJ*16+GCNTD+1))<1.5:1.5,^("G"_(GJ*16+GCNTD+1))>12.7:12.7,1:^("G"_(GJ*16+GCNTD+1)))
+45 if ^TMP($JOB,"GMRK","G"_(GJ*16+GCNTD+1))<1.6!(^("G"_(GJ*16+GCNTD+1))>12.6)
SET ^TMP($JOB,"GMRK","G"_(230+GCNTD))="P**"
End DoDot:2
End DoDot:1
+46 QUIT
SETP ;INITIALIZE ^TMP FOR HEIGHT, WEIGHT AND V/M QUALIFIERS
+1 ;250+I: BP QUALIFIER 270+I: HEIGHT IN INCH 290+I: HEIGHT IN CM
+2 ;310+I:WEIGHT IN KG 330+I: BMI
+3 ;1100+I: PULSE OXIMETRY DATA 1130+I: PULSE OX. L/MIN
+4 ;1150+I: PULSE OX. % 1170+I: PULSE OX. METHOD
+5 ;1200+I: CVP DATA IN CM H2O 1230+I: CVP DATA IN MMHG
+6 ;1250+I: C/G DATA IN INCH 1270+I: C/G QUALIFIER 1300+I: PULSE QUALIFIER
+7 ;1320+I: C/G DATA IN CM 1640+I: THIRD PIECE OF BP 1660+I: PAIN
+8 FOR I=1:1:10
Begin DoDot:1
+9 SET (^TMP($JOB,"GMRK","G"_(210+I)),^("G"_(230+I)),^("G"_(250+I)),^("G"_(270+I)),^("G"_(290+I)),^("G"_(310+I)),^("G"_(330+I)),^("G"_(1300+I)))=""
+10 SET (^TMP($JOB,"GMRK","G"_(1100+I)),^("G"_(1130+I)),^("G"_(1150+I)),^("G"_(1170+I)),^("G"_(1200+I)),^("G"_(1230+I)),^("G"_(1250+I)),^("G"_(1270+I)))=""
+11 SET (^TMP($JOB,"GMRK","G"_(1320+I)),^("G"_(1640+I)),^("G"_(1660+I)))=""
End DoDot:1
+12 QUIT