GMRYSE1 ;HIRMFO/YH-ITEMIZED PATIENT I/O REPORT BY SHIFT PART 2 ;3/11/97
;;4.0;Intake/Output;;Apr 25, 1997
BODY ;
I '$D(^TMP($J)) W !!,?5,"NO DATA FOR THIS PERIOD",!! Q
D INITOT^GMRYRP3,INISHFT^GMRYRP3,SHFTP,DAYP S (GRNDIP,GRNDOP)="" D SUM^GMRYSE2
Q
F X=1:1 W ! Q:IOSL<($Y+$S($E(IOST)="P":4,1:10))
D FOOTER^GMRYRP3 Q
REPORT ;
D TITLE^GMRYRP3
S GMRDOT="",$P(GMRDOT,".",50)="",GMRX="",$P(GMRX,"-",$S(GRPT=2:53,GRPT=3:32,1:53))="" D HEADER2 S GQT=1 D BODY D:'GMROUT FOOTER I $E(IOST)'="P",'GMROUT W !,"Press return to continue " R X:DTIME I '$T!(X["^") S GMROUT=1
K GCATH,GTOTAL,GLEFT,GREASON,GY Q
I GQT D FOOTER
I GQT,'GQ,$E(IOST)'="P" W !,"Press return to continue or ""^"" to stop " R X:DTIME I '$T!(X="^") S GMROUT=1 Q
W:'($E(IOST)'="C"&'GPC) @IOF
S GQT=1,GPC=GPC+1,GCOL=$S(IOM>80:40,1:10) W !,?GCOL,"PATIENT INTAKE/OUTPUT REPORT BY SHIFT AND EVENT TYPE" S GCOL=$S(IOM>80:120,1:70) W ?GCOL,"PAGE: ",GPC
S GCOL=$S(IOM>80:40,1:10) W !,?GCOL,$S(GRPT=9:$E(GMRX,1,46),1:GMRX),! S GCOL=GCOL+8 W ?GCOL,GMRDT1," - ",GMRDT2,!
I $D(GY) W GY_"(continued)",!
Q
NPOS ;OBTAIN NURSE POSITION
S GNURSE=$P(GDATA,"^",3),GTEXT=$P(GDATA,"^",2) D WHR^GMRYSE3
W ?14,$S(GIO="IN":$P($G(^GMRD(126.56,+GTYPE,0)),"^")_" intake vol: ",GIO="OUT":$P($G(^GMRD(126.58,+GTYPE,0)),"^")_" output vol: ",1:""),GAMOUNT_$S(GAMOUNT>0!(GAMOUNT="0"):" mls",1:"")
I GIO="OUT",(GSUB>0&(GSUB<99)),$D(^GMRD(126.6,GSUB,0)) W " "_$P(^GMRD(126.6,+GSUB,0),"^")
I GIO="OUT",$P(GDATA,"^",2)'="" S GTXT(1)="- "_$P(GDATA,"^",2) D WLINE^GMRYSE3
S GITEM=$P(GDATA,"^",4) I GITEM'="" S GTXT(1)="- "_GITEM D WLINE^GMRYSE3
S GITEM="" G:GNURSE="" Q S GCOL=$S(IOM>80:120,1:70) W ?GCOL,$E($P($P(^VA(200,GNURSE,0),"^"),",",2)),$E($P(^(0),"^"))
S GPOS="" I GNURSE'="",$D(^NURSF(211.8,"C",GNURSE)) S GLOC=$O(^NURSF(211.8,"C",GNURSE,0)) S:$D(^NURSF(211.8,GLOC,0)) GPOS=$P(^(0),"^",2)
W "/"_$S(GPOS="R":"RN",GPOS="L":"LPN",GPOS="N":"NA",GPOS="C":"CL",1:"OTH")
Q W ! Q
ILABEL ;
I II>3 S GLAB=$P(^GMRD(126.56,$O(^GMRD(126.56,"C",II-3,0)),0),"^") Q
S GLAB=$S(II=1:"IV FLUIDS",II=2:"BLOOD/PRODUCT",II=3:"PARENTERAL NUTR.",1:"") Q
OLABEL ;
S GLAB=$P(^GMRD(126.58,II,0),"^") Q
CHKPR ;
I ($Y+4)>IOSL D HEADER2 Q:GMROUT
I GIO="IN",GPRT(1)=0 W ?2,"INTAKE:",! S GPRT(1)=1 Q
I GIO="OUT",GPRT(2)=0 W ?2,"OUTPUT:",! S GPRT(2)=1 Q
Q
CHKTYP ;
I ($Y+4)>IOSL D HEADER2 Q:GMROUT
I GIO="IN" W ?4,$S(GSUB=1:"PO",GSUB=2:"NASOGASTRIC",GSUB=3:"GASTROTOMY",GSUB=4:"PHARYNGOTOMY",1:"OTHER")
I GIO="OUT" W ?4,$P(^GMRD(126.6,+GSUB,0),"^")
Q
SHFTP ;FIELD TO SAVE '+' CODE FOR SHIFT TOTAL
F II=1:1:GN(1) S GSIP(II)=""
F II=1:1:GN(2) S GSOP(II)=""
Q
DAYP ;FIELD TO SAVE '+' CODE FOR DAY TOTAL
F II=1:1:GN(1) S GDIP(II)=""
F II=1:1:GN(2) S GDOP(II)=""
Q
GMRYSE1 ;HIRMFO/YH-ITEMIZED PATIENT I/O REPORT BY SHIFT PART 2 ;3/11/97
+1 ;;4.0;Intake/Output;;Apr 25, 1997
BODY ;
+1 IF '$DATA(^TMP($JOB))
WRITE !!,?5,"NO DATA FOR THIS PERIOD",!!
QUIT
+2 DO INITOT^GMRYRP3
DO INISHFT^GMRYRP3
DO SHFTP
DO DAYP
SET (GRNDIP,GRNDOP)=""
DO SUM^GMRYSE2
+3 QUIT
+1 FOR X=1:1
WRITE !
IF IOSL<($Y+$SELECT($EXTRACT(IOST)="P"
QUIT
+2 DO FOOTER^GMRYRP3
QUIT
REPORT ;
+1 DO TITLE^GMRYRP3
+2 SET GMRDOT=""
SET $PIECE(GMRDOT,".",50)=""
SET GMRX=""
SET $PIECE(GMRX,"-",$SELECT(GRPT=2:53,GRPT=3:32,1:53))=""
DO HEADER2
SET GQT=1
DO BODY
IF 'GMROUT
DO FOOTER
IF $EXTRACT(IOST)'="P"
IF 'GMROUT
WRITE !,"Press return to continue "
READ X:DTIME
IF '$TEST!(X["^")
SET GMROUT=1
+3 KILL GCATH,GTOTAL,GLEFT,GREASON,GY
QUIT
+1 IF GQT
DO FOOTER
+2 IF GQT
IF 'GQ
IF $EXTRACT(IOST)'="P"
WRITE !,"Press return to continue or ""^"" to stop "
READ X:DTIME
IF '$TEST!(X="^")
SET GMROUT=1
QUIT
+3 IF '($EXTRACT(IOST)'="C"&'GPC)
WRITE @IOF
+4 SET GQT=1
SET GPC=GPC+1
SET GCOL=$SELECT(IOM>80:40,1:10)
WRITE !,?GCOL,"PATIENT INTAKE/OUTPUT REPORT BY SHIFT AND EVENT TYPE"
SET GCOL=$SELECT(IOM>80:120,1:70)
WRITE ?GCOL,"PAGE: ",GPC
+5 SET GCOL=$SELECT(IOM>80:40,1:10)
WRITE !,?GCOL,$SELECT(GRPT=9:$EXTRACT(GMRX,1,46),1:GMRX),!
SET GCOL=GCOL+8
WRITE ?GCOL,GMRDT1," - ",GMRDT2,!
+6 IF $DATA(GY)
WRITE GY_"(continued)",!
+7 QUIT
NPOS ;OBTAIN NURSE POSITION
+1 SET GNURSE=$PIECE(GDATA,"^",3)
SET GTEXT=$PIECE(GDATA,"^",2)
DO WHR^GMRYSE3
+2 WRITE ?14,$SELECT(GIO="IN":$PIECE($GET(^GMRD(126.56,+GTYPE,0)),"^")_" intake vol: ",GIO="OUT":$PIECE($GET(^GMRD(126.58,+GTYPE,0)),"^")_" output vol: ",1:""),GAMOUNT_$SELECT(GAMOUNT>0!(GAMOUNT="0"):" mls",1:"")
+3 IF GIO="OUT"
IF (GSUB>0&(GSUB<99))
IF $DATA(^GMRD(126.6,GSUB,0))
WRITE " "_$PIECE(^GMRD(126.6,+GSUB,0),"^")
+4 IF GIO="OUT"
IF $PIECE(GDATA,"^",2)'=""
SET GTXT(1)="- "_$PIECE(GDATA,"^",2)
DO WLINE^GMRYSE3
+5 SET GITEM=$PIECE(GDATA,"^",4)
IF GITEM'=""
SET GTXT(1)="- "_GITEM
DO WLINE^GMRYSE3
+6 SET GITEM=""
IF GNURSE=""
GOTO Q
SET GCOL=$SELECT(IOM>80:120,1:70)
WRITE ?GCOL,$EXTRACT($PIECE($PIECE(^VA(200,GNURSE,0),"^"),",",2)),$EXTRACT($PIECE(^(0),"^"))
+7 SET GPOS=""
IF GNURSE'=""
IF $DATA(^NURSF(211.8,"C",GNURSE))
SET GLOC=$ORDER(^NURSF(211.8,"C",GNURSE,0))
IF $DATA(^NURSF(211.8,GLOC,0))
SET GPOS=$PIECE(^(0),"^",2)
+8 WRITE "/"_$SELECT(GPOS="R":"RN",GPOS="L":"LPN",GPOS="N":"NA",GPOS="C":"CL",1:"OTH")
Q WRITE !
QUIT
ILABEL ;
+1 IF II>3
SET GLAB=$PIECE(^GMRD(126.56,$ORDER(^GMRD(126.56,"C",II-3,0)),0),"^")
QUIT
+2 SET GLAB=$SELECT(II=1:"IV FLUIDS",II=2:"BLOOD/PRODUCT",II=3:"PARENTERAL NUTR.",1:"")
QUIT
OLABEL ;
+1 SET GLAB=$PIECE(^GMRD(126.58,II,0),"^")
QUIT
CHKPR ;
+1 IF ($Y+4)>IOSL
DO HEADER2
IF GMROUT
QUIT
+2 IF GIO="IN"
IF GPRT(1)=0
WRITE ?2,"INTAKE:",!
SET GPRT(1)=1
QUIT
+3 IF GIO="OUT"
IF GPRT(2)=0
WRITE ?2,"OUTPUT:",!
SET GPRT(2)=1
QUIT
+4 QUIT
CHKTYP ;
+1 IF ($Y+4)>IOSL
DO HEADER2
IF GMROUT
QUIT
+2 IF GIO="IN"
WRITE ?4,$SELECT(GSUB=1:"PO",GSUB=2:"NASOGASTRIC",GSUB=3:"GASTROTOMY",GSUB=4:"PHARYNGOTOMY",1:"OTHER")
+3 IF GIO="OUT"
WRITE ?4,$PIECE(^GMRD(126.6,+GSUB,0),"^")
+4 QUIT
SHFTP ;FIELD TO SAVE '+' CODE FOR SHIFT TOTAL
+1 FOR II=1:1:GN(1)
SET GSIP(II)=""
+2 FOR II=1:1:GN(2)
SET GSOP(II)=""
+3 QUIT
DAYP ;FIELD TO SAVE '+' CODE FOR DAY TOTAL
+1 FOR II=1:1:GN(1)
SET GDIP(II)=""
+2 FOR II=1:1:GN(2)
SET GDOP(II)=""
+3 QUIT