SDECRMGP ;ALB/JSM - VISTA SCHEDULING RPCS ;MAR 15, 2017
;;5.3;Scheduling;**658**;Aug 13, 1993;Build 23
;
;
Q
;
PUTRMGUP(RET,SDECUSER,INP...) ; Save Request Manager Grid preferences for user.
;PUT1(RET,SDECUSER,INP) ;text input
;INPUT:
; SDECUSER - USER id pointer to NEW PERSON file (#200)
; INP(1-x) - Array of filter string text in which each array entry contains no more than 80 characters.
;RETURN:
; Successful Return:
; Single Value return in the format "0^"
; Caught Exception Return:
; A single entry in the Global Array in the format "-1^<error text>"
; "T00020RETURNCODE^T00100TEXT"
; Unexpected Exception Return:
; Handled by the RPC Broker.
; M errors are trapped by the use of M and Kernel error handling.
; The RPC execution stops and the RPC Broker sends the error generated
; text back to the client.
;
N ERR,SDI,SDC,END,FIL,FIL1,FILTERIN,FLTR
;S RET="^TMP(""SDECRMGP"","_$J_",""USRPREF"")"
S END=78
;K @RET
; data header
;S RET="T00030RETURNCODE^T00050TEXT"_$C(30)
S SDECUSER=$G(SDECUSER)
;D:SDECUSER=113 ^%ZTER
I SDECUSER'="",'$D(^VA(200,SDECUSER,0)) S RET="-1^Invalid user ID "_SDECUSER Q
I SDECUSER="" S SDECUSER=DUZ
S SDC=0
S SDI=-1 F S SDI=$O(INP(SDI)) Q:SDI="" D
.S FILTERIN=$G(INP(SDI))
.Q:FILTERIN=""
.S FIL=FILTERIN
.F Q:FIL="" D
..S:$E(FIL,END)=" " $E(FIL,END)="~"
..S FIL1=$E(FIL,1,END)
..S FIL=$S($L(FIL)>END:$E(FIL,END+1,$L(FIL)),1:"")
..S SDC=SDC+1 S FLTR(SDC,0)=FIL1
S:SDC>0 FLTR="SET USER PREFERENCES"
I FLTR'="" D EN^XPAR(SDECUSER_";VA(200,","SDEC REQ MGR GRID FILTER",1,.FLTR,.ERR)
I ERR S RET="-1^FILTER ERR: "_$P(ERR,U,1)_";"_$P(ERR,U,2) Q
S RET="0^SUCCESS"
;
Q
;
GETRMGUP(RET,SDECUSER) ; Get Request Manager Grid preferences for user.
;
; RETURN: The Filter delimited by "|" as it was provided by GUI to store
; OR -1:ERR
;
N ERR,SDI,SDC,FIL,FLTR
S RET="" ;"T00500FILTER"_$C(30)
S SDECUSER=$G(SDECUSER)
I SDECUSER="" S SDECUSER=DUZ
; setup array for word processing
D GETWP^XPAR(.FLTR,SDECUSER_";VA(200,","SDEC REQ MGR GRID FILTER",1,.ERR)
;I ERR S RET=RET_"-1: "_ERR_$C(30,31) Q
I ERR S RET="-1: "_ERR Q
S SDC=0 F S SDC=$O(FLTR(SDC)) Q:SDC="" D
.S FIL=FLTR(SDC,0)
.I $E(FIL,1,2)="~~" S RET=RET_$E(FIL,3,$L(FIL))
.E S RET=RET_FLTR(SDC,0)
S:RET="" RET="-1: NO USER PREFERENCE SET"
;.E S RET=RET_$S(SDC>1:"|",1:"")_FLTR(SDC,0)
;S:$O(FLTR(0)) RET=RET_$C(30)
;S RET=RET_$C(31)
;
Q
GET2(RET,SDECUSER) ; Get Request Manager Grid preferences for user.
;
; RETURN: The Filter delimited by "|" as it was provided by GUI to store
; OR -1:ERR
;
N ERR,SDI,SDC,END,FIL,FLTR
S END=78
S RET="T00500FILTER"_$C(30)
S SDECUSER=$G(SDECUSER)
I SDECUSER="" S SDECUSER=DUZ
; setup array for word processing
D GETWP^XPAR(.FLTR,SDECUSER_";VA(200,","SDEC REQ MGR GRID FILTER",1,.ERR)
I ERR S RET=RET_"-1: "_ERR_$C(30,31) Q
S SDC=0 F S SDC=$O(FLTR(SDC)) Q:SDC="" D
.S FIL=FLTR(SDC,0)
.S:$E(FIL,$L(FIL))="~" $E(FIL,$L(FIL))=" "
.S RET=RET_FIL
S:$O(FLTR(0)) RET=RET_$C(30)
S RET=RET_$C(31)
;
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDECRMGP 3146 printed Nov 22, 2024@18:02:32 Page 2
SDECRMGP ;ALB/JSM - VISTA SCHEDULING RPCS ;MAR 15, 2017
+1 ;;5.3;Scheduling;**658**;Aug 13, 1993;Build 23
+2 ;
+3 ;
+4 QUIT
+5 ;
PUTRMGUP(RET,SDECUSER,INP...) ; Save Request Manager Grid preferences for user.
+1 ;PUT1(RET,SDECUSER,INP) ;text input
+2 ;INPUT:
+3 ; SDECUSER - USER id pointer to NEW PERSON file (#200)
+4 ; INP(1-x) - Array of filter string text in which each array entry contains no more than 80 characters.
+5 ;RETURN:
+6 ; Successful Return:
+7 ; Single Value return in the format "0^"
+8 ; Caught Exception Return:
+9 ; A single entry in the Global Array in the format "-1^<error text>"
+10 ; "T00020RETURNCODE^T00100TEXT"
+11 ; Unexpected Exception Return:
+12 ; Handled by the RPC Broker.
+13 ; M errors are trapped by the use of M and Kernel error handling.
+14 ; The RPC execution stops and the RPC Broker sends the error generated
+15 ; text back to the client.
+16 ;
+17 NEW ERR,SDI,SDC,END,FIL,FIL1,FILTERIN,FLTR
+18 ;S RET="^TMP(""SDECRMGP"","_$J_",""USRPREF"")"
+19 SET END=78
+20 ;K @RET
+21 ; data header
+22 ;S RET="T00030RETURNCODE^T00050TEXT"_$C(30)
+23 SET SDECUSER=$GET(SDECUSER)
+24 ;D:SDECUSER=113 ^%ZTER
+25 IF SDECUSER'=""
IF '$DATA(^VA(200,SDECUSER,0))
SET RET="-1^Invalid user ID "_SDECUSER
QUIT
+26 IF SDECUSER=""
SET SDECUSER=DUZ
+27 SET SDC=0
+28 SET SDI=-1
FOR
SET SDI=$ORDER(INP(SDI))
if SDI=""
QUIT
Begin DoDot:1
+29 SET FILTERIN=$GET(INP(SDI))
+30 if FILTERIN=""
QUIT
+31 SET FIL=FILTERIN
+32 FOR
if FIL=""
QUIT
Begin DoDot:2
+33 if $EXTRACT(FIL,END)=" "
SET $EXTRACT(FIL,END)="~"
+34 SET FIL1=$EXTRACT(FIL,1,END)
+35 SET FIL=$SELECT($LENGTH(FIL)>END:$EXTRACT(FIL,END+1,$LENGTH(FIL)),1:"")
+36 SET SDC=SDC+1
SET FLTR(SDC,0)=FIL1
End DoDot:2
End DoDot:1
+37 if SDC>0
SET FLTR="SET USER PREFERENCES"
+38 IF FLTR'=""
DO EN^XPAR(SDECUSER_";VA(200,","SDEC REQ MGR GRID FILTER",1,.FLTR,.ERR)
+39 IF ERR
SET RET="-1^FILTER ERR: "_$PIECE(ERR,U,1)_";"_$PIECE(ERR,U,2)
QUIT
+40 SET RET="0^SUCCESS"
+41 ;
+42 QUIT
+43 ;
GETRMGUP(RET,SDECUSER) ; Get Request Manager Grid preferences for user.
+1 ;
+2 ; RETURN: The Filter delimited by "|" as it was provided by GUI to store
+3 ; OR -1:ERR
+4 ;
+5 NEW ERR,SDI,SDC,FIL,FLTR
+6 ;"T00500FILTER"_$C(30)
SET RET=""
+7 SET SDECUSER=$GET(SDECUSER)
+8 IF SDECUSER=""
SET SDECUSER=DUZ
+9 ; setup array for word processing
+10 DO GETWP^XPAR(.FLTR,SDECUSER_";VA(200,","SDEC REQ MGR GRID FILTER",1,.ERR)
+11 ;I ERR S RET=RET_"-1: "_ERR_$C(30,31) Q
+12 IF ERR
SET RET="-1: "_ERR
QUIT
+13 SET SDC=0
FOR
SET SDC=$ORDER(FLTR(SDC))
if SDC=""
QUIT
Begin DoDot:1
+14 SET FIL=FLTR(SDC,0)
+15 IF $EXTRACT(FIL,1,2)="~~"
SET RET=RET_$EXTRACT(FIL,3,$LENGTH(FIL))
+16 IF '$TEST
SET RET=RET_FLTR(SDC,0)
End DoDot:1
+17 if RET=""
SET RET="-1: NO USER PREFERENCE SET"
+18 ;.E S RET=RET_$S(SDC>1:"|",1:"")_FLTR(SDC,0)
+19 ;S:$O(FLTR(0)) RET=RET_$C(30)
+20 ;S RET=RET_$C(31)
+21 ;
+22 QUIT
GET2(RET,SDECUSER) ; Get Request Manager Grid preferences for user.
+1 ;
+2 ; RETURN: The Filter delimited by "|" as it was provided by GUI to store
+3 ; OR -1:ERR
+4 ;
+5 NEW ERR,SDI,SDC,END,FIL,FLTR
+6 SET END=78
+7 SET RET="T00500FILTER"_$CHAR(30)
+8 SET SDECUSER=$GET(SDECUSER)
+9 IF SDECUSER=""
SET SDECUSER=DUZ
+10 ; setup array for word processing
+11 DO GETWP^XPAR(.FLTR,SDECUSER_";VA(200,","SDEC REQ MGR GRID FILTER",1,.ERR)
+12 IF ERR
SET RET=RET_"-1: "_ERR_$CHAR(30,31)
QUIT
+13 SET SDC=0
FOR
SET SDC=$ORDER(FLTR(SDC))
if SDC=""
QUIT
Begin DoDot:1
+14 SET FIL=FLTR(SDC,0)
+15 if $EXTRACT(FIL,$LENGTH(FIL))="~"
SET $EXTRACT(FIL,$LENGTH(FIL))=" "
+16 SET RET=RET_FIL
End DoDot:1
+17 if $ORDER(FLTR(0))
SET RET=RET_$CHAR(30)
+18 SET RET=RET_$CHAR(31)
+19 ;
+20 QUIT