GMRYINFS ;HIRMFO/YH-ADJUST INFUSION RATE ;4/5/94
;;4.0;Intake/Output;;Apr 25, 1997
INFUSE ;
W @IOF,!!,"*** ADJUST INFUSION RATE ***",!
S DA=DFN,(GMRDC,GMROUT)=0 D LISTIV^GMRYUT0 D SEL^GMRYED4 G:GMROUT!($G(GMRZ(1))="") Q
S GDATA=^GMR(126,DA(1),"IV",DA,0),GDT=$P(GDATA,"^"),GTYPE=$P(GDATA,"^",4)
W !!,?5,$P(GDATA,"^",3)_" "_$S(GTYPE'["L":$P(GDATA,"^",5)_" mls ("_GTYPE_") ",1:"")_$P(GDATA,"^",2) S Y=GDT X ^DD("DD") W " started on "_$P(Y,":",1,2),! S GSITE=$P(GDATA,"^",2)
DT S %DT("A")="Please enter Date/Time: ",%DT="AETXRS",%DT("B")="NOW" D ^%DT I Y'>0 S GMROUT=1 G Q
I $P(GDATA,"^")>Y W !,"The Date/Time has to be after the IV started",! G DT
S GMRVDT=+Y D NOW^%DTC I GMRVDT>+% W !!,"NO FUTURE DATE/TIME!!!",! G DT
S GMROUT(1)=0,GMROUT(1)=$$ADM^GMRYUT12(.GMROUT,DFN,GMRVDT) Q:GMROUT
K GDA S (GDT,GDA)=0 I $D(^GMR(126,DA(1),"IV",DA,"TITR","C")) S GDT=$O(^GMR(126,DA(1),"IV",DA,"TITR","C",0)) D:GDT>0
.S GDA=$O(^GMR(126,DA(1),"IV",DA,"TITR","C",GDT,0)) S:$D(^GMR(126,DA(1),"IV",DA,"TITR",GDA,0)) GDA(1)=+$P(^(0),"^"),GDA(2)=+$P(^(0),"^",2),GDA(3)=+$P(^(0),"^",3)
I GDT>0 S Y=GDA(1) X ^DD("DD") W !!,"Rate was adjusted @"_$P(Y,":",1,2),! S GMRZ(3)=GDA(2)
RATE W !,"Infusion rate(ml/hr)"_$S(GMRZ(3)=0:" UNKNOWN //",GMRZ(3)'="":" "_GMRZ(3)_" //",1:": ") S X="" R X:DTIME G:'$T!(X["^") Q I X'=""&(X'?1.3N) S X="" D HELP^GMRYED4 G RATE
S:X="" X=GMRZ(3) S:X=""!(X=0) X="" I X'=""&((X<0)!(X>999)) D HELP^GMRYED4 G RATE
RATE1 ;
S GMRZ(3)=X,DA(2)=DA(1),DA(1)=DA S:'$D(^GMR(126,DA(2),"IV",DA(1),"TITR",0)) ^(0)="^126.316DA^0^0"
K DD S DLAYGO=126.316,X=GMRVDT,DIC="^GMR(126,"_DA(2)_",""IV"","_DA(1)_",""TITR"",",DIC(0)="ML" D FILE^DICN K DR,DIC,DLAYGO,DD S DA=+Y I Y'>0 S GMROUT=1,DA=DA(1),DA(1)=DA(2) G Q
S DIE="^GMR(126,"_DA(2)_",""IV"","_DA(1)_",""TITR"",",DR="1///^S X=GMRZ(3);2///^S X=""`""_DUZ;3///^S X=""`""_GMRHLOC;4" D WAIT^GMRYUT0,^DIE L -^GMR(126,DFN) K DIE,DR
Q K GMRVDT,GTYPE Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRYINFS 1918 printed Nov 22, 2024@17:05:35 Page 2
GMRYINFS ;HIRMFO/YH-ADJUST INFUSION RATE ;4/5/94
+1 ;;4.0;Intake/Output;;Apr 25, 1997
INFUSE ;
+1 WRITE @IOF,!!,"*** ADJUST INFUSION RATE ***",!
+2 SET DA=DFN
SET (GMRDC,GMROUT)=0
DO LISTIV^GMRYUT0
DO SEL^GMRYED4
if GMROUT!($GET(GMRZ(1))="")
GOTO Q
+3 SET GDATA=^GMR(126,DA(1),"IV",DA,0)
SET GDT=$PIECE(GDATA,"^")
SET GTYPE=$PIECE(GDATA,"^",4)
+4 WRITE !!,?5,$PIECE(GDATA,"^",3)_" "_$SELECT(GTYPE'["L":$PIECE(GDATA,"^",5)_" mls ("_GTYPE_") ",1:"")_$PIECE(GDATA,"^",2)
SET Y=GDT
XECUTE ^DD("DD")
WRITE " started on "_$PIECE(Y,":",1,2),!
SET GSITE=$PIECE(GDATA,"^",2)
DT SET %DT("A")="Please enter Date/Time: "
SET %DT="AETXRS"
SET %DT("B")="NOW"
DO ^%DT
IF Y'>0
SET GMROUT=1
GOTO Q
+1 IF $PIECE(GDATA,"^")>Y
WRITE !,"The Date/Time has to be after the IV started",!
GOTO DT
+2 SET GMRVDT=+Y
DO NOW^%DTC
IF GMRVDT>+%
WRITE !!,"NO FUTURE DATE/TIME!!!",!
GOTO DT
+3 SET GMROUT(1)=0
SET GMROUT(1)=$$ADM^GMRYUT12(.GMROUT,DFN,GMRVDT)
if GMROUT
QUIT
+4 KILL GDA
SET (GDT,GDA)=0
IF $DATA(^GMR(126,DA(1),"IV",DA,"TITR","C"))
SET GDT=$ORDER(^GMR(126,DA(1),"IV",DA,"TITR","C",0))
if GDT>0
Begin DoDot:1
+5 SET GDA=$ORDER(^GMR(126,DA(1),"IV",DA,"TITR","C",GDT,0))
if $DATA(^GMR(126,DA(1),"IV",DA,"TITR",GDA,0))
SET GDA(1)=+$PIECE(^(0),"^")
SET GDA(2)=+$PIECE(^(0),"^",2)
SET GDA(3)=+$PIECE(^(0),"^",3)
End DoDot:1
+6 IF GDT>0
SET Y=GDA(1)
XECUTE ^DD("DD")
WRITE !!,"Rate was adjusted @"_$PIECE(Y,":",1,2),!
SET GMRZ(3)=GDA(2)
RATE WRITE !,"Infusion rate(ml/hr)"_$SELECT(GMRZ(3)=0:" UNKNOWN //",GMRZ(3)'="":" "_GMRZ(3)_" //",1:": ")
SET X=""
READ X:DTIME
if '$TEST!(X["^")
GOTO Q
IF X'=""&(X'?1.3N)
SET X=""
DO HELP^GMRYED4
GOTO RATE
+1 if X=""
SET X=GMRZ(3)
if X=""!(X=0)
SET X=""
IF X'=""&((X<0)!(X>999))
DO HELP^GMRYED4
GOTO RATE
RATE1 ;
+1 SET GMRZ(3)=X
SET DA(2)=DA(1)
SET DA(1)=DA
if '$DATA(^GMR(126,DA(2),"IV",DA(1),"TITR",0))
SET ^(0)="^126.316DA^0^0"
+2 KILL DD
SET DLAYGO=126.316
SET X=GMRVDT
SET DIC="^GMR(126,"_DA(2)_",""IV"","_DA(1)_",""TITR"","
SET DIC(0)="ML"
DO FILE^DICN
KILL DR,DIC,DLAYGO,DD
SET DA=+Y
IF Y'>0
SET GMROUT=1
SET DA=DA(1)
SET DA(1)=DA(2)
GOTO Q
+3 SET DIE="^GMR(126,"_DA(2)_",""IV"","_DA(1)_",""TITR"","
SET DR="1///^S X=GMRZ(3);2///^S X=""`""_DUZ;3///^S X=""`""_GMRHLOC;4"
DO WAIT^GMRYUT0
DO ^DIE
LOCK -^GMR(126,DFN)
KILL DIE,DR
Q KILL GMRVDT,GTYPE
QUIT