1 | FSCGETQ ;SLC/STAFF-NOIS Get Query ;4/22/94 10:53
|
---|
2 | ;;1.1;NOIS;;Sep 06, 1998
|
---|
3 | ;
|
---|
4 | QUERY(DEFNUM,ARRAY) ; from FSCLMM
|
---|
5 | N EXT,SEQ,DEF,NUM,OP,FIELD,COND,VALUE K ARRAY
|
---|
6 | S SEQ=0 F S SEQ=$O(^FSC("LIST",DEFNUM,1,SEQ)) Q:SEQ<1 S DEF=$G(^(SEQ,0)) D
|
---|
7 | .S NUM=$P(DEF,U),OP=$P(DEF,U,2),EXT=$P(DEF,U,3),FIELD=$P(DEF,U,4),COND=$P(DEF,U,5),VALUE=$P(DEF,U,6)
|
---|
8 | .S ARRAY(SEQ,"NUM")=NUM
|
---|
9 | .S ARRAY(SEQ,"OP")=$S(OP="A":"Add",OP="R":"Remove",OP="S":"Select",1:"") I $L(ARRAY(SEQ,"OP")) S ARRAY(SEQ,"OP")=ARRAY(SEQ,"OP")_" where:"
|
---|
10 | .S EXT=$S(EXT="A":"and",EXT="O":"or",1:""),ARRAY(SEQ,"EXT")=$S($L(EXT):EXT,1:"")
|
---|
11 | .S ARRAY(SEQ,"FIELD")=$$VALUE^FSCGET(FIELD,7107.11,3)
|
---|
12 | .S ARRAY(SEQ,"COND")=$$VALUE^FSCGET(COND,7107.11,4)
|
---|
13 | .S ARRAY(SEQ,"VALUE")=$$NONDDV^FSCDD(VALUE,FIELD)
|
---|
14 | Q
|
---|
15 | ;
|
---|
16 | FORM(DEFNUM,ARRAY,LINECNT) ; from FSCLMM
|
---|
17 | S LINECNT=+$G(LINECNT)
|
---|
18 | N FORMAT,LINE,SEQ
|
---|
19 | S SEQ=0 F S SEQ=$O(QUERY(SEQ)) Q:SEQ<1 D
|
---|
20 | .I (SEQ#10)=0,'$G(FSCDEV) W "."
|
---|
21 | .D SETTEXT^FSCFORM(1,SEQ,1,SEQ)
|
---|
22 | .D SETTEXT^FSCFORM(1,SEQ,7,QUERY(SEQ,"OP"))
|
---|
23 | .D SETTEXT^FSCFORM(1,SEQ,15,QUERY(SEQ,"EXT"))
|
---|
24 | .D SETTEXT^FSCFORM(1,SEQ,25,QUERY(SEQ,"FIELD"))
|
---|
25 | .D SETTEXT^FSCFORM(1,SEQ,38,QUERY(SEQ,"COND"))
|
---|
26 | .D SETTEXT^FSCFORM(1,SEQ,45,QUERY(SEQ,"VALUE"))
|
---|
27 | S LINE=0 F S LINE=$O(FORMAT(1,LINE)) Q:LINE<1 D
|
---|
28 | .S VALMCNT=VALMCNT+1
|
---|
29 | .S ^TMP("FSC MODIFY LISTS",$J,VALMCNT,0)=FORMAT(1,LINE)
|
---|
30 | .S ^TMP("FSC MODIFY LISTS",$J,"IDX",+FORMAT(1,LINE),VALMCNT)=""
|
---|
31 | S ^TMP("FSC MODIFY LISTS",$J)=+$G(FORMAT(1,+$O(FORMAT(1,"A"),-1)))
|
---|
32 | Q
|
---|