FSCUF ;SLC/STAFF-NOIS Utilities Functions ;7/21/95 15:24
;;1.1;NOIS;;Sep 06, 1998
;
DEFLIST(USER) ; $$(user) -> user's default list
N LIST
S LIST=+$P($G(^FSC("SPEC",+$O(^FSC("SPEC","B",USER,0)),0)),U,9)
I 'LIST Q ""
Q LIST_U_$$VALUE^FSCGET(LIST,7105.2,9)
;
CAP(TYPE,STYLE,LISTNUM) ; $$(type,style,list number) -> caption
N CAPTION,FORMAT,VALUES
I TYPE="L" Q " # Call ID Call Subject "
S VALUES=$G(^TMP("FSC SELECT",$J,$S(TYPE="E":"EVALUES",1:"VVALUES")))
S CAPTION=$S(VALUES=+VALUES:" Call "_VALUES,1:$S($G(LISTNUM):" Call "_LISTNUM_" of",1:" Calls")_" ("_VALUES_")")
I '$O(^TMP("FSC LIST CALLS",$J,0)) S CAPTION=" "
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 ")
Q $$SETSTR^VALM1(FORMAT,CAPTION,62,$L(FORMAT))
;
STYLE(STYLE) ; $$(style) -> style name
Q $S(STYLE="B":"BRIEF",STYLE="D":"DETAIL",STYLE="F":"FORMAT",STYLE="S":"STAT",STYLE="C":"CUSTOM",1:"")
;
ACCESS(USER,ACCESS) ; $$(user,access) -> 1 or 0
; access uses hierarchy of user, spec, super
I '$L(ACCESS) Q 1
I ACCESS="USER" Q 1
N USERACC
S USERACC=$$PRIV(USER)
I ACCESS="SUPER",USERACC="SUPER" Q 1
I ACCESS="SPEC",USERACC="SUPER" Q 1
I ACCESS="SPEC",USERACC="SPEC" Q 1
Q 0
;
PRIV(USER) ; -> $$(user) -> user, spec, or super
Q:'$D(^FSC("SPEC",USER,0)) "USER" Q:$P(^(0),U,7) "SUPER" Q "SPEC"
;
USERINI(USER) ; $$(user) -> user's initials
Q $P($G(^VA(200,+USER,0)),U,2)
;
MODINI(MOD) ; $$(module) -> module's initials (naming convention)
Q $P($G(^FSC("MOD",+MOD,0)),U,7)
;
VFORMAT(USER) ; $$(user) -> default format type for view screen
N FTYPE
S FTYPE=$P($G(^FSC("SPEC",USER,0)),U,17) I 'FTYPE Q "DETAIL"
S FTYPE=$P($G(^FSC("FTYPE",FTYPE,0)),U,2) I '$L(FTYPE) Q "DETAIL"
Q FTYPE
;
EFORMAT(USER) ; $$(user) -> default format type for edit screen
N FTYPE
S FTYPE=$P($G(^FSC("SPEC",USER,0)),U,18) I 'FTYPE Q "BRIEF"
S FTYPE=$P($G(^FSC("FTYPE",FTYPE,0)),U,2) I '$L(FTYPE) Q "BRIEF"
Q FTYPE
;
EXIT(USER) ; $$(user) -> 1 or 0, default to exit or quit on NOIS screens
Q +$P($G(^FSC("SPEC",USER,0)),U,19)
ALERT(USER) ; $$(user) -> action on alerts
N ACTION
S ACTION=$P($G(^FSC("SPEC",USER,0)),U,20)
I ACTION="VIEW" Q "View"
Q "Edit"
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCUF 2440 printed Dec 13, 2024@02:20:26 Page 2
FSCUF ;SLC/STAFF-NOIS Utilities Functions ;7/21/95 15:24
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
DEFLIST(USER) ; $$(user) -> user's default list
+1 NEW LIST
+2 SET LIST=+$PIECE($GET(^FSC("SPEC",+$ORDER(^FSC("SPEC","B",USER,0)),0)),U,9)
+3 IF 'LIST
QUIT ""
+4 QUIT LIST_U_$$VALUE^FSCGET(LIST,7105.2,9)
+5 ;
CAP(TYPE,STYLE,LISTNUM) ; $$(type,style,list number) -> caption
+1 NEW CAPTION,FORMAT,VALUES
+2 IF TYPE="L"
QUIT " # Call ID Call Subject "
+3 SET VALUES=$GET(^TMP("FSC SELECT",$JOB,$SELECT(TYPE="E":"EVALUES",1:"VVALUES")))
+4 SET CAPTION=$SELECT(VALUES=+VALUES:" Call "_VALUES,1:$SELECT($GET(LISTNUM):" Call "_LISTNUM_" of",1:" Calls")_" ("_VALUES_")")
+5 IF '$ORDER(^TMP("FSC LIST CALLS",$JOB,0))
SET CAPTION=" "
+6 SET FORMAT=$SELECT(STYLE="BRIEF":"Brief Format ",STYLE="DETAIL":"Detailed Format ",STYLE="FORMAT":$SELECT($GET(STYLE("F")):$PIECE(STYLE("F"),U,2),1:" ")_" Format ",STYLE="STAT":"Statistic Format ",1:"Fields Format ")
+7 QUIT $$SETSTR^VALM1(FORMAT,CAPTION,62,$LENGTH(FORMAT))
+8 ;
STYLE(STYLE) ; $$(style) -> style name
+1 QUIT $SELECT(STYLE="B":"BRIEF",STYLE="D":"DETAIL",STYLE="F":"FORMAT",STYLE="S":"STAT",STYLE="C":"CUSTOM",1:"")
+2 ;
ACCESS(USER,ACCESS) ; $$(user,access) -> 1 or 0
+1 ; access uses hierarchy of user, spec, super
+2 IF '$LENGTH(ACCESS)
QUIT 1
+3 IF ACCESS="USER"
QUIT 1
+4 NEW USERACC
+5 SET USERACC=$$PRIV(USER)
+6 IF ACCESS="SUPER"
IF USERACC="SUPER"
QUIT 1
+7 IF ACCESS="SPEC"
IF USERACC="SUPER"
QUIT 1
+8 IF ACCESS="SPEC"
IF USERACC="SPEC"
QUIT 1
+9 QUIT 0
+10 ;
PRIV(USER) ; -> $$(user) -> user, spec, or super
+1 if '$DATA(^FSC("SPEC",USER,0))
QUIT "USER"
if $PIECE(^(0),U,7)
QUIT "SUPER"
QUIT "SPEC"
+2 ;
USERINI(USER) ; $$(user) -> user's initials
+1 QUIT $PIECE($GET(^VA(200,+USER,0)),U,2)
+2 ;
MODINI(MOD) ; $$(module) -> module's initials (naming convention)
+1 QUIT $PIECE($GET(^FSC("MOD",+MOD,0)),U,7)
+2 ;
VFORMAT(USER) ; $$(user) -> default format type for view screen
+1 NEW FTYPE
+2 SET FTYPE=$PIECE($GET(^FSC("SPEC",USER,0)),U,17)
IF 'FTYPE
QUIT "DETAIL"
+3 SET FTYPE=$PIECE($GET(^FSC("FTYPE",FTYPE,0)),U,2)
IF '$LENGTH(FTYPE)
QUIT "DETAIL"
+4 QUIT FTYPE
+5 ;
EFORMAT(USER) ; $$(user) -> default format type for edit screen
+1 NEW FTYPE
+2 SET FTYPE=$PIECE($GET(^FSC("SPEC",USER,0)),U,18)
IF 'FTYPE
QUIT "BRIEF"
+3 SET FTYPE=$PIECE($GET(^FSC("FTYPE",FTYPE,0)),U,2)
IF '$LENGTH(FTYPE)
QUIT "BRIEF"
+4 QUIT FTYPE
+5 ;
EXIT(USER) ; $$(user) -> 1 or 0, default to exit or quit on NOIS screens
+1 QUIT +$PIECE($GET(^FSC("SPEC",USER,0)),U,19)
ALERT(USER) ; $$(user) -> action on alerts
+1 NEW ACTION
+2 SET ACTION=$PIECE($GET(^FSC("SPEC",USER,0)),U,20)
+3 IF ACTION="VIEW"
QUIT "View"
+4 QUIT "Edit"