using adas_core.Domain.Models;
using adas_core.Domain.Models.DTO;
using adas_core.Domain.Models.Masters;
using adas_core.Domain.Models.MongoModels;
using adas_core.Domain.Models.Responses;
using MongoDB.Bson;

namespace adas_core.Application.Services.Interfaces;

public interface IAdmissionService : IApiRequestService
{
    Task<Admission?> GetAdmissionByIdAsync(ObjectId admissionId);
    Task DeleteAdmissionByIdAsync(ObjectId admissionId);
    Task DeleteAdmissionAsync(Admission admission);
    Task DeleteAdmissionsByUnitId(ObjectId unitId);

    Task UpdateAdmissionAsync(Admission admission);
    Task<IEnumerable<Admission>> GetAdmissionsAsync();
    Task<Admission?> InsertAdmission(Admission admission);
    Task AdmitPatient(Admission admission, bool isNew = false);
    Task ReturnPatientToAdmissions(ObjectId patientId);
    Task ReturnPatientToAdmissions(ObjectId patientId, Admission adm);
    Task<List<Admission>> GetAdmissionByLocation(PatientLocation location);
    Task<List<Admission>> GetAdmissionByPointOfCareId(ObjectId id);
    Task<List<Admission>> GetAdmissionByPointOfCareIdAndLocale(ObjectId pocId, LocaleEnum locale);
    Task<List<Admission>> GetAdmissionByUnitIdWithOutPoC(ObjectId unitId);
    Task<long> CountAdmissionsByUnitId(ObjectId unitId);

    Task<PatientSearch?> SearchByPatientNumberAndDistinctUnit(string patientNumber, ObjectId unitId);
    Task<Admission?> GetAdmissionByPatientNumber(string patientNumber);

    Task UpdatePatientMasterListItemChange(UpdateOptionMasterListDto opt, IEnumerable<Unit> unitList, string typeName);
    Task DeletePatientMasterListItem(OptionList opt, IEnumerable<Unit> unitList, string typeName);
}