GMRVHPO3 ;HIRMFO/YH-HP LASER PULSE OXIMETRY/RESP. GRAPH - ^TMP DATA ;3/3/99
;;4.0;Vitals/Measurements;**1,11**;Apr 25, 1997
SETA ;
I GK="Unavailable" S GK="Unavail"
S (GMRSITE,GMRSITE(1),GMRSITE(2),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^GMRVLGQU
I GK'="","UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GK) S GK=GK_$S(GMRVJ=1:"*",1:" ")
I GI="P" S ^TMP($J,"GMRK","G"_(510+GCNTD))=GK_$S($L(GMRSITE," ")>3:$P(GMRSITE," "),1:""),^("G"_(530+GCNTD))=$S($L(GMRSITE," ")>3:$P(GMRSITE," ",2,4),1:GMRSITE) Q
I GI="PO2" D
. S (GMRINF(1),GMRINF(2))="" I GMRINF'="" D PO2^GMRVLGQU(.GMRINF)
. S ^TMP($J,"GMRK","G"_(1430+GCNTD))=GMRINF(1)
. S ^TMP($J,"GMRK","G"_(1450+GCNTD))=GMRINF(2)
. S ^TMP($J,"GMRK","G"_(1470+GCNTD))=GMRSITE
S ^TMP($J,"GMRK","G"_(GJ+GCNTD+1))=$S(GK>0:$S(GI="R":GK-4/2,GI="PO2":GK-64/2,1:""),1:"") S ^TMP($J,"GMRK","G"_(GJ+20+GCNTD+1))=$S(+GK=0.1:"0*",1:GK)_$S(GI="R":GMRSITE,1:"")
I GI="R",GK>0 S ^TMP($J,"GMRK","G"_(410+GCNTD))=$S(GK["*":"R*",1:"R")
I GI="PO2",GK>0 S ^TMP($J,"GMRK","G"_(430+GCNTD))=$S(GK["*":"POx*",1:"POx")
I GK>0,GI="R" S ^TMP($J,"GMRK","G"_(GJ+GCNTD+1))=$S(^("G"_(GJ+GCNTD+1))<0.5:0.5,^("G"_(GJ+GCNTD+1))>18.7:18.7,1:^("G"_(GJ+GCNTD+1))) S:^("G"_(GJ+GCNTD+1))<0.6!(^("G"_(GJ+GCNTD+1))>18.6) ^TMP($J,"GMRK","G"_(410+GCNTD))="R**"
I GK>0,GI="PO2" S ^TMP($J,"GMRK","G"_(GJ+GCNTD+1))=$S(^("G"_(GJ+GCNTD+1))<0.5:0.5,^("G"_(GJ+GCNTD+1))>18.7:18.7,1:^("G"_(GJ+GCNTD+1))) S:^("G"_(GJ+GCNTD+1))<0.6!(^("G"_(GJ+GCNTD+1))>18.6) ^TMP($J,"GMRK","G"_(430+GCNTD))="POx**"
Q
PTID ;PRINT PATIENT ID
W !,"SD1,277,2,1,4,9,5,1,6,5,7,4;SS;PA-2,-4.5;LB"_^TMP($J,"GMRK","G194")_"#;PA-2,-4.8;LB"_^("G196")_" "_^("G197")_"#;"
W !,"PA-2,-5.1;LB"_^TMP($J,"GMRK","G198")_"#;PA6,-5.1;LB"_^("G200")_"#;PA6,-5.4;LB"_^("G199")_"#;PA-2,-5.4;LB"_GMRDIV_"#;"
W !,"PA-2,-5.7;LB"_GSTRFIN_"#;" Q
GMRVHPO3 ;HIRMFO/YH-HP LASER PULSE OXIMETRY/RESP. GRAPH - ^TMP DATA ;3/3/99
+1 ;;4.0;Vitals/Measurements;**1,11**;Apr 25, 1997
SETA ;
+1 IF GK="Unavailable"
SET GK="Unavail"
+2 SET (GMRSITE,GMRSITE(1),GMRSITE(2),GMRINF,GMRVJ)=""
+3 IF GK'=""
Begin DoDot:1
+4 SET GMRSITE(1)=$PIECE($GET(^TMP($JOB,"GMRVG",GI,GDT1,GK)),"^")
SET GMRVJ=$PIECE($GET(^(GK)),"^",2)
SET GMRINF=$PIECE($GET(^(GK)),"^",4)
+5 IF GMRSITE(1)'=""
DO SYNOARY^GMRVLGQU
End DoDot:1
+6 IF GK'=""
IF "UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GK)
SET GK=GK_$SELECT(GMRVJ=1:"*",1:" ")
+7 IF GI="P"
SET ^TMP($JOB,"GMRK","G"_(510+GCNTD))=GK_$SELECT($LENGTH(GMRSITE," ")>3:$PIECE(GMRSITE," "),1:"")
SET ^("G"_(530+GCNTD))=$SELECT($LENGTH(GMRSITE," ")>3:$PIECE(GMRSITE," ",2,4),1:GMRSITE)
QUIT
+8 IF GI="PO2"
Begin DoDot:1
+9 SET (GMRINF(1),GMRINF(2))=""
IF GMRINF'=""
DO PO2^GMRVLGQU(.GMRINF)
+10 SET ^TMP($JOB,"GMRK","G"_(1430+GCNTD))=GMRINF(1)
+11 SET ^TMP($JOB,"GMRK","G"_(1450+GCNTD))=GMRINF(2)
+12 SET ^TMP($JOB,"GMRK","G"_(1470+GCNTD))=GMRSITE
End DoDot:1
+13 SET ^TMP($JOB,"GMRK","G"_(GJ+GCNTD+1))=$SELECT(GK>0:$SELECT(GI="R":GK-4/2,GI="PO2":GK-64/2,1:""),1:"")
SET ^TMP($JOB,"GMRK","G"_(GJ+20+GCNTD+1))=$SELECT(+GK=0.1:"0*",1:GK)_$SELECT(GI="R":GMRSITE,1:"")
+14 IF GI="R"
IF GK>0
SET ^TMP($JOB,"GMRK","G"_(410+GCNTD))=$SELECT(GK["*":"R*",1:"R")
+15 IF GI="PO2"
IF GK>0
SET ^TMP($JOB,"GMRK","G"_(430+GCNTD))=$SELECT(GK["*":"POx*",1:"POx")
+16 IF GK>0
IF GI="R"
SET ^TMP($JOB,"GMRK","G"_(GJ+GCNTD+1))=$SELECT(^("G"_(GJ+GCNTD+1))<0.5:0.5,^("G"_(GJ+GCNTD+1))>18.7:18.7,1:^("G"_(GJ+GCNTD+1)))
IF ^("G"_(GJ+GCNTD+1))<0.6!(^("G"_(GJ+GCNTD+1))>18.6)
SET ^TMP($JOB,"GMRK","G"_(410+GCNTD))="R**"
+17 IF GK>0
IF GI="PO2"
SET ^TMP($JOB,"GMRK","G"_(GJ+GCNTD+1))=$SELECT(^("G"_(GJ+GCNTD+1))<0.5:0.5,^("G"_(GJ+GCNTD+1))>18.7:18.7,1:^("G"_(GJ+GCNTD+1)))
IF ^("G"_(GJ+GCNTD+1))<0.6!(^("G"_(GJ+GCNTD+1))>18.6)
SET ^TMP($JOB,"GMRK","G"_(430+GCNTD))="POx**"
+18 QUIT
PTID ;PRINT PATIENT ID
+1 WRITE !,"SD1,277,2,1,4,9,5,1,6,5,7,4;SS;PA-2,-4.5;LB"_^TMP($JOB,"GMRK","G194")_"#;PA-2,-4.8;LB"_^("G196")_" "_^("G197")_"#;"
+2 WRITE !,"PA-2,-5.1;LB"_^TMP($JOB,"GMRK","G198")_"#;PA6,-5.1;LB"_^("G200")_"#;PA6,-5.4;LB"_^("G199")_"#;PA-2,-5.4;LB"_GMRDIV_"#;"
+3 WRITE !,"PA-2,-5.7;LB"_GSTRFIN_"#;"
QUIT