source: WorldVistAEHR/trunk/r/NOIS-FSC/FSCUF.m@ 1716

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

initial load of WorldVistAEHR

File size: 2.3 KB
Line 
1FSCUF ;SLC/STAFF-NOIS Utilities Functions ;7/21/95 15:24
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4DEFLIST(USER) ; $$(user) -> user's default list
5 N LIST
6 S LIST=+$P($G(^FSC("SPEC",+$O(^FSC("SPEC","B",USER,0)),0)),U,9)
7 I 'LIST Q ""
8 Q LIST_U_$$VALUE^FSCGET(LIST,7105.2,9)
9 ;
10CAP(TYPE,STYLE,LISTNUM) ; $$(type,style,list number) -> caption
11 N CAPTION,FORMAT,VALUES
12 I TYPE="L" Q " # Call ID Call Subject "
13 S VALUES=$G(^TMP("FSC SELECT",$J,$S(TYPE="E":"EVALUES",1:"VVALUES")))
14 S CAPTION=$S(VALUES=+VALUES:" Call "_VALUES,1:$S($G(LISTNUM):" Call "_LISTNUM_" of",1:" Calls")_" ("_VALUES_")")
15 I '$O(^TMP("FSC LIST CALLS",$J,0)) S CAPTION=" "
16 S FORMAT=$S(STYLE="BRIEF":"Brief Format ",STYLE="DETAIL":"Detailed Format ",STYLE="FORMAT":$S($G(STYLE("F")):$P(STYLE("F"),U,2),1:" ")_" Format ",STYLE="STAT":"Statistic Format ",1:"Fields Format ")
17 Q $$SETSTR^VALM1(FORMAT,CAPTION,62,$L(FORMAT))
18 ;
19STYLE(STYLE) ; $$(style) -> style name
20 Q $S(STYLE="B":"BRIEF",STYLE="D":"DETAIL",STYLE="F":"FORMAT",STYLE="S":"STAT",STYLE="C":"CUSTOM",1:"")
21 ;
22ACCESS(USER,ACCESS) ; $$(user,access) -> 1 or 0
23 ; access uses hierarchy of user, spec, super
24 I '$L(ACCESS) Q 1
25 I ACCESS="USER" Q 1
26 N USERACC
27 S USERACC=$$PRIV(USER)
28 I ACCESS="SUPER",USERACC="SUPER" Q 1
29 I ACCESS="SPEC",USERACC="SUPER" Q 1
30 I ACCESS="SPEC",USERACC="SPEC" Q 1
31 Q 0
32 ;
33PRIV(USER) ; -> $$(user) -> user, spec, or super
34 Q:'$D(^FSC("SPEC",USER,0)) "USER" Q:$P(^(0),U,7) "SUPER" Q "SPEC"
35 ;
36USERINI(USER) ; $$(user) -> user's initials
37 Q $P($G(^VA(200,+USER,0)),U,2)
38 ;
39MODINI(MOD) ; $$(module) -> module's initials (naming convention)
40 Q $P($G(^FSC("MOD",+MOD,0)),U,7)
41 ;
42VFORMAT(USER) ; $$(user) -> default format type for view screen
43 N FTYPE
44 S FTYPE=$P($G(^FSC("SPEC",USER,0)),U,17) I 'FTYPE Q "DETAIL"
45 S FTYPE=$P($G(^FSC("FTYPE",FTYPE,0)),U,2) I '$L(FTYPE) Q "DETAIL"
46 Q FTYPE
47 ;
48EFORMAT(USER) ; $$(user) -> default format type for edit screen
49 N FTYPE
50 S FTYPE=$P($G(^FSC("SPEC",USER,0)),U,18) I 'FTYPE Q "BRIEF"
51 S FTYPE=$P($G(^FSC("FTYPE",FTYPE,0)),U,2) I '$L(FTYPE) Q "BRIEF"
52 Q FTYPE
53 ;
54EXIT(USER) ; $$(user) -> 1 or 0, default to exit or quit on NOIS screens
55 Q +$P($G(^FSC("SPEC",USER,0)),U,19)
56ALERT(USER) ; $$(user) -> action on alerts
57 N ACTION
58 S ACTION=$P($G(^FSC("SPEC",USER,0)),U,20)
59 I ACTION="VIEW" Q "View"
60 Q "Edit"
Note: See TracBrowser for help on using the repository browser.