using adas_core.Application.Subscriptions; using adas_core.Domain.Models; using adas_core.Domain.Models.GroupedObservations; using MongoDB.Bson; namespace adas_core.Application.Services.Interfaces; public interface ISubscriberGroupedService { /// /// Retrieves a list of subscribers organized into groups. /// /// A list of instances representing the grouped subscribers. List GetGrouped(); /// /// Removes grouped observations associated with the specified patient identifier. /// /// The unique identifier of the patient whose grouped observations should be removed. void RemoveGroupedObsByPatientId(string patientId); /// /// Removes a WebSocket subscriber associated with the specified patient based on the provided location. /// /// The identifier of the patient whose WebSocket subscriber should be removed. /// The new patient location used to identify the subscriber to remove, or null to remove without location filtering. void RemoveWsSubscriberByLocation(string patientId, PatientLocation? newLocation); /// /// Removes the specified workstation identifier associated with a patient's WS subscriber entry. /// /// The identifier of the patient whose WS subscriber entry will be updated. /// The workstation identifier to remove from the patient's WS subscriber entry. void RemoveWsSubscriberPatientIdAndWsId(string patientId, string wsIdToRemove); /// /// Validates the provided instance to identify empty subscriber groups. /// /// The subscriber group instance to be checked for empty groups. /// A containing validation messages for any empty subscriber groups found; returns an empty list if all groups are valid. List CheckEmptySubscriberGroup(WsSubscriberGrouped wsl); /// /// Adds a new subscriber together with its associated group information to the system. /// /// The web service representation of the subscriber and its group assignments to be added. void AddSubscriberGrouped(WsSubscriberGrouped wsSubscriberGrouped); /// /// Checks subscription-related conditions for a grouped field and its associated grouped observation. /// /// The grouped field to evaluate. /// The identifier of the patient associated with the observation. /// The time zone identifier used for the observation context. /// The connection identifier for the current request or session. /// The grouped observation to be checked against the subscription. void CheckOnSubscriptionGroup(GroupedField groupedField, ObjectId patientId, string timeZoneId, string connectionId, GroupedObservation go); /// /// Updates the most recent grouped observation in the group identified by the specified hash code with the new grouped observation. /// /// The hash code identifying the group whose last grouped observation should be updated. /// The new grouped observation to set as the last grouped observation in the group. void UpdateLastGroupedObsInGroup(string wsgHashCode, GroupedObservation newGroupedObservation); }