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

FSCQB.m

Go to the documentation of this file.
FSCQB ;SLC/STAFF-NOIS Query Browse ;1/19/98  11:26
 ;;1.1;NOIS;;Sep 06, 1998
 ;
BROWSE(LIST,LISTNAME,LISTCNT,MSG,PREOP,LISTDEF) ; from FSCLD, FSCLMPO, FSCLMPQQ, FSCLMPQU, FSCOPT
 N ANDOR,CNT,DESC,DESCNT,DONE,DTOUT,DUOUT,FINISH,OPER,LDCNT
 S LDCNT=0
 S DEFINE=$S($D(LISTDEF):1,1:0)
 S FINISH=$S(DEFINE:"Define",1:"List")
 S DESCNT=0,DESC(DESCNT)="List: "_LISTNAME
 S DONE=0 F  Q:DONE  D
 .N CRITERIA
 .I 'DEFINE,$G(PREOP)'=FINISH W !!,"Currently, "_LISTCNT_" calls are in this list."
 .I $G(PREOP)'=FINISH S CNT="" F  S CNT=$O(DESC(CNT)) Q:CNT=""  D
 ..W !,DESC(CNT)
 .I '$L($G(PREOP)) D OPER^FSCQCA
 .I $L($G(PREOP)) W:PREOP'=FINISH !?4,PREOP," where:" S OPER=PREOP,PREOP=FINISH
 .I $D(DUOUT) S MSG="EXIT",DONE=1 Q
 .I $D(DTOUT) S MSG="TIMEOUT",DONE=1 Q
 .I OPER="List" S DONE=1 Q
 .I OPER="Define" S DONE=1 Q
 .I DEFINE S LISTCNT=1,PREOP=""
 .S CRITERIA(0)=OPER_"^^0"
 .D CRITERIA
 .I MSG="EXIT" S MSG=1 W !,"No Action Taken",! Q
 .I MSG="TIMEOUT" S DONE=1 W !,"No Action Taken",! Q
 .D DESC^FSCQD(.DESCNT,.CRITERIA)
 .I 'DEFINE D QUERY^FSCQR(.LIST,.LISTCNT,.CRITERIA) K ^TMP("FSC NEWLIST",$J),^TMP("FSC USELIST",$J)
 I DEFINE M @LISTDEF@("DESC")=DESC
 Q
 ;
CRITERIA ;
 N COND,DONE,FIELD,FIELDCNT,FPASS,NAME,PAREN,PREVF,PREVS,REASK,STEP,TYPE,VALUE
 S (DONE,FIELDCNT,PREVS,PREVF,REASK,STEP)=0,FPASS=1,PAREN="closed",ANDOR=""
 F  Q:DONE  D
 .I 'FPASS D
 ..I MSG="REASK" D
 ...W !!?12,"*** You have entered a criteria that is not complete. ***",$C(7)
 ...W !,"The partial entry was: ",ANDOR," ",$P(FIELD,U,2)," ",$P(COND,U,5)," ",$P(VALUE,U,2)
 ...I '$D(CRITERIA(1)) S MSG="EXIT" W !,"Reenter criteria" Q
 ...D CRITERIA^FSCQD(.CRITERIA)
 ...W !,"Continue editing from this criteria.",!
 ..I MSG="EXIT" S MSG=1 Q
 ..I MSG'="REASK" D STORE^FSCQCS S (FIELD,COND,VALUE)=""
 ..S MSG=1
 ..D ANDOR^FSCQCA W !
 ..I $D(DTOUT) S MSG="TIMEOUT",DONE=1 Q
 ..I $D(DUOUT) S MSG="EXIT",DONE=1
 ..I ANDOR="" S DONE=1
 ..I DONE,PAREN="open" S CRITERIA(STEP,FIELDCNT,0)=CRITERIA(STEP,FIELDCNT,0)_")"
 .I DONE Q
 .I '$L(ANDOR) S FPASS=1
 .W !
 .S (FIELD,COND,VALUE)=""
 .D FIELD^FSCQCA,CHECK Q:DONE  Q:MSG="REASK"
 .S FPASS=0
 .D COND^FSCQCA($P(FIELD,U,4)),CHECK Q:DONE  Q:MSG="REASK"
 .D VALUE^FSCQCAV(COND,$P(FIELD,U,4)),CHECK Q:DONE  Q:MSG="REASK"
 .S FPASS=0
 Q
 ;
CHECK I $D(DTOUT) S MSG="TIMEOUT",DONE=1 Q
 I Y="^^"!(FPASS&(Y=""!$D(DUOUT))) S MSG="EXIT",DONE=1 Q
 I 'FPASS,Y=""!$D(DUOUT) S MSG="REASK" Q
 S MSG=$G(MSG,1)
 Q