GMRYDCIV ;HIRMFO/YH-DISCONTINUE IV LINES AND INFUSION SITE ;8/15/96
;;4.0;Intake/Output;;Apr 25, 1997
DCIV ;REMOVE IV FROM IV SITE
S GMROUT=0,GDCDA=0 W @IOF,!!,"*** DC IV/LOCK/PORT AND SITE ***",! S GDCIV=1,GADD="N" D SELSITE^GMRYMNT,SEL1^GMRYMNT G:GMROUT!(GMRXY=0)!(X="") QDC D CHECK G:GMROUT QDC
DT S %DT("A")="Please enter DATE/TIME: ",%DT="AETXRS",%DT("B")="NOW" D ^%DT K %DT G:Y'>0 QDC S GDCDT=+Y D NOW^%DTC S GNOW=% I GDCDT<GSTART S Y=GSTART X ^DD("DD") W !!,"IV DC'ed date/time has to be after "_$P(Y,":",1,2),! G DT
I GDCDT>GNOW W !,"NO FUTURE DATE ALLOWED",! G DT
D DCREASON^GMRYUT11 G:GMROUT QDC
K GSTART S DA(1)=DFN,G="" F S G=$O(GST(GSITE,G)) Q:G=""!GMROUT S G(1)=0 F S G(1)=$O(GST(GSITE,G,G(1))) Q:G(1)'>0!GMROUT D
. S DA=G(1),GMRZ=$P(^GMR(126,DA(1),"IV",DA,0),"^",3),GMRZ(1)=$P(^(0),"^",4),GMRZ(2)=$P(^(0),"^",5),GMRZ(3)=$P(^(0),"^",12) D REMOVE^GMRYED6 D:GMROUT WARN Q:GMROUT
. Q
G:GMROUT QDC D STCARE^GMRYED6
S GDA="",GYES=0 F S GDA=$O(GST(GSITE,GDA)) Q:GDA="" S GDA(1)=0 F S GDA(1)=$O(GST(GSITE,GDA,GDA(1))) Q:GDA(1)'>0 I $P(GST(GSITE,GDA,GDA(1)),"^",2)>4!($P(GST(GSITE,GDA,GDA(1)),"^",2)["*") S:'($$UP^XLFSTR(GDCREAS)["INFUSED") GYES=1
QUES I GYES S %=1 W !,"Do you want to restart the DC'd IV " D YN^DICN W:%=0 !!,"Do you want to proceed to the Restart DC'd IV option?",! G:%=0 QUES I %=1 S GOPT="RESTART" D RESTART^GMRYUT10
QDC S GMROUT=0 K GYES,G,GDCDA,GDATA,GST,GCT,GMRX Q
ECHO I GDCDA>0 S GDATA=^GMR(126,DFN,"IV",GDCDA,0),Y=$P(GDATA,"^") D D^DIQ W !
I $P(GDATA,"^",4)'["L" W $P(GDATA,"^",3)_" "_$P(GDATA,"^",4)_" "_$P(GDATA,"^",5)_" mls "
E W "LOCK/PORT"
W " started on "_$P(Y,":",1,2)_" DC'ED" Q
Q
CHECK ;
W !!,GSITE S GDA="",GSTART=0 F S GDA=$O(GST(GSITE,GDA)) Q:GDA="" D
. W:GDA'="BLANK" !,?2,GDA
. S GDA(1)=0 F S GDA(1)=$O(GST(GSITE,GDA,GDA(1))) Q:GDA(1)'>0 S GDATA=GST(GSITE,GDA,GDA(1),0) D WRITE^GMRYMNT
Q
;
WARN ;WARNING FOR ^ TO QUIT
W !!,"Infusion site has not been discontinued",! Q:GMROUT D WRITE
F S G=$O(GST(GSITE,G)) Q:G'>0 D WRITE
W !!,?5,"is(are) still running",!
Q
WRITE W !,?5,$P(^GMR(126,DFN,"IV",G,0),"^",3)_" ("_$P(^(0),"^",4)_") "_$P(^(0),"^",5)_" mls started on " S Y=$P(^(0),"^") X ^DD("DD") W $P(Y,":",1,2) Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRYDCIV 2227 printed Dec 13, 2024@01:55:13 Page 2
GMRYDCIV ;HIRMFO/YH-DISCONTINUE IV LINES AND INFUSION SITE ;8/15/96
+1 ;;4.0;Intake/Output;;Apr 25, 1997
DCIV ;REMOVE IV FROM IV SITE
+1 SET GMROUT=0
SET GDCDA=0
WRITE @IOF,!!,"*** DC IV/LOCK/PORT AND SITE ***",!
SET GDCIV=1
SET GADD="N"
DO SELSITE^GMRYMNT
DO SEL1^GMRYMNT
if GMROUT!(GMRXY=0)!(X="")
GOTO QDC
DO CHECK
if GMROUT
GOTO QDC
DT SET %DT("A")="Please enter DATE/TIME: "
SET %DT="AETXRS"
SET %DT("B")="NOW"
DO ^%DT
KILL %DT
if Y'>0
GOTO QDC
SET GDCDT=+Y
DO NOW^%DTC
SET GNOW=%
IF GDCDT<GSTART
SET Y=GSTART
XECUTE ^DD("DD")
WRITE !!,"IV DC'ed date/time has to be after "_$PIECE(Y,":",1,2),!
GOTO DT
+1 IF GDCDT>GNOW
WRITE !,"NO FUTURE DATE ALLOWED",!
GOTO DT
+2 DO DCREASON^GMRYUT11
if GMROUT
GOTO QDC
+3 KILL GSTART
SET DA(1)=DFN
SET G=""
FOR
SET G=$ORDER(GST(GSITE,G))
if G=""!GMROUT
QUIT
SET G(1)=0
FOR
SET G(1)=$ORDER(GST(GSITE,G,G(1)))
if G(1)'>0!GMROUT
QUIT
Begin DoDot:1
+4 SET DA=G(1)
SET GMRZ=$PIECE(^GMR(126,DA(1),"IV",DA,0),"^",3)
SET GMRZ(1)=$PIECE(^(0),"^",4)
SET GMRZ(2)=$PIECE(^(0),"^",5)
SET GMRZ(3)=$PIECE(^(0),"^",12)
DO REMOVE^GMRYED6
if GMROUT
DO WARN
if GMROUT
QUIT
+5 QUIT
End DoDot:1
+6 if GMROUT
GOTO QDC
DO STCARE^GMRYED6
+7 SET GDA=""
SET GYES=0
FOR
SET GDA=$ORDER(GST(GSITE,GDA))
if GDA=""
QUIT
SET GDA(1)=0
FOR
SET GDA(1)=$ORDER(GST(GSITE,GDA,GDA(1)))
if GDA(1)'>0
QUIT
IF $PIECE(GST(GSITE,GDA,GDA(1)),"^",2)>4!($PIECE(GST(GSITE,GDA,GDA(1)),"^",2)["*")
if '($$UP^XLFSTR(GDCREAS)["INFUSED")
SET GYES=1
QUES IF GYES
SET %=1
WRITE !,"Do you want to restart the DC'd IV "
DO YN^DICN
if %=0
WRITE !!,"Do you want to proceed to the Restart DC'd IV option?",!
if %=0
GOTO QUES
IF %=1
SET GOPT="RESTART"
DO RESTART^GMRYUT10
QDC SET GMROUT=0
KILL GYES,G,GDCDA,GDATA,GST,GCT,GMRX
QUIT
ECHO IF GDCDA>0
SET GDATA=^GMR(126,DFN,"IV",GDCDA,0)
SET Y=$PIECE(GDATA,"^")
DO D^DIQ
WRITE !
+1 IF $PIECE(GDATA,"^",4)'["L"
WRITE $PIECE(GDATA,"^",3)_" "_$PIECE(GDATA,"^",4)_" "_$PIECE(GDATA,"^",5)_" mls "
+2 IF '$TEST
WRITE "LOCK/PORT"
+3 WRITE " started on "_$PIECE(Y,":",1,2)_" DC'ED"
QUIT
+4 QUIT
CHECK ;
+1 WRITE !!,GSITE
SET GDA=""
SET GSTART=0
FOR
SET GDA=$ORDER(GST(GSITE,GDA))
if GDA=""
QUIT
Begin DoDot:1
+2 if GDA'="BLANK"
WRITE !,?2,GDA
+3 SET GDA(1)=0
FOR
SET GDA(1)=$ORDER(GST(GSITE,GDA,GDA(1)))
if GDA(1)'>0
QUIT
SET GDATA=GST(GSITE,GDA,GDA(1),0)
DO WRITE^GMRYMNT
End DoDot:1
+4 QUIT
+5 ;
WARN ;WARNING FOR ^ TO QUIT
+1 WRITE !!,"Infusion site has not been discontinued",!
if GMROUT
QUIT
DO WRITE
+2 FOR
SET G=$ORDER(GST(GSITE,G))
if G'>0
QUIT
DO WRITE
+3 WRITE !!,?5,"is(are) still running",!
+4 QUIT
WRITE WRITE !,?5,$PIECE(^GMR(126,DFN,"IV",G,0),"^",3)_" ("_$PIECE(^(0),"^",4)_") "_$PIECE(^(0),"^",5)_" mls started on "
SET Y=$PIECE(^(0),"^")
XECUTE ^DD("DD")
WRITE $PIECE(Y,":",1,2)
QUIT