source: FOIAVistA/trunk/r/NOIS-FSC/FSCRPXM.m@ 1203

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

initial load of FOIAVistA 6/30/08 version

File size: 4.0 KB
Line 
1FSCRPXM ;SLC/STAFF-NOIS RPC Menus ;1/13/98 16:51
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4MENUS(USER,OUTLINE,INLINE) ; from FSCRPX
5 N CALL,CNT,INDEX,INLINE0,LINE,LIST,MAXMRE,MAXMRA,MAXMRU,NUM,TIME
6 S MAXMRE=10,MAXMRA=10,MAXMRU=12
7 S INLINE0=$G(^TMP("FSCRPC",$J,"INPUT",0))
8 I $P(INLINE,U,6)=0 S $P(OUTLINE,U,6)=$$ALERT(DUZ)
9 E S $P(OUTLINE,U,6)=1
10 S $P(OUTLINE,U,7)=$$MRE(DUZ)
11 S $P(OUTLINE,U,8)=$$MRA(DUZ)
12 S $P(OUTLINE,U,9)=$$MRU(DUZ)
13 K ^TMP("FSCRPC",$J,"MENUS")
14 ;
15 I $P(OUTLINE,U,7)'=$P(INLINE0,U,7) D
16 .S CNT=0,TIME="" F S TIME=$O(^FSCD("MRE","AUTC",USER,TIME)) Q:TIME="" D Q:CNT=MAXMRE
17 ..S CALL=0 F S CALL=$O(^FSCD("MRE","AUTC",USER,TIME,CALL)) Q:CALL="" D Q:CNT=MAXMRE
18 ...S CNT=CNT+1
19 ...S ^TMP("FSCRPC",$J,"MENUS","MRE",CNT)=CALL_U_$$CALLID(CALL)
20 ;
21 I $P(OUTLINE,U,8)'=$P(INLINE0,U,8) D
22 .S CNT=0,TIME="" F S TIME=$O(^FSCD("MRA","AUTC",USER,TIME)) Q:TIME="" D Q:CNT=MAXMRA
23 ..S CALL=0 F S CALL=$O(^FSCD("MRA","AUTC",USER,TIME,CALL)) Q:CALL="" D Q:CNT=MAXMRA
24 ...S CNT=CNT+1
25 ...S ^TMP("FSCRPC",$J,"MENUS","MRA",CNT)=CALL_U_$$CALLID(CALL)
26 ;
27 I $P(OUTLINE,U,9)'=$P(INLINE0,U,9) D
28 .S CNT=0,TIME="" F S TIME=$O(^FSCD("MRU","AUTL",USER,TIME)) Q:TIME="" D Q:CNT=MAXMRU
29 ..S LIST=0 F S LIST=$O(^FSCD("MRU","AUTL",USER,TIME,LIST)) Q:LIST="" D Q:CNT=MAXMRU
30 ...S INDEX="" F S INDEX=$O(^FSCD("MRU","AUTL",USER,TIME,LIST,INDEX)) Q:INDEX="" D Q:CNT=MAXMRU
31 ....S CNT=CNT+1
32 ....S ^TMP("FSCRPC",$J,"MENUS","MRU",CNT)=LIST_U_INDEX_U_$P($G(^FSC("LIST",+LIST,0)),U)_$S(INDEX:" "_$$INDXVAL(LIST,INDEX),1:"")_U_$P($G(^FSC("LIST",+LIST,0)),U,8,9)
33 ....I 'INDEX Q
34 ....; append index external value
35 ;
36 I '$L($O(^TMP("FSCRPC",$J,"MENUS",""))) Q
37 K ^TMP("FSCRPC",$J,"MENUS","TEMP")
38 M ^TMP("FSCRPC",$J,"MENUS","TEMP")=^TMP("FSCRPC",$J,"OUTPUT")
39 K ^TMP("FSCRPC",$J,"OUTPUT")
40 S CNT=0
41 ;
42 I $O(^TMP("FSCRPC",$J,"MENUS","MRE",0)) D
43 .S CNT=CNT+1
44 .S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="{MRE}"
45 .S NUM=0 F S NUM=$O(^TMP("FSCRPC",$J,"MENUS","MRE",NUM)) Q:NUM<1 S LINE=^(NUM) D
46 ..S CNT=CNT+1
47 ..S ^TMP("FSCRPC",$J,"OUTPUT",CNT)=LINE
48 .S CNT=CNT+1
49 .S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="^^^"
50 ;
51 I $O(^TMP("FSCRPC",$J,"MENUS","MRA",0)) D
52 .S CNT=CNT+1
53 .S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="{MRA}"
54 .S NUM=0 F S NUM=$O(^TMP("FSCRPC",$J,"MENUS","MRA",NUM)) Q:NUM<1 S LINE=^(NUM) D
55 ..S CNT=CNT+1
56 ..S ^TMP("FSCRPC",$J,"OUTPUT",CNT)=LINE
57 .S CNT=CNT+1
58 .S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="^^^"
59 ;
60 I $O(^TMP("FSCRPC",$J,"MENUS","MRU",0)) D
61 .S CNT=CNT+1
62 .S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="{MRU}"
63 .S NUM=0 F S NUM=$O(^TMP("FSCRPC",$J,"MENUS","MRU",NUM)) Q:NUM<1 S LINE=^(NUM) D
64 ..S CNT=CNT+1
65 ..S ^TMP("FSCRPC",$J,"OUTPUT",CNT)=LINE
66 .S CNT=CNT+1
67 .S ^TMP("FSCRPC",$J,"OUTPUT",CNT)="^^^"
68 ;
69 S NUM=0 F S NUM=$O(^TMP("FSCRPC",$J,"MENUS","TEMP",NUM)) Q:NUM<1 S LINE=^(NUM) D
70 .S CNT=CNT+1
71 .S ^TMP("FSCRPC",$J,"OUTPUT",CNT)=LINE
72 S ^TMP("FSCRPC",$J,"OUTPUT")=CNT
73 K ^TMP("FSCRPC",$J,"MENUS")
74 Q
75 ;
76CALLID(CALL) ; $$(call) -> call text for menu
77 N CALLID
78 S CALLID=$P($G(^FSCD("CALL",+CALL,0)),U)_" "_$$MODINI^FSCUF($P(^(0),U,8))_U_$$REPLACE^FSCRU($$SHORT^FSCRPXUS(CALL,DUZ),U," ")
79 Q CALLID
80 ;
81ALERT(USER) ; $$(user) -> 1 or 0 if alerts available
82 I $D(^FSCD("ALERT","ALERT",USER)) Q 1
83 Q $$XQA(USER,"FSC-")
84 ;
85XQA(USER,TEXT) ; $$(user,text) -> 1 or 0 if alerts contains text in ID ** non documented access
86 N OK,TIME
87 I '$O(^XTV(8992,USER,"XQA",0)) Q 0
88 S (OK,TIME)=0 F S TIME=$O(^XTV(8992,USER,"XQA",TIME)) Q:TIME<1 I $P($G(^(TIME,0)),U,2)[TEXT S OK=1 Q
89 Q OK
90 ;
91MRE(USER) ; $$(user) -> timestamp of user's MRE list
92 Q +$P($G(^FSCD("MRE","AUT",+USER)),".",2)
93 ;
94MRA(USER) ; $$(user) -> timestamp of user's MRA list
95 Q +$P($G(^FSCD("MRA","AUT",+USER)),".",2)
96 ;
97MRU(USER) ; $$(user) -> timestamp of user's MRU lists
98 Q +$P($G(^FSCD("MRU","AUT",+USER)),".",2)
99 ;
100INDXVAL(LIST,INDEX) ; $$(list, index) -> external value of index
101 N FIELD,OFFSET,TYPE
102 S FIELD=+$P($G(^FSC("LIST",+LIST,0)),U,5)
103 I 'FIELD Q ""
104 S TYPE=+$P($P($G(^FSC("FLD",FIELD,0)),U,3),"P",2),OFFSET=$P($G(^(0)),U,6)
105 I TYPE=7105.2 S TYPE=200
106 I TYPE Q $$POINTER^FSCDD(INDEX,TYPE,OFFSET)
107 Q ""
Note: See TracBrowser for help on using the repository browser.