OmnichannelAlertsResource

Omni-channel alerts under /v1/omnichannel-alerts: Ovok runs the project's rule on each Signals alert event and tells the people it names by push and email.

  • Stable unknown
  • Release candidate not available
  • Development since 0.2.0-dev.32+058a03c
public final class OmnichannelAlertsResource

Omni-channel alerts under /v1/omnichannel-alerts: Ovok runs the project's rule on each Signals alert event and tells the people it names by push and email. For project admins. Get it from Ovok.omnichannelAlerts().

Methods

rules

public OmnichannelAlertsResource.Rules rules()

Returns the project's alert notifications rule.

Returns: the rules resource

preview

public JsonNode preview(
        Object preview,
        RequestOptions options) throws IOException, InterruptedException

Previews who the rule tells of a sample alert event; nothing is sent (POST /v1/omnichannel-alerts/preview).

Parameters:

  • preview: the patientId, an optional event (alert.triggered when omitted), an optional sample alert and an optional notifications rule to try instead of the project's own
  • options: per-request options, such as the timeout

Returns: the notify entries the rule answers, each with the people it reaches

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

OmnichannelAlertsResource.Rules

public static final class Rules

The project's alert notifications rule (/v1/omnichannel-alerts/rules), JSON Logic passed through.

Rules.retrieve

public JsonNode retrieve(RequestOptions options) throws IOException, InterruptedException

Reads the rule (GET /v1/omnichannel-alerts/rules).

Parameters:

  • options: per-request options, such as the timeout

Returns: the rule under notifications, null when the project has none

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

Rules.update

public JsonNode update(Object rule, RequestOptions options) throws IOException, InterruptedException

Sets the rule; Ovok checks the channels and recipients it names (PUT /v1/omnichannel-alerts/rules).

Parameters:

  • rule: the rule, with its JSON Logic under logic
  • options: per-request options, such as the timeout

Returns: the rule as Ovok now runs it

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

Rules.remove

public void remove(RequestOptions options) throws IOException, InterruptedException

Removes the rule, so nobody is told of a new alert (DELETE /v1/omnichannel-alerts/rules).

Parameters:

  • options: per-request options, such as the timeout

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

Last updated on

On this page