Creado apartir del commit b888de6c92056de294456f581a56e25e734d4ab7 de develop
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
using adas_core.Domain.Models;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IApiRequestService
|
||||
{
|
||||
Task SaveRequestAsync(ApiRequest apiRequest);
|
||||
Task SaveRequest(ApiRequest apiRequest);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using adas_core.Domain.Models;
|
||||
using adas_core.Domain.Models.DTO;
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IAdminPanelService
|
||||
{
|
||||
Task<bool> DeleteUnitById(ObjectId unitId);
|
||||
Task<Unit?> InsertUnit(Unit unit);
|
||||
|
||||
#region Patient
|
||||
|
||||
Task<Patient?> CreatePatient(AdmPanelRequest apiRequest);
|
||||
Task<Patient?> FindPatientByLocation(PatientLocation location);
|
||||
Task<Patient?> FindPatientByPatientNumber(string patientNumber);
|
||||
|
||||
Task<Patient?> FindPatientById(ObjectId id);
|
||||
|
||||
//List<person> FindAllPatient();
|
||||
Task<Patient?> FindPatient(AdmPanelRequest request);
|
||||
Task<UnitInfoDto?> GetUnitDependencyDto(Unit unit);
|
||||
|
||||
Task<bool> UpdatePatientLocation(AdmPanelRequest request);
|
||||
Task<bool> UpdatePatientData(AdmPanelRequest request, Patient oldPatient);
|
||||
Task<bool> ArchivePatient(Patient patient);
|
||||
|
||||
#endregion
|
||||
|
||||
#region ConfigObservations
|
||||
Task<bool> CreateConfig(ConfigObservation configObservation);
|
||||
Task<bool> UpdateConfig(ConfigObservation configObservation);
|
||||
Task<bool> DeleteConfigObservationItem(ObjectId id);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Medicienes
|
||||
|
||||
Task<Medicine?> GetMedicineById(ObjectId medicineId);
|
||||
Task<Medicine?> PostMedicine(Medicine medicine);
|
||||
Task<Medicine?> UpdateMedicine(Medicine medicine);
|
||||
Task<bool> DeleteMedicineById(string medicineId);
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
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);
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
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);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IAlertValuesService
|
||||
{
|
||||
Task<ConfigObservation?> FindByKey(ObjectId key);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using adas_core.Domain.Models;
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Driver;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IAppointmentService : IApiRequestService
|
||||
{
|
||||
Task<List<PatientAppointment>> FindByLocation(PatientLocation location);
|
||||
Task<List<PatientAppointment>> GetByPatient(ObjectId patientId);
|
||||
Task<List<PatientAppointment>> GetTodayByPatient(ObjectId patientId, CancellationToken ct = default);
|
||||
Task<List<PatientAppointment>> GetTodayByPoc(ObjectId pocId, CancellationToken ct = default);
|
||||
Task<IAsyncCursor<PatientAppointment>> FindByPatientIdAsync(ObjectId patientId);
|
||||
Task Archive(Patient patient);
|
||||
Task ArchiveByPatientId(ObjectId id);
|
||||
Task DeleteByPatientId(ObjectId id);
|
||||
Task ProcessApiRequest(ApiRequest apiRequest, Patient patient);
|
||||
Task UpdateManyObjectId(string nameId, ObjectId id, ObjectId oldId);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IArchivePatientCarePlanService
|
||||
{
|
||||
Task<List<PatientCarePlan>?> FindByPatientId(ObjectId id);
|
||||
Task<List<PatientCarePlan>?> FindByPatientId(string id);
|
||||
Task<List<PatientCarePlan>?> FindByPatientNumber(string id);
|
||||
|
||||
Task<List<PatientCarePlan>> FindAll();
|
||||
|
||||
// Task<PatientCarePlan?> UpdateTreatment(PatientCarePlan patientCarePla, List<OptionList> options);
|
||||
// Task<PatientCarePlan?> UpdateProcedure(PatientCarePlan patientCarePla, List<OptionList> options);
|
||||
Task<PatientCarePlan?> InsertOneAsync(PatientCarePlan patientCarePla);
|
||||
Task InsertManyAsync(List<PatientCarePlan> patientCarePla);
|
||||
|
||||
// Task Update(PatientCarePlan oldPatientCarePla, PatientCarePlan newPatientCarePla);
|
||||
// Task<PatientCarePlan?> FindByIds(ObjectId oldPatientCarePlaId, string? oldPatientCarePlaPatientId, string? oldPatientCarePlaPatientNumber);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using adas_core.Domain.Models;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IArchivedPatientObservationService
|
||||
{
|
||||
public Task<List<PatientObservation>> FindArchivedPatientObservationsFromPatient(ObjectId patientId);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IArchivedPatientService
|
||||
{
|
||||
public Task<List<Patient>> FindAllPatients();
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using adas_core.Domain.Models;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IArchivedPatientTreatmentService
|
||||
{
|
||||
Task<List<PatientTreatment>> FindAllPatientTreatmentsByPatient(ObjectId patientId);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using adas_core.Domain.Models.Responses;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IAuthService
|
||||
{
|
||||
Task<LoginResponse?> GetLoginResponse();
|
||||
Task<string> GetToken();
|
||||
Task<List<Authorization>> GetByUnitId(ObjectId unitId);
|
||||
Task<bool> DeleteByDisplayId(ObjectId displayId);
|
||||
Task<bool> DeleteByUnitId(ObjectId unitId);
|
||||
Task<List<Authorization>> GetUserAuthorities(ObjectId id);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using adas_core.Domain.Models.GroupedObservations;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces
|
||||
{
|
||||
public interface ICacheService
|
||||
{
|
||||
//Métodos básicos
|
||||
void SetValue(string key, string value);
|
||||
string? GetValue(string key);
|
||||
Task<T?> GetObjectAsync<T>(string key, bool updateExpiration = true);
|
||||
Task SetObjectAsync<T>(string key, T obj, bool updateExpiration = true);
|
||||
Task<T?> GetObjectAsync<T>(string key, TimeSpan? ttlOverride, bool updateExpiration);
|
||||
Task SetObjectAsync<T>(string key, T obj, TimeSpan? ttlOverride, bool updateExpiration);
|
||||
Task DeleteObjectAsync(string key);
|
||||
Task<long> DeleteByPatternAsync(string pattern);
|
||||
void CleanCache();
|
||||
|
||||
|
||||
// Métodos para transparencia y gestión de locks
|
||||
|
||||
// GetOrSet (string key)
|
||||
Task<string?> GetOrSetValueAsync(string key, Func<Task<string>> loader, TimeSpan? ttlOverride = null);
|
||||
Task<T> GetOrSetObjectAsync<T>(
|
||||
string key,
|
||||
Func<Task<T>> factory,
|
||||
TimeSpan? ttl = null,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
// GetOrSet especializado para GroupedObservations
|
||||
Task<T> GetOrSetObjectAsync<T>(
|
||||
GroupedField groupedField,
|
||||
ObjectId patientId,
|
||||
Func<Task<T>> factory,
|
||||
TimeSpan? ttl = null,
|
||||
CancellationToken cancellationToken = default);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
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);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using adas_core.Domain.Models;
|
||||
using adas_core.Domain.Models.Pumps;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface ICalculatedObservationsService
|
||||
{
|
||||
Task<PatientObservation?> Map(PatientObservation obs, bool onlyByName = false);
|
||||
Task<PatientObservationAlarm?> Map(PatientObservationAlarm obs, bool onlyByName = false);
|
||||
Task<PatientTreatment?> Map(PatientTreatment treatment);
|
||||
Task<PumpObservation?> Map(PumpObservation obs);
|
||||
Task<PatientRecordingAlert?> Map(PatientRecordingAlert obs);
|
||||
Task<PatientDiagnosis?> Map(PatientDiagnosis obs);
|
||||
Task<List<PatientObservation>> MapList(List<PatientObservation> listToInsert);
|
||||
Task CalculateBolusOpiates(ObjectId patientId);
|
||||
Task CalculateMedicineObservation(List<Medicine> activeMedicines, ObjectId patientId);
|
||||
Task<IEnumerable<PatientTreatment?>> GetActiveTreatmentsByPatient(ObjectId id);
|
||||
Task<PatientObservation> MapSourceAlarm(PatientObservation observation, PatientObservationAlarm observationAlarm);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using adas_core.Domain.Models.Filter;
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using adas_core.Domain.Models.Responses;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface ICameraService
|
||||
{
|
||||
Task<Camera?> GetById(ObjectId relayId);
|
||||
List<Camera> GetCameraInList(List<ObjectId> configurationRelayList);
|
||||
Task<PaginationResponse<Camera>> GetPaginatedCameras(PaginationFilter request);
|
||||
Task<Camera?> InsertCamera(Camera camera);
|
||||
Task<Camera?> UpdateCameraById(ObjectId objectId, Camera camera);
|
||||
Task<bool> DeleteCamera(ObjectId objectId);
|
||||
Task<List<Camera>> GetSearchByNameCameras(string textToSearch);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using adas_core.Domain.Enums;
|
||||
using adas_core.Domain.Models;
|
||||
using adas_core.Domain.Models.SignalR;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IClientMessageService
|
||||
{
|
||||
Task SendAsync(string receiverId, OperationType? type, object? msg);
|
||||
Task SendToAllAsync(OperationType type, object? msg);
|
||||
Task ProcessMessage(Message msg, string contextConnectionId);
|
||||
void SendUpdateMessageToBoxes(List<PatientLocation> boxes);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using adas_core.Domain.Enums;
|
||||
using adas_core.Domain.Models;
|
||||
using adas_core.Domain.Models.DTO;
|
||||
using adas_core.Domain.Models.Filter;
|
||||
using adas_core.Domain.Models.GroupedObservations;
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using adas_core.Domain.Models.Pumps;
|
||||
using adas_core.Domain.Models.Responses;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IConfigObservationService
|
||||
{
|
||||
Task<ConfigObservation?> GetByCodeSysAndCode(string codingSystem, string code);
|
||||
Task<ConfigObservation?> Get(string name);
|
||||
|
||||
Task<ConfigObservation?> Get<T>(T obs, bool onlyByName = false) where T : BasePatientObservation;
|
||||
|
||||
Task<ObservatitonRetentionResult?> RetentionActions<T>(T obs) where T : BasePatientObservation;
|
||||
Task<T?> Map<T>(T obs, bool onlyByName = false) where T : BasePatientObservation;
|
||||
Task<PatientTreatment?> Map(PatientTreatment treatment);
|
||||
|
||||
Task<StatusEnum.Type> GroupedObservationStatus(GroupedField groupedField, GroupedObservationEnum.Result result,
|
||||
string name, object value, double? min, double? max);
|
||||
|
||||
Task<ICollection<ConfigObservation>> GetAllConfigs(CancellationToken ct = default);
|
||||
Task<PaginationResponse<ConfigObservation>> GetPaginatedItems(PaginationFilter filter);
|
||||
Task<ConfigObservationDto> GetAllCompact();
|
||||
Task<ConfigObservation?> GetConfigById(ObjectId id);
|
||||
Task<List<string>> GetConfigNames(string id);
|
||||
Task<List<string>> GetConfigNames();
|
||||
Task<ConfigObservation?> UpdateConfig(ConfigObservation configObservation);
|
||||
Task<ConfigObservation?> CreateConfig(ConfigObservation configObservation);
|
||||
Task<ConfigObservation?> RemoveConfigItem(string itemName);
|
||||
Task<ConfigObservation?> RemoveConfigItem(ObjectId id);
|
||||
Task<IEnumerable<ConfigObservation>?> GetConfigObservationItem(string name);
|
||||
|
||||
Task<ConfigObservation?> GetSingleConfigObservationItem(string? code, string? codingSystem, string? name,
|
||||
string? originalName);
|
||||
|
||||
Task<bool> DeleteSingleConfigObservationItem(ConfigObservation configObservationItem);
|
||||
Task<IEnumerable<ConfigObservation>> GetConfigObservationItemsByName(string name);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using adas_core.Domain.Models;
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using adas_core.Domain.Models.Pumps;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IConfigPumpsService
|
||||
{
|
||||
Task<PumpObservation> Map(PumpObservation obs);
|
||||
Task<List<ConfigPumps>?> GetAllPumpConfigs();
|
||||
Task<List<ConfigPumpItem>?> GetConfigItems(string id);
|
||||
Task<ConfigPumps?> GetPumpConfigById(string id);
|
||||
Task<ConfigPumps?> UpdatePumpConfig(ConfigPumps pumpConfig);
|
||||
Task<ConfigPumps?> InsertPumpConfig(ConfigPumps pumpConfig);
|
||||
Task<bool> DeletePumpConfig(ConfigPumps config);
|
||||
Task<ObservatitonRetentionResult?> RetentionActions(PumpObservation obs);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using adas_core.Domain.Models;
|
||||
using adas_core.Domain.Models.Pumps;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IConfigUnitsService
|
||||
{
|
||||
Task<T> Map<T>(T obs) where T : BasePatientObservation;
|
||||
Task<PumpObservation> Map(PumpObservation obs);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using adas_core.Domain.Models.DTO;
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IDeviceService
|
||||
{
|
||||
Task<Device?> Create(DeviceDto device);
|
||||
Task<bool> Delete(ObjectId objectId);
|
||||
Task<Device?> Update(DeviceDto device);
|
||||
Task<Device?> ReceiveEvent(DeviceDto device);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using adas_core.Domain.Models;
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IDiagnosisService : IApiRequestService
|
||||
{
|
||||
Task<List<PatientDiagnosis>> GetByPatientId(ObjectId patientId);
|
||||
Task DeleteByPatientId(ObjectId id);
|
||||
Task Archive(Patient patient);
|
||||
Task ArchiveByPatientId(ObjectId id);
|
||||
Task ProcessDiagnosisObservation(ApiRequest apiRequest, Patient patient);
|
||||
Task SaveRequest(ApiRequest apiRequest, Patient patient);
|
||||
Task ProcessDiagnosis(List<PatientDiagnosis> diagnosis, Patient patient, DateTime messageTime);
|
||||
Task UpdateManyObjectId(string nameId, ObjectId id, ObjectId oldId);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
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
|
||||
{
|
||||
Task<Discharge?> GetDischargeByIdAsync(ObjectId dischargeId);
|
||||
Task<long> CountDischargesByUnitId(ObjectId unitId);
|
||||
Task DeleteDischargeByIdAsync(ObjectId dischargeId);
|
||||
Task DeleteDischargeAsync(Discharge discharge);
|
||||
Task UpdateDischargeAsync(Discharge discharge);
|
||||
Task<IEnumerable<Discharge>> GetDischargesAsync();
|
||||
Task<Discharge?> InsertDischarge(Discharge discharge);
|
||||
Task<Discharge?> GetDischargeByLocation(PatientLocation location);
|
||||
Task<Discharge?> GetDischargeByPatientId(ObjectId patientId);
|
||||
Task<Discharge?> GetDischargeByPointOfCareId(ObjectId location);
|
||||
Task<Discharge?> GetDischargeByPointOfCareIdWithLocale(ObjectId location, LocaleEnum dataLocale);
|
||||
void SendDischargeBroadcast(Discharge discharge, OperationType operation);
|
||||
Task UpdatePatientMasterListItemChange(UpdateOptionMasterListDto opt, IEnumerable<Unit> unitList, string typeName);
|
||||
Task DeletePatientMasterListItem(OptionList opt, IEnumerable<Unit> unitList, string typeName);
|
||||
Task DeleteDischargesByUnitId(ObjectId unitId);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using adas_core.Domain.Enums;
|
||||
using adas_core.Domain.Models.DTO.Display;
|
||||
using adas_core.Domain.Models.Filter;
|
||||
using adas_core.Domain.Models.GroupedObservations;
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using adas_core.Domain.Models.Responses;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IDisplayConfigService
|
||||
{
|
||||
Task<List<DisplayConfig>> GetAll();
|
||||
Task<PaginationResponse<DisplayConfigMinimalResponse>> GetAllCompactPaginated(PaginationFilter request);
|
||||
Task<List<DisplayConfig>> GetByType(DisplayConfigEnums.DisplayType type);
|
||||
Task<DisplayConfig> GetById(ObjectId id);
|
||||
Task<DisplayConfig?> GetById(ObjectId? configId, ObjectId unitId, DisplayConfigEnums.DisplayType displayType);
|
||||
Task<DisplayConfig?> InsertOne(DisplayConfig config);
|
||||
Task<DisplayConfig?> InsertOneMinimal(CreateDisplayConfigDto config);
|
||||
Task<DisplayConfig> InsertOneTest();
|
||||
Task<DisplayConfig?> UpdateConfig(ObjectId displayConfigId, object newDisplayConfig);
|
||||
Task<bool> UpdateFieldList(ObjectId objectIdConfigDisplay, List<Field> fields);
|
||||
Task<bool> UpdateConfigColor(ObjectId objectIdConfigDisplay, ColorConfig colorConfigDto);
|
||||
Task<bool> UpdateHeaderConfig(ObjectId objectIdConfigDisplay, HeaderConfig headerConfig);
|
||||
Task<bool> UpdateSetHomeBanner(ObjectId objectIdConfigDisplay, List<BannerItem> bannerItems);
|
||||
Task<bool> UpdateBaseConfig(DisplayConfig baseConfig);
|
||||
Task<bool> UpdateDisplayConfigHospitalName(ObjectId objectIdConfigDisplay, string name);
|
||||
Task<bool> DeleteDisplayConfig(ObjectId objectIdConfigDisplay);
|
||||
Task<DisplayConfig?> GetDefaultConfig(DisplayConfigEnums.DisplayType type);
|
||||
Task<List<DisplayConfigLocationDto>> GetDisplayConfigLocations(ObjectId objectIdConfigDisplay);
|
||||
Task<List<DisplayConfigMinimalResponse>> GetAllCompact();
|
||||
|
||||
Task<DisplayConfig?> InsertOneWithTemplate(string objectId,
|
||||
DisplayConfigEnums.DisplayType configType, string? configHospital);
|
||||
|
||||
Task<bool> UpdateCardConfig(CardConfig baseConfig);
|
||||
Task<CardConfig?> InsertCardConfig(CreateDisplayConfigCardDto updateDisplayConfigNameDto);
|
||||
Task<List<CardConfig>> GetCardConfigAll();
|
||||
Task<CardConfig?> GetCardConfigById(ObjectId id);
|
||||
Task<bool> UpdateDetailConfig(CardDetailsConfig baseConfig);
|
||||
Task<CardDetailsConfig?> InsertCardDetailConfig(CreateDisplayConfigCardDto updateDisplayConfigNameDto);
|
||||
Task<ChartConfig?> InsertChartConfig(CreateDisplayConfigCardDto updateDisplayConfigNameDto);
|
||||
Task<bool> UpdateChartConfig(ChartConfig baseConfig);
|
||||
Task<bool> DeleteChartConfig(ObjectId objectIdConfigDisplay);
|
||||
Task<ChartConfig?> GetChartConfig(ObjectId objectIdConfigChart);
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
using adas_core.Domain.Enums;
|
||||
using adas_core.Domain.Models.DTO;
|
||||
using adas_core.Domain.Models.DTO.Display;
|
||||
using adas_core.Domain.Models.Filter;
|
||||
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 IDisplayService
|
||||
{
|
||||
//Task<List<DisplayWithPermissionsDto>> GetAll(string? userName, List<Authorization> displayIdByAuthorities);
|
||||
Task<List<DisplayMinimalDto>> GetAllCompact();
|
||||
Task<List<DisplayWithPermissionsDto>> GetAllByUser(string? userName);
|
||||
Task<List<Display>> GetByType(DisplayConfigEnums.DisplayType type);
|
||||
Task<List<Display>> GetByPointOfCare(PointOfCare pointOfCare);
|
||||
Task<List<Display>> GetByConfigId(ObjectId configId);
|
||||
Task<List<Display>> GetByCardConfigId(ObjectId configId);
|
||||
|
||||
// Task<List<Display>> GetByUser();
|
||||
Task<Display?> GetByName(string name);
|
||||
Task<Display?> GetById(ObjectId id);
|
||||
Task<DisplayWithPermissionsDto> GetByIdWithPermissions(ObjectId id, LocaleEnum localeEnum);
|
||||
Task<long> CountDisplaysByUnitId(ObjectId unitId);
|
||||
|
||||
Task<Display?> GetInfo(
|
||||
ObjectId id,
|
||||
string? userName,
|
||||
List<Authorization>? authorizations,
|
||||
LocaleEnum? locale,
|
||||
bool fillPointOfCare = true,
|
||||
bool fillPatientData = false,
|
||||
bool fillDisplayList = true,
|
||||
bool fillDisplayConfig = true,
|
||||
CancellationToken ct = default
|
||||
);
|
||||
|
||||
|
||||
Task<List<MinimalDisplaySection>> GetDisplaySectionByUser(
|
||||
DisplayConfigEnums.DisplayType type,
|
||||
ObjectId? currentDisplay,
|
||||
string? userName,
|
||||
List<Authorization>? authorizations);
|
||||
|
||||
Task<MinimalDisplayListDto> GetAllDisplaySection();
|
||||
Task<List<Display>> GetByUnitId(ObjectId id);
|
||||
Task<PocAndUnitDto> GetAllAvailablePoc(List<string> displayIds, bool excludeVirtual = false);
|
||||
Task<List<PointOfCare>> GetAllPocsByDisplayId(ObjectId id);
|
||||
Task<Display> InsertOne(Display display);
|
||||
Task<Display> InsertOneTest();
|
||||
Task<Display?> UpdateConfig(Display oldDisplay, DisplayConfig? newDisplayConfig);
|
||||
Task<Display?> UpdateConfigId(Display oldDisplay, ObjectId configId);
|
||||
Task<Display?> UpdatePointOfCareList(ObjectId objectId, List<ObjectId> listPocObId);
|
||||
Task<Display?> UpdateConfigPreset(ObjectId objectIdDisplay, ObjectId objectIdConfigDisplay);
|
||||
Task<Display?> UpdateName(ObjectId id, string name);
|
||||
Task<PaginationResponse<Display>> GetPaginatedDisplays(PaginationFilter filter);
|
||||
Task<bool> DeleteDisplay(ObjectId id);
|
||||
Task<List<DisplayConfigLocationDto>> GetDisplayConfigLocations(ObjectId displayConfigId);
|
||||
Task<bool> IsDisplayConfigInUse(ObjectId displayConfigId);
|
||||
Task DeleteDisplaysByUnitId(ObjectId unitId);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
//using Microsoft.AspNetCore.Http;
|
||||
|
||||
using adas_core.Domain.Enums;
|
||||
using adas_core.Domain.Models.DTO;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IFileService
|
||||
{
|
||||
Task<bool> CopyUpdateFiles(ICollection<IFormFile> files);
|
||||
Task<bool> UploadAssetFiles(ICollection<IFormFile> files, FileEnum.AssetTheme themeParse);
|
||||
List<AssetDto> GetAllAssetFile(FileEnum.AssetTheme themeParse);
|
||||
|
||||
List<string> GetFilesInDirectory(string directoryPath);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using adas_core.Application.Subscriptions;
|
||||
using adas_core.Domain.Models;
|
||||
using adas_core.Domain.Models.GroupedObservations;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IGroupedObservationService
|
||||
{
|
||||
Task<GroupedObservation> GenerateGroupedObservation(ObjectId id, GroupedField groupedField,
|
||||
string timeZoneId = "Romance Standard Time", bool cacheIsChecked = false, CancellationToken ct = default);
|
||||
|
||||
Task<GroupedObservation> GenerateGroupedObservation(ObjectId obsPatientId, GroupedField groupedField,
|
||||
List<GroupedObservation.GroupedObservationObs> wsgLastGroupedObservationObs, PatientObservation obs,
|
||||
string timeZoneId = "Romance Standard Time");
|
||||
|
||||
Task<List<PatientObservation>> FindLastObservations(ObjectId patientId, int num = 2,
|
||||
List<string>? filterObservations = null);
|
||||
|
||||
Task<GroupedObservation> CreateNextEmptyObs(WsSubscriberGrouped ws);
|
||||
/*
|
||||
*
|
||||
List<BsonDocument> CalculateShiftObservations(List<BsonDocument> shiftGroupObservations, GroupedField groupedField);
|
||||
List<BsonDocument> GenerateShiftObservations(List<BsonDocument> result, GroupedField groupedField);
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using adas_core.Domain.Enums;
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IHistoricalConfigChangesService
|
||||
{
|
||||
Task<ICollection<HistoricalConfigChanges>> GetAll();
|
||||
Task<HistoricalConfigChanges?> Get(ObjectId id);
|
||||
Task<ICollection<HistoricalConfigChanges>> GetByType(DisplayConfigEnums.ConfigTypes type, int num);
|
||||
|
||||
Task<ICollection<HistoricalConfigChanges>> GetByUser(string user, DisplayConfigEnums.ConfigTypes? configTypes,
|
||||
int num);
|
||||
|
||||
Task<HistoricalConfigChanges?> FindLastConfigChanges(DisplayConfigEnums.ConfigTypes configTypes);
|
||||
|
||||
|
||||
Task<HistoricalConfigChanges?> InsertOne(HistoricalConfigChanges historicalConfigChanges);
|
||||
Task<HistoricalConfigChanges?> UpdateHistoricalConfigChange(HistoricalConfigChanges historicalConfigChanges);
|
||||
|
||||
Task DeleteHistoricalConfigChange(ObjectId id);
|
||||
|
||||
Task LogConfigChanged(string user, DisplayConfigEnums.ConfigTypes configType, string newConfig, string oldConfig);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using adas_core.Domain.Enums;
|
||||
using adas_core.Domain.Models;
|
||||
using adas_core.Domain.Models.Filter;
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using adas_core.Domain.Models.Responses;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface ILightBeaconService
|
||||
{
|
||||
Task SendColor(ObjectId pocId, LightBeaconColor color);
|
||||
Task SendColor(PointOfCare pocId, LightBeaconColor color);
|
||||
Task SendBeaconBroadcast(PointOfCare poc, LightBeaconColor color);
|
||||
Task SendBeaconBroadcast(ObjectId poc, LightBeaconColor color);
|
||||
Task PowerOffLed(ObjectId pocId);
|
||||
Task PowerOffLed(PointOfCare poc);
|
||||
|
||||
void GenerateColorAlert(PatientObservation obs);
|
||||
|
||||
//TODO refactor, one patient can have multiple beacons
|
||||
public Task<LightBeaconColor> GetColor(ObjectId pocId);
|
||||
public Task<LightBeaconColor> GetColor(PointOfCare poc);
|
||||
Task<LightBeacon?> UpdateOne(LightBeacon beacon);
|
||||
Task<LightBeacon?> InsertOne(LightBeacon beacon);
|
||||
Task<PaginationResponse<LightBeacon>> GetPaginatedBeacons(PaginationFilter request);
|
||||
Task<List<LightBeacon>> GetSearchByName(string textToSearch);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.Security.Claims;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface ILocalAuditService
|
||||
{
|
||||
Task CreateAuditLogAsync(ClaimsPrincipal? user, object? dataOriginal, object? dataModified, string? reason = null);
|
||||
Task<T?> DeepCopyAsync<T>(T data);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
namespace adas_core.Application.Services.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// Contrato genérico para un proveedor de locks por clave.
|
||||
/// CacheService usará una implementación local en memoria.
|
||||
/// RedisService podría usar una distribuida (si fuera necesario).
|
||||
/// </summary>
|
||||
public interface ILockProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// Intenta adquirir el lock para una clave dentro del timeout.
|
||||
/// </summary>
|
||||
Task<bool> AcquireAsync(string key, TimeSpan timeout);
|
||||
|
||||
/// <summary>
|
||||
/// Libera el lock para la clave (idempotente).
|
||||
/// </summary>
|
||||
Task ReleaseAsync(string key);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using adas_core.Domain.Enums;
|
||||
using adas_core.Domain.Models.DTO;
|
||||
using adas_core.Domain.Models.Filter;
|
||||
using adas_core.Domain.Models.Masters;
|
||||
using adas_core.Domain.Models.Responses;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IMasterListService<T> where T : MasterList
|
||||
{
|
||||
Task<IEnumerable<T>> GetAllMasterList();
|
||||
Task<IEnumerable<MasterListDto>> GetAllMasterListWithoutOptions();
|
||||
Task<IEnumerable<MasterListWithPaginatedOptionsDto>> GetAllMasterListWithPaginatedOptions(PaginationFilter request);
|
||||
Task<T?> GetMasterListById(ObjectId id, LocaleEnum? locale);
|
||||
|
||||
Task<MasterListWithPaginatedOptionsDto?> GetMasterListByIdWithPaginatedOptions(ObjectId id,
|
||||
PaginationFilter request);
|
||||
|
||||
Task<List<string>> GetMasterListOptionsNamesById(ObjectId id);
|
||||
Task<List<OptionList>> GetMasterListByIdAndTextSearch(ObjectId id, string? textSearch);
|
||||
Task<List<OptionList>> GetMasterListByIdAndSearchOptions(ObjectId id, FilterOptionListElement filterOption);
|
||||
Task<T?> GetMasterListByName(string name);
|
||||
Task<T?> InsertMasterList(T item);
|
||||
Task<T?> UpdateMasterList(T item);
|
||||
Task DeleteMasterListById(ObjectId id);
|
||||
Task<OptionList?> AddOptionToMasterList(ObjectId id, FilterOptionListElement opt);
|
||||
Task<OptionList?> UpdateMasterListOption(ObjectId id, OptionList opt, string typeName, LocaleEnum locale);
|
||||
Task<OptionList?> UpdateFullMasterListOption(ObjectId id, OptionList opt, string typeName);
|
||||
Task<OptionList?> UpdateMasterListOption(ObjectId id, OptionList opt, string typeName);
|
||||
Task<OptionList?> FindOptionItemById(ObjectId masterId, ObjectId optionId, LocaleEnum locale);
|
||||
Task<UpdateMasterListDetailsDto?> UpdateOptionDetailsToMasterList(ObjectId id, UpdateMasterListDetailsDto opt);
|
||||
Task<bool> UpdateMasterListName(ObjectId id, string name);
|
||||
Task<bool> UpdateMasterListDescription(ObjectId id, string name);
|
||||
Task<bool> RemoveMasterListOption(ObjectId id, OptionList oldOpt);
|
||||
Task<int> GetAllMasterListCount();
|
||||
Task<PaginationResponse<T>> GetPaginatedMasterList(PaginationFilter filter);
|
||||
Task<bool> DeleteMasterListOption(ObjectId id, ObjectId optId, string typeName);
|
||||
|
||||
Task<PaginationResponse<MasterListWithPaginatedOptionsDto>> GetPaginatedMasterListWithPaginatedOptions(
|
||||
PaginationFilter listFilter, PaginationFilter optionsFilter);
|
||||
|
||||
Task<PaginationResponse<OptionList>> GetPaginatedOptions(PaginationFilter filter, ObjectId listId);
|
||||
Task<ObjectId?> GetAssociatedList(ObjectId id, MasterListType masterListType1, MasterListType masterListType2);
|
||||
Task<List<string>> GetOptionsOfList(ObjectId id);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using adas_core.Domain.Enums;
|
||||
using adas_core.Domain.Models.Masters;
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IMasterListServiceFactory
|
||||
{
|
||||
object GetService(Type serviceType);
|
||||
object GetService(MasterListType serviceName);
|
||||
object? GetTypedMasterList(MasterListType masterListType, MasterList masterList);
|
||||
Type GetMasterListSpecificType(MasterListType masterListType);
|
||||
Task<object?> InsertMasterList(MasterListType masterListType, MasterList masterList);
|
||||
Task<object?> UpdateMasterList(MasterListType masterListType, MasterList masterList);
|
||||
Task<object?> GetMasterListById(MasterListType masterListType, ObjectId masterListId, LocaleEnum? dataLocale);
|
||||
List<string> StringNurseObs();
|
||||
Task<Patient?> GetPatientTraslated(Unit? unit, LocaleEnum? locale, Patient? patient);
|
||||
|
||||
Task<object?> GetMasterListOptionById(MasterListType masterListType, ObjectId masterListId,
|
||||
ObjectId masterListOptionId,
|
||||
LocaleEnum? dataLocale);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using adas_core.Domain.Models;
|
||||
using adas_core.Domain.Models.Filter;
|
||||
using adas_core.Domain.Models.Responses;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IMedicineService
|
||||
{
|
||||
Task<Medicine?> GetByCode(string code);
|
||||
Task<List<Medicine>> GetByCodeOrNote(List<string> codeNote);
|
||||
Task<Medicine?> GetByName(string name);
|
||||
Task<IEnumerable<Medicine>> GetMedicinesOfTreatments(IEnumerable<PatientTreatment?> treatments);
|
||||
Task<IEnumerable<Medicine>> GetActiveMedicinesByPatient(ObjectId patientId);
|
||||
Task<PaginationResponse<Medicine>> GetPaginatedMedicines(PaginationFilter filter);
|
||||
Task<List<Medicine>> GetAll();
|
||||
Task<Medicine?> GetMedicineById(ObjectId medicineId);
|
||||
Task<Medicine?> PostMedicine(Medicine medicine);
|
||||
Task<Medicine?> UpdateMedicine(Medicine medicine);
|
||||
Task DeleteMedicineById(ObjectId medicineId);
|
||||
Task<List<string>> GetAllTypes();
|
||||
Task<List<string>> GetAllGroups();
|
||||
Task<List<string>> GetAllNames();
|
||||
Task<List<string>> GetAllCodes();
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using adas_core.Domain.Models;
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface INoticeService
|
||||
{
|
||||
Task DeleteNoticeAsync(Notice notice);
|
||||
Task DeleteNoticeByIdAsync(ObjectId noticeId);
|
||||
Task<Notice?> GetNoticeByIdAsync(ObjectId noticeId);
|
||||
Task<IEnumerable<Notice>?> GetNoticeByTypeAsync(string noticeType);
|
||||
Task<IEnumerable<Notice>> GetNoticesAsync();
|
||||
Task<Notice?> InsertNotice(Notice notice);
|
||||
Task UpdateNoticeAsync(Notice notice);
|
||||
Task SaveRequest(ApiRequest apiRequest);
|
||||
Task SaveRequestAsync(ApiRequest apiRequest);
|
||||
Task<IEnumerable<Notice>?> GetNoticesByDisplayId(ObjectId displayId);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using adas_core.Domain.Models;
|
||||
using adas_core.Domain.Models.GroupedObservations;
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IObservationDemoService
|
||||
{
|
||||
Task<List<PatientObservation>> GenerateObservationByField(Patient patient, List<Field> dataFields);
|
||||
Task<GroupedObservation> GenerateGroupedObservation(Patient patient, GroupedField groupedField);
|
||||
Task<List<PatientObservationAlarm>> GenerateAlarmByField(Patient patient, List<Field> dataAlarmfields);
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
using adas_core.Domain.Models;
|
||||
using adas_core.Domain.Models.Filter;
|
||||
using adas_core.Domain.Models.GroupedObservations;
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using adas_core.Domain.Models.Responses;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Driver;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IObservationService : IApiRequestService
|
||||
{
|
||||
//REMOVE
|
||||
/*
|
||||
List<PatientObservation> FindLastObservations(ObjectId patientId, string codingSystem, string code, int num = 2);
|
||||
*/
|
||||
Task<IAsyncCursor<PatientObservation>> FindByPatientIdAsync(ObjectId patientId);
|
||||
|
||||
Task<IAsyncCursor<PatientObservation>> FindByPatientIdAndCodingSystemAsync(ObjectId patientId, string codingSystem,
|
||||
string name);
|
||||
|
||||
Task<List<PatientObservation>> FindLastObservations(ObjectId patientId, int num = 2,
|
||||
List<string>? filterObservations = null);
|
||||
|
||||
Task UpdateExpiredObservations(List<PatientObservation> expiredObservations);
|
||||
Task ExpireObservationsAndRecalculateAsync();
|
||||
Task ExpireAlertsAndPowerOffAsync();
|
||||
|
||||
Task<List<PatientObservation>> FindLatestUniqueValuesByName(ObjectId patientId, string name, int? expires);
|
||||
|
||||
Task<List<PatientObservation>> FindLastObservationsByField(ObjectId patientId,
|
||||
List<Field>? filterObservations = null, bool mapped = true, CancellationToken ct = default);
|
||||
|
||||
Task<List<PatientObservation?>> FindLastIntravenousLinesObservationByLocation(ObjectId patientId);
|
||||
Task InsertObservation(PatientObservation patientObservation, bool persistObs = true, bool mapObs = true);
|
||||
Task<bool> InsertIfChanged(string name, PatientObservation observation, bool persistObs = true, bool mapObs = true);
|
||||
Task InsertNurseObservation(PatientObservation obs);
|
||||
Task DeleteByPatientId(ObjectId id);
|
||||
Task Archive(PatientObservation observation);
|
||||
Task<PatientObservation?> MapObservation(PatientObservation obs, bool onlyByName = false);
|
||||
Task<Dictionary<ObjectId, DateTime>> FindAllLastPatientObservationTime();
|
||||
Task<PatientObservation?> MapObservationsByName(PatientObservation obs);
|
||||
Task Archive(Patient patient);
|
||||
Task ArchiveByPatientId(ObjectId id);
|
||||
|
||||
Task UpdateObservation(PatientObservation observation);
|
||||
Task UpdateManyObjectId(string nameId, ObjectId id, ObjectId oldId);
|
||||
|
||||
Task SendObsBroadcast(BasePatientObservation obs);
|
||||
Task SendObsBroadcast(List<PatientObservation> obs, PatientLocation location);
|
||||
Task SendObsBroadcast(List<PatientObservation> obs, ObjectId pocId);
|
||||
|
||||
Task<PatientObservation?> FindLastBeforeDate(ObjectId patientId, DateTime date, string? obsName);
|
||||
|
||||
Task<List<PatientObservation>?> FindAnyWithSameDate(ObjectId patientId, DateTime date, string? obsName);
|
||||
|
||||
//TODO To implement
|
||||
Task<List<PatientObservation>> FindAllBeforeDate(ObjectId patientId, DateTime date,
|
||||
List<string>? filterObservations = null);
|
||||
|
||||
//TODO To implement
|
||||
Task<List<PatientObservation>> FindAllAfterDate(ObjectId patientId, DateTime date,
|
||||
List<string>? filterObservations = null);
|
||||
|
||||
Task<List<PatientObservation>> FindAllBetweenDates(ObjectId patientId, DateTime? startDate, DateTime? endDate,
|
||||
List<string>? filterObservations = null, bool fromArchived = false, PaginationFilter? filter = null);
|
||||
|
||||
Task<IEnumerable<PatientObservation>> FindLastNotExpiredObservatonsByPatient(ObjectId patientId, string name,
|
||||
int? endAfter = null, int? num = null);
|
||||
|
||||
|
||||
Task CheckAndExpireObservations();
|
||||
|
||||
IAsyncEnumerable<PatientObservation> FindNotExpiredObservationsShouldBeExpired();
|
||||
|
||||
|
||||
void ProcessObservations(List<PatientObservation> observations, Patient patient, DateTime messageTime,
|
||||
ObservationData? observationData = null);
|
||||
|
||||
Task ExpireObservations();
|
||||
|
||||
Task InsertSimpleObservation(PatientObservation observation);
|
||||
Task<PaginationResponse<PatientObservation>> GetPaginatedObservations(PaginationFilter filter);
|
||||
Task SaveRequestNurseObsAsync(ApiRequest request);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using adas_core.Domain.Models.Masters;
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IPatientCarePlanService
|
||||
{
|
||||
Task<List<PatientCarePlan>> FindByPatientId(ObjectId patientId);
|
||||
Task<List<PatientCarePlan>> FindByUserId(ObjectId userId);
|
||||
Task<List<PatientCarePlan>> FindAll();
|
||||
Task InsertOneAsync(PatientCarePlan patientCarePlan);
|
||||
Task ArchiveCarePlanFromJob(Patient patientWithFinishedProcedure, List<OptionList> itemsToArchive);
|
||||
|
||||
Task ArchiveByPatientId(ObjectId patientid);
|
||||
Task UpdateManyObjectId(string patientid, ObjectId patientId, ObjectId oldId);
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using adas_core.Domain.Enums;
|
||||
using adas_core.Domain.Models;
|
||||
using adas_core.Domain.Models.DTO;
|
||||
using adas_core.Domain.Models.Filter;
|
||||
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 IPatientService : IApiRequestService
|
||||
{
|
||||
Task<Patient?> FindByPatientId(string patientId, bool withLocation = false);
|
||||
Task<Patient?> FindByPatientIdWithLocale(string patientId, LocaleEnum localeEnum);
|
||||
Task<Patient?> FindByPatientNumberArchived(string patientNumber);
|
||||
Task<Patient?> FindByPatientNumber(string patientNumber, bool withLocation = false);
|
||||
Task<Patient?> FindByLocation(PatientLocation? location);
|
||||
Task<Patient?> FindByPointOfCareId(ObjectId pocId);
|
||||
Task<Patient?> FindByUnitAndPocId(ObjectId unit, ObjectId pointOfCare);
|
||||
Task<List<Patient>> FindByPointOfCare(string pointOfCare);
|
||||
Task<long> CountPatientsByUnitId(ObjectId unitId);
|
||||
|
||||
Task<Patient?> FindPatient(string? patientId, string? patientNumber, PatientLocation? location,
|
||||
bool findByLocation = false);
|
||||
|
||||
Task Insert(Patient patient);
|
||||
Task InsertAsync(Patient patient);
|
||||
Task ArchivePatient(Patient patient);
|
||||
Task ArchivePatientData(ObjectId patientid);
|
||||
Task MergePatient(Patient patient, string oldPatienNumber);
|
||||
Task UpdateLocation(ObjectId id, PatientLocation? location);
|
||||
Task UpdateAttendingDoctor(ObjectId id, Person doctor);
|
||||
Task UpdatePatientData(ObjectId id, string patientNumber, Person data, bool updatePatientNumber = true);
|
||||
Task UpdatePatientData(ObjectId id, string patientNumber, Patient patient, bool updatePatientNumber = true);
|
||||
Task Update(Patient patient);
|
||||
Task<bool> Move(Patient patient, ObjectId newPocId, ObjectId oldPocId);
|
||||
Task<Patient?> FindById(ObjectId id, bool withLocation = false);
|
||||
Task<Box?> GetBox(PointOfCare poc, bool observations = false, List<string>? filterObservations = null);
|
||||
Task<Patient?> CreatePatientFromRequest(ApiRequest apiRequest, bool ignoreLocation = false);
|
||||
Task<Patient?> FindPatientByApiRequest(ApiRequest apiRequest);
|
||||
Task ArchivePatientWithoutObservationsSinceDate(DateTime date);
|
||||
|
||||
Task ArchiveDischargedPatients(int hoursBeforeArchive);
|
||||
Task<List<Patient>> FindAll(bool withLocation = false);
|
||||
Task<PaginationResponse<Patient>> GetPaginatedPatients(PaginationFilter filter);
|
||||
|
||||
Task DischargeInactivePatients(DateTime sinceDate, int hoursBeforeArchive);
|
||||
Task<Patient?> UpdateOne(Patient updatedPatient);
|
||||
|
||||
Task SendNewPatientBroadcast(Patient patient);
|
||||
Task SendPatientUpdateBroadcast(Patient patient);
|
||||
Task<List<Patient>> FindInActivePoC();
|
||||
Task<List<Patient>> FindInInactivePoC();
|
||||
|
||||
Task<Patient?> GetByPointOfCare(PointOfCare item, bool observations = false,
|
||||
List<string>? filterObservations = null);
|
||||
|
||||
Task<Patient?> GetByPointOfCareAndLocale(PointOfCare item, Unit? unit, LocaleEnum? localeEnum);
|
||||
Task<Patient?> UpdatePatientAltable(ObjectId patientId, OptionList altable, User? user);
|
||||
Task ExitPatientById(ObjectId id, bool archivePatient = true);
|
||||
|
||||
Task<Patient?> UpdatePatientMasterList(ObjectId patientId, MasterListType typeName,
|
||||
List<OptionList> updatedOptions,
|
||||
User? user, List<OptionList>? carePlanLog);
|
||||
|
||||
Task GenerateNurseCarePlanAndInsert(MasterListType carePlanType, List<OptionList>? options,
|
||||
Patient patient, User? user);
|
||||
|
||||
Task UpdatePatientIncomingData(ObjectId patientId, Patient person);
|
||||
Task UpdatePatientDemographicData(ObjectId patientId, Patient person, User? user);
|
||||
Task<Patient?> SearchByPatientNumberAndDistinctUnit(string patientNumber, ObjectId unitId);
|
||||
Task<List<Patient>> FindAllPatientWithFinishedProcedures(int archiveProcedureEndDateAfterMinutes);
|
||||
Task<List<Patient>> FindAllPatientWithFinishedTest(int archiveTestEndDateAfterMinutes);
|
||||
Task<List<Patient>> FindAllPatientWithFinishedTreatment(int archiveTreatmentEndDateAfterMinutes);
|
||||
|
||||
Task UpdatePatientIncomingData(ObjectId patientId, Patient person, PatientIncomeData personDataChange,
|
||||
User user);
|
||||
|
||||
Task UpdatePatientMasterListItemChange(UpdateOptionMasterListDto opt, IEnumerable<Unit> unitList,
|
||||
string typeName);
|
||||
|
||||
Task DeletePatientMasterListItem(OptionList opt, IEnumerable<Unit> unitList, string typeName);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using adas_core.Domain.Enums;
|
||||
using adas_core.Domain.Models.AppSettings;
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IPermissionService
|
||||
{
|
||||
public Task<DisplayPermissionTypes> GetPermissionsForDisplay(Display display, User user);
|
||||
public Task<DisplayPermissionTypes> GetPermissionsForUnit(string unitId, User user);
|
||||
public PanelPermissionTypes GetPermissionsForPanel(User user);
|
||||
public Task<PanelPermissionTypes> GetPermissionsForPanel(string user);
|
||||
|
||||
Task<bool> HasAccessToDisplay(string username, PermissionEnum.RolesType role,
|
||||
PermissionEnum.SourcePermissionsEnum source, string displayId);
|
||||
|
||||
Task<bool> HasAccessToUnit(string username, PermissionEnum.RolesType role,
|
||||
PermissionEnum.SourcePermissionsEnum source, string unitId);
|
||||
|
||||
Task<bool> HasAccessToPanel(string username, PermissionEnum.RolesType role,
|
||||
PermissionEnum.SourcePermissionsEnum source);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using adas_core.Domain.Models;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IPoCMappingService
|
||||
{
|
||||
Task<PatientLocation?> Map(PatientLocation original);
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
using adas_core.Domain.Enums;
|
||||
using adas_core.Domain.Models.Filter;
|
||||
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 IPointOfCareService
|
||||
{
|
||||
Task Delete(ObjectId id);
|
||||
|
||||
Task<PointOfCare?> Update(PointOfCare pointOfCare);
|
||||
|
||||
Task UpdateUnit(ObjectId id, Unit unit);
|
||||
Task<List<PointOfCare>> GetAll();
|
||||
|
||||
Task<List<PointOfCare>> GetAllConfigs();
|
||||
Task<List<PointOfCare>> GetAllLocationInfo();
|
||||
|
||||
Task UpdateConfiguration(ObjectId id, PointOfCareConfiguration configuration);
|
||||
|
||||
Task<PointOfCare?> FindById(ObjectId id);
|
||||
Task<PointOfCare?> FindByIdAllConfig(ObjectId id);
|
||||
|
||||
Task<IEnumerable<PointOfCare>?> FindAllByUnitId(ObjectId unit);
|
||||
|
||||
Task<IEnumerable<PointOfCare>?> FindByRoom(string room);
|
||||
|
||||
Task<IEnumerable<PointOfCare>?> FindByBed(string bed);
|
||||
|
||||
Task<List<PointOfCare>> FindAllByUnitIds(List<ObjectId> unitIds);
|
||||
|
||||
Task<PointOfCare?> GetInfo(ObjectId id, LocaleEnum? locale = null, bool fillPatientData = true, CancellationToken ct = default);
|
||||
|
||||
Task<PointOfCare?> InsertPointOfCare(PointOfCare pointOfCare);
|
||||
Task<PointOfCare?> FindPoCByPatientId(ObjectId patientId);
|
||||
|
||||
Task SetPointOfCareStatus(ObjectId id, StatusEnum.PointOfCare status);
|
||||
|
||||
Task<IEnumerable<PointOfCare>> FindByUnitAndStatus(ObjectId unitId, StatusEnum.PointOfCare poc,
|
||||
bool excludeVirtual = false);
|
||||
|
||||
void CheckNextAdmission(ObjectId? patientLocation);
|
||||
Task<PointOfCare?> FindByBedAndUnitId(string? bed, ObjectId? unitId);
|
||||
Task UpdateRelayConfig(PointOfCare poc);
|
||||
Task<PointOfCare?> FindPoCByPatientNumber(string patientNumber);
|
||||
|
||||
Task<long> CountPoCsByUnitId(ObjectId unitId);
|
||||
Task<long> CountVirtualPoCsByUnitId(ObjectId unitId);
|
||||
Task<PaginationResponse<PointOfCare>> GetPaginatedPoCs(PaginationFilter filter);
|
||||
Task DeletePoCsByUnitId(ObjectId unitId);
|
||||
Task<HashSet<ObjectId>> FindAllIdCamerasInUse();
|
||||
Task<HashSet<ObjectId>> FindAllIdRelaysInUse();
|
||||
Task<HashSet<ObjectId>> FindAllIdBeaconsInUse();
|
||||
Task<IEnumerable<PointOfCare>?> FindAllByUnitIdWithDevices(ObjectId unitId);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IPublisherService
|
||||
{
|
||||
Task<bool> CreateQueue(string queueName);
|
||||
Task<bool> SendMessageError(object obj, string queueName);
|
||||
Task<bool> SendMessage(object obj, string queueName);
|
||||
Task<bool> SendMessage(string message, string queueName);
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
using MongoDB.Bson;
|
||||
using adas_core.Domain.Models;
|
||||
using adas_core.Domain.Models.Pumps;
|
||||
using adas_core.Domain.Models.Filter;
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using adas_core.Domain.Models.Responses;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IPumpService: IApiRequestService
|
||||
{
|
||||
// Insert manual
|
||||
Task InsertPumpObservation(PumpObservation obs);
|
||||
|
||||
// Mapping
|
||||
Task<PumpObservation?> MapPumpObservation(PumpObservation obs);
|
||||
|
||||
// Consultas por paciente
|
||||
Task<List<PumpObservation>> FindLastPumpObservations(ObjectId patientId, int num = 1);
|
||||
Task<Dictionary<ObjectId, DateTime>> FindAllLastPatientObservationTime();
|
||||
|
||||
// Gestión de configuración
|
||||
Task<List<ConfigPumpItem>?> GetItemsById(string id);
|
||||
Task<List<ConfigPumps>?> GetAllPumpConfig();
|
||||
Task<ConfigPumps?> GetPumpConfigsById(string id);
|
||||
Task<ConfigPumps?> UpdatePumpConfig(ConfigPumps config);
|
||||
Task<ConfigPumps?> InsertPumpConfig(ConfigPumps config);
|
||||
Task<bool> DeletePumpConfig(ConfigPumps config);
|
||||
|
||||
// Paginación
|
||||
Task<PaginationResponse<PumpObservation>?> GetPaginatedPump(PaginationFilter filter);
|
||||
|
||||
// Archivado / limpieza
|
||||
Task DeleteByPatientId(ObjectId id);
|
||||
Task Archive(Patient patient);
|
||||
Task ArchiveByPatientId(ObjectId id);
|
||||
|
||||
// Mantenimiento ids
|
||||
Task UpdateManyObjectId(string nameId, ObjectId id, ObjectId oldId);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using adas_core.Domain.Models;
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IRecordingAlertService : IApiRequestService
|
||||
{
|
||||
Task<List<PatientRecordingAlert>> FindLastRecordingAlert(ObjectId patientId, int num = 2);
|
||||
Task DeleteByPatientId(ObjectId id);
|
||||
Task Archive(Patient patient);
|
||||
Task ArchiveByPatientId(ObjectId id);
|
||||
|
||||
Task UpdateManyObjectId(string nameId, ObjectId id, ObjectId oldId);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using adas_core.Domain.Enums;
|
||||
using adas_core.Domain.Models;
|
||||
using adas_core.Domain.Models.DTO;
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using adas_core.Domain.Models.Recording;
|
||||
using Patient = adas_core.Domain.Models.MongoModels.Patient;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IRecordingService : IApiRequestService
|
||||
{
|
||||
Task<bool> SendCancelRecordingToRecordingApi(Patient patient, PointOfCare poc);
|
||||
|
||||
Task SendRecordingDataToQueue(Patient patient, PointOfCare poc, DateTime? date, DateTime? endDate,
|
||||
DateTime? eventDate, AlarmEnum.Name? alarmName, AlarmEnum.Severity severity, string? alarmDescription,
|
||||
bool start = true, AlarmEnum.Type type = AlarmEnum.Type.Manual);
|
||||
|
||||
Task SendRecordingData(Patient patient, PointOfCare poc, ManualRecording manualRecording, bool start);
|
||||
|
||||
Task<bool> SendAutoRecordingData(Patient patient, PointOfCare poc, RecordingData automaticRecording);
|
||||
|
||||
Task<List<RecordingData>?> GetRecordings(int roomName);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using adas_core.Domain.Enums;
|
||||
using adas_core.Domain.Models.Filter;
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using adas_core.Domain.Models.Responses;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IRelayService
|
||||
{
|
||||
Task<RelayEnum.Status> CheckRelayStatus(Relay relay);
|
||||
Task<RelayEnum.Status> CheckRelayStatus(ObjectId relayId);
|
||||
|
||||
Task PowerOn(Relay relay);
|
||||
Task PowerOff(Relay relay);
|
||||
Task SetManualRelay(RelayEnum.Status status, ObjectId pocId, RelayEnum.Type type);
|
||||
Task<Relay?> GetById(ObjectId relay);
|
||||
List<Relay> GetRelayInList(List<ObjectId>? relayList);
|
||||
List<Relay> GetRelayByTypeInList(List<ObjectId>? configurationRelayList, RelayEnum.Type type);
|
||||
|
||||
Task<PaginationResponse<Relay>> GetPaginatedRelays(PaginationFilter request);
|
||||
Task<Relay?> InsertRelay(Relay request);
|
||||
Task<Relay?> UpdateRelayById(ObjectId objectId, Relay relay);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using adas_core.Domain.Models.SystemAlerts;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface ISendAlertService
|
||||
{
|
||||
Task<List<Queue>> GetQueues();
|
||||
List<Performance> GetPerformance();
|
||||
Task<List<ApiClients>> GetApiClients();
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface IServiceConfigService
|
||||
{
|
||||
Task<ServiceConfig?> Get(string id);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using adas_core.Application.Subscriptions;
|
||||
using adas_core.Domain.Models;
|
||||
using adas_core.Domain.Models.GroupedObservations;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface ISubscriberGroupedService
|
||||
{
|
||||
List<WsSubscriberGrouped> GetGrouped();
|
||||
void RemoveGroupedObsByPatientId(string patientId);
|
||||
void RemoveWsSubscriberByLocation(string patientId, PatientLocation? newLocation);
|
||||
void RemoveWsSubscriberPatientIdAndWsId(string patientId, string wsIdToRemove);
|
||||
List<string> CheckEmptySubscriberGroup(WsSubscriberGrouped wsl);
|
||||
void AddSubscriberGrouped(WsSubscriberGrouped wsSubscriberGrouped);
|
||||
|
||||
void CheckOnSubscriptionGroup(GroupedField groupedField, ObjectId patientId, string timeZoneId, string connectionId,
|
||||
GroupedObservation go);
|
||||
|
||||
void UpdateLastGroupedObsInGroup(string wsgHashCode, GroupedObservation newGroupedObservation);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using adas_core.Application.Subscriptions;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface ISubscribersService
|
||||
{
|
||||
List<WsSubscriber> GetSubscribers();
|
||||
WsSubscriber? GetById(string contextConnectionId);
|
||||
List<WsSubscriber> GetByPocId(ObjectId pocId);
|
||||
int RemoveConnectionById(string contextConnectionId);
|
||||
void AddSubscriber(WsSubscriber subscriber);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using adas_core.Domain.Models;
|
||||
using adas_core.Domain.Models.Filter;
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
using adas_core.Domain.Models.Responses;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Driver;
|
||||
|
||||
namespace adas_core.Application.Services.Interfaces;
|
||||
|
||||
public interface ITreatmentService : IApiRequestService
|
||||
{
|
||||
Task Insert(PatientTreatment treatment);
|
||||
Task<bool> DeleteByPatientId(ObjectId id);
|
||||
Task DeleteById(ObjectId id);
|
||||
Task ArchiveByPatientId(ObjectId id);
|
||||
Task Archive(Patient patient);
|
||||
Task<bool> UpdateTreatment(PatientTreatment patientTreatment);
|
||||
Task UpdateManyObjectId(string nameId, ObjectId id, ObjectId oldId);
|
||||
Task<IEnumerable<PatientTreatment>> GetTreatmentsByPatientId(ObjectId id);
|
||||
Task<IEnumerable<PatientTreatment?>> GetActiveTreatmentsByPatient(ObjectId id);
|
||||
Task<IAsyncCursor<PatientTreatment>> FindByPatientIdAsync(ObjectId patientId);
|
||||
Task<IEnumerable<PatientTreatment>> FindByPatientId(ObjectId patientId);
|
||||
Task<List<PatientTreatment>> GetBolusTreatments(ObjectId patientId);
|
||||
Task<PaginationResponse<PatientTreatment>> GetPaginatedTreatments(PaginationFilter filter);
|
||||
Task<List<PatientTreatment>> GetActiveTreatmentsByPatientIdAndOrder(ObjectId patientId, string order);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using adas_core.Domain.Enums;
|
||||
using adas_core.Domain.Models.DTO;
|
||||
using adas_core.Domain.Models.Filter;
|
||||
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 IUnitService
|
||||
{
|
||||
Task<List<Unit>> GetAll(bool withPocs = false);
|
||||
Task<List<UnitInfoDto>> GetAllCompact();
|
||||
|
||||
Task<UnitInfoDto> GetOneCompact(ObjectId id);
|
||||
|
||||
// Task<Unit?> GetByCodeSysAndCode(string unit);
|
||||
Task<Unit?> GetByName(string unit);
|
||||
|
||||
// Task<Unit?> GetByPointOfCare(PointOfCare pointOfCare);
|
||||
Task<Unit?> GetInfo(ObjectId id, LocaleEnum? dataLocale, bool fillLists = true, bool withPoCs = false);
|
||||
Task<Unit?> GetInfo(ObjectId id, bool withPoCs = true, bool withDevices = true);
|
||||
|
||||
Task<Unit?> FindByPatientId(ObjectId patientId);
|
||||
|
||||
// Task<List<Unit>?> FindByLocation(PatientLocation location);
|
||||
Task<Unit?> FindById(ObjectId? id);
|
||||
Task<Unit?> FindByName(string? name);
|
||||
|
||||
Task<Unit?> FindByUnitNameOrPocName(string? name, string? pocName);
|
||||
|
||||
//Task<Unit?> FindByPointOfCare(PointOfCare pointOfCare);
|
||||
Task<Unit?> InsertOne(Unit unit);
|
||||
Task<Unit?> UpdateUnit(Unit unit);
|
||||
Task<IEnumerable<Unit>?> FindUnitsByMasterListId(ObjectId masterListId, MasterListType masterListType);
|
||||
Task<long> CountUnitsByMasterListId(ObjectId masterListId, MasterListType masterListType);
|
||||
Task<IEnumerable<Unit>> FindUnitsByMasterListId(ObjectId masterListId);
|
||||
Task<Unit?> UpdateUnitMasterList(UpdateUnitIdListDto updateUnitListDto);
|
||||
Task<bool> UpdateConfiguration(ObjectId unitIdParsed, UnitConfiguration unitConfiguration);
|
||||
Task<bool> DeleteUnitById(Unit unit);
|
||||
Task<Unit?> UpdateUnitInfo(ObjectId unitId, string name, string title, string? configObsId = null);
|
||||
Task<PaginationResponse<Unit>> GetPaginatedUnits(PaginationFilter filter, bool withPoCs);
|
||||
}
|
||||
Reference in New Issue
Block a user