GMRYED3 ;HIRMFO/YH-START IV AND IV MAINTENANCE ENTRY POINT ;9/10/92
;;4.0;Intake/Output;;Apr 25, 1997
EN1 ;SELECTE IV I/O AND IV MAINTENANCE
S (GMRVIDT,GDR,GMROUT)=0,GSITE="" D MASPT^GMRYRP5
LIST W ! S (GMROUT,GNN)=0,DA=DFN D LISTOP^GMRYED4
W !!,"Select from 1 to ",GNN," (enter 1,3-5 etc.) or <RET> to exit: " R GNI:DTIME S:'$T!(GNI["^")!(GNI="") GMROUT=1 G:GMROUT Q
I (GNI["?") W ! D LISTQUES^GMRYED4 W !!,"Enter <RET> to continue or ^ to exit " R X:DTIME S:'$T!(X["^")!(X="") GMROUT=1 G:GMROUT Q
D VALIDAT^GMRYED1 I '$D(GTYP)!GMROUT(1) W $C(7)," ??" G LIST
S GGNN=0 F S GGNN=$O(GTYP(GGNN)) Q:GGNN'>0 I $D(GNN(GGNN)) S GOPT=$P(GNN(GGNN),"^",2) D @GOPT I GMROUT S GMROUT=0 Q
Q K GPORT,X,Y,DD,DR,DIE,DIC,DLAYGO,%,GMRZZZ,GSAVE,GLINE,GMRX,GSAVE,GDCREAS,GIV,GMRDC,GMRVN,GIVDT,GREC,GSITE,GMRDA,GIN,GLEFT,GGDA,GMRY,GDCIV,GDCDT,DA,GDR,GDCIV,GADD,GGNN,GNN,GNI,GNUR,GOPT,GMRW,GTYP,GCT,GDATA,GMRXX,GMRZ,GNOW,GST G:GMROUT=0 LIST
D Q^GMRYED2 K GFLAG,GHLOC,GMRVTYP,GMRYY,GCATH Q
;
STARTIV ;
S GMROUT=0 W @IOF,!!,"*** START IV ***",! S GDCIV=0 D EN3^GMRYED1
K GFLAG Q
;
DCIV ;REMOVE IV FROM IV SITE
D DCIV^GMRYDCIV Q
;
MAINTN ;CARE/MAINTENANCE/FLUSH OPTION ENTRY POINT
S GMROUT=0,GDCIV=4 W @IOF,!!,"*** CARE/MAINTENANCE/FLUSH ***",! D SELSITE^GMRYMNT W:GMRXY=0 !!,"There are no sites with IV(s) running or DC'd within 24 hours.",! D:GMRXY>0 EN1^GMRYMNT K GSTDC,GST,GCT,GX,GMRXY Q
;
HANG ;D/C CURRENT SOLUTION/ADD THE SAME SOLUTION
S GMROUT=0,DA=DFN,GDCIV=5,GMRDC=0 W @IOF,!!,"*** REPLACE SAME SOLUTION ***",! D LISTIV^GMRYUT0,SEL^GMRYED4 Q:X="" I GMROUT D Q4^GMRYED6 Q
S GDR=0 I $G(GCATH)'="" S GCATH(2)=$S($D(^GMRD(126.74,"B",GCATH)):$O(^GMRD(126.74,"B",GCATH,0)),1:"")
D HANG^GMRYED4 D Q4^GMRYED6 Q
;
ADDONLY ;ADD ANOTHER SOLUTION (MULTIPLE SOLUTIONS FOR A LINE) WITHOUT DC CURRENT
S GDCIV=6,DA=DFN,(GMROUT,GMRDC)=0 W @IOF,!!,"*** ADD ADDITIONAL SOLUTION(S) ***",!! D SELSITE^GMRYMNT,SEL1^GMRYMNT Q:GMROUT!(GMRXY=0)!(X="") D DT^GMRYUT3 Q:GMROUT!(GX'>0)
;ONLY ONE INFUSION SITE
I GMRXY=1 W !,GSITE(GSITE) D SITEIV
S GMROUT(1)=0,GMROUT(1)=$$ADM^GMRYUT12(.GMROUT,DFN,GX) Q:GMROUT
S GMRLINE=0
SELECTP G:GMROUT QADD I GMRLINE>0,'$D(GMRPORT) G QADD
;OBTAIN PORT/LUMEN
K GHOLD S GCATH=GSITE(GSITE),GCATH(1)="",GCATH(2)=$O(^GMRD(126.74,"B",GCATH,0)) S GHOLD=GCATH(2),(GHOLD(1),GHOLD(2),GHOLD(3))="" D FINDPORT^GMRYSTCA(.GHOLD) S GCATH(1)=GHOLD(3) I GMROUT K GX,GHOLD G QADD
K GHOLD S GMRLINE=0 D SOLTYPE^GMRYUT7 I 'GMROUT S GMRDEL="",GDR=3,GADD="Y" D ADDIV^GMRYED2 G SELECTP
QADD D Q4^GMRYED6 K GST,GCT,GSDC,GMRLINE Q
Q
;
ADDSOL ;ADD IV SOLUTION
W @IOF,!!,"*** SOLUTION: REPLACE/DC/CONVERT/FINISH SOLUTION ***",! S GDCIV=0,GDCREAS=0
D ADDSOL1^GMRYED6 K GST,GCT,GDCDT,GDCREAS,%
Q
TITER ;ADJUST INFUSION RATE FOR A SELECTED SOLUTION
D INFUSE^GMRYINFS Q
;
FLUSH ;FLUSH OPTION ENTRY POINT
D FLUSH^GMRYFLSH Q
;
RESTART ;RESTAT AN IV
W @IOF,!!,"*** RESTART DC'd IV ***" S (GMROUT,GDCIV)=0 D RESTART^GMRYUT10
Q
SITEIV ;
S GDA="" F S GDA=$O(GST(GSITE,GDA)) Q:GDA="" W:GDA'="BLANK" !,?2,GDA S GPORT=GDA,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
GMRYED3 ;HIRMFO/YH-START IV AND IV MAINTENANCE ENTRY POINT ;9/10/92
+1 ;;4.0;Intake/Output;;Apr 25, 1997
EN1 ;SELECTE IV I/O AND IV MAINTENANCE
+1 SET (GMRVIDT,GDR,GMROUT)=0
SET GSITE=""
DO MASPT^GMRYRP5
LIST WRITE !
SET (GMROUT,GNN)=0
SET DA=DFN
DO LISTOP^GMRYED4
+1 WRITE !!,"Select from 1 to ",GNN," (enter 1,3-5 etc.) or <RET> to exit: "
READ GNI:DTIME
IF '$TEST!(GNI["^")!(GNI="")
SET GMROUT=1
IF GMROUT
GOTO Q
+2 IF (GNI["?")
WRITE !
DO LISTQUES^GMRYED4
WRITE !!,"Enter <RET> to continue or ^ to exit "
READ X:DTIME
IF '$TEST!(X["^")!(X="")
SET GMROUT=1
IF GMROUT
GOTO Q
+3 DO VALIDAT^GMRYED1
IF '$DATA(GTYP)!GMROUT(1)
WRITE $CHAR(7)," ??"
GOTO LIST
+4 SET GGNN=0
FOR
SET GGNN=$ORDER(GTYP(GGNN))
IF GGNN'>0
QUIT
IF $DATA(GNN(GGNN))
SET GOPT=$PIECE(GNN(GGNN),"^",2)
DO @GOPT
IF GMROUT
SET GMROUT=0
QUIT
Q KILL GPORT,X,Y,DD,DR,DIE,DIC,DLAYGO,%,GMRZZZ,GSAVE,GLINE,GMRX,GSAVE,GDCREAS,GIV,GMRDC,GMRVN,GIVDT,GREC,GSITE,GMRDA,GIN,GLEFT,GGDA,GMRY,GDCIV,GDCDT,DA,GDR,GDCIV,GADD,GGNN,GNN,GNI,GNUR,GOPT,GMRW,GTYP,GCT,GDATA,GMRXX,GMRZ,GNOW,GST
IF GMROUT=0
GOTO LIST
+1 DO Q^GMRYED2
KILL GFLAG,GHLOC,GMRVTYP,GMRYY,GCATH
QUIT
+2 ;
STARTIV ;
+1 SET GMROUT=0
WRITE @IOF,!!,"*** START IV ***",!
SET GDCIV=0
DO EN3^GMRYED1
+2 KILL GFLAG
QUIT
+3 ;
DCIV ;REMOVE IV FROM IV SITE
+1 DO DCIV^GMRYDCIV
QUIT
+2 ;
MAINTN ;CARE/MAINTENANCE/FLUSH OPTION ENTRY POINT
+1 SET GMROUT=0
SET GDCIV=4
WRITE @IOF,!!,"*** CARE/MAINTENANCE/FLUSH ***",!
DO SELSITE^GMRYMNT
IF GMRXY=0
WRITE !!,"There are no sites with IV(s) running or DC'd within 24 hours.",!
IF GMRXY>0
DO EN1^GMRYMNT
KILL GSTDC,GST,GCT,GX,GMRXY
QUIT
+2 ;
HANG ;D/C CURRENT SOLUTION/ADD THE SAME SOLUTION
+1 SET GMROUT=0
SET DA=DFN
SET GDCIV=5
SET GMRDC=0
WRITE @IOF,!!,"*** REPLACE SAME SOLUTION ***",!
DO LISTIV^GMRYUT0
DO SEL^GMRYED4
IF X=""
QUIT
IF GMROUT
DO Q4^GMRYED6
QUIT
+2 SET GDR=0
IF $GET(GCATH)'=""
SET GCATH(2)=$SELECT($DATA(^GMRD(126.74,"B",GCATH)):$ORDER(^GMRD(126.74,"B",GCATH,0)),1:"")
+3 DO HANG^GMRYED4
DO Q4^GMRYED6
QUIT
+4 ;
ADDONLY ;ADD ANOTHER SOLUTION (MULTIPLE SOLUTIONS FOR A LINE) WITHOUT DC CURRENT
+1 SET GDCIV=6
SET DA=DFN
SET (GMROUT,GMRDC)=0
WRITE @IOF,!!,"*** ADD ADDITIONAL SOLUTION(S) ***",!!
DO SELSITE^GMRYMNT
DO SEL1^GMRYMNT
IF GMROUT!(GMRXY=0)!(X="")
QUIT
DO DT^GMRYUT3
IF GMROUT!(GX'>0)
QUIT
+2 ;ONLY ONE INFUSION SITE
+3 IF GMRXY=1
WRITE !,GSITE(GSITE)
DO SITEIV
+4 SET GMROUT(1)=0
SET GMROUT(1)=$$ADM^GMRYUT12(.GMROUT,DFN,GX)
IF GMROUT
QUIT
+5 SET GMRLINE=0
SELECTP IF GMROUT
GOTO QADD
IF GMRLINE>0
IF '$DATA(GMRPORT)
GOTO QADD
+1 ;OBTAIN PORT/LUMEN
+2 KILL GHOLD
SET GCATH=GSITE(GSITE)
SET GCATH(1)=""
SET GCATH(2)=$ORDER(^GMRD(126.74,"B",GCATH,0))
SET GHOLD=GCATH(2)
SET (GHOLD(1),GHOLD(2),GHOLD(3))=""
DO FINDPORT^GMRYSTCA(.GHOLD)
SET GCATH(1)=GHOLD(3)
IF GMROUT
KILL GX,GHOLD
GOTO QADD
+3 KILL GHOLD
SET GMRLINE=0
DO SOLTYPE^GMRYUT7
IF 'GMROUT
SET GMRDEL=""
SET GDR=3
SET GADD="Y"
DO ADDIV^GMRYED2
GOTO SELECTP
QADD DO Q4^GMRYED6
KILL GST,GCT,GSDC,GMRLINE
QUIT
+1 QUIT
+2 ;
ADDSOL ;ADD IV SOLUTION
+1 WRITE @IOF,!!,"*** SOLUTION: REPLACE/DC/CONVERT/FINISH SOLUTION ***",!
SET GDCIV=0
SET GDCREAS=0
+2 DO ADDSOL1^GMRYED6
KILL GST,GCT,GDCDT,GDCREAS,%
+3 QUIT
TITER ;ADJUST INFUSION RATE FOR A SELECTED SOLUTION
+1 DO INFUSE^GMRYINFS
QUIT
+2 ;
FLUSH ;FLUSH OPTION ENTRY POINT
+1 DO FLUSH^GMRYFLSH
QUIT
+2 ;
RESTART ;RESTAT AN IV
+1 WRITE @IOF,!!,"*** RESTART DC'd IV ***"
SET (GMROUT,GDCIV)=0
DO RESTART^GMRYUT10
+2 QUIT
SITEIV ;
+1 SET GDA=""
FOR
SET GDA=$ORDER(GST(GSITE,GDA))
IF GDA=""
QUIT
IF GDA'="BLANK"
WRITE !,?2,GDA
SET GPORT=GDA
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
+2 QUIT