Documentation modifications

This commit is contained in:
julian
2026-06-27 15:23:26 -07:00
parent a633fe6c06
commit a19fb90902
218 changed files with 2882 additions and 0 deletions
@@ -15,6 +15,12 @@ public class PumpAlarmStateRepository : MongoRepository<PumpAlarmState>, IPumpAl
{
private readonly ApiSettings _apiSettings;
/// <summary>
/// Initializes a new instance of the <see cref="PumpAlarmStateRepository"/> class, which persists pump alarm state data, by storing the resolved <see cref="ApiSettings"/> and delegating MongoDB initialization to the base repository.
/// </summary>
/// <param name="apiSettings">The <see cref="IOptions{ApiSettings}"/> instance whose <see cref="IOptions{TOptions}.Value"/> supplies the <see cref="ApiSettings"/> used by the repository.</param>
/// <param name="database">The <see cref="IMongoDatabase"/> passed to the base constructor to provide the underlying MongoDB connection.</param>
/// <!-- aidoc:v1 sig=df28b3e body=12fddac -->
public PumpAlarmStateRepository(IOptions<ApiSettings> apiSettings, IMongoDatabase database)
: base(database)
{
@@ -32,6 +38,10 @@ public class PumpAlarmStateRepository : MongoRepository<PumpAlarmState>, IPumpAl
return _apiSettings.PumpAlarmState ?? "pump_alarm_state";
}
/// <summary>
/// Creates the MongoDB indexes required by the <see cref="PumpAlarmState"/> collection: a unique compound index on <see cref="PumpAlarmState.DeviceId"/>, <see cref="PumpAlarmState.AlarmType"/>, and <see cref="PumpAlarmState.AlarmCodeMdc"/> (named <c>ux_device_alarm</c>), plus supporting indexes on <see cref="PumpAlarmState.DeviceId"/> and <see cref="PumpAlarmState.PatientId"/>.
/// </summary>
/// <!-- aidoc:v1 sig=4955da2 body=cfe5f4a -->
public override async Task CreateIndexes()
{
var indexModels = new List<CreateIndexModel<PumpAlarmState>>
@@ -80,6 +90,15 @@ public class PumpAlarmStateRepository : MongoRepository<PumpAlarmState>, IPumpAl
return await Collection.Find(filter).FirstOrDefaultAsync();
}
/// <summary>
/// Inserts or updates an active <see cref="PumpAlarmState"/> document, reusing the identifier of an
/// existing record that already matches the same <see cref="PumpAlarmState.DeviceId"/>, <see cref="PumpAlarmState.AlarmType"/>
/// and <see cref="PumpAlarmState.AlarmCodeMdc"/> combination, or generating a new <see cref="ObjectId"/> when
/// <paramref name="state"/> does not yet carry one.
/// </summary>
/// <param name="state">The <see cref="PumpAlarmState"/> to persist; its <see cref="PumpAlarmState.Id"/> is
/// populated from the matching document when one is found, or newly generated when it is currently <see cref="ObjectId.Empty"/>.</param>
/// <!-- aidoc:v1 sig=9119854 body=4bd6c92 -->
public async Task UpsertActiveAsync(PumpAlarmState state)
{
var filter =