using adas_core.Domain.Enums; using adas_core.Domain.Models; using adas_core.Domain.Models.DTO; using adas_core.Domain.Models.Masters; using adas_core.Domain.Models.MongoModels; using MongoDB.Bson; namespace adas_core.Application.Services.Interfaces; public interface IDischargeService : IApiRequestService { /// /// Asynchronously retrieves a discharge record by its unique identifier, returning null if no matching discharge is found. /// /// The unique identifier of the discharge to look up. /// A task that represents the asynchronous operation, containing the if found, or null when no record matches the provided identifier. Task GetDischargeByIdAsync(ObjectId dischargeId); /// /// Asynchronously counts the number of discharge records associated with the specified unit. /// /// The identifier of the unit whose discharges should be counted. /// A task that represents the asynchronous operation, containing the total number of discharges for the specified unit. Task CountDischargesByUnitId(ObjectId unitId); /// /// Asynchronously deletes a discharge record identified by the specified identifier. /// /// The unique identifier of the discharge to delete. Task DeleteDischargeByIdAsync(ObjectId dischargeId); /// /// Asynchronously deletes the specified discharge record. /// /// The discharge entity to be removed. Task DeleteDischargeAsync(Discharge discharge); /// /// Asynchronously updates an existing discharge record in the data store. /// /// The entity containing the updated information to persist. Task UpdateDischargeAsync(Discharge discharge); /// /// Asynchronously retrieves a collection of discharge records. /// /// A task that represents the asynchronous operation. The task result contains an enumerable collection of objects. Task> GetDischargesAsync(); /// /// Inserts a new discharge record into the data store. Returns the inserted entity, or if the record could not be created. /// /// The entity containing the data to be inserted. /// A that resolves to the inserted , or when the insertion does not produce a result. Task InsertDischarge(Discharge discharge); /// /// Retrieves the discharge record associated with the specified patient location, returning null if no matching discharge is found. /// /// The patient location used to look up the discharge record. /// A task that represents the asynchronous operation. The task result contains the matching if found, or null if no discharge is associated with the specified location. Task GetDischargeByLocation(PatientLocation location); /// /// Retrieves the discharge record associated with the specified patient identifier. /// /// The unique identifier of the patient whose discharge record is being requested. /// A that resolves to the matching if found; otherwise, null. Task GetDischargeByPatientId(ObjectId patientId); /// /// Retrieves a discharge record associated with the specified point of care location identifier. /// /// The ObjectId of the point of care location used to look up the discharge. /// A task that represents the asynchronous operation. The task result contains the matching if found, or null if no discharge exists for the specified point of care location. Task GetDischargeByPointOfCareId(ObjectId location); /// /// Retrieves the discharge associated with the specified point of care location, returning localized data for the requested locale. /// Returns null when no matching discharge is found. /// /// The identifier of the point of care location whose discharge should be retrieved. /// The locale used to determine the language of the returned discharge data. /// A task containing the matching , or null if no discharge exists for the given location. Task GetDischargeByPointOfCareIdWithLocale(ObjectId location, LocaleEnum dataLocale); /// /// Sends a broadcast notification for the specified discharge based on the given operation type. /// /// The discharge entity to be included in the broadcast. /// The type of operation (e.g., create, update, delete) that determines the broadcast context. void SendDischargeBroadcast(Discharge discharge, OperationType operation); /// /// Updates a patient master list item change using the provided update options, applying the change across the specified unit list and master list type. /// /// The update options describing the change to apply to the patient master list item. /// The collection of units to which the master list item change should be applied. /// The name of the master list type that identifies which list the item belongs to. Task UpdatePatientMasterListItemChange(UpdateOptionMasterListDto opt, IEnumerable unitList, string typeName); /// /// Deletes the specified patient master list item associated with the given option list and units. /// /// The option list containing the patient master list item to delete. /// The collection of units associated with the item to be deleted. /// The name of the type used to identify the patient master list item. /// A task that represents the asynchronous delete operation. Task DeletePatientMasterListItem(OptionList opt, IEnumerable unitList, string typeName); /// /// Deletes discharge records associated with the specified unit identifier. /// /// The unique identifier of the unit whose discharge records should be removed. Task DeleteDischargesByUnitId(ObjectId unitId); }