using adas_core.Domain.Models;
using adas_core.Domain.Models.Filter;
using adas_core.Domain.Models.MongoModels;
using adas_core.Domain.Models.Responses;
using MongoDB.Bson;
using MongoDB.Driver;
namespace adas_core.Application.Services.Interfaces;
public interface ITreatmentService : IApiRequestService
{
///
/// Inserts a new record into the underlying data store.
///
/// The patient treatment entity to be added.
Task Insert(PatientTreatment treatment);
///
/// Asynchronously deletes an entity associated with the specified patient identifier.
///
/// The representing the unique identifier of the patient whose related entity should be removed.
/// A containing true if the deletion was successful; otherwise, false.
Task DeleteByPatientId(ObjectId id);
///
/// Asynchronously deletes the entity identified by the specified identifier.
///
/// The unique identifier of the entity to delete.
Task DeleteById(ObjectId id);
///
/// Archives records associated with the specified patient identifier.
///
/// The ObjectId of the patient whose records should be archived.
Task ArchiveByPatientId(ObjectId id);
///
/// Archives the specified patient, marking them as archived in the system.
///
/// The patient to archive.
Task Archive(Patient patient);
///
/// Updates an existing patient treatment record in the system.
///
/// The patient treatment entity containing the updated information to be persisted.
/// A task that represents the asynchronous operation. The task result contains true if the treatment was updated successfully; otherwise, false.
Task UpdateTreatment(PatientTreatment patientTreatment);
///
/// Updates many records by replacing the specified old ObjectId with the new ObjectId in the field identified by nameId.
///
/// The name of the field that contains the ObjectId to be updated.
/// The new ObjectId value that will replace the existing one.
/// The existing ObjectId value to be replaced.
Task UpdateManyObjectId(string nameId, ObjectId id, ObjectId oldId);
///
/// Retrieves all treatments associated with the specified patient identifier.
///
/// The unique identifier of the patient whose treatments are to be retrieved.
/// A task that represents the asynchronous operation, containing a collection of PatientTreatment objects for the specified patient.
Task> GetTreatmentsByPatientId(ObjectId id);
///
/// Retrieves the active treatment records associated with the specified patient identifier.
///
/// The unique identifier of the patient whose active treatments should be retrieved.
/// A task that represents the asynchronous operation, containing an enumerable collection of active records, which may include null entries.
Task> GetActiveTreatmentsByPatient(ObjectId id);
///
/// Asynchronously retrieves a cursor over the records associated with the specified patient identifier.
///
/// The unique identifier of the patient whose treatments should be returned.
/// A yielding an that iterates the matching documents.
Task> FindByPatientIdAsync(ObjectId patientId);
///
/// Asynchronously retrieves all patient treatments associated with the specified patient identifier.
///
/// The unique identifier of the patient whose treatments are being queried.
/// A task that represents the asynchronous operation, containing a collection of instances for the specified patient.
Task> FindByPatientId(ObjectId patientId);
///
/// Retrieves the list of bolus treatments associated with the specified patient.
///
/// The unique identifier of the patient whose bolus treatments are being retrieved.
/// A task that represents the asynchronous operation, containing a list of records representing the patient's bolus treatments.
Task> GetBolusTreatments(ObjectId patientId);
///
/// Retrieves a paginated list of patient treatments based on the specified filter criteria.
///
/// The pagination filter used to control the page number, page size, and other query options.
/// A task that represents the asynchronous operation, containing the paginated patient treatment results.
Task> GetPaginatedTreatments(PaginationFilter filter);
///
/// Retrieves the list of active treatments associated with the specified patient, sorted according to the provided order parameter.
///
/// The unique identifier of the patient whose active treatments are being queried.
/// A string defining the ordering criteria applied to the returned treatments.
/// A task that represents the asynchronous operation, containing a list of active entries for the patient.
Task> GetActiveTreatmentsByPatientIdAndOrder(ObjectId patientId, string order);
}