GMVVS2 ;HIOFO/YH,FT-PATIENT VITAL SIGNS-I/O SF 511 GRAPH - 2 ;9/30/02 15:25
;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
;
; This routine uses the following IAs:
; #1392 - FILE 126.56 references (private)
; #1393 - FILE 126.58 references (private)
; #10061 - ^VADPT calls (supported)
; #10104 - ^XLFSTR calls (supported)
;
IO ;PRINT INTAKE/OUTPUT SECTION OF VITAL SIGNS-I/O SHEET
K ^TMP($J,"XI"),^TMP($J,"XO")
F NN=1:1:GN(1)+1 S GMRI="XI"_NN K GMRLINE(GMRI)
F NN=1:1:GN(2)+1 S GMRI="XO"_NN K GMRLINE(GMRI)
S GMRNM=0 F GMRDT=0:0 S GMRDT=$O(^TMP($J,"GMRDT",GMRDT)) Q:GMRDT'>0 S GMRNM=GMRNM+1 Q:GMRNM>10 S GDT=+$E(GMRDT,1,7) D
. F NN=1:1:GN(1)+1 S GMRI="XI"_NN I $D(^TMP($J,"GMR",GMRI,GDT)) D
. . S GMRYDT=$O(^TMP($J,"GMR",GMRI,GDT,0)) I GMRYDT>0 S ^TMP($J,"XI",NN,GDT,GMRYDT)="",GMRLINE(GMRI)=GMRX1
. F NN=1:1:GN(2)+1 S GMRI="XO"_NN I $D(^TMP($J,"GMR",GMRI,GDT)) D
. . S GMRYDT=$O(^TMP($J,"GMR",GMRI,GDT,0)) I GMRYDT>0 S ^TMP($J,"XO",NN,GDT,GMRYDT)="",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 S GDT=+$E(GMRDT,1,7) D SETDATA
I IOSL<($Y+6) D FOOTER,HEADER,DATES W !,?15,"|",?16,GMRX
W !,"Intake(24 Hr)(cc)",?20,"|",GMRX F NN=1:1:GN(1)+1 S GMRI="XI"_NN I $D(GMRLINE(GMRI)) D
.I IOSL<($Y+6) S GMRI(1)=GMRI D FOOTER,HEADER,DATES S GMRI=GMRI(1) W !,?20,"|",?21,GMRX
.W !,?3,$S(NN=1:"IV",NN=2:"BLOOD",NN=3:"P NUTRI",NN=(GN(1)+1):"TOTAL",NN>3&(NN<(GN(1)+1)):$E($P(^GMRD(126.56,+$O(^GMRD(126.56,"C",NN-3,0)),0),"^"),1,6),1:" "),?10,"|",GMRLINE(GMRI)
I IOSL<($Y+6) S GMRI(1)=GMRI D FOOTER,HEADER,DATES S GMRI=GMRI(1) W !,?10,"|",?11,GMRX
W !,"Output(24 Hr)(cc)",?20,"|",GMRX
F NN=1:1:GN(2)+1 S GI="XO"_NN I $D(GMRLINE(GI)) D
.I IOSL<($Y+6) S GMRI(1)=GMRI D FOOTER,HEADER,DATES W !,?20,"|",?21,GMRX S GMRI=GMRI(1)
.W !,?3,$S(NN<(GN(2)+1):$E($P(^GMRD(126.58,+$O(^GMRD(126.58,"C",NN,0)),0),"^"),1,6),NN=(GN(2)+1):"TOTAL",1:" "),?10,"|",GMRLINE(GI)
Q
SETDATA ; FILL GMRLINE WITH I/O DATA AND WRITE GMRLINE
F GMRI="XI","XO" S GMRY=0 F S GMRY=$O(^TMP($J,GMRI,GMRY)) Q:GMRY'>0 D
. I $D(^TMP($J,GMRI,GMRY,GDT)) S GDATA=$O(^TMP($J,GMRI,GMRY,GDT,0)) S:GDATA>0 $P(GMRLINE(GMRI_GMRY),"|",GMRNM)=$J(GDATA,8) K ^TMP($J,"GMR",GMRI_GMRY,GDT),^TMP($J,GMRI,GMRY,GDT,GDATA)
Q
W ! W:GMRNAM'="" ?$X-3,$E(GMRNAM,1,35) W:SSN'="" " "_SSN W:GMRBTH'="" " "_GMRBTH W:GMRAGE'="" " "_GMRAGE_" YRS" W:GMRSEX'="" " "_GMRSEX
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,"VITAL FLOW SHEET"
D INP^VADPT S GMRVHLOC=$$HOSPLOC^GMVUTL1(+$G(VAIN(4)))
W !,"Division: "_$$DIVISION^GMVUTL1(+GMRVHLOC),?55,"Page "_GMRPGC,?95,"VAF 10-7987 VICE SF 511",!
W GSTRFIN Q
DATES ;PRINT DATE/TIME COLUMNS FOR VITAL SIGNS-I/O SHEET
W ?18,$$REPEAT^XLFSTR("_",109),!,?6,"Date/Time",?17,"|" S GMRLINE=GMRX1,GMRJ=0 F GMRI=1:1:10 S GMRJ=$O(^TMP($J,"GMRDT",GMRJ)) Q:GMRJ'>0 S GMRDT=$E(GMRJ,4,5)_"/"_$E(GMRJ,6,7)_"/"_$E(GMRJ,2,3),$P(GMRLINE,"|",GMRI)=GMRDT_" "
W ?18,GMRLINE,! S GMRLINE=GMRX1,GMRJ=0 F GMRI=1:1:10 S GMRJ=$O(^TMP($J,"GMRDT",GMRJ)) Q:GMRJ'>0 S:+$P(GMRJ,".",2)>0 GMRDT=$E($P(GMRJ,".",2)_"0000000",1,4),$P(GMRLINE,"|",GMRI)=$E($E(GMRDT,1,2)_":"_$E(GMRDT,3,4)_" ",1,10)
W ?17,"|",?18,GMRLINE
Q
W:'($E(IOST)'="C"&'GFLAG) @IOF S GFLAG=1,GMRPGC=GMRPGC+1
W !,?116,"PAGE ",GMRPGC,!
Q
BP ;
S GMR("B")=$O(^TMP($J,"GMR","B",GMRDT,"")) Q:GMR("B")=""
I GMR("B")'>0,GMR("B")'="" S $P(GMRLINE("B"),"|",GMRNM)=$E(GMR("B")_" ",1,10),$P(GMRLINE("B1"),"|",GMRNM)=" ",$P(GMRLINE("B2"),"|",GMRNM)=" " Q
S (GMRSITE,GMRSITE(1),GMRINF,GMRVJ)="" S:GMR("B")'="" GMRSITE(1)=$P(^TMP($J,"GMR","B",GMRDT,GMR("B")),"^"),GMRVJ=$P(^(GMR("B")),"^",2),GMRINF=$P(^(GMR("B")),"^",4)
I GMRSITE(1)'="" S GI="B" D SYNOARY^GMVLGQU
S $P(GMRLINE("B"),"|",GMRNM)=$E($P(GMR("B"),"/",1,2)_" ",1,10)
S $P(GMRLINE("B1"),"|",GMRNM)=$E($P(GMR("B"),"/",3)_" "_$S($L(GMRSITE," ")>3:$P(GMRSITE," "),1:"")_" ",1,10)
S $P(GMRLINE("B2"),"|",GMRNM)=$E($S($L(GMRSITE," ")>3:$P(GMRSITE," ",2,4),1:GMRSITE)_" ",1,10)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMVVS2 4281 printed Oct 16, 2024@18:00:52 Page 2
GMVVS2 ;HIOFO/YH,FT-PATIENT VITAL SIGNS-I/O SF 511 GRAPH - 2 ;9/30/02 15:25
+1 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
+2 ;
+3 ; This routine uses the following IAs:
+4 ; #1392 - FILE 126.56 references (private)
+5 ; #1393 - FILE 126.58 references (private)
+6 ; #10061 - ^VADPT calls (supported)
+7 ; #10104 - ^XLFSTR calls (supported)
+8 ;
IO ;PRINT INTAKE/OUTPUT SECTION OF VITAL SIGNS-I/O SHEET
+1 KILL ^TMP($JOB,"XI"),^TMP($JOB,"XO")
+2 FOR NN=1:1:GN(1)+1
SET GMRI="XI"_NN
KILL GMRLINE(GMRI)
+3 FOR NN=1:1:GN(2)+1
SET GMRI="XO"_NN
KILL GMRLINE(GMRI)
+4 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
SET GDT=+$EXTRACT(GMRDT,1,7)
Begin DoDot:1
+5 FOR NN=1:1:GN(1)+1
SET GMRI="XI"_NN
IF $DATA(^TMP($JOB,"GMR",GMRI,GDT))
Begin DoDot:2
+6 SET GMRYDT=$ORDER(^TMP($JOB,"GMR",GMRI,GDT,0))
IF GMRYDT>0
SET ^TMP($JOB,"XI",NN,GDT,GMRYDT)=""
SET GMRLINE(GMRI)=GMRX1
End DoDot:2
+7 FOR NN=1:1:GN(2)+1
SET GMRI="XO"_NN
IF $DATA(^TMP($JOB,"GMR",GMRI,GDT))
Begin DoDot:2
+8 SET GMRYDT=$ORDER(^TMP($JOB,"GMR",GMRI,GDT,0))
IF GMRYDT>0
SET ^TMP($JOB,"XO",NN,GDT,GMRYDT)=""
SET GMRLINE(GMRI)=GMRX1
End DoDot:2
End DoDot:1
+9 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
SET GDT=+$EXTRACT(GMRDT,1,7)
DO SETDATA
+10 IF IOSL<($Y+6)
DO FOOTER
DO HEADER
DO DATES
WRITE !,?15,"|",?16,GMRX
+11 WRITE !,"Intake(24 Hr)(cc)",?20,"|",GMRX
FOR NN=1:1:GN(1)+1
SET GMRI="XI"_NN
IF $DATA(GMRLINE(GMRI))
Begin DoDot:1
+12 IF IOSL<($Y+6)
SET GMRI(1)=GMRI
DO FOOTER
DO HEADER
DO DATES
SET GMRI=GMRI(1)
WRITE !,?20,"|",?21,GMRX
+13 WRITE !,?3,$SELECT(NN=1:"IV",NN=2:"BLOOD",NN=3:"P NUTRI",NN=(GN(1)+1):"TOTAL",NN>3&(NN<(GN(1)+1)):$EXTRACT($PIECE(^GMRD(126.56,+$ORDER(^GMRD(126.56,"C",NN-3,0)),0),"^"),1,6),1:" "),?10,"|",GMRLINE(GMRI)
End DoDot:1
+14 IF IOSL<($Y+6)
SET GMRI(1)=GMRI
DO FOOTER
DO HEADER
DO DATES
SET GMRI=GMRI(1)
WRITE !,?10,"|",?11,GMRX
+15 WRITE !,"Output(24 Hr)(cc)",?20,"|",GMRX
+16 FOR NN=1:1:GN(2)+1
SET GI="XO"_NN
IF $DATA(GMRLINE(GI))
Begin DoDot:1
+17 IF IOSL<($Y+6)
SET GMRI(1)=GMRI
DO FOOTER
DO HEADER
DO DATES
WRITE !,?20,"|",?21,GMRX
SET GMRI=GMRI(1)
+18 WRITE !,?3,$SELECT(NN<(GN(2)+1):$EXTRACT($PIECE(^GMRD(126.58,+$ORDER(^GMRD(126.58,"C",NN,0)),0),"^"),1,6),NN=(GN(2)+1):"TOTAL",1:" "),?10,"|",GMRLINE(GI)
End DoDot:1
+19 QUIT
SETDATA ; FILL GMRLINE WITH I/O DATA AND WRITE GMRLINE
+1 FOR GMRI="XI","XO"
SET GMRY=0
FOR
SET GMRY=$ORDER(^TMP($JOB,GMRI,GMRY))
if GMRY'>0
QUIT
Begin DoDot:1
+2 IF $DATA(^TMP($JOB,GMRI,GMRY,GDT))
SET GDATA=$ORDER(^TMP($JOB,GMRI,GMRY,GDT,0))
if GDATA>0
SET $PIECE(GMRLINE(GMRI_GMRY),"|",GMRNM)=$JUSTIFY(GDATA,8)
KILL ^TMP($JOB,"GMR",GMRI_GMRY,GDT),^TMP($JOB,GMRI,GMRY,GDT,GDATA)
End DoDot:1
+3 QUIT
+1 WRITE !
if GMRNAM'=""
WRITE ?$X-3,$EXTRACT(GMRNAM,1,35)
if SSN'=""
WRITE " "_SSN
if GMRBTH'=""
WRITE " "_GMRBTH
if GMRAGE'=""
WRITE " "_GMRAGE_" YRS"
if GMRSEX'=""
WRITE " "_GMRSEX
+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,"VITAL FLOW SHEET"
+3 DO INP^VADPT
SET GMRVHLOC=$$HOSPLOC^GMVUTL1(+$GET(VAIN(4)))
+4 WRITE !,"Division: "_$$DIVISION^GMVUTL1(+GMRVHLOC),?55,"Page "_GMRPGC,?95,"VAF 10-7987 VICE SF 511",!
+5 WRITE GSTRFIN
QUIT
DATES ;PRINT DATE/TIME COLUMNS FOR VITAL SIGNS-I/O SHEET
+1 WRITE ?18,$$REPEAT^XLFSTR("_",109),!,?6,"Date/Time",?17,"|"
SET GMRLINE=GMRX1
SET GMRJ=0
FOR GMRI=1:1:10
SET GMRJ=$ORDER(^TMP($JOB,"GMRDT",GMRJ))
if GMRJ'>0
QUIT
SET GMRDT=$EXTRACT(GMRJ,4,5)_"/"_$EXTRACT(GMRJ,6,7)_"/"_$EXTRACT(GMRJ,2,3)
SET $PIECE(GMRLINE,"|",GMRI)=GMRDT_" "
+2 WRITE ?18,GMRLINE,!
SET GMRLINE=GMRX1
SET GMRJ=0
FOR GMRI=1:1:10
SET GMRJ=$ORDER(^TMP($JOB,"GMRDT",GMRJ))
if GMRJ'>0
QUIT
if +$PIECE(GMRJ,".",2)>0
SET GMRDT=$EXTRACT($PIECE(GMRJ,".",2)_"0000000",1,4)
SET $PIECE(GMRLINE,"|",GMRI)=$EXTRACT($EXTRACT(GMRDT,1,2)_":"_$EXTRACT(GMRDT,3,4)_" ",1,10)
+3 WRITE ?17,"|",?18,GMRLINE
+4 QUIT
+1 if '($EXTRACT(IOST)'="C"&'GFLAG)
WRITE @IOF
SET GFLAG=1
SET GMRPGC=GMRPGC+1
+2 WRITE !,?116,"PAGE ",GMRPGC,!
+3 QUIT
BP ;
+1 SET GMR("B")=$ORDER(^TMP($JOB,"GMR","B",GMRDT,""))
if GMR("B")=""
QUIT
+2 IF GMR("B")'>0
IF GMR("B")'=""
SET $PIECE(GMRLINE("B"),"|",GMRNM)=$EXTRACT(GMR("B")_" ",1,10)
SET $PIECE(GMRLINE("B1"),"|",GMRNM)=" "
SET $PIECE(GMRLINE("B2"),"|",GMRNM)=" "
QUIT
+3 SET (GMRSITE,GMRSITE(1),GMRINF,GMRVJ)=""
if GMR("B")'=""
SET GMRSITE(1)=$PIECE(^TMP($JOB,"GMR","B",GMRDT,GMR("B")),"^")
SET GMRVJ=$PIECE(^(GMR("B")),"^",2)
SET GMRINF=$PIECE(^(GMR("B")),"^",4)
+4 IF GMRSITE(1)'=""
SET GI="B"
DO SYNOARY^GMVLGQU
+5 SET $PIECE(GMRLINE("B"),"|",GMRNM)=$EXTRACT($PIECE(GMR("B"),"/",1,2)_" ",1,10)
+6 SET $PIECE(GMRLINE("B1"),"|",GMRNM)=$EXTRACT($PIECE(GMR("B"),"/",3)_" "_$SELECT($LENGTH(GMRSITE," ")>3:$PIECE(GMRSITE," "),1:"")_" ",1,10)
+7 SET $PIECE(GMRLINE("B2"),"|",GMRNM)=$EXTRACT($SELECT($LENGTH(GMRSITE," ")>3:$PIECE(GMRSITE," ",2,4),1:GMRSITE)_" ",1,10)
+8 QUIT