GMRVHG0 ;HIRMFO/YH-HP LASER SF 511 GRAPH - DATA ARRAY ;3/15/99
;;4.0;Vitals/Measurements;**1,7,11**;Apr 25, 1997
EN1 ;ENTRY POINT FROM GMRVSR0 TO PRINT SF-511 GRAPH FOR HP-3/4
S GMRHT=0 K ^TMP($J,"GMR"),^TMP($J,"GMRK"),^TMP($J,"GDT"),^TMP($J,"GMRVG"),^TMP($J,"GTNM") F GI=1:1:200 S ^TMP($J,"GMRK","G"_GI)=""
S (GMROUT,GHT)="",^TMP($J,"GMRK","G50M")=0.2,^TMP($J,"GMRK","G82M")=0.6
S GSTART1=(9999999-GMRFIN)-.0001,GEND1=9999999-GMRSTRT
F GTYPE="B","H","P","R","T","W","PO2","CVP","CG","PN" D SETT^GMRVGR0
S GRPT=5 D SETIO^GMRVGR0 U IO D GRAPH
Q1 K GSOL,GIVDT,GMRHLOC,GMRVJ,GDATA,GDT,GEN,GEND1,GI,GJ,GK,GMRVX,GSTART1,GTNM,GTYP,GTYPE,GX,I D KVAR^VADPT K VA,VAROOT
D QIO^GMRVGR5 K GRPT,GMRRMBD,GAGE,GCNT,GDOB,GCNTB,GCNTD,GCNTP,GCNTR,GCNTT,GCNTT1,GCNTI,GCNTO,GDT1,GCNTPD,GCNTTD,GCNTW,GPG,GPGS,GHT,GTYPE1,GCNTB3,GDTA,XDT,XIO,XX,^TMP($J,"GMRK"),^TMP($J,"GMR"),^TMP($J,"GDT"),^TMP($J,"GMRVG")
K GLINE,GMRQUAL,^TMP($J,"GTNM") Q
GRAPH D DEM^VADPT,INP^VADPT,SETV^GMRVGR1
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)=""
. S ^TMP($J,"GMRK","G199")="Page "_GPGS D SETP,DATE S ^TMP($J,"GMRK","G200")=GMRRMBD D PAGE D ^GMRVHG1 D
. . S ^TMP($J,"GMRK","G50M")=0.2,^TMP($J,"GMRK","G82M")=0.6,^TMP($J,"GMRK","G210M")=0.2,^TMP($J,"GMRK","G226M")=0.2
D KVAR^VADPT K VA,GRAPHT,GRAPHP,GRAPHS,GRAPHD,GPA Q
PAGE ;SET GRAPH DATA
;DATA FOR T GRAPH
D SETV^GMRVGR1
K GRAPHT S GRAPHT=0,I=1,J=411,GPA=0 F GI=50:1:59 S GRAPHT=0.4+((I-1)*1.6) D:^TMP($J,"GMRK","G"_GI)'="" S I=I+1,J=J+1
.S GRAPHT(I)=$S(GPA=0:"PA",1:"PD")_GRAPHT_","_^TMP($J,"GMRK","G"_GI)_";LB"_^TMP($J,"GMRK","G"_J)_"#;",GPA=1
;DATA FOR P GRAPH
K GRAPHP S GRAPHP=0,I=1,J=431,GPA=0 F GI=82:1:92 S GRAPHP=0.6+((I-1)*1.6) D:^TMP($J,"GMRK","G"_GI)'="" S I=I+1,J=J+1
.S GRAPHP(I)=$S(GPA=0:"PA",1:"PD")_GRAPHP_","_^TMP($J,"GMRK","G"_GI)_";LB"_^TMP($J,"GMRK","G"_J)_"#;",GPA=1
I $D(GMRQUAL) D LEGEND^GMRVLGQU
K GMRQUAL,GG,GI,GMRVJ,GSYNO,GHOLD Q
DATE S GHOLD="" 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" S GJ=$F("WTXPXRBIOCHDS",GI),GK=$S($L(GDT1):$O(^TMP($J,"GMRVG",GI,GDT1,"")),1:"") D SETA^GMRVHG4
F GI="PO2","CVP","CG","PN" S GJ=0,GK=$S($L(GDT1):$O(^TMP($J,"GMRVG",GI,GDT1,"")),1:"") D SETA^GMRVHG4
Q
SETP ;INITIALIZE ^TMP FOR HEIGHT AND V/M QUALIFIERS
;470 - STORE HEIGHT IN INCH 1100 - STORE HEIGHT IN CM
;1200 - STORE WEIGHT IN KG 1300 - STORE BODY MASS INDEX
; 410 - STORE T* 430 - STORE P* 450 - STORE BP QUALIFIER
;1400+I - PULSE OXIMETRY DATA 1430+I - PULSE OX. L/MIN
;1450+I - PULSE OX. % 1470+I - PULSE OX. METHOD
;1500+I - CVP DATA IN CM H2O 1530+I - CVP DATA IN MMHG
;1550+I - C/G DATA IN INCH 1570+I - C/G QUALIFIER 1600+I - PULSE QUALIFIER
;1620+I - C/G DATA IN CM 1640+I - THE THIRD PIECE OF BP
;1660+I - PAIN
F I=1:1:10 D
. S (^TMP($J,"GMRK","G"_(410+I)),^("G"_(430+I)),^("G"_(450+I)),^("G"_(470+I)),^("G"_(1100+I)),^("G"_(1200+I)),^("G"_(1300+I)),^("G"_(1640+I)))=""
. S (^TMP($J,"GMRK","G"_(1400+I)),^("G"_(1430+I)),^("G"_(1450+I)),^("G"_(1470+I)),^("G"_(1500+I)),^("G"_(1530+I)),^("G"_(1550+I)),^("G"_(1570+I)))=""
. S (^TMP($J,"GMRK","G"_(1600+I)),^("G"_(1620+I)),^("G"_(1660+I)))=""
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRVHG0 3813 printed Oct 16, 2024@17:57:23 Page 2
GMRVHG0 ;HIRMFO/YH-HP LASER SF 511 GRAPH - DATA ARRAY ;3/15/99
+1 ;;4.0;Vitals/Measurements;**1,7,11**;Apr 25, 1997
EN1 ;ENTRY POINT FROM GMRVSR0 TO PRINT SF-511 GRAPH FOR HP-3/4
+1 SET GMRHT=0
KILL ^TMP($JOB,"GMR"),^TMP($JOB,"GMRK"),^TMP($JOB,"GDT"),^TMP($JOB,"GMRVG"),^TMP($JOB,"GTNM")
FOR GI=1:1:200
SET ^TMP($JOB,"GMRK","G"_GI)=""
+2 SET (GMROUT,GHT)=""
SET ^TMP($JOB,"GMRK","G50M")=0.2
SET ^TMP($JOB,"GMRK","G82M")=0.6
+3 SET GSTART1=(9999999-GMRFIN)-.0001
SET GEND1=9999999-GMRSTRT
+4 FOR GTYPE="B","H","P","R","T","W","PO2","CVP","CG","PN"
DO SETT^GMRVGR0
+5 SET GRPT=5
DO SETIO^GMRVGR0
USE IO
DO GRAPH
Q1 KILL GSOL,GIVDT,GMRHLOC,GMRVJ,GDATA,GDT,GEN,GEND1,GI,GJ,GK,GMRVX,GSTART1,GTNM,GTYP,GTYPE,GX,I
DO KVAR^VADPT
KILL VA,VAROOT
+1 DO QIO^GMRVGR5
KILL GRPT,GMRRMBD,GAGE,GCNT,GDOB,GCNTB,GCNTD,GCNTP,GCNTR,GCNTT,GCNTT1,GCNTI,GCNTO,GDT1,GCNTPD,GCNTTD,GCNTW,GPG,GPGS,GHT,GTYPE1,GCNTB3,GDTA,XDT,XIO,XX,^TMP($JOB,"GMRK"),^TMP($JOB,"GMR"),^TMP($JOB,"GDT"),^TMP($JOB,"GMRVG")
+2 KILL GLINE,GMRQUAL,^TMP($JOB,"GTNM")
QUIT
GRAPH DO DEM^VADPT
DO INP^VADPT
DO SETV^GMRVGR1
+1 FOR GK="H","W","T","P","R","B","I","O","PO2","CVP","CG","PN"
Begin DoDot:1
+2 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
+3 SET GTNM=0
FOR X=0:0
SET X=$ORDER(^TMP($JOB,"GDT",X))
if X'>0
QUIT
SET GTNM=GTNM+1
+4 SET GPG=$SELECT(GTNM=0:1,1:GTNM\10+''(GTNM#10))
SET GDT1=0
+5 FOR GPGS=1:1:GPG
Begin DoDot:1
+6 FOR GI=1:1:200
SET ^TMP($JOB,"GMRK","G"_GI)=""
+7 SET ^TMP($JOB,"GMRK","G199")="Page "_GPGS
DO SETP
DO DATE
SET ^TMP($JOB,"GMRK","G200")=GMRRMBD
DO PAGE
DO ^GMRVHG1
Begin DoDot:2
+8 SET ^TMP($JOB,"GMRK","G50M")=0.2
SET ^TMP($JOB,"GMRK","G82M")=0.6
SET ^TMP($JOB,"GMRK","G210M")=0.2
SET ^TMP($JOB,"GMRK","G226M")=0.2
End DoDot:2
End DoDot:1
+9 DO KVAR^VADPT
KILL VA,GRAPHT,GRAPHP,GRAPHS,GRAPHD,GPA
QUIT
PAGE ;SET GRAPH DATA
+1 ;DATA FOR T GRAPH
+2 DO SETV^GMRVGR1
+3 KILL GRAPHT
SET GRAPHT=0
SET I=1
SET J=411
SET GPA=0
FOR GI=50:1:59
SET GRAPHT=0.4+((I-1)*1.6)
if ^TMP($JOB,"GMRK","G"_GI)'=""
Begin DoDot:1
+4 SET GRAPHT(I)=$SELECT(GPA=0:"PA",1:"PD")_GRAPHT_","_^TMP($JOB,"GMRK","G"_GI)_";LB"_^TMP($JOB,"GMRK","G"_J)_"#;"
SET GPA=1
End DoDot:1
SET I=I+1
SET J=J+1
+5 ;DATA FOR P GRAPH
+6 KILL GRAPHP
SET GRAPHP=0
SET I=1
SET J=431
SET GPA=0
FOR GI=82:1:92
SET GRAPHP=0.6+((I-1)*1.6)
if ^TMP($JOB,"GMRK","G"_GI)'=""
Begin DoDot:1
+7 SET GRAPHP(I)=$SELECT(GPA=0:"PA",1:"PD")_GRAPHP_","_^TMP($JOB,"GMRK","G"_GI)_";LB"_^TMP($JOB,"GMRK","G"_J)_"#;"
SET GPA=1
End DoDot:1
SET I=I+1
SET J=J+1
+8 IF $DATA(GMRQUAL)
DO LEGEND^GMRVLGQU
+9 KILL GMRQUAL,GG,GI,GMRVJ,GSYNO,GHOLD
QUIT
DATE SET GHOLD=""
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"
SET GJ=$FIND("WTXPXRBIOCHDS",GI)
SET GK=$SELECT($LENGTH(GDT1):$ORDER(^TMP($JOB,"GMRVG",GI,GDT1,"")),1:"")
DO SETA^GMRVHG4
+1 FOR GI="PO2","CVP","CG","PN"
SET GJ=0
SET GK=$SELECT($LENGTH(GDT1):$ORDER(^TMP($JOB,"GMRVG",GI,GDT1,"")),1:"")
DO SETA^GMRVHG4
+2 QUIT
SETP ;INITIALIZE ^TMP FOR HEIGHT AND V/M QUALIFIERS
+1 ;470 - STORE HEIGHT IN INCH 1100 - STORE HEIGHT IN CM
+2 ;1200 - STORE WEIGHT IN KG 1300 - STORE BODY MASS INDEX
+3 ; 410 - STORE T* 430 - STORE P* 450 - STORE BP QUALIFIER
+4 ;1400+I - PULSE OXIMETRY DATA 1430+I - PULSE OX. L/MIN
+5 ;1450+I - PULSE OX. % 1470+I - PULSE OX. METHOD
+6 ;1500+I - CVP DATA IN CM H2O 1530+I - CVP DATA IN MMHG
+7 ;1550+I - C/G DATA IN INCH 1570+I - C/G QUALIFIER 1600+I - PULSE QUALIFIER
+8 ;1620+I - C/G DATA IN CM 1640+I - THE THIRD PIECE OF BP
+9 ;1660+I - PAIN
+10 FOR I=1:1:10
Begin DoDot:1
+11 SET (^TMP($JOB,"GMRK","G"_(410+I)),^("G"_(430+I)),^("G"_(450+I)),^("G"_(470+I)),^("G"_(1100+I)),^("G"_(1200+I)),^("G"_(1300+I)),^("G"_(1640+I)))=""
+12 SET (^TMP($JOB,"GMRK","G"_(1400+I)),^("G"_(1430+I)),^("G"_(1450+I)),^("G"_(1470+I)),^("G"_(1500+I)),^("G"_(1530+I)),^("G"_(1550+I)),^("G"_(1570+I)))=""
+13 SET (^TMP($JOB,"GMRK","G"_(1600+I)),^("G"_(1620+I)),^("G"_(1660+I)))=""
End DoDot:1
+14 QUIT