# Interface ISubscriberGroupedService

Namespace
  adas_core.Application.Services.Interfaces

Assembly
  adas-core.Application.dll

    public interface ISubscriberGroupedService

Extension Methods
  NumberUtils.IsNumber(object)
  NumberUtils.ToDouble(object)
  ObjectUtils.ToStr(object?)

## Methods

### AddSubscriberGrouped(WsSubscriberGrouped)

Adds a new subscriber together with its associated group information to the system.

    void AddSubscriberGrouped(WsSubscriberGrouped wsSubscriberGrouped)

#### Parameters

`wsSubscriberGrouped` WsSubscriberGrouped

  The web service representation of the subscriber and its group assignments to be added.

### CheckEmptySubscriberGroup(WsSubscriberGrouped)

Validates the provided WsSubscriberGrouped instance to identify empty subscriber groups.

    List<string> CheckEmptySubscriberGroup(WsSubscriberGrouped wsl)

#### Parameters

`wsl` WsSubscriberGrouped

  The subscriber group instance to be checked for empty groups.

#### Returns

List<string>

  A List<T> containing validation messages for any empty subscriber groups found; returns an empty list if all groups are valid.

### CheckOnSubscriptionGroup(GroupedField, ObjectId, string, string, GroupedObservation)

Checks subscription-related conditions for a grouped field and its associated grouped observation.

    void CheckOnSubscriptionGroup(GroupedField groupedField, ObjectId patientId, string timeZoneId, string connectionId, GroupedObservation go)

#### Parameters

`groupedField` GroupedField

  The grouped field to evaluate.

`patientId` ObjectId

  The identifier of the patient associated with the observation.

`timeZoneId` string

  The time zone identifier used for the observation context.

`connectionId` string

  The connection identifier for the current request or session.

`go` GroupedObservation

  The grouped observation to be checked against the subscription.

### GetGrouped()

Retrieves a list of subscribers organized into groups.

    List<WsSubscriberGrouped> GetGrouped()

#### Returns

List<WsSubscriberGrouped>

  A list of WsSubscriberGrouped instances representing the grouped subscribers.

### RemoveGroupedObsByPatientId(string)

Removes grouped observations associated with the specified patient identifier.

    void RemoveGroupedObsByPatientId(string patientId)

#### Parameters

`patientId` string

  The unique identifier of the patient whose grouped observations should be removed.

### RemoveWsSubscriberByLocation(string, PatientLocation?)

Removes a WebSocket subscriber associated with the specified patient based on the provided location.

    void RemoveWsSubscriberByLocation(string patientId, PatientLocation? newLocation)

#### Parameters

`patientId` string

  The identifier of the patient whose WebSocket subscriber should be removed.

`newLocation` PatientLocation

  The new patient location used to identify the subscriber to remove, or null to remove without location filtering.

### RemoveWsSubscriberPatientIdAndWsId(string, string)

Removes the specified workstation identifier associated with a patient's WS subscriber entry.

    void RemoveWsSubscriberPatientIdAndWsId(string patientId, string wsIdToRemove)

#### Parameters

`patientId` string

  The identifier of the patient whose WS subscriber entry will be updated.

`wsIdToRemove` string

  The workstation identifier to remove from the patient's WS subscriber entry.

### UpdateLastGroupedObsInGroup(string, GroupedObservation)

Updates the most recent grouped observation in the group identified by the specified hash code with the new grouped observation.

    void UpdateLastGroupedObsInGroup(string wsgHashCode, GroupedObservation newGroupedObservation)

#### Parameters

`wsgHashCode` string

  The hash code identifying the group whose last grouped observation should be updated.

`newGroupedObservation` GroupedObservation

  The new grouped observation to set as the last grouped observation in the group.