using adas_core.Domain.Enums;
using adas_core.Domain.Models;
using adas_core.Domain.Models.Pumps;
using MongoDB.Bson;

namespace adas_core.Application.Services.Interfaces;

public interface ICalculatedObservations
{
    Task<T?> Map<T>(T obs, bool onlyByName = false) where T : BasePatientObservation;
    Task<PatientTreatment> Map(PatientTreatment treatment);
    Task<PatientDiagnosis> Map(PatientDiagnosis diagnosis);

    Task<PumpObservation> Map(PumpObservation pumpObservation);

    Task CalculateMedicineObservation(List<Medicine> activeMedicines, ObjectId patientId);

    Task CalculateActiveBolus(ObjectId patientId);

    Task<IEnumerable<PatientTreatment?>> GetActiveTreatmentsByPatient(ObjectId id);

    Task<PatientObservation?> FixTimeInconsistencyWithLast(PatientObservation newObservation);
    Task<List<PatientObservation>> PreMapList(List<PatientObservation> listToInsert);
    Task<PatientObservation> MapSourceAlarm(PatientObservation obs, PatientObservationAlarm alarmToInsert);

    Task SendAlarm(PatientObservation obs, string name, AlarmEnum.Name? code);
}