=== 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:
julian
2026-06-28 02:50:05 -07:00
parent a19fb90902
commit 586f02a2ca
654 changed files with 5260 additions and 0 deletions
@@ -12,12 +12,14 @@ public interface IAdmissionRepository : IMongoRepository<Admission>
/// Deletes the entity identified by the specified identifier.
/// </summary>
/// <param name="id">The unique identifier of the entity to delete.</param>
/// <!-- aidoc:v1 sig=0112d17 -->
Task Delete(ObjectId id);
/// <summary>
/// Updates the specified admission record asynchronously.
/// </summary>
/// <param name="admission">The admission entity containing the updated information.</param>
/// <!-- aidoc:v1 sig=1180a0b -->
Task Update(Admission admission);
/// <summary>
@@ -25,6 +27,7 @@ public interface IAdmissionRepository : IMongoRepository<Admission>
/// </summary>
/// <param name="id">The unique identifier of the entity whose location is to be updated.</param>
/// <param name="newLocation">The identifier of the new location to assign to the entity.</param>
/// <!-- aidoc:v1 sig=a4e527f -->
Task UpdateLocation(ObjectId id, ObjectId newLocation);
/// <summary>
@@ -32,12 +35,14 @@ public interface IAdmissionRepository : IMongoRepository<Admission>
/// </summary>
/// <param name="id">The unique identifier of the patient to update.</param>
/// <param name="patient">The patient object containing the updated information to apply.</param>
/// <!-- aidoc:v1 sig=afe7c06 -->
Task UpdatePatient(ObjectId id, Person patient);
/// <summary>
/// Asynchronously retrieves all admission records.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains an <see cref="IEnumerable{Admission}"/> with all available admissions.</returns>
/// <!-- aidoc:v1 sig=7eecf14 -->
Task<IEnumerable<Admission>> FindAll();
/// <summary>
@@ -45,6 +50,7 @@ public interface IAdmissionRepository : IMongoRepository<Admission>
/// </summary>
/// <param name="id">The <see cref="ObjectId"/> of the <see cref="Admission"/> to look up.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the matching <see cref="Admission"/>, or <c>null</c> if no admission exists with the specified identifier.</returns>
/// <!-- aidoc:v1 sig=1fe8488 -->
Task<Admission?> FindById(ObjectId id);
/// <summary>
@@ -52,6 +58,7 @@ public interface IAdmissionRepository : IMongoRepository<Admission>
/// </summary>
/// <param name="nhc">The NHC (clinical history number) used to look up the admission.</param>
/// <returns>A task that resolves to the matching <see cref="Admission"/>, or <c>null</c> if no admission is found for the given NHC.</returns>
/// <!-- aidoc:v1 sig=c8b26b9 -->
Task<Admission?> FindByNhc(string nhc);
//Task<IEnumerable<Admission>?> FindByUnit(string unit);
@@ -61,6 +68,7 @@ public interface IAdmissionRepository : IMongoRepository<Admission>
/// </summary>
/// <param name="location">The patient location used to filter and find the relevant admissions.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of admissions matching the given location.</returns>
/// <!-- aidoc:v1 sig=c1ce2c3 -->
Task<List<Admission>> FindByLocation(PatientLocation location);
/// <summary>
@@ -68,12 +76,14 @@ public interface IAdmissionRepository : IMongoRepository<Admission>
/// </summary>
/// <param name="origin">The origin value used to filter the admissions.</param>
/// <returns>A task that represents the asynchronous operation, containing a collection of matching admissions, or <c>null</c> if no admissions are found for the given origin.</returns>
/// <!-- aidoc:v1 sig=ed6ddde -->
Task<IEnumerable<Admission>?> FindByOrigin(string origin);
/// <summary>
/// Asynchronously inserts a new <see cref="Admission"/> record into the data store and returns the resulting entity.
/// </summary>
/// <param name="origin">The <see cref="Admission"/> entity to be inserted.</param>
/// <returns>A task that represents the asynchronous insert operation, containing the inserted <see cref="Admission"/>, or <c>null</c> if no result is returned.</returns>
/// <!-- aidoc:v1 sig=2b0177a -->
Task<Admission?> InsertOneAsyncAndReturn(Admission origin);
/// <summary>
/// Searches for an admission matching the specified patient number and unit, returning a distinct result.
@@ -81,30 +91,35 @@ public interface IAdmissionRepository : IMongoRepository<Admission>
/// <param name="patientNumber">The patient's identifier used to locate the admission.</param>
/// <param name="unitId">The unique identifier of the unit to filter the search.</param>
/// <returns>A <see cref="Admission"/> if a matching record is found; otherwise, <c>null</c>.</returns>
/// <!-- aidoc:v1 sig=fb125ed -->
Task<Admission?> SearchByPatientNumberAndDistinctUnit(string patientNumber, ObjectId unitId);
/// <summary>
/// Asynchronously retrieves a list of admissions associated with the specified unit, excluding Point of Care (PoC) entries.
/// </summary>
/// <param name="unitId">The unique identifier of the unit whose admissions are being retrieved.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="Admission"/> records linked to the given unit, with PoC entries excluded.</returns>
/// <!-- aidoc:v1 sig=609220d -->
Task<List<Admission>> GetAdmissionByUnitIdWithOutPoC(ObjectId unitId);
/// <summary>
/// Retrieves a list of admissions associated with the specified point of care identifier.
/// </summary>
/// <param name="pocId">The unique identifier of the point of care used to filter the admissions.</param>
/// <returns>A task that represents the asynchronous operation, containing the list of admissions matching the specified point of care identifier.</returns>
/// <!-- aidoc:v1 sig=3e416fe -->
Task<List<Admission>> FindByPointOfCareId(ObjectId pocId);
/// <summary>
/// Asynchronously retrieves a list of admissions associated with the specified unit identifiers.
/// </summary>
/// <param name="unitIds">The list of unit identifiers used to look up the corresponding admissions.</param>
/// <returns>A task that represents the asynchronous operation, containing the list of admissions matching the provided unit identifiers.</returns>
/// <!-- aidoc:v1 sig=050b604 -->
Task<List<Admission>> FindByUnitIds(List<ObjectId> unitIds);
/// <summary>
/// Asynchronously counts the number of records associated with the specified unit identifier.
/// </summary>
/// <param name="unitId">The identifier of the unit used to filter the records.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the count of matching records.</returns>
/// <!-- aidoc:v1 sig=e0dfc62 -->
Task<long> CountByUnitId(ObjectId unitId);
/// <summary>
@@ -114,6 +129,7 @@ public interface IAdmissionRepository : IMongoRepository<Admission>
/// <param name="opt">The data transfer object containing the new master list option values to apply.</param>
/// <param name="typeName">The name of the option type to be updated.</param>
/// <returns>A task that represents the asynchronous operation, containing the collection of admissions affected by the update.</returns>
/// <!-- aidoc:v1 sig=fc94c14 -->
Task<IEnumerable<Admission>> UpdateMasterListOption(List<ObjectId> unitIds, UpdateOptionMasterListDto opt,
string typeName);
@@ -124,11 +140,13 @@ public interface IAdmissionRepository : IMongoRepository<Admission>
/// <param name="opt">The option to be removed from the master list.</param>
/// <param name="typeName">The name of the type associated with the master list option.</param>
/// <returns>A task that represents the asynchronous operation, containing the collection of <see cref="Admission"/> records affected by the deletion.</returns>
/// <!-- aidoc:v1 sig=248078c -->
Task<IEnumerable<Admission>> DeleteMasterListOption(List<ObjectId> unitIds, OptionList opt, string typeName);
/// <summary>
/// Asynchronously deletes admissions associated with the specified unit identifier.
/// </summary>
/// <param name="unitId">The identifier of the unit whose admissions will be deleted.</param>
/// <returns>A task that represents the asynchronous operation, containing a value indicating the result of the deletion.</returns>
/// <!-- aidoc:v1 sig=cb6488e -->
Task<bool> DeleteAdmissionsByUnitId(ObjectId unitId);
}
@@ -13,6 +13,7 @@ public interface IAlarmRepository : IMongoRepository<PatientObservationAlarm>
/// <param name="patientId">The unique identifier of the patient whose last observations should be aggregated.</param>
/// <param name="filterObservations">An optional list of fields used to restrict which observation types are included in the aggregation; when null, all available observations are considered.</param>
/// <returns>A task that resolves to the list of aggregated <see cref="PatientObservationAlarm"/> entries representing the patient's latest observations.</returns>
/// <!-- aidoc:v1 sig=b862090 -->
Task<List<PatientObservationAlarm>> AggregatedPatientLastObservationsByField(ObjectId patientId,
List<Field>? filterObservations = null);
@@ -23,6 +24,7 @@ public interface IAlarmRepository : IMongoRepository<PatientObservationAlarm>
/// <param name="filterObservations">An optional list of fields used to restrict which observations are considered. If null, no field-based filtering is applied.</param>
/// <param name="configAlarm">The list of configuration observation definitions used to build and aggregate the resulting alarms.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of aggregated <see cref="PatientObservationAlarm"/> entries for the patient.</returns>
/// <!-- aidoc:v1 sig=e1ec5ad -->
Task<List<PatientObservationAlarm>> AggregatedPatientNotExpiredObservationsByField(ObjectId patientId,
List<Field>? filterObservations, List<ConfigObservation> configAlarm);
}
@@ -8,16 +8,19 @@ public interface IAppointmentArchiveRepository
/// Asynchronously inserts a single patient appointment into the underlying data store.
/// </summary>
/// <param name="patientAppointment">The patient appointment entity to be persisted.</param>
/// <!-- aidoc:v1 sig=1116668 -->
Task InsertOneAsync(PatientAppointment patientAppointment);
/// <summary>
/// Asynchronously deletes records that have a date earlier than the specified cutoff date.
/// </summary>
/// <param name="date">The cutoff date; records dated before this value will be removed.</param>
/// <!-- aidoc:v1 sig=350661d -->
Task DeleteBeforeDate(DateTime date);
/// <summary>
/// Inserts a batch of patient appointments asynchronously, typically as part of a bulk import or synchronization process.
/// </summary>
/// <param name="appointment">The collection of patient appointments to be inserted.</param>
/// <returns>A task that represents the asynchronous insert operation, containing a long value that represents the result of the batch insertion.</returns>
/// <!-- aidoc:v1 sig=5df04bf -->
Task<long> InsertBatch(IEnumerable<PatientAppointment> appointment);
}
@@ -12,17 +12,20 @@ public interface IAppointmentRepository : IMongoRepository<PatientAppointment>
/// </summary>
/// <param name="patientId">The unique identifier of the patient whose appointments are being retrieved.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="PatientAppointment"/> objects for the specified patient.</returns>
/// <!-- aidoc:v1 sig=44280ba -->
Task<List<PatientAppointment>> GetByPatient(ObjectId patientId);
/// <summary>
/// Asynchronously inserts a single patient appointment record into the data store.
/// </summary>
/// <param name="appointment">The patient appointment entity to be inserted.</param>
/// <!-- aidoc:v1 sig=43c09a3 -->
new Task InsertOneAsync(PatientAppointment appointment);
/// <summary>
/// Updates an existing patient appointment asynchronously.
/// </summary>
/// <param name="appointment">The patient appointment containing the updated information.</param>
/// <!-- aidoc:v1 sig=75991de -->
Task Update(PatientAppointment appointment);
/// <summary>
/// Updates the <see cref="ObjectId"/> field identified by <paramref name="nameId"/> across many records, replacing the existing value <paramref name="oldId"/> with the new value <paramref name="id"/>.
@@ -30,22 +33,26 @@ public interface IAppointmentRepository : IMongoRepository<PatientAppointment>
/// <param name="nameId">The name of the field that contains the <see cref="ObjectId"/> to update.</param>
/// <param name="id">The new <see cref="ObjectId"/> value to assign to matching records.</param>
/// <param name="oldId">The current <see cref="ObjectId"/> value to be replaced.</param>
/// <!-- aidoc:v1 sig=24ef97c -->
Task UpdateManyObjectId(string nameId, ObjectId id, ObjectId oldId);
/// <summary>
/// Asynchronously deletes the entity identified by the specified identifier.
/// </summary>
/// <param name="id">The ObjectId of the entity to delete.</param>
/// <!-- aidoc:v1 sig=9f8dfa3 -->
new Task DeleteAsync(ObjectId id);
/// <summary>
/// Asynchronously retrieves a cursor of <see cref="PatientAppointment"/> records associated with the specified patient identifier.
/// </summary>
/// <param name="patientId">The unique <see cref="ObjectId"/> of the patient whose appointments are being queried.</param>
/// <returns>A <see cref="Task{IAsyncCursor{PatientAppointment}}"/> that yields the matching patient appointments; the cursor may be empty if no appointments are found for the given patient.</returns>
/// <!-- aidoc:v1 sig=2d5cd9f -->
Task<IAsyncCursor<PatientAppointment>> FindByPatientIdAsync(ObjectId patientId);
/// <summary>
/// Asynchronously deletes records associated with the specified patient identifier.
/// </summary>
/// <param name="patientId">The unique ObjectId of the patient whose related records should be removed.</param>
/// <!-- aidoc:v1 sig=1e79565 -->
Task DeleteByPatientId(ObjectId patientId);
/// <summary>
/// Asynchronously retrieves a <see cref="PatientAppointment"/> matching the specified patient identifier and visit number.
@@ -53,6 +60,7 @@ public interface IAppointmentRepository : IMongoRepository<PatientAppointment>
/// <param name="patientId">The unique identifier of the patient whose appointment should be located.</param>
/// <param name="visitNumber">The visit number used to identify the specific appointment for the patient.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the matching <see cref="PatientAppointment"/> if found; otherwise, <c>null</c>.</returns>
/// <!-- aidoc:v1 sig=60947c5 -->
Task<PatientAppointment?> FindByPatientAndVisitNumber(ObjectId patientId, string visitNumber);
/// <summary>
/// Asynchronously retrieves a patient appointment matching the specified patient identifier and appointment reason.
@@ -61,17 +69,20 @@ public interface IAppointmentRepository : IMongoRepository<PatientAppointment>
/// <param name="patientId">The unique identifier of the patient whose appointment should be located.</param>
/// <param name="appointmentReason">The appointment reason used to filter the lookup, or <c>null</c> to match any reason.</param>
/// <returns>A <see cref="Task{PatientAppointment}"/> that resolves to the matching <see cref="PatientAppointment"/>, or <c>null</c> if none exists.</returns>
/// <!-- aidoc:v1 sig=e3683e7 -->
Task<PatientAppointment?> FindByPatientAndReason(ObjectId patientId, string? appointmentReason);
/// <summary>
/// Retrieves a list of patient appointments associated with the specified location.
/// </summary>
/// <param name="location">The patient location used to filter and retrieve matching appointments.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="PatientAppointment"/> entries for the given location.</returns>
/// <!-- aidoc:v1 sig=8d1c435 -->
Task<List<PatientAppointment>> FindByLocation(PatientLocation location);
/// <summary>
/// Asynchronously retrieves the list of patient appointments associated with the specified point of care.
/// </summary>
/// <param name="poc">The point of care used to filter the patient appointments.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains a list of patient appointments for the given point of care.</returns>
/// <!-- aidoc:v1 sig=2cf49d9 -->
Task<List<PatientAppointment>> FindByPoC(PointOfCare poc);
}
@@ -10,23 +10,27 @@ public interface IArchivePatientCarePlanRepository : IMongoRepository<PatientCar
/// </summary>
/// <param name="patientId">The unique identifier of the patient whose care plans should be retrieved.</param>
/// <returns>A task that returns a list of <see cref="PatientCarePlan"/> objects for the given patient, or <c>null</c> when no care plans are found.</returns>
/// <!-- aidoc:v1 sig=5c4d553 -->
Task<List<PatientCarePlan>?> FindByPatientId(ObjectId patientId);
/// <summary>
/// Retrieves the list of patient care plans associated with the specified patient identifier.
/// </summary>
/// <param name="patientId">The unique identifier of the patient whose care plans are being queried.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains a list of <see cref="PatientCarePlan"/> for the given patient, or <c>null</c> if no care plans are found.</returns>
/// <!-- aidoc:v1 sig=6cb79cd -->
Task<List<PatientCarePlan>?> FindByPatientId(string patientId);
/// <summary>
/// Asynchronously retrieves the list of care plans associated with the specified patient number, returning <c>null</c> when no matching care plans are found.
/// </summary>
/// <param name="patientId">The patient number used to look up the associated care plans.</param>
/// <returns>A task representing the asynchronous operation, containing a list of <see cref="PatientCarePlan"/> entries for the patient, or <c>null</c> if none exist.</returns>
/// <!-- aidoc:v1 sig=e73ac89 -->
Task<List<PatientCarePlan>?> FindByPatientNumber(string patientId);
/// <summary>
/// Asynchronously retrieves all patient care plans from the data store.
/// </summary>
/// <returns>A task that represents the asynchronous operation, containing a list of all <see cref="PatientCarePlan"/> entries.</returns>
/// <!-- aidoc:v1 sig=83af170 -->
Task<List<PatientCarePlan>> FindAll();
/// <summary>
@@ -36,6 +40,7 @@ public interface IArchivePatientCarePlanRepository : IMongoRepository<PatientCar
/// <param name="oldPatientPatientId">An optional legacy patient ID string used as an additional lookup criterion.</param>
/// <param name="oldPatientPatientNumber">An optional legacy patient number string used as an additional lookup criterion.</param>
/// <returns>A <see cref="Task{TResult}"/> containing a nullable list of <see cref="PatientCarePlan"/> records, or <c>null</c> if no matching care plans are found.</returns>
/// <!-- aidoc:v1 sig=d0b7192 -->
Task<List<PatientCarePlan>?> FindByIds(ObjectId oldPatientId, string? oldPatientPatientId,
string? oldPatientPatientNumber);
@@ -43,5 +48,6 @@ public interface IArchivePatientCarePlanRepository : IMongoRepository<PatientCar
/// Asynchronously inserts a collection of patient care plans into the underlying data store.
/// </summary>
/// <param name="patientCarePla">The list of <see cref="PatientCarePlan"/> records to be inserted.</param>
/// <!-- aidoc:v1 sig=fea7cc8 -->
Task InsertManyAsync(List<PatientCarePlan> patientCarePla);
}
@@ -10,46 +10,54 @@ public interface IAuthorityRepository : IMongoRepository<Authorization>
/// </summary>
/// <param name="authId">The unique identifier of the authorization to retrieve.</param>
/// <returns>A task that represents the asynchronous operation, containing the <see cref="Authorization"/> that matches the specified identifier.</returns>
/// <!-- aidoc:v1 sig=65df479 -->
public Task<Authorization> GetById(ObjectId authId);
/// <summary>
/// Creates a new authority assignment for the specified user with the given role name.
/// </summary>
/// <param name="roleName">The name of the role to assign as the new authority.</param>
/// <param name="userId">The identifier of the user to whom the authority will be assigned.</param>
/// <!-- aidoc:v1 sig=45c3591 -->
void CreateNewAuthority(string roleName, ObjectId userId);
/// <summary>
/// Retrieves the list of authorizations (authorities/permissions) associated with the specified user.
/// </summary>
/// <param name="userId">The unique identifier of the user whose authorities are being requested.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the list of <see cref="Authorization"/> entries assigned to the user.</returns>
/// <!-- aidoc:v1 sig=1476a1a -->
public Task<List<Authorization>> GetUserAuthorities(ObjectId userId);
/// <summary>
/// Asynchronously retrieves all available authorizations.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains a list of all <see cref="Authorization"/> objects.</returns>
/// <!-- aidoc:v1 sig=dd351e0 -->
public Task<List<Authorization>> GetAllAuthorities();
/// <summary>
/// Asynchronously deletes all authorities associated with the specified user.
/// </summary>
/// <param name="userId">The unique identifier of the user whose authorities will be removed.</param>
/// <returns>A task that represents the asynchronous operation. The task result is <c>true</c> if authorities were deleted; otherwise, <c>false</c>.</returns>
/// <!-- aidoc:v1 sig=f6a59e6 -->
public Task<bool> DeleteAllAuthoritiesByUser(ObjectId userId);
/// <summary>
/// Deletes all authorities associated with the specified unit.
/// </summary>
/// <param name="unitId">The unique identifier of the unit whose authorities should be removed.</param>
/// <returns>A task that resolves to <c>true</c> if the authorities were successfully deleted; otherwise, <c>false</c>.</returns>
/// <!-- aidoc:v1 sig=1f7fa45 -->
Task<bool> DeleteAllAuthoritiesByUnit(ObjectId unitId);
/// <summary>
/// Deletes all authorities associated with the specified display identifier.
/// </summary>
/// <param name="displayId">The identifier of the display whose related authorities should be removed.</param>
/// <returns>A task that resolves to a boolean indicating the outcome of the deletion operation.</returns>
/// <!-- aidoc:v1 sig=f1cb547 -->
Task<bool> DeleteAllAuthoritiesByDisplay(ObjectId displayId);
/// <summary>
/// Retrieves a list of authorizations associated with the specified unit identifier.
/// </summary>
/// <param name="unitId">The unique identifier of the unit whose authorizations are being requested.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="Authorization"/> objects matching the provided unit identifier.</returns>
/// <!-- aidoc:v1 sig=82be9e3 -->
Task<List<Authorization>> GetByUnitId(ObjectId unitId);
}
@@ -12,30 +12,35 @@ public interface ICameraRepository : IMongoRepository<Camera>
/// </summary>
/// <param name="cameraId">The unique identifier of the camera to look up.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the matching <see cref="Camera"/>, or <c>null</c> if no camera is found with the specified identifier.</returns>
/// <!-- aidoc:v1 sig=fbf139f -->
Task<Camera?> GetById(ObjectId cameraId);
/// <summary>
/// Asynchronously retrieves a camera by its name, returning <c>null</c> if no matching camera is found.
/// </summary>
/// <param name="name">The name of the camera to look up.</param>
/// <returns>A <see cref="Task{TResult}"/> that resolves to the matching <see cref="Camera"/>, or <c>null</c> if no camera with the specified name exists.</returns>
/// <!-- aidoc:v1 sig=6a4834c -->
Task<Camera?> GetByName(string name);
/// <summary>
/// Retrieves the list of <see cref="Camera"/> objects associated with the specified configuration relays.
/// </summary>
/// <param name="configurationRelayList">The list of <see cref="ObjectId"/> values identifying the configuration relays whose cameras should be returned.</param>
/// <returns>A <see cref="List{Camera}"/> containing the cameras linked to the provided configuration relays; returns an empty list when no matching cameras are found.</returns>
/// <!-- aidoc:v1 sig=4523ee6 -->
List<Camera> GetCameraInList(List<ObjectId> configurationRelayList);
/// <summary>
/// Retrieves a paginated, fluent queryable collection of cameras based on the supplied pagination filter.
/// </summary>
/// <param name="request">The pagination filter containing the page number and page size used to page the camera results.</param>
/// <returns>An <see cref="IFindFluent{Camera, Camera}"/> representing the paged query of cameras.</returns>
/// <!-- aidoc:v1 sig=f9540cc -->
IFindFluent<Camera, Camera> GetPaginatedCameras(PaginationFilter request);
/// <summary>
/// Inserts a new camera record into the data store and returns the persisted entity, or <c>null</c> if the camera could not be inserted.
/// </summary>
/// <param name="camera">The <see cref="Camera"/> instance containing the data to be inserted.</param>
/// <returns>A <see cref="Task{T}"/> that resolves to the inserted <see cref="Camera"/>, or <c>null</c> when the insertion is not performed.</returns>
/// <!-- aidoc:v1 sig=1baa756 -->
Task<Camera?> InsertOneCamera(Camera camera);
/// <summary>
/// Asynchronously updates an existing camera identified by the specified object identifier.
@@ -43,11 +48,13 @@ public interface ICameraRepository : IMongoRepository<Camera>
/// <param name="objectId">The unique identifier of the camera to update.</param>
/// <param name="camera">The camera object containing the updated information.</param>
/// <returns>A task that represents the asynchronous update operation. The task result contains the updated <see cref="Camera"/>, or <c>null</c> if no camera with the specified identifier was found.</returns>
/// <!-- aidoc:v1 sig=85a936b -->
Task<Camera?> UpdateCameraAsync(ObjectId objectId, Camera camera);
/// <summary>
/// Asynchronously searches for cameras whose name matches the specified text.
/// </summary>
/// <param name="textToSearch">The text used to filter cameras by name.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="Camera"/> objects matching the search criteria.</returns>
/// <!-- aidoc:v1 sig=b1c98a2 -->
Task<List<Camera>> GetSearchByNameCameras(string textToSearch);
}
@@ -11,6 +11,7 @@ public interface IConfigObservationRepository : IMongoRepository<ConfigObservati
/// </summary>
/// <param name="id">The unique identifier of the configuration observation to locate.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the <see cref="ConfigObservation"/> if found, or <c>null</c> if no observation matches the specified identifier.</returns>
/// <!-- aidoc:v1 sig=1d4cd90 -->
Task<ConfigObservation?> FindById(ObjectId id);
/// <summary>
@@ -19,6 +20,7 @@ public interface IConfigObservationRepository : IMongoRepository<ConfigObservati
/// </summary>
/// <param name="configObservation">The configuration observation containing the updated values to persist.</param>
/// <returns>A task that resolves to the updated <see cref="ConfigObservation"/>, or <c>null</c> if the observation does not exist.</returns>
/// <!-- aidoc:v1 sig=58909e3 -->
Task<ConfigObservation?> Update(ConfigObservation configObservation);
/// <summary>
@@ -26,18 +28,21 @@ public interface IConfigObservationRepository : IMongoRepository<ConfigObservati
/// </summary>
/// <param name="id">The unique identifier of the configuration observation to delete.</param>
/// <returns>A task that represents the asynchronous delete operation. The task result contains the deleted configuration observation, or <c>null</c> if no observation with the specified identifier was found.</returns>
/// <!-- aidoc:v1 sig=ae833b9 -->
Task<ConfigObservation?> Delete(ObjectId id);
/// <summary>
/// Asynchronously retrieves all available identifiers, returning them as a list of <see cref="ObjectId"/> values.
/// </summary>
/// <returns>A <see cref="Task{TResult}"/> that represents the asynchronous operation, containing a list of all <see cref="ObjectId"/> instances found.</returns>
/// <!-- aidoc:v1 sig=2b29fbf -->
Task<List<ObjectId>> FindAllIds();
/// <summary>
/// Retrieves all configuration observations available in the system.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains a collection of <see cref="ConfigObservation"/> instances.</returns>
/// <!-- aidoc:v1 sig=4aacd78 -->
Task<ICollection<ConfigObservation>> FindAll();
/// <summary>
@@ -45,28 +50,33 @@ public interface IConfigObservationRepository : IMongoRepository<ConfigObservati
/// </summary>
/// <param name="id">The identifier used to look up the configuration names.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of configuration names.</returns>
/// <!-- aidoc:v1 sig=e20bf71 -->
Task<List<string>> GetConfigNames(string id);
/// <summary>
/// Asynchronously retrieves the list of available configuration names.
/// </summary>
/// <returns>A task that represents the asynchronous operation, containing the list of configuration names.</returns>
/// <!-- aidoc:v1 sig=45b7793 -->
Task<List<string>> GetConfigNames();
/// <summary>
/// Asynchronously retrieves the total count of items.
/// </summary>
/// <returns>A task that represents the asynchronous operation, containing the total count as a <see cref="long"/>.</returns>
/// <!-- aidoc:v1 sig=25063b3 -->
Task<long> Count();
/// <summary>
/// Retrieves a paginated collection of configuration observations based on the specified filter.
/// </summary>
/// <param name="filter">The pagination filter that defines the page size, page number, and any additional criteria used to retrieve the observations.</param>
/// <returns>A task that represents the asynchronous operation, containing a collection of <see cref="ConfigObservation"/> items that match the pagination criteria.</returns>
/// <!-- aidoc:v1 sig=6003918 -->
Task<ICollection<ConfigObservation>> GetPaginatedItems(PaginationFilter filter);
/// <summary>
/// Retrieves a configuration observation that matches the specified name.
/// </summary>
/// <param name="name">The name of the configuration observation to find.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the matching ConfigObservation if found; otherwise, null.</returns>
/// <!-- aidoc:v1 sig=8fdec03 -->
Task<ConfigObservation?> FindByName(string name);
/// <summary>
/// Retrieves a <see cref="ConfigObservation"/> matching the specified coding system and code.
@@ -74,18 +84,21 @@ public interface IConfigObservationRepository : IMongoRepository<ConfigObservati
/// <param name="codingSystem">The coding system identifier used to look up the configuration observation.</param>
/// <param name="code">The code value within the specified coding system used to look up the configuration observation.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the matching <see cref="ConfigObservation"/> if found; otherwise, <c>null</c>.</returns>
/// <!-- aidoc:v1 sig=8d72db9 -->
Task<ConfigObservation?> GetByCodeSysAndCode(string? codingSystem, string? code);
/// <summary>
/// Asynchronously inserts the specified configuration observation item and returns the persisted entity.
/// </summary>
/// <param name="configObservationItem">The configuration observation to insert.</param>
/// <returns>A task that represents the asynchronous insert operation, containing the inserted <see cref="ConfigObservation"/>.</returns>
/// <!-- aidoc:v1 sig=6699d0c -->
Task<ConfigObservation> InsertOneAsyncAndReturn(ConfigObservation configObservationItem);
/// <summary>
/// Asynchronously retrieves all <see cref="ConfigObservation"/> records matching the specified name.
/// </summary>
/// <param name="name">The name used to look up the configuration observations.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains a list of <see cref="ConfigObservation"/> objects matching the given name, or an empty list if none are found.</returns>
/// <!-- aidoc:v1 sig=4081b04 -->
Task<List<ConfigObservation>> FindAllByName(string name);
/// <summary>
@@ -96,6 +109,7 @@ public interface IConfigObservationRepository : IMongoRepository<ConfigObservati
/// <param name="name">The name used to look up the configuration observation item, or <see langword="null"/> if not specified.</param>
/// <param name="originalName">The original name used to look up the configuration observation item, or <see langword="null"/> if not specified.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the matching <see cref="ConfigObservation"/> item, or <see langword="null"/> if no item matches the specified criteria.</returns>
/// <!-- aidoc:v1 sig=2c7c75f -->
Task<ConfigObservation?> GetSingleConfigObservationItem(string? code, string? codingSystem, string? name,
string? originalName);
}
@@ -10,11 +10,13 @@ public interface IConfigPumpsRepository : IMongoRepository<ConfigPumps>
/// </summary>
/// <param name="id">The unique identifier of the configuration to look up.</param>
/// <returns>A task that yields the matching ConfigPumps instance, or null if no configuration is found for the specified id.</returns>
/// <!-- aidoc:v1 sig=394bbbd -->
Task<ConfigPumps?> FindById(string id);
/// <summary>
/// Retrieves all pump configurations asynchronously.
/// </summary>
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="ConfigPumps"/> if found, or <c>null</c> if no configurations are available.</returns>
/// <!-- aidoc:v1 sig=d87df07 -->
Task<List<ConfigPumps>?> GetAllConfigs();
/// <summary>
@@ -22,11 +24,13 @@ public interface IConfigPumpsRepository : IMongoRepository<ConfigPumps>
/// </summary>
/// <param name="config">The pumps configuration to be persisted.</param>
/// <returns>A task that resolves to the updated <see cref="ConfigPumps"/> instance, or <see langword="null"/> if the configuration could not be found.</returns>
/// <!-- aidoc:v1 sig=4bd2a84 -->
Task<ConfigPumps?> UpdateConfig(ConfigPumps config);
/// <summary>
/// Asynchronously deletes the specified pump configuration.
/// </summary>
/// <param name="config">The pump configuration to delete.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains <c>true</c> if the configuration was successfully deleted; otherwise, <c>false</c>.</returns>
/// <!-- aidoc:v1 sig=2400a34 -->
Task<bool> DeleteConfig(ConfigPumps config);
}
@@ -10,5 +10,6 @@ public interface IConfigUnitsRepository : IMongoRepository<ConfigUnits>
/// </summary>
/// <param name="id">The unique identifier of the configuration unit to look up.</param>
/// <returns>A task that represents the asynchronous operation, containing the matching <see cref="ConfigUnits"/> or <c>null</c> if no entity is found.</returns>
/// <!-- aidoc:v1 sig=6cffb54 -->
Task<ConfigUnits?> FindById(string id);
}
@@ -11,24 +11,28 @@ public interface IDeviceRepository : IMongoRepository<Device>
/// </summary>
/// <param name="deviceDtoMacAddr">The MAC address used to look up the device.</param>
/// <returns>A task that represents the asynchronous operation, containing the matching <see cref="Device"/> or null when no device is found.</returns>
/// <!-- aidoc:v1 sig=c887f30 -->
Task<Device?> FindByMacAddr(string deviceDtoMacAddr);
/// <summary>
/// Finds and returns the device matching the specified serial number, or <c>null</c> if no matching device is found.
/// </summary>
/// <param name="deviceDtoSerialNumber">The serial number used to look up the device.</param>
/// <returns>A <see cref="Device"/> instance if a match is found; otherwise, <c>null</c>.</returns>
/// <!-- aidoc:v1 sig=2bc0894 -->
Task<Device?> FindBySerialNumber(string deviceDtoSerialNumber);
/// <summary>
/// Asynchronously finds a device by its unique identifier (UUID) and returns the matching device, or null if no device is found.
/// </summary>
/// <param name="deviceDtoUuid">The UUID string used to look up the device.</param>
/// <returns>A <see cref="Task{Device}"/> that resolves to the matching <see cref="Device"/>, or null when no device matches the provided UUID.</returns>
/// <!-- aidoc:v1 sig=d0a473e -->
Task<Device?> FindByUuid(string deviceDtoUuid);
/// <summary>
/// Retrieves a device by its unique key identifier.
/// </summary>
/// <param name="deviceDtoKey">The key identifier of the device to look up.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the <see cref="Device"/> if a matching device is found, or <c>null</c> if no device corresponds to the specified key.</returns>
/// <!-- aidoc:v1 sig=f846571 -->
Task<Device?> FindByKey(string deviceDtoKey);
/// <summary>
/// Updates the statistics of an existing device identified by the specified identifier.
@@ -36,5 +40,6 @@ public interface IDeviceRepository : IMongoRepository<Device>
/// <param name="id">The unique identifier of the device whose statistics will be updated.</param>
/// <param name="deviceExist">The device data transfer object representing the existing device to be updated.</param>
/// <returns>A task that represents the asynchronous update operation.</returns>
/// <!-- aidoc:v1 sig=d3d9745 -->
Task UpdateDeviceStats(ObjectId id,DeviceDto deviceExist);
}
@@ -9,16 +9,19 @@ public interface IDiagnosisArchiveRepository
/// </summary>
/// <param name="patientDiagnosis">The patient diagnosis entity to be persisted.</param>
/// <returns>A task that represents the asynchronous insert operation.</returns>
/// <!-- aidoc:v1 sig=2e5fbfe -->
Task InsertOneAsync(PatientDiagnosis patientDiagnosis);
/// <summary>
/// Asynchronously deletes items that occurred before the specified cutoff date.
/// </summary>
/// <param name="date">The cutoff date; items dated prior to this value will be deleted.</param>
/// <!-- aidoc:v1 sig=350661d -->
Task DeleteBeforeDate(DateTime date);
/// <summary>
/// Inserts a batch of patient diagnosis records into the data store.
/// </summary>
/// <param name="diagnosis">The collection of <see cref="PatientDiagnosis"/> entities to insert.</param>
/// <returns>A <see cref="Task{TResult}"/> representing the asynchronous operation, containing the result of the batch insertion.</returns>
/// <!-- aidoc:v1 sig=ad12097 -->
Task<long> InsertBatch(IEnumerable<PatientDiagnosis> diagnosis);
}
@@ -11,17 +11,20 @@ public interface IDiagnosisRepository : IMongoRepository<PatientDiagnosis>
/// </summary>
/// <param name="patientId">The unique identifier of the patient whose diagnoses are to be retrieved.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="PatientDiagnosis"/> objects for the specified patient.</returns>
/// <!-- aidoc:v1 sig=5d93ade -->
Task<List<PatientDiagnosis>> GetByPatient(ObjectId patientId);
/// <summary>
/// Asynchronously inserts a single patient diagnosis record into the data store.
/// </summary>
/// <param name="diagnosis">The patient diagnosis entity to insert.</param>
/// <!-- aidoc:v1 sig=f01c3df -->
new Task InsertOneAsync(PatientDiagnosis diagnosis);
/// <summary>
/// Asynchronously deletes the entity identified by the specified identifier.
/// </summary>
/// <param name="id">The unique identifier of the entity to delete.</param>
/// <!-- aidoc:v1 sig=9f8dfa3 -->
new Task DeleteAsync(ObjectId id);
/// <summary>
/// Updates many records by replacing the existing <see cref="ObjectId"/> identified by <paramref name="oldId"/> with the new <see cref="ObjectId"/> <paramref name="id"/>, scoped to the specified <paramref name="nameId"/>.
@@ -29,17 +32,20 @@ public interface IDiagnosisRepository : IMongoRepository<PatientDiagnosis>
/// <param name="nameId">The identifier of the field or collection on which the update is performed.</param>
/// <param name="id">The new <see cref="ObjectId"/> value to assign.</param>
/// <param name="oldId">The existing <see cref="ObjectId"/> value to be replaced.</param>
/// <!-- aidoc:v1 sig=24ef97c -->
Task UpdateManyObjectId(string nameId, ObjectId id, ObjectId oldId);
/// <summary>
/// Asynchronously finds all patient diagnoses associated with the specified patient identifier, returning a cursor to iterate over the matching documents.
/// </summary>
/// <param name="patientId">The unique identifier of the patient whose diagnoses should be retrieved.</param>
/// <returns>A task that represents the asynchronous operation, containing an IAsyncCursor of PatientDiagnosis that yields the matching documents.</returns>
/// <!-- aidoc:v1 sig=61b15db -->
Task<IAsyncCursor<PatientDiagnosis>> FindByPatientIdAsync(ObjectId patientId);
/// <summary>
/// Asynchronously deletes records associated with the specified patient identifier.
/// </summary>
/// <param name="patientId">The unique <see cref="ObjectId"/> of the patient whose related records should be removed.</param>
/// <!-- aidoc:v1 sig=1e79565 -->
Task DeleteByPatientId(ObjectId patientId);
/// <summary>
/// Asynchronously retrieves the <see cref="PatientDiagnosis"/> associated with the specified patient, diagnosis code, and coding system.
@@ -49,5 +55,6 @@ public interface IDiagnosisRepository : IMongoRepository<PatientDiagnosis>
/// <param name="diagnosisCode">The diagnosis code to match. May be null.</param>
/// <param name="codingSystem">The coding system of the diagnosis code (for example, ICD-10 or SNOMED). May be null.</param>
/// <returns>A task that resolves to the matching <see cref="PatientDiagnosis"/>, or null if no diagnosis matches the given criteria.</returns>
/// <!-- aidoc:v1 sig=56ca4f7 -->
Task<PatientDiagnosis?> FindByPatientIdAndCode(ObjectId patientId, string? diagnosisCode, string? codingSystem);
}
@@ -12,12 +12,14 @@ public interface IDischargeRepository : IMongoRepository<Discharge>
/// Deletes the entity identified by the specified identifier.
/// </summary>
/// <param name="id">The unique identifier of the entity to delete.</param>
/// <!-- aidoc:v1 sig=0112d17 -->
Task Delete(ObjectId id);
/// <summary>
/// Asynchronously updates an existing discharge record.
/// </summary>
/// <param name="discharge">The discharge entity containing the updated information to be persisted.</param>
/// <!-- aidoc:v1 sig=2ea41b6 -->
Task Update(Discharge discharge);
/// <summary>
@@ -25,6 +27,7 @@ public interface IDischargeRepository : IMongoRepository<Discharge>
/// </summary>
/// <param name="id">The unique identifier of the object whose unit will be updated.</param>
/// <param name="unit">The new unit value to assign to the object.</param>
/// <!-- aidoc:v1 sig=e209b77 -->
Task UpdateUnit(ObjectId id, string unit);
/// <summary>
@@ -32,12 +35,14 @@ public interface IDischargeRepository : IMongoRepository<Discharge>
/// </summary>
/// <param name="id">The unique identifier of the patient to update.</param>
/// <param name="patient">The patient object containing the updated information to be applied to the existing record.</param>
/// <!-- aidoc:v1 sig=7d687d6 -->
Task UpdatePatient(ObjectId id, Patient patient);
/// <summary>
/// Asynchronously retrieves all discharge records.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains a collection of all <see cref="Discharge"/> entities.</returns>
/// <!-- aidoc:v1 sig=f3aa8a3 -->
Task<IEnumerable<Discharge>> FindAll();
/// <summary>
@@ -45,6 +50,7 @@ public interface IDischargeRepository : IMongoRepository<Discharge>
/// </summary>
/// <param name="id">The unique identifier of the discharge record to find.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the <see cref="Discharge"/> if a matching record is found; otherwise, <c>null</c>.</returns>
/// <!-- aidoc:v1 sig=cbc5b2e -->
Task<Discharge?> FindById(ObjectId id);
/// <summary>
@@ -52,6 +58,7 @@ public interface IDischargeRepository : IMongoRepository<Discharge>
/// </summary>
/// <param name="unit">The unit identifier used to filter the discharge records.</param>
/// <returns>A task that represents the asynchronous operation. The result is an <see cref="IEnumerable{T}"/> of <see cref="Discharge"/> containing the matching records, or <see langword="null"/> when no records are found.</returns>
/// <!-- aidoc:v1 sig=43b920c -->
Task<IEnumerable<Discharge>?> FindByUnit(string unit);
/// <summary>
@@ -59,6 +66,7 @@ public interface IDischargeRepository : IMongoRepository<Discharge>
/// </summary>
/// <param name="unitId">The ObjectId of the unit whose associated records will be counted.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the count of records for the specified unit.</returns>
/// <!-- aidoc:v1 sig=e0dfc62 -->
Task<long> CountByUnitId(ObjectId unitId);
/// <summary>
@@ -66,6 +74,7 @@ public interface IDischargeRepository : IMongoRepository<Discharge>
/// </summary>
/// <param name="destination">The destination identifier used to look up matching discharge records.</param>
/// <returns>A task that yields an <see cref="IEnumerable{Discharge}"/> of matching discharge records, or <c>null</c> if no records are found for the given destination.</returns>
/// <!-- aidoc:v1 sig=9eb7a6c -->
Task<IEnumerable<Discharge>?> FindByDestination(string destination);
/// <summary>
@@ -74,12 +83,14 @@ public interface IDischargeRepository : IMongoRepository<Discharge>
/// </summary>
/// <param name="service">The service identifier used to look up matching discharge records.</param>
/// <returns>A task that represents the asynchronous operation. The result is an <see cref="IEnumerable{T}"/> of <see cref="Discharge"/> entries for the specified service, or <c>null</c> if none are found.</returns>
/// <!-- aidoc:v1 sig=24de989 -->
Task<IEnumerable<Discharge>?> FindByService(string service);
/// <summary>
/// Asynchronously retrieves a collection of <see cref="Discharge"/> records associated with the specified unit identifiers.
/// </summary>
/// <param name="unitIds">The collection of unit identifiers used to look up the matching discharges. May be <c>null</c>.</param>
/// <returns>A task that represents the asynchronous operation, containing a collection of <see cref="Discharge"/> objects, or <c>null</c> when no matching discharges are available.</returns>
/// <!-- aidoc:v1 sig=29c7c15 -->
Task<IEnumerable<Discharge>?> GetDischargesByUnitIds(IEnumerable<ObjectId>? unitIds);
@@ -88,12 +99,14 @@ public interface IDischargeRepository : IMongoRepository<Discharge>
/// </summary>
/// <param name="location">The patient location used to look up the associated discharge record.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the matching <see cref="Discharge"/> if found; otherwise, <c>null</c>.</returns>
/// <!-- aidoc:v1 sig=8da289b -->
Task<Discharge?> GetDischargeByLocation(PatientLocation location);
/// <summary>
/// Retrieves the discharge record associated with the specified patient identifier, or <see langword="null"/> if no discharge exists for that patient.
/// </summary>
/// <param name="patientId">The unique identifier of the patient whose discharge record is being requested.</param>
/// <returns>A <see cref="Task{Discharge}"/> that resolves to the matching <see cref="Discharge"/>, or <see langword="null"/> when no record is found.</returns>
/// <!-- aidoc:v1 sig=201be7c -->
Task<Discharge?> GetByPatientId(ObjectId patientId);
/// <summary>
@@ -101,12 +114,14 @@ public interface IDischargeRepository : IMongoRepository<Discharge>
/// </summary>
/// <param name="pocId">The point-of-care identifier used to look up the associated discharges.</param>
/// <returns>A task that returns an <see cref="IEnumerable{T}"/> of <see cref="Discharge"/> records, or <see langword="null"/> if no discharges are found for the given point-of-care identifier.</returns>
/// <!-- aidoc:v1 sig=dd4639c -->
Task<IEnumerable<Discharge>?> FindByPoCId(ObjectId pocId);
/// <summary>
/// Retrieves the discharge associated with the specified point of care identifier.
/// </summary>
/// <param name="poc">The identifier of the point of care used to look up the discharge.</param>
/// <returns>A task that returns the matching <see cref="Discharge"/> if one is found; otherwise, <c>null</c>.</returns>
/// <!-- aidoc:v1 sig=5c6cb4c -->
Task<Discharge?> GetDischargeByPointOfCareId(ObjectId poc);
/// <summary>
@@ -116,6 +131,7 @@ public interface IDischargeRepository : IMongoRepository<Discharge>
/// <param name="opt">The update option master list data transfer object containing the new option details.</param>
/// <param name="typeName">The name of the type to which the master list option applies.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains a collection of updated Discharge records.</returns>
/// <!-- aidoc:v1 sig=03334e1 -->
Task<IEnumerable<Discharge>> UpdateMasterListOption(List<ObjectId> unitIds, UpdateOptionMasterListDto opt,
string typeName);
@@ -126,11 +142,13 @@ public interface IDischargeRepository : IMongoRepository<Discharge>
/// <param name="opt">The master list option to delete.</param>
/// <param name="typeName">The type name associated with the option.</param>
/// <returns>A task that represents the asynchronous operation, containing the collection of <see cref="Discharge"/> objects resulting from the deletion.</returns>
/// <!-- aidoc:v1 sig=5d8584d -->
Task<IEnumerable<Discharge>> DeleteMasterListOption(List<ObjectId> unitIds, OptionList opt, string typeName);
/// <summary>
/// Deletes the entity associated with the specified unit identifier.
/// </summary>
/// <param name="unitId">The unique identifier of the unit whose associated record should be removed.</param>
/// <returns>A task that represents the asynchronous operation. The result is <c>true</c> if a record was deleted; otherwise, <c>false</c>.</returns>
/// <!-- aidoc:v1 sig=7032be4 -->
Task<bool> DeleteByUnitId(ObjectId unitId);
}
@@ -10,29 +10,34 @@ public interface IDisplayCardConfigRepository : IMongoRepository<CardConfig>
/// Asynchronously retrieves all available card configurations.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains a list of all <see cref="CardConfig"/> items.</returns>
/// <!-- aidoc:v1 sig=7c46da8 -->
Task<List<CardConfig>> GetAll();
/// <summary>
/// Retrieves a card configuration by its unique identifier, returning <c>null</c> when no matching configuration is found.
/// </summary>
/// <param name="configId">The unique identifier of the card configuration to look up.</param>
/// <returns>A <see cref="Task{TResult}"/> that yields the matching <see cref="CardConfig"/> if found; otherwise, <c>null</c>.</returns>
/// <!-- aidoc:v1 sig=10fd753 -->
Task<CardConfig?> GetById(ObjectId configId);
/// <summary>
/// Asynchronously inserts a new <see cref="CardConfig"/> into the data store and returns the persisted record, which may include database-generated values.
/// </summary>
/// <param name="config">The <see cref="CardConfig"/> instance to insert.</param>
/// <returns>A <see cref="Task{TResult}"/> that yields the inserted <see cref="CardConfig"/>, or <c>null</c> if the record could not be persisted.</returns>
/// <!-- aidoc:v1 sig=ba19ca3 -->
Task<CardConfig?> InsertOneAsyncAndReturn(CardConfig config);
/// <summary>
/// Updates a single <see cref="CardConfig"/> record based on the provided configuration.
/// </summary>
/// <param name="config">The <see cref="CardConfig"/> to update. May be <c>null</c> to indicate no update payload was provided.</param>
/// <returns>A task that resolves to an <see cref="UpdateResponse{T}"/> containing the updated <see cref="CardConfig"/>, or <c>null</c> if no matching record was found.</returns>
/// <!-- aidoc:v1 sig=1c7016f -->
Task<UpdateResponse<CardConfig?>> UpdateOne(CardConfig? config);
/// <summary>
/// Deletes a single card configuration identified by the specified identifier, returning the removed configuration when found.
/// </summary>
/// <param name="configId">The unique identifier of the card configuration to delete.</param>
/// <returns>A task that represents the asynchronous delete operation. The task result contains the deleted <see cref="CardConfig"/>, or <c>null</c> if no configuration with the specified identifier exists.</returns>
/// <!-- aidoc:v1 sig=06062fe -->
Task<CardConfig?> DeleteOne(ObjectId configId);
}
@@ -10,29 +10,34 @@ public interface IDisplayChartConfigRepository : IMongoRepository<ChartConfig>
/// Asynchronously retrieves all chart configurations.
/// </summary>
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="ChartConfig"/> objects.</returns>
/// <!-- aidoc:v1 sig=69d54d6 -->
Task<List<ChartConfig>> GetAll();
/// <summary>
/// Asynchronously retrieves a <see cref="ChartConfig"/> by its unique identifier, returning null if no matching configuration is found.
/// </summary>
/// <param name="configId">The identifier of the chart configuration to look up.</param>
/// <returns>A task that yields the matching <see cref="ChartConfig"/>, or null when no configuration exists for the specified id.</returns>
/// <!-- aidoc:v1 sig=0f66137 -->
Task<ChartConfig?> GetById(ObjectId configId);
/// <summary>
/// Asynchronously inserts a new chart configuration into the data store and returns the persisted entity, which may be null if no record is produced.
/// </summary>
/// <param name="config">The chart configuration to insert.</param>
/// <returns>A task that represents the asynchronous insert operation, containing the inserted <see cref="ChartConfig"/> or null when the operation yields no result.</returns>
/// <!-- aidoc:v1 sig=ff330b7 -->
Task<ChartConfig?> InsertOneAsyncAndReturn(ChartConfig config);
/// <summary>
/// Updates a single chart configuration and returns the operation result wrapped in an update response.
/// </summary>
/// <param name="config">The chart configuration to update. May be null.</param>
/// <returns>A task containing the update response with the updated chart configuration, which may be null.</returns>
/// <!-- aidoc:v1 sig=5d67082 -->
Task<UpdateResponse<ChartConfig?>> UpdateOne(ChartConfig? config);
/// <summary>
/// Deletes a single chart configuration identified by its unique identifier. Returns the deleted configuration, or <see langword="null"/> if no matching configuration was found.
/// </summary>
/// <param name="configId">The unique identifier of the chart configuration to delete.</param>
/// <returns>A task that resolves to the deleted <see cref="ChartConfig"/>, or <see langword="null"/> if no configuration with the specified id exists.</returns>
/// <!-- aidoc:v1 sig=7690568 -->
Task<ChartConfig?> DeleteOne(ObjectId configId);
}
@@ -15,18 +15,21 @@ public interface IDisplayConfigRepository : IMongoRepository<DisplayConfig>
/// Asynchronously retrieves all display configurations.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains a list of all <see cref="DisplayConfig"/> entries.</returns>
/// <!-- aidoc:v1 sig=0650c45 -->
Task<List<DisplayConfig>> GetAll();
/// <summary>
/// Retrieves a paginated set of <see cref="DisplayConfig"/> entities projected as <see cref="DisplayConfigSummary"/>.
/// </summary>
/// <param name="request">The pagination filter applied to the query.</param>
/// <returns>An <see cref="IFindFluent{TDocument, TProjection}"/> that produces the paginated <see cref="DisplayConfigSummary"/> results.</returns>
/// <!-- aidoc:v1 sig=5cd5916 -->
IFindFluent<DisplayConfig, DisplayConfigSummary> GetAllPaginated(PaginationFilter request);
/// <summary>
/// Asynchronously retrieves the list of display configurations that match the specified display type.
/// </summary>
/// <param name="type">The display type used to filter the returned display configurations.</param>
/// <returns>A task that represents the asynchronous operation, containing the list of <see cref="DisplayConfig"/> entries matching the specified type.</returns>
/// <!-- aidoc:v1 sig=2f20b32 -->
Task<List<DisplayConfig>> GetByType(DisplayConfigEnums.DisplayType type);
/// <summary>
/// Retrieves a <see cref="DisplayConfig"/> entity by its unique identifier asynchronously.
@@ -34,6 +37,7 @@ public interface IDisplayConfigRepository : IMongoRepository<DisplayConfig>
/// </summary>
/// <param name="id">The unique identifier of the display configuration to retrieve.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the <see cref="DisplayConfig"/> if found, or <c>null</c> if no matching record exists.</returns>
/// <!-- aidoc:v1 sig=938724e -->
Task<DisplayConfig?> GetById(ObjectId id);
/// <summary>
/// Asynchronously retrieves the default <see cref="DisplayConfig"/> for the specified display type.
@@ -41,12 +45,14 @@ public interface IDisplayConfigRepository : IMongoRepository<DisplayConfig>
/// </summary>
/// <param name="type">The display type used to look up the default configuration.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the default <see cref="DisplayConfig"/> for the given type, or <c>null</c> if no default exists.</returns>
/// <!-- aidoc:v1 sig=691190f -->
Task<DisplayConfig?> GetDefault(DisplayConfigEnums.DisplayType type);
/// <summary>
/// Asynchronously inserts a new <see cref="DisplayConfig"/> and returns the persisted entity, typically populated with any server-generated values.
/// </summary>
/// <param name="config">The <see cref="DisplayConfig"/> to insert.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the inserted <see cref="DisplayConfig"/>, or <see langword="null"/> when no result is returned.</returns>
/// <!-- aidoc:v1 sig=93c23df -->
Task<DisplayConfig?> InsertOneAsyncAndReturn(DisplayConfig config);
/// <summary>
/// Updates the smart display configuration identified by the specified ID with the provided new configuration.
@@ -54,6 +60,7 @@ public interface IDisplayConfigRepository : IMongoRepository<DisplayConfig>
/// <param name="displayConfigId">The unique identifier of the smart display configuration to update.</param>
/// <param name="newDisplayConfig">The new smart display configuration to apply.</param>
/// <returns>A task that represents the asynchronous update operation, containing the updated smart display configuration, or null if no configuration with the given ID was found.</returns>
/// <!-- aidoc:v1 sig=5c60d9b -->
Task<SmartDisplay?> UpdateSmartDisplay(ObjectId displayConfigId, SmartDisplay? newDisplayConfig);
/// <summary>
@@ -63,6 +70,7 @@ public interface IDisplayConfigRepository : IMongoRepository<DisplayConfig>
/// <param name="newDisplayConfig">The new display nurse configuration data, or null if not provided.</param>
/// <param name="nurseObs">The list of nurse observations to associate with the configuration.</param>
/// <returns>A task that represents the asynchronous operation, containing the updated <see cref="DisplayNurse"/> or null if not found.</returns>
/// <!-- aidoc:v1 sig=317dda3 -->
Task<DisplayNurse?> UpdateDisplayNurse(ObjectId displayConfigId, DisplayNurseDto? newDisplayConfig,
List<string> nurseObs);
@@ -73,6 +81,7 @@ public interface IDisplayConfigRepository : IMongoRepository<DisplayConfig>
/// <param name="unitId">The identifier of the unit whose default display configuration is being requested.</param>
/// <param name="displayType">The display type used to filter the configuration lookup.</param>
/// <returns>A task containing the matching <see cref="DisplayConfig"/>, or <c>null</c> if no default configuration is found for the given unit and display type.</returns>
/// <!-- aidoc:v1 sig=c1f0b10 -->
Task<DisplayConfig?> GetDefaultByUnitIdAndType(ObjectId unitId, DisplayConfigEnums.DisplayType displayType);
/// <summary>
/// Asynchronously updates the color configuration for the specified config display entry.
@@ -80,6 +89,7 @@ public interface IDisplayConfigRepository : IMongoRepository<DisplayConfig>
/// <param name="objectIdConfigDisplay">The unique identifier of the config display whose color configuration will be updated.</param>
/// <param name="colorConfig">The new color configuration to apply to the config display.</param>
/// <returns>A task that resolves to <c>true</c> if the color configuration was successfully updated; otherwise, <c>false</c>.</returns>
/// <!-- aidoc:v1 sig=603eb76 -->
Task<bool> UpdateConfigColor(ObjectId objectIdConfigDisplay, ColorConfig colorConfig);
/// <summary>
/// Updates the home banner configuration identified by the specified config display ObjectId with the provided list of banner items.
@@ -87,6 +97,7 @@ public interface IDisplayConfigRepository : IMongoRepository<DisplayConfig>
/// <param name="objectIdConfigDisplay">The ObjectId of the config display whose home banner set will be updated.</param>
/// <param name="bannerItems">The collection of banner items to apply to the home banner set.</param>
/// <returns>A task that resolves to <c>true</c> if the home banner set was updated successfully; otherwise, <c>false</c>.</returns>
/// <!-- aidoc:v1 sig=a96cf5b -->
Task<bool> UpdateSetHomeBanner(ObjectId objectIdConfigDisplay, List<BannerItem> bannerItems);
/// <summary>
/// Updates the base display configuration identified by the specified object identifier with the provided configuration data.
@@ -94,6 +105,7 @@ public interface IDisplayConfigRepository : IMongoRepository<DisplayConfig>
/// <param name="objectIdConfigDisplay">The object identifier of the configuration display entry to update.</param>
/// <param name="baseConfig">The new base display configuration values to apply.</param>
/// <returns>A task that represents the asynchronous operation. The result is <c>true</c> if the update succeeded; otherwise, <c>false</c>.</returns>
/// <!-- aidoc:v1 sig=93fc07a -->
Task<bool> UpdateBaseConfig(ObjectId objectIdConfigDisplay, DisplayConfig baseConfig);
/// <summary>
/// Updates an existing header configuration associated with the specified configuration display identifier.
@@ -101,6 +113,7 @@ public interface IDisplayConfigRepository : IMongoRepository<DisplayConfig>
/// <param name="objectIdConfigDisplay">The unique identifier of the configuration display whose header configuration is being updated.</param>
/// <param name="headerConfig">The new header configuration values to apply.</param>
/// <returns>A task that represents the asynchronous operation. The task result is <c>true</c> if the header configuration was successfully updated; otherwise, <c>false</c>.</returns>
/// <!-- aidoc:v1 sig=979f311 -->
Task<bool> UpdateHeaderConfig(ObjectId objectIdConfigDisplay, HeaderConfig headerConfig);
/// <summary>
/// Updates the hospital name associated with the specified display configuration.
@@ -108,6 +121,7 @@ public interface IDisplayConfigRepository : IMongoRepository<DisplayConfig>
/// <param name="objectIdConfigDisplay">The identifier of the display configuration to update.</param>
/// <param name="name">The new hospital name to apply to the display configuration.</param>
/// <returns>A task that represents the asynchronous operation. The task result is <c>true</c> if the update succeeded; otherwise, <c>false</c>.</returns>
/// <!-- aidoc:v1 sig=519223f -->
Task<bool> UpdateDisplayConfigHospitalName(ObjectId objectIdConfigDisplay, string name);
/// <summary>
/// Updates the field list associated with the specified configuration display.
@@ -115,29 +129,34 @@ public interface IDisplayConfigRepository : IMongoRepository<DisplayConfig>
/// <param name="objectIdConfigDisplay">The identifier of the configuration display whose field list is being updated.</param>
/// <param name="fields">The list of fields to apply to the configuration display.</param>
/// <returns>A task that resolves to <c>true</c> if the field list was updated successfully; otherwise, <c>false</c>.</returns>
/// <!-- aidoc:v1 sig=62079e1 -->
Task<bool> UpdateFieldList(ObjectId objectIdConfigDisplay, List<Field> fields);
/// <summary>
/// Deletes a display configuration identified by the specified object ID.
/// </summary>
/// <param name="objectIdConfigDisplay">The object ID of the display configuration to delete.</param>
/// <returns>A task that represents the asynchronous delete operation. The task result contains the deleted display configuration, or null if no configuration was found with the specified ID.</returns>
/// <!-- aidoc:v1 sig=f04bba3 -->
Task<DisplayConfig?> DeleteDisplayConfig(ObjectId objectIdConfigDisplay);
/// <summary>
/// Retrieves all display configurations in a compact, minimal representation.
/// </summary>
/// <returns>A task containing a list of <see cref="DisplayConfigMinimalResponse"/> objects representing the display configurations.</returns>
/// <!-- aidoc:v1 sig=784f030 -->
Task<List<DisplayConfigMinimalResponse>> GetAllCompact();
/// <summary>
/// Retrieves all object identifiers associated with the specified card configuration identifier.
/// </summary>
/// <param name="cardConfigId">The identifier of the card configuration whose related objects should be returned.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="ObjectId"/> values linked to the given card configuration.</returns>
/// <!-- aidoc:v1 sig=4ca5d28 -->
Task<List<ObjectId>> GetAllByCardConfigId(ObjectId cardConfigId);
/// <summary>
/// Asynchronously retrieves a list of ObjectIds associated with the specified card configuration that are marked as rotating.
/// </summary>
/// <param name="cardConfigId">The ObjectId of the card configuration used to filter the results.</param>
/// <returns>A task representing the asynchronous operation, containing a list of ObjectIds that match the given card configuration and rotating criteria.</returns>
/// <!-- aidoc:v1 sig=59e1336 -->
Task<List<ObjectId>> GetAllByCardConfigIdAndRotating(ObjectId cardConfigId);
/// <summary>
/// Updates the card configuration identifier for the specified display configuration and result.
@@ -145,6 +164,7 @@ public interface IDisplayConfigRepository : IMongoRepository<DisplayConfig>
/// <param name="displayConfigId">The identifier of the display configuration whose card configuration will be updated.</param>
/// <param name="resultId">The identifier of the result associated with the card configuration update.</param>
/// <returns>A task that resolves to <c>true</c> if the update succeeded; otherwise, <c>false</c>.</returns>
/// <!-- aidoc:v1 sig=5aceeda -->
Task<bool> UpdateCardConfigId(ObjectId? displayConfigId, ObjectId? resultId);
/// <summary>
/// Adds a chart identifier to the specified display configuration asynchronously.
@@ -152,18 +172,21 @@ public interface IDisplayConfigRepository : IMongoRepository<DisplayConfig>
/// <param name="displayConfigId">The identifier of the display configuration to which the chart ID will be added, or <c>null</c> when no specific configuration is targeted.</param>
/// <param name="newChartIdToAdd">The chart identifier to add.</param>
/// <returns>A task that represents the asynchronous operation. The task result is <c>true</c> if the chart identifier was successfully added; otherwise, <c>false</c>.</returns>
/// <!-- aidoc:v1 sig=e08471c -->
Task<bool> AddChartId(ObjectId? displayConfigId, ObjectId newChartIdToAdd);
/// <summary>
/// Updates the configuration of a chart that was previously deleted, using the specified identifier.
/// </summary>
/// <param name="deletedId">The identifier of the deleted chart configuration to update.</param>
/// <returns>A task that represents the asynchronous update operation, containing the result of the update.</returns>
/// <!-- aidoc:v1 sig=dd3d4a9 -->
Task<UpdateResult> UpdateDeletedChartConfig(ObjectId deletedId);
/// <summary>
/// Asynchronously retrieves the chart configuration associated with the specified chart object identifier.
/// </summary>
/// <param name="objectIdConfigChart">The unique object identifier of the chart configuration to retrieve.</param>
/// <returns>A task that represents the asynchronous operation, containing the <see cref="ChartConfig"/> associated with the specified identifier.</returns>
/// <!-- aidoc:v1 sig=4913157 -->
Task<ChartConfig> GetChartConfig(ObjectId objectIdConfigChart);
/// <summary>
/// Asynchronously updates the detail configuration identifier, associating it with the specified result identifier.
@@ -171,11 +194,13 @@ public interface IDisplayConfigRepository : IMongoRepository<DisplayConfig>
/// <param name="displayConfigId">The nullable identifier of the display configuration to update.</param>
/// <param name="resultId">The nullable identifier of the result to associate with the configuration.</param>
/// <returns>A task that represents the asynchronous operation, containing a boolean indicating whether the update was successful.</returns>
/// <!-- aidoc:v1 sig=461a960 -->
Task<bool> UpdateDetailConfigId(ObjectId? displayConfigId, ObjectId? resultId);
/// <summary>
/// Asynchronously retrieves a list of identifiers associated with the specified card detail base configuration.
/// </summary>
/// <param name="baseConfigId">The identifier of the card detail base configuration to filter by.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="ObjectId"/> values matching the provided base configuration identifier.</returns>
/// <!-- aidoc:v1 sig=370fbe0 -->
Task<List<ObjectId>> GetAllByCardDetailConfigId(ObjectId baseConfigId);
}
@@ -10,6 +10,7 @@ public interface IDisplayDetailConfigRepository : IMongoRepository<CardDetailsCo
/// Asynchronously retrieves all card details configurations from the data source.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains a list of all <see cref="CardDetailsConfig"/> entries.</returns>
/// <!-- aidoc:v1 sig=b4de920 -->
Task<List<CardDetailsConfig>> GetAll();
/// <summary>
/// Retrieves a <see cref="CardDetailsConfig"/> by its unique identifier.
@@ -17,23 +18,27 @@ public interface IDisplayDetailConfigRepository : IMongoRepository<CardDetailsCo
/// </summary>
/// <param name="configId">The identifier of the card details configuration to retrieve.</param>
/// <returns>A task that represents the asynchronous operation, containing the matching <see cref="CardDetailsConfig"/> or <see langword="null"/> if not found.</returns>
/// <!-- aidoc:v1 sig=a624128 -->
Task<CardDetailsConfig?> GetById(ObjectId configId);
/// <summary>
/// Asynchronously inserts a new card details configuration and returns the inserted entity.
/// </summary>
/// <param name="config">The card details configuration to insert.</param>
/// <returns>A task representing the asynchronous operation, containing the inserted <see cref="CardDetailsConfig"/>, or <c>null</c> if no entity was returned.</returns>
/// <!-- aidoc:v1 sig=6ff78fc -->
Task<CardDetailsConfig?> InsertOneAsyncAndReturn(CardDetailsConfig config);
/// <summary>
/// Updates a single card details configuration record asynchronously.
/// </summary>
/// <param name="config">The card details configuration to update. May be <see langword="null"/>.</param>
/// <returns>A task that represents the asynchronous operation, containing the update response with the updated <see cref="CardDetailsConfig"/> or <see langword="null"/> when no configuration is found.</returns>
/// <!-- aidoc:v1 sig=00357b8 -->
Task<UpdateResponse<CardDetailsConfig?>> UpdateOne(CardDetailsConfig? config);
/// <summary>
/// Deletes a single <see cref="CardDetailsConfig"/> identified by its unique identifier.
/// </summary>
/// <param name="configId">The unique identifier of the <see cref="CardDetailsConfig"/> to delete.</param>
/// <returns>A task that represents the asynchronous operation, containing the deleted <see cref="CardDetailsConfig"/>, or <c>null</c> if no matching configuration was found.</returns>
/// <!-- aidoc:v1 sig=e53d89f -->
Task<CardDetailsConfig?> DeleteOne(ObjectId configId);
}
@@ -14,6 +14,7 @@ public interface IDisplayRepository : IMongoRepository<Display>
/// Retrieves every display stored in the collection.
/// </summary>
/// <returns>A <see cref="Task{List{Display}}"/> representing the asynchronous operation. The task result contains all displays, or an empty list if none exist.</returns>
/// <!-- aidoc:v1 sig=d9b5d50 -->
Task<List<Display>> GetAll();
@@ -22,6 +23,7 @@ public interface IDisplayRepository : IMongoRepository<Display>
/// </summary>
/// <param name="pointOfCare">The <see cref="PointOfCare"/> to filter by.</param>
/// <returns>A <see cref="Task{List{Display}}"/> representing the asynchronous operation. The task result contains the matching displays, or an empty list if none exist.</returns>
/// <!-- aidoc:v1 sig=04ec30c -->
Task<List<Display>> GetByPointOfCare(PointOfCare pointOfCare);
// Task<List<Display>> GetByUser();
@@ -31,6 +33,7 @@ public interface IDisplayRepository : IMongoRepository<Display>
/// </summary>
/// <param name="name">The display name to look up.</param>
/// <returns>A <see cref="Task{Display}"/> representing the asynchronous operation. The task result contains the <see cref="Display"/> if found; otherwise, <see langword="null"/>.</returns>
/// <!-- aidoc:v1 sig=02f4c9c -->
Task<Display?> GetByName(string name);
/// <summary>
@@ -38,6 +41,7 @@ public interface IDisplayRepository : IMongoRepository<Display>
/// </summary>
/// <param name="id">The <see cref="ObjectId"/> of the display to retrieve.</param>
/// <returns>A <see cref="Task{Display}"/> representing the asynchronous operation. The task result contains the <see cref="Display"/> if found; otherwise, <see langword="null"/>.</returns>
/// <!-- aidoc:v1 sig=3467c35 -->
Task<Display?> GetById(ObjectId id);
/// <summary>
@@ -45,6 +49,7 @@ public interface IDisplayRepository : IMongoRepository<Display>
/// </summary>
/// <param name="id">The <see cref="ObjectId"/> of the display to retrieve.</param>
/// <returns>A <see cref="Task{Display}"/> representing the asynchronous operation. The task result contains the <see cref="Display"/> with its config populated if found; otherwise, <see langword="null"/>.</returns>
/// <!-- aidoc:v1 sig=ae957ab -->
Task<Display?> GetByIdWithConfigDisplay(ObjectId id);
/// <summary>
@@ -52,6 +57,7 @@ public interface IDisplayRepository : IMongoRepository<Display>
/// </summary>
/// <param name="id">The <see cref="ObjectId"/> of the unit.</param>
/// <returns>A <see cref="Task{List{Display}}"/> representing the asynchronous operation. The task result contains the matching displays, or an empty list if none exist.</returns>
/// <!-- aidoc:v1 sig=a786839 -->
Task<List<Display>> GetByUnitId(ObjectId id);
/// <summary>
@@ -59,6 +65,7 @@ public interface IDisplayRepository : IMongoRepository<Display>
/// </summary>
/// <param name="id">The <see cref="ObjectId"/> of the display configuration to filter by.</param>
/// <returns>A <see cref="Task{List{Display}}"/> representing the asynchronous operation. The task result contains the matching displays, or an empty list if none exist.</returns>
/// <!-- aidoc:v1 sig=da68f5b -->
Task<List<Display>> GetByConfigId(ObjectId id);
/// <summary>
@@ -67,6 +74,7 @@ public interface IDisplayRepository : IMongoRepository<Display>
/// <param name="objectId">The <see cref="ObjectId"/> of the display to update.</param>
/// <param name="listPocObId">The new list of <see cref="ObjectId"/> values representing the point-of-cares to associate with the display.</param>
/// <returns>A <see cref="Task{Display}"/> representing the asynchronous operation. The task result contains the updated <see cref="Display"/> if the update succeeded; otherwise, <see langword="null"/>.</returns>
/// <!-- aidoc:v1 sig=48f0e68 -->
Task<Display?> UpdatePointOfCareList(ObjectId objectId, List<ObjectId> listPocObId);
/// <summary>
@@ -75,6 +83,7 @@ public interface IDisplayRepository : IMongoRepository<Display>
/// <param name="oldDisplayId">The <see cref="ObjectId"/> of the display whose configuration should be replaced.</param>
/// <param name="newDisplayConfigCast">The new <see cref="DisplayConfig"/> instance to assign to the display.</param>
/// <returns>A <see cref="Task{Display}"/> representing the asynchronous operation. The task result contains the updated <see cref="Display"/> if the update succeeded; otherwise, <see langword="null"/>.</returns>
/// <!-- aidoc:v1 sig=a68edd4 -->
Task<Display?> UpdateConfig(ObjectId oldDisplayId, DisplayConfig newDisplayConfigCast);
/// <summary>
@@ -83,6 +92,7 @@ public interface IDisplayRepository : IMongoRepository<Display>
/// <param name="objectIdDisplay">The <see cref="ObjectId"/> of the display to update.</param>
/// <param name="objectIdConfigDisplay">The <see cref="ObjectId"/> of the display-config preset to associate.</param>
/// <returns>A <see cref="Task{Display}"/> representing the asynchronous operation. The task result contains the updated <see cref="Display"/> if the update succeeded; otherwise, <see langword="null"/>.</returns>
/// <!-- aidoc:v1 sig=6061a62 -->
Task<Display?> UpdateConfigPreset(ObjectId objectIdDisplay, ObjectId objectIdConfigDisplay);
/// <summary>
@@ -91,6 +101,7 @@ public interface IDisplayRepository : IMongoRepository<Display>
/// <param name="display">The <see cref="Display"/> instance to update. Its <see cref="ObjectId"/> is used to identify the document.</param>
/// <param name="name">The new display name.</param>
/// <returns>A <see cref="Task{Display}"/> representing the asynchronous operation. The task result contains the updated <see cref="Display"/>.</returns>
/// <!-- aidoc:v1 sig=43f880c -->
Task<Display> UpdateName(Display display, string name);
/// <summary>
@@ -98,6 +109,7 @@ public interface IDisplayRepository : IMongoRepository<Display>
/// </summary>
/// <param name="filter">The <see cref="PaginationFilter"/> containing pagination and filter criteria.</param>
/// <returns>An <see cref="IFindFluent{Display, Display}"/> instance that can be used to further refine and execute the query.</returns>
/// <!-- aidoc:v1 sig=35cf2af -->
IFindFluent<Display, Display> GetPaginatedDisplays(PaginationFilter filter);
/// <summary>
@@ -105,6 +117,7 @@ public interface IDisplayRepository : IMongoRepository<Display>
/// </summary>
/// <param name="displayConfigId">The <see cref="ObjectId"/> of the display configuration to check for usage.</param>
/// <returns>A <see cref="Task{Int64}"/> representing the asynchronous operation. The task result contains the number of displays referencing the configuration.</returns>
/// <!-- aidoc:v1 sig=ddb0904 -->
Task<long> IsDisplayConfigInUse(ObjectId displayConfigId);
/// <summary>
@@ -113,6 +126,7 @@ public interface IDisplayRepository : IMongoRepository<Display>
/// <param name="objectId">The <see cref="ObjectId"/> of the display to update.</param>
/// <param name="displayConfigId">The new <see cref="ObjectId"/> of the display configuration to associate with the display.</param>
/// <returns>A <see cref="Task{Display}"/> representing the asynchronous operation. The task result contains the updated <see cref="Display"/> if the update succeeded; otherwise, <see langword="null"/>.</returns>
/// <!-- aidoc:v1 sig=53467c7 -->
Task<Display?> UpdateConfigId(ObjectId objectId, ObjectId displayConfigId);
/// <summary>
@@ -120,6 +134,7 @@ public interface IDisplayRepository : IMongoRepository<Display>
/// </summary>
/// <param name="unitId">The <see cref="ObjectId"/> of the unit.</param>
/// <returns>A <see cref="Task{Int64}"/> representing the asynchronous operation. The task result contains the number of displays for the unit.</returns>
/// <!-- aidoc:v1 sig=e0dfc62 -->
Task<long> CountByUnitId(ObjectId unitId);
/// <summary>
@@ -127,6 +142,7 @@ public interface IDisplayRepository : IMongoRepository<Display>
/// </summary>
/// <param name="unitId">The <see cref="ObjectId"/> of the unit whose displays should be removed.</param>
/// <returns>A <see cref="Task{Boolean}"/> representing the asynchronous operation. The task result is <see langword="true"/> when at least one display was deleted; otherwise, <see langword="false"/>.</returns>
/// <!-- aidoc:v1 sig=903a910 -->
Task<bool> DeleteManyByUnitId(ObjectId unitId);
/// <summary>
@@ -134,5 +150,6 @@ public interface IDisplayRepository : IMongoRepository<Display>
/// </summary>
/// <param name="configId">The <see cref="ObjectId"/> of the card configuration to filter by.</param>
/// <returns>A <see cref="Task{List{Display}}"/> representing the asynchronous operation. The task result contains the matching displays, or an empty list if none exist.</returns>
/// <!-- aidoc:v1 sig=7885fbb -->
Task<List<Display>> GetByCardConfigId(ObjectId configId);
}
@@ -12,6 +12,7 @@ public interface IHistoricalConfigChangesRepository : IMongoRepository<Historica
/// </summary>
/// <param name="id">The unique identifier of the historical configuration changes record to look up.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the matching <see cref="HistoricalConfigChanges"/> record, or null if no record with the specified identifier exists.</returns>
/// <!-- aidoc:v1 sig=32618a1 -->
Task<HistoricalConfigChanges?> FindById(ObjectId id);
/// <summary>
@@ -19,6 +20,7 @@ public interface IHistoricalConfigChangesRepository : IMongoRepository<Historica
/// </summary>
/// <param name="historicalConfigChange">The historical config change entity containing the values to persist.</param>
/// <returns>A task that represents the asynchronous update operation. The result is the updated historical config change, or <c>null</c> if the record was not found.</returns>
/// <!-- aidoc:v1 sig=febe8cf -->
Task<HistoricalConfigChanges?> Update(HistoricalConfigChanges historicalConfigChange);
/// <summary>
@@ -27,24 +29,28 @@ public interface IHistoricalConfigChangesRepository : IMongoRepository<Historica
/// </summary>
/// <param name="id">The unique identifier of the historical configuration change to delete.</param>
/// <returns>A task that represents the asynchronous delete operation, containing the deleted <see cref="HistoricalConfigChanges"/> record, or <c>null</c> if no matching record exists.</returns>
/// <!-- aidoc:v1 sig=08b33f1 -->
Task<HistoricalConfigChanges?> Delete(ObjectId id);
/// <summary>
/// Asynchronously retrieves a list of all object identifiers.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains a list of ObjectId values.</returns>
/// <!-- aidoc:v1 sig=2b29fbf -->
Task<List<ObjectId>> FindAllIds();
/// <summary>
/// Asynchronously retrieves all historical configuration changes.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains a collection of <see cref="HistoricalConfigChanges"/> records.</returns>
/// <!-- aidoc:v1 sig=0d065db -->
Task<ICollection<HistoricalConfigChanges>> FindAll();
/// <summary>
/// Asynchronously inserts a new <see cref="HistoricalConfigChanges"/> record into the data store.
/// </summary>
/// <param name="patientObservation">The historical config change entity to insert.</param>
/// <returns>A task that represents the asynchronous insert operation, containing the inserted <see cref="HistoricalConfigChanges"/> entity, or <c>null</c> if the insertion did not produce a result.</returns>
/// <!-- aidoc:v1 sig=caa51e2 -->
new Task<HistoricalConfigChanges?> InsertOneAsync(HistoricalConfigChanges patientObservation);
/// <summary>
@@ -53,6 +59,7 @@ public interface IHistoricalConfigChangesRepository : IMongoRepository<Historica
/// <param name="cfgType">The configuration type used to filter the historical changes.</param>
/// <param name="num">The maximum number of recent changes to return. Defaults to 10.</param>
/// <returns>A task that returns a collection of historical configuration changes matching the specified type, ordered from most recent.</returns>
/// <!-- aidoc:v1 sig=36bb7c3 -->
Task<ICollection<HistoricalConfigChanges>> FindLastHistoricalConfigChangesByType(
DisplayConfigEnums.ConfigTypes cfgType, int num = 10);
@@ -63,6 +70,7 @@ public interface IHistoricalConfigChangesRepository : IMongoRepository<Historica
/// <param name="cfgType">Optional. The configuration type to filter the results by. If null, changes across all configuration types are returned.</param>
/// <param name="num">The maximum number of historical changes to return. Defaults to 10.</param>
/// <returns>A task representing the asynchronous operation, containing a collection of historical configuration changes for the user.</returns>
/// <!-- aidoc:v1 sig=e9b2c45 -->
Task<ICollection<HistoricalConfigChanges>> FindLastHistoricalConfigChangesByUser(string user,
DisplayConfigEnums.ConfigTypes? cfgType = null, int num = 10);
}
@@ -12,35 +12,41 @@ public interface ILightBeaconRepository : IMongoRepository<LightBeacon>
/// </summary>
/// <param name="configurationRelayList">The collection of configuration relay <see cref="ObjectId"/> values used to look up the corresponding light beacons.</param>
/// <returns>A <see cref="List{LightBeacon}"/> containing the light beacons matching the provided configuration relay identifiers; returns an empty list if no matches are found.</returns>
/// <!-- aidoc:v1 sig=74d25d3 -->
List<LightBeacon> GetLightBeaconInList(List<ObjectId> configurationRelayList);
/// <summary>
/// Retrieves a light beacon by its associated relay identifier.
/// </summary>
/// <param name="relayId">The unique identifier of the relay used to look up the corresponding light beacon.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the matching <see cref="LightBeacon"/>, or <c>null</c> if no beacon is found for the specified relay.</returns>
/// <!-- aidoc:v1 sig=53103f5 -->
Task<LightBeacon?> GetById(ObjectId relayId);
/// <summary>
/// Asynchronously retrieves a <see cref="LightBeacon"/> by its name.
/// </summary>
/// <param name="name">The name of the light beacon to look up.</param>
/// <returns>A task that returns the matching <see cref="LightBeacon"/>, or <c>null</c> if no beacon with the specified name is found.</returns>
/// <!-- aidoc:v1 sig=8fe6fa2 -->
Task<LightBeacon?> GetByName(string name);
/// <summary>
/// Asynchronously inserts a new LightBeacon and returns the persisted entity, or null if the insertion did not produce a result.
/// </summary>
/// <param name="beacon">The LightBeacon entity to insert.</param>
/// <returns>A task containing the inserted LightBeacon, or null when no entity was returned by the underlying operation.</returns>
/// <!-- aidoc:v1 sig=a792e57 -->
Task<LightBeacon?> InsertOneAsyncAndReturn(LightBeacon beacon);
/// <summary>
/// Retrieves a paginated, queryable collection of light beacons (relays) based on the supplied pagination filter.
/// </summary>
/// <param name="filter">The pagination filter that controls paging parameters applied to the relay list.</param>
/// <returns>An <see cref="IFindFluent{LightBeacon, LightBeacon}"/> exposing the paginated relay result set for further querying or enumeration.</returns>
/// <!-- aidoc:v1 sig=c985c38 -->
IFindFluent<LightBeacon, LightBeacon> GetPaginatedRelays(PaginationFilter filter);
/// <summary>
/// Asynchronously retrieves a list of <see cref="LightBeacon"/> objects whose name matches the specified search text.
/// </summary>
/// <param name="textToSearch">The text used to search for matching <see cref="LightBeacon"/> entries by name.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="LightBeacon"/> objects that match the search criteria.</returns>
/// <!-- aidoc:v1 sig=2c88e45 -->
Task<List<LightBeacon>> GetSearchByName(string textToSearch);
}
@@ -12,11 +12,13 @@ public interface IMasterListRepository<T> : IMongoRepository<T> where T : Master
/// Deletes the entity identified by the specified identifier.
/// </summary>
/// <param name="id">The identifier of the entity to delete.</param>
/// <!-- aidoc:v1 sig=0112d17 -->
Task Delete(ObjectId id);
/// <summary>
/// Asynchronously updates the specified collection of items.
/// </summary>
/// <param name="list">The collection of items to update.</param>
/// <!-- aidoc:v1 sig=85228bb -->
Task Update(T list);
/// <summary>
/// Asynchronously retrieves an entity identified by the specified <paramref name="id"/>, optionally resolving localized content using the given <paramref name="locale"/>. Returns <c>null</c> when no matching entity is found.
@@ -24,6 +26,7 @@ public interface IMasterListRepository<T> : IMongoRepository<T> where T : Master
/// <param name="id">The unique identifier of the entity to look up.</param>
/// <param name="locale">The optional locale used to resolve localized fields of the retrieved entity.</param>
/// <returns>A task that yields the matching entity, or <c>null</c> if the entity is not found.</returns>
/// <!-- aidoc:v1 sig=96a4e49 -->
Task<T?> FindById(ObjectId id, LocaleEnum? locale);
/// <summary>
/// Asynchronously retrieves an entity of type <typeparamref name="T"/> by its unique identifier.
@@ -31,6 +34,7 @@ public interface IMasterListRepository<T> : IMongoRepository<T> where T : Master
/// </summary>
/// <param name="id">The unique identifier of the entity to locate.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the entity of type <typeparamref name="T"/> if found, or <c>null</c> otherwise.</returns>
/// <!-- aidoc:v1 sig=b0b0918 -->
Task<T?> FindById(ObjectId id);
/// <summary>
/// Asynchronously retrieves an <see cref="OptionList"/> item identified by the specified master and option identifiers for the given locale.
@@ -40,6 +44,7 @@ public interface IMasterListRepository<T> : IMongoRepository<T> where T : Master
/// <param name="optionId">The identifier of the specific option item to retrieve within the master scope.</param>
/// <param name="locale">The locale used to select the localized version of the option item.</param>
/// <returns>A <see cref="Task{TResult}"/> that yields the matching <see cref="OptionList"/>, or <c>null</c> if no item is found.</returns>
/// <!-- aidoc:v1 sig=353f501 -->
Task<OptionList?> FindOptionItemById(ObjectId masterId, ObjectId optionId, LocaleEnum locale);
/// <summary>
/// Asynchronously retrieves an <see cref="OptionList"/> identified by the given master and option identifiers.
@@ -47,17 +52,20 @@ public interface IMasterListRepository<T> : IMongoRepository<T> where T : Master
/// <param name="masterId">The identifier of the master record that owns the option list.</param>
/// <param name="optionId">The identifier of the specific option item to locate within the master.</param>
/// <returns>A <see cref="Task{OptionList}"/> that yields the matching <see cref="OptionList"/>, or <c>null</c> when no item is found.</returns>
/// <!-- aidoc:v1 sig=ff21f84 -->
Task<OptionList?> FindOptionItemById(ObjectId masterId, ObjectId optionId);
/// <summary>
/// Asynchronously retrieves all items of type T.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains an enumerable collection of all items of type T.</returns>
/// <!-- aidoc:v1 sig=48c919f -->
Task<IEnumerable<T>> GetAll();
/// <summary>
/// Retrieves all master list entries without applying optional filters or including related option data.
/// Used to fetch the complete set of master list records for scenarios such as full enumeration or bulk operations.
/// </summary>
/// <returns>A task that represents the asynchronous operation, containing an <see cref="IEnumerable{MasterListDto}"/> with all available master list entries.</returns>
/// <!-- aidoc:v1 sig=5929589 -->
Task<IEnumerable<MasterListDto>> GetAllWithoutOptions();
/// <summary>
/// Asynchronously finds and returns an entity of type <typeparamref name="T"/> matching the specified <paramref name="name"/>.
@@ -65,6 +73,7 @@ public interface IMasterListRepository<T> : IMongoRepository<T> where T : Master
/// </summary>
/// <param name="name">The name used to look up the entity.</param>
/// <returns>A task that represents the asynchronous lookup, containing the matched entity of type <typeparamref name="T"/> or <c>null</c> if no match exists.</returns>
/// <!-- aidoc:v1 sig=f5a2991 -->
Task<T?> FindByName(string name);
/// <summary>
/// Retrieves a master list of option list entries filtered by the specified identifier and an optional text search that performs a contains match.
@@ -72,6 +81,7 @@ public interface IMasterListRepository<T> : IMongoRepository<T> where T : Master
/// <param name="id">The identifier used to scope the option list entries to be returned.</param>
/// <param name="textSearch">An optional text used to filter entries whose content contains the specified value; may be null to skip text-based filtering.</param>
/// <returns>A task representing the asynchronous operation, containing a list of <see cref="OptionList"/> entries that match the identifier and the optional text search criteria.</returns>
/// <!-- aidoc:v1 sig=807ba8d -->
Task<List<OptionList>> GetMasterListByIdAndTextSearchContaining(ObjectId id, string? textSearch);
/// <summary>
/// Asynchronously adds a <see cref="FilterOptionListElement"/> to the master option list identified by the given <see cref="ObjectId"/>.
@@ -79,6 +89,7 @@ public interface IMasterListRepository<T> : IMongoRepository<T> where T : Master
/// <param name="id">The identifier of the master option list to which the element will be added.</param>
/// <param name="opt">The filter option list element to add to the master list.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the resulting <see cref="OptionList"/>, or <c>null</c> if no list is returned.</returns>
/// <!-- aidoc:v1 sig=07eea1e -->
Task<OptionList?> AddOptionToMasterList(ObjectId id, FilterOptionListElement opt);
/// <summary>
/// Updates an existing master list option identified by the specified identifier using the provided option data and locale, returning the updated option list.
@@ -87,6 +98,7 @@ public interface IMasterListRepository<T> : IMongoRepository<T> where T : Master
/// <param name="newOpt">The new option list data to apply to the master list option.</param>
/// <param name="locale">The locale used for the update operation.</param>
/// <returns>A task that represents the asynchronous operation, containing the updated <see cref="OptionList"/> if found, or <c>null</c> if no matching master list option exists.</returns>
/// <!-- aidoc:v1 sig=69ad188 -->
Task<OptionList?> UpdateMasterListOption(ObjectId id, OptionList newOpt, LocaleEnum locale);
/// <summary>
/// Updates an existing master list option identified by the given id with the provided data, returning the updated option or null if no matching option is found.
@@ -94,6 +106,7 @@ public interface IMasterListRepository<T> : IMongoRepository<T> where T : Master
/// <param name="id">The unique identifier of the master list option to update.</param>
/// <param name="newOpt">The new option data to replace the existing master list option.</param>
/// <returns>A task representing the asynchronous operation, containing the updated <see cref="OptionList"/>, or null if no option with the specified id exists.</returns>
/// <!-- aidoc:v1 sig=7c563ac -->
Task<OptionList?> UpdateFullMasterListOption(ObjectId id, OptionList newOpt);
/// <summary>
/// Updates an existing master list option identified by the specified id with the provided new option data.
@@ -101,6 +114,7 @@ public interface IMasterListRepository<T> : IMongoRepository<T> where T : Master
/// <param name="id">The unique identifier of the master list option to update.</param>
/// <param name="newOpt">The new option data to apply to the existing master list option.</param>
/// <returns>A task that represents the asynchronous operation, containing the updated <see cref="OptionList"/>, or <c>null</c> if no matching option was found.</returns>
/// <!-- aidoc:v1 sig=1f17447 -->
Task<OptionList?> UpdateMasterListOption(ObjectId id, OptionList newOpt);
/// <summary>
/// Deletes a master list option identified by the specified option ID.
@@ -108,6 +122,7 @@ public interface IMasterListRepository<T> : IMongoRepository<T> where T : Master
/// <param name="id">The identifier of the master list containing the option to delete.</param>
/// <param name="deleteOptId">The identifier of the option to be deleted from the master list.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains a boolean indicating whether the option was successfully deleted.</returns>
/// <!-- aidoc:v1 sig=2e650f2 -->
Task<bool> DeleteMasterListOption(ObjectId id, ObjectId deleteOptId);
/// <summary>
/// Updates the option details of an existing entry in the master list identified by the specified id.
@@ -115,6 +130,7 @@ public interface IMasterListRepository<T> : IMongoRepository<T> where T : Master
/// <param name="id">The unique identifier of the master list entry to update.</param>
/// <param name="opt">The update payload containing the new option details to apply.</param>
/// <returns>A task that represents the asynchronous operation, containing the updated master list details, or null if no matching entry is found.</returns>
/// <!-- aidoc:v1 sig=1d0803c -->
Task<UpdateMasterListDetailsDto?> UpdateOptionDetailsToMasterList(ObjectId id, UpdateMasterListDetailsDto opt);
/// <summary>
/// Updates the name of an existing master list identified by the specified identifier.
@@ -122,6 +138,7 @@ public interface IMasterListRepository<T> : IMongoRepository<T> where T : Master
/// <param name="id">The unique identifier of the master list to update.</param>
/// <param name="name">The new name to assign to the master list.</param>
/// <returns>A task that represents the asynchronous operation. The task result is <c>true</c> if the master list was updated successfully; otherwise, <c>false</c>.</returns>
/// <!-- aidoc:v1 sig=a2d47b2 -->
Task<bool> UpdateMasterListName(ObjectId id, string name);
/// <summary>
/// Asynchronously updates the description of a master list identified by the specified identifier.
@@ -129,6 +146,7 @@ public interface IMasterListRepository<T> : IMongoRepository<T> where T : Master
/// <param name="id">The unique identifier of the master list to update.</param>
/// <param name="description">The new description to set for the master list.</param>
/// <returns>A task that represents the asynchronous operation. The task result is <see langword="true"/> if the update was successful; otherwise, <see langword="false"/>.</returns>
/// <!-- aidoc:v1 sig=d9584a6 -->
Task<bool> UpdateMasterListDescription(ObjectId id, string description);
/// <summary>
/// Asynchronously removes the specified option from the master list associated with the given identifier.
@@ -136,12 +154,14 @@ public interface IMasterListRepository<T> : IMongoRepository<T> where T : Master
/// <param name="id">The identifier of the master list from which the option will be removed.</param>
/// <param name="oldOpt">The option to be removed from the master list.</param>
/// <returns>A task that represents the asynchronous removal operation. The task result contains true if the option was successfully removed; otherwise, false.</returns>
/// <!-- aidoc:v1 sig=f049a15 -->
Task<bool> RemoveMasterListOption(ObjectId id, OptionList oldOpt);
/// <summary>
/// Retrieves a paginated master list using the specified pagination filter, returning a fluent queryable result.
/// </summary>
/// <param name="filter">The pagination filter that defines the paging criteria applied to the master list query.</param>
/// <returns>An <see cref="IFindFluent{TDocument, TProjection}"/> that represents the paginated queryable master list.</returns>
/// <!-- aidoc:v1 sig=6bbc1e5 -->
IFindFluent<T, T> GetPaginatedMasterList(PaginationFilter filter);
/// <summary>
/// Retrieves a paginated collection of options associated with the specified list identifier, applying the provided pagination filter to control the result set.
@@ -149,11 +169,13 @@ public interface IMasterListRepository<T> : IMongoRepository<T> where T : Master
/// <param name="filter">The pagination filter defining page size, page number, and related pagination constraints.</param>
/// <param name="listId">The unique identifier of the list whose options should be retrieved.</param>
/// <returns>A task representing the asynchronous operation, containing a list of <see cref="OptionList"/> items for the requested page.</returns>
/// <!-- aidoc:v1 sig=f5b427c -->
Task<List<OptionList>> GetPaginatedOptions(PaginationFilter filter, ObjectId listId);
/// <summary>
/// Asynchronously counts the number of items and returns the total.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains the total count of items.</returns>
/// <!-- aidoc:v1 sig=cabd009 -->
Task<int> Count();
/// <summary>
/// Retrieves a master list of <see cref="OptionList"/> entries identified by the given id, optionally applying the provided search and filtering options.
@@ -161,5 +183,6 @@ public interface IMasterListRepository<T> : IMongoRepository<T> where T : Master
/// <param name="id">The identifier of the master list to retrieve.</param>
/// <param name="filterOption">Optional filter criteria used to narrow the returned options. May be <c>null</c> to return the full list without additional filtering.</param>
/// <returns>A task that represents the asynchronous operation, containing the list of <see cref="OptionList"/> items that match the specified id and filter, or an empty list if no matching entries are found.</returns>
/// <!-- aidoc:v1 sig=437ba17 -->
Task<List<OptionList>> GetMasterListByIdAndSearchOptions(ObjectId id, FilterOptionListElement? filterOption);
}
@@ -12,6 +12,7 @@ public interface IMedicineRepository : IMongoRepository<Medicine>
/// </summary>
/// <param name="code">The code used to look up the medicine.</param>
/// <returns>A task that returns the matching <see cref="Medicine"/> if found, or <c>null</c> if no medicine matches the specified code.</returns>
/// <!-- aidoc:v1 sig=27e988f -->
Task<Medicine?> GetMedicine(string code);
/// <summary>
@@ -19,17 +20,20 @@ public interface IMedicineRepository : IMongoRepository<Medicine>
/// </summary>
/// <param name="codeNotes">The list of codes or notes used to look up the medicines.</param>
/// <returns>A task that represents the asynchronous operation, containing the list of matching medicines.</returns>
/// <!-- aidoc:v1 sig=2a2f753 -->
Task<List<Medicine>> GetMedicineByCodeOrNote(List<string> codeNotes);
/// <summary>
/// Retrieves a <see cref="Medicine"/> entity by its name asynchronously.
/// </summary>
/// <param name="name">The name of the medicine to look up.</param>
/// <returns>A <see cref="Task{Medicine}"/> that resolves to the matching <see cref="Medicine"/>, or <c>null</c> if no medicine with the specified name is found.</returns>
/// <!-- aidoc:v1 sig=2bab729 -->
Task<Medicine?> GetMedicineByName(string name);
/// <summary>
/// Asynchronously retrieves all medicines from the data source.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains a list of <see cref="Medicine"/> objects; an empty list is returned when no medicines are found.</returns>
/// <!-- aidoc:v1 sig=84b2421 -->
Task<List<Medicine>> GetAll();
/// <summary>
/// Retrieves a medicine entity by its unique identifier from the data store.
@@ -37,29 +41,34 @@ public interface IMedicineRepository : IMongoRepository<Medicine>
/// </summary>
/// <param name="medicineId">The unique <see cref="ObjectId"/> of the medicine to retrieve.</param>
/// <returns>A <see cref="Task{TResult}"/> containing the matching <see cref="Medicine"/> if found, or <see langword="null"/> when no record exists for the given identifier.</returns>
/// <!-- aidoc:v1 sig=a87fd1e -->
Task<Medicine?> GetMedicineById(ObjectId medicineId);
/// <summary>
/// Asynchronously creates and posts a new medicine entry, returning the persisted <see cref="Medicine"/> on success or <c>null</c> when no result is produced.
/// </summary>
/// <param name="medicine">The medicine entity to be created and submitted.</param>
/// <returns>A task that resolves to the newly created <see cref="Medicine"/>, or <c>null</c> if the operation does not yield a result.</returns>
/// <!-- aidoc:v1 sig=9decc93 -->
Task<Medicine?> PostMedicine(Medicine medicine);
/// <summary>
/// Updates an existing medicine record with the provided information.
/// </summary>
/// <param name="medicine">The medicine entity containing the updated data, typically identified by its primary key.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the updated <see cref="Medicine"/>, or <c>null</c> if no matching medicine was found.</returns>
/// <!-- aidoc:v1 sig=2ae8490 -->
Task<Medicine?> UpdateMedicine(Medicine medicine);
/// <summary>
/// Asynchronously deletes a medicine record from the data store using the specified identifier.
/// </summary>
/// <param name="medicineId">The unique identifier of the medicine to delete.</param>
/// <!-- aidoc:v1 sig=44a1285 -->
Task DeleteMedicineById(ObjectId medicineId);
/// <summary>
/// Builds a MongoDB aggregation pipeline that retrieves the distinct values for the specified field.
/// </summary>
/// <param name="field">The name of the field whose distinct values should be queried.</param>
/// <returns>An <see cref="IAggregateFluent{BsonDocument}"/> representing the distinct field data query.</returns>
/// <!-- aidoc:v1 sig=ec965d8 -->
IAggregateFluent<BsonDocument> GetDistinctFieldDataQuery(string field);
/// <summary>
@@ -67,5 +76,6 @@ public interface IMedicineRepository : IMongoRepository<Medicine>
/// </summary>
/// <param name="filter">The pagination filter containing the page number and page size used to control the result set.</param>
/// <returns>A fluent query interface for the paginated medicines.</returns>
/// <!-- aidoc:v1 sig=c603913 -->
IFindFluent<Medicine, Medicine> GetPaginatedMedicines(PaginationFilter filter);
}
@@ -11,23 +11,27 @@ public interface IMongoRepository<T>
/// Gets the name of the collection.
/// </summary>
/// <returns>The name of the collection.</returns>
/// <!-- aidoc:v1 sig=a1be5ef -->
string GetCollectionName();
/// <summary>
/// Asynchronously inserts a single object of type <typeparamref name="T"/>.
/// </summary>
/// <param name="obj">The object to insert.</param>
/// <returns>A task that represents the asynchronous insert operation.</returns>
/// <!-- aidoc:v1 sig=f786cc1 -->
Task InsertOneAsync(T obj);
/// <summary>
/// Asynchronously deletes the entity identified by the specified identifier and returns the deleted entity.
/// </summary>
/// <param name="id">The unique identifier of the entity to delete.</param>
/// <returns>A task that represents the asynchronous operation, containing the deleted entity of type <typeparamref name="T"/>, or <c>null</c> if no matching entity was found.</returns>
/// <!-- aidoc:v1 sig=e29699e -->
Task<T?> DeleteAsync(ObjectId id);
/// <summary>
/// Asynchronously updates an existing document identified by the specified identifier with the provided object data.
/// </summary>
/// <param name="id">The unique identifier of the document to update.</param>
/// <param name="obj">The object containing the updated values to persist.</param>
/// <!-- aidoc:v1 sig=3e43209 -->
Task UpdateOneAsync(ObjectId id, T obj);
}
@@ -9,39 +9,46 @@ public interface INoticeRepository : IMongoRepository<Notice>
/// Deletes the entity identified by the specified <see cref="ObjectId"/>.
/// </summary>
/// <param name="id">The <see cref="ObjectId"/> of the entity to delete.</param>
/// <!-- aidoc:v1 sig=0112d17 -->
Task Delete(ObjectId id);
/// <summary>
/// Asynchronously updates an existing notice with the provided information.
/// </summary>
/// <param name="notice">The notice entity containing the updated data to be persisted.</param>
/// <!-- aidoc:v1 sig=3841eb4 -->
Task Update(Notice notice);
/// <summary>
/// Asynchronously retrieves all notices.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains an enumerable collection of all <see cref="Notice"/> objects.</returns>
/// <!-- aidoc:v1 sig=f8ca02f -->
Task<IEnumerable<Notice>> FindAll();
/// <summary>
/// Retrieves a <see cref="Notice"/> by its unique identifier. Returns <c>null</c> when no matching notice is found.
/// </summary>
/// <param name="id">The identifier of the notice to look up.</param>
/// <returns>A task that yields the matching <see cref="Notice"/>, or <c>null</c> if no notice exists for the specified <paramref name="id"/>.</returns>
/// <!-- aidoc:v1 sig=da1f6f5 -->
Task<Notice?> FindById(ObjectId id);
/// <summary>
/// Asynchronously retrieves the collection of notices that match the specified date.
/// </summary>
/// <param name="date">The date used to filter the notices to be retrieved.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains a collection of <see cref="Notice"/> objects for the specified date, or <c>null</c> if no matching notices are found.</returns>
/// <!-- aidoc:v1 sig=aaaf476 -->
Task<IEnumerable<Notice>?> FindByDate(DateTime date);
/// <summary>
/// Asynchronously retrieves the <see cref="Notice"/> entries that match the specified type.
/// </summary>
/// <param name="type">The notice type used to filter the lookup.</param>
/// <returns>A task containing the matching <see cref="Notice"/> items, or <c>null</c> when no results are available.</returns>
/// <!-- aidoc:v1 sig=64b3426 -->
Task<IEnumerable<Notice>?> FindByType(string type);
/// <summary>
/// Asynchronously retrieves the <see cref="Notice"/> entities associated with the specified display identifier.
/// </summary>
/// <param name="displayId">The display identifier used to locate the matching notices.</param>
/// <returns>A task that yields the collection of matching <see cref="Notice"/> items, or <c>null</c> if no notices are found.</returns>
/// <!-- aidoc:v1 sig=08d036f -->
Task<IEnumerable<Notice>?> FindByDisplayId(ObjectId displayId);
}
@@ -9,17 +9,20 @@ public interface IObservationArchiveRepository : IMongoRepository<PatientObserva
/// Asynchronously inserts a single <see cref="PatientObservation"/> into the data store.
/// </summary>
/// <param name="patientObservation">The patient observation to insert.</param>
/// <!-- aidoc:v1 sig=a11df0e -->
new Task InsertOneAsync(PatientObservation patientObservation);
/// <summary>
/// Deletes the records that have a date earlier than the specified cutoff date.
/// </summary>
/// <param name="date">The cutoff date; records dated before this value will be removed.</param>
/// <!-- aidoc:v1 sig=350661d -->
Task DeleteBeforeDate(DateTime date);
/// <summary>
/// Asynchronously inserts a batch of patient observation records into the underlying data store.
/// </summary>
/// <param name="observations">The collection of <see cref="PatientObservation"/> entities to be inserted.</param>
/// <returns>A <see cref="Task{TResult}"/> that represents the asynchronous insert operation, returning a <see cref="long"/> value (such as the number of affected rows or a generated identifier) produced by the batch insertion.</returns>
/// <!-- aidoc:v1 sig=713717d -->
Task<long> InsertBatch(IEnumerable<PatientObservation> observations);
/// <summary>
@@ -30,6 +33,7 @@ public interface IObservationArchiveRepository : IMongoRepository<PatientObserva
/// <param name="lastDate">The cutoff date; only observations on or before this date are considered.</param>
/// <param name="filterObservations">An optional list of observation names to restrict the results to; pass an empty or null list to include all observations.</param>
/// <returns>A task that resolves to a list of <see cref="PatientObservation"/> entries representing the aggregated last observations matching the criteria.</returns>
/// <!-- aidoc:v1 sig=1fb9a10 -->
Task<List<PatientObservation>> AggregatedPatientLastObservations(ObjectId patientId, int num, DateTime lastDate,
List<string> filterObservations);
@@ -38,5 +42,6 @@ public interface IObservationArchiveRepository : IMongoRepository<PatientObserva
/// </summary>
/// <param name="patientId">The identifier of the patient whose observations are being retrieved.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="PatientObservation"/> records for the patient.</returns>
/// <!-- aidoc:v1 sig=644a6c3 -->
Task<List<PatientObservation>> FindAllFromPatient(ObjectId patientId);
}
@@ -15,6 +15,7 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// <param name="patientId">The identifier of the patient whose observations will be aggregated.</param>
/// <param name="groupedField">The field used to group the patient's observations during aggregation.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of BSON documents with the aggregated results.</returns>
/// <!-- aidoc:v1 sig=6bf1b3d -->
Task<List<BsonDocument>> AggregatedPatientGroupedObservations(ObjectId patientId, GroupedField groupedField);
/// <summary>
@@ -26,6 +27,7 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// <param name="num">The maximum number of most recent observations to return.</param>
/// <param name="filterObservations">An optional list of observation identifiers used to restrict the returned results; if null, no filter is applied.</param>
/// <returns>A task representing the asynchronous operation, containing a list of the patient's most recent <see cref="PatientObservation"/> records.</returns>
/// <!-- aidoc:v1 sig=eaa55e7 -->
Task<List<PatientObservation>> AggregatedPatientLastObservations(ObjectId patientId, int num,
List<string>? filterObservations = null);
@@ -37,6 +39,7 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// <param name="lastDate">The cutoff date; only observations on or before this date are considered.</param>
/// <param name="filterObservations">An optional list of observation names to restrict the results to. If null, no observation-name filter is applied.</param>
/// <returns>A task that represents the asynchronous operation, containing the list of aggregated <see cref="PatientObservation"/> entries that match the criteria.</returns>
/// <!-- aidoc:v1 sig=e0e7bb3 -->
Task<List<PatientObservation>> AggregatedPatientLastObservationsByLastDate(ObjectId patientId, int num,
DateTime lastDate, List<string>? filterObservations = null);
@@ -46,6 +49,7 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// <param name="patientId">The unique identifier of the patient whose observations are being retrieved.</param>
/// <param name="filterObservations">An optional list of fields to filter the observations by; if null, observations for all fields are returned.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains a list of the latest patient observations grouped by field.</returns>
/// <!-- aidoc:v1 sig=50cede3 -->
Task<List<PatientObservation>> AggregatedPatientLastObservationsByField(ObjectId patientId,
List<Field>? filterObservations = null);
@@ -57,6 +61,7 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// <param name="code">The specific code within the coding system identifying the type of observation to retrieve.</param>
/// <param name="num">The maximum number of most recent observations to return. Defaults to 2.</param>
/// <returns>A task that yields a collection of the matching <see cref="PatientObservation"/> records, ordered from most recent to oldest, containing at most <paramref name="num"/> entries.</returns>
/// <!-- aidoc:v1 sig=f22fd00 -->
Task<IEnumerable<PatientObservation>> FindLastObservations(ObjectId patientId, string codingSystem, string code,
int num = 2);
@@ -67,6 +72,7 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// <param name="codingSystem">The coding system used to filter the observations.</param>
/// <param name="num">The maximum number of recent observations to return. Defaults to 10.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of the patient's most recent observations matching the coding system.</returns>
/// <!-- aidoc:v1 sig=0970f2d -->
Task<List<PatientObservation>> FindLastObservationsByCodingSystem(ObjectId patientId, string codingSystem,
int num = 10);
@@ -77,12 +83,14 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// <param name="name">The optional name of the observation to filter by. If <c>null</c>, observations of any name are considered.</param>
/// <param name="date">The cutoff date; only observations recorded strictly before this date are eligible.</param>
/// <returns>A task that resolves to the matching <see cref="PatientObservation"/> if found, or <c>null</c> if no observation exists before the specified date.</returns>
/// <!-- aidoc:v1 sig=2d11f04 -->
Task<PatientObservation?> FindLastObservationBeforeDate(ObjectId patientId, string? name, DateTime date);
/// <summary>
/// Asynchronously updates the state of patient observations that have expired, applying the appropriate expiration handling to each item in the provided list.
/// </summary>
/// <param name="expiredObservations">The list of patient observations that have expired and require their state to be updated.</param>
/// <!-- aidoc:v1 sig=e7ed4fa -->
Task UpdateExpiredObservations(List<PatientObservation> expiredObservations);
/// <summary>
@@ -92,6 +100,7 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// <param name="name">The optional name of the observation to match; if null, observations of any name are considered.</param>
/// <param name="date">The date used to match observations recorded on the same day.</param>
/// <returns>A task that returns a list of matching <see cref="PatientObservation"/> instances, or <c>null</c> if no matching observations are found.</returns>
/// <!-- aidoc:v1 sig=c14ce85 -->
Task<List<PatientObservation>?> FindAnyWithSameDate(ObjectId patientId, string? name, DateTime date);
/// <summary>
/// Asynchronously retrieves all patient observations recorded for the specified patient before the given date.
@@ -99,6 +108,7 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// <param name="patientId">The unique identifier of the patient whose observations are being queried.</param>
/// <param name="date">The cutoff date; only observations recorded prior to this date are returned.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of patient observations found before the specified date.</returns>
/// <!-- aidoc:v1 sig=d6e7618 -->
Task<List<PatientObservation>> FindAnyBeforeDate(ObjectId patientId, DateTime date);
/// <summary>
@@ -108,23 +118,27 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// <param name="name">The name used to match the relevant patient observations.</param>
/// <param name="expires">An optional expiration value in seconds used to control the time window for the lookup; if <c>null</c>, no expiration is applied.</param>
/// <returns>A task that resolves to a list of the latest unique <see cref="PatientObservation"/> records matching the specified name for the patient. The list is empty if no matching observations are found.</returns>
/// <!-- aidoc:v1 sig=cd1a09e -->
Task<List<PatientObservation>> FindLatestUniqueValuesByName(ObjectId patientId, string name, int? expires);
/// <summary>
/// Asynchronously inserts a single <see cref="PatientObservation"/> record into the underlying data store.
/// </summary>
/// <param name="patientObservation">The patient observation entity to persist.</param>
/// <!-- aidoc:v1 sig=a11df0e -->
new Task InsertOneAsync(PatientObservation patientObservation);
/// <summary>
/// Deletes records associated with the specified patient identifier.
/// </summary>
/// <param name="id">The ObjectId of the patient whose related records should be removed.</param>
/// <!-- aidoc:v1 sig=d457cb9 -->
Task DeleteByPatientId(ObjectId id);
/// <summary>
/// Asynchronously retrieves the collection of patient observations associated with the specified patient identifier.
/// </summary>
/// <param name="patientId">The unique identifier of the patient whose observations are to be retrieved.</param>
/// <returns>A task that represents the asynchronous operation, containing an <see cref="IAsyncCursor{TDocument}"/> of <see cref="PatientObservation"/> instances to iterate through the matching records.</returns>
/// <!-- aidoc:v1 sig=39ad19b -->
Task<IAsyncCursor<PatientObservation>> FindByPatientIdAsync(ObjectId patientId);
/// <summary>
@@ -135,6 +149,7 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// <param name="codingSystem">The coding system used to classify the observations (e.g., LOINC, SNOMED).</param>
/// <param name="name">The name of the observation to filter within the coding system.</param>
/// <returns>A <see cref="Task{TResult}"/> that yields an <see cref="IAsyncCursor{TDocument}"/> streaming the matching <see cref="PatientObservation"/> documents.</returns>
/// <!-- aidoc:v1 sig=d7bdee5 -->
Task<IAsyncCursor<PatientObservation>> FindByPatientIdAndCodingSystemAsync(ObjectId patientId, string codingSystem,
string name);
@@ -143,6 +158,7 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// </summary>
/// <param name="id">The unique identifier of the entity to delete.</param>
/// <returns>A task that represents the asynchronous delete operation.</returns>
/// <!-- aidoc:v1 sig=9f8dfa3 -->
new Task DeleteAsync(ObjectId id);
/// <summary>
/// Asynchronously deletes patient observations older than the specified retention period and returns the records that were removed.
@@ -150,6 +166,7 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// <param name="name">The identifier used to locate the relevant patient observations to be evaluated for deletion.</param>
/// <param name="retentionPolicyValue">The retention period in days; observations older than this value will be deleted.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of the deleted <see cref="PatientObservation"/> records.</returns>
/// <!-- aidoc:v1 sig=221fcb6 -->
Task<List<PatientObservation>> DeleteOlderDaysAsync(string name, int retentionPolicyValue);
/// <summary>
/// Asynchronously deletes patient observations based on the specified name and retention policy value.
@@ -157,6 +174,7 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// <param name="name">The name used to identify or filter the patient observations to be deleted.</param>
/// <param name="retentionPolicyValue">The retention policy threshold value that determines which older observations should be removed.</param>
/// <returns>A task representing the asynchronous operation, containing the list of patient observations that were deleted.</returns>
/// <!-- aidoc:v1 sig=7338971 -->
Task<List<PatientObservation>> DeleteOlderNumberAsync(string name, int retentionPolicyValue);
/// <summary>
/// Asynchronously checks whether a record exists for the specified patient identified by the given system identifier.
@@ -164,6 +182,7 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// <param name="patientid">The unique identifier of the patient whose record is being checked.</param>
/// <param name="systemId">The system identifier used to look up the patient's record.</param>
/// <returns>A task that represents the asynchronous operation. The task result is <c>true</c> if a matching record exists; otherwise, <c>false</c>.</returns>
/// <!-- aidoc:v1 sig=d900b6f -->
Task<bool> ExistBySystemId(ObjectId patientid, string systemId);
/// <summary>
/// Asynchronously deletes patient observations older than the specified number of seconds and returns the affected records.
@@ -171,17 +190,20 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// <param name="name">The name used to identify the patient observations to filter for deletion.</param>
/// <param name="value">The age threshold in seconds; observations older than this value will be deleted.</param>
/// <returns>A task that represents the asynchronous operation, containing the list of deleted patient observations.</returns>
/// <!-- aidoc:v1 sig=5df4a1a -->
Task<List<PatientObservation>> DeleteOlderSecondsAsync(string name, int value);
/// <summary>
/// Retrieves the aggregated active intravenous lines observations for the specified patient.
/// </summary>
/// <param name="patientId">The unique identifier of the patient whose active intravenous lines observations are being retrieved.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="PatientObservation"/> entries representing the patient's active intravenous lines observations, where each entry may be null.</returns>
/// <!-- aidoc:v1 sig=d7ee355 -->
Task<List<PatientObservation?>> AggregatedPatientActiveIntravenousLinesObservations(ObjectId patientId);
/// <summary>
/// Asynchronously retrieves the most recent observation timestamp for every patient, returning a mapping of patient identifiers to their last observation times.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains a dictionary where each key is a patient <see cref="ObjectId"/> and the associated value is the date and time of that patient's last observation.</returns>
/// <!-- aidoc:v1 sig=cbcaa4c -->
Task<Dictionary<ObjectId, DateTime>> FindAllLastPatientObservationTime();
/// <summary>
@@ -189,6 +211,7 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// </summary>
/// <param name="id">The unique identifier of the patient observation to locate.</param>
/// <returns>A <see cref="Task{PatientObservation}"/> that resolves to the matching <see cref="PatientObservation"/>, or <c>null</c> if no observation exists for the given identifier.</returns>
/// <!-- aidoc:v1 sig=1d8d07e -->
Task<PatientObservation?> FindById(ObjectId id);
/// <summary>
@@ -196,11 +219,13 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// </summary>
/// <param name="id">The unique identifier of the patient whose observations are being retrieved.</param>
/// <returns>A task containing a list of <see cref="PatientObservation"/> objects for the specified patient, or null if no observations are found.</returns>
/// <!-- aidoc:v1 sig=331eec2 -->
Task<List<PatientObservation>?> FindByPatientId(ObjectId id);
/// <summary>
/// Updates an existing patient observation with the provided data.
/// </summary>
/// <param name="observation">The patient observation containing the updated information to be persisted.</param>
/// <!-- aidoc:v1 sig=86309e7 -->
Task Update(PatientObservation observation);
/// <summary>
/// Updates many records by replacing the specified old ObjectId with the new ObjectId identified by the given name.
@@ -208,6 +233,7 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// <param name="nameId">The name identifier used to locate the target collection or field to update.</param>
/// <param name="id">The new ObjectId to assign to the matching records.</param>
/// <param name="oldId">The existing ObjectId that identifies the records to be updated.</param>
/// <!-- aidoc:v1 sig=24ef97c -->
Task UpdateManyObjectId(string nameId, ObjectId id, ObjectId oldId);
/// <summary>
@@ -215,6 +241,7 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// </summary>
/// <param name="filterObservations">An optional list of observation identifiers used to narrow the result set. May be null or contain null entries.</param>
/// <returns>A task that resolves to a collection of non-expired <see cref="PatientObservation"/> instances matching the filter criteria.</returns>
/// <!-- aidoc:v1 sig=dc784c5 -->
Task<IEnumerable<PatientObservation>> FindNotExpired(List<string?>? filterObservations);
/// <summary>
@@ -223,6 +250,7 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// <param name="name">The name used to look up the patient observations.</param>
/// <param name="date">The optional date used to filter the observations; when null, results are not restricted by date.</param>
/// <returns>A task that represents the asynchronous operation, containing a collection of <see cref="PatientObservation"/> entries that match the criteria.</returns>
/// <!-- aidoc:v1 sig=239fa0e -->
Task<IEnumerable<PatientObservation>> FindByName(string name, DateTime? date);
/// <summary>
@@ -230,18 +258,22 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// </summary>
/// <param name="patientObservations">The collection of patient observations to update.</param>
/// <param name="update">The update definition describing the modifications to apply to each patient observation.</param>
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
/// "The summary states documents are updated because they 'match the provided update definition', but the update definition describes modifications, not a filter. The method takes an explicit collection of patient observations and applies the update to each, rather than matching documents by the update definition." -->
Task UpdateMany(IEnumerable<PatientObservation> patientObservations, UpdateDefinition<PatientObservation> update);
/// <summary>
/// Retrieves all patient observation records.
/// </summary>
/// <returns>A task representing the asynchronous operation, containing a collection of <see cref="PatientObservation"/> entries.</returns>
/// <!-- aidoc:v1 sig=e3a2156 -->
Task<IEnumerable<PatientObservation>> FindAll();
/// <summary>
/// Asynchronously processes and expires the specified configuration observations that have met their expiration criteria.
/// </summary>
/// <param name="configObservationsToExpire">The list of configuration observations to expire.</param>
/// <!-- aidoc:v1 sig=2a24be0 -->
Task ExpireExpiredObservations(List<ConfigObservation> configObservationsToExpire);
//Task<PaginationResponse<PatientObservation>> GetPaginatedObservations(PaginationFilter filter);
@@ -250,6 +282,7 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// </summary>
/// <param name="filter">The pagination filter that defines the page size, page number, and sorting criteria applied to the observations.</param>
/// <returns>An <see cref="IFindFluent{TSource, TDocument}"/> for <see cref="PatientObservation"/> that allows further refinement and execution of the paginated query.</returns>
/// <!-- aidoc:v1 sig=e6754ed -->
IFindFluent<PatientObservation, PatientObservation> GetPaginatedObservations(PaginationFilter filter);
/// <summary>
@@ -260,6 +293,7 @@ public interface IObservationRepository : IMongoRepository<PatientObservation>
/// <param name="endAfter">Optional pagination cursor indicating the number of results to skip.</param>
/// <param name="num">Optional maximum number of observations to return.</param>
/// <returns>A task that represents the asynchronous operation, containing a collection of matching <see cref="PatientObservation"/> objects.</returns>
/// <!-- aidoc:v1 sig=ba8e6f1 -->
Task<IEnumerable<PatientObservation>> FindLastNotExpiredObservatonsByPatient(ObjectId patientId, string name,
int? endAfter = null, int? num = null);
}
@@ -10,12 +10,14 @@ public interface IPatientArchiveRepository : IMongoRepository<Patient>
/// </summary>
/// <param name="patientNumber">The unique patient number used to look up the patient.</param>
/// <returns>A <see cref="Patient"/> instance if a match is found; otherwise, <see langword="null"/>.</returns>
/// <!-- aidoc:v1 sig=fc426b5 -->
Task<Patient?> FindByPatientNumber(string patientNumber);
/// <summary>
/// Retrieves all patients from the data source.
/// </summary>
/// <returns>A task that represents the asynchronous operation, containing a list of all <see cref="Patient"/> entities.</returns>
/// <!-- aidoc:v1 sig=350dff6 -->
Task<List<Patient>> FindAll();
/// <summary>
/// Searches for a patient by patient number within a specific distinct unit.
@@ -23,5 +25,6 @@ public interface IPatientArchiveRepository : IMongoRepository<Patient>
/// <param name="patientNumber">The patient number used to locate the patient.</param>
/// <param name="unitId">The identifier of the distinct unit in which to perform the search.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the matching <see cref="Patient"/> if found; otherwise, <c>null</c>.</returns>
/// <!-- aidoc:v1 sig=1d70651 -->
Task<Patient?> SearchByPatientNumberAndDistinctUnit(string patientNumber, ObjectId unitId);
}
@@ -10,17 +10,20 @@ public interface IPatientCarePlanRepository : IMongoRepository<PatientCarePlan>
/// </summary>
/// <param name="patientId">The unique identifier of the patient whose care plans are being requested.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="PatientCarePlan"/> records for the patient, or an empty list if no care plans are found.</returns>
/// <!-- aidoc:v1 sig=6525ef9 -->
Task<List<PatientCarePlan>> FindByPatientId(ObjectId patientId);
/// <summary>
/// Asynchronously retrieves the list of patient care plans associated with the specified user identifier.
/// </summary>
/// <param name="userId">The unique identifier of the user whose patient care plans are being requested.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="PatientCarePlan"/> objects linked to the specified user.</returns>
/// <!-- aidoc:v1 sig=150426f -->
Task<List<PatientCarePlan>> FindByUserId(ObjectId userId);
/// <summary>
/// Asynchronously retrieves all patient care plans from the data store.
/// </summary>
/// <returns>A task representing the asynchronous operation, containing a list of all <see cref="PatientCarePlan"/> records.</returns>
/// <!-- aidoc:v1 sig=83af170 -->
Task<List<PatientCarePlan>> FindAll();
/// <summary>
/// Updates all records that reference the specified old ObjectId so they are associated with the new patient ObjectId.
@@ -28,5 +31,6 @@ public interface IPatientCarePlanRepository : IMongoRepository<PatientCarePlan>
/// <param name="patientid">The string identifier of the patient whose related records will be updated.</param>
/// <param name="patientId">The new ObjectId that will replace the previous identifier in the matching records.</param>
/// <param name="oldId">The previous ObjectId whose references should be replaced across the matching records.</param>
/// <!-- aidoc:v1 sig=7e33b89 -->
Task UpdateManyObjectId(string patientid, ObjectId patientId, ObjectId oldId);
}
@@ -14,36 +14,42 @@ public interface IPatientRepository : IMongoRepository<Patient>
/// Deletes the item identified by the specified identifier.
/// </summary>
/// <param name="id">The identifier of the item to delete.</param>
/// <!-- aidoc:v1 sig=0112d17 -->
Task Delete(ObjectId id);
/// <summary>
/// Asynchronously retrieves a <see cref="Patient"/> associated with the specified location, or <see langword="null"/> if no patient is found at that location.
/// </summary>
/// <param name="location">The location used to look up the patient.</param>
/// <returns>A task that represents the asynchronous operation, containing the <see cref="Patient"/> if found; otherwise, <see langword="null"/>.</returns>
/// <!-- aidoc:v1 sig=f818833 -->
Task<Patient?> FindByLocation(PatientLocation location);
/// <summary>
/// Retrieves a patient by their unique identifier, returning <c>null</c> when no matching patient exists.
/// </summary>
/// <param name="id">The unique <see cref="ObjectId"/> of the patient to look up.</param>
/// <returns>A <see cref="Task{T}"/> that resolves to the matching <see cref="Patient"/>, or <c>null</c> if no patient is found.</returns>
/// <!-- aidoc:v1 sig=bff0af8 -->
Task<Patient?> FindById(ObjectId id);
/// <summary>
/// Asynchronously updates the location of a patient identified by the specified identifier.
/// </summary>
/// <param name="id">The unique identifier of the patient whose location is to be updated.</param>
/// <param name="location">The new patient location data to apply to the existing record.</param>
/// <!-- aidoc:v1 sig=80c429e -->
Task UpdateLocation(ObjectId id, PatientLocation location);
/// <summary>
/// Updates the location of the entity identified by the specified identifier.
/// </summary>
/// <param name="id">The identifier of the entity whose location will be updated.</param>
/// <param name="location">The identifier of the new location to associate with the entity.</param>
/// <!-- aidoc:v1 sig=6663fab -->
Task UpdateLocation(ObjectId id, ObjectId location);
/// <summary>
/// Updates the attending doctor for the record identified by the specified id.
/// </summary>
/// <param name="id">The identifier of the record whose attending doctor will be updated.</param>
/// <param name="attendingDoctor">The person to be set as the new attending doctor.</param>
/// <!-- aidoc:v1 sig=08253ac -->
Task UpdateAttendingDoctor(ObjectId id, Person attendingDoctor);
/// <summary>
/// Updates the patient data identified by the specified id, optionally updating the patient number when <paramref name="updatePatientNumber"/> is true.
@@ -52,11 +58,13 @@ public interface IPatientRepository : IMongoRepository<Patient>
/// <param name="patientNumber">The patient number associated with the patient.</param>
/// <param name="data">The new person data to apply to the patient record.</param>
/// <param name="updatePatientNumber">Indicates whether the patient number should be updated; defaults to true.</param>
/// <!-- aidoc:v1 sig=c9778ad -->
Task UpdatePatientData(ObjectId id, string patientNumber, Person data, bool updatePatientNumber = true);
/// <summary>
/// Updates the information of an existing patient in the system.
/// </summary>
/// <param name="patient">The patient entity containing the updated information to be persisted.</param>
/// <!-- aidoc:v1 sig=0688359 -->
Task Update(Patient patient);
/// <summary>
/// Asynchronously retrieves a <see cref="Patient"/> by their unique patient number.
@@ -64,68 +72,83 @@ public interface IPatientRepository : IMongoRepository<Patient>
/// </summary>
/// <param name="patientNumber">The unique patient number used to look up the patient.</param>
/// <returns>A <see cref="Task{TResult}"/> containing the matching <see cref="Patient"/>, or <c>null</c> if no patient is found.</returns>
/// <!-- aidoc:v1 sig=fc426b5 -->
Task<Patient?> FindByPatientNumber(string patientNumber);
/// <summary>
/// Asynchronously retrieves a <see cref="Patient"/> that matches the specified patient identifier.
/// </summary>
/// <param name="patientId">The unique identifier of the patient to look up.</param>
/// <returns>A task that represents the asynchronous operation, containing the matching <see cref="Patient"/> if found; otherwise, <c>null</c>.</returns>
/// <!-- aidoc:v1 sig=6132bff -->
Task<Patient?> FindByPatientId(string patientId);
/// <summary>
/// Asynchronously retrieves all <see cref="Patient"/> records.
/// </summary>
/// <returns>A task that represents the asynchronous operation, containing a list of all <see cref="Patient"/> entities.</returns>
/// <!-- aidoc:v1 sig=350dff6 -->
Task<List<Patient>> FindAll();
/// <summary>
/// Asynchronously retrieves a list of patients associated with the specified point of care.
/// </summary>
/// <param name="pointOfCare">The point of care identifier used to filter patients.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of patients matching the specified point of care.</returns>
/// <!-- aidoc:v1 sig=c2cb9ce -->
Task<List<Patient>> FindByPointOfCare(string pointOfCare);
/// <summary>
/// Asynchronously retrieves the list of patients associated with the specified point of care.
/// </summary>
/// <param name="pointOfCare">The unique identifier of the point of care used to filter patients.</param>
/// <returns>A task that represents the asynchronous operation, containing the list of patients matching the specified point of care.</returns>
/// <!-- aidoc:v1 sig=a0a7e87 -->
Task<List<Patient>> FindByPointOfCare(ObjectId pointOfCare);
/// <summary>
/// Retrieves a patient by their point-of-care identifier, returning <c>null</c> when no matching patient is found.
/// </summary>
/// <param name="pointOfCare">The unique identifier of the point-of-care location used to look up the patient.</param>
/// <returns>A task that resolves to the matching <see cref="Patient"/>, or <c>null</c> if no patient is associated with the specified point-of-care id.</returns>
/// <!-- aidoc:v1 sig=dd213b7 -->
Task<Patient?> FindByPointOfCareId(ObjectId pointOfCare);
/// <summary>
/// Asynchronously retrieves a list of patients who have been discharged.
/// </summary>
/// <returns>A task representing the asynchronous operation, containing a list of discharged <see cref="Patient"/> records.</returns>
/// <!-- aidoc:v1 sig=16d2227 -->
Task<List<Patient>> FindDischargedPatients();
/// <summary>
/// Updates an existing patient record and returns the updated patient, or <see langword="null"/> if the patient was not found.
/// </summary>
/// <param name="updatedPatient">The patient containing the updated information.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the updated <see cref="Patient"/>, or <see langword="null"/> if no matching patient exists.</returns>
/// <!-- aidoc:v1 sig=1b69c26 -->
Task<Patient?> UpdateOne(Patient updatedPatient);
/// <summary>
/// Asynchronously retrieves a list of patients who have an inactive Point of Care (PoC) assignment.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains a list of <see cref="Patient"/> objects with inactive PoC status.</returns>
/// <!-- aidoc:v1 sig=1eb056c -->
Task<List<Patient>> FindInActivePoC();
/// <summary>
/// Asynchronously retrieves a list of patients who are currently marked as inactive points of contact (PoC).
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains a list of inactive PoC patients.</returns>
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
/// "The method name 'FindInActivePoC' uses PascalCase with a capital 'A' in 'Active', indicating two separate words 'In Active' (i.e., patients currently in an active PoC status), not 'Inactive'. The documentation describes finding 'inactive PoC' patients, which contradicts the method name." -->
/// <!-- aidoc-review:v1 severity=high kind=wrong_returns
/// "The <returns> description says 'a list of inactive PoC patients', but per the method name's PascalCase the result should be a list of patients in an active PoC." -->
Task<List<Patient>> FindInInactivePoC();
/// <summary>
/// Retrieves a list of patients whose records have not been updated since the specified date.
/// </summary>
/// <param name="date">The cutoff date; patients last updated before this date will be included in the result.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains a list of <see cref="Patient"/> objects that have not been updated since the specified date.</returns>
/// <!-- aidoc:v1 sig=25a6510 -->
Task<List<Patient>> FindPatientsNotUpdatedSince(DateTime date);
/// <summary>
/// Asynchronously retrieves a patient from the data store by their unique identifier.
/// </summary>
/// <param name="patientId">The unique identifier of the patient to look up.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the matching <see cref="Patient"/> if one is found; otherwise, <c>null</c>.</returns>
/// <!-- aidoc:v1 sig=571fb89 -->
Task<Patient?> FindByPatientId(ObjectId patientId);
/// <summary>
/// Updates the incoming data for the specified patient and returns the updated patient record.
@@ -133,6 +156,7 @@ public interface IPatientRepository : IMongoRepository<Patient>
/// <param name="patientId">The unique identifier of the patient whose incoming data should be updated.</param>
/// <param name="person">The patient object containing the incoming data to apply.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the updated <see cref="Patient"/>, or <c>null</c> if the patient was not found.</returns>
/// <!-- aidoc:v1 sig=367d157 -->
Task<Patient?> UpdatePatientIncomingData(ObjectId patientId, Patient person);
/// <summary>
/// Updates the demographic data of an existing patient identified by the given identifier.
@@ -140,6 +164,7 @@ public interface IPatientRepository : IMongoRepository<Patient>
/// <param name="patientId">The unique identifier of the patient whose demographic data is to be updated.</param>
/// <param name="person">The patient object containing the updated demographic information.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the updated <see cref="Patient"/>, or <c>null</c> if the patient was not found.</returns>
/// <!-- aidoc:v1 sig=381b38d -->
Task<Patient?> UpdatePatientDemographicData(ObjectId patientId, Patient person);
/// <summary>
/// Asynchronously retrieves the patient matching the specified unit and point of care identifier.
@@ -147,12 +172,14 @@ public interface IPatientRepository : IMongoRepository<Patient>
/// <param name="unit">The identifier of the unit used to locate the patient.</param>
/// <param name="pointOfCare">The point of care identifier used together with the unit to locate the patient.</param>
/// <returns>A task that resolves to the <see cref="Patient"/> associated with the given unit and point of care.</returns>
/// <!-- aidoc:v1 sig=47b83cd -->
Task<Patient> FindByUnitAndPocId(ObjectId unit, ObjectId pointOfCare);
/// <summary>
/// Asynchronously retrieves the total count of records associated with the specified unit identifier.
/// </summary>
/// <param name="unitId">The identifier of the unit whose associated records should be counted.</param>
/// <returns>A task that represents the asynchronous operation, containing the total count of matching records.</returns>
/// <!-- aidoc:v1 sig=e0dfc62 -->
Task<long> CountByUnitId(ObjectId unitId);
/// <summary>
/// Asynchronously searches for a patient by their patient number within a specific unit, ensuring the patient is associated with a distinct unit.
@@ -160,30 +187,35 @@ public interface IPatientRepository : IMongoRepository<Patient>
/// <param name="patientNumber">The unique patient number used to identify the patient.</param>
/// <param name="unitId">The identifier of the unit to constrain the search to a distinct unit context.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the matching <see cref="Patient"/> if found; otherwise, <c>null</c>.</returns>
/// <!-- aidoc:v1 sig=1d70651 -->
Task<Patient?> SearchByPatientNumberAndDistinctUnit(string patientNumber, ObjectId unitId);
/// <summary>
/// Retrieves a paginated, fluent query of patients based on the specified pagination filter.
/// </summary>
/// <param name="filter">The pagination filter that defines page size, page number, and additional criteria applied to the patient query.</param>
/// <returns>An <see cref="IFindFluent{Patient, Patient}"/> representing the paginated patient query that can be further composed before execution.</returns>
/// <!-- aidoc:v1 sig=206a5f3 -->
IFindFluent<Patient, Patient> GetPaginatedPatients(PaginationFilter filter);
/// <summary>
/// Asynchronously retrieves all patients who have completed procedures, filtering by the number of minutes that have elapsed since the procedure end date for archival purposes.
/// </summary>
/// <param name="archiveProcedureEndDateAfterMinutes">The number of minutes after the procedure end date used to determine which finished procedures are eligible for archive retrieval.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains a list of patients with finished procedures matching the archive criteria.</returns>
/// <!-- aidoc:v1 sig=d37257e -->
Task<List<Patient>> FindAllPatientWithFinishedProcedures(int archiveProcedureEndDateAfterMinutes);
/// <summary>
/// Asynchronously retrieves all patients whose tests have finished based on the specified archive end date threshold.
/// </summary>
/// <param name="archiveTestEndDateAfterMinutes">The number of minutes after which a test is considered finished and eligible for retrieval.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of patients with finished tests.</returns>
/// <!-- aidoc:v1 sig=bde5551 -->
Task<List<Patient>> FindAllPatientWithFinishedTests(int archiveTestEndDateAfterMinutes);
/// <summary>
/// Retrieves all patients whose treatment has been finished and is eligible for archival based on the specified end date threshold.
/// </summary>
/// <param name="archiveTreatmentEndDateAfterMinutes">The number of minutes after the treatment end date used as the archival threshold.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of patients with finished treatments that meet the archival criteria.</returns>
/// <!-- aidoc:v1 sig=bef780c -->
Task<List<Patient>> FindAllPatientWithFinishedTreatment(int archiveTreatmentEndDateAfterMinutes);
/// <summary>
/// Updates a master list option for the specified units and returns the patients affected by the change.
@@ -192,6 +224,7 @@ public interface IPatientRepository : IMongoRepository<Patient>
/// <param name="opt">The DTO containing the master list option update details.</param>
/// <param name="typeName">The name of the option type being updated.</param>
/// <returns>A task that resolves to the list of patients impacted by the master list option update.</returns>
/// <!-- aidoc:v1 sig=56aa456 -->
Task<List<Patient>> UpdateMasterListOption(List<ObjectId> unitIds, UpdateOptionMasterListDto opt, string typeName);
/// <summary>
/// Asynchronously retrieves a list of <see cref="Patient"/> objects associated with the specified unit identifiers and patient type.
@@ -199,6 +232,7 @@ public interface IPatientRepository : IMongoRepository<Patient>
/// <param name="unitIds">The list of unit identifiers used to filter the patients to be returned.</param>
/// <param name="typeName">The name of the patient type used to further refine the query results.</param>
/// <returns>A <see cref="Task{TResult}"/> that represents the asynchronous operation, containing a list of <see cref="Patient"/> objects matching the provided unit identifiers and type.</returns>
/// <!-- aidoc:v1 sig=0c3ac7e -->
Task<List<Patient>> GetPatientsByUnitIds(List<ObjectId> unitIds, string typeName);
/// <summary>
/// Deletes the specified master list option and returns the patients affected by its removal.
@@ -207,5 +241,6 @@ public interface IPatientRepository : IMongoRepository<Patient>
/// <param name="opt">The master list option to remove.</param>
/// <param name="typeName">The name of the master list type to which the option belongs.</param>
/// <returns>A task that yields the collection of patients impacted by deleting the master list option.</returns>
/// <!-- aidoc:v1 sig=263b587 -->
Task<IEnumerable<Patient>> DeleteMasterListOption(List<ObjectId> unitIds, OptionList opt, string typeName);
}
@@ -10,10 +10,12 @@ public interface IPoCMappingRepository
/// </summary>
/// <param name="key">The key used to look up the <see cref="PoCMapping"/>.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the <see cref="PoCMapping"/> if found, or <c>null</c> if no mapping exists for the specified key.</returns>
/// <!-- aidoc:v1 sig=84febd1 -->
Task<PoCMapping?> FindByKey(string key);
/// <summary>
/// Retrieves the name of the collection associated with the current context or entity.
/// </summary>
/// <returns>The collection name as a string.</returns>
/// <!-- aidoc:v1 sig=a1be5ef -->
string GetCollectionName();
}
@@ -10,6 +10,7 @@ public interface IPoCSettingsRepository : IMongoRepository<PoCSettings>
/// Asynchronously deletes the entity identified by the specified <see cref="ObjectId"/>.
/// </summary>
/// <param name="id">The <see cref="ObjectId"/> of the entity to delete.</param>
/// <!-- aidoc:v1 sig=0112d17 -->
Task Delete(ObjectId id);
/// <summary>
@@ -17,6 +18,7 @@ public interface IPoCSettingsRepository : IMongoRepository<PoCSettings>
/// </summary>
/// <param name="location">The patient location used to look up the corresponding PoC settings.</param>
/// <returns>A task that returns the matching <see cref="PoCSettings"/> if found; otherwise, <c>null</c>.</returns>
/// <!-- aidoc:v1 sig=5eb997f -->
Task<PoCSettings?> FindByLocation(PatientLocation location);
/// <summary>
@@ -24,6 +26,7 @@ public interface IPoCSettingsRepository : IMongoRepository<PoCSettings>
/// </summary>
/// <param name="id">The unique identifier of the PoC settings to retrieve.</param>
/// <returns>A task that represents the asynchronous operation. The result contains the matching <see cref="PoCSettings"/> if found, or <c>null</c> when no settings exist for the given identifier.</returns>
/// <!-- aidoc:v1 sig=2527bbc -->
Task<PoCSettings?> FindById(ObjectId id);
/// <summary>
@@ -31,11 +34,13 @@ public interface IPoCSettingsRepository : IMongoRepository<PoCSettings>
/// </summary>
/// <param name="pocSettings">The PoC settings to be applied.</param>
/// <returns>A task that represents the asynchronous update operation.</returns>
/// <!-- aidoc:v1 sig=6d3c931 -->
Task Update(PoCSettings pocSettings);
/// <summary>
/// Asynchronously retrieves all <see cref="PoCSettings"/> records.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains a list of all <see cref="PoCSettings"/> entries.</returns>
/// <!-- aidoc:v1 sig=b718f84 -->
Task<List<PoCSettings>> FindAll();
}
@@ -14,12 +14,14 @@ public interface IPointOfCareRepository : IMongoRepository<PointOfCare>
/// Asynchronously deletes the entity identified by the specified <paramref name="id"/>.
/// </summary>
/// <param name="id">The <see cref="ObjectId"/> of the entity to delete.</param>
/// <!-- aidoc:v1 sig=0112d17 -->
Task Delete(ObjectId id);
/// <summary>
/// Asynchronously updates the specified <see cref="PointOfCare"/> entity.
/// </summary>
/// <param name="pointOfCare">The <see cref="PointOfCare"/> instance containing the updated data to be persisted.</param>
/// <!-- aidoc:v1 sig=3647fc3 -->
Task Update(PointOfCare pointOfCare);
/// <summary>
@@ -27,6 +29,7 @@ public interface IPointOfCareRepository : IMongoRepository<PointOfCare>
/// </summary>
/// <param name="id">The identifier of the object whose unit will be updated.</param>
/// <param name="unit">The unit value to apply to the object.</param>
/// <!-- aidoc:v1 sig=d53662b -->
Task UpdateUnitId(ObjectId id, Unit unit);
/// <summary>
@@ -34,6 +37,7 @@ public interface IPointOfCareRepository : IMongoRepository<PointOfCare>
/// </summary>
/// <param name="id">The unique identifier of the point of care configuration to update.</param>
/// <param name="configuration">The new configuration values to apply to the existing point of care record.</param>
/// <!-- aidoc:v1 sig=92922a6 -->
Task UpdateConfiguration(ObjectId id, PointOfCareConfiguration configuration);
/// <summary>
@@ -41,6 +45,7 @@ public interface IPointOfCareRepository : IMongoRepository<PointOfCare>
/// </summary>
/// <param name="id">The unique identifier of the point of care to locate.</param>
/// <returns>A task that yields the matching <see cref="PointOfCare"/>, or <c>null</c> if no record exists for the given identifier.</returns>
/// <!-- aidoc:v1 sig=f01a187 -->
Task<PointOfCare?> FindById(ObjectId id);
/// <summary>
@@ -48,6 +53,7 @@ public interface IPointOfCareRepository : IMongoRepository<PointOfCare>
/// </summary>
/// <param name="unit">The <see cref="ObjectId"/> of the unit whose points of care should be returned.</param>
/// <returns>A task that yields an <see cref="IEnumerable{T}"/> of <see cref="PointOfCare"/> for the matching unit, or <c>null</c> when no results are found.</returns>
/// <!-- aidoc:v1 sig=d969dd8 -->
Task<IEnumerable<PointOfCare>?> FindAllByUnitId(ObjectId unit);
/// <summary>
@@ -55,6 +61,7 @@ public interface IPointOfCareRepository : IMongoRepository<PointOfCare>
/// </summary>
/// <param name="room">The room identifier used to look up the corresponding points of care.</param>
/// <returns>A task that represents the asynchronous operation. The result is a collection of <see cref="PointOfCare"/> matching the specified room, or <see langword="null"/> if no matching points of care are found.</returns>
/// <!-- aidoc:v1 sig=4637691 -->
Task<IEnumerable<PointOfCare>?> FindByRoom(string room);
/// <summary>
@@ -63,6 +70,7 @@ public interface IPointOfCareRepository : IMongoRepository<PointOfCare>
/// <param name="filter">The filter definition used to match <see cref="PointOfCare"/> entities in the data store.</param>
/// <param name="projection">An optional projection definition that limits or shapes the fields returned in each result. If <c>null</c>, the full <see cref="PointOfCare"/> entity is returned.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="PointOfCare"/> entities that satisfy the filter. Returns an empty list when no matching entities are found.</returns>
/// <!-- aidoc:v1 sig=e2b8c68 -->
Task<List<PointOfCare>> FindByFilter(FilterDefinition<PointOfCare> filter,
ProjectionDefinition<PointOfCare>? projection = null);
@@ -71,22 +79,26 @@ public interface IPointOfCareRepository : IMongoRepository<PointOfCare>
/// </summary>
/// <param name="bed">The bed identifier used to look up the associated points of care.</param>
/// <returns>A task that yields an <see cref="IEnumerable{T}"/> of <see cref="PointOfCare"/> when matches exist, or <c>null</c> if none are found.</returns>
/// <!-- aidoc:v1 sig=604796d -->
Task<IEnumerable<PointOfCare>?> FindByBed(string bed);
/// <summary>
/// Asynchronously retrieves all available points of care.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result is a list of <see cref="PointOfCare"/> instances, or <c>null</c> if no points of care are available.</returns>
/// <!-- aidoc:v1 sig=78b96d6 -->
Task<List<PointOfCare>?> GetAll();
/// <summary>
/// Retrieves all Point of Care configurations available in the system.
/// </summary>
/// <returns>A task containing a list of <see cref="PointOfCare"/> configurations, or <c>null</c> if no configurations are found.</returns>
/// <!-- aidoc:v1 sig=2c3ec18 -->
Task<List<PointOfCare>?> GetAllConfigs();
/// <summary>
/// Retrieves all Point of Care location information.
/// </summary>
/// <returns>A task that resolves to a list of <see cref="PointOfCare"/> locations, or <c>null</c> if no location data is available.</returns>
/// <!-- aidoc:v1 sig=591d801 -->
Task<List<PointOfCare>?> GetAllLocationInfo();
/// <summary>
@@ -95,6 +107,7 @@ public interface IPointOfCareRepository : IMongoRepository<PointOfCare>
/// </summary>
/// <param name="pocId">The unique identifier of the Point of Care whose configuration is being requested.</param>
/// <returns>A task that resolves to the matching <see cref="PointOfCare"/> configuration, or null if no configuration is found.</returns>
/// <!-- aidoc:v1 sig=d108b88 -->
Task<PointOfCare?> GetPoCConfiguration(ObjectId pocId);
@@ -104,6 +117,7 @@ public interface IPointOfCareRepository : IMongoRepository<PointOfCare>
/// <param name="bed">The bed identifier used to locate the point of care; may be <see langword="null"/>.</param>
/// <param name="unitId">The identifier of the unit in which the bed is located.</param>
/// <returns>A <see cref="Task{TResult}"/> that yields the matching <see cref="PointOfCare"/>, or <see langword="null"/> if none is found.</returns>
/// <!-- aidoc:v1 sig=bcdaa77 -->
Task<PointOfCare?> FindByBedAndUnitId(string? bed, ObjectId unitId);
/// <summary>
@@ -111,6 +125,7 @@ public interface IPointOfCareRepository : IMongoRepository<PointOfCare>
/// </summary>
/// <param name="patientLocation">The patient location used to look up the corresponding point of care.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the matching <see cref="PointOfCare"/>, or <c>null</c> if no point of care is found for the given patient location.</returns>
/// <!-- aidoc:v1 sig=9158434 -->
Task<PointOfCare?> FindByPatientLocation(PatientLocation patientLocation);
/// <summary>
@@ -121,6 +136,7 @@ public interface IPointOfCareRepository : IMongoRepository<PointOfCare>
/// <param name="status">The point-of-care status used to filter the results.</param>
/// <param name="excludeVirtual">When set to <c>true</c>, virtual points of care are excluded from the returned collection.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains an <see cref="IEnumerable{PointOfCare}"/> of points of care matching the specified unit and status.</returns>
/// <!-- aidoc:v1 sig=cdc58d5 -->
Task<IEnumerable<PointOfCare>> FindByUnitAndStatus(ObjectId unitId, StatusEnum.PointOfCare status,
bool excludeVirtual = false);
@@ -129,12 +145,14 @@ public interface IPointOfCareRepository : IMongoRepository<PointOfCare>
/// </summary>
/// <param name="pocId">The unique identifier of the point of contact whose relay configuration is being updated.</param>
/// <param name="relayConfig">The collection of relay entries to apply to the configuration.</param>
/// <!-- aidoc:v1 sig=c7679db -->
Task UpdateRelayConfig(ObjectId pocId, List<Relay> relayConfig);
/// <summary>
/// Updates the relay configuration for the specified point of configuration (POC) using the provided list of relay configuration identifiers.
/// </summary>
/// <param name="pocId">The unique identifier of the point of configuration whose relay configuration will be updated.</param>
/// <param name="relayConfig">The list of relay configuration identifiers to apply to the specified POC.</param>
/// <!-- aidoc:v1 sig=ed2237d -->
Task UpdateRelayConfig(ObjectId pocId, List<ObjectId> relayConfig);
/// <summary>
@@ -142,24 +160,28 @@ public interface IPointOfCareRepository : IMongoRepository<PointOfCare>
/// </summary>
/// <param name="filter">The pagination filter that defines paging parameters such as page number and page size.</param>
/// <returns>An <see cref="IFindFluent{PointOfCare, PointOfCare}"/> representing the paginated query against the PoCs collection.</returns>
/// <!-- aidoc:v1 sig=0fe74b2 -->
IFindFluent<PointOfCare, PointOfCare> GetPaginatedPoCs(PaginationFilter filter);
/// <summary>
/// Asynchronously counts the number of entities associated with the specified unit identifier.
/// </summary>
/// <param name="unitId">The identifier of the unit used to filter the entities to be counted.</param>
/// <returns>A <see cref="Task{TResult}"/> that represents the asynchronous operation, containing the total count of matching entities.</returns>
/// <!-- aidoc:v1 sig=e0dfc62 -->
Task<long> CountByUnitId(ObjectId unitId);
/// <summary>
/// Asynchronously counts the number of virtuals associated with the specified unit.
/// </summary>
/// <param name="unitId">The identifier of the unit whose virtuals will be counted.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the count of virtuals for the given unit.</returns>
/// <!-- aidoc:v1 sig=abeaf32 -->
Task<long> CountVirtualsByUnitId(ObjectId unitId);
/// <summary>
/// Deletes multiple records associated with the specified unit identifier asynchronously.
/// </summary>
/// <param name="unitId">The unique identifier of the unit whose related records should be deleted.</param>
/// <returns>A task that represents the asynchronous operation, containing a boolean value indicating whether the deletion was successful.</returns>
/// <!-- aidoc:v1 sig=903a910 -->
Task<bool> DeleteManyByUnitId(ObjectId unitId);
/// <summary>
/// Retrieves a <see cref="PointOfCare"/> entity by its identifier, including all associated configuration data.
@@ -167,26 +189,31 @@ public interface IPointOfCareRepository : IMongoRepository<PointOfCare>
/// </summary>
/// <param name="id">The unique identifier of the point of care to retrieve.</param>
/// <returns>A task that resolves to the matching <see cref="PointOfCare"/> with all configuration, or <see langword="null"/> if not found.</returns>
/// <!-- aidoc:v1 sig=810206b -->
Task<PointOfCare?> FindByIdAllConfig(ObjectId id);
/// <summary>
/// Asynchronously retrieves the set of camera identifiers that are currently in use.
/// </summary>
/// <returns>A task that represents the asynchronous operation, containing a hash set of <see cref="ObjectId"/> values for all cameras in use.</returns>
/// <!-- aidoc:v1 sig=5635e4a -->
Task<HashSet<ObjectId>> FindAllIdCamerasInUse();
/// <summary>
/// Asynchronously retrieves all ID relays that are currently in use, returning them as a hash set for efficient lookup.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains a hash set of the <see cref="ObjectId"/> values of all ID relays currently in use.</returns>
/// <!-- aidoc:v1 sig=a6e513b -->
Task<HashSet<ObjectId>> FindAllIdRelaysInUse();
/// <summary>
/// Asynchronously retrieves the set of all ID beacons that are currently in use.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains a <see cref="HashSet{ObjectId}"/> with the identifiers of all ID beacons currently in use.</returns>
/// <!-- aidoc:v1 sig=3084f59 -->
Task<HashSet<ObjectId>> FindAllIdBeaconsInUse();
/// <summary>
/// Retrieves all points of care associated with the specified unit identifier, including their related devices.
/// </summary>
/// <param name="unitId">The unique identifier of the unit whose points of care and associated devices are to be retrieved.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains an enumerable collection of points of care with their associated devices, or <c>null</c> if no points of care are found for the specified unit.</returns>
/// <!-- aidoc:v1 sig=dbf2769 -->
Task<IEnumerable<PointOfCare>?> FindAllByUnitIdWithDevices(ObjectId unitId);
}
@@ -9,6 +9,7 @@ public interface IPumpAlarmEventRepository
/// Asynchronously inserts a pump alarm event into the underlying data store.
/// </summary>
/// <param name="alarmEvent">The pump alarm event to be persisted.</param>
/// <!-- aidoc:v1 sig=28b5d03 -->
Task InsertAsync(PumpAlarmEvent alarmEvent);
/// <summary>
@@ -19,6 +20,7 @@ public interface IPumpAlarmEventRepository
/// <param name="to">Optional end of the date range used to filter the events.</param>
/// <param name="limit">Optional maximum number of alarm events to return.</param>
/// <returns>A task that represents the asynchronous operation, containing the collection of pump alarm events matching the criteria.</returns>
/// <!-- aidoc:v1 sig=517b04b -->
Task<IEnumerable<PumpAlarmEvent>> FindByDeviceIdAsync(
string deviceId,
DateTime? from = null,
@@ -31,6 +33,7 @@ public interface IPumpAlarmEventRepository
/// </summary>
/// <param name="deviceId">The unique identifier of the device whose last pump alarm event is to be retrieved.</param>
/// <returns>A task that represents the asynchronous operation, containing the most recent <see cref="PumpAlarmEvent"/> for the device, or null if none exists.</returns>
/// <!-- aidoc:v1 sig=7150407 -->
Task<PumpAlarmEvent?> FindLastByDeviceIdAsync(string deviceId);
// cleanup
@@ -38,6 +41,7 @@ public interface IPumpAlarmEventRepository
/// Deletes records associated with the specified patient identifier.
/// </summary>
/// <param name="patientId">The unique identifier of the patient whose records should be deleted.</param>
/// <!-- aidoc:v1 sig=1e79565 -->
Task DeleteByPatientId(ObjectId patientId);
/// <summary>
@@ -47,5 +51,6 @@ public interface IPumpAlarmEventRepository
/// <param name="newId">The new ObjectId value to assign to the matching records.</param>
/// <param name="oldId">The existing ObjectId value used to identify the records to be updated.</param>
/// <returns>A task that represents the asynchronous operation, containing the number of records that were updated.</returns>
/// <!-- aidoc:v1 sig=2ba081a -->
Task<long> UpdateManyObjectIdByFiledNameAsync(string fieldName, ObjectId newId, ObjectId oldId);
}
@@ -14,6 +14,7 @@ public interface IPumpAlarmStateRepository
/// <param name="alarmType">The optional alarm type to filter the search by; if <c>null</c>, no alarm type filter is applied.</param>
/// <param name="alarmCodeMdc">The optional MDC alarm code to further filter the search; if <c>null</c>, no alarm code filter is applied.</param>
/// <returns>A <see cref="Task{TResult}"/> containing the active <see cref="PumpAlarmState"/>, or <c>null</c> if no matching active alarm state exists.</returns>
/// <!-- aidoc:v1 sig=d7b60d9 -->
Task<PumpAlarmState?> FindActiveAsync(
string deviceId,
PumpEnum.AlarmType? alarmType,
@@ -24,12 +25,14 @@ public interface IPumpAlarmStateRepository
/// </summary>
/// <param name="deviceId">The unique identifier of the device whose active pump alarm states are being queried.</param>
/// <returns>A task representing the asynchronous operation, containing a collection of active <see cref="PumpAlarmState"/> entries for the given device.</returns>
/// <!-- aidoc:v1 sig=1cb4d36 -->
Task<IEnumerable<PumpAlarmState>> FindAllActiveByDeviceAsync(string deviceId);
/// <summary>
/// Inserts a new active pump alarm state or updates the existing one, maintaining the current state for the alarm.
/// </summary>
/// <param name="state">The pump alarm state to upsert as the active record.</param>
/// <!-- aidoc:v1 sig=3d8bd8b -->
Task UpsertActiveAsync(PumpAlarmState state);
/// <summary>
@@ -38,6 +41,7 @@ public interface IPumpAlarmStateRepository
/// <param name="deviceId">The identifier of the device whose alarms should be removed.</param>
/// <param name="alarmType">The optional alarm type to filter the removal; when null, all alarm types are considered.</param>
/// <param name="alarmCodeMdc">The optional alarm code (MDC) to further filter the removal; when null, no code filter is applied.</param>
/// <!-- aidoc:v1 sig=1a5b895 -->
Task RemoveAsync(
string deviceId,
PumpEnum.AlarmType? alarmType,
@@ -48,6 +52,7 @@ public interface IPumpAlarmStateRepository
/// Deletes records associated with the specified patient identifier.
/// </summary>
/// <param name="patientId">The unique identifier of the patient whose related records should be removed.</param>
/// <!-- aidoc:v1 sig=1e79565 -->
Task DeleteByPatientId(ObjectId patientId);
/// <summary>
@@ -57,5 +62,6 @@ public interface IPumpAlarmStateRepository
/// <param name="newId">The new <see cref="ObjectId"/> value to assign.</param>
/// <param name="oldId">The existing <see cref="ObjectId"/> value to be replaced.</param>
/// <returns>A <see cref="Task{T}"/> that represents the asynchronous operation. The task result contains the number of documents updated.</returns>
/// <!-- aidoc:v1 sig=dd74902 -->
Task<long> UpdateManyObjectIdByFieldNameAsync(string fieldName, ObjectId newId, ObjectId oldId);
}
@@ -14,16 +14,20 @@ namespace adas_core.Application.Repositories.Interfaces
/// <summary>
/// Inserta una observación de bomba en la colección de archivo.
/// </summary>
/// <!-- aidoc-review:v1 severity=medium kind=missing_param
/// "The <param> for 'obs' (PumpObservation) is not documented." -->
Task InsertAsync(PumpObservation obs);
/// <summary>
/// Inserta múltiples observaciones en la colección de archivo.
/// </summary>
/// <!-- aidoc:v1 sig=0c99da2 -->
Task InsertManyAsync(IEnumerable<PumpObservation> observations);
/// <summary>
/// Búsqueda por paciente para auditoría o restauración.
/// </summary>
/// <!-- aidoc:v1 sig=5956bf6 -->
Task<IEnumerable<PumpObservation>> FindByPatientIdAsync(ObjectId patientId,
DateTime? from = null, DateTime? to = null, int? limit = null);
}
@@ -9,11 +9,13 @@ public interface IPumpObservationRepository
/// Asynchronously inserts a pump observation into the underlying data store.
/// </summary>
/// <param name="obs">The pump observation entity to persist.</param>
/// <!-- aidoc:v1 sig=7782312 -->
Task InsertAsync(PumpObservation obs);
/// <summary>
/// Asynchronously inserts a collection of pump observations into the underlying data store.
/// </summary>
/// <param name="observations">The collection of <see cref="PumpObservation"/> records to be persisted.</param>
/// <!-- aidoc:v1 sig=0c99da2 -->
Task InsertManyAsync(IEnumerable<PumpObservation> observations);
/// <summary>
@@ -24,6 +26,7 @@ public interface IPumpObservationRepository
/// <param name="to">Optional inclusive upper bound for the observation timestamp; when null, no upper bound is applied.</param>
/// <param name="limit">Optional maximum number of observations to return; when null, all matching observations are returned.</param>
/// <returns>A task that represents the asynchronous operation, yielding an enumerable collection of <see cref="PumpObservation"/> instances matching the criteria.</returns>
/// <!-- aidoc:v1 sig=3f079d3 -->
Task<IEnumerable<PumpObservation>> FindByDeviceIdAsync(
string deviceId,
DateTime? from = null,
@@ -35,11 +38,13 @@ public interface IPumpObservationRepository
/// </summary>
/// <param name="deviceId">The unique identifier of the device whose last observation is being queried.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the last <see cref="PumpObservation"/> for the device, or <c>null</c> if no observation exists for the given device.</returns>
/// <!-- aidoc:v1 sig=2ce7df1 -->
Task<PumpObservation?> FindLastByDeviceIdAsync(string deviceId);
/// <summary>
/// Asynchronously retrieves the most recent observation time for all patients, returning a mapping of patient identifiers to their last observation timestamps.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains a dictionary where each key is a patient <see cref="ObjectId"/> and the associated value is the <see cref="DateTime"/> of that patient's last observation.</returns>
/// <!-- aidoc:v1 sig=57fe6bb -->
Task<Dictionary<ObjectId, DateTime>> FindAllLastPatientObservationTimeAsync();
/// <summary>
@@ -47,6 +52,7 @@ public interface IPumpObservationRepository
/// </summary>
/// <param name="patientId">The identifier of the patient whose pump observations are being queried. May be <see langword="null"/>.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the collection of <see cref="PumpObservation"/> items found for the patient, or an empty collection if no observations are found.</returns>
/// <!-- aidoc:v1 sig=882efc8 -->
Task<IEnumerable<PumpObservation>> FindByPatientId(ObjectId? patientId);
/// <summary>
@@ -55,11 +61,13 @@ public interface IPumpObservationRepository
/// <param name="patientId">The unique identifier of the patient whose observations are being queried.</param>
/// <param name="num">The maximum number of observations to return. Defaults to 100.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of the patient's most recent <see cref="PumpObservation"/> entries.</returns>
/// <!-- aidoc:v1 sig=c2169af -->
Task<List<PumpObservation>> AggregatedPatientLastObservations(ObjectId patientId, int num = 100);
/// <summary>
/// Deletes all records associated with the specified patient identifier. If the patient identifier is null, no deletion is performed.
/// </summary>
/// <param name="patientId">The optional patient identifier whose related records should be removed.</param>
/// <!-- aidoc:v1 sig=c3af748 -->
Task DeleteByPatientId(ObjectId? patientId);
/// <summary>
/// Asynchronously deletes records older than the specified number of days, optionally filtered by name, and returns the number of items removed.
@@ -67,12 +75,14 @@ public interface IPumpObservationRepository
/// <param name="days">The age threshold in days; only records older than this value will be deleted.</param>
/// <param name="name">An optional name used to filter which records are targeted for deletion. If null, deletion applies to all records regardless of name.</param>
/// <returns>A <see cref="Task{TResult}"/> that represents the asynchronous operation, containing the total count of deleted records.</returns>
/// <!-- aidoc:v1 sig=83b8dc2 -->
Task<long> DeleteOlderThanDaysAsync(int days, string? name = null);
/// <summary>
/// Asynchronously deletes items, retaining only the most recent <paramref name="maxCount"/> entries, and returns the number of items that were removed.
/// </summary>
/// <param name="maxCount">The maximum number of most recent items to keep after the deletion.</param>
/// <returns>A task representing the asynchronous operation, containing the count of items that were deleted.</returns>
/// <!-- aidoc:v1 sig=2548ed6 -->
Task<long> DeleteKeepLastNAsync(int maxCount);
/// <summary>
@@ -82,5 +92,6 @@ public interface IPumpObservationRepository
/// <param name="newId">The new ObjectId value to assign to the field.</param>
/// <param name="oldId">The optional current ObjectId value used as a filter; when <see langword="null"/>, the update is applied without filtering by the previous value.</param>
/// <returns>A <see cref="Task{T}"/> that represents the asynchronous operation, containing the number of records updated.</returns>
/// <!-- aidoc:v1 sig=88b76ee -->
Task<long> UpdateManyObjectIdByFieldAsync(string fieldName, ObjectId newId, ObjectId? oldId);
}
@@ -10,17 +10,20 @@ public interface IPumpStateRepository
/// </summary>
/// <param name="deviceId">The unique identifier of the device whose pump state is being looked up.</param>
/// <returns>A task that resolves to the PumpState if a match is found, or null if no pump state exists for the specified device.</returns>
/// <!-- aidoc:v1 sig=ad2e179 -->
Task<PumpState?> FindByDeviceIdAsync(string deviceId);
/// <summary>
/// Asynchronously creates or updates a pump state record in the data store.
/// </summary>
/// <param name="state">The pump state to be inserted if it does not exist, or updated if it already exists.</param>
/// <!-- aidoc:v1 sig=04c1a72 -->
Task UpsertAsync(PumpState state);
/// <summary>
/// Asynchronously retrieves all available pump states.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains a collection of all <see cref="PumpState"/> objects.</returns>
/// <!-- aidoc:v1 sig=46297e3 -->
Task<IEnumerable<PumpState>> GetAllAsync();
}
@@ -8,16 +8,19 @@ public interface IRecordingAlertArchiveRepository : IMongoRepository<PatientReco
/// Inserts a new patient recording alert into the underlying data store asynchronously.
/// </summary>
/// <param name="recordingAlert">The patient recording alert to be inserted.</param>
/// <!-- aidoc:v1 sig=f1cd52e -->
new Task InsertOneAsync(PatientRecordingAlert recordingAlert);
/// <summary>
/// Asynchronously deletes records that have a date earlier than the specified threshold.
/// </summary>
/// <param name="date">The cutoff date; records with a date value before this will be removed.</param>
/// <!-- aidoc:v1 sig=350661d -->
Task DeleteBeforeDate(DateTime date);
/// <summary>
/// Inserts a batch of <see cref="PatientRecordingAlert"/> entities into the data store in a single operation.
/// </summary>
/// <param name="recordingAlerts">The collection of patient recording alerts to insert.</param>
/// <returns>A task that represents the asynchronous batch insert operation, containing the number of affected or inserted records.</returns>
/// <!-- aidoc:v1 sig=9f1ecad -->
Task<long> InsertBatch(IEnumerable<PatientRecordingAlert> recordingAlerts);
}
@@ -12,6 +12,7 @@ public interface IRecordingAlertRepository : IMongoRepository<PatientRecordingAl
/// <param name="patientId">The unique identifier of the patient whose recent alerts are being retrieved.</param>
/// <param name="num">The maximum number of recent observations to return.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="PatientRecordingAlert"/> entries for the patient's last observations.</returns>
/// <!-- aidoc:v1 sig=8f82904 -->
Task<List<PatientRecordingAlert>> AggregatedPatientLastObservations(ObjectId patientId, int num);
/// <summary>
@@ -21,17 +22,20 @@ public interface IRecordingAlertRepository : IMongoRepository<PatientRecordingAl
/// <param name="name">The name of the observation to filter by.</param>
/// <param name="num">The maximum number of recent observations to return. Defaults to 2.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains a list of <see cref="PatientRecordingAlert"/> entries representing the matching observations.</returns>
/// <!-- aidoc:v1 sig=4c1f7cc -->
Task<List<PatientRecordingAlert>> FindLastObservations(ObjectId patientId, string name, int num = 2);
/// <summary>
/// Asynchronously inserts a single <see cref="PatientRecordingAlert"/> into the underlying data store.
/// </summary>
/// <param name="patientRecordingAlert">The patient recording alert to be inserted.</param>
/// <!-- aidoc:v1 sig=95f54d7 -->
new Task InsertOneAsync(PatientRecordingAlert patientRecordingAlert);
/// <summary>
/// Asynchronously deletes records older than the specified number of days, identified by the given name.
/// </summary>
/// <param name="name">The identifier or key used to locate the records to be evaluated for deletion.</param>
/// <param name="value">The age threshold, in days, used to determine which records are considered older and eligible for deletion.</param>
/// <!-- aidoc:v1 sig=65b0e84 -->
Task DeleteOlderDaysAsync(string name, int value);
/// <summary>
/// Asynchronously deletes a number record matching the specified name and value.
@@ -39,11 +43,14 @@ public interface IRecordingAlertRepository : IMongoRepository<PatientRecordingAl
/// <param name="name">The name associated with the number to delete.</param>
/// <param name="value">The numeric value of the record to delete.</param>
/// <returns>A task that represents the asynchronous delete operation.</returns>
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
/// "Method name 'DeleteOlderNumberAsync' implies deleting a number that is older than the specified value, but the summary describes a simple equality match on name and value, omitting the 'older' comparison semantics." -->
Task DeleteOlderNumberAsync(string name, int value);
/// <summary>
/// Asynchronously deletes records associated with the specified patient identifier.
/// </summary>
/// <param name="patientId">The unique <see cref="ObjectId"/> of the patient whose related records should be removed.</param>
/// <!-- aidoc:v1 sig=1e79565 -->
Task DeleteByPatientId(ObjectId patientId);
/// <summary>
/// Updates many records by replacing the specified <paramref name="oldId"/> with the new <paramref name="id"/> within the collection identified by <paramref name="nameId"/>.
@@ -51,11 +58,13 @@ public interface IRecordingAlertRepository : IMongoRepository<PatientRecordingAl
/// <param name="nameId">The name or identifier of the collection in which the update is performed.</param>
/// <param name="id">The new ObjectId to assign to the matching records.</param>
/// <param name="oldId">The existing ObjectId used to locate the records to be updated.</param>
/// <!-- aidoc:v1 sig=24ef97c -->
Task UpdateManyObjectId(string nameId, ObjectId id, ObjectId oldId);
/// <summary>
/// Asynchronously retrieves all patient recording alerts associated with the specified patient identifier.
/// </summary>
/// <param name="patientId">The unique identifier of the patient whose recording alerts are being queried.</param>
/// <returns>A task that represents the asynchronous operation, containing an asynchronous cursor over the matching <see cref="PatientRecordingAlert"/> documents.</returns>
/// <!-- aidoc:v1 sig=7bf4b99 -->
Task<IAsyncCursor<PatientRecordingAlert>> FindByPatientIdAsync(ObjectId patientId);
}
@@ -13,6 +13,7 @@ public interface IRelayRepository : IMongoRepository<Relay>
/// </summary>
/// <param name="relayId">The unique identifier of the relay to retrieve.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the <see cref="Relay"/> if found; otherwise, <c>null</c>.</returns>
/// <!-- aidoc:v1 sig=ffa341f -->
Task<Relay?> GetById(ObjectId relayId);
/// <summary>
/// Retrieves the relays of the specified type from the provided configuration relay list.
@@ -20,24 +21,28 @@ public interface IRelayRepository : IMongoRepository<Relay>
/// <param name="configurationRelayList">The list of relay object identifiers to search through.</param>
/// <param name="type">The relay type used to filter the configuration relay list.</param>
/// <returns>A list of relays matching the specified type; an empty list if no relays of that type are found.</returns>
/// <!-- aidoc:v1 sig=f35333c -->
List<Relay> GetRelayByTypeInList(List<ObjectId> configurationRelayList, RelayEnum.Type type);
/// <summary>
/// Retrieves the <see cref="Relay"/> objects that correspond to the supplied configuration relay identifiers.
/// </summary>
/// <param name="configurationRelayList">The list of <see cref="ObjectId"/> values identifying the configuration relays to look up.</param>
/// <returns>A <see cref="List{Relay}"/> containing the relays that match the provided configuration relay identifiers.</returns>
/// <!-- aidoc:v1 sig=8fbadfa -->
List<Relay> GetRelayInList(List<ObjectId> configurationRelayList);
/// <summary>
/// Retrieves a paginated, filterable query of relays based on the specified pagination filter.
/// </summary>
/// <param name="filter">The pagination filter used to control paging and additional query criteria for the relay lookup.</param>
/// <returns>An <see cref="IFindFluent{Relay, Relay}"/> representing the paginated query that can be further refined and executed.</returns>
/// <!-- aidoc:v1 sig=af5ebe2 -->
IFindFluent<Relay, Relay> GetPaginatedRelays(PaginationFilter filter);
/// <summary>
/// Asynchronously inserts a single <see cref="Relay"/> record and returns the inserted entity, or <see langword="null"/> if the insertion did not produce a result.
/// </summary>
/// <param name="request">The <see cref="Relay"/> entity to be inserted.</param>
/// <returns>A task that represents the asynchronous insert operation. The result is the inserted <see cref="Relay"/>, or <see langword="null"/> when no relay is returned.</returns>
/// <!-- aidoc:v1 sig=4bd4f3e -->
Task<Relay?> InsertOneRelayAsync(Relay request);
/// <summary>
/// Updates an existing relay identified by the specified object identifier.
@@ -45,11 +50,13 @@ public interface IRelayRepository : IMongoRepository<Relay>
/// <param name="objectId">The unique identifier of the relay to update.</param>
/// <param name="relay">The relay object containing the updated information.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the updated relay, or <see langword="null"/> if no relay with the specified identifier was found.</returns>
/// <!-- aidoc:v1 sig=6c6a3e9 -->
Task<Relay?> UpdateRelayAsync(ObjectId objectId, Relay relay);
/// <summary>
/// Retrieves a relay by its name asynchronously, returning null if no matching relay is found.
/// </summary>
/// <param name="requestRelayName">The name of the relay to look up. May be null.</param>
/// <returns>A task that represents the asynchronous lookup. The task result contains the matching relay, or null if no relay with the specified name exists.</returns>
/// <!-- aidoc:v1 sig=78bca23 -->
Task<Relay?> GetByName(string? requestRelayName);
}
@@ -10,12 +10,14 @@ public interface ISectionRepository : IMongoRepository<Section>
/// </summary>
/// <param name="location">The patient location used to filter the sections.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the list of sections matching the specified patient location.</returns>
/// <!-- aidoc:v1 sig=695f16c -->
Task<List<Section>> FindByLocation(PatientLocation location);
/// <summary>
/// Asynchronously retrieves a <see cref="Section"/> by its identifier, returning <c>null</c> when no matching section is found.
/// </summary>
/// <param name="id">The identifier of the section to look up.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the matching <see cref="Section"/>, or <c>null</c> if no section with the specified identifier exists.</returns>
/// <!-- aidoc:v1 sig=762067a -->
Task<Section?> FindById(object id);
/// <summary>
/// Asynchronously retrieves the <see cref="Section"/> that matches the specified identifier.
@@ -23,23 +25,27 @@ public interface ISectionRepository : IMongoRepository<Section>
/// </summary>
/// <param name="id">The unique identifier of the section to look up.</param>
/// <returns>A <see cref="Task{Section}"/> that resolves to the matching <see cref="Section"/>, or <c>null</c> if no section is found.</returns>
/// <!-- aidoc:v1 sig=5b41cb2 -->
Task<Section?> FindById(string id);
/// <summary>
/// Asynchronously retrieves a <see cref="Section"/> that matches the specified section identifier.
/// </summary>
/// <param name="section">The section name or identifier used to look up the matching <see cref="Section"/>.</param>
/// <returns>A <see cref="Task{TResult}"/> that yields the matching <see cref="Section"/>, or <c>null</c> if no section is found.</returns>
/// <!-- aidoc:v1 sig=a21b7e6 -->
Task<Section?> FindBySection(string section);
/// <summary>
/// Asynchronously retrieves the <see cref="Section"/> associated with the specified point of care.
/// </summary>
/// <param name="pointOfCare">The point of care identifier used to look up the section.</param>
/// <returns>A task that returns the matching <see cref="Section"/>, or <c>null</c> if no section is found for the given point of care.</returns>
/// <!-- aidoc:v1 sig=ddef70d -->
Task<Section?> FindByPointOfCare(string pointOfCare);
/// <summary>
/// Asynchronously retrieves all sections.
/// </summary>
/// <returns>A task that represents the asynchronous operation. The task result contains a list of all <see cref="Section"/> items.</returns>
/// <!-- aidoc:v1 sig=9d69dd9 -->
Task<List<Section>> GetAll();
/// <summary>
@@ -47,6 +53,7 @@ public interface ISectionRepository : IMongoRepository<Section>
/// </summary>
/// <param name="section">The section entity containing the updated information.</param>
/// <returns>A task that represents the asynchronous update operation, containing the updated section, or null if the section was not found.</returns>
/// <!-- aidoc:v1 sig=02e0747 -->
Task<Section?> UpdateSection(Section section);
//Task<Section?> UpdateSectionItems(Section section);
//Task<Section?> UpdateSectionConfig(Section section);
@@ -57,5 +64,6 @@ public interface ISectionRepository : IMongoRepository<Section>
/// </summary>
/// <param name="section">The <see cref="Section"/> instance to be inserted.</param>
/// <returns>A <see cref="Task{TResult}"/> that resolves to the inserted <see cref="Section"/>, or <see langword="null"/> if no section was inserted.</returns>
/// <!-- aidoc:v1 sig=cb4b0b2 -->
Task<Section?> InsertOneSection(Section section);
}
@@ -11,11 +11,13 @@ public interface IServiceConfigRepository : IMongoRepository<ServiceConfig>
/// </summary>
/// <param name="oid">The unique identifier of the service configuration to look up.</param>
/// <returns>A <see cref="ServiceConfig"/> matching the provided identifier, or <c>null</c> if no configuration exists for that id.</returns>
/// <!-- aidoc:v1 sig=233d53e -->
Task<ServiceConfig?> FindById(ObjectId oid);
/// <summary>
/// Retrieves a <see cref="ServiceConfig"/> by its identifier, returning <see langword="null"/> when no matching configuration is found.
/// </summary>
/// <param name="id">The unique identifier of the service configuration to look up.</param>
/// <returns>A task that resolves to the matching <see cref="ServiceConfig"/>, or <see langword="null"/> if no configuration exists for the given id.</returns>
/// <!-- aidoc:v1 sig=9457927 -->
Task<ServiceConfig?> FindById(string id);
}
@@ -9,17 +9,20 @@ public interface ITreatmentArchiveRepository
/// Asynchronously inserts a new patient treatment record into the underlying data store.
/// </summary>
/// <param name="patientTreatment">The patient treatment entity to insert.</param>
/// <!-- aidoc:v1 sig=95ea25e -->
Task InsertOneAsync(PatientTreatment patientTreatment);
/// <summary>
/// Asynchronously deletes items whose associated date is earlier than the specified cutoff date.
/// </summary>
/// <param name="date">The cutoff date; items dated before this value are removed.</param>
/// <!-- aidoc:v1 sig=350661d -->
Task DeleteBeforeDate(DateTime date);
/// <summary>
/// Asynchronously inserts a batch of <see cref="PatientTreatment"/> records.
/// </summary>
/// <param name="treatments">The collection of patient treatment entities to be inserted.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains a <see cref="long"/> value associated with the batch insertion.</returns>
/// <!-- aidoc:v1 sig=457cfa9 -->
Task<long> InsertBatch(IEnumerable<PatientTreatment> treatments);
/// <summary>
@@ -27,5 +30,6 @@ public interface ITreatmentArchiveRepository
/// </summary>
/// <param name="patientId">The unique identifier of the patient whose treatments are being queried.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="PatientTreatment"/> records for the given patient.</returns>
/// <!-- aidoc:v1 sig=1ec184e -->
Task<List<PatientTreatment>> FindAllFromPatient(ObjectId patientId);
}
@@ -12,6 +12,7 @@ public interface ITreatmentRepository : IMongoRepository<PatientTreatment>
/// </summary>
/// <param name="patientId">The unique identifier of the patient whose treatments are being queried.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains an <see cref="IEnumerable{PatientTreatment}"/> of treatments for the patient; the collection is empty if no treatments are found.</returns>
/// <!-- aidoc:v1 sig=905ff5f -->
Task<IEnumerable<PatientTreatment>> GetByPatientId(ObjectId patientId);
/// <summary>
/// Asynchronously retrieves a patient treatment record from the data store that matches the specified identifier.
@@ -19,35 +20,41 @@ public interface ITreatmentRepository : IMongoRepository<PatientTreatment>
/// </summary>
/// <param name="id">The unique <see cref="ObjectId"/> of the patient treatment record to retrieve.</param>
/// <returns>A <see cref="Task{IAsyncCursor{PatientTreatment}}"/> that yields a cursor containing the matching patient treatment, if any.</returns>
/// <!-- aidoc:v1 sig=8d884be -->
Task<IAsyncCursor<PatientTreatment>> GetById(ObjectId id);
/// <summary>
/// Asynchronously inserts a new <see cref="PatientTreatment"/> record into the data store.
/// </summary>
/// <param name="treatment">The patient treatment entity to be persisted.</param>
/// <returns>A <see cref="Task"/> that represents the asynchronous insert operation.</returns>
/// <!-- aidoc:v1 sig=289f9f5 -->
new Task InsertOneAsync(PatientTreatment treatment);
/// <summary>
/// Asynchronously deletes the entity identified by the specified identifier.
/// </summary>
/// <param name="id">The unique identifier of the entity to delete.</param>
/// <!-- aidoc:v1 sig=9f8dfa3 -->
new Task DeleteAsync(ObjectId id);
/// <summary>
/// Updates an existing <see cref="PatientTreatment"/> record in the data store asynchronously.
/// </summary>
/// <param name="treatment">The <see cref="PatientTreatment"/> entity containing the updated information.</param>
/// <returns>A <see cref="Task{TResult}"/> that represents the asynchronous update operation. The task result contains <c>true</c> if the update was successful; otherwise, <c>false</c>.</returns>
/// <!-- aidoc:v1 sig=e966e11 -->
Task<bool> Update(PatientTreatment treatment);
/// <summary>
/// Asynchronously retrieves the collection of <see cref="PatientTreatment"/> records associated with the specified patient identifier, returning the results as a cursor for streaming access.
/// </summary>
/// <param name="patientId">The unique identifier of the patient whose treatments are being queried.</param>
/// <returns>A task that yields an <see cref="IAsyncCursor{TDocument}"/> of <see cref="PatientTreatment"/> records matching the given patient identifier.</returns>
/// <!-- aidoc:v1 sig=1be8597 -->
Task<IAsyncCursor<PatientTreatment>> FindByPatientIdAsync(ObjectId patientId);
/// <summary>
/// Asynchronously retrieves the collection of patient treatments associated with the specified patient identifier.
/// </summary>
/// <param name="patientId">The unique identifier of the patient whose treatments are being queried.</param>
/// <returns>A task that represents the asynchronous operation, containing an enumerable collection of <see cref="PatientTreatment"/> records for the given patient.</returns>
/// <!-- aidoc:v1 sig=8e33f27 -->
Task<IEnumerable<PatientTreatment>> FindByPatientId(ObjectId patientId);
/// <summary>
@@ -55,12 +62,14 @@ public interface ITreatmentRepository : IMongoRepository<PatientTreatment>
/// </summary>
/// <param name="patientId">The unique identifier of the patient whose record should be deleted.</param>
/// <returns>A task that represents the asynchronous operation. The task result is <c>true</c> if the record was successfully deleted; otherwise, <c>false</c>.</returns>
/// <!-- aidoc:v1 sig=30d6841 -->
Task<bool> DeleteByPatientId(ObjectId patientId);
/// <summary>
/// Asynchronously retrieves the list of bolus treatments associated with the specified patient.
/// </summary>
/// <param name="patientId">The unique identifier of the patient whose bolus treatments are being queried.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="PatientTreatment"/> entries representing the patient's bolus treatments.</returns>
/// <!-- aidoc:v1 sig=a6b897b -->
Task<List<PatientTreatment>> FindBolusTreatments(ObjectId patientId);
/// <summary>
/// Updates many records that reference a specific ObjectId, replacing the existing ObjectId with a new one.
@@ -69,12 +78,14 @@ public interface ITreatmentRepository : IMongoRepository<PatientTreatment>
/// <param name="nameId">The name of the field/property that contains the ObjectId reference to be updated.</param>
/// <param name="id">The new ObjectId value that will replace the existing reference.</param>
/// <param name="oldId">The current ObjectId value to match and be replaced.</param>
/// <!-- aidoc:v1 sig=24ef97c -->
Task UpdateManyObjectId(string nameId, ObjectId id, ObjectId oldId);
/// <summary>
/// Retrieves a paginated, fluent queryable collection of patient treatments based on the provided pagination filter.
/// </summary>
/// <param name="filter">The pagination filter containing page size, page number, and other pagination criteria.</param>
/// <returns>An <see cref="IFindFluent{TSource, TDocument}"/> for <see cref="PatientTreatment"/> that supports further fluent query composition and pagination.</returns>
/// <!-- aidoc:v1 sig=e758e90 -->
IFindFluent<PatientTreatment, PatientTreatment> GetPaginatedTreatments(PaginationFilter filter);
/// <summary>
/// Asynchronously retrieves a list of active patient treatments for the specified patient, ordered according to the provided ordering criterion.
@@ -82,5 +93,6 @@ public interface ITreatmentRepository : IMongoRepository<PatientTreatment>
/// <param name="patientId">The unique identifier of the patient whose active treatments are to be retrieved.</param>
/// <param name="order">The ordering criterion applied to the returned list of treatments.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of active <see cref="PatientTreatment"/> objects for the specified patient.</returns>
/// <!-- aidoc:v1 sig=d9fb0b1 -->
Task<List<PatientTreatment>> GetActiveTreatmentsByPatientIdAndOrder(ObjectId patientId, string order);
}
@@ -15,6 +15,7 @@ public interface IUnitRepository : IMongoRepository<Unit>
/// </summary>
/// <param name="id">The identifier of the <see cref="Unit"/> to locate.</param>
/// <returns>A task that resolves to the matching <see cref="Unit"/>, or <c>null</c> if no entity is found.</returns>
/// <!-- aidoc:v1 sig=ea48821 -->
Task<Unit?> FindById(object id);
/// <summary>
@@ -22,6 +23,7 @@ public interface IUnitRepository : IMongoRepository<Unit>
/// </summary>
/// <param name="section">The name of the section to search for.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the unit if found; otherwise, null.</returns>
/// <!-- aidoc:v1 sig=ede1d64 -->
Task<Unit?> FindByName(string section);
//Task<Unit?> FindByPointOfCare(PointOfCare pointOfCare);
@@ -29,18 +31,21 @@ public interface IUnitRepository : IMongoRepository<Unit>
/// Asynchronously retrieves all available units and returns them as a list.
/// </summary>
/// <returns>A task that represents the asynchronous operation, containing a list of all <see cref="Unit"/> entities.</returns>
/// <!-- aidoc:v1 sig=8307d85 -->
Task<List<Unit>> GetAll();
/// <summary>
/// Updates an existing unit in the underlying store and returns the updated entity.
/// </summary>
/// <param name="section">The unit containing the updated data to persist.</param>
/// <returns>A task that resolves to the updated <see cref="Unit"/>, or <c>null</c> when the unit cannot be found.</returns>
/// <!-- aidoc:v1 sig=a321fce -->
Task<Unit?> UpdateUnit(Unit section);
/// <summary>
/// Inserts a single <see cref="Unit"/> record and returns the inserted entity, or <see langword="null"/> if the insertion did not produce a result.
/// </summary>
/// <param name="unit">The <see cref="Unit"/> entity to insert.</param>
/// <returns>A task that represents the asynchronous insert operation. The task result contains the inserted <see cref="Unit"/>, or <see langword="null"/> when no unit is returned.</returns>
/// <!-- aidoc:v1 sig=f7169a1 -->
Task<Unit?> InsertOneUnit(Unit unit);
/// <summary>
/// Retrieves the collection of units associated with the specified master list identifier and master list type.
@@ -48,18 +53,21 @@ public interface IUnitRepository : IMongoRepository<Unit>
/// <param name="id">The unique identifier of the master list whose units should be retrieved.</param>
/// <param name="masterListType">The type of the master list used to filter or scope the unit lookup.</param>
/// <returns>A task that represents the asynchronous operation, containing the collection of units linked to the specified master list.</returns>
/// <!-- aidoc:v1 sig=0faf184 -->
Task<IEnumerable<Unit>> FindByMasterListId(ObjectId id, MasterListType masterListType);
/// <summary>
/// Asynchronously retrieves the collection of <see cref="Unit"/> entities associated with the specified master list identifier.
/// </summary>
/// <param name="id">The <see cref="ObjectId"/> of the master list whose units are being requested.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains an <see cref="IEnumerable{Unit}"/> with the units linked to the given master list.</returns>
/// <!-- aidoc:v1 sig=cf80d78 -->
Task<IEnumerable<Unit>> FindByMasterListId(ObjectId id);
/// <summary>
/// Updates the unit master list based on the provided unit identifiers. Returns the updated <see cref="Unit"/> when the operation succeeds, or <c>null</c> when no matching unit is found.
/// </summary>
/// <param name="updateUnitListDto">The data transfer object containing the list of unit identifiers to update.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the updated <see cref="Unit"/>, or <c>null</c> if no unit was updated.</returns>
/// <!-- aidoc:v1 sig=4b7663f -->
Task<Unit?> UpdateUnitMasterList(UpdateUnitIdListDto updateUnitListDto);
/// <summary>
/// Updates the name and title of an existing unit identified by the specified identifier.
@@ -68,6 +76,7 @@ public interface IUnitRepository : IMongoRepository<Unit>
/// <param name="name">The new name to assign to the unit.</param>
/// <param name="title">The new title to assign to the unit.</param>
/// <returns>A task that represents the asynchronous update operation. The task result contains the updated <see cref="Unit"/>, or <c>null</c> if the unit was not found.</returns>
/// <!-- aidoc:v1 sig=a3c7afb -->
Task<Unit?> UpdateUnitInfo(ObjectId unitId, string name, string title);
/// <summary>
/// Updates the configuration of a unit identified by the specified identifier.
@@ -75,12 +84,14 @@ public interface IUnitRepository : IMongoRepository<Unit>
/// <param name="unitIdParsed">The parsed object identifier of the unit whose configuration will be updated.</param>
/// <param name="unitConfiguration">The new configuration values to apply to the unit.</param>
/// <returns>A task that represents the asynchronous operation. The task result is <c>true</c> if the configuration was successfully updated; otherwise, <c>false</c>.</returns>
/// <!-- aidoc:v1 sig=bfe899b -->
Task<bool> UpdateConfiguration(ObjectId unitIdParsed, UnitConfiguration unitConfiguration);
/// <summary>
/// Retrieves a paginated collection of <see cref="Unit"/> records based on the provided pagination criteria.
/// </summary>
/// <param name="filter">The pagination filter that defines the page size, page number, and any additional filtering criteria.</param>
/// <returns>An <see cref="IFindFluent{Unit, Unit}"/> representing the fluent query for the paginated units.</returns>
/// <!-- aidoc:v1 sig=4cab03f -->
IFindFluent<Unit, Unit> GetPaginatedUnits(PaginationFilter filter);
/// <summary>
/// Asynchronously counts the number of units associated with the master list identified by the specified identifier and type.
@@ -88,5 +99,6 @@ public interface IUnitRepository : IMongoRepository<Unit>
/// <param name="id">The unique identifier of the master list whose units should be counted.</param>
/// <param name="masterListType">The type of the master list used to resolve the appropriate unit collection.</param>
/// <returns>A task that represents the asynchronous operation, containing the total number of units matching the specified master list.</returns>
/// <!-- aidoc:v1 sig=d8cd4b6 -->
Task<long> CountUnitsByMasterListId(ObjectId id, MasterListType masterListType);
}
@@ -14,30 +14,35 @@ public interface IUserRepository : IMongoRepository<User>
/// <param name="username">The username used to look up the user account.</param>
/// <param name="password">The password used to authenticate the user.</param>
/// <returns>A task that resolves to the authenticated <see cref="User"/>, or null if no user matches the provided credentials.</returns>
/// <!-- aidoc:v1 sig=6f5e55d -->
Task<User?> GetUser(string username, string password);
/// <summary>
/// Retrieves a user by their unique identifier asynchronously.
/// </summary>
/// <param name="id">The unique identifier of the user to retrieve.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the <see cref="User"/> if found; otherwise, <see langword="null"/>.</returns>
/// <!-- aidoc:v1 sig=ab4b64e -->
Task<User?> GetById(ObjectId id);
/// <summary>
/// Asynchronously retrieves a user matching the specified username. Returns <c>null</c> if no user is found.
/// </summary>
/// <param name="name">The username to look up.</param>
/// <returns>A task that represents the asynchronous operation, containing the matching <see cref="User"/> or <c>null</c> if not found.</returns>
/// <!-- aidoc:v1 sig=117d092 -->
Task<User?> GetByUserName(string name);
/// <summary>
/// Asynchronously retrieves a user by their name, returning null if no matching user is found.
/// </summary>
/// <param name="name">The name of the user to look up.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the user with the specified name, or null if no matching user exists.</returns>
/// <!-- aidoc:v1 sig=c29096f -->
Task<User?> GetByName(string name);
/// <summary>
/// Asynchronously retrieves the user associated with the specified authorities name.
/// </summary>
/// <param name="name">The authorities name used to look up the user.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the matching <see cref="User"/> if found; otherwise, <c>null</c>.</returns>
/// <!-- aidoc:v1 sig=9c416d2 -->
Task<User?> GetByUserAndAuthoritesName(string name);
/// <summary>
/// Updates an existing user in the system, optionally updating the user's password when the <paramref name="updatePass"/> flag is set.
@@ -45,16 +50,19 @@ public interface IUserRepository : IMongoRepository<User>
/// <param name="user">The user entity containing the updated information to be persisted.</param>
/// <param name="updatePass">A flag indicating whether the user's password should also be updated as part of this operation.</param>
/// <returns>A task that returns the updated <see cref="User"/> entity, or <c>null</c> if the user was not found.</returns>
/// <!-- aidoc:v1 sig=41a6482 -->
Task<User?> UpdateUser(User user, bool updatePass);
/// <summary>
/// Retrieves a paginated, fluent queryable collection of <see cref="User"/> entities based on the supplied pagination filter.
/// </summary>
/// <param name="filter">The pagination filter that defines paging parameters such as page number and page size.</param>
/// <returns>An <see cref="IFindFluent{User, User}"/> representing the queryable, paginated user results.</returns>
/// <!-- aidoc:v1 sig=b888cec -->
IFindFluent<User, User> GetPaginatedUsers(PaginationFilter filter);
/// <summary>
/// Retrieves the existing system user, creating a new one if it does not already exist.
/// </summary>
/// <returns>The existing or newly created system <see cref="User"/>.</returns>
/// <!-- aidoc:v1 sig=35c711b -->
Task<User> GetOrCreateSystemUser();
}