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

FSCGETQ.m

Go to the documentation of this file.
FSCGETQ ;SLC/STAFF-NOIS Get Query ;4/22/94  10:53
 ;;1.1;NOIS;;Sep 06, 1998
 ;
QUERY(DEFNUM,ARRAY) ; from FSCLMM
 N EXT,SEQ,DEF,NUM,OP,FIELD,COND,VALUE K ARRAY
 S SEQ=0 F  S SEQ=$O(^FSC("LIST",DEFNUM,1,SEQ)) Q:SEQ<1  S DEF=$G(^(SEQ,0)) D
 .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)
 .S ARRAY(SEQ,"NUM")=NUM
 .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:"
 .S EXT=$S(EXT="A":"and",EXT="O":"or",1:""),ARRAY(SEQ,"EXT")=$S($L(EXT):EXT,1:"")
 .S ARRAY(SEQ,"FIELD")=$$VALUE^FSCGET(FIELD,7107.11,3)
 .S ARRAY(SEQ,"COND")=$$VALUE^FSCGET(COND,7107.11,4)
 .S ARRAY(SEQ,"VALUE")=$$NONDDV^FSCDD(VALUE,FIELD)
 Q
 ;
FORM(DEFNUM,ARRAY,LINECNT) ; from FSCLMM
 S LINECNT=+$G(LINECNT)
 N FORMAT,LINE,SEQ
 S SEQ=0 F  S SEQ=$O(QUERY(SEQ)) Q:SEQ<1  D
 .I (SEQ#10)=0,'$G(FSCDEV) W "."
 .D SETTEXT^FSCFORM(1,SEQ,1,SEQ)
 .D SETTEXT^FSCFORM(1,SEQ,7,QUERY(SEQ,"OP"))
 .D SETTEXT^FSCFORM(1,SEQ,15,QUERY(SEQ,"EXT"))
 .D SETTEXT^FSCFORM(1,SEQ,25,QUERY(SEQ,"FIELD"))
 .D SETTEXT^FSCFORM(1,SEQ,38,QUERY(SEQ,"COND"))
 .D SETTEXT^FSCFORM(1,SEQ,45,QUERY(SEQ,"VALUE"))
 S LINE=0 F  S LINE=$O(FORMAT(1,LINE)) Q:LINE<1  D
 .S VALMCNT=VALMCNT+1
 .S ^TMP("FSC MODIFY LISTS",$J,VALMCNT,0)=FORMAT(1,LINE)
 .S ^TMP("FSC MODIFY LISTS",$J,"IDX",+FORMAT(1,LINE),VALMCNT)=""
 S ^TMP("FSC MODIFY LISTS",$J)=+$G(FORMAT(1,+$O(FORMAT(1,"A"),-1)))
 Q