using adas_core.Domain.Enums;
using adas_core.Domain.Models;
using adas_core.Domain.Models.GroupedObservations;
using adas_core.Domain.Models.MongoModels;
using MongoDB.Bson;

namespace adas_core.Application.Services.Interfaces;

public interface IAlarmService : IApiRequestService
{
    public Task<List<PatientObservationAlarm>> FindLastObservationsByField(ObjectId patientId,
        List<Field>? filterObservations = null);

    Task<List<PatientObservationAlarm>> FindLastValuesNotExpired(ObjectId patientId, List<Field> dataAlarmfields,
        List<ConfigObservation> configAlarm);

    public Task<PatientObservationAlarm?> MapObservation(PatientObservationAlarm obs, bool onlyByName = false);
    public Task<PatientObservationAlarm?> MapObservationsByName(PatientObservationAlarm obs);

    Task CalculateAlarmTest(BasePatientObservationValue source, string name);

    Task SendAlarm(PatientObservation obs, string name, AlarmEnum.Name? code, AlarmEnum.Severity severity,
        AlarmEnum.Type type);

    Task CheckObservationAlarm(PatientObservation obs4);

    Task ProcessAlarmObservations(List<PatientObservationAlarm> alarmObservations,
        List<PatientObservation> observations, Patient patient,
        DateTime messageTime, ObservationData? observationData = null);
}