GMRVED6 ;HIRMFO/YH-VM EDIT FOR PATIENT ON PASS OR REFUSE ;2/7/99
;;4.0;Vitals/Measurements;**1,7**;Apr 25, 1997
EN1 ;
S %=2 W !,"Do you want to enter Vitals" D YN^DICN
I %<0 S GMROUT=1 Q
I %=1 Q
F GMRX=2:1:$L(GMRSTR(0),";")-1 D
. S GMRY=$P(GMRSTR,";",GMRX),GMRDAT(GMRY)="pass",(GMRSITE(GMRY),GMRINF(GMRY))=""
. Q
S GMROUT(1)=1 Q
EN2(GRSN) ;
N GG,I,X S GG=3,GG(1)="Unavailable",GG(2)="Pass",GG(3)="Refused"
AGAIN W !!,"*** Reason for Omission ***" F I=1:1:GG W !,I_". "_GG(I)
W !!,"Select a number (the reason for the data omission) or ^ to quit: "
S X=0 R X:DTIME I '$T!(X["^") S GMROUT=1,GRSN="" Q GRSN
I $L(X)>2 G AGAIN
I X["?" W !,"Enter the number of reason * was entered",! G AGAIN
I '$D(GG(+X)) G AGAIN
S GRSN=GG(+X)
Q GRSN
EN3 ; SELECT ROOMS ON A GIVEN WARD
K GMRMSL
I $D(^DG(405.4,0)) S X=0 F Y=1:0 S X=$O(^DG(405.4,"W",GMRWARD,X)) Q:X'>0 I $D(^DG(405.4,X,0)),$P($P(^(0),"^"),"-")'="" S:'$D(GMRMSL("B",$P($P(^(0),"^"),"-"))) GMRMSL(Y)=$P($P(^(0),"^"),"-"),GMRMSL("B",$P($P(^(0),"^"),"-"))="",Y=Y+1
S GMRMSL=Y-1
S3 K I S I(1)=1,I(2)=21,I(3)=41,I(4)=61,I(5)=81 W !!,"UNIT "_GMRWARD(1)_" has the following Rooms:",!! F Y=0:0 S Y=$O(GMRMSL(Y)) Q:Y'>0!(Y'<21) D ROOMSEL^GMRVUT3
W !!,"Select the NUMBER(S) of the Rooms for Vital/Measurement: " R GMRRMST:DTIME W:GMRRMST="" !,"NO ROOM SELECTED",! I "^"[GMRRMST!'$T!(GMRRMST="") S GMROUT=1 Q
I $L(GMRRMST)>20 G S3
I GMRRMST?1"?".E W !,?5,"Type in number(s) associated with the rooms you want,",!,?5,"separated by commas or hyphens if there is more than one room",!,?5,"(e.g., 1-3,5 would be entries 1,2,3 and 5)." G S3
I '(GMRRMST?.N!(GMRRMST?.NP&(GMRRMST["-"!(GMRRMST[",")))) W $C(7)," ??" G S3
F GMRI=1:1 S GMRLEN=$P(GMRRMST,",",GMRI) Q:GMRLEN="" S GMRLEN(1)=$P(GMRLEN,"-",2)_"+"_GMRLEN F GMRX=+GMRLEN:1:+GMRLEN(1) D RMCHK I GMROUT S GMROUT=0 G S3
Q
RMCHK ;
I '$D(GMRMSL(GMRX)) W !?5,$C(7),"Please select a number between 1 and ",GMRMSL S GMROUT=1 Q
S:GMRX=+GMRX GMRROOM(GMRMSL(GMRX))=""
Q
GMRVED6 ;HIRMFO/YH-VM EDIT FOR PATIENT ON PASS OR REFUSE ;2/7/99
+1 ;;4.0;Vitals/Measurements;**1,7**;Apr 25, 1997
EN1 ;
+1 SET %=2
WRITE !,"Do you want to enter Vitals"
DO YN^DICN
+2 IF %<0
SET GMROUT=1
QUIT
+3 IF %=1
QUIT
+4 FOR GMRX=2:1:$LENGTH(GMRSTR(0),";")-1
Begin DoDot:1
+5 SET GMRY=$PIECE(GMRSTR,";",GMRX)
SET GMRDAT(GMRY)="pass"
SET (GMRSITE(GMRY),GMRINF(GMRY))=""
+6 QUIT
End DoDot:1
+7 SET GMROUT(1)=1
QUIT
EN2(GRSN) ;
+1 NEW GG,I,X
SET GG=3
SET GG(1)="Unavailable"
SET GG(2)="Pass"
SET GG(3)="Refused"
AGAIN WRITE !!,"*** Reason for Omission ***"
FOR I=1:1:GG
WRITE !,I_". "_GG(I)
+1 WRITE !!,"Select a number (the reason for the data omission) or ^ to quit: "
+2 SET X=0
READ X:DTIME
IF '$TEST!(X["^")
SET GMROUT=1
SET GRSN=""
QUIT GRSN
+3 IF $LENGTH(X)>2
GOTO AGAIN
+4 IF X["?"
WRITE !,"Enter the number of reason * was entered",!
GOTO AGAIN
+5 IF '$DATA(GG(+X))
GOTO AGAIN
+6 SET GRSN=GG(+X)
+7 QUIT GRSN
EN3 ; SELECT ROOMS ON A GIVEN WARD
+1 KILL GMRMSL
+2 IF $DATA(^DG(405.4,0))
SET X=0
FOR Y=1:0
SET X=$ORDER(^DG(405.4,"W",GMRWARD,X))
IF X'>0
QUIT
IF $DATA(^DG(405.4,X,0))
IF $PIECE($PIECE(^(0),"^"),"-")'=""
IF '$DATA(GMRMSL("B",$PIECE($PIECE(^(0),"^"),"-")))
SET GMRMSL(Y)=$PIECE($PIECE(^(0),"^"),"-")
SET GMRMSL("B",$PIECE($PIECE(^(0),"^"),"-"))=""
SET Y=Y+1
+3 SET GMRMSL=Y-1
S3 KILL I
SET I(1)=1
SET I(2)=21
SET I(3)=41
SET I(4)=61
SET I(5)=81
WRITE !!,"UNIT "_GMRWARD(1)_" has the following Rooms:",!!
FOR Y=0:0
SET Y=$ORDER(GMRMSL(Y))
IF Y'>0!(Y'<21)
QUIT
DO ROOMSEL^GMRVUT3
+1 WRITE !!,"Select the NUMBER(S) of the Rooms for Vital/Measurement: "
READ GMRRMST:DTIME
IF GMRRMST=""
WRITE !,"NO ROOM SELECTED",!
IF "^"[GMRRMST!'$TEST!(GMRRMST="")
SET GMROUT=1
QUIT
+2 IF $LENGTH(GMRRMST)>20
GOTO S3
+3 IF GMRRMST?1"?".E
WRITE !,?5,"Type in number(s) associated with the rooms you want,",!,?5,"separated by commas or hyphens if there is more than one room",!,?5,"(e.g., 1-3,5 would be entries 1,2,3 and 5)."
GOTO S3
+4 IF '(GMRRMST?.N!(GMRRMST?.NP&(GMRRMST["-"!(GMRRMST[","))))
WRITE $CHAR(7)," ??"
GOTO S3
+5 FOR GMRI=1:1
SET GMRLEN=$PIECE(GMRRMST,",",GMRI)
IF GMRLEN=""
QUIT
SET GMRLEN(1)=$PIECE(GMRLEN,"-",2)_"+"_GMRLEN
FOR GMRX=+GMRLEN:1:+GMRLEN(1)
DO RMCHK
IF GMROUT
SET GMROUT=0
GOTO S3
+6 QUIT
RMCHK ;
+1 IF '$DATA(GMRMSL(GMRX))
WRITE !?5,$CHAR(7),"Please select a number between 1 and ",GMRMSL
SET GMROUT=1
QUIT
+2 IF GMRX=+GMRX
SET GMRROOM(GMRMSL(GMRX))=""
+3 QUIT