source: WorldVistAEHR/trunk/r/NOIS-FSC/FSCLMPM.m@ 862

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

initial load of WorldVistAEHR

File size: 3.0 KB
RevLine 
[613]1FSCLMPM ;SLC/STAFF-NOIS List Manager Protocol Modify ;1/13/98 12:46
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4EDIT ; from FSCLMPE
5 N CHOICE,CNT,DEF,DESC,LINE,NEWDEF,NEWLINE,OK,PREOP,QDESC K DEF,DESC,NEWDEF,QDESC
6 W !,"Edit line:"
7 S CHOICE="1-"_+@VALMAR D SELECT^FSCUL(CHOICE,"S^Select line","","MVALUES",.OK)
8 I 'OK Q
9 S CHOICE=+$O(^TMP("FSC SELECT",$J,"MVALUES",0))
10 I $$ALL D REPLACE^FSCLDR(FSCLNAME,FSCLNUM) Q
11 D GETDEF^FSCLMPME(FSCLNUM,.DEF)
12 S PREOP="" I CHOICE=1 S PREOP="ADD"
13 W !,"Replace line ",^TMP("FSC MODIFY LISTS",$J,+$O(^TMP("FSC MODIFY LISTS",$J,"IDX",CHOICE,0)),0)
14 D EDIT^FSCLMPME(.NEWLINE,PREOP,.OK)
15 I 'OK Q
16 S CHOICE=+$O(^TMP("FSC SELECT",$J,"MVALUES",0)),(CNT,LINE)=0 F S LINE=$O(DEF(LINE)) Q:LINE<1 D
17 .S CNT=CNT+1 I CNT=CHOICE S NEWDEF(CNT)=CNT_U_NEWLINE Q
18 .S NEWDEF(CNT)=DEF(LINE),$P(NEWDEF(CNT),U)=CNT
19 D STUFF^FSCLMPMS
20 Q
21 ;
22INSERT ; from FSCLMPE
23 N CHOICE,CNT,DEF,LINE,NEWCNT,NEWDEF,NEWLINE,NEWLINES,OK,PREOP K DEF,NEWDEF,NEWLINES
24 W !,"Insert lines after:"
25 S CHOICE="0-"_+@VALMAR D SELECT^FSCUL(CHOICE,"S^Select line","","MVALUES",.OK)
26 I 'OK Q
27 S CHOICE=+$O(^TMP("FSC SELECT",$J,"MVALUES",0))
28 D GETDEF^FSCLMPME(FSCLNUM,.DEF)
29 S PREOP="" I CHOICE=0 S PREOP="ADD"
30 I CHOICE W !,"Insert after line ",^TMP("FSC MODIFY LISTS",$J,+$O(^TMP("FSC MODIFY LISTS",$J,"IDX",CHOICE,0)),0)
31 D ADD(CHOICE,PREOP,.DEF)
32 Q
33 ;
34ADD(CHOICE,PREOP,DEF) ; from FSCLDR
35 ; not scoped
36 S CNT=0 F D Q:'OK
37 .D EDIT^FSCLMPME(.NEWLINE,PREOP,.OK)
38 .I OK S CNT=CNT+1,NEWLINES(CNT)=NEWLINE,PREOP="" W !,"Next line:"
39 I '$O(NEWLINES(0)) Q
40 S CHOICE=+$O(^TMP("FSC SELECT",$J,"MVALUES",0)),CNT=0
41 I CHOICE=0 D
42 .S NEWCNT=0 F S NEWCNT=$O(NEWLINES(NEWCNT)) Q:NEWCNT<1 S NEWLINE=NEWLINES(NEWCNT) D
43 ..S CNT=CNT+1,NEWDEF(CNT)=CNT_U_NEWLINE
44 S LINE=0 F S LINE=$O(DEF(LINE)) Q:LINE<1 D
45 .S CNT=CNT+1,NEWDEF(CNT)=DEF(LINE),$P(NEWDEF(CNT),U)=CNT
46 .I CNT=CHOICE D
47 ..S NEWCNT=0 F S NEWCNT=$O(NEWLINES(NEWCNT)) Q:NEWCNT<1 S NEWLINE=NEWLINES(NEWCNT) D
48 ...S CNT=CNT+1,NEWDEF(CNT)=CNT_U_NEWLINE
49 D STUFF^FSCLMPMS
50 Q
51 ;
52DELETE ; from FSCLMPE
53 N CHOICE,CNT,DEF,LINE,OK,NEWDEF K DEF,NEWDEF
54 W !,"Delete lines:"
55 S CHOICE="1-"_+@VALMAR D SELECT^FSCUL(CHOICE,"^Select line(s)","","MVALUES",.OK)
56 I 'OK Q
57 I $$ALL D WARNING^FSCMU(FSCLNAME,.OK) D:OK DELETE^FSCLDR(FSCLNAME,FSCLNUM) Q
58 D GETDEF^FSCLMPME(FSCLNUM,.DEF)
59 I $O(^TMP("FSC SELECT",$J,"MVALUES",0))=1,$P($G(DEF(+$O(DEF(0)))),U,2)'="A" D Q
60 .W !,"You cannot delete these lines."
61 .W !,"The remaining query must begin with an 'Add' operation.",$C(7) H 2
62 S (CNT,LINE)=0 F S LINE=$O(DEF(LINE)) Q:LINE<1 D
63 .I $D(^TMP("FSC SELECT",$J,"MVALUES",LINE)) Q
64 .S CNT=CNT+1,NEWDEF(CNT)=DEF(LINE),$P(NEWDEF(CNT),U)=CNT
65 D STUFF^FSCLMPMS
66 Q
67 ;
68CHECK(LIST,USER) ; $$(list,user) -> 1 allows editing or 0 does not allow editing
69 ; to edit a list you must be a NOIS specialist and either own the list or be a supervisor
70 Q:'$D(^FSC("SPEC",USER,0)) 0 Q:$P(^(0),U,7) 1 Q:$P($G(^FSC("LIST",LIST,0)),U,2)=USER 1 Q 0
71 ;
72ALL() ; $$() -> 1 if all selections in list are chosen, else 0
73 N CNT,SEL
74 S (CNT,SEL)=0 F S SEL=$O(^TMP("FSC SELECT",$J,"MVALUES",SEL)) Q:SEL<1 S CNT=CNT+1
75 I CNT=+@VALMAR Q 1
76 Q 0
Note: See TracBrowser for help on using the repository browser.