NURCRL3 ;HIRMFO/RM-SELECT MULTIPLE NURSING LOCATION UTILITY ;9/11/91
;;4.0;NURSING SERVICE;;Apr 25, 1997
;;
MDIC() ; FUNTION RETURNS NURSNLOC(NLOC,NLOCIEN)=""
; FUNCTION VALUE IS -1 IF USER ABORT, 0 IF NO LOCS PICKED, ELSE 1
N DIC,MDIC,NEG,X,Y K NURSNLOC
DIC W !,$S('$D(NURSNLOC):"Select",1:"Another")_" Nursing Unit: " R X:DTIME E S X="^^"
RETURN I "^^"[X S MDIC=$S(X["^":-1,1:''$D(NURSNLOC)) Q MDIC
I X?1"?".E D HLP S:Y<0 X="^^" G:Y<0 RETURN S X="?"
S NEG=X?1"-".E,X=$E(X,NEG+1,$L(X)),DIC="^NURSF(211.4,",DIC(0)="EQMNZ" D ^DIC I +Y'>0 G DIC
I 'NEG S NURSNLOC(Y(0,0),+Y)=""
E K NURSNLOC(Y(0,0),+Y)
G DIC
HLP ; PRINT LOCATIONS SELECTED ALREADY
W $C(7) I $D(NURSNLOC) W !?3,"YOU HAVE ALREADY SELECTED: "
S Y="",X=0 F S Y=$O(NURSNLOC(Y)) Q:Y="" W !?5,Y S X=X+1 I X>5 W """^"" TO STOP: " R X:DTIME S:'$T X="^^" S:X="^^" Y=-1 Q:X="^"!(Y<0) S X=0
Q:Y<0
W !!?3,"You may deselect from the list by typing the - followed by unit name.",!?4,"E.g. -3E would delete 3E from the list of units already selected."
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HNURCRL3 1040 printed Dec 13, 2024@02:20:52 Page 2
NURCRL3 ;HIRMFO/RM-SELECT MULTIPLE NURSING LOCATION UTILITY ;9/11/91
+1 ;;4.0;NURSING SERVICE;;Apr 25, 1997
+2 ;;
MDIC() ; FUNTION RETURNS NURSNLOC(NLOC,NLOCIEN)=""
+1 ; FUNCTION VALUE IS -1 IF USER ABORT, 0 IF NO LOCS PICKED, ELSE 1
+2 NEW DIC,MDIC,NEG,X,Y
KILL NURSNLOC
DIC WRITE !,$SELECT('$DATA(NURSNLOC):"Select",1:"Another")_" Nursing Unit: "
READ X:DTIME
IF '$TEST
SET X="^^"
RETURN IF "^^"[X
SET MDIC=$SELECT(X["^":-1,1:''$DATA(NURSNLOC))
QUIT MDIC
+1 IF X?1"?".E
DO HLP
if Y<0
SET X="^^"
if Y<0
GOTO RETURN
SET X="?"
+2 SET NEG=X?1"-".E
SET X=$EXTRACT(X,NEG+1,$LENGTH(X))
SET DIC="^NURSF(211.4,"
SET DIC(0)="EQMNZ"
DO ^DIC
IF +Y'>0
GOTO DIC
+3 IF 'NEG
SET NURSNLOC(Y(0,0),+Y)=""
+4 IF '$TEST
KILL NURSNLOC(Y(0,0),+Y)
+5 GOTO DIC
HLP ; PRINT LOCATIONS SELECTED ALREADY
+1 WRITE $CHAR(7)
IF $DATA(NURSNLOC)
WRITE !?3,"YOU HAVE ALREADY SELECTED: "
+2 SET Y=""
SET X=0
FOR
SET Y=$ORDER(NURSNLOC(Y))
if Y=""
QUIT
WRITE !?5,Y
SET X=X+1
IF X>5
WRITE """^"" TO STOP: "
READ X:DTIME
if '$TEST
SET X="^^"
if X="^^"
SET Y=-1
if X="^"!(Y<0)
QUIT
SET X=0
+3 if Y<0
QUIT
+4 WRITE !!?3,"You may deselect from the list by typing the - followed by unit name.",!?4,"E.g. -3E would delete 3E from the list of units already selected."
+5 QUIT