GMRYED4 ;HIRMFO/YH - INTRAVENOUS INFUSION PROTOCOL ;10/16/96
;;4.0;Intake/Output;**6**;Apr 25, 1997
HANG ;DC CURRENT SOLUTION/ADD THE SAME SOLUTION - CONTINUED
D DC^GMRYED6 Q:GMROUT!($G(GMRZ(1))="") S GDCDT=$P(^GMR(126,DA(1),"IV",DA,0),"^",9),GMRVTYP=$P(^(0),"^",4)
S GMRDEL="",GX=GDCDT I '$D(^GMR(126,DA(1),"IV",DA,"IN",0)) S GLABEL="",GHLOC=GMRHLOC D DC^GMRYUT0 G ADD
I '$D(^GMR(126,DA(1),"IV",DA,"IN","C")) S GLABEL="",GHLOC=GMRHLOC D DC^GMRYUT0 G ADD
S GDT=$O(^GMR(126,DA(1),"IV",DA,"IN","C",0)) I GDT'>0 S GLABEL="",GHLOC=GMRHLOC D DC^GMRYUT0 G ADD
S GGDA=$O(^GMR(126,DA(1),"IV",DA,"IN","C",GDT,0)) I GGDA>0 W !,"Last reading for AMOUNT LEFT is "_$P(^GMR(126,DA(1),"IV",DA,"IN",GGDA,0),"^",2)_" mls"
S GLABEL="",GHLOC=GMRHLOC
I ($P(^GMR(126,DA(1),"IV",DA,"IN",GGDA,0),"^",2)>0) D
.S GHLOC=GMRHLOC,GLABEL="" D DC^GMRYUT0 S GGDA=+$P(^GMR(126,DA(1),"IV",DA,"IN",0),"^",3)
. ;; GMRY*4*6 - RJS TEST FOR GMROUT
.Q:GMROUT
.D IVINTK^GMRYUT8 W !,"Total solution absorbed for this bottle: "_$S($P(^GMR(126,DA(1),"IV",DA,"IN",GGDA,0),"^",2)["*":"UNKNOWN",1:($P(GDATA,"^",5)-GTOTAL)_" mls"),!
ADD I GMROUT S $P(^GMR(126,DFN,"IV",DA(1),0),"^",9)="",$P(^(0),"^",10)="" W !,"DC canceled!!!",! Q
D ^GMRYSTCA Q:GMROUT
I GMRVTYP["L" S (GMRZ(2),GMRZ(3))="*"
W !!,"Adding "_GMRZ_" ("_GMRZ(1)_") "_$S(+GMRZ(2)>0:GMRZ(2)_" mls ",1:""),! S:GMRZ(3)'>0 GMRZ(3)=""
RATE W !,"Infusion rate(ml/hr)"_$S(GMRZ(3)'="":" "_GMRZ(3)_" //",1:": ") S X="" R X:DTIME Q:'$T!(X["^") I X'=""&(X'?1.3N) S X="" D HELP G RATE
S:X="" X=GMRZ(3) S:X=""!(X=0) X="" I X'=""&((X<0)!(X>999)) D HELP G RATE
RATE1 W !,"New infusion rate is "_$S(X>0:X,1:"UNKNOWN") ;S %=1 D YN^DICN W:%=0 !!,"If the infusion rate is not correct then enter N(o).",! G:%=0 RATE1 Q:%<0 G:%'=1 RATE S GMRZ(3)=X
QUICK K DD S GSAVE=GMRVTYP,(X,GX)=GDCDT,DLAYGO=126.03,DA(1)=DFN,DIC="^GMR(126,"_DA(1)_",""IV"",",DIC(0)="ML" D WAIT^GMRYUT0 Q:GMROUT D FILE^DICN L -^GMR(126,DFN) K DIC,DLAYGO,DD S DA=+Y,GMRVTYP=GSAVE Q:Y'>0
S DIE="^GMR(126,"_DA(1)_",""IV"",",DR="2///^S X=GMRZ;3///^S X=GMRZ(1);4//^S X=GMRZ(2);11///^S X=GMRZ(3);6///^S X=""`""_DUZ;7///^S X=""`""_GMRHLOC;1///^S X=GSITE;17///^S X=GCATH(1)"
D WAIT^GMRYUT0 I 'GMROUT D ^DIE L -^GMR(126,DFN)
K DIE,DR Q
;
SELSITE ;SELECT IV SITE TO EDIT
S GSITE="",GMRX=0 F S GSITE=$O(^GMR(126,DFN,"IV","SITE",GSITE)) Q:GSITE="" S GMRY=0,GDT=0 F S GDT=$O(^GMR(126,DFN,"IV","SITE",GSITE,GDT)) Q:GDT'>0!(GMRY>0) S GDA=$O(^(GDT,0)) D CHCKDC
Q
SEL S GSITE="" I GN=0 S GMROUT=1 K GN,GMRDATA Q
D SEL^GMRYUT13 Q
CHCKDC I $P(^GMR(126,DFN,"IV",GDA,0),"^",9)="" S GMRX=GMRX+1,GMRY=1,GMRX(GMRX)=GSITE_"^"_GDA Q
Q
LISTQUES ;
W !,"IV is defined as IV line/port/lock",! S GNN=0 F I=1:1 S X=$T(QUES+I) Q:X="" S GMRW=$P(X,";;",2) W !,$P(GMRW,"^"),!,?5,$P(GMRW,"^",3)
Q
HELP W !!,"Enter a number between 0 and 999 at which the infusion takes place",!,"0 means that the rate is UNKNOWN",! Q
LISTOP ;
F I=1:1:9 S X=$T(QUES+I) Q:X="" S GMRW=$P(X,";;",2),GNN($E(GMRW))=$E(GMRW,5,99),GNN=+GMRW W !,$P(GMRW,"^")
QUES ;
;;1. Start IV^STARTIV^Start a new IV line or heparin/saline lock/port.
;;2. Solution: Replace/DC/Convert/Finish Solution^ADDSOL^DC current solution then replace a new solution to the selected IV line or convert the IV according to the user's choice.
;;3. Replace Same Solution^HANG^Replace the same solution to a selected IV.
;;4. DC IV/Lock/Port and Site^DCIV^Remove IV/lock/port from a selected IV site.
;;5. Care/Maintenance/Flush^MAINTN^Check site condition, dressing change, tube change and flush.
;;6. Add Additional Solution(s)^ADDONLY^Add additional solution(s) without discontinuing an existing one.
;;7. Restart DC'd IV^RESTART^Restart an IV which was DC'd due to infiltration or other reasons.
;;8. Adjust Infusion Rate^TITER^Adjust infusion rate for a selected IV.
;;9. Flush^FLUSH^Flush all IV line(s) for a selected infusion site.
GMRYED4 ;HIRMFO/YH - INTRAVENOUS INFUSION PROTOCOL ;10/16/96
+1 ;;4.0;Intake/Output;**6**;Apr 25, 1997
HANG ;DC CURRENT SOLUTION/ADD THE SAME SOLUTION - CONTINUED
+1 DO DC^GMRYED6
IF GMROUT!($GET(GMRZ(1))="")
QUIT
SET GDCDT=$PIECE(^GMR(126,DA(1),"IV",DA,0),"^",9)
SET GMRVTYP=$PIECE(^(0),"^",4)
+2 SET GMRDEL=""
SET GX=GDCDT
IF '$DATA(^GMR(126,DA(1),"IV",DA,"IN",0))
SET GLABEL=""
SET GHLOC=GMRHLOC
DO DC^GMRYUT0
GOTO ADD
+3 IF '$DATA(^GMR(126,DA(1),"IV",DA,"IN","C"))
SET GLABEL=""
SET GHLOC=GMRHLOC
DO DC^GMRYUT0
GOTO ADD
+4 SET GDT=$ORDER(^GMR(126,DA(1),"IV",DA,"IN","C",0))
IF GDT'>0
SET GLABEL=""
SET GHLOC=GMRHLOC
DO DC^GMRYUT0
GOTO ADD
+5 SET GGDA=$ORDER(^GMR(126,DA(1),"IV",DA,"IN","C",GDT,0))
IF GGDA>0
WRITE !,"Last reading for AMOUNT LEFT is "_$PIECE(^GMR(126,DA(1),"IV",DA,"IN",GGDA,0),"^",2)_" mls"
+6 SET GLABEL=""
SET GHLOC=GMRHLOC
+7 IF ($PIECE(^GMR(126,DA(1),"IV",DA,"IN",GGDA,0),"^",2)>0)
Begin DoDot:1
+8 SET GHLOC=GMRHLOC
SET GLABEL=""
DO DC^GMRYUT0
SET GGDA=+$PIECE(^GMR(126,DA(1),"IV",DA,"IN",0),"^",3)
+9 ;; GMRY*4*6 - RJS TEST FOR GMROUT
+10 IF GMROUT
QUIT
+11 DO IVINTK^GMRYUT8
WRITE !,"Total solution absorbed for this bottle: "_$SELECT($PIECE(^GMR(126,DA(1),"IV",DA,"IN",GGDA,0),"^",2)["*":"UNKNOWN",1:($PIECE(GDATA,"^",5)-GTOTAL)_" mls"),!
End DoDot:1
ADD IF GMROUT
SET $PIECE(^GMR(126,DFN,"IV",DA(1),0),"^",9)=""
SET $PIECE(^(0),"^",10)=""
WRITE !,"DC canceled!!!",!
QUIT
+1 DO ^GMRYSTCA
IF GMROUT
QUIT
+2 IF GMRVTYP["L"
SET (GMRZ(2),GMRZ(3))="*"
+3 WRITE !!,"Adding "_GMRZ_" ("_GMRZ(1)_") "_$SELECT(+GMRZ(2)>0:GMRZ(2)_" mls ",1:""),!
IF GMRZ(3)'>0
SET GMRZ(3)=""
RATE WRITE !,"Infusion rate(ml/hr)"_$SELECT(GMRZ(3)'="":" "_GMRZ(3)_" //",1:": ")
SET X=""
READ X:DTIME
IF '$TEST!(X["^")
QUIT
IF X'=""&(X'?1.3N)
SET X=""
DO HELP
GOTO RATE
+1 IF X=""
SET X=GMRZ(3)
IF X=""!(X=0)
SET X=""
IF X'=""&((X<0)!(X>999))
DO HELP
GOTO RATE
RATE1 ;S %=1 D YN^DICN W:%=0 !!,"If the infusion rate is not correct then enter N(o).",! G:%=0 RATE1 Q:%<0 G:%'=1 RATE S GMRZ(3)=X
WRITE !,"New infusion rate is "_$SELECT(X>0:X,1:"UNKNOWN")
QUICK KILL DD
SET GSAVE=GMRVTYP
SET (X,GX)=GDCDT
SET DLAYGO=126.03
SET DA(1)=DFN
SET DIC="^GMR(126,"_DA(1)_",""IV"","
SET DIC(0)="ML"
DO WAIT^GMRYUT0
IF GMROUT
QUIT
DO FILE^DICN
LOCK -^GMR(126,DFN)
KILL DIC,DLAYGO,DD
SET DA=+Y
SET GMRVTYP=GSAVE
IF Y'>0
QUIT
+1 SET DIE="^GMR(126,"_DA(1)_",""IV"","
SET DR="2///^S X=GMRZ;3///^S X=GMRZ(1);4//^S X=GMRZ(2);11///^S X=GMRZ(3);6///^S X=""`""_DUZ;7///^S X=""`""_GMRHLOC;1///^S X=GSITE;17///^S X=GCATH(1)"
+2 DO WAIT^GMRYUT0
IF 'GMROUT
DO ^DIE
LOCK -^GMR(126,DFN)
+3 KILL DIE,DR
QUIT
+4 ;
SELSITE ;SELECT IV SITE TO EDIT
+1 SET GSITE=""
SET GMRX=0
FOR
SET GSITE=$ORDER(^GMR(126,DFN,"IV","SITE",GSITE))
IF GSITE=""
QUIT
SET GMRY=0
SET GDT=0
FOR
SET GDT=$ORDER(^GMR(126,DFN,"IV","SITE",GSITE,GDT))
IF GDT'>0!(GMRY>0)
QUIT
SET GDA=$ORDER(^(GDT,0))
DO CHCKDC
+2 QUIT
SEL SET GSITE=""
IF GN=0
SET GMROUT=1
KILL GN,GMRDATA
QUIT
+1 DO SEL^GMRYUT13
QUIT
CHCKDC IF $PIECE(^GMR(126,DFN,"IV",GDA,0),"^",9)=""
SET GMRX=GMRX+1
SET GMRY=1
SET GMRX(GMRX)=GSITE_"^"_GDA
QUIT
+1 QUIT
LISTQUES ;
+1 WRITE !,"IV is defined as IV line/port/lock",!
SET GNN=0
FOR I=1:1
SET X=$TEXT(QUES+I)
IF X=""
QUIT
SET GMRW=$PIECE(X,";;",2)
WRITE !,$PIECE(GMRW,"^"),!,?5,$PIECE(GMRW,"^",3)
+2 QUIT
HELP WRITE !!,"Enter a number between 0 and 999 at which the infusion takes place",!,"0 means that the rate is UNKNOWN",!
QUIT
LISTOP ;
+1 FOR I=1:1:9
SET X=$TEXT(QUES+I)
IF X=""
QUIT
SET GMRW=$PIECE(X,";;",2)
SET GNN($EXTRACT(GMRW))=$EXTRACT(GMRW,5,99)
SET GNN=+GMRW
WRITE !,$PIECE(GMRW,"^")
QUES ;
+1 ;;1. Start IV^STARTIV^Start a new IV line or heparin/saline lock/port.
+2 ;;2. Solution: Replace/DC/Convert/Finish Solution^ADDSOL^DC current solution then replace a new solution to the selected IV line or convert the IV according to the user's choice.
+3 ;;3. Replace Same Solution^HANG^Replace the same solution to a selected IV.
+4 ;;4. DC IV/Lock/Port and Site^DCIV^Remove IV/lock/port from a selected IV site.
+5 ;;5. Care/Maintenance/Flush^MAINTN^Check site condition, dressing change, tube change and flush.
+6 ;;6. Add Additional Solution(s)^ADDONLY^Add additional solution(s) without discontinuing an existing one.
+7 ;;7. Restart DC'd IV^RESTART^Restart an IV which was DC'd due to infiltration or other reasons.
+8 ;;8. Adjust Infusion Rate^TITER^Adjust infusion rate for a selected IV.
+9 ;;9. Flush^FLUSH^Flush all IV line(s) for a selected infusion site.