source: WorldVistAEHR/trunk/r/NOIS-FSC/FSCQB.m@ 1714

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

initial load of WorldVistAEHR

File size: 2.4 KB
RevLine 
[613]1FSCQB ;SLC/STAFF-NOIS Query Browse ;1/19/98 11:26
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4BROWSE(LIST,LISTNAME,LISTCNT,MSG,PREOP,LISTDEF) ; from FSCLD, FSCLMPO, FSCLMPQQ, FSCLMPQU, FSCOPT
5 N ANDOR,CNT,DESC,DESCNT,DONE,DTOUT,DUOUT,FINISH,OPER,LDCNT
6 S LDCNT=0
7 S DEFINE=$S($D(LISTDEF):1,1:0)
8 S FINISH=$S(DEFINE:"Define",1:"List")
9 S DESCNT=0,DESC(DESCNT)="List: "_LISTNAME
10 S DONE=0 F Q:DONE D
11 .N CRITERIA
12 .I 'DEFINE,$G(PREOP)'=FINISH W !!,"Currently, "_LISTCNT_" calls are in this list."
13 .I $G(PREOP)'=FINISH S CNT="" F S CNT=$O(DESC(CNT)) Q:CNT="" D
14 ..W !,DESC(CNT)
15 .I '$L($G(PREOP)) D OPER^FSCQCA
16 .I $L($G(PREOP)) W:PREOP'=FINISH !?4,PREOP," where:" S OPER=PREOP,PREOP=FINISH
17 .I $D(DUOUT) S MSG="EXIT",DONE=1 Q
18 .I $D(DTOUT) S MSG="TIMEOUT",DONE=1 Q
19 .I OPER="List" S DONE=1 Q
20 .I OPER="Define" S DONE=1 Q
21 .I DEFINE S LISTCNT=1,PREOP=""
22 .S CRITERIA(0)=OPER_"^^0"
23 .D CRITERIA
24 .I MSG="EXIT" S MSG=1 W !,"No Action Taken",! Q
25 .I MSG="TIMEOUT" S DONE=1 W !,"No Action Taken",! Q
26 .D DESC^FSCQD(.DESCNT,.CRITERIA)
27 .I 'DEFINE D QUERY^FSCQR(.LIST,.LISTCNT,.CRITERIA) K ^TMP("FSC NEWLIST",$J),^TMP("FSC USELIST",$J)
28 I DEFINE M @LISTDEF@("DESC")=DESC
29 Q
30 ;
31CRITERIA ;
32 N COND,DONE,FIELD,FIELDCNT,FPASS,NAME,PAREN,PREVF,PREVS,REASK,STEP,TYPE,VALUE
33 S (DONE,FIELDCNT,PREVS,PREVF,REASK,STEP)=0,FPASS=1,PAREN="closed",ANDOR=""
34 F Q:DONE D
35 .I 'FPASS D
36 ..I MSG="REASK" D
37 ...W !!?12,"*** You have entered a criteria that is not complete. ***",$C(7)
38 ...W !,"The partial entry was: ",ANDOR," ",$P(FIELD,U,2)," ",$P(COND,U,5)," ",$P(VALUE,U,2)
39 ...I '$D(CRITERIA(1)) S MSG="EXIT" W !,"Reenter criteria" Q
40 ...D CRITERIA^FSCQD(.CRITERIA)
41 ...W !,"Continue editing from this criteria.",!
42 ..I MSG="EXIT" S MSG=1 Q
43 ..I MSG'="REASK" D STORE^FSCQCS S (FIELD,COND,VALUE)=""
44 ..S MSG=1
45 ..D ANDOR^FSCQCA W !
46 ..I $D(DTOUT) S MSG="TIMEOUT",DONE=1 Q
47 ..I $D(DUOUT) S MSG="EXIT",DONE=1
48 ..I ANDOR="" S DONE=1
49 ..I DONE,PAREN="open" S CRITERIA(STEP,FIELDCNT,0)=CRITERIA(STEP,FIELDCNT,0)_")"
50 .I DONE Q
51 .I '$L(ANDOR) S FPASS=1
52 .W !
53 .S (FIELD,COND,VALUE)=""
54 .D FIELD^FSCQCA,CHECK Q:DONE Q:MSG="REASK"
55 .S FPASS=0
56 .D COND^FSCQCA($P(FIELD,U,4)),CHECK Q:DONE Q:MSG="REASK"
57 .D VALUE^FSCQCAV(COND,$P(FIELD,U,4)),CHECK Q:DONE Q:MSG="REASK"
58 .S FPASS=0
59 Q
60 ;
61CHECK I $D(DTOUT) S MSG="TIMEOUT",DONE=1 Q
62 I Y="^^"!(FPASS&(Y=""!$D(DUOUT))) S MSG="EXIT",DONE=1 Q
63 I 'FPASS,Y=""!$D(DUOUT) S MSG="REASK" Q
64 S MSG=$G(MSG,1)
65 Q
Note: See TracBrowser for help on using the repository browser.