Interface ITreatmentRepository
- Namespace
- adas_core.Application.Repositories.Interfaces
- Assembly
- adas-core.Application.dll
public interface ITreatmentRepository : IMongoRepository<PatientTreatment>
- Inherited Members
- Extension Methods
Methods
DeleteAsync(ObjectId)
Asynchronously deletes the entity identified by the specified identifier.
Task DeleteAsync(ObjectId id)
Parameters
idObjectIdThe unique identifier of the entity to delete.
Returns
DeleteByPatientId(ObjectId)
Asynchronously deletes a record associated with the specified patient identifier.
Task<bool> DeleteByPatientId(ObjectId patientId)
Parameters
patientIdObjectIdThe unique identifier of the patient whose record should be deleted.
Returns
- Task<bool>
A task that represents the asynchronous operation. The task result is
trueif the record was successfully deleted; otherwise,false.
FindBolusTreatments(ObjectId)
Asynchronously retrieves the list of bolus treatments associated with the specified patient.
Task<List<PatientTreatment>> FindBolusTreatments(ObjectId patientId)
Parameters
patientIdObjectIdThe unique identifier of the patient whose bolus treatments are being queried.
Returns
- Task<List<PatientTreatment>>
A task that represents the asynchronous operation, containing a list of PatientTreatment entries representing the patient's bolus treatments.
FindByPatientId(ObjectId)
Asynchronously retrieves the collection of patient treatments associated with the specified patient identifier.
Task<IEnumerable<PatientTreatment>> FindByPatientId(ObjectId patientId)
Parameters
patientIdObjectIdThe unique identifier of the patient whose treatments are being queried.
Returns
- Task<IEnumerable<PatientTreatment>>
A task that represents the asynchronous operation, containing an enumerable collection of PatientTreatment records for the given patient.
FindByPatientIdAsync(ObjectId)
Asynchronously retrieves the collection of PatientTreatment records associated with the specified patient identifier, returning the results as a cursor for streaming access.
Task<IAsyncCursor<PatientTreatment>> FindByPatientIdAsync(ObjectId patientId)
Parameters
patientIdObjectIdThe unique identifier of the patient whose treatments are being queried.
Returns
- Task<IAsyncCursor<PatientTreatment>>
A task that yields an MongoDB.Driver.IAsyncCursor<TDocument> of PatientTreatment records matching the given patient identifier.
GetActiveTreatmentsByPatientIdAndOrder(ObjectId, string)
Asynchronously retrieves a list of active patient treatments for the specified patient, ordered according to the provided ordering criterion.
Task<List<PatientTreatment>> GetActiveTreatmentsByPatientIdAndOrder(ObjectId patientId, string order)
Parameters
patientIdObjectIdThe unique identifier of the patient whose active treatments are to be retrieved.
orderstringThe ordering criterion applied to the returned list of treatments.
Returns
- Task<List<PatientTreatment>>
A task that represents the asynchronous operation, containing a list of active PatientTreatment objects for the specified patient.
GetById(ObjectId)
Asynchronously retrieves a patient treatment record from the data store that matches the specified identifier. Returns a cursor over the matching PatientTreatment document, or an empty cursor if no record is found.
Task<IAsyncCursor<PatientTreatment>> GetById(ObjectId id)
Parameters
idObjectIdThe unique MongoDB.Bson.ObjectId of the patient treatment record to retrieve.
Returns
- Task<IAsyncCursor<PatientTreatment>>
A Task<TResult> that yields a cursor containing the matching patient treatment, if any.
GetByPatientId(ObjectId)
Retrieves the collection of PatientTreatment records associated with the specified patient identifier.
Task<IEnumerable<PatientTreatment>> GetByPatientId(ObjectId patientId)
Parameters
patientIdObjectIdThe unique identifier of the patient whose treatments are being queried.
Returns
- Task<IEnumerable<PatientTreatment>>
A task that represents the asynchronous operation. The task result contains an IEnumerable<T> of treatments for the patient; the collection is empty if no treatments are found.
GetPaginatedTreatments(PaginationFilter)
Retrieves a paginated, fluent queryable collection of patient treatments based on the provided pagination filter.
IFindFluent<PatientTreatment, PatientTreatment> GetPaginatedTreatments(PaginationFilter filter)
Parameters
filterPaginationFilterThe pagination filter containing page size, page number, and other pagination criteria.
Returns
- IFindFluent<PatientTreatment, PatientTreatment>
An MongoDB.Driver.IFindFluent<TDocument, TProjection> for PatientTreatment that supports further fluent query composition and pagination.
InsertOneAsync(PatientTreatment)
Asynchronously inserts a new PatientTreatment record into the data store.
Task InsertOneAsync(PatientTreatment treatment)
Parameters
treatmentPatientTreatmentThe patient treatment entity to be persisted.
Returns
Update(PatientTreatment)
Updates an existing PatientTreatment record in the data store asynchronously.
Task<bool> Update(PatientTreatment treatment)
Parameters
treatmentPatientTreatmentThe PatientTreatment entity containing the updated information.
Returns
- Task<bool>
A Task<TResult> that represents the asynchronous update operation. The task result contains
trueif the update was successful; otherwise,false.
UpdateManyObjectId(string, ObjectId, ObjectId)
Updates many records that reference a specific ObjectId, replacing the existing ObjectId with a new one.
Typically used to remap references from oldId to id for the field identified by nameId.
Task UpdateManyObjectId(string nameId, ObjectId id, ObjectId oldId)
Parameters
nameIdstringThe name of the field/property that contains the ObjectId reference to be updated.
idObjectIdThe new ObjectId value that will replace the existing reference.
oldIdObjectIdThe current ObjectId value to match and be replaced.