FSCQSR ;SLC/STAFF-NOIS Query Search Range ;8/8/98 21:34
;;1.1;NOIS;;Sep 06, 1998
;
R ; from FSCQS
I CODE["7100.6" D PR Q
D VALUE(VALUE)
I LIST=1 D Q
.S NODE=+$P(CODE,";"),PIECE=$P(CODE,";",2)
.S CALL=0 F S CALL=$O(^TMP("FSC USELIST",$J,CALL)) Q:CALL<1 D
..S CVALUE=$P($G(^FSCD("CALL",CALL,NODE)),U,PIECE) I $L(CVALUE),CVALUE'<VALUE1,CVALUE'>VALUE2 X ACTION
I '$L(INDEX) D Q
.S NODE=+$P(CODE,";"),PIECE=$P(CODE,";",2)
.S CALL=0 F S CALL=$O(^FSCD("CALL",CALL)) Q:CALL<1 D
..S CVALUE=$P($G(^FSCD("CALL",CALL,NODE)),U,PIECE) I $L(CVALUE),CVALUE'<VALUE1,CVALUE'>VALUE2 X ACTION
I LIST=0 D Q
.S CALL=0 F S CALL=$O(^FSCD("CALL",INDEX,VALUE1,CALL)) Q:CALL<1 D
..I $D(^TMP("FSC USELIST",$J,CALL)) X ACTION
.S CVALUE=VALUE1 F S CVALUE=$O(^FSCD("CALL",INDEX,CVALUE)) Q:CVALUE="" Q:CVALUE>VALUE2 D
..S CALL=0 F S CALL=$O(^FSCD("CALL",INDEX,CVALUE,CALL)) Q:CALL<1 D
...I $D(^TMP("FSC USELIST",$J,CALL)) X ACTION
I LIST="" D Q
.S CALL=0 F S CALL=$O(^FSCD("CALL",INDEX,VALUE1,CALL)) Q:CALL<1 X ACTION
.S CVALUE=VALUE1 F S CVALUE=$O(^FSCD("CALL",INDEX,CVALUE)) Q:CVALUE="" Q:CVALUE>VALUE2 D
..S CALL=0 F S CALL=$O(^FSCD("CALL",INDEX,CVALUE,CALL)) Q:CALL<1 X ACTION
Q
NR ; from FSCQS
I CODE["7100.6" D PNR Q
D VALUE(VALUE)
I LIST=1 D Q
.S NODE=+$P(CODE,";"),PIECE=$P(CODE,";",2)
.S CALL=0 F S CALL=$O(^TMP("FSC USELIST",$J,CALL)) Q:CALL<1 D
..S CVALUE=$P($G(^FSCD("CALL",CALL,NODE)),U,PIECE) I $L(CVALUE),CVALUE<VALUE1!(CVALUE>VALUE2) X ACTION
I '$L(INDEX) D Q
.S NODE=+$P(CODE,";"),PIECE=$P(CODE,";",2)
.S CALL=0 F S CALL=$O(^FSCD("CALL",CALL)) Q:CALL<1 D
..S CVALUE=$P($G(^FSCD("CALL",CALL,NODE)),U,PIECE) I $L(CVALUE),CVALUE<VALUE1!(CVALUE>VALUE2) X ACTION
I LIST=0 D Q
.S CVALUE="" F S CVALUE=$O(^FSCD("CALL",INDEX,CVALUE)) Q:CVALUE="" D
..I CVALUE'<VALUE1,CVALUE'>VALUE2 S CVALUE=VALUE2 Q
..S CALL=0 F S CALL=$O(^FSCD("CALL",INDEX,CVALUE,CALL)) Q:CALL<1 D
...I $D(^TMP("FSC USELIST",$J,CALL)) X ACTION
I LIST="" D Q
.S CVALUE="" F S CVALUE=$O(^FSCD("CALL",INDEX,CVALUE)) Q:CVALUE="" D
..I CVALUE'<VALUE1,CVALUE'>VALUE2 S CVALUE=VALUE2 Q
..S CALL=0 F S CALL=$O(^FSCD("CALL",INDEX,CVALUE,CALL)) Q:CALL<1 X ACTION
Q
;
PR ;
N IEN
D VALUE(VALUE)
S CODE=$P(CODE,",",2)
I (LIST=1)!(LIST=0) D Q
.S NODE=+$P(CODE,";"),PIECE=$P(CODE,";",2)
.S CALL=0 F S CALL=$O(^TMP("FSC USELIST",$J,CALL)) Q:CALL<1 D
..S IEN=+$G(^FSCD("CALL USER","AUC",DUZ,CALL)) I 'IEN Q
..S CVALUE=$P($G(^FSCD("CALL USER",IEN,NODE)),U,PIECE) I $L(CVALUE),CVALUE'<VALUE1,CVALUE'>VALUE2 X ACTION
S NODE=+$P(CODE,";"),PIECE=$P(CODE,";",2)
S CALL=0 F S CALL=$O(^FSCD("CALL USER","AUC",DUZ,CALL)) Q:CALL<1 D
.S IEN=+$G(^FSCD("CALL USER","AUC",DUZ,CALL)) I 'IEN Q
.S CVALUE=$P($G(^FSCD("CALL USER",IEN,NODE)),U,PIECE) I $L(CVALUE),CVALUE'<VALUE1,CVALUE'>VALUE2 X ACTION
Q
PNR ;
N IEN
D VALUE(VALUE)
S CODE=$P(CODE,",",2)
I (LIST=1)!(LIST=0) D Q
.S NODE=+$P(CODE,";"),PIECE=$P(CODE,";",2)
.S CALL=0 F S CALL=$O(^TMP("FSC USELIST",$J,CALL)) Q:CALL<1 D
..S IEN=+$G(^FSCD("CALL USER","AUC",DUZ,CALL)) I 'IEN Q
..S CVALUE=$P($G(^FSCD("CALL USER",IEN,NODE)),U,PIECE) I $L(CVALUE),CVALUE<VALUE1!(CVALUE>VALUE2) X ACTION
S NODE=+$P(CODE,";"),PIECE=$P(CODE,";",2)
S CALL=0 F S CALL=$O(^FSCD("CALL USER","AUC",DUZ,CALL)) Q:CALL<1 D
.S IEN=+$G(^FSCD("CALL USER","AUC",DUZ,CALL)) I 'IEN Q
.S CVALUE=$P($G(^FSCD("CALL USER",IEN,NODE)),U,PIECE) I $L(CVALUE),CVALUE<VALUE1!(CVALUE>VALUE2) X ACTION
Q
;
VALUE(VALUE) S VALUE1=$P(VALUE,"-"),VALUE2=$P(VALUE,"-",2)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCQSR 3590 printed Dec 13, 2024@02:19:05 Page 2
FSCQSR ;SLC/STAFF-NOIS Query Search Range ;8/8/98 21:34
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
R ; from FSCQS
+1 IF CODE["7100.6"
DO PR
QUIT
+2 DO VALUE(VALUE)
+3 IF LIST=1
Begin DoDot:1
+4 SET NODE=+$PIECE(CODE,";")
SET PIECE=$PIECE(CODE,";",2)
+5 SET CALL=0
FOR
SET CALL=$ORDER(^TMP("FSC USELIST",$JOB,CALL))
if CALL<1
QUIT
Begin DoDot:2
+6 SET CVALUE=$PIECE($GET(^FSCD("CALL",CALL,NODE)),U,PIECE)
IF $LENGTH(CVALUE)
IF CVALUE'<VALUE1
IF CVALUE'>VALUE2
XECUTE ACTION
End DoDot:2
End DoDot:1
QUIT
+7 IF '$LENGTH(INDEX)
Begin DoDot:1
+8 SET NODE=+$PIECE(CODE,";")
SET PIECE=$PIECE(CODE,";",2)
+9 SET CALL=0
FOR
SET CALL=$ORDER(^FSCD("CALL",CALL))
if CALL<1
QUIT
Begin DoDot:2
+10 SET CVALUE=$PIECE($GET(^FSCD("CALL",CALL,NODE)),U,PIECE)
IF $LENGTH(CVALUE)
IF CVALUE'<VALUE1
IF CVALUE'>VALUE2
XECUTE ACTION
End DoDot:2
End DoDot:1
QUIT
+11 IF LIST=0
Begin DoDot:1
+12 SET CALL=0
FOR
SET CALL=$ORDER(^FSCD("CALL",INDEX,VALUE1,CALL))
if CALL<1
QUIT
Begin DoDot:2
+13 IF $DATA(^TMP("FSC USELIST",$JOB,CALL))
XECUTE ACTION
End DoDot:2
+14 SET CVALUE=VALUE1
FOR
SET CVALUE=$ORDER(^FSCD("CALL",INDEX,CVALUE))
if CVALUE=""
QUIT
if CVALUE>VALUE2
QUIT
Begin DoDot:2
+15 SET CALL=0
FOR
SET CALL=$ORDER(^FSCD("CALL",INDEX,CVALUE,CALL))
if CALL<1
QUIT
Begin DoDot:3
+16 IF $DATA(^TMP("FSC USELIST",$JOB,CALL))
XECUTE ACTION
End DoDot:3
End DoDot:2
End DoDot:1
QUIT
+17 IF LIST=""
Begin DoDot:1
+18 SET CALL=0
FOR
SET CALL=$ORDER(^FSCD("CALL",INDEX,VALUE1,CALL))
if CALL<1
QUIT
XECUTE ACTION
+19 SET CVALUE=VALUE1
FOR
SET CVALUE=$ORDER(^FSCD("CALL",INDEX,CVALUE))
if CVALUE=""
QUIT
if CVALUE>VALUE2
QUIT
Begin DoDot:2
+20 SET CALL=0
FOR
SET CALL=$ORDER(^FSCD("CALL",INDEX,CVALUE,CALL))
if CALL<1
QUIT
XECUTE ACTION
End DoDot:2
End DoDot:1
QUIT
+21 QUIT
NR ; from FSCQS
+1 IF CODE["7100.6"
DO PNR
QUIT
+2 DO VALUE(VALUE)
+3 IF LIST=1
Begin DoDot:1
+4 SET NODE=+$PIECE(CODE,";")
SET PIECE=$PIECE(CODE,";",2)
+5 SET CALL=0
FOR
SET CALL=$ORDER(^TMP("FSC USELIST",$JOB,CALL))
if CALL<1
QUIT
Begin DoDot:2
+6 SET CVALUE=$PIECE($GET(^FSCD("CALL",CALL,NODE)),U,PIECE)
IF $LENGTH(CVALUE)
IF CVALUE<VALUE1!(CVALUE>VALUE2)
XECUTE ACTION
End DoDot:2
End DoDot:1
QUIT
+7 IF '$LENGTH(INDEX)
Begin DoDot:1
+8 SET NODE=+$PIECE(CODE,";")
SET PIECE=$PIECE(CODE,";",2)
+9 SET CALL=0
FOR
SET CALL=$ORDER(^FSCD("CALL",CALL))
if CALL<1
QUIT
Begin DoDot:2
+10 SET CVALUE=$PIECE($GET(^FSCD("CALL",CALL,NODE)),U,PIECE)
IF $LENGTH(CVALUE)
IF CVALUE<VALUE1!(CVALUE>VALUE2)
XECUTE ACTION
End DoDot:2
End DoDot:1
QUIT
+11 IF LIST=0
Begin DoDot:1
+12 SET CVALUE=""
FOR
SET CVALUE=$ORDER(^FSCD("CALL",INDEX,CVALUE))
if CVALUE=""
QUIT
Begin DoDot:2
+13 IF CVALUE'<VALUE1
IF CVALUE'>VALUE2
SET CVALUE=VALUE2
QUIT
+14 SET CALL=0
FOR
SET CALL=$ORDER(^FSCD("CALL",INDEX,CVALUE,CALL))
if CALL<1
QUIT
Begin DoDot:3
+15 IF $DATA(^TMP("FSC USELIST",$JOB,CALL))
XECUTE ACTION
End DoDot:3
End DoDot:2
End DoDot:1
QUIT
+16 IF LIST=""
Begin DoDot:1
+17 SET CVALUE=""
FOR
SET CVALUE=$ORDER(^FSCD("CALL",INDEX,CVALUE))
if CVALUE=""
QUIT
Begin DoDot:2
+18 IF CVALUE'<VALUE1
IF CVALUE'>VALUE2
SET CVALUE=VALUE2
QUIT
+19 SET CALL=0
FOR
SET CALL=$ORDER(^FSCD("CALL",INDEX,CVALUE,CALL))
if CALL<1
QUIT
XECUTE ACTION
End DoDot:2
End DoDot:1
QUIT
+20 QUIT
+21 ;
PR ;
+1 NEW IEN
+2 DO VALUE(VALUE)
+3 SET CODE=$PIECE(CODE,",",2)
+4 IF (LIST=1)!(LIST=0)
Begin DoDot:1
+5 SET NODE=+$PIECE(CODE,";")
SET PIECE=$PIECE(CODE,";",2)
+6 SET CALL=0
FOR
SET CALL=$ORDER(^TMP("FSC USELIST",$JOB,CALL))
if CALL<1
QUIT
Begin DoDot:2
+7 SET IEN=+$GET(^FSCD("CALL USER","AUC",DUZ,CALL))
IF 'IEN
QUIT
+8 SET CVALUE=$PIECE($GET(^FSCD("CALL USER",IEN,NODE)),U,PIECE)
IF $LENGTH(CVALUE)
IF CVALUE'<VALUE1
IF CVALUE'>VALUE2
XECUTE ACTION
End DoDot:2
End DoDot:1
QUIT
+9 SET NODE=+$PIECE(CODE,";")
SET PIECE=$PIECE(CODE,";",2)
+10 SET CALL=0
FOR
SET CALL=$ORDER(^FSCD("CALL USER","AUC",DUZ,CALL))
if CALL<1
QUIT
Begin DoDot:1
+11 SET IEN=+$GET(^FSCD("CALL USER","AUC",DUZ,CALL))
IF 'IEN
QUIT
+12 SET CVALUE=$PIECE($GET(^FSCD("CALL USER",IEN,NODE)),U,PIECE)
IF $LENGTH(CVALUE)
IF CVALUE'<VALUE1
IF CVALUE'>VALUE2
XECUTE ACTION
End DoDot:1
+13 QUIT
PNR ;
+1 NEW IEN
+2 DO VALUE(VALUE)
+3 SET CODE=$PIECE(CODE,",",2)
+4 IF (LIST=1)!(LIST=0)
Begin DoDot:1
+5 SET NODE=+$PIECE(CODE,";")
SET PIECE=$PIECE(CODE,";",2)
+6 SET CALL=0
FOR
SET CALL=$ORDER(^TMP("FSC USELIST",$JOB,CALL))
if CALL<1
QUIT
Begin DoDot:2
+7 SET IEN=+$GET(^FSCD("CALL USER","AUC",DUZ,CALL))
IF 'IEN
QUIT
+8 SET CVALUE=$PIECE($GET(^FSCD("CALL USER",IEN,NODE)),U,PIECE)
IF $LENGTH(CVALUE)
IF CVALUE<VALUE1!(CVALUE>VALUE2)
XECUTE ACTION
End DoDot:2
End DoDot:1
QUIT
+9 SET NODE=+$PIECE(CODE,";")
SET PIECE=$PIECE(CODE,";",2)
+10 SET CALL=0
FOR
SET CALL=$ORDER(^FSCD("CALL USER","AUC",DUZ,CALL))
if CALL<1
QUIT
Begin DoDot:1
+11 SET IEN=+$GET(^FSCD("CALL USER","AUC",DUZ,CALL))
IF 'IEN
QUIT
+12 SET CVALUE=$PIECE($GET(^FSCD("CALL USER",IEN,NODE)),U,PIECE)
IF $LENGTH(CVALUE)
IF CVALUE<VALUE1!(CVALUE>VALUE2)
XECUTE ACTION
End DoDot:1
+13 QUIT
+14 ;
VALUE(VALUE) SET VALUE1=$PIECE(VALUE,"-")
SET VALUE2=$PIECE(VALUE,"-",2)
+1 QUIT