GMRVLPO2 ;DOT MATRIX HIRMFO/YH-PULSE OX. AND RESPIRATION DATA ;7/15/97
;;4.0;Vitals/Measurements;**1,11**;Apr 25, 1997
W ! W:GMRNAM'="" ?$X-3,$E(GMRNAM,1,35) W " "_$P($G(VADM(2)),"^",2)_" "_$P($G(VADM(3)),"^",2)_" "_$P($G(VADM(4)),"^")_" YRS "_$P($G(VADM),"^",2)
W ?95,"MEDICAL RECORD" W !,"Unit: "_$S(GMRWARD(1)'="":GMRWARD(1),1:" ")," "_"Room: "_$S($P(VAIN(5),"^")'="":$P($P(VAIN(5),"^"),"-",1,2),1:" "),?95,"Pulse Oximetry/Respiration Graph"
D INP^VADPT S GMRVHLOC=$P($G(^DIC(42,+$G(VAIN(4)),44)),"^")
W !,"Division: "_$S(GMRVHLOC>0:$$GET1^DIQ(4,+$$GET1^DIQ(44,+GMRVHLOC,3,"I"),.01,"I"),1:""),?55,"Page "_GMRPGC,?95,"SF 512",!
W GSTRFIN Q
STLNP ;
S GMR(GMRI)=$O(^TMP($J,"GMRVG",GMRI,GMRDT,"")) Q:GMR(GMRI)=""
N GMRVOK S (GMRSITE,GMRSITE(1),GMRINF,GMRVJ)="",GMRVOK=0
S GMRSITE(1)=$P($G(^TMP($J,"GMRVG",GMRI,GMRDT,GMR(GMRI))),"^"),GMRSITE(2)=$P($G(^(GMR(GMRI))),"^",3),GMRINF=$P($G(^(GMR(GMRI))),"^",4)
I GMRSITE(1)'="" D Q:GMRVOK
.I GMRI="P",(GMRSITE(1)'["RADIAL"),(GMRSITE(1)'["APICAL"),(GMRSITE(1)'["BRACHIAL") S GMRVOK=1 Q
.S GI=GMRI D SYNOARY^GMRVLGQU
.Q
S GI=$S(GMR(GMRI)>0&(GMRI="PO2"):$J(GMR(GMRI),0,1),1:GMR(GMRI))
I "UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GMR(GMRI)) S GI=GI_$S($P(^TMP($J,"GMRVG",GMRI,GMRDT,GMR(GMRI)),"^",2)'=1:" ",1:"*")
S $P(GMRLINE(GMRI),"|",GMRNM)=$E(GI_$S(GMRI="R":GMRSITE,GMRI="P"&($L(GMRSITE," ")>3):$P(GMRSITE," "),1:"")_" ",1,10)
I GMRI="P" S $P(GMRLINE("P1"),"|",GMRNM)=$E($S($L(GMRSITE," ")>3:$P(GMRSITE," ",2,4),1:GMRSITE)_" ",1,10)
D SETLN
I GMRI="PO2",$D(GMRLINE("OX1")) D
. S $P(GMRLINE("OX3"),"|",GMRNM)=$E(GMRSITE_" ",1,10)
. S GMRINF=$P(^TMP($J,"GMRVG",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)
K GI Q
SETLN ;
S GVAR(GMRI)=""
I GMRI="PO2" S (GVAR("PO2"),GVAR("OX1"),GVAR("OX2"),GVAR("OX3"))="" Q
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRVLPO2 2138 printed Nov 22, 2024@17:07:17 Page 2
GMRVLPO2 ;DOT MATRIX HIRMFO/YH-PULSE OX. AND RESPIRATION DATA ;7/15/97
+1 ;;4.0;Vitals/Measurements;**1,11**;Apr 25, 1997
+1 WRITE !
if GMRNAM'=""
WRITE ?$X-3,$EXTRACT(GMRNAM,1,35)
WRITE " "_$PIECE($GET(VADM(2)),"^",2)_" "_$PIECE($GET(VADM(3)),"^",2)_" "_$PIECE($GET(VADM(4)),"^")_" YRS "_$PIECE($GET(VADM),"^",2)
+2 WRITE ?95,"MEDICAL RECORD"
WRITE !,"Unit: "_$SELECT(GMRWARD(1)'="":GMRWARD(1),1:" ")," "_"Room: "_$SELECT($PIECE(VAIN(5),"^")'="":$PIECE($PIECE(VAIN(5),"^"),"-",1,2),1:" "),?95,"Pulse Oximetry/Respiration Graph"
+3 DO INP^VADPT
SET GMRVHLOC=$PIECE($GET(^DIC(42,+$GET(VAIN(4)),44)),"^")
+4 WRITE !,"Division: "_$SELECT(GMRVHLOC>0:$$GET1^DIQ(4,+$$GET1^DIQ(44,+GMRVHLOC,3,"I"),.01,"I"),1:""),?55,"Page "_GMRPGC,?95,"SF 512",!
+5 WRITE GSTRFIN
QUIT
STLNP ;
+1 SET GMR(GMRI)=$ORDER(^TMP($JOB,"GMRVG",GMRI,GMRDT,""))
if GMR(GMRI)=""
QUIT
+2 NEW GMRVOK
SET (GMRSITE,GMRSITE(1),GMRINF,GMRVJ)=""
SET GMRVOK=0
+3 SET GMRSITE(1)=$PIECE($GET(^TMP($JOB,"GMRVG",GMRI,GMRDT,GMR(GMRI))),"^")
SET GMRSITE(2)=$PIECE($GET(^(GMR(GMRI))),"^",3)
SET GMRINF=$PIECE($GET(^(GMR(GMRI))),"^",4)
+4 IF GMRSITE(1)'=""
Begin DoDot:1
+5 IF GMRI="P"
IF (GMRSITE(1)'["RADIAL")
IF (GMRSITE(1)'["APICAL")
IF (GMRSITE(1)'["BRACHIAL")
SET GMRVOK=1
QUIT
+6 SET GI=GMRI
DO SYNOARY^GMRVLGQU
+7 QUIT
End DoDot:1
if GMRVOK
QUIT
+8 SET GI=$SELECT(GMR(GMRI)>0&(GMRI="PO2"):$JUSTIFY(GMR(GMRI),0,1),1:GMR(GMRI))
+9 IF "UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GMR(GMRI))
SET GI=GI_$SELECT($PIECE(^TMP($JOB,"GMRVG",GMRI,GMRDT,GMR(GMRI)),"^",2)'=1:" ",1:"*")
+10 SET $PIECE(GMRLINE(GMRI),"|",GMRNM)=$EXTRACT(GI_$SELECT(GMRI="R":GMRSITE,GMRI="P"&($LENGTH(GMRSITE," ")>3):$PIECE(GMRSITE," "),1:"")_" ",1,10)
+11 IF GMRI="P"
SET $PIECE(GMRLINE("P1"),"|",GMRNM)=$EXTRACT($SELECT($LENGTH(GMRSITE," ")>3:$PIECE(GMRSITE," ",2,4),1:GMRSITE)_" ",1,10)
+12 DO SETLN
+13 IF GMRI="PO2"
IF $DATA(GMRLINE("OX1"))
Begin DoDot:1
+14 SET $PIECE(GMRLINE("OX3"),"|",GMRNM)=$EXTRACT(GMRSITE_" ",1,10)
+15 SET GMRINF=$PIECE(^TMP($JOB,"GMRVG",GMRI,GMRDT,GMR(GMRI)),"^",4)
SET (GMRINF(1),GMRINF(2))=""
Begin DoDot:2
+16 IF GMRINF=""
SET $PIECE(GMRLINE("OX1"),"|",GMRNM)=" "
SET $PIECE(GMRLINE("OX2"),"|",GMRNM)=" "
+17 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
+18 KILL GI
QUIT
SETLN ;
+1 SET GVAR(GMRI)=""
+2 IF GMRI="PO2"
SET (GVAR("PO2"),GVAR("OX1"),GVAR("OX2"),GVAR("OX3"))=""
QUIT
+3 QUIT