Kernel 8.0 APIs Banner
Office of Information and Technology (OIT) Banner
[skip navigation]

SETSURO1^XQALSURO(): Establish a Surrogate for Alerts

Reference Type: Supported, Category: Alerts, ICR#: 3213

Description

The SETSURO1^XQALSURO API establishes a surrogate for alerts. It should be used instead of the (obsolete) SETSURO^XQALSURO API. The SETSURO1^XQALSURO API also tests for cyclic relationships (such that the user eventually would become the surrogate). SETSURO1 does these tests, and therefore, has the possibility of failure. It returns either of the following values:

Previously, the (obsolete) SETSURO^XQALSURO API returned no value and, as long as both a user and surrogate were specified, would simply store the values. This left open the possibility that the user was specified as the surrogate or that a chain of surrogates ended up pointing again at the user; cases that could result in a very tight, non-ending, loop being generated if an alert was sent. These possibilities have been tested for in the interactive specification of surrogates, and is tested for non-interactive usage in the SETSURO1^XQALSURO API.

NOTE: The SETSURO1^XQALSURO API should be used instead of the (obsolete) SETSURO^XQALSURO API (i.e., ICR #2790).

Format

  SETSURO1^XQALSURO(xqauser,xqalsuro[,xqalstrt][,xqalend])

Input Parameters

xqauser:

(required) User's DUZ number (i.e., Internal Entry Number in the NEW PERSON [#200] file) for which the surrogate should act in receiving alerts.

xqalsuro:

(required) Surrogate's DUZ number (i.e., Internal Entry Number in the NEW PERSON [#200] file) for the user who receives and process alerts for xqauser.

xqalstrt:

(optional) The start date/time or the surrogate activity, in VA FileMan internal format. If the start date/time is not specified, the surrogate relationship begins immediately.

xqalend:

(optional) The end date/time for the end of the surrogate relationship, in VA FileMan internal format. If the end date/time is not specified, the surrogate remains active until another surrogate is specified or the surrogate is deleted.

Output

returns:

Returns:

  • IEN (value > 0; True)—Surrogate was created successfully.

  • Text String (False)—Text explaining why the surrogate was not created.

Example

>S XQAUSER=DUZ

>S XQASURRO=45

>S XQASTART=3001004.1630

>S XQAEND=3001008.1630

>S X=$$SETSURO1^XQALSURO(XQAUSER,XQASURRO,XQASTART,XQAEND)

>I 'X W !,"Could not activate surrogate",!,?5,X Q