GMRYSE1 ;HIRMFO/YH-ITEMIZED PATIENT I/O REPORT BY SHIFT PART 2 ;3/11/97
;;4.0;Intake/Output;**9**;Apr 25, 1997;Build 6
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
N GPOS
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=$$GPOS(GNURSE)
W "/"_$S(GPOS="R":"RN",GPOS="L":"LPN",GPOS="N":"NA",GPOS="C":"CL",1:"OTH")
Q W ! Q
;
GPOS(GNURSE) ;
N GDATE1,GLOC1,GSEQ,GSTR,GSTART,GEND
S (GPOS,GLOC1,GSEQ,GSTR,GSTART,GEND)=""
I GNURSE="" Q GPOS
;
;Retrieve previous start date to I/O date unless I/O date also a start date.
;
S GDATE1=$S($D(^NURSF(211.8,"ASDT",GNURSE,GDATE)):GDATE,1:$O(^NURSF(211.8,"ASDT",GNURSE,GDATE),-1))
I GDATE1="" Q GPOS
F S GLOC1=$O(^NURSF(211.8,"ASDT",GNURSE,GDATE1,GLOC1)) Q:GLOC1="" D
. F S GSEQ=$O(^NURSF(211.8,"ASDT",GNURSE,GDATE1,GLOC1,GSEQ)) Q:GSEQ="" D
. . S GSTR=$G(^NURSF(211.8,GLOC1,1,GSEQ,0)) Q:GSTR=""
. . S GSTART=$P(GSTR,"^"),GEND=$P(GSTR,"^",6)
. . ;
. . ;Checking to see if the date that I/O was recorded (GDATE)
. . ;falls in timeframe when the service position was active.
. . ;
. . I $S(GEND="":1,GEND'<GDATE:1,1:0),$D(^NURSF(211.8,GLOC1,0)) D
. . . S GPOS=$P(^NURSF(211.8,GLOC1,0),"^",2)
Q GPOS
;
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
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRYSE1 3548 printed Dec 13, 2024@01:55:38 Page 2
GMRYSE1 ;HIRMFO/YH-ITEMIZED PATIENT I/O REPORT BY SHIFT PART 2 ;3/11/97
+1 ;;4.0;Intake/Output;**9**;Apr 25, 1997;Build 6
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 NEW GPOS
+2 SET GNURSE=$PIECE(GDATA,"^",3)
SET GTEXT=$PIECE(GDATA,"^",2)
DO WHR^GMRYSE3
+3 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:"")
+4 IF GIO="OUT"
IF (GSUB>0&(GSUB<99))
IF $DATA(^GMRD(126.6,GSUB,0))
WRITE " "_$PIECE(^GMRD(126.6,+GSUB,0),"^")
+5 IF GIO="OUT"
IF $PIECE(GDATA,"^",2)'=""
SET GTXT(1)="- "_$PIECE(GDATA,"^",2)
DO WLINE^GMRYSE3
+6 SET GITEM=$PIECE(GDATA,"^",4)
IF GITEM'=""
SET GTXT(1)="- "_GITEM
DO WLINE^GMRYSE3
+7 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),"^"))
+8 SET GPOS=$$GPOS(GNURSE)
+9 WRITE "/"_$SELECT(GPOS="R":"RN",GPOS="L":"LPN",GPOS="N":"NA",GPOS="C":"CL",1:"OTH")
Q WRITE !
QUIT
+1 ;
GPOS(GNURSE) ;
+1 NEW GDATE1,GLOC1,GSEQ,GSTR,GSTART,GEND
+2 SET (GPOS,GLOC1,GSEQ,GSTR,GSTART,GEND)=""
+3 IF GNURSE=""
QUIT GPOS
+4 ;
+5 ;Retrieve previous start date to I/O date unless I/O date also a start date.
+6 ;
+7 SET GDATE1=$SELECT($DATA(^NURSF(211.8,"ASDT",GNURSE,GDATE)):GDATE,1:$ORDER(^NURSF(211.8,"ASDT",GNURSE,GDATE),-1))
+8 IF GDATE1=""
QUIT GPOS
+9 FOR
SET GLOC1=$ORDER(^NURSF(211.8,"ASDT",GNURSE,GDATE1,GLOC1))
if GLOC1=""
QUIT
Begin DoDot:1
+10 FOR
SET GSEQ=$ORDER(^NURSF(211.8,"ASDT",GNURSE,GDATE1,GLOC1,GSEQ))
if GSEQ=""
QUIT
Begin DoDot:2
+11 SET GSTR=$GET(^NURSF(211.8,GLOC1,1,GSEQ,0))
if GSTR=""
QUIT
+12 SET GSTART=$PIECE(GSTR,"^")
SET GEND=$PIECE(GSTR,"^",6)
+13 ;
+14 ;Checking to see if the date that I/O was recorded (GDATE)
+15 ;falls in timeframe when the service position was active.
+16 ;
+17 IF $SELECT(GEND="":1,GEND'<GDATE:1,1:0)
IF $DATA(^NURSF(211.8,GLOC1,0))
Begin DoDot:3
+18 SET GPOS=$PIECE(^NURSF(211.8,GLOC1,0),"^",2)
End DoDot:3
End DoDot:2
End DoDot:1
+19 QUIT GPOS
+20 ;
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