Alert

public class Alert implements Comparable<Alert>

The alert class, the core of this module. Note that the alert module does not impose any interpretations on the fields of this class, that is left to the implementation that will make use of this module.

Constructors

Alert

public Alert()

Constructs a new alert with medium type, new status and 0 priority.

Alert

public Alert(String externalId, AlertType alertType, AlertStatus status, int priority, Map<String, String> data)

Creates a new instance of the alert without the name and description.

Parameters:
  • externalId – the external id of this alert
  • alertType – the type of this alert
  • status – the status of this alert
  • priority – the number representing the alert priority
  • data – the additional data for this alert

Alert

public Alert(String externalId, String name, String description, AlertType alertType, AlertStatus status, int priority, Map<String, String> data)

Creates a new instance of an alert.

Parameters:
  • externalId – the external id of this alert
  • name – the short name of this alert
  • description – the description of this alert
  • alertType – the type of this alert
  • status – the status of this alert
  • priority – the number representing the alert priority
  • data – the additional data for this alert

Methods

compareTo

public int compareTo(Alert o)

equals

public boolean equals(Object o)

getAlertType

public AlertType getAlertType()

Returns the type of this alert. The type describes the importance of this alert.

Returns:the type of this alert

getData

public Map<String, String> getData()

Returns the additional data for this alert. This a string-string map that allows implementations to place additional data in the alert.

Returns:the data map for this alert

getDateTime

public DateTime getDateTime()

Returns the datetime of this alert. Usually describes when the alert should be/was delivered.

Returns:the datetime of this alert

getDateTimeInMillis

public long getDateTimeInMillis()

Returns the value of getDateTime() as milliseconds from 1970-01-01T00:00:00Z.

Returns:the datetime of this alert in milliseconds

getDescription

public String getDescription()
Returns:the description of this alert

getExternalId

public String getExternalId()

Gets the external id for this alert. The external id can be used for associating this alert with different external concepts, such as patients, doctors, etc.

Returns:the external id of this alert

getId

public Long getId()
Returns:the id of this alert (auto-generated field)

getName

public String getName()

Returns the name of this alert. Can be used for giving alerts short, human-friendly descriptions.

Returns:the name of this alert

getPriority

public Long getPriority()

Returns the priority of this value in number format (long). This is independent from the alert type.

Returns:the priority of this alert

getStatus

public AlertStatus getStatus()

Returns the status of this alert, describing whether it is a new alert, a read alert or a closed alert. The actual meaning of those values is left to the implementation.

Returns:the status of this alert

hashCode

public int hashCode()

setAlertType

public void setAlertType(AlertType alertType)

Sets the type of this alert. The type describes the importance of this alert.

Parameters:
  • alertType – the type of this alert

setData

public void setData(Map<String, String> data)

Sets the additional data for this alert. This a string-string map that allows implementations to place additional data in the alert.

Parameters:
  • data – the data map for this alert

setDateTime

public void setDateTime(DateTime dateTime)

Sets the datetime of this alert. Usually describes when the alert should be/was delivered.

Parameters:
  • dateTime – the datetime of this alert

setDescription

public void setDescription(String description)
Parameters:
  • description – a description of this alert

setExternalId

public void setExternalId(String externalId)

Sets the external id for this alert. The external id can be used for associating this alert with different external concepts, such as patients, doctors, etc.

Parameters:
  • externalId – external id of this alert

setId

public void setId(Long id)
Parameters:
  • id – the id of this alert (auto-generated field)

setName

public void setName(String name)

Sets the name of this alert. Can be used for giving alerts short, human-friendly descriptions.

Parameters:
  • name – the name of this alert

setPriority

public void setPriority(Long priority)

Sets the priority of this value in number format (long). This is independent from the alert type.

Parameters:
  • priority – the priority of this alert

setStatus

public void setStatus(AlertStatus status)

Sets the status of this alert, describing whether it is a new alert, a read alert or a closed alert. The actual meaning of those values is left to the implementation.

Parameters:
  • status – the status of this alert

toString

public String toString()