source: FOIAVistA/trunk/r/NOIS-FSC/FSCQSR.m@ 1791

Last change on this file since 1791 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 3.4 KB
Line 
1FSCQSR ;SLC/STAFF-NOIS Query Search Range ;8/8/98 21:34
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4R ; from FSCQS
5 I CODE["7100.6" D PR Q
6 D VALUE(VALUE)
7 I LIST=1 D Q
8 .S NODE=+$P(CODE,";"),PIECE=$P(CODE,";",2)
9 .S CALL=0 F S CALL=$O(^TMP("FSC USELIST",$J,CALL)) Q:CALL<1 D
10 ..S CVALUE=$P($G(^FSCD("CALL",CALL,NODE)),U,PIECE) I $L(CVALUE),CVALUE'<VALUE1,CVALUE'>VALUE2 X ACTION
11 I '$L(INDEX) D Q
12 .S NODE=+$P(CODE,";"),PIECE=$P(CODE,";",2)
13 .S CALL=0 F S CALL=$O(^FSCD("CALL",CALL)) Q:CALL<1 D
14 ..S CVALUE=$P($G(^FSCD("CALL",CALL,NODE)),U,PIECE) I $L(CVALUE),CVALUE'<VALUE1,CVALUE'>VALUE2 X ACTION
15 I LIST=0 D Q
16 .S CALL=0 F S CALL=$O(^FSCD("CALL",INDEX,VALUE1,CALL)) Q:CALL<1 D
17 ..I $D(^TMP("FSC USELIST",$J,CALL)) X ACTION
18 .S CVALUE=VALUE1 F S CVALUE=$O(^FSCD("CALL",INDEX,CVALUE)) Q:CVALUE="" Q:CVALUE>VALUE2 D
19 ..S CALL=0 F S CALL=$O(^FSCD("CALL",INDEX,CVALUE,CALL)) Q:CALL<1 D
20 ...I $D(^TMP("FSC USELIST",$J,CALL)) X ACTION
21 I LIST="" D Q
22 .S CALL=0 F S CALL=$O(^FSCD("CALL",INDEX,VALUE1,CALL)) Q:CALL<1 X ACTION
23 .S CVALUE=VALUE1 F S CVALUE=$O(^FSCD("CALL",INDEX,CVALUE)) Q:CVALUE="" Q:CVALUE>VALUE2 D
24 ..S CALL=0 F S CALL=$O(^FSCD("CALL",INDEX,CVALUE,CALL)) Q:CALL<1 X ACTION
25 Q
26NR ; from FSCQS
27 I CODE["7100.6" D PNR Q
28 D VALUE(VALUE)
29 I LIST=1 D Q
30 .S NODE=+$P(CODE,";"),PIECE=$P(CODE,";",2)
31 .S CALL=0 F S CALL=$O(^TMP("FSC USELIST",$J,CALL)) Q:CALL<1 D
32 ..S CVALUE=$P($G(^FSCD("CALL",CALL,NODE)),U,PIECE) I $L(CVALUE),CVALUE<VALUE1!(CVALUE>VALUE2) X ACTION
33 I '$L(INDEX) D Q
34 .S NODE=+$P(CODE,";"),PIECE=$P(CODE,";",2)
35 .S CALL=0 F S CALL=$O(^FSCD("CALL",CALL)) Q:CALL<1 D
36 ..S CVALUE=$P($G(^FSCD("CALL",CALL,NODE)),U,PIECE) I $L(CVALUE),CVALUE<VALUE1!(CVALUE>VALUE2) X ACTION
37 I LIST=0 D Q
38 .S CVALUE="" F S CVALUE=$O(^FSCD("CALL",INDEX,CVALUE)) Q:CVALUE="" D
39 ..I CVALUE'<VALUE1,CVALUE'>VALUE2 S CVALUE=VALUE2 Q
40 ..S CALL=0 F S CALL=$O(^FSCD("CALL",INDEX,CVALUE,CALL)) Q:CALL<1 D
41 ...I $D(^TMP("FSC USELIST",$J,CALL)) X ACTION
42 I LIST="" D Q
43 .S CVALUE="" F S CVALUE=$O(^FSCD("CALL",INDEX,CVALUE)) Q:CVALUE="" D
44 ..I CVALUE'<VALUE1,CVALUE'>VALUE2 S CVALUE=VALUE2 Q
45 ..S CALL=0 F S CALL=$O(^FSCD("CALL",INDEX,CVALUE,CALL)) Q:CALL<1 X ACTION
46 Q
47 ;
48PR ;
49 N IEN
50 D VALUE(VALUE)
51 S CODE=$P(CODE,",",2)
52 I (LIST=1)!(LIST=0) D Q
53 .S NODE=+$P(CODE,";"),PIECE=$P(CODE,";",2)
54 .S CALL=0 F S CALL=$O(^TMP("FSC USELIST",$J,CALL)) Q:CALL<1 D
55 ..S IEN=+$G(^FSCD("CALL USER","AUC",DUZ,CALL)) I 'IEN Q
56 ..S CVALUE=$P($G(^FSCD("CALL USER",IEN,NODE)),U,PIECE) I $L(CVALUE),CVALUE'<VALUE1,CVALUE'>VALUE2 X ACTION
57 S NODE=+$P(CODE,";"),PIECE=$P(CODE,";",2)
58 S CALL=0 F S CALL=$O(^FSCD("CALL USER","AUC",DUZ,CALL)) Q:CALL<1 D
59 .S IEN=+$G(^FSCD("CALL USER","AUC",DUZ,CALL)) I 'IEN Q
60 .S CVALUE=$P($G(^FSCD("CALL USER",IEN,NODE)),U,PIECE) I $L(CVALUE),CVALUE'<VALUE1,CVALUE'>VALUE2 X ACTION
61 Q
62PNR ;
63 N IEN
64 D VALUE(VALUE)
65 S CODE=$P(CODE,",",2)
66 I (LIST=1)!(LIST=0) D Q
67 .S NODE=+$P(CODE,";"),PIECE=$P(CODE,";",2)
68 .S CALL=0 F S CALL=$O(^TMP("FSC USELIST",$J,CALL)) Q:CALL<1 D
69 ..S IEN=+$G(^FSCD("CALL USER","AUC",DUZ,CALL)) I 'IEN Q
70 ..S CVALUE=$P($G(^FSCD("CALL USER",IEN,NODE)),U,PIECE) I $L(CVALUE),CVALUE<VALUE1!(CVALUE>VALUE2) X ACTION
71 S NODE=+$P(CODE,";"),PIECE=$P(CODE,";",2)
72 S CALL=0 F S CALL=$O(^FSCD("CALL USER","AUC",DUZ,CALL)) Q:CALL<1 D
73 .S IEN=+$G(^FSCD("CALL USER","AUC",DUZ,CALL)) I 'IEN Q
74 .S CVALUE=$P($G(^FSCD("CALL USER",IEN,NODE)),U,PIECE) I $L(CVALUE),CVALUE<VALUE1!(CVALUE>VALUE2) X ACTION
75 Q
76 ;
77VALUE(VALUE) S VALUE1=$P(VALUE,"-"),VALUE2=$P(VALUE,"-",2)
78 Q
Note: See TracBrowser for help on using the repository browser.