Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: GMRYFLSH

GMRYFLSH.m

Go to the documentation of this file.
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