GMVLPO1 ;HIOFO/YH,FT-DOT MATRIX PULSE OXIMETRY AND RESPIRATION GRAPH ;11/6/01 15:44
;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
;
; This routine uses the following IAs:
; <None>
;
SETHD ;
;GMRPO2 - PO2 VALUE WHEN $Y=1 GMRPO2(1) - LABEL
;GMRY - $Y FOR LABEL
;GMRESP - RESPIRATION VALUE WHEN $Y=1 GMRESP(1) - LABEL
S GMR3=(($Y/3)=($Y\3)),GMRPHI=GMRPO2-(($Y-1)*0.666),GMRPLO=GMRPHI-0.666
S GMRRHI=GMRESP-(($Y-1)*0.666),GMRRLO=GMRRHI-0.666
S GMRHDR10=$S($Y=GMRY&(GMRPO2(1)>62)&($Y>5)&($Y<66):$E(GMRPO2(1)_" ",1,4)_GMRESP(1),1:"")
I $Y=GMRY S GMRY=GMRY+3,GMRPO2(1)=GMRPO2(1)-2,GMRESP(1)=GMRESP(1)-2
Q
DATAPRT ;
S GMRLINE=GMRX1
S GMRNM=0 F GMRDT=0:0 S GMRDT=$O(^TMP($J,"GMRDT",GMRDT)) Q:GMRDT'>0 D SETLINE Q:GMRNM=10
W GMRLINE
Q
SETLINE ;
S GMRNM=GMRNM+1,GMROLD=$P(GMRLINE,"|",GMRNM)
S (GP,GMRP)=$O(^TMP($J,"GMRVG","PO2",GMRDT,"")) S:GMRP="0" GP=.1
S (GR,GMRR)=$O(^TMP($J,"GMRVG","R",GMRDT,""))
;S:GMRR="0" GR=.1
S GMRPOFF=($Y=6&(+GP>101))!($Y=62&(+GP<65)),GMRROFF=($Y=6&(+GR>41))!($Y=62&(+GR<5))
S GMROLD=$S(+GP>0&(+GP'<GMRPLO&(+GP'>GMRPHI)!GMRPOFF):"POx"_$S('$P(^TMP($J,"GMRVG","PO2",GMRDT,GMRP),"^",2):" ",1:"*")_$S('GMRPOFF:" ",1:"*")_$E(GMROLD,4,10),1:GMROLD)
S GMROLD=$E(GMROLD,1,5)_$S(GR>0&(+GR'<GMRRLO&(+GR'>GMRRHI)!GMRROFF):"R"_$S('$P(^TMP($J,"GMRVG","R",GMRDT,GMRR),"^",2):" ",1:"*")_$S('GMRROFF:" ",1:"*")_$E(GMROLD,9,10),1:$E(GMROLD,6,10))
S $P(GMRLINE,"|",GMRNM)=GMROLD
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMVLPO1 1438 printed Nov 22, 2024@17:09:47 Page 2
GMVLPO1 ;HIOFO/YH,FT-DOT MATRIX PULSE OXIMETRY AND RESPIRATION GRAPH ;11/6/01 15:44
+1 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
+2 ;
+3 ; This routine uses the following IAs:
+4 ; <None>
+5 ;
SETHD ;
+1 ;GMRPO2 - PO2 VALUE WHEN $Y=1 GMRPO2(1) - LABEL
+2 ;GMRY - $Y FOR LABEL
+3 ;GMRESP - RESPIRATION VALUE WHEN $Y=1 GMRESP(1) - LABEL
+4 SET GMR3=(($Y/3)=($Y\3))
SET GMRPHI=GMRPO2-(($Y-1)*0.666)
SET GMRPLO=GMRPHI-0.666
+5 SET GMRRHI=GMRESP-(($Y-1)*0.666)
SET GMRRLO=GMRRHI-0.666
+6 SET GMRHDR10=$SELECT($Y=GMRY&(GMRPO2(1)>62)&($Y>5)&($Y<66):$EXTRACT(GMRPO2(1)_" ",1,4)_GMRESP(1),1:"")
+7 IF $Y=GMRY
SET GMRY=GMRY+3
SET GMRPO2(1)=GMRPO2(1)-2
SET GMRESP(1)=GMRESP(1)-2
+8 QUIT
DATAPRT ;
+1 SET GMRLINE=GMRX1
+2 SET GMRNM=0
FOR GMRDT=0:0
SET GMRDT=$ORDER(^TMP($JOB,"GMRDT",GMRDT))
if GMRDT'>0
QUIT
DO SETLINE
if GMRNM=10
QUIT
+3 WRITE GMRLINE
+4 QUIT
SETLINE ;
+1 SET GMRNM=GMRNM+1
SET GMROLD=$PIECE(GMRLINE,"|",GMRNM)
+2 SET (GP,GMRP)=$ORDER(^TMP($JOB,"GMRVG","PO2",GMRDT,""))
if GMRP="0"
SET GP=.1
+3 SET (GR,GMRR)=$ORDER(^TMP($JOB,"GMRVG","R",GMRDT,""))
+4 ;S:GMRR="0" GR=.1
+5 SET GMRPOFF=($Y=6&(+GP>101))!($Y=62&(+GP<65))
SET GMRROFF=($Y=6&(+GR>41))!($Y=62&(+GR<5))
+6 SET GMROLD=$SELECT(+GP>0&(+GP'<GMRPLO&(+GP'>GMRPHI)!GMRPOFF):"POx"_$SELECT('$PIECE(^TMP($JOB,"GMRVG","PO2",GMRDT,GMRP),"^",2):" ",1:"*")_$SELECT('GMRPOFF:" ",1:"*")_$EXTRACT(GMROLD,4,10),1:GMROLD)
+7 SET GMROLD=$EXTRACT(GMROLD,1,5)_$SELECT(GR>0&(+GR'<GMRRLO&(+GR'>GMRRHI)!GMRROFF):"R"_$SELECT('$PIECE(^TMP($JOB,"GMRVG","R",GMRDT,GMRR),"^",2):" ",1:"*")_$SELECT('GMRROFF:" ",1:"*")_$EXTRACT(GMROLD,9,10),1:$EXTRACT(GMROLD,6,10))
+8 SET $PIECE(GMRLINE,"|",GMRNM)=GMROLD
+9 QUIT