Interface IPumpAlarmStateRepository
- Namespace
- adas_core.Application.Repositories.Interfaces
- Assembly
- adas-core.Application.dll
public interface IPumpAlarmStateRepository
- Extension Methods
Methods
DeleteByPatientId(ObjectId)
Deletes records associated with the specified patient identifier.
Task DeleteByPatientId(ObjectId patientId)
Parameters
patientIdObjectIdThe unique identifier of the patient whose related records should be removed.
Returns
FindActiveAsync(string, AlarmType?, string?)
Asynchronously retrieves the active alarm state for a specified device, optionally filtered by alarm type and alarm code.
Returns null when no matching active alarm state is found.
Task<PumpAlarmState?> FindActiveAsync(string deviceId, PumpEnum.AlarmType? alarmType, string? alarmCodeMdc = null)
Parameters
deviceIdstringThe identifier of the device whose active alarm state is being queried.
alarmTypePumpEnum.AlarmType?The optional alarm type to filter the search by; if
null, no alarm type filter is applied.alarmCodeMdcstringThe optional MDC alarm code to further filter the search; if
null, no alarm code filter is applied.
Returns
- Task<PumpAlarmState>
A Task<TResult> containing the active PumpAlarmState, or
nullif no matching active alarm state exists.
FindAllActiveByDeviceAsync(string)
Asynchronously retrieves all active pump alarm states associated with the specified device.
Task<IEnumerable<PumpAlarmState>> FindAllActiveByDeviceAsync(string deviceId)
Parameters
deviceIdstringThe unique identifier of the device whose active pump alarm states are being queried.
Returns
- Task<IEnumerable<PumpAlarmState>>
A task representing the asynchronous operation, containing a collection of active PumpAlarmState entries for the given device.
RemoveAsync(string, AlarmType?, string?)
Asynchronously removes alarm records associated with the specified device, optionally filtered by alarm type and alarm code.
Task RemoveAsync(string deviceId, PumpEnum.AlarmType? alarmType, string? alarmCodeMdc = null)
Parameters
deviceIdstringThe identifier of the device whose alarms should be removed.
alarmTypePumpEnum.AlarmType?The optional alarm type to filter the removal; when null, all alarm types are considered.
alarmCodeMdcstringThe optional alarm code (MDC) to further filter the removal; when null, no code filter is applied.
Returns
UpdateManyObjectIdByFieldNameAsync(string, ObjectId, ObjectId)
Asynchronously updates the MongoDB.Bson.ObjectId value in multiple documents identified by the specified field name, replacing oldId with newId, and returns the number of documents affected.
Task<long> UpdateManyObjectIdByFieldNameAsync(string fieldName, ObjectId newId, ObjectId oldId)
Parameters
fieldNamestringThe name of the field whose value will be updated.
newIdObjectIdThe new MongoDB.Bson.ObjectId value to assign.
oldIdObjectIdThe existing MongoDB.Bson.ObjectId value to be replaced.
Returns
- Task<long>
A Task<TResult> that represents the asynchronous operation. The task result contains the number of documents updated.
UpsertActiveAsync(PumpAlarmState)
Inserts a new active pump alarm state or updates the existing one, maintaining the current state for the alarm.
Task UpsertActiveAsync(PumpAlarmState state)
Parameters
statePumpAlarmStateThe pump alarm state to upsert as the active record.