using adas_core.Domain.Models;
using adas_core.Domain.Models.Pumps;
using MongoDB.Bson;
namespace adas_core.Application.Services.Interfaces;
public interface ICalculatedObservationsService
{
///
/// Maps a to a corresponding , typically resolved through a lookup or translation process.
///
/// The source to be mapped.
/// When true, restricts the mapping to be performed by name only; otherwise, additional criteria are used.
/// A that resolves to the mapped , or null if no match is found.
Task Map(PatientObservation obs, bool onlyByName = false);
///
/// Asynchronously maps a instance, optionally performing the mapping
/// by name only when is true. Returns null when no matching
/// alarm can be resolved based on the selected lookup strategy.
///
/// The source patient observation alarm to map.
/// When true, restricts the mapping to match by name only; otherwise the
/// full mapping logic is applied. Defaults to false.
/// A task that represents the asynchronous operation. The task result contains the mapped
/// , or null if no mapping is found.
Task Map(PatientObservationAlarm obs, bool onlyByName = false);
///
/// Maps a instance to a projected representation asynchronously.
///
/// The source to be mapped.
/// A that represents the asynchronous mapping operation. The result is the mapped , or if no mapping could be produced.
Task Map(PatientTreatment treatment);
///
/// Maps the provided to a result, returning when no mapping is produced.
///
/// The source to be mapped.
/// A containing the mapped , or if the mapping yields no result.
Task Map(PumpObservation obs);
///
/// Asynchronously maps the specified to a resulting , returning when no mapping is produced.
///
/// The source instance to map.
/// A that contains the mapped , or if the source cannot be mapped.
Task Map(PatientRecordingAlert obs);
///
/// Maps a instance to its corresponding representation, returning when no mapping is available.
///
/// The source to map.
/// A containing the mapped , or if the source cannot be mapped.
Task Map(PatientDiagnosis obs);
///
/// Maps a list of patient observations for insertion, returning the transformed list asynchronously.
///
/// The list of patient observations to be mapped for insertion.
/// A task representing the asynchronous operation, containing the mapped list of patient observations.
Task> MapList(List listToInsert);
///
/// Asynchronously calculates the bolus dose of opiates for the specified patient.
///
/// The unique identifier of the patient for whom the bolus opiates calculation is performed.
Task CalculateBolusOpiates(ObjectId patientId);
///
/// Asynchronously calculates medicine observations for a patient based on their active medicines.
///
/// The list of medicines currently active for the patient.
/// The unique identifier of the patient.
/// A task that represents the asynchronous calculation operation.
Task CalculateMedicineObservation(List activeMedicines, ObjectId patientId);
///
/// Retrieves the active patient treatments associated with the specified patient identifier.
///
/// The unique identifier of the patient whose active treatments are being requested.
/// A task that represents the asynchronous operation, containing an enumerable collection of active PatientTreatment entries for the patient.
Task> GetActiveTreatmentsByPatient(ObjectId id);
///
/// Maps a source alarm from a onto a , producing an observation enriched with the corresponding alarm information.
///
/// The patient observation that serves as the base for the mapping.
/// The source alarm whose data is mapped onto the observation.
/// A task that represents the asynchronous operation. The task result contains the populated with the mapped alarm data.
Task MapSourceAlarm(PatientObservation observation, PatientObservationAlarm observationAlarm);
}