GMRYSE0 ;HIRMFO/YH-ITEMIZED PATIENT I/O REPORT BY SHIFT PART 1 ;5/13/96
;;4.0;Intake/Output;;Apr 25, 1997
EN1 ;PATIENT INTAKE/OUTPUT BY SHIFT AND EVENT
S GRPT=8,GMROUT=0 D DATE^GMRYRP1 G:GMROUT Q S GMROP(1)=$S($D(GMRNUR):"WARDPAT^GMRYUT4",1:"MASPT^GMRYRP5") D @GMROP(1) G:GMROUT Q
D DEV^GMRYRP0 G:POP Q
I $D(IO("Q")) K IO("Q"),IO("C") S ZTDESC="ITEMIZED PATIENT I/O REPORT BY SHIFT",ZTRTN="START^GMRYSE0",ZTIO=ION_";"_IOM_";"_IOSL D LOOP1^GMRYRP0,^%ZTLOAD,HOME^%ZIS D Q2^GMRYRP0 K GMROUT Q
START ;
D START^GMRYRP0 I GMROUT D Q K GMROUT Q
I "Pp"[GMREDB D PATIENT^GMRYUT9 G:GMROUT Q D SETARRY G:GMROUT Q D REPORT^GMRYSE1 D Q,Q2^GMRYRP0 K GMROUT Q
I "SsWw"[GMREDB D:$D(GMRNUR) PATIENT^GMRYUT11
G:'$D(^TMP("GMRPT",$J)) Q0
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,GBED)) Q:GBED=""!GMROUT S DFN=0 F J=0:0 S DFN=$O(^TMP("GMRPT",$J,GROOM,GBED,DFN)) Q:DFN'>0!GMROUT D
.S GMRNAM=^TMP("GMRPT",$J,GROOM,GBED,DFN)
.D PRNT
Q0 D Q D Q2^GMRYRP0 Q
PRNT S (GQ,GQT)=0 K ^TMP($J) D PT^GMRYUT0,SETARRY D REPORT^GMRYSE1
Q
Q ;
K GMRVHLOC,GMRVWLOC,GPORT,GSTAR,GDA,GMRY,GSAVE,GSAVEH,GMRHLOC,GDATA D Q^GMRYRP0
K VAROOT,GTYPI,GTYPO,GN,GNN,GLN,GTXT,GMR100,GMRLEN,GMROP,GMRFIN,GMRSTRT,GRPT,GMROUT,DFN,GMREDB Q
SETARRY ;SET DATA IN ^TMP($J,"GMRY", FOR EACH PATIENT
I '$D(^GMR(126,"B",DFN)) Q
S GSAVEH=0,DA(1)=$O(^GMR(126,"B",DFN,0)) K ^TMP($J,"GMRY")
F II="IN","OUT" D SAVE^GMRYRP2
D SAVEIV^GMRYRP2,IVM
Q
IVM ;SET IV MAINTENANCE IN ^TMP($J,"GMRY"
Q:'$D(^GMR(126,DFN,"IVM","B"))
S GSITE="" F S GSITE=$O(^GMR(126,DA(1),"IVM","B",GSITE)) Q:GSITE="" S DA=$O(^(GSITE,0)) Q:DA'>0 D SCARE
Q
SCARE ;
Q:'$D(^GMR(126,DA(1),"IVM",DA,1,"B"))
S GSTRT=0 F S GSTRT=$O(^GMR(126,DA(1),"IVM",DA,1,"B",GSTRT)) Q:GSTRT'>0 S GDA=0 F S GDA=$O(^GMR(126,DA(1),"IVM",DA,1,"B",GSTRT,GDA)) Q:GDA'>0 D
. S GMRINDT=GSTRT,GDAY=0 D NEXT^GMRYRP1 I '(GMRINDT<GMRSTRT!(GMRINDT>GMRFIN)) D SETSIFT^GMRYRP2,SETUT
Q
SETUT S ^TMP($J,"GMRY",$P(GMRINDT,"."),GSHIFT,"IV",GMRINDT,GSTRT,"Z",DA,GDA)=$P(^GMR(126,DA(1),"IVM",DA,1,GDA,0)_"^^^^","^",1,8)_GSITE Q
GMRYSE0 ;HIRMFO/YH-ITEMIZED PATIENT I/O REPORT BY SHIFT PART 1 ;5/13/96
+1 ;;4.0;Intake/Output;;Apr 25, 1997
EN1 ;PATIENT INTAKE/OUTPUT BY SHIFT AND EVENT
+1 SET GRPT=8
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 Q
+2 DO DEV^GMRYRP0
IF POP
GOTO Q
+3 IF $DATA(IO("Q"))
KILL IO("Q"),IO("C")
SET ZTDESC="ITEMIZED PATIENT I/O REPORT BY SHIFT"
SET ZTRTN="START^GMRYSE0"
SET ZTIO=ION_";"_IOM_";"_IOSL
DO LOOP1^GMRYRP0
DO ^%ZTLOAD
DO HOME^%ZIS
DO Q2^GMRYRP0
KILL GMROUT
QUIT
START ;
+1 DO START^GMRYRP0
IF GMROUT
DO Q
KILL GMROUT
QUIT
+2 IF "Pp"[GMREDB
DO PATIENT^GMRYUT9
IF GMROUT
GOTO Q
DO SETARRY
IF GMROUT
GOTO Q
DO REPORT^GMRYSE1
DO Q
DO Q2^GMRYRP0
KILL GMROUT
QUIT
+3 IF "SsWw"[GMREDB
IF $DATA(GMRNUR)
DO PATIENT^GMRYUT11
+4 IF '$DATA(^TMP("GMRPT",$JOB))
GOTO Q0
+5 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
SET DFN=0
FOR J=0:0
SET DFN=$ORDER(^TMP("GMRPT",$JOB,GROOM,GBED,DFN))
IF DFN'>0!GMROUT
QUIT
Begin DoDot:1
+6 SET GMRNAM=^TMP("GMRPT",$JOB,GROOM,GBED,DFN)
+7 DO PRNT
End DoDot:1
Q0 DO Q
DO Q2^GMRYRP0
QUIT
PRNT SET (GQ,GQT)=0
KILL ^TMP($JOB)
DO PT^GMRYUT0
DO SETARRY
DO REPORT^GMRYSE1
+1 QUIT
Q ;
+1 KILL GMRVHLOC,GMRVWLOC,GPORT,GSTAR,GDA,GMRY,GSAVE,GSAVEH,GMRHLOC,GDATA
DO Q^GMRYRP0
+2 KILL VAROOT,GTYPI,GTYPO,GN,GNN,GLN,GTXT,GMR100,GMRLEN,GMROP,GMRFIN,GMRSTRT,GRPT,GMROUT,DFN,GMREDB
QUIT
SETARRY ;SET DATA IN ^TMP($J,"GMRY", FOR EACH PATIENT
+1 IF '$DATA(^GMR(126,"B",DFN))
QUIT
+2 SET GSAVEH=0
SET DA(1)=$ORDER(^GMR(126,"B",DFN,0))
KILL ^TMP($JOB,"GMRY")
+3 FOR II="IN","OUT"
DO SAVE^GMRYRP2
+4 DO SAVEIV^GMRYRP2
DO IVM
+5 QUIT
IVM ;SET IV MAINTENANCE IN ^TMP($J,"GMRY"
+1 IF '$DATA(^GMR(126,DFN,"IVM","B"))
QUIT
+2 SET GSITE=""
FOR
SET GSITE=$ORDER(^GMR(126,DA(1),"IVM","B",GSITE))
IF GSITE=""
QUIT
SET DA=$ORDER(^(GSITE,0))
IF DA'>0
QUIT
DO SCARE
+3 QUIT
SCARE ;
+1 IF '$DATA(^GMR(126,DA(1),"IVM",DA,1,"B"))
QUIT
+2 SET GSTRT=0
FOR
SET GSTRT=$ORDER(^GMR(126,DA(1),"IVM",DA,1,"B",GSTRT))
IF GSTRT'>0
QUIT
SET GDA=0
FOR
SET GDA=$ORDER(^GMR(126,DA(1),"IVM",DA,1,"B",GSTRT,GDA))
IF GDA'>0
QUIT
Begin DoDot:1
+3 SET GMRINDT=GSTRT
SET GDAY=0
DO NEXT^GMRYRP1
IF '(GMRINDT<GMRSTRT!(GMRINDT>GMRFIN))
DO SETSIFT^GMRYRP2
DO SETUT
End DoDot:1
+4 QUIT
SETUT SET ^TMP($JOB,"GMRY",$PIECE(GMRINDT,"."),GSHIFT,"IV",GMRINDT,GSTRT,"Z",DA,GDA)=$PIECE(^GMR(126,DA(1),"IVM",DA,1,GDA,0)_"^^^^","^",1,8)_GSITE
QUIT