source: FOIAVistA/trunk/r/NOIS-FSC/FSCU.m@ 868

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

initial load of FOIAVistA 6/30/08 version

File size: 2.9 KB
Line 
1FSCU ;SLC/STAFF-NOIS Utilities ;10/18/96 09:56
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4CONST ; tempoary use (called when options or protocol actions are disabled)
5 W !,"UNDER CONSTRUCTION",! H 2
6 Q
7 ;
8DATE(X) ; $$(date in external format) -> FM format
9 N Y D ^%DT Q Y
10 ;
11PAUSE(OK) ; from FSCFORMP, FSCLMPO, FSCLMPOC, FSCLMPOE, FSCLMPON, FSCLMPOW, FSCRUDQ, FSCRX, FSCUEDIT, FSCUEDS
12 N DIR,X,Y K DIR S OK=1
13 S DIR(0)="E"
14 S DIR("?")="^D HELP^FSCU(.DIR)"
15 S DIR("??")="FSC U1 NOIS"
16 D ^DIR K DIR
17 I Y<1 S OK=0
18 Q
19 ;
20DEFLIST(USER) ; $$(user) -> user's default list
21 N LIST
22 S LIST=+$P($G(^FSC("SPEC",+$O(^FSC("SPEC","B",USER,0)),0)),U,9)
23 I 'LIST S LIST=+$O(^FSC("LIST","B","EMPTY",0))
24 I 'LIST Q ""
25 Q LIST_U_$$VALUE^FSCGET(LIST,7105.2,9)
26 ;
27VIDEOOFF ; from FSCFORM, FSCLMPC, FSCLMPCC, FSCLMV
28 Q:'$D(VALMCC) N LINE
29 D KILL^VALM10(.LINE)
30 Q
31 ;
32USERDEF(USER) ; $$(user) -> defaults
33 N DEF
34 S DEF=$$UP^XLFSTR($P($G(^FSC("SPEC",+USER,0)),U,11))
35 I '$L(DEF) S DEF="SM"
36 Q DEF
37 ;
38CAP(TYPE,STYLE,LISTNUM) ; $$(type,style,list number) -> caption
39 N CAPTION,FORMAT,VALUES
40 I TYPE="L",'$L($G(FSCUD)) Q " # Call ID Call Subject "
41 I TYPE="L" D Q CAPTION
42 .S CAPTION=" # Call ID "
43 .I FSCUD["S" S CAPTION=$$SETSTR^VALM1("Status",CAPTION,$L(CAPTION)+1,6)
44 .I FSCUD["M" S CAPTION=$$SETSTR^VALM1("Mod",CAPTION,$L(CAPTION)+2,3)
45 .I FSCUD["U" S CAPTION=$$SETSTR^VALM1("Spec",CAPTION,$L(CAPTION)+4,4)
46 .I FSCUD["R" S CAPTION=$$SETSTR^VALM1("Ref",CAPTION,$L(CAPTION)+4,4)
47 .I FSCUD["P" S CAPTION=$$SETSTR^VALM1("Pri",CAPTION,$L(CAPTION)+3,3)
48 .S CAPTION=$$SETSTR^VALM1("Call Subject",CAPTION,$L(CAPTION)+8,60)
49 S VALUES=$G(^TMP("FSC SELECT",$J,$S(TYPE="E":"EVALUES",1:"VVALUES")))
50 S CAPTION=$S(VALUES=+VALUES:" Call "_VALUES,1:$S($G(LISTNUM):" Call "_LISTNUM_" of",1:" Calls")_" ("_VALUES_")")
51 I '$O(^TMP("FSC LIST CALLS",$J,0)) S CAPTION=" "
52 S STYLE=$G(STYLE,"BRIEF")
53 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 ")
54 Q $$SETSTR^VALM1(FORMAT,CAPTION,62,$L(FORMAT))
55 ;
56STYLE(STYLE) ; $$(style) -> style name
57 Q $S(STYLE="B":"BRIEF",STYLE="D":"DETAIL",STYLE="F":"FORMAT",STYLE="S":"STAT",STYLE="C":"CUSTOM",STYLE="FM":"FM",1:"")
58 ;
59ACCESS(USER,ACCESS) ; $$(user,access) -> 1 or 0
60 ; access uses hierarchy of user, spec, super
61 I '$L(ACCESS) Q 1
62 I ACCESS="USER" Q 1
63 N USERACC
64 S USERACC=$$PRIV(USER)
65 I ACCESS="SUPER",USERACC="SUPER" Q 1
66 I ACCESS="SPEC",USERACC="SUPER" Q 1
67 I ACCESS="SPEC",USERACC="SPEC" Q 1
68 Q 0
69 ;
70PRIV(USER) ; -> $$(user) -> user, spec, or super
71 Q:'$D(^FSC("SPEC",+USER,0)) "USER" Q:$P(^(0),U,2) "USER" Q:$P(^(0),U,7) "SUPER" Q "SPEC"
72 ;
73HELP(DIR) ;
74 N CNT
75 W !
76 S CNT=0 F S CNT=$O(DIR("?",CNT)) Q:CNT<1 W !?5,DIR("?",CNT)
77 I $G(DIR("?",+$O(DIR("?","A"),-1)))'["??" W !?5,"Enter '^' to exit, '??' for additional help."
78 Q
Note: See TracBrowser for help on using the repository browser.