NURCES3 ;HIRMFO/YH-END OF SHIFT REPORT PART 4 - INTRAVENOUS INFUSION ;12/12/96
;;4.0;NURSING SERVICE;**2**;Apr 25, 1997
IV K NURIV S NURIV=0,GDATE="" F S GDATE=$O(^TMP($J,"GMRY",GDATE)) Q:GDATE="" S GSFT="" F S GSFT=$O(^TMP($J,"GMRY",GDATE,GSFT)) Q:GSFT="" D GIO
D Q^GMRYRP0 K GBLNK,GDA,GCATH,GDATA,GLN,GQ,GQT,GSAVE,GTOTAL,GTYPI,GTYPO
Q
GIO S GIO="" F S GIO=$O(^TMP($J,"GMRY",GDATE,GSFT,GIO)) Q:GIO="" I GIO="IV" S GHR=0 F S GHR=$O(^TMP($J,"GMRY",GDATE,GSFT,"IV",GHR)) Q:GHR'>0 D GETDA
Q
WIVINF ;
S GDA=0 F S GDA=$O(^TMP($J,"GMRY",GDATE,GSFT,"IV",GHR,GIVDT,GIVTYP,GSUB,GDA)) Q:GDA'>0 S GDATA=$G(^(GDA)),GAMT=+$P(GDATA,"^") K GTXT
I GIVTYP="Z" D WCARE Q
I GAMT>3000 D START Q
Q
START ;
S GCATH=$P(GDATA,"^",6),GTYP=$P(GDATA,"^",4),GSITE=$P(GDATA,"^",2),GSOL=$P(GDATA,"^",3),GVOL=$P(GDATA,"^",5),GNURSE=+$P(GDATA,"^",7),GREASON=$P(GDATA,"^",11),GRATE=$P(GDATA,"^",12) D WHR
Q:GSITE=""!(GVOL="")
S GPORT="",GSITE(GSITE)="" D FINDCA^GMRYCATH(.GSITE) I $D(^GMR(126,DFN,"IV",GSUB,3)) S GPORT=$P(^(3),"^")
D WTYPE I GREASON["FLUSH" S GTXT=GTXT_" - "_GSITE(GSITE)_" "_GPORT D FITLINE^NURCES5(GTXT,62,.NURIV) Q
S GTXT=GTXT_" "_GVOL_" mls "_$S(GCATH'="":"started",1:"added")_" Site: "_GSITE_" "_GSITE(GSITE)_$S(GPORT'="":" "_GPORT,1:"") S:GRATE'="" GTXT=GTXT_" Rate: "_GRATE_" ml/hr"
D FITLINE^NURCES5(GTXT,62,.NURIV)
Q:$P(GDATA,"^",9)="" S GSAVE=GHR,GHR=$P(GDATA,"^",9),GNURSE=+$P(GDATA,"^",10),GREASON=$P(GDATA,"^",11)
S GTXT=" Discontinued on " S Y=GHR X ^DD("DD") S GTXT=GTXT_$P(Y,":",1,2)_" Reason: "_GREASON D FITLINE^NURCES5(GTXT,62,.NURIV)
S GHR=GSAVE Q
WTYPE ;PRINT IV TYPE
I GREASON["FLUSH" S GTXT=GTIME_" "_GREASON_" "_GSITE Q
S GTXT=GTIME_" "_GSOL_" "_$S(GTYP="A":"admix",GTYP="B":"blood",GTYP="P":"piggy",GTYP="H":"hyper",GTYP="I":"intra",1:"")
Q
WHR ;
S Y=GIVDT X ^DD("DD") S GTIME="@"_$P($P(Y,"@",2),":",1,2) Q
WCARE ;
S GTXT="" D WHR S GTXT=GTIME,GSITE=$P(GDATA,"^",7),GCOND=$P(GDATA,"^",2)
S GDRESS=$S($P(GDATA,"^",4)="Y":" dressing changed",1:""),GTUBE=$S($P(GDATA,"^",3)="Y":" tubing changed",1:"")
S GDC=$S($P(GDATA,"^",6)="Y":" site discontinued",1:"")
S GTXT(1)=GCOND S GTXT(1)=GTXT(1)_$S(GTXT(1)'=""&(GDRESS'=""):",",1:"")_GDRESS
S GTXT(1)=GTXT(1)_$S(GTXT(1)'=""&(GDC'=""):",",1:"")_GDC,GTXT=GTXT_GSITE_" - "_GTXT(1) D:GCOND'="" FITLINE^NURCES5(GTXT,62,.NURIV) S (GTXT,GTXT(1))=""
I GTUBE'="" S GTXT=" "_$P(GDATA,"^",8)_$S($P(GDATA,"^",9)'="":" - ",1:"")_$P(GDATA,"^",9)_" "_GTUBE D FITLINE^NURCES5(GTXT,62,.NURIV)
K GTUBE,GDRESS,GDC,GCOND Q
GETDA ;
S GIVDT=0 F S GIVDT=$O(^TMP($J,"GMRY",GDATE,GSFT,"IV",GHR,GIVDT)) Q:GIVDT'>0 S GIVTYP="" F S GIVTYP=$O(^TMP($J,"GMRY",GDATE,GSFT,"IV",GHR,GIVDT,GIVTYP)) Q:GIVTYP="" D GETDA1
Q
GETDA1 ;
S GSUB=0 F S GSUB=$O(^TMP($J,"GMRY",GDATE,GSFT,"IV",GHR,GIVDT,GIVTYP,GSUB)) Q:GSUB'>0 D WIVINF
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HNURCES3 2843 printed Oct 16, 2024@18:21:09 Page 2
NURCES3 ;HIRMFO/YH-END OF SHIFT REPORT PART 4 - INTRAVENOUS INFUSION ;12/12/96
+1 ;;4.0;NURSING SERVICE;**2**;Apr 25, 1997
IV KILL NURIV
SET NURIV=0
SET GDATE=""
FOR
SET GDATE=$ORDER(^TMP($JOB,"GMRY",GDATE))
if GDATE=""
QUIT
SET GSFT=""
FOR
SET GSFT=$ORDER(^TMP($JOB,"GMRY",GDATE,GSFT))
if GSFT=""
QUIT
DO GIO
+1 DO Q^GMRYRP0
KILL GBLNK,GDA,GCATH,GDATA,GLN,GQ,GQT,GSAVE,GTOTAL,GTYPI,GTYPO
+2 QUIT
GIO SET GIO=""
FOR
SET GIO=$ORDER(^TMP($JOB,"GMRY",GDATE,GSFT,GIO))
if GIO=""
QUIT
IF GIO="IV"
SET GHR=0
FOR
SET GHR=$ORDER(^TMP($JOB,"GMRY",GDATE,GSFT,"IV",GHR))
if GHR'>0
QUIT
DO GETDA
+1 QUIT
WIVINF ;
+1 SET GDA=0
FOR
SET GDA=$ORDER(^TMP($JOB,"GMRY",GDATE,GSFT,"IV",GHR,GIVDT,GIVTYP,GSUB,GDA))
if GDA'>0
QUIT
SET GDATA=$GET(^(GDA))
SET GAMT=+$PIECE(GDATA,"^")
KILL GTXT
+2 IF GIVTYP="Z"
DO WCARE
QUIT
+3 IF GAMT>3000
DO START
QUIT
+4 QUIT
START ;
+1 SET GCATH=$PIECE(GDATA,"^",6)
SET GTYP=$PIECE(GDATA,"^",4)
SET GSITE=$PIECE(GDATA,"^",2)
SET GSOL=$PIECE(GDATA,"^",3)
SET GVOL=$PIECE(GDATA,"^",5)
SET GNURSE=+$PIECE(GDATA,"^",7)
SET GREASON=$PIECE(GDATA,"^",11)
SET GRATE=$PIECE(GDATA,"^",12)
DO WHR
+2 if GSITE=""!(GVOL="")
QUIT
+3 SET GPORT=""
SET GSITE(GSITE)=""
DO FINDCA^GMRYCATH(.GSITE)
IF $DATA(^GMR(126,DFN,"IV",GSUB,3))
SET GPORT=$PIECE(^(3),"^")
+4 DO WTYPE
IF GREASON["FLUSH"
SET GTXT=GTXT_" - "_GSITE(GSITE)_" "_GPORT
DO FITLINE^NURCES5(GTXT,62,.NURIV)
QUIT
+5 SET GTXT=GTXT_" "_GVOL_" mls "_$SELECT(GCATH'="":"started",1:"added")_" Site: "_GSITE_" "_GSITE(GSITE)_$SELECT(GPORT'="":" "_GPORT,1:"")
if GRATE'=""
SET GTXT=GTXT_" Rate: "_GRATE_" ml/hr"
+6 DO FITLINE^NURCES5(GTXT,62,.NURIV)
+7 if $PIECE(GDATA,"^",9)=""
QUIT
SET GSAVE=GHR
SET GHR=$PIECE(GDATA,"^",9)
SET GNURSE=+$PIECE(GDATA,"^",10)
SET GREASON=$PIECE(GDATA,"^",11)
+8 SET GTXT=" Discontinued on "
SET Y=GHR
XECUTE ^DD("DD")
SET GTXT=GTXT_$PIECE(Y,":",1,2)_" Reason: "_GREASON
DO FITLINE^NURCES5(GTXT,62,.NURIV)
+9 SET GHR=GSAVE
QUIT
WTYPE ;PRINT IV TYPE
+1 IF GREASON["FLUSH"
SET GTXT=GTIME_" "_GREASON_" "_GSITE
QUIT
+2 SET GTXT=GTIME_" "_GSOL_" "_$SELECT(GTYP="A":"admix",GTYP="B":"blood",GTYP="P":"piggy",GTYP="H":"hyper",GTYP="I":"intra",1:"")
+3 QUIT
WHR ;
+1 SET Y=GIVDT
XECUTE ^DD("DD")
SET GTIME="@"_$PIECE($PIECE(Y,"@",2),":",1,2)
QUIT
WCARE ;
+1 SET GTXT=""
DO WHR
SET GTXT=GTIME
SET GSITE=$PIECE(GDATA,"^",7)
SET GCOND=$PIECE(GDATA,"^",2)
+2 SET GDRESS=$SELECT($PIECE(GDATA,"^",4)="Y":" dressing changed",1:"")
SET GTUBE=$SELECT($PIECE(GDATA,"^",3)="Y":" tubing changed",1:"")
+3 SET GDC=$SELECT($PIECE(GDATA,"^",6)="Y":" site discontinued",1:"")
+4 SET GTXT(1)=GCOND
SET GTXT(1)=GTXT(1)_$SELECT(GTXT(1)'=""&(GDRESS'=""):",",1:"")_GDRESS
+5 SET GTXT(1)=GTXT(1)_$SELECT(GTXT(1)'=""&(GDC'=""):",",1:"")_GDC
SET GTXT=GTXT_GSITE_" - "_GTXT(1)
if GCOND'=""
DO FITLINE^NURCES5(GTXT,62,.NURIV)
SET (GTXT,GTXT(1))=""
+6 IF GTUBE'=""
SET GTXT=" "_$PIECE(GDATA,"^",8)_$SELECT($PIECE(GDATA,"^",9)'="":" - ",1:"")_$PIECE(GDATA,"^",9)_" "_GTUBE
DO FITLINE^NURCES5(GTXT,62,.NURIV)
+7 KILL GTUBE,GDRESS,GDC,GCOND
QUIT
GETDA ;
+1 SET GIVDT=0
FOR
SET GIVDT=$ORDER(^TMP($JOB,"GMRY",GDATE,GSFT,"IV",GHR,GIVDT))
if GIVDT'>0
QUIT
SET GIVTYP=""
FOR
SET GIVTYP=$ORDER(^TMP($JOB,"GMRY",GDATE,GSFT,"IV",GHR,GIVDT,GIVTYP))
if GIVTYP=""
QUIT
DO GETDA1
+2 QUIT
GETDA1 ;
+1 SET GSUB=0
FOR
SET GSUB=$ORDER(^TMP($JOB,"GMRY",GDATE,GSFT,"IV",GHR,GIVDT,GIVTYP,GSUB))
if GSUB'>0
QUIT
DO WIVINF
+2 QUIT