=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===
This commit is contained in:
@@ -14,6 +14,7 @@ namespace adas_core.Application.Subscriptions;
|
||||
/// <remarks>
|
||||
/// This service depends on an optional cache, a grouped observation service, a logger, and a lazily-initialized client message service to support its subscriber-related operations.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=01f4003 -->
|
||||
public class SubscriberGroupedService(
|
||||
ICacheService? cacheService,
|
||||
IGroupedObservationService groupedObservationService,
|
||||
@@ -48,6 +49,7 @@ public class SubscriberGroupedService(
|
||||
/// Returns a thread-safe snapshot of the grouped subscribers as a new list. The internal collection is locked during the copy to ensure consistency and prevent concurrent modification.
|
||||
/// </summary>
|
||||
/// <returns>A new <see cref="List{WsSubscriberGrouped}"/> containing a copy of the grouped subscribers.</returns>
|
||||
/// <!-- aidoc:v1 sig=6e3438d body=29d89cc -->
|
||||
public List<WsSubscriberGrouped> GetGrouped()
|
||||
{
|
||||
lock (_subscriberGrouped)
|
||||
@@ -60,6 +62,7 @@ public class SubscriberGroupedService(
|
||||
/// Removes all grouped observations associated with the specified patient identifier from the subscriber collection in a thread-safe manner.
|
||||
/// </summary>
|
||||
/// <param name="patientId">The string representation of the patient identifier used to locate and remove the matching grouped observations.</param>
|
||||
/// <!-- aidoc:v1 sig=60f9191 body=6bbfa2e -->
|
||||
public void RemoveGroupedObsByPatientId(string patientId)
|
||||
{
|
||||
lock (_subscriberGrouped)
|
||||
@@ -76,6 +79,10 @@ public class SubscriberGroupedService(
|
||||
/// </summary>
|
||||
/// <param name="patientId">objectId on db for Patient</param>
|
||||
/// <param name="newLocation"></param>
|
||||
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
|
||||
/// "Summary describes conditional removal logic distinguishing section vs box subscribers, but the code removes ALL wsSubscribers for the given patientId without any section/box differentiation." -->
|
||||
/// <!-- aidoc-review:v1 severity=high kind=mentions_removed_behavior
|
||||
/// "Summary mentions BoxSubscribers and SectionSubscribers with conditional behavior that does not exist in the code; CheckEmptySubscriberGroup is called but no selective filtering is performed." -->
|
||||
public void RemoveWsSubscriberByLocation(string patientId, PatientLocation? newLocation)
|
||||
{
|
||||
lock (_subscriberGrouped)
|
||||
@@ -100,6 +107,7 @@ public class SubscriberGroupedService(
|
||||
/// </summary>
|
||||
/// <param name="patientId">The patient identifier used to locate the subscriber groups to update.</param>
|
||||
/// <param name="wsIdToRemove">The WebSocket subscriber ID to remove from the matching subscriber and group collections.</param>
|
||||
/// <!-- aidoc:v1 sig=66711e2 body=1eb38c9 -->
|
||||
public void RemoveWsSubscriberPatientIdAndWsId(string patientId, string wsIdToRemove)
|
||||
{
|
||||
lock (_subscriberGrouped)
|
||||
@@ -139,6 +147,8 @@ public class SubscriberGroupedService(
|
||||
/// Object with properties to generate new grouped observations, clients using those
|
||||
/// grouped obsercations and the generated list of grouped observations
|
||||
/// </param>
|
||||
/// <!-- aidoc-review:v1 severity=medium kind=missing_returns
|
||||
/// "Method returns a List<string> describing what was removed (e.g. 'ws:{PatientId}-{Names}-{Regularity}-{Group.Count}' when the whole object is removed, or 'group:{key}' per removed group), but no <returns> tag exists." -->
|
||||
public List<string> CheckEmptySubscriberGroup(WsSubscriberGrouped? wsSubscriberGrouped)
|
||||
{
|
||||
lock (_subscriberGrouped)
|
||||
@@ -179,6 +189,7 @@ public class SubscriberGroupedService(
|
||||
/// Uses locking to ensure that concurrent calls do not corrupt the subscriber list.
|
||||
/// </summary>
|
||||
/// <param name="wsSubscriberGrouped">The grouped WebSocket subscriber instance to be added to the collection.</param>
|
||||
/// <!-- aidoc:v1 sig=38538c1 body=b4c236b -->
|
||||
public void AddSubscriberGrouped(WsSubscriberGrouped wsSubscriberGrouped)
|
||||
{
|
||||
lock (_subscriberGrouped)
|
||||
@@ -195,6 +206,7 @@ public class SubscriberGroupedService(
|
||||
/// <param name="timeZoneId">The optional time zone identifier applied to the new subscription when one is created.</param>
|
||||
/// <param name="connectionId">The unique identifier of the client connection being registered.</param>
|
||||
/// <param name="lastObsInGroup">The most recent observation in the group, used to initialize a new subscription.</param>
|
||||
/// <!-- aidoc:v1 sig=fbd3149 body=ea8c43a -->
|
||||
public void CheckOnSubscriptionGroup(GroupedField groupedField, ObjectId patientId, string? timeZoneId,
|
||||
string connectionId, GroupedObservation lastObsInGroup)
|
||||
{
|
||||
@@ -235,6 +247,7 @@ public class SubscriberGroupedService(
|
||||
/// </summary>
|
||||
/// <param name="wsgHashCode">The hash code used to identify the target subscriber group whose last grouped observation should be updated.</param>
|
||||
/// <param name="newGroupedObservation">The new <see cref="GroupedObservation"/> to set as the last grouped observation in the matched group.</param>
|
||||
/// <!-- aidoc:v1 sig=da02c06 body=39de597 -->
|
||||
public void UpdateLastGroupedObsInGroup(string wsgHashCode, GroupedObservation newGroupedObservation)
|
||||
{
|
||||
lock (_subscriberGrouped)
|
||||
@@ -247,6 +260,7 @@ public class SubscriberGroupedService(
|
||||
/// Creates the next empty grouped observation for the supplied WebSocket subscriber group and distributes it asynchronously to every subscriber in the group, applying the subscriber-specific group value resolved from the group mapping.
|
||||
/// </summary>
|
||||
/// <param name="ws">The grouped WebSocket subscriber context whose next empty observation is generated and whose subscribers will receive the notification.</param>
|
||||
/// <!-- aidoc:v1 sig=cabbfc3 body=1ebe417 -->
|
||||
private async Task AddEmptyObs(WsSubscriberGrouped ws)
|
||||
{
|
||||
var gobs = await groupedObservationService.CreateNextEmptyObs(ws);
|
||||
|
||||
Reference in New Issue
Block a user