GMRVVS1 ;HIRMFO/YH-PATIENT VITAL SIGNS-I/O SF 511 GRAPH - 1 ;3/17/97
;;4.0;Vitals/Measurements;**1,9,11**;Apr 25, 1997
GRAPH ;
S GMRPGC=0,GMRX1="" F X=1:1:111 S GMRX1=GMRX1_$S(X#11:" ",1:"|")
S (GMRX,GMRX2)=GMRX1 F X=1:1:10 S $P(GMRX,"|",X)="__________",$P(GMRX2,"|",X)="----------"
S GMRPG=GMRTNM\10+$S(GMRTNM#10>0:1,1:0) I GMRPG=0 D HEADER^GMRVVS2 W !,"THERE IS NO DATA FOR THIS REPORT" X "F Y=$Y:1:(IOSL-6) W !" D FOOTER^GMRVVS2 Q
F GMRPGS=1:1:GMRPG S GMRTLO=105.8335,GMRPLO=198.335 D PAGE Q:GMROUT
Q
PAGE ;
K GMRQUAL,GLINE,GVAR D HEADER^GMRVVS2 W "T: Temperature P: Pulse BMI: Body Mass Index C/G: Circumference/Girth * - Abnormal value ** - Abnormal value off of graph",! D DATES^GMRVVS2 W !,?10,"|",?11,GMRX
F GMRI=0:0 Q:$Y>51 W ! D SETHD^GMRVVS4 W GMRHDR1,?9,$S(GMR3!($Y=28):"-",1:""),?10,"|" D DATAPRT^GMRVVS4 W $S(GMR3!($Y=28):"-",1:""),?106,GMRHDR2
W !,?10,"|",GMRX2 F GMRI="T","P","R","B","B1","B2","W","H","P1","BMI" S GMRLINE(GMRI)=GMRX1,GVAR(GMRI)=""
F GMRI="PO2","OX1","OX2","OX3","CVP","CVP1","CG","CG1","CG2" K GVAR(GMRI)
S GMRNM=0 F GMRDT=0:0 S GMRDT=$O(^TMP($J,"GMRDT",GMRDT)) Q:GMRDT'>0 S GMRNM=GMRNM+1 Q:GMRNM>12 F GMRI="T","P","R","H","W" D STLNP
S GMRNM=0 F GMRDT=0:0 S GMRDT=$O(^TMP($J,"GMRDT",GMRDT)) Q:GMRDT'>0 S GMRNM=GMRNM+1 Q:GMRNM>12 D BP^GMRVVS2
F GMRI="T","P","P1","R","B","B1","B2","W","BMI","H" I $D(GVAR(GMRI)) D
.I IOSL<($Y+6) S GMRI(1)=GMRI D FOOTER^GMRVVS2,HEADER^GMRVVS2,DATES^GMRVVS2 S GMRI=GMRI(1) W !,?10,"|",?11,GMRX
. S G=$S(GMRI="T":"TEMP.",GMRI="P":"PULSE",GMRI="R":"RESP.",GMRI="W":"WEIGHT(LB)",GMRI="H":"HEIGHT(IN)",GMRI="B":"BLOOD",GMRI="B1":" PRESSURE",GMRI="BMI":"BMI",1:"")
. I G="" S G=$S(GMRI="PO2":"PULSE OX.",GMRI="OX1":" L/MIN",GMRI="OX2":" %",GMRI="OX3":" METHOD",GMRI="CG":"C/G (IN)",GMRI="CVP":"CVP cm H2O",GMRI="CVP1":" mmHg",GMRI="CG1":" ",GMRI="CG2":" (CM)",1:"")
. W !,G,?10,"|",GMRLINE(GMRI)
D IO^GMRVVS2 I 'GMROUT W !,?10,"|",GMRX,!
I IOSL<($Y+6) D FOOTER^GMRVVS2,HEADER^GMRVVS2
I $D(GMRQUAL),'GMROUT W ! S GLINE="Qualifier: " S G="" F S G=$O(GMRQUAL(G)) Q:G="" D LEGEND^GMRVLGQU
I 'GMROUT W GLINE F X=0:0 W ! Q:IOSL<($Y+6)
D FOOTER^GMRVVS2 S GMRDT="" F GMRNM=1:1:12 S GMRDT=$O(^TMP($J,"GMRDT",GMRDT)) Q:GMRDT'>0 K ^TMP($J,"GMRDT",GMRDT)
Q
STLNP ;
S GMR(GMRI)=$O(^TMP($J,"GMR",GMRI,GMRDT,"")) Q:GMR(GMRI)=""
S (GMRSITE,GMRSITE(1),GMRINF,GMRVJ)=""
S GMRSITE(1)=$P($G(^TMP($J,"GMR",GMRI,GMRDT,GMR(GMRI))),"^"),GMRSITE(2)=$P($G(^(GMR(GMRI))),"^",3),GMRINF=$P($G(^(GMR(GMRI))),"^",4) I GMRSITE(1)'="" S GI=GMRI D SYNOARY^GMRVLGQU
I GMRI'="CVP" S GI=$S(GMR(GMRI)>0:$J(GMR(GMRI),0,$S(GMRI="W"!(GMRI="H")!(GMRI="CG"):2,GMRI'="T":0,1:1)),1:GMR(GMRI))
E S GI=$S(GMR(GMRI)>0!(GMR(GMRI)<0)!($E(GMR(GMRI))="0"):$J(GMR(GMRI),0,1),1:GMR(GMRI))
I "UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GI) S GI=GI_$S($P(^TMP($J,"GMR",GMRI,GMRDT,GMR(GMRI)),"^",2)'=1:" ",1:"*")
I GMRI="P",($P(^TMP($J,"GMR",GMRI,GMRDT,GMR(GMRI)),"^",1)["DORSALIS PEDIS"),(+GI=1) S:$E(GI,$L(GI))="*" GI=$E(GI,1,$L(GI)-1)
S $P(GMRLINE(GMRI),"|",GMRNM)=GI_$S(GMRI="P"&($L(GMRSITE," ")>3):""_$P(GMRSITE," "),GMRI="R"!(GMRI="T")!(GMRI="H")!(GMRI="W")!(GMRI="CG"):""_GMRSITE,1:"")
S $P(GMRLINE(GMRI),"|",GMRNM)=$E($P(GMRLINE(GMRI),"|",GMRNM)_" ",1,10)
D SETLN
I GMRI="CG",$D(GMRLINE("CG2")) S $P(GMRLINE("CG2"),"|",GMRNM)=$E($S(GMR(GMRI)>0:$J(GMR(GMRI)/.3937,0,2),1:"")_" ",1,10)
I GMRI="P" S $P(GMRLINE("P1"),"|",GMRNM)=$E($S($L(GMRSITE," ")>3:$P(GMRSITE," ",2,4),1:GMRSITE)_" ",1,10)
I GMRI="H",$D(GMRLINE("H1")) S:GMR(GMRI)>0 $P(GMRLINE("H1"),"|",GMRNM)=$E($S(GMR(GMRI)>0:$J(GMR(GMRI)*2.54,0,2),1:GMR(GMRI))_" ",1,10)
I GMRI="W",$D(GMRLINE("W1")) S:GMR(GMRI)>0 $P(GMRLINE("W1"),"|",GMRNM)=$E($S(GMR(GMRI)>0:$J(GMR(GMRI)/2.2,0,2),1:GMR(GMRI))_" ",1,10)
I GMRI="W",$D(GMRLINE("BMI")),GMR(GMRI)>0 D
. S GMRBMI="",GMRBMI(1)=GMRDT,GMRBMI(2)=GMR(GMRI) D CALBMI^GMRVBMI(.GMRBMI)
. S $P(GMRLINE("BMI"),"|",GMRNM)=$E(GMRBMI_" ",1,10) K GMRBMI
I GMRI="PO2",$D(GMRLINE("OX1")) D
. S $P(GMRLINE("OX3"),"|",GMRNM)=$E(GMRSITE_" ",1,10)
. S GMRINF=$P(^TMP($J,"GMR",GMRI,GMRDT,GMR(GMRI)),"^",4),(GMRINF(1),GMRINF(2))="" D
. . I GMRINF="" S $P(GMRLINE("OX1"),"|",GMRNM)=" ",$P(GMRLINE("OX2"),"|",GMRNM)=" "
. . E D PO2^GMRVLGQU(.GMRINF) S $P(GMRLINE("OX1"),"|",GMRNM)=$E(GMRINF(1)_" ",1,10),$P(GMRLINE("OX2"),"|",GMRNM)=$E(GMRINF(2)_" ",1,10)
I GMRI="CVP",$D(GMRLINE("CVP1")) S $P(GMRLINE("CVP1"),"|",GMRNM)=$E($S(GMR(GMRI)>0!(GMR(GMRI)<0)!($E(GMR(GMRI))="0"):$J(GMR(GMRI)/1.36,0,1),1:"")_$S(GI["*":"*",1:"")_" ",1,10)
I GMRI="PN",$D(GMRLINE("PN")) S $P(GMRLINE("PN"),"|",GMRNM)=$E($S(GMR(GMRI)?1.2N&(GMR(GMRI)'>10):GMR(GMRI),GMR(GMRI)=99:GMR(GMRI),1:"")_" ",1,10)
K GI Q
SETLN ;
S GVAR(GMRI)=""
I GMRI="PO2" S (GVAR("PO2"),GVAR("OX1"),GVAR("OX2"),GVAR("OX3"))="" Q
I GMRI="CVP" S (GVAR("CVP"),GVAR("CVP1"))="" Q
I GMRI="CG" S (GVAR("CG"),GVAR("CG2"))="" Q
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRVVS1 5022 printed Oct 16, 2024@17:58:25 Page 2
GMRVVS1 ;HIRMFO/YH-PATIENT VITAL SIGNS-I/O SF 511 GRAPH - 1 ;3/17/97
+1 ;;4.0;Vitals/Measurements;**1,9,11**;Apr 25, 1997
GRAPH ;
+1 SET GMRPGC=0
SET GMRX1=""
FOR X=1:1:111
SET GMRX1=GMRX1_$SELECT(X#11:" ",1:"|")
+2 SET (GMRX,GMRX2)=GMRX1
FOR X=1:1:10
SET $PIECE(GMRX,"|",X)="__________"
SET $PIECE(GMRX2,"|",X)="----------"
+3 SET GMRPG=GMRTNM\10+$SELECT(GMRTNM#10>0:1,1:0)
IF GMRPG=0
DO HEADER^GMRVVS2
WRITE !,"THERE IS NO DATA FOR THIS REPORT"
XECUTE "F Y=$Y:1:(IOSL-6) W !"
DO FOOTER^GMRVVS2
QUIT
+4 FOR GMRPGS=1:1:GMRPG
SET GMRTLO=105.8335
SET GMRPLO=198.335
DO PAGE
if GMROUT
QUIT
+5 QUIT
PAGE ;
+1 KILL GMRQUAL,GLINE,GVAR
DO HEADER^GMRVVS2
WRITE "T: Temperature P: Pulse BMI: Body Mass Index C/G: Circumference/Girth * - Abnormal value ** - Abnormal value off of graph",!
DO DATES^GMRVVS2
WRITE !,?10,"|",?11,GMRX
+2 FOR GMRI=0:0
if $Y>51
QUIT
WRITE !
DO SETHD^GMRVVS4
WRITE GMRHDR1,?9,$SELECT(GMR3!($Y=28):"-",1:""),?10,"|"
DO DATAPRT^GMRVVS4
WRITE $SELECT(GMR3!($Y=28):"-",1:""),?106,GMRHDR2
+3 WRITE !,?10,"|",GMRX2
FOR GMRI="T","P","R","B","B1","B2","W","H","P1","BMI"
SET GMRLINE(GMRI)=GMRX1
SET GVAR(GMRI)=""
+4 FOR GMRI="PO2","OX1","OX2","OX3","CVP","CVP1","CG","CG1","CG2"
KILL GVAR(GMRI)
+5 SET GMRNM=0
FOR GMRDT=0:0
SET GMRDT=$ORDER(^TMP($JOB,"GMRDT",GMRDT))
if GMRDT'>0
QUIT
SET GMRNM=GMRNM+1
if GMRNM>12
QUIT
FOR GMRI="T","P","R","H","W"
DO STLNP
+6 SET GMRNM=0
FOR GMRDT=0:0
SET GMRDT=$ORDER(^TMP($JOB,"GMRDT",GMRDT))
if GMRDT'>0
QUIT
SET GMRNM=GMRNM+1
if GMRNM>12
QUIT
DO BP^GMRVVS2
+7 FOR GMRI="T","P","P1","R","B","B1","B2","W","BMI","H"
IF $DATA(GVAR(GMRI))
Begin DoDot:1
+8 IF IOSL<($Y+6)
SET GMRI(1)=GMRI
DO FOOTER^GMRVVS2
DO HEADER^GMRVVS2
DO DATES^GMRVVS2
SET GMRI=GMRI(1)
WRITE !,?10,"|",?11,GMRX
+9 SET G=$SELECT(GMRI="T":"TEMP.",GMRI="P":"PULSE",GMRI="R":"RESP.",GMRI="W":"WEIGHT(LB)",GMRI="H":"HEIGHT(IN)",GMRI="B":"BLOOD",GMRI="B1":" PRESSURE",GMRI="BMI":"BMI",1:"")
+10 IF G=""
SET G=$SELECT(GMRI="PO2":"PULSE OX.",GMRI="OX1":" L/MIN",GMRI="OX2":" %",GMRI="OX3":" METHOD",GMRI="CG":"C/G (IN)",GMRI="CVP":"CVP cm H2O",GMRI="CVP1":" mmHg",GMRI="CG1":" ",GMRI="CG2":" (CM)",1:"")
+11 WRITE !,G,?10,"|",GMRLINE(GMRI)
End DoDot:1
+12 DO IO^GMRVVS2
IF 'GMROUT
WRITE !,?10,"|",GMRX,!
+13 IF IOSL<($Y+6)
DO FOOTER^GMRVVS2
DO HEADER^GMRVVS2
+14 IF $DATA(GMRQUAL)
IF 'GMROUT
WRITE !
SET GLINE="Qualifier: "
SET G=""
FOR
SET G=$ORDER(GMRQUAL(G))
if G=""
QUIT
DO LEGEND^GMRVLGQU
+15 IF 'GMROUT
WRITE GLINE
FOR X=0:0
WRITE !
if IOSL<($Y+6)
QUIT
+16 DO FOOTER^GMRVVS2
SET GMRDT=""
FOR GMRNM=1:1:12
SET GMRDT=$ORDER(^TMP($JOB,"GMRDT",GMRDT))
if GMRDT'>0
QUIT
KILL ^TMP($JOB,"GMRDT",GMRDT)
+17 QUIT
STLNP ;
+1 SET GMR(GMRI)=$ORDER(^TMP($JOB,"GMR",GMRI,GMRDT,""))
if GMR(GMRI)=""
QUIT
+2 SET (GMRSITE,GMRSITE(1),GMRINF,GMRVJ)=""
+3 SET GMRSITE(1)=$PIECE($GET(^TMP($JOB,"GMR",GMRI,GMRDT,GMR(GMRI))),"^")
SET GMRSITE(2)=$PIECE($GET(^(GMR(GMRI))),"^",3)
SET GMRINF=$PIECE($GET(^(GMR(GMRI))),"^",4)
IF GMRSITE(1)'=""
SET GI=GMRI
DO SYNOARY^GMRVLGQU
+4 IF GMRI'="CVP"
SET GI=$SELECT(GMR(GMRI)>0:$JUSTIFY(GMR(GMRI),0,$SELECT(GMRI="W"!(GMRI="H")!(GMRI="CG"):2,GMRI'="T":0,1:1)),1:GMR(GMRI))
+5 IF '$TEST
SET GI=$SELECT(GMR(GMRI)>0!(GMR(GMRI)<0)!($EXTRACT(GMR(GMRI))="0"):$JUSTIFY(GMR(GMRI),0,1),1:GMR(GMRI))
+6 IF "UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GI)
SET GI=GI_$SELECT($PIECE(^TMP($JOB,"GMR",GMRI,GMRDT,GMR(GMRI)),"^",2)'=1:" ",1:"*")
+7 IF GMRI="P"
IF ($PIECE(^TMP($JOB,"GMR",GMRI,GMRDT,GMR(GMRI)),"^",1)["DORSALIS PEDIS")
IF (+GI=1)
if $EXTRACT(GI,$LENGTH(GI))="*"
SET GI=$EXTRACT(GI,1,$LENGTH(GI)-1)
+8 SET $PIECE(GMRLINE(GMRI),"|",GMRNM)=GI_$SELECT(GMRI="P"&($LENGTH(GMRSITE," ")>3):""_$PIECE(GMRSITE," "),GMRI="R"!(GMRI="T")!(GMRI="H")!(GMRI="W")!(GMRI="CG"):""_GMRSITE,1:"")
+9 SET $PIECE(GMRLINE(GMRI),"|",GMRNM)=$EXTRACT($PIECE(GMRLINE(GMRI),"|",GMRNM)_" ",1,10)
+10 DO SETLN
+11 IF GMRI="CG"
IF $DATA(GMRLINE("CG2"))
SET $PIECE(GMRLINE("CG2"),"|",GMRNM)=$EXTRACT($SELECT(GMR(GMRI)>0:$JUSTIFY(GMR(GMRI)/.3937,0,2),1:"")_" ",1,10)
+12 IF GMRI="P"
SET $PIECE(GMRLINE("P1"),"|",GMRNM)=$EXTRACT($SELECT($LENGTH(GMRSITE," ")>3:$PIECE(GMRSITE," ",2,4),1:GMRSITE)_" ",1,10)
+13 IF GMRI="H"
IF $DATA(GMRLINE("H1"))
if GMR(GMRI)>0
SET $PIECE(GMRLINE("H1"),"|",GMRNM)=$EXTRACT($SELECT(GMR(GMRI)>0:$JUSTIFY(GMR(GMRI)*2.54,0,2),1:GMR(GMRI))_" ",1,10)
+14 IF GMRI="W"
IF $DATA(GMRLINE("W1"))
if GMR(GMRI)>0
SET $PIECE(GMRLINE("W1"),"|",GMRNM)=$EXTRACT($SELECT(GMR(GMRI)>0:$JUSTIFY(GMR(GMRI)/2.2,0,2),1:GMR(GMRI))_" ",1,10)
+15 IF GMRI="W"
IF $DATA(GMRLINE("BMI"))
IF GMR(GMRI)>0
Begin DoDot:1
+16 SET GMRBMI=""
SET GMRBMI(1)=GMRDT
SET GMRBMI(2)=GMR(GMRI)
DO CALBMI^GMRVBMI(.GMRBMI)
+17 SET $PIECE(GMRLINE("BMI"),"|",GMRNM)=$EXTRACT(GMRBMI_" ",1,10)
KILL GMRBMI
End DoDot:1
+18 IF GMRI="PO2"
IF $DATA(GMRLINE("OX1"))
Begin DoDot:1
+19 SET $PIECE(GMRLINE("OX3"),"|",GMRNM)=$EXTRACT(GMRSITE_" ",1,10)
+20 SET GMRINF=$PIECE(^TMP($JOB,"GMR",GMRI,GMRDT,GMR(GMRI)),"^",4)
SET (GMRINF(1),GMRINF(2))=""
Begin DoDot:2
+21 IF GMRINF=""
SET $PIECE(GMRLINE("OX1"),"|",GMRNM)=" "
SET $PIECE(GMRLINE("OX2"),"|",GMRNM)=" "
+22 IF '$TEST
DO PO2^GMRVLGQU(.GMRINF)
SET $PIECE(GMRLINE("OX1"),"|",GMRNM)=$EXTRACT(GMRINF(1)_" ",1,10)
SET $PIECE(GMRLINE("OX2"),"|",GMRNM)=$EXTRACT(GMRINF(2)_" ",1,10)
End DoDot:2
End DoDot:1
+23 IF GMRI="CVP"
IF $DATA(GMRLINE("CVP1"))
SET $PIECE(GMRLINE("CVP1"),"|",GMRNM)=$EXTRACT($SELECT(GMR(GMRI)>0!(GMR(GMRI)<0)!($EXTRACT(GMR(GMRI))="0"):$JUSTIFY(GMR(GMRI)/1.36,0,1),1:"")_$SELECT(GI["*":"*",1:"")_" ",1,10)
+24 IF GMRI="PN"
IF $DATA(GMRLINE("PN"))
SET $PIECE(GMRLINE("PN"),"|",GMRNM)=$EXTRACT($SELECT(GMR(GMRI)?1.2N&(GMR(GMRI)'>10):GMR(GMRI),GMR(GMRI)=99:GMR(GMRI),1:"")_" ",1,10)
+25 KILL GI
QUIT
SETLN ;
+1 SET GVAR(GMRI)=""
+2 IF GMRI="PO2"
SET (GVAR("PO2"),GVAR("OX1"),GVAR("OX2"),GVAR("OX3"))=""
QUIT
+3 IF GMRI="CVP"
SET (GVAR("CVP"),GVAR("CVP1"))=""
QUIT
+4 IF GMRI="CG"
SET (GVAR("CG"),GVAR("CG2"))=""
QUIT
+5 QUIT