FSCU ;SLC/STAFF-NOIS Utilities ;10/18/96 09:56
;;1.1;NOIS;;Sep 06, 1998
;
CONST ; tempoary use (called when options or protocol actions are disabled)
W !,"UNDER CONSTRUCTION",! H 2
Q
;
DATE(X) ; $$(date in external format) -> FM format
N Y D ^%DT Q Y
;
PAUSE(OK) ; from FSCFORMP, FSCLMPO, FSCLMPOC, FSCLMPOE, FSCLMPON, FSCLMPOW, FSCRUDQ, FSCRX, FSCUEDIT, FSCUEDS
N DIR,X,Y K DIR S OK=1
S DIR(0)="E"
S DIR("?")="^D HELP^FSCU(.DIR)"
S DIR("??")="FSC U1 NOIS"
D ^DIR K DIR
I Y<1 S OK=0
Q
;
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 S LIST=+$O(^FSC("LIST","B","EMPTY",0))
I 'LIST Q ""
Q LIST_U_$$VALUE^FSCGET(LIST,7105.2,9)
;
VIDEOOFF ; from FSCFORM, FSCLMPC, FSCLMPCC, FSCLMV
Q:'$D(VALMCC) N LINE
D KILL^VALM10(.LINE)
Q
;
USERDEF(USER) ; $$(user) -> defaults
N DEF
S DEF=$$UP^XLFSTR($P($G(^FSC("SPEC",+USER,0)),U,11))
I '$L(DEF) S DEF="SM"
Q DEF
;
CAP(TYPE,STYLE,LISTNUM) ; $$(type,style,list number) -> caption
N CAPTION,FORMAT,VALUES
I TYPE="L",'$L($G(FSCUD)) Q " # Call ID Call Subject "
I TYPE="L" D Q CAPTION
.S CAPTION=" # Call ID "
.I FSCUD["S" S CAPTION=$$SETSTR^VALM1("Status",CAPTION,$L(CAPTION)+1,6)
.I FSCUD["M" S CAPTION=$$SETSTR^VALM1("Mod",CAPTION,$L(CAPTION)+2,3)
.I FSCUD["U" S CAPTION=$$SETSTR^VALM1("Spec",CAPTION,$L(CAPTION)+4,4)
.I FSCUD["R" S CAPTION=$$SETSTR^VALM1("Ref",CAPTION,$L(CAPTION)+4,4)
.I FSCUD["P" S CAPTION=$$SETSTR^VALM1("Pri",CAPTION,$L(CAPTION)+3,3)
.S CAPTION=$$SETSTR^VALM1("Call Subject",CAPTION,$L(CAPTION)+8,60)
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 STYLE=$G(STYLE,"BRIEF")
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",STYLE="FM":"FM",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,2) "USER" Q:$P(^(0),U,7) "SUPER" Q "SPEC"
;
HELP(DIR) ;
N CNT
W !
S CNT=0 F S CNT=$O(DIR("?",CNT)) Q:CNT<1 W !?5,DIR("?",CNT)
I $G(DIR("?",+$O(DIR("?","A"),-1)))'["??" W !?5,"Enter '^' to exit, '??' for additional help."
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCU 3053 printed Dec 13, 2024@02:20:21 Page 2
FSCU ;SLC/STAFF-NOIS Utilities ;10/18/96 09:56
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
CONST ; tempoary use (called when options or protocol actions are disabled)
+1 WRITE !,"UNDER CONSTRUCTION",!
HANG 2
+2 QUIT
+3 ;
DATE(X) ; $$(date in external format) -> FM format
+1 NEW Y
DO ^%DT
QUIT Y
+2 ;
PAUSE(OK) ; from FSCFORMP, FSCLMPO, FSCLMPOC, FSCLMPOE, FSCLMPON, FSCLMPOW, FSCRUDQ, FSCRX, FSCUEDIT, FSCUEDS
+1 NEW DIR,X,Y
KILL DIR
SET OK=1
+2 SET DIR(0)="E"
+3 SET DIR("?")="^D HELP^FSCU(.DIR)"
+4 SET DIR("??")="FSC U1 NOIS"
+5 DO ^DIR
KILL DIR
+6 IF Y<1
SET OK=0
+7 QUIT
+8 ;
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
SET LIST=+$ORDER(^FSC("LIST","B","EMPTY",0))
+4 IF 'LIST
QUIT ""
+5 QUIT LIST_U_$$VALUE^FSCGET(LIST,7105.2,9)
+6 ;
VIDEOOFF ; from FSCFORM, FSCLMPC, FSCLMPCC, FSCLMV
+1 if '$DATA(VALMCC)
QUIT
NEW LINE
+2 DO KILL^VALM10(.LINE)
+3 QUIT
+4 ;
USERDEF(USER) ; $$(user) -> defaults
+1 NEW DEF
+2 SET DEF=$$UP^XLFSTR($PIECE($GET(^FSC("SPEC",+USER,0)),U,11))
+3 IF '$LENGTH(DEF)
SET DEF="SM"
+4 QUIT DEF
+5 ;
CAP(TYPE,STYLE,LISTNUM) ; $$(type,style,list number) -> caption
+1 NEW CAPTION,FORMAT,VALUES
+2 IF TYPE="L"
IF '$LENGTH($GET(FSCUD))
QUIT " # Call ID Call Subject "
+3 IF TYPE="L"
Begin DoDot:1
+4 SET CAPTION=" # Call ID "
+5 IF FSCUD["S"
SET CAPTION=$$SETSTR^VALM1("Status",CAPTION,$LENGTH(CAPTION)+1,6)
+6 IF FSCUD["M"
SET CAPTION=$$SETSTR^VALM1("Mod",CAPTION,$LENGTH(CAPTION)+2,3)
+7 IF FSCUD["U"
SET CAPTION=$$SETSTR^VALM1("Spec",CAPTION,$LENGTH(CAPTION)+4,4)
+8 IF FSCUD["R"
SET CAPTION=$$SETSTR^VALM1("Ref",CAPTION,$LENGTH(CAPTION)+4,4)
+9 IF FSCUD["P"
SET CAPTION=$$SETSTR^VALM1("Pri",CAPTION,$LENGTH(CAPTION)+3,3)
+10 SET CAPTION=$$SETSTR^VALM1("Call Subject",CAPTION,$LENGTH(CAPTION)+8,60)
End DoDot:1
QUIT CAPTION
+11 SET VALUES=$GET(^TMP("FSC SELECT",$JOB,$SELECT(TYPE="E":"EVALUES",1:"VVALUES")))
+12 SET CAPTION=$SELECT(VALUES=+VALUES:" Call "_VALUES,1:$SELECT($GET(LISTNUM):" Call "_LISTNUM_" of",1:" Calls")_" ("_VALUES_")")
+13 IF '$ORDER(^TMP("FSC LIST CALLS",$JOB,0))
SET CAPTION=" "
+14 SET STYLE=$GET(STYLE,"BRIEF")
+15 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 ")
+16 QUIT $$SETSTR^VALM1(FORMAT,CAPTION,62,$LENGTH(FORMAT))
+17 ;
STYLE(STYLE) ; $$(style) -> style name
+1 QUIT $SELECT(STYLE="B":"BRIEF",STYLE="D":"DETAIL",STYLE="F":"FORMAT",STYLE="S":"STAT",STYLE="C":"CUSTOM",STYLE="FM":"FM",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,2)
QUIT "USER"
if $PIECE(^(0),U,7)
QUIT "SUPER"
QUIT "SPEC"
+2 ;
HELP(DIR) ;
+1 NEW CNT
+2 WRITE !
+3 SET CNT=0
FOR
SET CNT=$ORDER(DIR("?",CNT))
if CNT<1
QUIT
WRITE !?5,DIR("?",CNT)
+4 IF $GET(DIR("?",+$ORDER(DIR("?","A"),-1)))'["??"
WRITE !?5,"Enter '^' to exit, '??' for additional help."
+5 QUIT