GMRYFLSH ;HIRMFO/YH-FLUSH IV LINES FOR A SELECTED IV SITE ;6/5/96
;;4.0;Intake/Output;;Apr 25, 1997
FLUSH S (GMROUT,GDCIV)=0 W @IOF,!!,"*** FLUSH ***",!
D SELSITE^GMRYMNT,SEL1^GMRYMNT G:GMROUT!(GMRXY=0)!(X="") QUIT
DT W ! S %DT("A")="Please enter DATE/TIME: ",%DT="AETXRS",%DT("B")="NOW" D ^%DT K %DT G:Y'>0 QUIT S GX=+Y D NOW^%DTC S GNOW=%
I GX>GNOW W !,"NO FUTURE DATE ALLOWED",! G DT
S GMROUT(1)=0,GMROUT(1)=$$ADM^GMRYUT12(.GMROUT,DFN,GX) Q:GMROUT
;I GMROUT(1) S GMROUT=$$CONTNU^GMRYUT12(GMROUT,"FLUSH PORT/IV LINE") Q:GMROUT
D DOFLSH
QUIT K G,GX,GMRZ,GMRYZ,GN,GMESSG,GFLUSH,GSEL Q
SETDB ;
S GHLOC=GMRHLOC K DD S X=+GX,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 Q:Y'>0!GMROUT
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=""`""_GHLOC;1///^S X=GSITE;8///^S X=GX;9///^S X=""`""_DUZ;10///^S X=""FLUSHED"";17///^S X=GCATH(1)"
D WAIT^GMRYUT0 D:'GMROUT ^DIE K DIE,DR L:'GMROUT -^GMR(126,DFN)
S ^GMR(126,DA(1),"IV",DA,"IN",0)="^126.313IDA^1^1"
S ^GMR(126,DA(1),"IV",DA,"IN",1,0)=GX_"^0^^"_DUZ_"^"_GHLOC
S ^GMR(126,DA(1),"IV",DA,"IN","B",GX,1)="",^GMR(126,DA(1),"IV",DA,"IN","C",(9999999-GX),1)=""
Q
ASKFLSH ;CALLED BY MAINTENANCE OPTION
;G:GMROUT QUIT2 S %=2 W !,"Do you want to flush IV line" D YN^DICN Q:%'=1
D DOFLSH
QUIT2 K GMRYZ,GN,GMESSG,GFLUSH,GSEL Q
DOFLSH W ! S GMRVTYP="L",GOPT="" D LOCK^GMRYED5 Q:GMROUT
D LIST Q:GMROUT
I '$D(GMRPORT) S GCATH(1)="" D SETDB Q
S G=0 F S G=$O(GSEL(G)) Q:G'>0!GMROUT S GCATH(1)=$P(GMRPORT(G),"^",2) D SETDB
Q
LIST ;
S GOPT="FLUSH",GHOLD=GCATH(2),(GHOLD(1),GHOLD(2),GHOLD(3))=0 D FINDPORT^GMRYSTCA(.GHOLD)
Q:'$D(GMRPORT)
W !,GSITE,!
S GMRN=GHOLD(4) K GHOLD Q:GMRN'>0
LIST2 F I=1:1:GMRN W !,?2,I_" "_$P(GMRPORT(I),"^",2)
W !,?2,"Enter the number(s) of port/lumen for flush: " S GMRX="" R GMRX:DTIME
G:GMRX["?" LIST2
I '$T!(GMRX["^")!(GMRX="") S GMROUT=1 Q
D VALIDAT^GMRYUT9
I '$D(GSEL)!($O(GSEL(0))'>0) W !,"ERROR ENTRY, TRY AGAIN",! G LIST2
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRYFLSH 2141 printed Dec 13, 2024@01:55:23 Page 2
GMRYFLSH ;HIRMFO/YH-FLUSH IV LINES FOR A SELECTED IV SITE ;6/5/96
+1 ;;4.0;Intake/Output;;Apr 25, 1997
FLUSH SET (GMROUT,GDCIV)=0
WRITE @IOF,!!,"*** FLUSH ***",!
+1 DO SELSITE^GMRYMNT
DO SEL1^GMRYMNT
if GMROUT!(GMRXY=0)!(X="")
GOTO QUIT
DT WRITE !
SET %DT("A")="Please enter DATE/TIME: "
SET %DT="AETXRS"
SET %DT("B")="NOW"
DO ^%DT
KILL %DT
if Y'>0
GOTO QUIT
SET GX=+Y
DO NOW^%DTC
SET GNOW=%
+1 IF GX>GNOW
WRITE !,"NO FUTURE DATE ALLOWED",!
GOTO DT
+2 SET GMROUT(1)=0
SET GMROUT(1)=$$ADM^GMRYUT12(.GMROUT,DFN,GX)
if GMROUT
QUIT
+3 ;I GMROUT(1) S GMROUT=$$CONTNU^GMRYUT12(GMROUT,"FLUSH PORT/IV LINE") Q:GMROUT
+4 DO DOFLSH
QUIT KILL G,GX,GMRZ,GMRYZ,GN,GMESSG,GFLUSH,GSEL
QUIT
SETDB ;
+1 SET GHLOC=GMRHLOC
KILL DD
SET X=+GX
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
if Y'>0!GMROUT
QUIT
+2 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=""`""_GHLOC;1///^S X=GSITE;8///^S X=GX;9///^S X=""`""_DUZ;10///^S X=""FLUSHED"";17///^S X=GCATH(1)"
+3 DO WAIT^GMRYUT0
if 'GMROUT
DO ^DIE
KILL DIE,DR
if 'GMROUT
LOCK -^GMR(126,DFN)
+4 SET ^GMR(126,DA(1),"IV",DA,"IN",0)="^126.313IDA^1^1"
+5 SET ^GMR(126,DA(1),"IV",DA,"IN",1,0)=GX_"^0^^"_DUZ_"^"_GHLOC
+6 SET ^GMR(126,DA(1),"IV",DA,"IN","B",GX,1)=""
SET ^GMR(126,DA(1),"IV",DA,"IN","C",(9999999-GX),1)=""
+7 QUIT
ASKFLSH ;CALLED BY MAINTENANCE OPTION
+1 ;G:GMROUT QUIT2 S %=2 W !,"Do you want to flush IV line" D YN^DICN Q:%'=1
+2 DO DOFLSH
QUIT2 KILL GMRYZ,GN,GMESSG,GFLUSH,GSEL
QUIT
DOFLSH WRITE !
SET GMRVTYP="L"
SET GOPT=""
DO LOCK^GMRYED5
if GMROUT
QUIT
+1 DO LIST
if GMROUT
QUIT
+2 IF '$DATA(GMRPORT)
SET GCATH(1)=""
DO SETDB
QUIT
+3 SET G=0
FOR
SET G=$ORDER(GSEL(G))
if G'>0!GMROUT
QUIT
SET GCATH(1)=$PIECE(GMRPORT(G),"^",2)
DO SETDB
+4 QUIT
LIST ;
+1 SET GOPT="FLUSH"
SET GHOLD=GCATH(2)
SET (GHOLD(1),GHOLD(2),GHOLD(3))=0
DO FINDPORT^GMRYSTCA(.GHOLD)
+2 if '$DATA(GMRPORT)
QUIT
+3 WRITE !,GSITE,!
+4 SET GMRN=GHOLD(4)
KILL GHOLD
if GMRN'>0
QUIT
LIST2 FOR I=1:1:GMRN
WRITE !,?2,I_" "_$PIECE(GMRPORT(I),"^",2)
+1 WRITE !,?2,"Enter the number(s) of port/lumen for flush: "
SET GMRX=""
READ GMRX:DTIME
+2 if GMRX["?"
GOTO LIST2
+3 IF '$TEST!(GMRX["^")!(GMRX="")
SET GMROUT=1
QUIT
+4 DO VALIDAT^GMRYUT9
+5 IF '$DATA(GSEL)!($ORDER(GSEL(0))'>0)
WRITE !,"ERROR ENTRY, TRY AGAIN",!
GOTO LIST2
+6 QUIT