GMRYRP0 ;HIRMFO/YH-PATIENT INTAKE/OUTPUT REPORT ;2/25/91
;;4.0;Intake/Output;;Apr 25, 1997
EN1 ;PATIENT I/O SUMMARY REPORT BY DATE AND SHIFT
S ZTDESC="PATIENT I/O SUMMARY BY DATE AND SHIFT",GRPT=1,GMROUT=0,GMREDB="P" D DATE^GMRYRP1 G:GMROUT Q D PATDAT^GMRYUT0 G:GMROUT Q
RPT2 ;
S GMRCOL=6*(3+$P(^GMRD(126.56,0),"^",4)+$P(^GMRD(126.58,0),"^",4))
W:GRPT=5!(GMRCOL>80) !!,"This report should be sent to 132 column PRINTER - PORT !!!",!! D DEV G:POP Q I GRPT=5&(IOM'>130) G RPT2
I $D(IO("Q")) K IO("Q"),IO("C") S ZTRTN="START^GMRYRP0",ZTIO=ION_";"_IOM_";"_IOSL D LOOP1,^%ZTLOAD,HOME^%ZIS D Q2 Q
START ;
I '$D(^GMRD(126.95,1,1)) W !,"NUR SHIFT FILE NOT DEFINED",! S GMROUT=1 Q:GRPT>7 D Q G Q2
S GMRDAY=$P(^GMRD(126.95,1,1),"^",2),GMREVE=$P(^(1),"^",3),GMRNIT=$P(^(1),"^") I GMRDAY=""!(GMREVE="")!(GMRNIT="") W !,"NUR SHIFT STARTING HOUR NOT DEFINED",! S GMROUT=1 Q:GRPT>7 D Q G Q2
S Y=GMRSTRT D DD^%DT S GMRDT1=Y,Y=GMRFIN D DD^%DT S GMRDT2=Y
D STARTD^GMRYRP1 U IO S (GQ,GQT,GPC)=0 Q:GRPT>7
I "Pp"[GMREDB D PATIENT^GMRYUT9 G:GMROUT Q D ^GMRYRP2 G:GMROUT Q D REPORT1^GMRYRP3 D Q G Q2
I "SsWw"[GMREDB D:$D(GMRNUR) PATIENT^GMRYUT11
G:'$D(^TMP("GMRPT",$J)) Q S GROOM="" F J=0:0 S GROOM=$O(^TMP("GMRPT",$J,GROOM)) Q:GROOM=""!GMROUT S GBED="" F J=0:0 S GBED=$O(^TMP("GMRPT",$J,GROOM,G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PT,VAROOT,GTYPI,GTYPO,GN,GNN,GLN Q
DEV S %ZIS="Q" S %ZIS("B")="HOME" D ^%ZIS K:POP IO("Q") Q:POP
I GRPT=4,$E(IOST)'="C",IOM<80,GMRCOL>80 D ^%ZISC W !,$C(7),"** THIS REPORT NEEDS 132 COLUMNS - PORT **",! G DEV
Q
LOOP1 ;
F X="GMRWARD","GMRWARD(","GMRNUR","GNRMBD(","GMROUT","GMRFIN","GMRSTRT","GMREDB","GRPT","DFN","^TMP(""GMRPT"",$J,","GMRCOL" S ZTSAVE(X)=""
Q
EN2 ;PATIENT I/O SUMMARY REPORT FOR THE PREVIOUS DAY
S ZTDESC="PATIENT I/O SUMMARY REPORT FOR THE PREVIOUS DAY",GRPT=3,GMROUT=0,X1=DT,X2=-1 D C^%DTC S (GMRSTRT,GMRFIN)=X S GMROP(1)=$S($D(GMRNUR):"WARDPAT^GMRYUT4",1:"MASPT^GMRYRP5") D @GMROP(1) G:'GMROUT RPT2
D Q,Q2 Q
EN3 ;PATIENT VITAL SIGNS & I/O SHEET - SF511
S ZTDESC="PATIENT VITAL SIGNS & I/O SHEET - SF511",GRPT=5,GMROUT=0 D DATE^GMRYRP1 G:GMROUT Q S GMROP(1)=$S($D(GMRNUR):"WARDPAT^GMRYUT4",1:"MASPT^GMRYRP5") D @GMROP(1) G:'GMROUT RPT2
D Q,Q2 Q
EN4 ;PATIENT I/O SUMMARY FOR TODAY
S ZTDESC="PATIENT I/O SUMMARY FOR TODAY",GRPT=2,GMROUT=0,(GMRSTRT,GMRFIN)=DT S GMROP(1)=$S($D(GMRNUR):"WARDPAT^GMRYUT4",1:"MASPT^GMRYRP5") D @GMROP(1) G:'GMROUT RPT2
D Q,Q2 Q
EN5 ;I/O SUMMARY FOR 48 HRS
S ZTDESC="I/O SUMMARY FOR 48 HRS",GRPT=4,GMROUT=0,X1=DT,X2=-1 D C^%DTC S GMRSTRT=X,GMRFIN=DT S GMROP(1)=$S($D(GMRNUR):"WARDPAT^GMRYUT4",1:"MASPT^GMRYRP5") D @GMROP(1) G:'GMROUT RPT2
D Q,Q2 Q
STOP Q:GMROUT W "Press return to continue or ""^"" to stop " R X:DTIME
I '$T!(X="^") S GMROUT=1 Q
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRYRP0 3829 printed Oct 16, 2024@17:56:19 Page 2
GMRYRP0 ;HIRMFO/YH-PATIENT INTAKE/OUTPUT REPORT ;2/25/91
+1 ;;4.0;Intake/Output;;Apr 25, 1997
EN1 ;PATIENT I/O SUMMARY REPORT BY DATE AND SHIFT
+1 SET ZTDESC="PATIENT I/O SUMMARY BY DATE AND SHIFT"
SET GRPT=1
SET GMROUT=0
SET GMREDB="P"
DO DATE^GMRYRP1
if GMROUT
GOTO Q
DO PATDAT^GMRYUT0
if GMROUT
GOTO Q
RPT2 ;
+1 SET GMRCOL=6*(3+$PIECE(^GMRD(126.56,0),"^",4)+$PIECE(^GMRD(126.58,0),"^",4))
+2 if GRPT=5!(GMRCOL>80)
WRITE !!,"This report should be sent to 132 column PRINTER - PORT !!!",!!
DO DEV
if POP
GOTO Q
IF GRPT=5&(IOM'>130)
GOTO RPT2
+3 IF $DATA(IO("Q"))
KILL IO("Q"),IO("C")
SET ZTRTN="START^GMRYRP0"
SET ZTIO=ION_";"_IOM_";"_IOSL
DO LOOP1
DO ^%ZTLOAD
DO HOME^%ZIS
DO Q2
QUIT
START ;
+1 IF '$DATA(^GMRD(126.95,1,1))
WRITE !,"NUR SHIFT FILE NOT DEFINED",!
SET GMROUT=1
if GRPT>7
QUIT
DO Q
GOTO Q2
+2 SET GMRDAY=$PIECE(^GMRD(126.95,1,1),"^",2)
SET GMREVE=$PIECE(^(1),"^",3)
SET GMRNIT=$PIECE(^(1),"^")
IF GMRDAY=""!(GMREVE="")!(GMRNIT="")
WRITE !,"NUR SHIFT STARTING HOUR NOT DEFINED",!
SET GMROUT=1
if GRPT>7
QUIT
DO Q
GOTO Q2
+3 SET Y=GMRSTRT
DO DD^%DT
SET GMRDT1=Y
SET Y=GMRFIN
DO DD^%DT
SET GMRDT2=Y
+4 DO STARTD^GMRYRP1
USE IO
SET (GQ,GQT,GPC)=0
if GRPT>7
QUIT
+5 IF "Pp"[GMREDB
DO PATIENT^GMRYUT9
if GMROUT
GOTO Q
DO ^GMRYRP2
if GMROUT
GOTO Q
DO REPORT1^GMRYRP3
DO Q
GOTO Q2
+6 IF "SsWw"[GMREDB
if $DATA(GMRNUR)
DO PATIENT^GMRYUT11
+7 if '$DATA(^TMP("GMRPT",$JOB))
GOTO Q
SET GROOM=""
FOR J=0:0
SET GROOM=$ORDER(^TMP("GMRPT",$JOB,GROOM))
if GROOM=""!GMROUT
QUIT
SET GBED=""
FOR J=0:0
SET GBED=$ORDER(^TMP("GMRPT",$JOB,GROOM,GBED))
if GBED=""!GMROUT
QUIT
Begin DoDot:1
+8 SET DFN=0
FOR J=0:0
SET DFN=$ORDER(^TMP("GMRPT",$JOB,GROOM,GBED,DFN))
if DFN'>0!GMROUT
QUIT
DO PRNT
End DoDot:1
+9 DO Q
GOTO Q2
PRNT if GRPT>4
SET (GQ,GQT)=0
DO PT^GMRYUT0
DO ^GMRYRP2
DO REPORT1^GMRYRP3
DO Q
+1 QUIT
Q ;
+1 KILL I,GSTAR,GNSH,GNDATE,GOP,DA,GAMOUNT,GCSHFT,GCURDT,GDATE,GDAY,GDSHFT,GESHFT,GHR,GID,GIN,GINDT,GIO,GIVDT,GIVSTRT,GIVSUB,GIVTYP,GLASTDT,GLINE,GMRDOT
+2 KILL GNN,GAMT,GCOL,GCSFT,GDRESS,GIV,GLAB,GLEN,GLOC,GNURSE,GPOS,GPRT,GRATE,GREC,GSFT,GT,GTIME,GTUBE,GVOL,GSOL,GITEM,GDTSTRT,GDTFIN
+3 KILL II,JJ,LL,KK,GMIN,GMRINDT,GNSHFT,GNXNSF,GNXTDT,GOPT,GOUT,GSHIFT,GSITE,GSTRT,GSUB,GTEXT,GTOTIN,GTOTLI,GTOTLO,GTOTOUT,GTYPE,GTYP,GX,GY,^TMP($JOB,"GMRY"),X,Y
+4 KILL GMRNAM,GI,SSN,GMRBED,GMRBTH,GMRDIAG,GMRSEX,GMRVADM,GMRWARD,GMRVDT,GMRAGE,GMR,GMRDT,GMRQ,GMRS,GMRX1,GMRX2,GDT,GFOUND,GMRHLOC
+5 QUIT
Q2 KILL ZTSAVE,ZTRTN,GHLOC,ZTDESC,J,GMRLEN,GMRQUAL,GMROP,GMRCOL,GROOM,GBED,GMRX,GNRMBD,ZTSAVE,GNBED,GMRDAY,GMREVE,GMRNIT,GQ,GQT,GPC,GMRDT1,GMRDT2,DFN,GBLNK,GMRSTRT,GMRFIN,GMREDB,ZTIO,ZTSK,%ZIS,IO("Q")
if $EXTRACT(IOST)'="C"
WRITE @IOF
DO ^%ZISC
DO HOME^%ZIS
+1 KILL ^TMP("GMRPT",$JOB),X,Y,X1,X2,XQH,XQUIT,GMRVTYP,GMRYY,GSDC,GMRI,VAERR,VAIN,GMRNUR,GMROUT,GRPT,VAROOT,GTYPI,GTYPO,GN,GNN,GLN
QUIT
DEV SET %ZIS="Q"
SET %ZIS("B")="HOME"
DO ^%ZIS
if POP
KILL IO("Q")
if POP
QUIT
+1 IF GRPT=4
IF $EXTRACT(IOST)'="C"
IF IOM<80
IF GMRCOL>80
DO ^%ZISC
WRITE !,$CHAR(7),"** THIS REPORT NEEDS 132 COLUMNS - PORT **",!
GOTO DEV
+2 QUIT
LOOP1 ;
+1 FOR X="GMRWARD","GMRWARD(","GMRNUR","GNRMBD(","GMROUT","GMRFIN","GMRSTRT","GMREDB","GRPT","DFN","^TMP(""GMRPT"",$J,","GMRCOL"
SET ZTSAVE(X)=""
+2 QUIT
EN2 ;PATIENT I/O SUMMARY REPORT FOR THE PREVIOUS DAY
+1 SET ZTDESC="PATIENT I/O SUMMARY REPORT FOR THE PREVIOUS DAY"
SET GRPT=3
SET GMROUT=0
SET X1=DT
SET X2=-1
DO C^%DTC
SET (GMRSTRT,GMRFIN)=X
SET GMROP(1)=$SELECT($DATA(GMRNUR):"WARDPAT^GMRYUT4",1:"MASPT^GMRYRP5")
DO @GMROP(1)
if 'GMROUT
GOTO RPT2
+2 DO Q
DO Q2
QUIT
EN3 ;PATIENT VITAL SIGNS & I/O SHEET - SF511
+1 SET ZTDESC="PATIENT VITAL SIGNS & I/O SHEET - SF511"
SET GRPT=5
SET GMROUT=0
DO DATE^GMRYRP1
if GMROUT
GOTO Q
SET GMROP(1)=$SELECT($DATA(GMRNUR):"WARDPAT^GMRYUT4",1:"MASPT^GMRYRP5")
DO @GMROP(1)
if 'GMROUT
GOTO RPT2
+2 DO Q
DO Q2
QUIT
EN4 ;PATIENT I/O SUMMARY FOR TODAY
+1 SET ZTDESC="PATIENT I/O SUMMARY FOR TODAY"
SET GRPT=2
SET GMROUT=0
SET (GMRSTRT,GMRFIN)=DT
SET GMROP(1)=$SELECT($DATA(GMRNUR):"WARDPAT^GMRYUT4",1:"MASPT^GMRYRP5")
DO @GMROP(1)
if 'GMROUT
GOTO RPT2
+2 DO Q
DO Q2
QUIT
EN5 ;I/O SUMMARY FOR 48 HRS
+1 SET ZTDESC="I/O SUMMARY FOR 48 HRS"
SET GRPT=4
SET GMROUT=0
SET X1=DT
SET X2=-1
DO C^%DTC
SET GMRSTRT=X
SET GMRFIN=DT
SET GMROP(1)=$SELECT($DATA(GMRNUR):"WARDPAT^GMRYUT4",1:"MASPT^GMRYRP5")
DO @GMROP(1)
if 'GMROUT
GOTO RPT2
+2 DO Q
DO Q2
QUIT
STOP if GMROUT
QUIT
WRITE "Press return to continue or ""^"" to stop "
READ X:DTIME
+1 IF '$TEST!(X="^")
SET GMROUT=1
QUIT
+2 QUIT