Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: FSCQSR

FSCQSR.m

Go to the documentation of this file.
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