GMRYSTCA ;HIRMFO/YH-IV SITE AND CATHETER SELECTION ;3/1/96
;;4.0;Intake/Output;;Apr 25, 1997
SITECATH ;ENTER INFUSION SITE/CATH TYPE
Q:GSITE'=""&(GCATH'="")&(GCATH(1)'="") N GHOLD
I GSITE'="",GDR'=1 S GHOLD=GCATH(2),GHOLD(1)=GCATH,(GHOLD(2),GHOLD(3))="" D:GCATH(1)="" FINDPORT(.GHOLD) Q:GMROUT S GCATH(1)=GHOLD(3) Q
E D
.N GMRZ D EN1^GMRYUT5 S X="" W ": " R X:DTIME I '$T!(X["^")!($L(X)>3) S:'$T!(X["^") GMROUT=1 S X="" Q
.I '(X=""!(X["?")) D EN2^GMRYUT5 S GSITE=X
Q:GMROUT I X=""!(X["?") W !!,"Enter the number of the site you want and a L for LEFT/R for RIGHT after",!,"the number. The default is L(eft).",!,"For example, 1L or 1 is LEFT HAND, 1R is RIGHT HAND.",! S X="",GSITE="" G SITECATH
ENTER S (GHOLD,GHOLD(1),GHOLD(2),GHOLD(3),GCATH(1),GCATH(2))=""
I GCATH="" D CATH(.GHOLD) Q:GMROUT S GCATH=GHOLD(1) D FINDPORT(.GHOLD) S GCATH(1)=GHOLD(3),GCATH(2)=GHOLD Q
E S GHOLD(1)=GCATH,GHOLD=$O(^GMRD(126.74,"B",GCATH,0)) D FINDPORT(.GHOLD)
Q:GMROUT
YN W !,GHOLD(1)_" "_GHOLD(3) ;S %=1 D YN^DICN W:%=0 !!,"Enter N(o) if the data is not correct.",! I %<1 S GMROUT=1 Q
S GCATH(1)=GHOLD(3),GCATH(2)=GHOLD
Q
FINDPORT(JJ) ;
N GJ K GMRPORT
I JJ>0,$P($G(^GMRD(126.74,+JJ,1,0)),"^",4)>0 D Q:GMROUT
. S GJ=0,GJ(1)="" F S GJ(1)=$O(^GMRD(126.74,+JJ,1,"B",GJ(1))) Q:GJ(1)="" S GJ(2)=0 F S GJ(2)=$O(^GMRD(126.74,+JJ,1,"B",GJ(1),GJ(2))) Q:GJ(2)'>0 S GJ=GJ+1,GMRPORT(GJ)=GJ(2)_"^"_GJ(1)
PORT . S JJ(4)=GJ Q:GJ'>0!($G(GOPT)["FLUSH")!GMROUT W ! F I=1:1:GJ W !,I_" "_$P(GMRPORT(I),"^",2)
. W !!,?3,"Select the port number used for medication infusion or ^ to quit: " S JJ(2)=0 R JJ(2):DTIME I '$T!(JJ(2)["^") S GMROUT=1
. Q:GMROUT I '$D(GMRPORT(+JJ(2))) W !,"ERROR ENTRY!" G PORT
. S JJ(3)=$P(GMRPORT(+JJ(2)),"^",2)
.Q
Q
CATH(II) ;
N GTXT,GMRY,GMRZ,GMRN
LISTC K GMRZ W !,"Select from the following IV CATHs",! S (GMRZ,GMRN)=0 F S GMRZ=$O(^GMRD(126.74,GMRZ)) Q:GMRZ'>0 S GMRN=GMRN+1,GMRY(GMRN)=GMRZ_"^"_$P(^(GMRZ,0),"^")_"^"_GMRN_". "
S GMRN(1)=(GMRN\2)+(GMRN#2) D LISTS^GMRYUT5 W !,"Select a number between 1 and "_GMRN_": " S X="" R X:DTIME I '$T!(X["^") S GMROUT=1 Q
I X=""!(X["?")!'(X>0&(X<(GMRN+1))) W !,"Enter a number between 1 and "_GMRN G LISTC
S II=+$P(GMRY(+X),"^"),II(1)=$P(^GMRD(126.74,II,0),"^")
Q
GMRYSTCA ;HIRMFO/YH-IV SITE AND CATHETER SELECTION ;3/1/96
+1 ;;4.0;Intake/Output;;Apr 25, 1997
SITECATH ;ENTER INFUSION SITE/CATH TYPE
+1 IF GSITE'=""&(GCATH'="")&(GCATH(1)'="")
QUIT
NEW GHOLD
+2 IF GSITE'=""
IF GDR'=1
SET GHOLD=GCATH(2)
SET GHOLD(1)=GCATH
SET (GHOLD(2),GHOLD(3))=""
IF GCATH(1)=""
DO FINDPORT(.GHOLD)
IF GMROUT
QUIT
SET GCATH(1)=GHOLD(3)
QUIT
+3 IF '$TEST
Begin DoDot:1
+4 NEW GMRZ
DO EN1^GMRYUT5
SET X=""
WRITE ": "
READ X:DTIME
IF '$TEST!(X["^")!($LENGTH(X)>3)
IF '$TEST!(X["^")
SET GMROUT=1
SET X=""
QUIT
+5 IF '(X=""!(X["?"))
DO EN2^GMRYUT5
SET GSITE=X
End DoDot:1
+6 IF GMROUT
QUIT
IF X=""!(X["?")
WRITE !!,"Enter the number of the site you want and a L for LEFT/R for RIGHT after",!,"the number. The default is L(eft).",!,"For example, 1L or 1 is LEFT HAND, 1R is RIGHT HAND.",!
SET X=""
SET GSITE=""
GOTO SITECATH
ENTER SET (GHOLD,GHOLD(1),GHOLD(2),GHOLD(3),GCATH(1),GCATH(2))=""
+1 IF GCATH=""
DO CATH(.GHOLD)
IF GMROUT
QUIT
SET GCATH=GHOLD(1)
DO FINDPORT(.GHOLD)
SET GCATH(1)=GHOLD(3)
SET GCATH(2)=GHOLD
QUIT
+2 IF '$TEST
SET GHOLD(1)=GCATH
SET GHOLD=$ORDER(^GMRD(126.74,"B",GCATH,0))
DO FINDPORT(.GHOLD)
+3 IF GMROUT
QUIT
YN ;S %=1 D YN^DICN W:%=0 !!,"Enter N(o) if the data is not correct.",! I %<1 S GMROUT=1 Q
WRITE !,GHOLD(1)_" "_GHOLD(3)
+1 SET GCATH(1)=GHOLD(3)
SET GCATH(2)=GHOLD
+2 QUIT
FINDPORT(JJ) ;
+1 NEW GJ
KILL GMRPORT
+2 IF JJ>0
IF $PIECE($GET(^GMRD(126.74,+JJ,1,0)),"^",4)>0
Begin DoDot:1
+3 SET GJ=0
SET GJ(1)=""
FOR
SET GJ(1)=$ORDER(^GMRD(126.74,+JJ,1,"B",GJ(1)))
IF GJ(1)=""
QUIT
SET GJ(2)=0
FOR
SET GJ(2)=$ORDER(^GMRD(126.74,+JJ,1,"B",GJ(1),GJ(2)))
IF GJ(2)'>0
QUIT
SET GJ=GJ+1
SET GMRPORT(GJ)=GJ(2)_"^"_GJ(1)
PORT SET JJ(4)=GJ
IF GJ'>0!($GET(GOPT)["FLUSH")!GMROUT
QUIT
WRITE !
FOR I=1:1:GJ
WRITE !,I_" "_$PIECE(GMRPORT(I),"^",2)
+1 WRITE !!,?3,"Select the port number used for medication infusion or ^ to quit: "
SET JJ(2)=0
READ JJ(2):DTIME
IF '$TEST!(JJ(2)["^")
SET GMROUT=1
+2 IF GMROUT
QUIT
IF '$DATA(GMRPORT(+JJ(2)))
WRITE !,"ERROR ENTRY!"
GOTO PORT
+3 SET JJ(3)=$PIECE(GMRPORT(+JJ(2)),"^",2)
+4 QUIT
End DoDot:1
IF GMROUT
QUIT
+5 QUIT
CATH(II) ;
+1 NEW GTXT,GMRY,GMRZ,GMRN
LISTC KILL GMRZ
WRITE !,"Select from the following IV CATHs",!
SET (GMRZ,GMRN)=0
FOR
SET GMRZ=$ORDER(^GMRD(126.74,GMRZ))
IF GMRZ'>0
QUIT
SET GMRN=GMRN+1
SET GMRY(GMRN)=GMRZ_"^"_$PIECE(^(GMRZ,0),"^")_"^"_GMRN_". "
+1 SET GMRN(1)=(GMRN\2)+(GMRN#2)
DO LISTS^GMRYUT5
WRITE !,"Select a number between 1 and "_GMRN_": "
SET X=""
READ X:DTIME
IF '$TEST!(X["^")
SET GMROUT=1
QUIT
+2 IF X=""!(X["?")!'(X>0&(X<(GMRN+1)))
WRITE !,"Enter a number between 1 and "_GMRN
GOTO LISTC
+3 SET II=+$PIECE(GMRY(+X),"^")
SET II(1)=$PIECE(^GMRD(126.74,II,0),"^")
+4 QUIT