FSCLMPME ;SLC/STAFF-NOIS List Manager Protocol Modify Edit ;4/22/94 11:04
;;1.1;NOIS;;Sep 06, 1998
;
GETDEF(LIST,ARRAY) ; from FSCLMPM
; returns array of list definition
N CNT,LINE
S (CNT,LINE)=0 F S LINE=$O(^FSC("LIST",LIST,1,LINE)) Q:LINE<1 S CNT=CNT+1,ARRAY(CNT)=^(LINE,0)
Q
;
EDIT(LINE,OPER,OK) ; from FSCLMPM
N COND,EXT,FIELD,VALUE
S (EXT,FIELD,COND,VALUE)="",OK=0
I $L(OPER) W !,OPER," using:"
I '$L(OPER) D OPER(.OPER) I '$L(OPER)!$D(DUOUT)!$D(DTOUT) Q
I OPER="and"!(OPER="or") S EXT=$S(OPER="and":"A",1:"O"),OPER=""
S OPER=$E(OPER)
D FIELD^FSCQCA I 'FIELD!$D(DUOUT)!$D(DTOUT) Q
D COND^FSCQCA($P(FIELD,U,4)) I 'COND!$D(DUOUT)!$D(DTOUT) Q
D VALUE^FSCQCAV(COND,$P(FIELD,U,4)) I $D(DUOUT)!$D(DTOUT) Q
S FIELD=+FIELD,COND=+COND,VALUE=$P(VALUE,U)
S LINE=OPER_U_EXT_U_FIELD_U_COND_U_VALUE
S OK=1
Q
;
OPER(OPER) ;
N DIR,X,Y K DIR
S DIR(0)="SAMO^ADD:ADD;REMOVE:REMOVE;SELECT:SELECT;AND:AND;OR:OR"
S DIR("A")="Select (ADD), (R)emove, (S)elect, (AND), (O)r, else (return): "
S DIR("?",1)="You are putting a new line into the query definition."
S DIR("?",2)="Your entry should be consistent with the preceding and following entries."
S DIR("?",3)="Enter ADD, REMOVE, or SELECT to begin a query statement."
S DIR("?",4)="Enter AND or OR to continue a query statement."
S DIR("?",5)="Enter 'return' to stop editing the query."
S DIR("?")="^D HELP^FSCU(.DIR)"
S DIR("??")="FSC U1 NOIS"
D ^DIR K DIR
S OPER=$S(Y="ADD":"Add",Y="REMOVE":"Remove",Y="SELECT":"Select",Y="AND":"and",Y="OR":"or",1:"")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCLMPME 1565 printed Oct 16, 2024@18:18:55 Page 2
FSCLMPME ;SLC/STAFF-NOIS List Manager Protocol Modify Edit ;4/22/94 11:04
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
GETDEF(LIST,ARRAY) ; from FSCLMPM
+1 ; returns array of list definition
+2 NEW CNT,LINE
+3 SET (CNT,LINE)=0
FOR
SET LINE=$ORDER(^FSC("LIST",LIST,1,LINE))
if LINE<1
QUIT
SET CNT=CNT+1
SET ARRAY(CNT)=^(LINE,0)
+4 QUIT
+5 ;
EDIT(LINE,OPER,OK) ; from FSCLMPM
+1 NEW COND,EXT,FIELD,VALUE
+2 SET (EXT,FIELD,COND,VALUE)=""
SET OK=0
+3 IF $LENGTH(OPER)
WRITE !,OPER," using:"
+4 IF '$LENGTH(OPER)
DO OPER(.OPER)
IF '$LENGTH(OPER)!$DATA(DUOUT)!$DATA(DTOUT)
QUIT
+5 IF OPER="and"!(OPER="or")
SET EXT=$SELECT(OPER="and":"A",1:"O")
SET OPER=""
+6 SET OPER=$EXTRACT(OPER)
+7 DO FIELD^FSCQCA
IF 'FIELD!$DATA(DUOUT)!$DATA(DTOUT)
QUIT
+8 DO COND^FSCQCA($PIECE(FIELD,U,4))
IF 'COND!$DATA(DUOUT)!$DATA(DTOUT)
QUIT
+9 DO VALUE^FSCQCAV(COND,$PIECE(FIELD,U,4))
IF $DATA(DUOUT)!$DATA(DTOUT)
QUIT
+10 SET FIELD=+FIELD
SET COND=+COND
SET VALUE=$PIECE(VALUE,U)
+11 SET LINE=OPER_U_EXT_U_FIELD_U_COND_U_VALUE
+12 SET OK=1
+13 QUIT
+14 ;
OPER(OPER) ;
+1 NEW DIR,X,Y
KILL DIR
+2 SET DIR(0)="SAMO^ADD:ADD;REMOVE:REMOVE;SELECT:SELECT;AND:AND;OR:OR"
+3 SET DIR("A")="Select (ADD), (R)emove, (S)elect, (AND), (O)r, else (return): "
+4 SET DIR("?",1)="You are putting a new line into the query definition."
+5 SET DIR("?",2)="Your entry should be consistent with the preceding and following entries."
+6 SET DIR("?",3)="Enter ADD, REMOVE, or SELECT to begin a query statement."
+7 SET DIR("?",4)="Enter AND or OR to continue a query statement."
+8 SET DIR("?",5)="Enter 'return' to stop editing the query."
+9 SET DIR("?")="^D HELP^FSCU(.DIR)"
+10 SET DIR("??")="FSC U1 NOIS"
+11 DO ^DIR
KILL DIR
+12 SET OPER=$SELECT(Y="ADD":"Add",Y="REMOVE":"Remove",Y="SELECT":"Select",Y="AND":"and",Y="OR":"or",1:"")
+13 QUIT