Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SDECRMGP

SDECRMGP.m

Go to the documentation of this file.
  1. SDECRMGP ;ALB/JSM - VISTA SCHEDULING RPCS ;MAR 15, 2017
  1. ;;5.3;Scheduling;**658**;Aug 13, 1993;Build 23
  1. ;
  1. ;
  1. Q
  1. ;
  1. PUTRMGUP(RET,SDECUSER,INP...) ; Save Request Manager Grid preferences for user.
  1. ;PUT1(RET,SDECUSER,INP) ;text input
  1. ;INPUT:
  1. ; SDECUSER - USER id pointer to NEW PERSON file (#200)
  1. ; INP(1-x) - Array of filter string text in which each array entry contains no more than 80 characters.
  1. ;RETURN:
  1. ; Successful Return:
  1. ; Single Value return in the format "0^"
  1. ; Caught Exception Return:
  1. ; A single entry in the Global Array in the format "-1^<error text>"
  1. ; "T00020RETURNCODE^T00100TEXT"
  1. ; Unexpected Exception Return:
  1. ; Handled by the RPC Broker.
  1. ; M errors are trapped by the use of M and Kernel error handling.
  1. ; The RPC execution stops and the RPC Broker sends the error generated
  1. ; text back to the client.
  1. ;
  1. N ERR,SDI,SDC,END,FIL,FIL1,FILTERIN,FLTR
  1. ;S RET="^TMP(""SDECRMGP"","_$J_",""USRPREF"")"
  1. S END=78
  1. ;K @RET
  1. ; data header
  1. ;S RET="T00030RETURNCODE^T00050TEXT"_$C(30)
  1. S SDECUSER=$G(SDECUSER)
  1. ;D:SDECUSER=113 ^%ZTER
  1. I SDECUSER'="",'$D(^VA(200,SDECUSER,0)) S RET="-1^Invalid user ID "_SDECUSER Q
  1. I SDECUSER="" S SDECUSER=DUZ
  1. S SDC=0
  1. S SDI=-1 F S SDI=$O(INP(SDI)) Q:SDI="" D
  1. .S FILTERIN=$G(INP(SDI))
  1. .Q:FILTERIN=""
  1. .S FIL=FILTERIN
  1. .F Q:FIL="" D
  1. ..S:$E(FIL,END)=" " $E(FIL,END)="~"
  1. ..S FIL1=$E(FIL,1,END)
  1. ..S FIL=$S($L(FIL)>END:$E(FIL,END+1,$L(FIL)),1:"")
  1. ..S SDC=SDC+1 S FLTR(SDC,0)=FIL1
  1. S:SDC>0 FLTR="SET USER PREFERENCES"
  1. I FLTR'="" D EN^XPAR(SDECUSER_";VA(200,","SDEC REQ MGR GRID FILTER",1,.FLTR,.ERR)
  1. I ERR S RET="-1^FILTER ERR: "_$P(ERR,U,1)_";"_$P(ERR,U,2) Q
  1. S RET="0^SUCCESS"
  1. ;
  1. Q
  1. ;
  1. GETRMGUP(RET,SDECUSER) ; Get Request Manager Grid preferences for user.
  1. ;
  1. ; RETURN: The Filter delimited by "|" as it was provided by GUI to store
  1. ; OR -1:ERR
  1. ;
  1. N ERR,SDI,SDC,FIL,FLTR
  1. S RET="" ;"T00500FILTER"_$C(30)
  1. S SDECUSER=$G(SDECUSER)
  1. I SDECUSER="" S SDECUSER=DUZ
  1. ; setup array for word processing
  1. D GETWP^XPAR(.FLTR,SDECUSER_";VA(200,","SDEC REQ MGR GRID FILTER",1,.ERR)
  1. ;I ERR S RET=RET_"-1: "_ERR_$C(30,31) Q
  1. I ERR S RET="-1: "_ERR Q
  1. S SDC=0 F S SDC=$O(FLTR(SDC)) Q:SDC="" D
  1. .S FIL=FLTR(SDC,0)
  1. .I $E(FIL,1,2)="~~" S RET=RET_$E(FIL,3,$L(FIL))
  1. .E S RET=RET_FLTR(SDC,0)
  1. S:RET="" RET="-1: NO USER PREFERENCE SET"
  1. ;.E S RET=RET_$S(SDC>1:"|",1:"")_FLTR(SDC,0)
  1. ;S:$O(FLTR(0)) RET=RET_$C(30)
  1. ;S RET=RET_$C(31)
  1. ;
  1. Q
  1. GET2(RET,SDECUSER) ; Get Request Manager Grid preferences for user.
  1. ;
  1. ; RETURN: The Filter delimited by "|" as it was provided by GUI to store
  1. ; OR -1:ERR
  1. ;
  1. N ERR,SDI,SDC,END,FIL,FLTR
  1. S END=78
  1. S RET="T00500FILTER"_$C(30)
  1. S SDECUSER=$G(SDECUSER)
  1. I SDECUSER="" S SDECUSER=DUZ
  1. ; setup array for word processing
  1. D GETWP^XPAR(.FLTR,SDECUSER_";VA(200,","SDEC REQ MGR GRID FILTER",1,.ERR)
  1. I ERR S RET=RET_"-1: "_ERR_$C(30,31) Q
  1. S SDC=0 F S SDC=$O(FLTR(SDC)) Q:SDC="" D
  1. .S FIL=FLTR(SDC,0)
  1. .S:$E(FIL,$L(FIL))="~" $E(FIL,$L(FIL))=" "
  1. .S RET=RET_FIL
  1. S:$O(FLTR(0)) RET=RET_$C(30)
  1. S RET=RET_$C(31)
  1. ;
  1. Q