Class RecordingAlertArchiveRepository
- Namespace
- adas_core.Infrastructure.Repositories
- Assembly
- adas-core.Infrastructure.dll
Represents a MongoDB repository responsible for managing archived patient recording alerts, exposing archive-specific data access operations through the recording alert archive repository contract.
public class RecordingAlertArchiveRepository : MongoRepository<PatientRecordingAlert>, IRecordingAlertArchiveRepository, IMongoRepository<PatientRecordingAlert>
- Inheritance
-
RecordingAlertArchiveRepository
- Implements
- Inherited Members
- Extension Methods
Constructors
RecordingAlertArchiveRepository(IOptions<ApiSettings>, IMongoDatabase)
public RecordingAlertArchiveRepository(IOptions<ApiSettings> apiSettings, IMongoDatabase database)
Parameters
apiSettingsIOptions<ApiSettings>databaseIMongoDatabase
Methods
DeleteBeforeDate(DateTime)
Deletes all PatientRecordingAlert records whose Time is earlier than the specified cutoff date.
public Task DeleteBeforeDate(DateTime date)
Parameters
dateDateTimeThe cutoff date; records with a time strictly before this value will be removed.
Returns
GetCollectionName()
Gets the collection name for archive patients recording alerts, returning the configured value from API settings or a default name when no setting is provided.
public override string GetCollectionName()
Returns
- string
The configured collection name from
_apiSettings.ArchivePatientsRecordingalerts, or the default "archive_patients_recordingalerts" if the setting is null.
InsertBatch(IEnumerable<PatientRecordingAlert>)
Bulk inserts a collection of patient recording alerts using a single batch operation and returns the number of documents successfully inserted.
public Task<long> InsertBatch(IEnumerable<PatientRecordingAlert> patientRecordingAlerts)
Parameters
patientRecordingAlertsIEnumerable<PatientRecordingAlert>The patient recording alerts to insert into the collection.
Returns
InsertOneAsync(PatientRecordingAlert)
Asynchronously inserts a new PatientRecordingAlert into the underlying collection.
public override Task InsertOneAsync(PatientRecordingAlert patientRecordingAlert)
Parameters
patientRecordingAlertPatientRecordingAlertThe patient recording alert document to persist.