GMVLBP0 ;HIOFO/YH,FT-PATIENT BLOOD PRESSURE LINE PRINTER GRAPH - 1 ;11/6/01 15:49
;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
;
; This routine uses the following IAs:
; #10061 - ^VADPT calls (supported)
; #10104 - ^XLFSTR calls (supported)
;
SF512 ;BLOOD PRESSURE GRAPH
D DEM^VADPT,INP^VADPT S GMRBTH=$P(VADM(3),"^",2),GMRNAM=VADM(1)
S GSTART1=(9999999-GMRFIN)-.0001,GEND1=9999999-GMRSTRT
F GTYPE="B","P" D SETT^GMVBP0
F GMRK="P","B" D GMRDT
S (GMRTNM,GMRI)=0 I $D(^TMP($J,"GMRDT")) F S GMRI=$O(^TMP($J,"GMRDT",GMRI)) Q:GMRI'>0 S GMRTNM=GMRTNM+1
U IO D GRAPH
K GMR3,GMRDAT,GMREN,GMRHDR1,GMRHDR11,GMRHDR10,GMRHDR2,GMRHT,GMRI,GMRJ,GMRK,GMRLINE,GDATA,GMROLD,GMRP,GMRSDIF,GMRPG,GMRPGC,GMRPGS,GMRSHI,GMRSLO,GMRSOFF,GMRSITE,GMRD,GMRDDIF,GMRDHI,GMRDLO,GMRTNM
K Z,GCHA,GEN,GTYP,GTYPE,GMAP,GX,GEND1,GSTART1,GLPRNTR,GMRDOFF,GMRTY,GMRNM,GMRVX,GMRVX1,GMRVX2,^TMP($J,"GMRDT"),^TMP($J,"GMRG"),^TMP($J,"GMRVG")
Q
GRAPH ;
S:'$D(GFLAG) GFLAG=0 S GMRPGC=0,GMRX1="" F X=1:1:10 S GMRX1=GMRX1_" "_"|"
S (GMRX,GMRX2)=GMRX1 F X=1:1:10 S $P(GMRX,"|",X)="__________",$P(GMRX2,"|",X)="----------"
S GMRPG=$S(GMRTNM=0:1,1:GMRTNM\10+$S(GMRTNM#10>0:1,1:0)) F GMRPGS=1:1:GMRPG S (GMRSLO,GMRDLO)=228.335 D PAGE Q:GMROUT
Q
PAGE ;
K GMRQUAL,GLINE W:'($E(IOST)'="C"&'GFLAG) @IOF S GFLAG=1,GMRPGC=GMRPGC+1 W !
I '$D(^TMP($J,"GMRVG")) W !!!!!!!!,?5,"THERE IS NO DATA FOR THIS REPORT" X "F Y=$Y:1:(IOSL-6) W !" D FOOTER^GMVLBP2 Q
W ! D DATES^GMVVS2 W !,?3,"Blood Pressure",?17,"|",?18,GMRX
F GMRI=0:0 Q:$Y>61 W ! D SETHD^GMVLBP1 W ?10,GMRHDR10,?16,$S(GMR3:"-",1:""),?17,"|" D DATAPRT^GMVLBP1
W !,?17,"|",GMRX2 F GMRI="P","P1","B","D","BQUAL","MAP" S GMRLINE(GMRI)=GMRX1
S GMRNM=0 F GMRDT=0:0 S GMRDT=$O(^TMP($J,"GMRDT",GMRDT)) Q:GMRDT'>0 S GMRNM=GMRNM+1 Q:GMRNM>10 F GMRI="P","B" D:$D(^TMP($J,"GMRVG",GMRI,GMRDT)) STLNP^GMVLBP2
F GMRI="P","P1","B","D","BQUAL","MAP" D
.S G=$S(GMRI="P":"Pulse",GMRI="B":"BLOOD",GMRI="D":" PRESSURE",GMRI="MAP":"MAP",1:"")
. W !,?5,G,?17,"|",GMRLINE(GMRI)
I 'GMROUT W !,?17,$$REPEAT^XLFSTR("-",111)
W !,"S: Systolic B/P D: Diastolic B/P MAP: Mean Arterial Pressure * - Abnormal value ** - Abnormal value off of graph"
W ! I $D(GMRQUAL) S GLPRNTR=1 D LEGEND^GMVLGQU F I=1:1:5 W !,GLINE(I)
I IOSL'<($Y+10) F X=1:1 W ! Q:IOSL<($Y+10)
D FOOTER^GMVLBP2 S GMRDT="" F GMRNM=1:1:10 S GMRDT=$O(^TMP($J,"GMRDT",GMRDT)) Q:GMRDT'>0 K ^TMP($J,"GMRDT",GMRDT)
K GG,GI,GMRVJ,GSYNO Q
CKDT F GMRJ=0:0 S GMRJ=$O(^TMP($J,"GMRDT",GMRJ)) Q:GMRJ'>0!(+$P(GMRJ,".")>GMRI) S:+$P(GMRJ,".")=GMRI GFOUND=1
Q
GMRDT S GMRTNM(GMRK)=0 F GMRI=0:0 S GMRI=$O(^TMP($J,"GMRVG",GMRK,GMRI)) Q:GMRI'>0 S GMRJ="" F X=0:0 S GMRJ=$O(^TMP($J,"GMRVG",GMRK,GMRI,GMRJ)) Q:GMRJ="" S GMRTNM(GMRK)=GMRTNM(GMRK)+1 S:GMRK'="XI1" ^TMP($J,"GMRDT",GMRI)=""
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMVLBP0 2826 printed Oct 16, 2024@18:00:15 Page 2
GMVLBP0 ;HIOFO/YH,FT-PATIENT BLOOD PRESSURE LINE PRINTER GRAPH - 1 ;11/6/01 15:49
+1 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
+2 ;
+3 ; This routine uses the following IAs:
+4 ; #10061 - ^VADPT calls (supported)
+5 ; #10104 - ^XLFSTR calls (supported)
+6 ;
SF512 ;BLOOD PRESSURE GRAPH
+1 DO DEM^VADPT
DO INP^VADPT
SET GMRBTH=$PIECE(VADM(3),"^",2)
SET GMRNAM=VADM(1)
+2 SET GSTART1=(9999999-GMRFIN)-.0001
SET GEND1=9999999-GMRSTRT
+3 FOR GTYPE="B","P"
DO SETT^GMVBP0
+4 FOR GMRK="P","B"
DO GMRDT
+5 SET (GMRTNM,GMRI)=0
IF $DATA(^TMP($JOB,"GMRDT"))
FOR
SET GMRI=$ORDER(^TMP($JOB,"GMRDT",GMRI))
if GMRI'>0
QUIT
SET GMRTNM=GMRTNM+1
+6 USE IO
DO GRAPH
+7 KILL GMR3,GMRDAT,GMREN,GMRHDR1,GMRHDR11,GMRHDR10,GMRHDR2,GMRHT,GMRI,GMRJ,GMRK,GMRLINE,GDATA,GMROLD,GMRP,GMRSDIF,GMRPG,GMRPGC,GMRPGS,GMRSHI,GMRSLO,GMRSOFF,GMRSITE,GMRD,GMRDDIF,GMRDHI,GMRDLO,GMRTNM
+8 KILL Z,GCHA,GEN,GTYP,GTYPE,GMAP,GX,GEND1,GSTART1,GLPRNTR,GMRDOFF,GMRTY,GMRNM,GMRVX,GMRVX1,GMRVX2,^TMP($JOB,"GMRDT"),^TMP($JOB,"GMRG"),^TMP($JOB,"GMRVG")
+9 QUIT
GRAPH ;
+1 if '$DATA(GFLAG)
SET GFLAG=0
SET GMRPGC=0
SET GMRX1=""
FOR X=1:1:10
SET GMRX1=GMRX1_" "_"|"
+2 SET (GMRX,GMRX2)=GMRX1
FOR X=1:1:10
SET $PIECE(GMRX,"|",X)="__________"
SET $PIECE(GMRX2,"|",X)="----------"
+3 SET GMRPG=$SELECT(GMRTNM=0:1,1:GMRTNM\10+$SELECT(GMRTNM#10>0:1,1:0))
FOR GMRPGS=1:1:GMRPG
SET (GMRSLO,GMRDLO)=228.335
DO PAGE
if GMROUT
QUIT
+4 QUIT
PAGE ;
+1 KILL GMRQUAL,GLINE
if '($EXTRACT(IOST)'="C"&'GFLAG)
WRITE @IOF
SET GFLAG=1
SET GMRPGC=GMRPGC+1
WRITE !
+2 IF '$DATA(^TMP($JOB,"GMRVG"))
WRITE !!!!!!!!,?5,"THERE IS NO DATA FOR THIS REPORT"
XECUTE "F Y=$Y:1:(IOSL-6) W !"
DO FOOTER^GMVLBP2
QUIT
+3 WRITE !
DO DATES^GMVVS2
WRITE !,?3,"Blood Pressure",?17,"|",?18,GMRX
+4 FOR GMRI=0:0
if $Y>61
QUIT
WRITE !
DO SETHD^GMVLBP1
WRITE ?10,GMRHDR10,?16,$SELECT(GMR3:"-",1:""),?17,"|"
DO DATAPRT^GMVLBP1
+5 WRITE !,?17,"|",GMRX2
FOR GMRI="P","P1","B","D","BQUAL","MAP"
SET GMRLINE(GMRI)=GMRX1
+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>10
QUIT
FOR GMRI="P","B"
if $DATA(^TMP($JOB,"GMRVG",GMRI,GMRDT))
DO STLNP^GMVLBP2
+7 FOR GMRI="P","P1","B","D","BQUAL","MAP"
Begin DoDot:1
+8 SET G=$SELECT(GMRI="P":"Pulse",GMRI="B":"BLOOD",GMRI="D":" PRESSURE",GMRI="MAP":"MAP",1:"")
+9 WRITE !,?5,G,?17,"|",GMRLINE(GMRI)
End DoDot:1
+10 IF 'GMROUT
WRITE !,?17,$$REPEAT^XLFSTR("-",111)
+11 WRITE !,"S: Systolic B/P D: Diastolic B/P MAP: Mean Arterial Pressure * - Abnormal value ** - Abnormal value off of graph"
+12 WRITE !
IF $DATA(GMRQUAL)
SET GLPRNTR=1
DO LEGEND^GMVLGQU
FOR I=1:1:5
WRITE !,GLINE(I)
+13 IF IOSL'<($Y+10)
FOR X=1:1
WRITE !
if IOSL<($Y+10)
QUIT
+14 DO FOOTER^GMVLBP2
SET GMRDT=""
FOR GMRNM=1:1:10
SET GMRDT=$ORDER(^TMP($JOB,"GMRDT",GMRDT))
if GMRDT'>0
QUIT
KILL ^TMP($JOB,"GMRDT",GMRDT)
+15 KILL GG,GI,GMRVJ,GSYNO
QUIT
CKDT FOR GMRJ=0:0
SET GMRJ=$ORDER(^TMP($JOB,"GMRDT",GMRJ))
if GMRJ'>0!(+$PIECE(GMRJ,".")>GMRI)
QUIT
if +$PIECE(GMRJ,".")=GMRI
SET GFOUND=1
+1 QUIT
GMRDT SET GMRTNM(GMRK)=0
FOR GMRI=0:0
SET GMRI=$ORDER(^TMP($JOB,"GMRVG",GMRK,GMRI))
if GMRI'>0
QUIT
SET GMRJ=""
FOR X=0:0
SET GMRJ=$ORDER(^TMP($JOB,"GMRVG",GMRK,GMRI,GMRJ))
if GMRJ=""
QUIT
SET GMRTNM(GMRK)=GMRTNM(GMRK)+1
if GMRK'="XI1"
SET ^TMP($JOB,"GMRDT",GMRI)=""
+1 QUIT