source: WorldVistAEHR/trunk/r/NOIS-FSC/FSCQS.m@ 1259

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

initial load of WorldVistAEHR

File size: 1.6 KB
Line 
1FSCQS ;SLC/STAFF-NOIS Query Search ;5/25/98 19:00
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4SEARCH(LISTCNT,CRITERIA) ; from FSCQR
5 S LIST=$$LIST(LISTCNT)
6 I '$D(CRITERIA("O")) D OPTIMIZE^FSCQO(.CRITERIA)
7 K ^TMP("FSC NEWLIST",$J) N ACTION,CVALUE,FCOND,QUERY,STEP
8 I $P(CRITERIA(0),U,2)=1 D Q
9 .S STEP=$O(CRITERIA(0))
10 .I CRITERIA(STEP)=1 D Q
11 ..S ACTION="S ^TMP(""FSC NEWLIST"",$J,CALL)="""""
12 ..S QUERY=CRITERIA(STEP,+$O(CRITERIA(STEP,0)))
13 ..D CHECK(LIST,$P(QUERY,U),$P(QUERY,U,2),$P(QUERY,U,3))
14 .S ACTION="D MULT^FSCQSM(CALL)"
15 .D SETUP^FSCQSS
16 .D CHECK(LIST,$P(QUERY,U),$P(QUERY,U,2),$P(QUERY,U,3))
17 S ACTION="D MMULT^FSCQSM(CALL)"
18 D SETUP^FSCQSSM
19 D ALL^FSCQSA
20 Q
21CHECK(LIST,FIELD,COND,VALUE) ; *** needs to handle special code, word processing
22 N TYPE,INDEX,CODE
23 S TYPE=$P(CRITERIA("F",FIELD),U),CODE=$P(CRITERIA("F",FIELD),U,2),INDEX=$P(CRITERIA("F",FIELD),U,3)
24 ;I CODE["7100.6," Q ;**** fix for personal field search
25 I TYPE="W" D Q
26 .I COND="[" D CON^FSCQSW Q
27 .I COND="exists" D EX^FSCQSW Q
28 .I COND="'[" D NCON^FSCQSW Q
29 .I COND="not exists" D NEX^FSCQSW Q
30 I '$L(INDEX) D Q
31 .I COND="exists" D EX^FSCQSN Q
32 .I COND="not exists" D NEX^FSCQSN Q
33 .I COND="range" D R^FSCQSR Q
34 .I COND="not range" D NR^FSCQSR Q
35 .D OTHER^FSCQSN Q
36 I COND="=" D EQ^FSCQSE Q
37 I COND=">" D GT^FSCQSG Q
38 I COND="<" D LT^FSCQSL Q
39 I COND="[" D CON^FSCQSC Q
40 I COND="exists" D EX^FSCQSX Q
41 I COND="range" D R^FSCQSR Q
42 I COND="'=" D NEQ^FSCQSE Q
43 I COND="'>" D NGT^FSCQSG Q
44 I COND="'<" D NLT^FSCQSL Q
45 I COND="'[" D NCON^FSCQSC Q
46 I COND="not exists" D NEX^FSCQSX Q
47 I COND="not range" D NR^FSCQSR Q
48 Q
49 ;
50LIST(CNT) ; $$(list count) -> "" if 0, 0 if count is >1000, else 1
51 Q $S(CNT=0:"",CNT>1000:0,1:1)
Note: See TracBrowser for help on using the repository browser.