GMRYUT9 ;HIRMFO/YH-LIST/SELECT IV LINES ;10/15/96
;;4.0;Intake/Output;;Apr 25, 1997
IVLINE ;
K GMRYZ S GN=0,GN(1)="" F S GN(1)=$O(GST(GSITE,GN(1))) Q:GN(1)="" S GN(2)=0 F S GN(2)=$O(GST(GSITE,GN(1),GN(2))) Q:GN(2)'>0 S GN=GN+1,GMRYZ(GN)=GN(2)_"^"_GN(1)
I GN=0 Q
LIST W !!,GSITE_" - "_GSITE(GSITE),! F I=1:1:GN S GN(1)=GMRYZ(I) D WRITE
W !,GMESSG S GMRX="" R GMRX:DTIME I '$T!(GMRX["^") S GMROUT=1 Q
Q:GMRX="" I GMRX["?" W !,GMESSG,!,"or enter ^ to quit.",! G LIST
S GMRN=GN D VALIDAT
I '$D(GSEL) W !,"ERROR ENTRY, TRY AGAIN",! G LIST
S GMRYZ=$O(GSEL(0)) I GMRYZ'>0!('$D(GMRYZ(+GMRYZ))) W !,"ERROR ENTRY, TRY AGAIN",! G LIST
Q:$D(GFLUSH)
S $P(^GMR(126,DA(2),"IVM",DA(1),1,DA,0),"^",7)=+GMRYZ(GMRYZ),$P(^(0),"^",3)="Y"
;ADD 1/10TH SECOND TO THE DATE/TIME FOR EACH ADDITIONAL TUBE CHANGED
F S GMRYZ=$O(GSEL(GMRYZ)) Q:GMRYZ'>0!GMROUT I $D(GMRYZ(GMRYZ)) D
.D WAIT^GMRYUT0 Q:GMROUT K DD S X=GX,DIC="^GMR(126,"_DA(2)_",""IVM"","_DA(1)_",1,",DIC(0)="ML" D FILE^DICN L -^GMR(126,DFN) Q:+Y'>0 S DA=+Y
.S $P(^GMR(126,DA(2),"IVM",DA(1),1,DA,0),"^",3)="Y",$P(^(0),"^",7)=+GMRYZ(GMRYZ)
.Q
Q
WRITE W !,?3,I_". " S GN(2)=$P(GN(1),"^",2),GN(1)=+GN(1)
W " "_GST(GSITE,GN(2),GN(1),2)_$S(GN(2)'="BLANK":"("_GN(2)_")",1:"")
Q
VALIDAT ;
F GMRX(1)=1:1 S GMRX(2)=$P(GMRX,",",GMRX(1)) Q:GMRX(2)="" D VAL1
Q
VAL1 ;
I GMRX(2)["-" D VAL2 Q
S:GMRX(2)>0&(GMRX(2)<(GMRN+1)) GSEL(GMRX(2))=""
Q
VAL2 ;
S GMRX(3)=$P(GMRX(2),"-") Q:GMRX(3)<1!(GMRX(3)>GMRN) S GMRX(4)=$P(GMRX(2),"-",2) S:GMRX(4)>GMRN GMRX(4)=GMRN F GMRX(5)=GMRX(3):1:GMRX(4) S GSEL(GMRX(5))=""
Q
ADDRC S DR="1///^S X=GMRY;4///^S X=""`""_DUZ" D WAIT^GMRYUT0 I 'GMROUT D ^DIE L -^GMR(126,DFN)
K GMRX,DIE,DR Q
KILLRC S DIK="^GMR(126,"_DA(2)_",""IVM"","_DA(1)_",1," D ^DIK K DIK W !!,"Data not completed, the record of site maintenance is deleted!!!",! Q
PATIENT ;OBTAIN PATIENT WARD
D PT^GMRYUT0
I $D(GMRNUR) S X=$S($D(^NURSF(214,DFN,0)):+$P(^(0),"^",3),1:"") S X=$S(X>0&($D(^NURSF(211.4,+X,0))):+$P(^(0),"^"),1:"") S GMRWARD(1)=$S(X>0&($D(^SC(+X,0))):$P($P(^(0),"^"),"NUR ",2),1:"")
Q
GMRYUT9 ;HIRMFO/YH-LIST/SELECT IV LINES ;10/15/96
+1 ;;4.0;Intake/Output;;Apr 25, 1997
IVLINE ;
+1 KILL GMRYZ
SET GN=0
SET GN(1)=""
FOR
SET GN(1)=$ORDER(GST(GSITE,GN(1)))
IF GN(1)=""
QUIT
SET GN(2)=0
FOR
SET GN(2)=$ORDER(GST(GSITE,GN(1),GN(2)))
IF GN(2)'>0
QUIT
SET GN=GN+1
SET GMRYZ(GN)=GN(2)_"^"_GN(1)
+2 IF GN=0
QUIT
LIST WRITE !!,GSITE_" - "_GSITE(GSITE),!
FOR I=1:1:GN
SET GN(1)=GMRYZ(I)
DO WRITE
+1 WRITE !,GMESSG
SET GMRX=""
READ GMRX:DTIME
IF '$TEST!(GMRX["^")
SET GMROUT=1
QUIT
+2 IF GMRX=""
QUIT
IF GMRX["?"
WRITE !,GMESSG,!,"or enter ^ to quit.",!
GOTO LIST
+3 SET GMRN=GN
DO VALIDAT
+4 IF '$DATA(GSEL)
WRITE !,"ERROR ENTRY, TRY AGAIN",!
GOTO LIST
+5 SET GMRYZ=$ORDER(GSEL(0))
IF GMRYZ'>0!('$DATA(GMRYZ(+GMRYZ)))
WRITE !,"ERROR ENTRY, TRY AGAIN",!
GOTO LIST
+6 IF $DATA(GFLUSH)
QUIT
+7 SET $PIECE(^GMR(126,DA(2),"IVM",DA(1),1,DA,0),"^",7)=+GMRYZ(GMRYZ)
SET $PIECE(^(0),"^",3)="Y"
+8 ;ADD 1/10TH SECOND TO THE DATE/TIME FOR EACH ADDITIONAL TUBE CHANGED
+9 FOR
SET GMRYZ=$ORDER(GSEL(GMRYZ))
IF GMRYZ'>0!GMROUT
QUIT
IF $DATA(GMRYZ(GMRYZ))
Begin DoDot:1
+10 DO WAIT^GMRYUT0
IF GMROUT
QUIT
KILL DD
SET X=GX
SET DIC="^GMR(126,"_DA(2)_",""IVM"","_DA(1)_",1,"
SET DIC(0)="ML"
DO FILE^DICN
LOCK -^GMR(126,DFN)
IF +Y'>0
QUIT
SET DA=+Y
+11 SET $PIECE(^GMR(126,DA(2),"IVM",DA(1),1,DA,0),"^",3)="Y"
SET $PIECE(^(0),"^",7)=+GMRYZ(GMRYZ)
+12 QUIT
End DoDot:1
+13 QUIT
WRITE WRITE !,?3,I_". "
SET GN(2)=$PIECE(GN(1),"^",2)
SET GN(1)=+GN(1)
+1 WRITE " "_GST(GSITE,GN(2),GN(1),2)_$SELECT(GN(2)'="BLANK":"("_GN(2)_")",1:"")
+2 QUIT
VALIDAT ;
+1 FOR GMRX(1)=1:1
SET GMRX(2)=$PIECE(GMRX,",",GMRX(1))
IF GMRX(2)=""
QUIT
DO VAL1
+2 QUIT
VAL1 ;
+1 IF GMRX(2)["-"
DO VAL2
QUIT
+2 IF GMRX(2)>0&(GMRX(2)<(GMRN+1))
SET GSEL(GMRX(2))=""
+3 QUIT
VAL2 ;
+1 SET GMRX(3)=$PIECE(GMRX(2),"-")
IF GMRX(3)<1!(GMRX(3)>GMRN)
QUIT
SET GMRX(4)=$PIECE(GMRX(2),"-",2)
IF GMRX(4)>GMRN
SET GMRX(4)=GMRN
FOR GMRX(5)=GMRX(3):1:GMRX(4)
SET GSEL(GMRX(5))=""
+2 QUIT
ADDRC SET DR="1///^S X=GMRY;4///^S X=""`""_DUZ"
DO WAIT^GMRYUT0
IF 'GMROUT
DO ^DIE
LOCK -^GMR(126,DFN)
+1 KILL GMRX,DIE,DR
QUIT
KILLRC SET DIK="^GMR(126,"_DA(2)_",""IVM"","_DA(1)_",1,"
DO ^DIK
KILL DIK
WRITE !!,"Data not completed, the record of site maintenance is deleted!!!",!
QUIT
PATIENT ;OBTAIN PATIENT WARD
+1 DO PT^GMRYUT0
+2 IF $DATA(GMRNUR)
SET X=$SELECT($DATA(^NURSF(214,DFN,0)):+$PIECE(^(0),"^",3),1:"")
SET X=$SELECT(X>0&($DATA(^NURSF(211.4,+X,0))):+$PIECE(^(0),"^"),1:"")
SET GMRWARD(1)=$SELECT(X>0&($DATA(^SC(+X,0))):$PIECE($PIECE(^(0),"^"),"NUR ",2),1:"")
+3 QUIT