diff --git a/adas-core.Application/Customizations/BD/CalculatedObservations.cs b/adas-core.Application/Customizations/BD/CalculatedObservations.cs
index ddccb59a..566ad128 100644
--- a/adas-core.Application/Customizations/BD/CalculatedObservations.cs
+++ b/adas-core.Application/Customizations/BD/CalculatedObservations.cs
@@ -14,6 +14,7 @@ namespace adas_core.Application.Customizations.BD;
///
/// This type is instantiated with a primary constructor that accepts an to resolve its dependencies.
///
+///
public class CalculatedObservations(IServiceProvider serviceProvider) : ICalculatedObservations
{
private readonly ILogger _logger =
@@ -29,6 +30,8 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The patient observation to map.
/// Indicates whether the mapping should match observations by name only.
/// A containing the provided observation.
+ ///
public Task Map(T obs, bool onlyByName = false) where T : BasePatientObservation
{
return Task.FromResult(obs)!;
@@ -39,6 +42,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The patient treatment instance to map.
/// A completed containing the provided treatment.
+ ///
public Task Map(PatientTreatment treatment)
{
return Task.FromResult(treatment);
@@ -49,6 +53,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The instance to map.
/// A containing the provided .
+ ///
public Task Map(PatientDiagnosis diagnosis)
{
return Task.FromResult(diagnosis);
@@ -59,6 +64,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The pump observation to be mapped.
/// The mapped pump observation.
+ ///
public async Task Map(PumpObservation pumpObservation)
{
if (pumpObservation.Code == "IHE PCD-04")
@@ -71,6 +77,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The list of active medicines associated with the patient.
/// The unique identifier of the patient for whom the observations are calculated.
+ ///
public Task CalculateMedicineObservation(List activeMedicines, ObjectId patientId)
{
return Task.CompletedTask;
@@ -81,6 +88,8 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The unique identifier of the patient whose active bolus is being calculated.
/// A task that represents the asynchronous calculation of the active bolus.
+ ///
public Task CalculateActiveBolus(ObjectId patientId)
{
return Task.CompletedTask;
@@ -92,6 +101,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The unique identifier of the patient whose active treatments are being requested.
/// A task that represents the asynchronous operation, containing an of nullable entries for the patient's active treatments.
/// Thrown to indicate that the method is not yet implemented.
+ ///
public Task> GetActiveTreatmentsByPatient(ObjectId id)
{
throw new NotImplementedException();
@@ -103,6 +113,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The new patient observation to be reconciled against the last stored observation.
/// A task that yields the time-corrected , or null when no correction is required or no prior observation exists.
/// Thrown because the method has not been implemented yet.
+ ///
public Task FixTimeInconsistencyWithLast(PatientObservation newObservation)
{
throw new NotImplementedException();
@@ -114,6 +125,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The list of patient observations to be pre-mapped before insertion.
/// A task containing the provided list of patient observations.
+ ///
public Task> PreMapList(List listToInsert)
{
return Task.FromResult(listToInsert);
@@ -126,6 +138,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The source alarm to be inserted/mapped into the observation.
/// A that represents the asynchronous mapping operation, returning the resulting patient observation.
/// Thrown because the method has not been implemented yet.
+ ///
public Task MapSourceAlarm(PatientObservation obs, PatientObservationAlarm alarmToInsert)
{
throw new NotImplementedException();
@@ -139,6 +152,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The optional alarm code that categorizes the alarm; may be null.
/// A task that represents the asynchronous alarm sending operation.
/// Thrown because the method is not yet implemented.
+ ///
public Task SendAlarm(PatientObservation obs, string name, AlarmEnum.Name? code)
{
throw new NotImplementedException();
@@ -152,6 +166,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The pump observation containing the alarm state, type, timestamps, and identifiers used to build the alarm patient observation.
/// A completed representing the insert operation, which never faults since exceptions are caught internally.
+ ///
private Task CreatePumpAlarmObservation(PumpObservation pumpObservation)
{
PatientObservation patientObservationAlarm = new()
diff --git a/adas-core.Application/Customizations/CHUO/CalculatedObservations.cs b/adas-core.Application/Customizations/CHUO/CalculatedObservations.cs
index e336105c..be68b0c2 100644
--- a/adas-core.Application/Customizations/CHUO/CalculatedObservations.cs
+++ b/adas-core.Application/Customizations/CHUO/CalculatedObservations.cs
@@ -14,6 +14,7 @@ namespace adas_core.Application.Customizations.CHUO;
///
/// Instances are constructed with an used to resolve dependencies required by the implementation.
///
+///
public class CalculatedObservations(IServiceProvider serviceProvider) : ICalculatedObservations
{
private readonly ILogger _logger =
@@ -23,6 +24,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// Asynchronously calculates the active bolus for the specified patient.
///
/// The unique identifier of the patient for whom the active bolus is being calculated.
+ ///
public Task CalculateActiveBolus(ObjectId patientId)
{
return Task.CompletedTask;
@@ -33,6 +35,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The pump observation to map.
/// A containing the provided pump observation.
+ ///
public async Task Map(PumpObservation pumpObservation)
{
return await Task.FromResult(pumpObservation);
@@ -43,6 +46,8 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The list of medicines currently active for the patient.
/// The identifier of the patient for whom the observation is calculated.
+ ///
public Task CalculateMedicineObservation(List activeMedicines, ObjectId patientId)
{
return Task.CompletedTask;
@@ -55,6 +60,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The new patient observation to compare and reconcile against the last stored observation.
/// A task that yields the corrected , or null when no time inconsistency is found.
/// Thrown because the method has not been implemented yet.
+ ///
public Task FixTimeInconsistencyWithLast(PatientObservation newObservation)
{
throw new NotImplementedException();
@@ -66,6 +72,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The unique identifier of the patient whose active treatments are being requested.
/// A task that represents the asynchronous operation. The task result contains a collection of nullable objects representing the patient's active treatments.
/// Thrown to indicate that the method has not yet been implemented.
+ ///
public Task> GetActiveTreatmentsByPatient(ObjectId id)
{
throw new NotImplementedException();
@@ -77,6 +84,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The patient observation to map.
/// Indicates whether mapping should be performed by name only.
/// A task containing the provided observation.
+ ///
public Task Map(T obs, bool onlyByName = false) where T : BasePatientObservation
{
_logger.LogTrace("Mapping {name} observation {obs}", obs.Name, obs);
@@ -91,6 +99,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The patient treatment to be mapped.
/// A task that represents the asynchronous mapping operation, containing the resulting .
/// Thrown when the method is invoked, as the mapping has not been implemented.
+ ///
public Task Map(PatientTreatment treatment)
{
throw new NotImplementedException();
@@ -102,6 +111,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The patient diagnosis to be mapped.
/// A task representing the asynchronous operation, containing the mapped .
/// Thrown because the mapping logic has not yet been implemented.
+ ///
public Task Map(PatientDiagnosis diagnosis)
{
throw new NotImplementedException();
@@ -113,6 +123,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The list of patient observations to be pre-mapped prior to insertion.
/// A completed task containing the provided list of patient observations.
+ ///
public Task> PreMapList(List listToInsert)
{
return Task.FromResult(listToInsert);
@@ -124,6 +135,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The existing patient observation to be returned.
/// The alarm to be associated with the observation (currently not applied).
/// A completed containing the original observation.
+ ///
public Task MapSourceAlarm(PatientObservation obs, PatientObservationAlarm alarmToInsert)
{
return Task.FromResult(obs);
@@ -135,6 +147,8 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The patient observation that triggers the alarm.
/// The name of the alarm to send.
/// The optional alarm code providing additional classification for the alarm.
+ ///
public Task SendAlarm(PatientObservation obs, string name, AlarmEnum.Name? code)
{
return Task.CompletedTask;
diff --git a/adas-core.Application/Customizations/H12O/UCIN/CalculatedObservations.cs b/adas-core.Application/Customizations/H12O/UCIN/CalculatedObservations.cs
index c64f833c..8f3f05c9 100644
--- a/adas-core.Application/Customizations/H12O/UCIN/CalculatedObservations.cs
+++ b/adas-core.Application/Customizations/H12O/UCIN/CalculatedObservations.cs
@@ -17,6 +17,7 @@ namespace adas_core.Application.Customizations.H12O.UCIN;
/// raw observations and active entries, using the catalogue of
/// codes, groups, and types configured in .
///
+///
public class CalculatedObservations : ICalculatedObservations
{
private readonly List _complexityObservations =
@@ -87,6 +88,8 @@ public class CalculatedObservations : ICalculatedObservations
/// ONi, ventilation modes, ECMO, and notes indicating medication) from .
///
/// The application's service provider used to resolve the required dependencies and configuration.
+ ///
public CalculatedObservations(IServiceProvider serviceProvider)
{
_observationService = serviceProvider.GetRequiredService>(); //observationService;
@@ -159,6 +162,8 @@ public class CalculatedObservations : ICalculatedObservations
/// A that resolves to the (possibly transformed) observation, or
/// when the input observation has no name.
///
+ ///
public async Task Map(T obs, bool onlyByName) where T : BasePatientObservation
{
// Early exit: if the observation has no name, there's nothing to map
@@ -244,6 +249,8 @@ public class CalculatedObservations : ICalculatedObservations
/// The to be mapped.
/// A task that represents the asynchronous mapping operation. The task result contains the processed .
/// Thrown when the parameter is null.
+ ///
public async Task Map(PatientTreatment treatment)
{
if (treatment.SingleDose)
@@ -316,6 +323,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The pump observation to map.
/// A task containing the same instance that was passed in.
+ ///
public async Task Map(PumpObservation pumpObservation)
{
return await Task.FromResult(pumpObservation);
@@ -330,6 +338,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The list of active instances currently associated with the patient.
/// The unique identifier of the patient.
/// A task that represents the asynchronous calculation operation.
+ ///
public async Task CalculateMedicineObservation(List activeMedicines, ObjectId patientId)
{
await CalculateMedicineObservation(activeMedicines, [], new PatientTreatment { PatientId = patientId });
@@ -342,6 +351,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The unique identifier of the patient.
/// A task that represents the asynchronous calculation operation.
+ ///
public async Task CalculateActiveBolus(ObjectId patientId)
{
// SIN RXA
@@ -395,6 +405,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The unique identifier of the patient.
/// A collection of active objects for the patient.
+ ///
public async Task> GetActiveTreatmentsByPatient(ObjectId id)
{
var activeTreatments = await _treatmentService.Value.GetActiveTreatmentsByPatient(id);
@@ -409,6 +420,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The to map.
/// A task containing the same instance that was passed in.
+ ///
public Task Map(PatientDiagnosis diagnosis)
{
return Task.FromResult(diagnosis);
@@ -425,6 +437,8 @@ public class CalculatedObservations : ICalculatedObservations
/// A task that represents the asynchronous operation. The task result contains the fixed
/// if the input had a valid name; otherwise, .
///
+ ///
public async Task FixTimeInconsistencyWithLast(PatientObservation newObservation)
{
if (string.IsNullOrEmpty(newObservation.Name))
@@ -460,6 +474,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The list of patient observations to be pre-mapped.
/// A task containing the original list of patient observations.
+ ///
public Task> PreMapList(List listToInsert)
{
return Task.FromResult(listToInsert);
@@ -473,6 +488,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The patient observation that triggered the alarm.
/// The alarm metadata to be inserted alongside the observation.
/// A task containing the same instance that was passed in.
+ ///
public Task MapSourceAlarm(PatientObservation obs, PatientObservationAlarm alarmToInsert)
{
return Task.FromResult(obs);
@@ -487,6 +503,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The optional alarm code from .
/// Never returns a result.
/// Always thrown because alarm dispatch is not implemented in the UCIN customization.
+ ///
public Task SendAlarm(PatientObservation obs, string name, AlarmEnum.Name? code)
{
throw new NotImplementedException();
@@ -501,6 +518,8 @@ public class CalculatedObservations : ICalculatedObservations
/// A task that represents the asynchronous insert operation.
/// Thrown when cannot be cast to .
/// Rethrown after the underlying exception is written to the console for diagnostics.
+ ///
public async Task CheckSurgeryExpired(BasePatientObservation obs)
{
try
@@ -536,6 +555,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation expected to be a .
/// A task that represents the asynchronous operation. The task result contains the (possibly time-shifted) base patient observation.
+ ///
public async Task CheckObsExistsAndIncrementTime(BasePatientObservation obs)
{
var pobs = (PatientObservation)obs;
@@ -559,6 +579,8 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation expected to be a .
/// A task that represents the asynchronous operation. The task result contains the (possibly time-shifted) base patient observation.
+ ///
public async Task CheckObsWithSameTimeExistsAndIncrementTime(BasePatientObservation obs)
{
var pobs = (PatientObservation)obs;
@@ -579,6 +601,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The observation that triggered the calculation (one of AirPressure_Mean, FiO2, or PaO2).
/// A task that represents the asynchronous calculation operation.
+ ///
public async Task CalculateOxygenationIndex(BasePatientObservation obs)
{
var toSearchList = new List();
@@ -655,6 +678,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The single-dose treatment whose end time is to be calculated.
/// The same instance with its EndTime updated.
+ ///
private static PatientTreatment CalculateSingleDoseEndDate(PatientTreatment treatment)
{
/* Deprecated calc finish treatment date on shift end. Now every treatment single dose is last 8 Hours
@@ -690,6 +714,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The treatment whose medicines should be checked.
/// A task that represents the asynchronous check operation.
+ ///
public async Task CheckTreatmentMedicines(PatientTreatment treatment)
{
//sI TIENE UNA NOTA CON NPT SON DE TIPO NUTRICIÓN PARENTERAL Y SUMAN 1
@@ -784,6 +809,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The treatment to inspect for NPT indicators, or .
/// A task that resolves to a instance describing the parenteral nutrition, or an unnamed, untyped instance when no NPT notes are present.
+ ///
private static Task CalculateParentalNutritionMedicine(PatientTreatment? treatment)
{
List medicineType = [];
@@ -818,6 +844,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The medicines to add or remove depending on OrderControl.
/// The treatment that triggered the recalculation.
/// A task that represents the asynchronous calculation operation.
+ ///
public async Task CalculateMedicineObservation(List activeMedicines, List medicines,
PatientTreatment treatment)
{
@@ -876,6 +903,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The list of active medicines used to derive the risk level.
/// The treatment that triggered the recalculation.
/// A task that represents the asynchronous calculation operation.
+ ///
private async Task CalculateErMedication(List activeMedicines, PatientTreatment treatment)
{
//var activeTreatments = treatmentService.Value.GetActiveTreatmentsByPatient(treatment.patientid);
@@ -908,6 +936,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The list of active medicines to evaluate.
/// A task that resolves to the integer risk level (0–5).
+ ///
private static Task CalculateErMedicineLevels(List activeMedicines)
{
var ironVitaminDCodes = new List { "374424002", "175041000140104" };
@@ -964,6 +993,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The respiratory-mode observation expected to be a .
/// A task that represents the asynchronous insert operation.
+ ///
public async Task CalculateVentilationMode(BasePatientObservation obs)
{
var pobs = (PatientObservation)obs;
@@ -998,6 +1028,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation that triggered the calculation (expected to be a ).
/// A task that resolves to the same base patient observation that was passed in.
+ ///
public async Task CalculateAsistResp(BasePatientObservation obs)
{
//Comprobar si hay un resp_type más nuevo y si no lo hay ignorar
@@ -1057,6 +1088,8 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The treatment whose ECMO state is being applied.
/// A task that represents the asynchronous recalculation operation.
+ ///
private async Task CalculateComplexityOnEcmo(PatientTreatment treatment)
{
var ecmoObs = new PatientObservation
@@ -1102,6 +1135,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The base patient observation that triggered the recalculation.
/// When , the supplied is not added to the calculation inputs (useful for synthetic observations like ECMO).
/// A task that resolves to the same base patient observation that was passed in.
+ ///
public async Task CalculateComplexity(BasePatientObservation obs, bool ignoreObs = false)
{
try
@@ -1278,6 +1312,7 @@ public class CalculatedObservations : ICalculatedObservations
/// early because the incoming observation is a duplicate insert (in which case the caller should
/// not overwrite the stored observation).
///
+ ///
public async Task CalculateIntravenousLineObservation(BasePatientObservation obs)
{
try
@@ -1413,6 +1448,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation whose value represents the patient's weight.
/// A task that resolves to the integer complexity contribution (0–7).
+ ///
private async Task CalculateWeight(BasePatientObservation obs)
{
var complexityValueOfWeight = 0;
@@ -1445,6 +1481,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation expected to be a with a numeric value.
/// A task that resolves to the (possibly converted) base patient observation.
+ ///
public Task ParseWeight(BasePatientObservation obs)
{
if (obs is not PatientObservation pobs || !double.TryParse(pobs.Value.ToString(), out var dValue))
@@ -1471,6 +1508,7 @@ public class CalculatedObservations : ICalculatedObservations
/// derived from whichever type is supplied.
///
/// A task that represents the asynchronous calculation operation.
+ ///
public async Task CalculateMonitor(object monitorObservation)
{
var monitorValue = 0;
@@ -1545,6 +1583,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The treatment that triggered the recalculation.
/// A task that represents the asynchronous calculation operation.
+ ///
private async Task CalculateSurgery(PatientTreatment treatment)
{
var surgeryScore = 0;
@@ -1596,6 +1635,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The unique identifier of the patient.
/// The optional new treatment to be included in the active-bolus set.
/// A task that resolves to the list of treatments currently counted as active boluses.
+ ///
private async Task> GetActiveBolus(ObjectId patientId, PatientTreatment? newTreatment)
{
var treatmentsProcessed = new List();
@@ -1660,6 +1700,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The treatment that triggered the recalculation and should be included in the active-bolus set.
/// A task that represents the asynchronous insert operation.
+ ///
private async Task CalculateBolus(PatientTreatment treatment)
{
var activeBolus = await GetActiveBolus(treatment.PatientId, treatment);
@@ -1686,6 +1727,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation that triggered the alert evaluation (TAm, Age_Gestational, or Age_Gestational_Fixed).
/// A task that represents the asynchronous calculation operation.
+ ///
public async Task CalculateTAmAlert(BasePatientObservation obs)
{
var pobs = (PatientObservation)obs;
@@ -1749,6 +1791,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation that triggered the calculation (Temp_Patient or Temp_Incubator).
/// A task that represents the asynchronous calculation operation.
+ ///
public async Task CalculateTempGradient(BasePatientObservation obs)
{
List tempRetrievedesFromBd;
diff --git a/adas-core.Application/Customizations/HGM/CalculatedObservations.cs b/adas-core.Application/Customizations/HGM/CalculatedObservations.cs
index 59a2b41e..ea3c5800 100644
--- a/adas-core.Application/Customizations/HGM/CalculatedObservations.cs
+++ b/adas-core.Application/Customizations/HGM/CalculatedObservations.cs
@@ -14,6 +14,7 @@ namespace adas_core.Application.Customizations.HGM;
///
/// Represents a collection of calculated observations, providing a concrete implementation of the contract.
///
+///
public class CalculatedObservations : ICalculatedObservations
{
private readonly List _highFrequencyVentilation = [];
@@ -51,6 +52,8 @@ public class CalculatedObservations : ICalculatedObservations
/// The patient observation to be mapped.
/// Flag indicating whether the mapping should be restricted to name-based criteria.
/// The mapped patient observation, or the original observation if no applicable mapping is found.
+ ///
public async Task Map(T obs, bool onlyByName = false) where T : BasePatientObservation
{
if (string.IsNullOrEmpty(obs.Name)) return obs;
@@ -72,6 +75,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The instance to be mapped.
/// A task that represents the asynchronous mapping operation, containing the resulting .
/// Thrown to indicate that the method has not yet been implemented.
+ ///
public Task Map(PatientTreatment treatment)
{
throw new NotImplementedException();
@@ -83,6 +87,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The patient diagnosis to be mapped.
/// A task that represents the asynchronous mapping operation, containing the mapped .
/// Thrown when the method is invoked, as the mapping logic has not been implemented yet.
+ ///
public Task Map(PatientDiagnosis diagnosis)
{
throw new NotImplementedException();
@@ -93,6 +98,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The pump observation to map.
/// A completed task containing the provided .
+ ///
public async Task Map(PumpObservation pumpObservation)
{
return await Task.FromResult(pumpObservation);
@@ -104,6 +110,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The unique identifier of the patient for whom the active bolus is calculated.
/// The method is not yet implemented.
+ ///
public Task CalculateActiveBolus(ObjectId patientId)
{
throw new NotImplementedException();
@@ -115,6 +122,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The list of active medicines currently associated with the patient.
/// The unique identifier of the patient for whom the observation is being calculated.
/// The method is not yet implemented.
+ ///
public Task CalculateMedicineObservation(List activeMedicines, ObjectId patientId)
{
throw new NotImplementedException();
@@ -126,6 +134,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The new patient observation to reconcile against the last recorded observation.
/// A task that returns the corrected , or null when no last observation is available to compare against.
/// The method is not yet implemented.
+ ///
public Task FixTimeInconsistencyWithLast(PatientObservation newObservation)
{
throw new NotImplementedException();
@@ -137,6 +146,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The identifier of the patient whose active treatments are being requested.
/// A task that yields a collection of active entries for the patient.
/// Thrown because the method has not been implemented yet.
+ ///
public Task> GetActiveTreatmentsByPatient(ObjectId id)
{
throw new NotImplementedException();
@@ -147,6 +157,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The list of patient observations to be pre-mapped.
/// A completed task containing the provided list of patient observations.
+ ///
public Task> PreMapList(List listToInsert)
{
return Task.FromResult(listToInsert);
@@ -158,6 +169,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The patient observation to return as the mapped result.
/// The patient observation alarm to be considered during mapping.
/// A containing the provided .
+ ///
public Task MapSourceAlarm(PatientObservation obs, PatientObservationAlarm alarmToInsert)
{
return Task.FromResult(obs);
@@ -171,6 +183,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The optional alarm code identifying the alarm type.
/// A task that represents the asynchronous alarm sending operation.
/// Thrown when the method is invoked, as it is not yet implemented.
+ ///
public Task SendAlarm(PatientObservation obs, string name, AlarmEnum.Name? code)
{
throw new NotImplementedException();
@@ -180,6 +193,7 @@ public class CalculatedObservations : ICalculatedObservations
/// Calculates and persists the ventilation mode (Resp_Type) for a patient observation by mapping the observed value against known high-frequency, invasive, and non-invasive ventilation vocabularies, defaulting to None when the value is empty or unrecognized.
///
/// The base patient observation whose value is used to derive the respiration type; it is cast to to access the value.
+ ///
private async Task CalculateVentilationMode(BasePatientObservation obs)
{
var pobs = (PatientObservation)obs;
diff --git a/adas-core.Application/Customizations/HPAZ/CalculatedObservations.cs b/adas-core.Application/Customizations/HPAZ/CalculatedObservations.cs
index acacd293..9be31de1 100644
--- a/adas-core.Application/Customizations/HPAZ/CalculatedObservations.cs
+++ b/adas-core.Application/Customizations/HPAZ/CalculatedObservations.cs
@@ -17,6 +17,7 @@ namespace adas_core.Application.Customizations.HPAZ;
///
/// This class implements the contract, exposing the behavior defined by that interface while relying on constructor-injected services for its operations.
///
+///
public class CalculatedObservations(IServiceProvider serviceProvider) : ICalculatedObservations
{
private readonly Lazy _alarmService = serviceProvider.GetRequiredService>();
@@ -42,6 +43,8 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// Asynchronously calculates the active bolus for the specified patient.
///
/// The unique identifier of the patient whose active bolus is to be calculated.
+ ///
public Task CalculateActiveBolus(ObjectId patientId)
{
return Task.CompletedTask;
@@ -52,6 +55,8 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The list of medicines currently active for the patient.
/// The unique identifier of the patient whose medicine observations are being calculated.
+ ///
public Task CalculateMedicineObservation(List activeMedicines, ObjectId patientId)
{
return Task.CompletedTask;
@@ -63,6 +68,8 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The unique identifier of the patient whose active treatments are being retrieved.
/// A task that represents the asynchronous operation, containing a collection of active records for the patient, or an empty collection if none exist.
+ ///
public Task> GetActiveTreatmentsByPatient(ObjectId id)
{
return Task.FromResult>(new List());
@@ -75,6 +82,10 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// Observation
/// True if the observation needs to generate an alert
/// Mapped observation
+ ///
+ ///
public async Task Map(T source, bool onlyByName) where T : BasePatientObservation
{
_logger.LogDebug("Mapping {obsName} mode observation {obs}", source.Name, source);
@@ -113,6 +124,8 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The source to map.
/// A task that represents the asynchronous mapping operation. The task result contains the mapped .
+ ///
public async Task Map(PumpObservation pumpObservation)
{
try
@@ -212,6 +225,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The to be mapped.
/// A task representing the asynchronous operation, containing the mapped .
/// Thrown in all cases because the method has not yet been implemented.
+ ///
public Task Map(PatientTreatment treatment)
{
throw new NotImplementedException();
@@ -223,6 +237,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The to be mapped.
/// A task that represents the asynchronous operation, containing the mapped .
/// Thrown to indicate that the mapping logic has not been implemented.
+ ///
public Task Map(PatientDiagnosis diagnosis)
{
throw new NotImplementedException();
@@ -234,6 +249,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The new patient observation to validate and potentially adjust for time consistency.
/// The patient observation with its time corrected if a time inconsistency was detected, otherwise the original observation.
+ ///
public async Task FixTimeInconsistencyWithLast(PatientObservation newObservation)
{
if (string.IsNullOrEmpty(newObservation.Name))
@@ -267,6 +283,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The list of patient observations to process for mapping and blue code calculation.
/// The original list of patient observations passed to the method.
+ ///
public Task> PreMapList(List listToMap)
{
var mappedObsList = listToMap
@@ -290,6 +307,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The target instance that will be updated with values from the alarm.
/// The source whose values are applied to .
/// A completed containing the updated .
+ ///
public Task MapSourceAlarm(PatientObservation obs, PatientObservationAlarm alarmToInsert)
{
if (!string.IsNullOrEmpty(alarmToInsert.EventId))
@@ -310,6 +328,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The name of the alarm to be sent.
/// The optional alarm code identifying the type of alarm.
/// Thrown because the method is not yet implemented.
+ ///
Task ICalculatedObservations.SendAlarm(PatientObservation obs, string name, AlarmEnum.Name? code)
{
throw new NotImplementedException();
@@ -323,6 +342,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The name of the alarm.
/// The optional alarm code identifier.
/// The type of alarm to send.
+ ///
private async Task SendAlarm(PatientObservation obs, string name, AlarmEnum.Name? code, AlarmEnum.Type type)
{
await _alarmService.Value.SendAlarm(obs, name, code, AlarmEnum.Severity.None, type);
@@ -334,6 +354,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// Observation
/// True if it needs to be ignored
+ ///
private bool CheckIfObservationIsOlderAndShouldBeIgnored(PatientObservation obs)
{
if (obs.Time.ToUniversalTime().AddMinutes(_apiSettings.IgnoreCalcObservationsOlderInMinutesThan) <
@@ -354,6 +375,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The patient observation whose alarm configuration should be resolved; its Name and PatientId are used to locate the configuration.
/// The same instance with its Alarm property populated from the matching configuration, or null when no configuration is found.
+ ///
private async Task CheckAlarmConfig(PatientObservation pobs)
{
var configObs = await _configObservationService.Get(new PatientObservation
@@ -373,6 +395,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The alarm code used to identify the type of alarm; it is set as the Code and used to compose the Name.
/// The source patient observation whose value, patient identifier, time, and alarm flag are copied into the new alarm observation.
/// A new configured as an ADAS alarm observation based on the provided source.
+ ///
private static PatientObservation CreateAlarmObservation(string name, PatientObservation pobs)
{
return new PatientObservation
@@ -391,6 +414,10 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// Checks if a blue code observation Lists needs to be generated and inserts it.
///
///
+ ///
+ ///
public async Task CalculateBlueCodeList(List? obsList)
{
//Las 3 observaciones vienen siempre juntas en el mismo mensaje
@@ -461,6 +488,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// Sends a Blue Code alarm for the given patient observation. If the observation is null, the method returns without taking any action; otherwise it creates the corresponding alarm observation, validates it against the alarm configuration, persists it, and dispatches the alarm as an automatically triggered Blue alarm.
///
/// The patient observation that triggers the Blue Code alarm; when null, the method short-circuits without processing.
+ ///
private async Task SendBlueCode(PatientObservation? pobs)
{
if (pobs == null)
@@ -486,6 +514,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The base patient observation value whose ventilation mode will be calculated and normalized.
/// The patient observation with the normalized ventilation mode value.
+ ///
private BasePatientObservationValue CalculateVentilationMode(BasePatientObservationValue obs)
{
var value = obs is PatientObservationAlarm oAlarm ? oAlarm.Value
@@ -508,6 +537,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The patient observation to evaluate; non- instances are returned unchanged.
/// The original observation, with its Time adjusted by one second when a matching observation is found.
+ ///
private async Task CheckObsWithSameTimeExistsAndIncrementTime(
BasePatientObservationValue obs)
{
@@ -529,6 +559,8 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The newly received patient observation that triggered the calculation; its Name must be either "FiO2" or "Sattc".
/// The name of the observation, used to determine whether is the FiO2 or the Sattc value.
+ ///
private async Task CalculateSf(BasePatientObservationValue obs, string name)
{
try
@@ -590,6 +622,8 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// calculation if they are not
/// in database then does nothing.
///
+ ///
public async Task CalculateOxygenationIndex(BasePatientObservationValue obs, string name)
{
var toSearchList = new List();
@@ -665,6 +699,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The current patient observation that initiated the calculation; provides the patient identifier and timestamp used for the resulting observation.
/// The name of the observation in , expected to be either FiO2 or PaO2_Tidal, which determines how the counterpart value is resolved.
+ ///
private async Task CalculatePf(BasePatientObservationValue obs, string name)
{
try
@@ -729,6 +764,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The alarm identifier used to build the observation Code and Name.
/// The pump data source providing rack/auxiliary info, drug name, time, and optional patient id.
/// A that yields the resulting observation, or null when the alarm configuration check rejects it.
+ ///
private async Task CreatePumpAlarmObservation(string name,
PumpObservation pumpObservation)
{
diff --git a/adas-core.Application/Customizations/HRYC/CalculatedObservations.cs b/adas-core.Application/Customizations/HRYC/CalculatedObservations.cs
index 2a223921..9aafa59e 100644
--- a/adas-core.Application/Customizations/HRYC/CalculatedObservations.cs
+++ b/adas-core.Application/Customizations/HRYC/CalculatedObservations.cs
@@ -18,6 +18,7 @@ namespace adas_core.Application.Customizations.HRYC;
/// Resp_Type, and Hour_Balance) from incoming raw observations and active configurations loaded from
/// .
///
+///
public class CalculatedObservations : ICalculatedObservations
{
private readonly IOptions _apiSettings;
@@ -42,6 +43,7 @@ public class CalculatedObservations : ICalculatedObservations
/// from .
///
/// The application's service provider used to resolve the required dependencies and configuration.
+ ///
public CalculatedObservations(IServiceProvider serviceProvider)
{
_observationService = serviceProvider.GetRequiredService>(); //observationService;
@@ -86,6 +88,8 @@ public class CalculatedObservations : ICalculatedObservations
/// A that resolves to the (possibly transformed) observation,
/// or when the input observation has no name.
///
+ ///
public async Task Map(T obs, bool onlyByName) where T : BasePatientObservation
{
_logger.LogTrace("Mapping {name} observation {obs}", obs.Name, obs);
@@ -148,6 +152,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The treatment to map.
/// Never returns a result.
/// Always thrown because treatment mapping is not implemented in the HRYC customization.
+ ///
public Task Map(PatientTreatment treatment)
{
throw new NotImplementedException();
@@ -161,6 +166,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The pump observation to map.
/// A task containing the same instance that was passed in.
+ ///
public async Task Map(PumpObservation pumpObservation)
{
return await Task.FromResult(pumpObservation);
@@ -174,6 +180,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The list of active medicines (ignored).
/// The unique identifier of the patient (ignored).
/// A completed task.
+ ///
public Task CalculateMedicineObservation(List activeMedicines, ObjectId patientId)
{
return Task.CompletedTask;
@@ -185,6 +192,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The unique identifier of the patient (ignored).
/// A completed task.
+ ///
public Task CalculateActiveBolus(ObjectId patientId)
{
return Task.CompletedTask;
@@ -196,6 +204,8 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The unique identifier of the patient (ignored).
/// A completed task containing an empty .
+ ///
public Task> GetActiveTreatmentsByPatient(ObjectId id)
{
return Task.FromResult(new List().AsEnumerable());
@@ -207,6 +217,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The to map.
/// A task containing the same instance that was passed in.
+ ///
public Task Map(PatientDiagnosis diagnosis)
{
return Task.FromResult(diagnosis);
@@ -224,6 +235,8 @@ public class CalculatedObservations : ICalculatedObservations
/// A task that resolves to the (possibly time-shifted) .
/// Returns the input unchanged when its Name is null or empty, logging the error.
///
+ ///
public async Task FixTimeInconsistencyWithLast(PatientObservation newObservation)
{
if (string.IsNullOrEmpty(newObservation.Name))
@@ -262,6 +275,7 @@ public class CalculatedObservations : ICalculatedObservations
/// A task that resolves to the resulting list of observations (with Vent_Rate removed
/// when it was inserted synchronously, or the original list otherwise).
///
+ ///
public async Task> PreMapList(List listToInsert)
{
var ventRate = listToInsert.FirstOrDefault(obs => obs.Name == "MDC_VENT_RESP_RATE");
@@ -312,6 +326,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The patient observation that triggered the alarm.
/// The alarm metadata to be inserted alongside the observation.
/// A task containing the same instance that was passed in.
+ ///
public Task MapSourceAlarm(PatientObservation obs, PatientObservationAlarm alarmToInsert)
{
return Task.FromResult(obs);
@@ -327,6 +342,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The optional alarm code from .
/// Never returns a result.
/// Always thrown because this overload is not used in the HRYC customization.
+ ///
public Task SendAlarm(PatientObservation obs, string name, AlarmEnum.Name? code)
{
throw new NotImplementedException();
@@ -339,6 +355,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation that triggered the calculation, expected to be a whose Name is NEWS.
/// A task that represents the asynchronous alarm evaluation.
+ ///
private async Task CalculateNews(BasePatientObservation obs)
{
var pobs = (PatientObservation)obs;
@@ -382,6 +399,8 @@ public class CalculatedObservations : ICalculatedObservations
/// The base patient observation that triggered the alarm (used to derive PatientId and Time).
/// The describing the alarm kind (for example, NewsOff, NewsWarning, NewsAlert).
/// A task that represents the asynchronous alarm dispatch.
+ ///
private async Task SendAlarm(BasePatientObservation obs, AlarmEnum.Name name)
{
var pobs = (PatientObservation)obs;
@@ -444,6 +463,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The beacon colour to apply.
/// The patient whose associated beacon should be updated.
+ ///
private void SendBeaconCode(AlarmEnum.BeaconColor color, Patient patient)
{
if (!patient.PointOfCareId.HasValue)
@@ -478,6 +498,8 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation that triggered the calculation (SpO2, FiO2, or FR).
/// A task that represents the asynchronous calculation operation.
+ ///
private async Task CalculateIrox(BasePatientObservation obs)
{
try
@@ -560,6 +582,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation that triggered the calculation (FR or Vent_Rate).
/// A task that represents the asynchronous insert operation.
+ ///
private async Task CalculateRespRate(BasePatientObservation obs)
{
var pobs = (PatientObservation)obs;
@@ -627,6 +650,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation expected to be a with Name Hydric_Balance.
/// A task that resolves to the (possibly time-shifted) base patient observation.
+ ///
private async Task CalculateHydricBalance(BasePatientObservation obs)
{
var pobs = (PatientObservation)obs;
@@ -650,6 +674,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation expected to be a with Name Hour_Balance.
/// A task that resolves to the (possibly time-shifted) base patient observation.
+ ///
private async Task CalculateHourBalance(BasePatientObservation obs)
{
var pobs = (PatientObservation)obs;
@@ -677,6 +702,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation that triggered the calculation, expected to be a with Name Hydric_Balance.
/// A task that represents the asynchronous insert operation.
+ ///
private async Task CalculateHydricBalanceCalculated(BasePatientObservation obs)
{
//Hydric_Balance_Calculated
@@ -753,6 +779,8 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation that triggered the calculation, expected to be a with Name Resp_Mode.
/// A task that represents the asynchronous insert operation.
+ ///
private async Task CalculateVentilationMode(BasePatientObservation obs)
{
_logger.LogDebug("CalculateVentilationMode {obs}", obs);
@@ -800,6 +828,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation that triggered the calculation, expected to be a with Name Weight_Current.
/// A task that represents the asynchronous insert operation.
+ ///
private async Task CalculateWeight_DiffObservation(BasePatientObservation obs)
{
var toSearchList = new List();
@@ -839,6 +868,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation that triggered the calculation (Diuresis or Weight_Current).
/// A task that represents the asynchronous insert operation.
+ ///
private async Task CalculateDiureis_WeightObservation(BasePatientObservation obs)
{
var toSearchList = new List();
@@ -891,6 +921,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation that triggered the calculation, expected to be a with Name AllergiesObs and a collection-valued Value of .
/// A task that represents the asynchronous insert operation.
+ ///
private async Task CalculateAllergiesObservation(BasePatientObservation obs)
{
try
@@ -967,6 +998,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation that triggered the calculation, expected to be a with Name DrainagesObs and a -typed Value.
/// A task that represents the asynchronous insert operation.
+ ///
private async Task CalculateDrainagesObservation(BasePatientObservation obs)
{
var pobs = (PatientObservation)obs;
@@ -1013,6 +1045,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation that triggered the calculation (PEEP or Pleateu_Pressure).
/// A task that represents the asynchronous insert operation.
+ ///
private async Task CalculateDelta_PressureObservation(BasePatientObservation obs)
{
var toSearchList = new List();
@@ -1071,6 +1104,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation that triggered the calculation, expected to be a with Name Daily_Balance.
/// A task that represents the asynchronous insert operation.
+ ///
private async Task CalculateDaily_BalanceObservation(BasePatientObservation obs)
{
if (obs.Time.ToLocalTime().Hour == 8)
@@ -1098,6 +1132,7 @@ public class CalculatedObservations : ICalculatedObservations
/// when the observation has an Expires value and the current time
/// is past the expiration instant; otherwise, .
///
+ ///
private static bool CheckExpired(PatientObservation obs)
{
if (obs.Expires == null) return false;
diff --git a/adas-core.Application/Customizations/HUVH/UCIA/CalculatedObservations.cs b/adas-core.Application/Customizations/HUVH/UCIA/CalculatedObservations.cs
index 05682e36..3b5d6545 100644
--- a/adas-core.Application/Customizations/HUVH/UCIA/CalculatedObservations.cs
+++ b/adas-core.Application/Customizations/HUVH/UCIA/CalculatedObservations.cs
@@ -15,6 +15,7 @@ namespace adas_core.Application.Customizations.HUVH.UCIA;
/// Represents a concrete implementation of the interface,
/// providing functionality to manage a collection of calculated observations.
///
+///
public class CalculatedObservations : ICalculatedObservations
{
private const string CodingSystem = "ADAS";
@@ -67,6 +68,8 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The identifier of the patient whose active bolus should be calculated.
/// Thrown when the method is invoked, as the calculation logic has not yet been implemented.
+ ///
public Task CalculateActiveBolus(ObjectId patientId)
{
throw new NotImplementedException();
@@ -79,6 +82,8 @@ public class CalculatedObservations : ICalculatedObservations
/// The patient observation to map; may be replaced with the result of the matched asynchronous calculation when applicable.
/// Indicates whether the mapping should be performed using only the observation's name.
/// The processed patient observation, potentially updated by the applicable calculation.
+ ///
public async Task Map(T obs, bool onlyByName = false) where T : BasePatientObservation
{
if (obs.Name is "PSI" or "RASS" or "TS") _ = CalculateOverSedation(obs);
@@ -106,6 +111,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The patient treatment to map and update.
/// The patient treatment with its order control set according to the evaluated business rules.
+ ///
public async Task Map(PatientTreatment treatment)
{
var order = treatment.PlacerOrder?.EntityIdentifier; //aquí almacenamos el número de orden
@@ -130,6 +136,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The pump observation to map.
/// A completed task containing the provided .
+ ///
public async Task Map(PumpObservation pumpObservation)
{
return await Task.FromResult(pumpObservation);
@@ -141,6 +148,8 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The list of currently active medicines assigned to the patient.
/// The unique identifier of the patient whose medication categories will be checked.
+ ///
public Task CalculateMedicineObservation(List activeMedicines, ObjectId patientId)
{
//Esto viene del schedulerService para chequear los medicamentos activos
@@ -154,6 +163,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The unique identifier of the patient whose active treatments should be retrieved.
/// A collection of objects representing the patient's active treatments.
+ ///
public async Task> GetActiveTreatmentsByPatient(ObjectId id)
{
var activeTreatments = await _treatmentService.Value.GetActiveTreatmentsByPatient(id);
@@ -167,6 +177,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The to be mapped.
/// A task that represents the asynchronous mapping operation, containing the resulting .
/// Thrown when the method is invoked, as the mapping logic has not yet been implemented.
+ ///
public Task Map(PatientDiagnosis diagnosis)
{
throw new NotImplementedException();
@@ -179,6 +190,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The new patient observation whose timestamp should be adjusted to avoid time inconsistencies with prior observations.
/// The patient observation, with its Time adjusted when a time collision is detected, or the original observation when its name is null or empty.
+ ///
public async Task FixTimeInconsistencyWithLast(PatientObservation newObservation)
{
if (string.IsNullOrEmpty(newObservation.Name))
@@ -211,6 +223,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The list of patient observations to pre-map before insertion.
/// A completed task containing the provided list of patient observations.
+ ///
public Task> PreMapList(List listToInsert)
{
return Task.FromResult(listToInsert);
@@ -222,6 +235,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The patient observation to be returned as the mapping result.
/// The patient observation alarm intended to be associated with the observation.
/// A task containing the patient observation.
+ ///
public Task MapSourceAlarm(PatientObservation obs, PatientObservationAlarm alarmToInsert)
{
return Task.FromResult(obs);
@@ -235,6 +249,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The optional alarm code categorizing the alarm, or null if no code is specified.
/// A task that represents the asynchronous alarm sending operation.
/// Thrown to indicate that the method has not yet been implemented.
+ ///
public Task SendAlarm(PatientObservation obs, string name, AlarmEnum.Name? code)
{
throw new NotImplementedException();
@@ -246,6 +261,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation to evaluate for the rehabilitation alarm condition.
/// The observation with its status set to Alert when the six previous rehabilitation observations also fall within the 0-2 range; otherwise the observation is returned as-is.
+ ///
private async Task CalculateRehabilitationAlarm(BasePatientObservation obs)
{
//En rojo si el grado es de 0 a 2 incluidos, por más de 7 días
@@ -270,6 +286,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The incoming base patient observation; only instances whose
/// Name is "Diuresis" or "Weight" are processed, otherwise the method returns without changes.
+ ///
private async Task CalculateDiuresis(BasePatientObservation obs)
{
// Calculado como el sumatorio de la Diuresis de las últimas 6h
@@ -350,6 +367,7 @@ public class CalculatedObservations : ICalculatedObservations
/// Calculates the ROX Index by dividing the SpO2/FiO2 ratio by the respiratory rate (FR) and persists the result as a new Rox_Index observation. The method supports both directions of the calculation: when the incoming observation is the SpO2/FiO2 ratio, it retrieves the latest FR, and vice versa. It silently returns if the observation is not a PatientObservation, if the observation name is not recognized, if the required paired observation cannot be found, if its value cannot be parsed, or if the FR value is zero (to avoid division by zero).
///
/// The base patient observation that triggers the ROX index calculation. Only observations named SpO2_FiO2_Ratio or FR are processed; any other type or name is ignored.
+ ///
private async Task CalculateRoxIndex(BasePatientObservation obs)
{
// Cálculo dividiendo el ratio SpO2/FiO2 entre la FR
@@ -402,6 +420,7 @@ public class CalculatedObservations : ICalculatedObservations
/// Calculates the driving pressure for a patient as the difference between Pmeset and PEEP when a new Pmeset or PEEP observation is provided. Looks up the complementary observation to obtain the missing value, then creates and persists a "Driving_Pressure" observation. Returns early if the input is not a PatientObservation, the observation name is neither Pmeset nor PEEP, the complementary observation cannot be found, or its value cannot be parsed as an integer.
///
/// The base patient observation that triggered the calculation; expected to represent a Pmeset or PEEP measurement.
+ ///
private async Task CalculateDrivingPressure(BasePatientObservation obs)
{
//Diferencia entre la Pmeset y la PEEP
@@ -458,6 +477,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The observation that triggered the evaluation; its value must be numeric and it is ignored if is provided (e.g., when invoked from a treatment context).
/// The patient identifier when the evaluation is triggered by a treatment event; when null, it is derived from .
+ ///
private async Task CalculateOverAnalgesia(BasePatientObservation? obs, ObjectId? patientId = null)
{
// Mandar observación 'SOBREANALGESIA'
@@ -537,6 +557,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation to evaluate and potentially transform.
/// A task that yields the observation, with its value normalized to "ECMO" when the original value is one of the recognized ECMO variants.
+ ///
private Task CalculateEcmoLocation(BasePatientObservation obs)
{
//Las opciones pueden ser VV, VA o ECMO.
@@ -564,6 +585,7 @@ public class CalculatedObservations : ICalculatedObservations
/// anything.
///
/// The incoming patient observation whose name drives the ventilation mode calculation.
+ ///
private async Task CalculateVentilationMode(BasePatientObservation obs)
{
//- Si llega valor de PI pero NO COMPL, el tipo de ventilación es VMNI
@@ -619,6 +641,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The triggering patient observation used to evaluate the sedation state. When provided, its name and value drive the initial validation; when null, the method relies on the parameter (typically from a treatment update).
/// Optional identifier of the patient to evaluate. If null, it is derived from ; otherwise, the method performs a full evaluation using the patient's recent observations.
+ ///
private async Task CalculateOverSedation(BasePatientObservation? obs, ObjectId? patientId = null)
{
//Mandar observación 'SOBRESEDACIÓN'
@@ -700,6 +723,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The patient treatment to evaluate; may be null.
/// true if the treatment has a start time and was started more than 24 hours ago; otherwise, false.
+ ///
private static bool ExceedsAnalgesiaThreshold(PatientTreatment? treatment)
{
// Perfusiones de morfina, remifentanilo o fentanilo sostenidas > 24 h
@@ -713,6 +737,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The patient treatment to evaluate, or null.
/// true if the treatment is not null and any requested medication exceeds its defined sedation threshold; otherwise, false.
+ ///
private static bool ExceedsSedationThreshold(PatientTreatment? treatment)
{
return (treatment != null &&
@@ -729,6 +754,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The patient treatment whose patient is used to look up the list of active treatments to evaluate.
/// A task that returns the list of active patient treatments that were not discontinued.
+ ///
private async Task> CheckExpiredPatientTreatments(PatientTreatment treatment)
{
//si el tratamiento ha expirado actualizamos el OrderControl a DC y devolvemos las que siguen activas
@@ -757,6 +783,7 @@ public class CalculatedObservations : ICalculatedObservations
/// further validation.
///
/// The patient treatment whose requested medicines will be checked against the patient's active medicines.
+ ///
private async Task CheckTreatmentMedicines(PatientTreatment treatment)
{
var newMedicines = (await Task.WhenAll(treatment.RequestedGiveCodes
@@ -785,6 +812,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The identifier of the patient whose medication categories are being evaluated and linked to the created observations.
/// The distinct list of medicines to be checked against the predefined category reference lists.
+ ///
private void CheckMedicationCategories(ObjectId patientId, List uniqueMedicines)
{
var medicationCategories = new Dictionary?>
@@ -821,6 +849,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The collection of medications whose names will be stored as the observation values.
/// The identifier of the patient the observation belongs to.
/// The name used to group and look up the previous observation for the same concept.
+ ///
private async Task CreateMedicationMultivalueObservation(IEnumerable medications, ObjectId patientId,
string obsName)
{
diff --git a/adas-core.Application/Customizations/HUVH/UCIN/CalculatedObservations.cs b/adas-core.Application/Customizations/HUVH/UCIN/CalculatedObservations.cs
index 08a7bfc4..d1ecc5f7 100644
--- a/adas-core.Application/Customizations/HUVH/UCIN/CalculatedObservations.cs
+++ b/adas-core.Application/Customizations/HUVH/UCIN/CalculatedObservations.cs
@@ -16,6 +16,7 @@ namespace adas_core.Application.Customizations.HUVH.UCIN;
/// Represents a concrete implementation of the interface,
/// providing a collection of calculated observation data.
///
+///
public class CalculatedObservations : ICalculatedObservations
{
private const string Spo2PreObservationName = "SpO2";
@@ -61,6 +62,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The unique identifier of the patient for whom the active bolus is calculated.
/// Thrown because the method has not been implemented yet.
+ ///
public Task CalculateActiveBolus(ObjectId patientId)
{
throw new NotImplementedException();
@@ -73,6 +75,8 @@ public class CalculatedObservations : ICalculatedObservations
/// The patient observation to be mapped, which may be transformed depending on its name.
/// Indicates whether the mapping should be performed using only the observation name.
/// The mapped patient observation, potentially enriched with computed values, wrapped in a task.
+ ///
public async Task Map(T obs, bool onlyByName = false) where T : BasePatientObservation
{
if (obs.Name is "Intervention_In" or "Intervention_Out") await CalculateInterventionMultiValueObservation(obs);
@@ -105,6 +109,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The patient treatment to map, including its placer order, end time, and medicines.
/// The mapped with its order control type and medicines updated.
+ ///
public async Task Map(PatientTreatment treatment)
{
var order = treatment.PlacerOrder?.EntityIdentifier; //aquí almacenamos el número de orden
@@ -129,6 +134,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The pump observation to map.
/// A completed containing the provided .
+ ///
public async Task Map(PumpObservation pumpObservation)
{
return await Task.FromResult(pumpObservation);
@@ -140,6 +146,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The list of active medicines from which distinct medication names are extracted to build the observation value.
/// The identifier of the patient for whom the medication observation is calculated and stored.
+ ///
public async Task CalculateMedicineObservation(List activeMedicines, ObjectId patientId)
{
var medicineObs = new PatientObservation
@@ -171,6 +178,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The unique of the patient whose active treatments should be fetched.
/// A task that represents the asynchronous operation, containing an of nullable instances for the patient.
+ ///
public async Task> GetActiveTreatmentsByPatient(ObjectId id)
{
var activeTreatments = await _treatmentService.Value.GetActiveTreatmentsByPatient(id);
@@ -184,6 +192,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The source instance to be mapped.
/// A that represents the asynchronous mapping operation, containing the mapped .
/// Thrown when the method is invoked, as the mapping logic has not yet been implemented.
+ ///
public Task Map(PatientDiagnosis diagnosis)
{
throw new NotImplementedException();
@@ -195,6 +204,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The new patient observation whose time may be adjusted to follow the most recent observation for the same patient and measurement.
/// The patient observation with a corrected time if a time conflict was detected, or the original observation if no adjustment was needed or the name was invalid.
+ ///
public async Task FixTimeInconsistencyWithLast(PatientObservation newObservation)
{
if (string.IsNullOrEmpty(newObservation.Name))
@@ -227,6 +237,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The list of patient observations to pre-map.
/// A task that represents the asynchronous operation, containing the provided list of patient observations.
+ ///
public Task> PreMapList(List listToInsert)
{
return Task.FromResult(listToInsert);
@@ -238,6 +249,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The patient observation that the alarm is to be associated with.
/// The alarm intended to be inserted into the observation.
/// A task containing the patient observation, returned as-is.
+ ///
public Task MapSourceAlarm(PatientObservation obs, PatientObservationAlarm alarmToInsert)
{
return Task.FromResult(obs);
@@ -250,6 +262,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The name associated with the alarm.
/// The optional alarm code categorizing the type of alarm to be sent.
/// Thrown because the method has not been implemented.
+ ///
public Task SendAlarm(PatientObservation obs, string name, AlarmEnum.Name? code)
{
throw new NotImplementedException();
@@ -261,6 +274,7 @@ public class CalculatedObservations : ICalculatedObservations
/// Returns without creating a record when the observation is not a or when its name does not match any of the supported scales.
///
/// The source patient observation used to derive the pain scale; only instances of with a supported name (ALPS, NPASS_Sedation, NPASS_Analgesia) are processed.
+ ///
private async Task CalculatePainScale(BasePatientObservation obs)
{
if (obs is not PatientObservation pobs) return;
@@ -314,6 +328,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The base patient observation to process.
/// The original if it is not a ; otherwise, the with its value set to the locally formatted observation time.
+ ///
private static BasePatientObservation CalculateLastDefecationValue(BasePatientObservation obs)
{
if (obs is not PatientObservation pobs) return obs;
@@ -332,6 +347,7 @@ public class CalculatedObservations : ICalculatedObservations
/// Calculates and persists a multi-value observation by appending the current value to the existing list of values for the corresponding "Multivalue" observation. Expirates the previous multi-value observation before inserting the new one.
///
/// The base patient observation used to derive the multi-value observation; it must be a with a non-empty name and a string value.
+ ///
private async Task CalculateMultiValueObservation(BasePatientObservation obs)
{
//El valor de la observación es un array de strings
@@ -388,6 +404,7 @@ public class CalculatedObservations : ICalculatedObservations
/// Calculates and persists a multi-value observation that aggregates the active intervention groups (e.g., devices, routes) for a patient based on incoming "_In" and "_Out" observations. Handles the insertion of new groups (with special duplicate prevention for respiratory devices) and the removal of groups when a corresponding "Out" event is received, expiring the previous multi-value observation and inserting a new one when the resulting set is not empty.
///
/// The base patient observation that triggered the calculation; expected to be a with a non-empty name and a string value representing the intervention group.
+ ///
private async Task CalculateInterventionMultiValueObservation(BasePatientObservation obs)
{
if (obs is not PatientObservation pobs || string.IsNullOrEmpty(obs.Name) ||
@@ -478,6 +495,7 @@ public class CalculatedObservations : ICalculatedObservations
/// Observation text from which the leading token is taken as the candidate intervention code.
/// When the method returns true, contains the resolved intervention's type, name, and group; otherwise null.
/// true if a matching intervention was found; false if the code is not numeric or the lookup yields no result.
+ ///
private bool GetInterventionValue(string valueObs, out (string type, string Name, string Group)? r)
{
var code = valueObs.Split(" ")[0]; //
@@ -506,6 +524,7 @@ public class CalculatedObservations : ICalculatedObservations
/// Calcula la complejidad del paciente en función de las observaciones registradas.
///
/// Observación del paciente que se va a evaluar para recalcular su complejidad.
+ ///
private async Task CalculateComplexity(BasePatientObservation obs)
{
var pobs = obs as PatientObservation;
@@ -575,6 +594,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The name of the multivalue observation to look up and calculate complexity for.
/// An optional pre-loaded observation that overrides the database lookup when supplied.
/// The aggregated complexity value for the observation, or 0 if no observation or values are found.
+ ///
private async Task CalculateMultivalueObservationComplexityValue(ObjectId patientId, string observationName,
PatientObservation? observation = null)
{
@@ -602,6 +622,7 @@ public class CalculatedObservations : ICalculatedObservations
/// The identifier of the patient whose newborn weight complexity is being calculated.
/// An optional patient observation to use instead of the latest stored one; if provided with "kg" units, its value is converted.
/// The calculated newborn weight complexity value, or 0 when no valid value is available.
+ ///
private async Task CalculateWeightNewBornValue(ObjectId patientId, PatientObservation? pobs = null)
{
var result =
@@ -644,6 +665,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The patient observation containing the weight value to parse and convert.
/// The patient observation with the value converted to grams, or the original observation if the value could not be parsed.
+ ///
private PatientObservation ParseWeight(PatientObservation obs)
{
if (!double.TryParse(obs.Value.ToString(), out var dValue))
@@ -664,6 +686,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The incoming patient observation (either a pre or post SpO2 measurement) used to drive the calculation and identify the counterpart observation.
/// A task that represents the asynchronous insert of the derived observations.
+ ///
private async Task CalculateSaturation_DiffObservation(BasePatientObservation obs)
{
var toSearchList = new List();
@@ -726,6 +749,8 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The patient treatment being evaluated, used to locate the existing record by its placer order entity identifier and to persist the updated state.
/// A task that yields the list of active patient treatments for the patient that are not the same placer order as the supplied treatment.
+ ///
private async Task> CheckExpiredPatientTreatments(PatientTreatment treatment)
{
//si el tratamiento ha expirado actualizamos el OrderControl a DC y devolvemos las que siguen activas
@@ -763,6 +788,7 @@ public class CalculatedObservations : ICalculatedObservations
/// medicines remain after filtering.
///
/// The patient treatment whose requested give codes are inspected for medicines, nutrition items, and vasoactive drugs.
+ ///
private async Task CheckTreatmentMedicines(PatientTreatment treatment)
{
var newMedicines = new List();
@@ -825,6 +851,7 @@ public class CalculatedObservations : ICalculatedObservations
///
/// The feeding type value to record; if it contains "parenteral" (case-insensitive), the observation is stored as a parenteral entry.
/// The identifier of the patient to whom the observation belongs.
+ ///
private async Task CreateNutritionObservation(string value, ObjectId patientId)
{
var nutritionObs = new PatientObservation
diff --git a/adas-core.Application/Customizations/NursePlan/CalculatedObservations.cs b/adas-core.Application/Customizations/NursePlan/CalculatedObservations.cs
index eae9f0ce..df245c4f 100644
--- a/adas-core.Application/Customizations/NursePlan/CalculatedObservations.cs
+++ b/adas-core.Application/Customizations/NursePlan/CalculatedObservations.cs
@@ -10,6 +10,7 @@ namespace adas_core.Application.Customizations.NursePlan;
///
/// Provides calculated observations by leveraging services obtained from the injected service provider.
///
+///
public class CalculatedObservations(IServiceProvider serviceProvider) : ICalculatedObservations
{
private readonly Lazy _observationService =
@@ -20,6 +21,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The unique identifier of the patient whose active bolus is to be calculated.
/// Thrown when the method is invoked, as the calculation logic has not yet been implemented.
+ ///
public Task CalculateActiveBolus(ObjectId patientId)
{
throw new NotImplementedException();
@@ -30,6 +32,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The PumpObservation to be mapped.
/// A task containing the mapped PumpObservation.
+ ///
public async Task Map(PumpObservation pumpObservation)
{
return await Task.FromResult(pumpObservation);
@@ -42,6 +45,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The collection of medicines currently active for the patient.
/// The identifier of the patient whose medicine observation is being calculated.
/// The method is not yet implemented.
+ ///
public Task CalculateMedicineObservation(List activeMedicines, ObjectId patientId)
{
throw new NotImplementedException();
@@ -53,6 +57,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The new patient observation whose timestamps may need to be reconciled with the last recorded observation.
/// A task that represents the asynchronous operation. The task result contains the fixed , or null when no time inconsistency is detected.
/// Thrown because the method has not been implemented yet.
+ ///
public Task FixTimeInconsistencyWithLast(PatientObservation newObservation)
{
throw new NotImplementedException();
@@ -64,6 +69,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The unique identifier of the patient whose active treatments are being queried.
/// A task representing the asynchronous operation, containing a collection of active PatientTreatment entries, which may include null values, for the specified patient.
/// The method has not yet been implemented.
+ ///
public Task> GetActiveTreatmentsByPatient(ObjectId id)
{
throw new NotImplementedException();
@@ -75,6 +81,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The patient observation to return.
/// Reserved flag that is not used in the current implementation.
/// A completed task containing the provided observation.
+ ///
public Task Map(T obs, bool onlyByName = false) where T : BasePatientObservation
{
return Task.FromResult(obs)!;
@@ -85,6 +92,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The patient treatment to map.
/// A task containing the mapped patient treatment.
+ ///
public Task Map(PatientTreatment treatment)
{
return Task.FromResult(treatment);
@@ -95,6 +103,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The patient diagnosis to be returned as a completed task result.
/// A completed containing the provided diagnosis.
+ ///
public Task Map(PatientDiagnosis diagnosis)
{
return Task.FromResult(diagnosis);
@@ -107,6 +116,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The patient observation to return.
/// The patient observation alarm; not used in the current implementation.
/// A completed task containing the original .
+ ///
public Task MapSourceAlarm(PatientObservation obs, PatientObservationAlarm alarmToInsert)
{
return Task.FromResult(obs);
@@ -118,6 +128,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// The patient observation that triggers the alarm.
/// The name associated with the alarm.
/// The optional alarm code identifying the alarm type.
+ ///
public Task SendAlarm(PatientObservation obs, string name, AlarmEnum.Name? code)
{
return Task.CompletedTask;
@@ -128,6 +139,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
///
/// The list of patient observations to be pre-mapped.
/// A completed containing the original list of patient observations.
+ ///
public Task> PreMapList(List listToInsert)
{
return Task.FromResult(listToInsert);
diff --git a/adas-core.Application/Exceptions/APIRequestException.cs b/adas-core.Application/Exceptions/APIRequestException.cs
index cb73352d..745814be 100644
--- a/adas-core.Application/Exceptions/APIRequestException.cs
+++ b/adas-core.Application/Exceptions/APIRequestException.cs
@@ -4,4 +4,5 @@
/// Represents errors that occur during API request processing, wrapping a descriptive message.
///
/// The message that describes the error.
+///
public class ApiRequestException(string message) : Exception($"Api request exception: {message}");
\ No newline at end of file
diff --git a/adas-core.Application/Exceptions/BadRequestException.cs b/adas-core.Application/Exceptions/BadRequestException.cs
index 6142a5a2..fb2bd1d6 100644
--- a/adas-core.Application/Exceptions/BadRequestException.cs
+++ b/adas-core.Application/Exceptions/BadRequestException.cs
@@ -6,12 +6,14 @@ namespace adas_core.Application.Exceptions;
/// Represents an exception that is thrown when a bad or invalid request is received.
/// It serves as a specialized error type derived from the base class for signaling client-side request failures.
///
+///
public class BadRequestException : Exception
{
///
/// Initializes a new instance of the class with a specified error message.
///
/// The error message defined in that describes the reason for the exception.
+ ///
public BadRequestException(HttpEnum.ErrorMessage message) : base(((int)message).ToString())
{
}
@@ -20,6 +22,7 @@ public class BadRequestException : Exception
/// Initializes a new instance of the class with a specified error message.
///
/// The error message that describes the reason for the exception.
+ ///
public BadRequestException(string message) : base(message)
{
}
diff --git a/adas-core.Application/Exceptions/ConflictException.cs b/adas-core.Application/Exceptions/ConflictException.cs
index 0ca24e73..9228f7cf 100644
--- a/adas-core.Application/Exceptions/ConflictException.cs
+++ b/adas-core.Application/Exceptions/ConflictException.cs
@@ -5,12 +5,14 @@ namespace adas_core.Application.Exceptions;
///
/// Represents an exception that is thrown when a conflict is encountered, such as a resource state mismatch or a duplicate entry.
///
+///
public class ConflictException : Exception
{
///
/// Initializes a new instance of the class with a specified error message.
///
/// The error message that describes the conflict.
+ ///
public ConflictException(HttpEnum.ErrorMessage message) : base(((int)message).ToString())
{
}
@@ -19,6 +21,7 @@ public class ConflictException : Exception
/// Initializes a new instance of the class with a specified error message.
///
/// The message that describes the error.
+ ///
public ConflictException(string message) : base(message)
{
}
diff --git a/adas-core.Application/Exceptions/CustomArgumentException.cs b/adas-core.Application/Exceptions/CustomArgumentException.cs
index 874d2088..74fbafac 100644
--- a/adas-core.Application/Exceptions/CustomArgumentException.cs
+++ b/adas-core.Application/Exceptions/CustomArgumentException.cs
@@ -8,12 +8,14 @@ namespace adas_core.Application.Exceptions;
///
/// This exception extends the base class to provide a domain-specific error type for argument validation failures.
///
+///
public class CustomArgumentException : Exception
{
///
/// Initializes a new instance of the class with the specified error message.
///
/// The error message from the enumeration.
+ ///
public CustomArgumentException(HttpEnum.ErrorMessage message) : base(((int)message).ToString())
{
}
@@ -22,6 +24,7 @@ public class CustomArgumentException : Exception
/// Initializes a new instance of the class with a specified error message.
///
/// The error message that describes the reason for the exception.
+ ///
public CustomArgumentException(string message) : base(message)
{
}
diff --git a/adas-core.Application/Exceptions/ForbbidenException.cs b/adas-core.Application/Exceptions/ForbbidenException.cs
index d27d1cdb..85953e58 100644
--- a/adas-core.Application/Exceptions/ForbbidenException.cs
+++ b/adas-core.Application/Exceptions/ForbbidenException.cs
@@ -8,12 +8,14 @@ namespace adas_core.Application.Exceptions;
///
/// This exception is intended to signal that a requested action violates access rules or restrictions, allowing callers to handle forbidden scenarios distinctly from other error conditions.
///
+///
public class ForbbidenException : Exception
{
///
/// Initializes a new instance of the class with a specified error message from the enumeration.
///
/// The enumeration value whose integer representation is used as the exception message.
+ ///
public ForbbidenException(HttpEnum.ErrorMessage message) : base(((int)message).ToString())
{
}
@@ -22,6 +24,7 @@ public class ForbbidenException : Exception
/// Initializes a new instance of the class with a specified error message.
///
/// The message that describes the error.
+ ///
public ForbbidenException(string message) : base(message)
{
}
diff --git a/adas-core.Application/Exceptions/InvalidFormatException.cs b/adas-core.Application/Exceptions/InvalidFormatException.cs
index 2896a24c..56965c83 100644
--- a/adas-core.Application/Exceptions/InvalidFormatException.cs
+++ b/adas-core.Application/Exceptions/InvalidFormatException.cs
@@ -5,12 +5,15 @@ namespace adas_core.Application.Exceptions;
///
/// Represents the exception that is thrown when data is encountered in a format that is not valid or expected.
///
+///
public class InvalidFormatException : Exception
{
///
/// Initializes a new instance of the class with a specified error message.
///
/// The error message that describes the reason for the exception.
+ ///
public InvalidFormatException(HttpEnum.ErrorMessage message) : base(((int)message).ToString())
{
}
@@ -19,6 +22,7 @@ public class InvalidFormatException : Exception
/// Initializes a new instance of the class with a specified error message.
///
/// The error message that describes the reason for the exception.
+ ///
public InvalidFormatException(string message) : base(message)
{
}
diff --git a/adas-core.Application/Exceptions/NotFoundException.cs b/adas-core.Application/Exceptions/NotFoundException.cs
index 6fe77ef3..5cae3504 100644
--- a/adas-core.Application/Exceptions/NotFoundException.cs
+++ b/adas-core.Application/Exceptions/NotFoundException.cs
@@ -5,11 +5,13 @@ namespace adas_core.Application.Exceptions;
///
/// Represents an exception that is thrown when a requested resource or item cannot be found.
///
+///
public class NotFoundException : Exception
{
///
/// Initializes a new instance of the class.
///
+ ///
public NotFoundException()
{
}
@@ -18,6 +20,7 @@ public class NotFoundException : Exception
/// Initializes a new instance of the class with a specified error message.
///
/// The message that describes the error.
+ ///
public NotFoundException(HttpEnum.ErrorMessage message) : base(((int)message).ToString())
{
}
@@ -26,6 +29,7 @@ public class NotFoundException : Exception
/// Initializes a new instance of the class with a specified error message.
///
/// The message that describes the error.
+ ///
public NotFoundException(string message) : base(message)
{
}
diff --git a/adas-core.Application/Exceptions/TokenException.cs b/adas-core.Application/Exceptions/TokenException.cs
index 508c7925..467b09c3 100644
--- a/adas-core.Application/Exceptions/TokenException.cs
+++ b/adas-core.Application/Exceptions/TokenException.cs
@@ -4,4 +4,5 @@
/// Represents an exception that is thrown when a token-related error occurs.
///
/// The message that describes the error.
+///
public class TokenException(string message) : Exception(message);
\ No newline at end of file
diff --git a/adas-core.Application/Exceptions/UnauthorizedException.cs b/adas-core.Application/Exceptions/UnauthorizedException.cs
index 4dbbfeb0..96a39d83 100644
--- a/adas-core.Application/Exceptions/UnauthorizedException.cs
+++ b/adas-core.Application/Exceptions/UnauthorizedException.cs
@@ -5,12 +5,14 @@ namespace adas_core.Application.Exceptions;
///
/// Exception thrown when a user lacks authorization to perform an operation.
///
+///
public class UnauthorizedException : Exception
{
///
/// Initializes a new instance of the class.
///
/// The error message associated with the exception.
+ ///
public UnauthorizedException(HttpEnum.ErrorMessage message) : base(((int)message).ToString())
{
}
@@ -19,6 +21,7 @@ public class UnauthorizedException : Exception
/// Initializes a new instance of the class.
///
/// The message that describes the error.
+ ///
public UnauthorizedException(string message) : base(message)
{
}
diff --git a/adas-core.Application/Exceptions/UnprocessableEntityException.cs b/adas-core.Application/Exceptions/UnprocessableEntityException.cs
index 7cdefa2e..f8a87eba 100644
--- a/adas-core.Application/Exceptions/UnprocessableEntityException.cs
+++ b/adas-core.Application/Exceptions/UnprocessableEntityException.cs
@@ -8,12 +8,14 @@ namespace adas_core.Application.Exceptions;
///
/// This exception is typically used to signal that a request or entity was understood but could not be processed, similar to the semantics of an HTTP 422 (Unprocessable Entity) response.
///
+///
public class UnprocessableEntityException : Exception
{
///
/// Initializes a new instance of the class with a specified error message enum.
///
/// The error message enum containing the error code.
+ ///
public UnprocessableEntityException(HttpEnum.ErrorMessage message) : base(((int)message).ToString())
{
}
@@ -22,6 +24,7 @@ public class UnprocessableEntityException : Exception
/// Initializes a new instance of the class with a specified error message.
///
/// The message that describes the error.
+ ///
public UnprocessableEntityException(string message) : base(message)
{
}
diff --git a/adas-core.Application/Providers/AdasProvider.cs b/adas-core.Application/Providers/AdasProvider.cs
index 05b38503..c5a5c712 100644
--- a/adas-core.Application/Providers/AdasProvider.cs
+++ b/adas-core.Application/Providers/AdasProvider.cs
@@ -29,6 +29,7 @@ public class AdasProvider(IOptions providerSettings, IHttpCli
///
/// The patient for whom observations are being calculated.
/// A task that represents the asynchronous operation, returning a list of patient observations.
+ ///
public override async Task> GetObservations(Patient patient)
{
var calculatedObservations = new List();
@@ -88,6 +89,7 @@ public class AdasProvider(IOptions providerSettings, IHttpCli
///
/// The list of ADAS medication prediction results to be serialized. Only the first five entries are included.
/// A string containing the selected medication prediction entries joined by the "^" delimiter.
+ ///
private static string ParseAdasMedicationsToMedicationObservation(
List medicationPredict)
{
@@ -100,6 +102,7 @@ public class AdasProvider(IOptions providerSettings, IHttpCli
///
/// The unique identifier of the patient whose ADAS stay prediction is being requested.
/// A task containing the deserialized result on success, or null if the patient number is null, the response is unsuccessful, or the call throws.
+ ///
private async Task GetPredictOfStay(string? patientNumber)
{
if (patientNumber == null)
@@ -140,6 +143,7 @@ public class AdasProvider(IOptions providerSettings, IHttpCli
///
/// The unique identifier of the patient whose ADAS medication predictions are being retrieved.
/// A task containing a list of with the predicted medication data, or null if the request fails or the patient number is null.
+ ///
private async Task?> GetPredictMedications(string? patientNumber)
{
if (patientNumber == null)
@@ -176,6 +180,7 @@ public class AdasProvider(IOptions providerSettings, IHttpCli
/// Creates a new instance and configures it with the configured base address URL.
///
/// An with its set to the configured Url.
+ ///
private HttpClient GetClient()
{
var client = HttpClientFactory.CreateClient();
diff --git a/adas-core.Application/Providers/BaseProvider.cs b/adas-core.Application/Providers/BaseProvider.cs
index b11ae8c8..19a4e195 100644
--- a/adas-core.Application/Providers/BaseProvider.cs
+++ b/adas-core.Application/Providers/BaseProvider.cs
@@ -21,5 +21,6 @@ public abstract class BaseProvider(
///
/// The patient whose observations are being requested.
/// A task that represents the asynchronous operation, containing a list of entries for the patient.
+ ///
public abstract Task> GetObservations(Patient patient);
}
\ No newline at end of file
diff --git a/adas-core.Application/Repositories/Interfaces/IAdmissionRepository.cs b/adas-core.Application/Repositories/Interfaces/IAdmissionRepository.cs
index 06d21b4b..28213a24 100644
--- a/adas-core.Application/Repositories/Interfaces/IAdmissionRepository.cs
+++ b/adas-core.Application/Repositories/Interfaces/IAdmissionRepository.cs
@@ -12,12 +12,14 @@ public interface IAdmissionRepository : IMongoRepository
/// Deletes the entity identified by the specified identifier.
///
/// The unique identifier of the entity to delete.
+ ///
Task Delete(ObjectId id);
///
/// Updates the specified admission record asynchronously.
///
/// The admission entity containing the updated information.
+ ///
Task Update(Admission admission);
///
@@ -25,6 +27,7 @@ public interface IAdmissionRepository : IMongoRepository
///
/// The unique identifier of the entity whose location is to be updated.
/// The identifier of the new location to assign to the entity.
+ ///
Task UpdateLocation(ObjectId id, ObjectId newLocation);
///
@@ -32,12 +35,14 @@ public interface IAdmissionRepository : IMongoRepository
///
/// The unique identifier of the patient to update.
/// The patient object containing the updated information to apply.
+ ///
Task UpdatePatient(ObjectId id, Person patient);
///
/// Asynchronously retrieves all admission records.
///
/// A task that represents the asynchronous operation. The task result contains an with all available admissions.
+ ///
Task> FindAll();
///
@@ -45,6 +50,7 @@ public interface IAdmissionRepository : IMongoRepository
///
/// The of the to look up.
/// A task that represents the asynchronous operation. The task result contains the matching , or null if no admission exists with the specified identifier.
+ ///
Task FindById(ObjectId id);
///
@@ -52,6 +58,7 @@ public interface IAdmissionRepository : IMongoRepository
///
/// The NHC (clinical history number) used to look up the admission.
/// A task that resolves to the matching , or null if no admission is found for the given NHC.
+ ///
Task FindByNhc(string nhc);
//Task?> FindByUnit(string unit);
@@ -61,6 +68,7 @@ public interface IAdmissionRepository : IMongoRepository
///
/// The patient location used to filter and find the relevant admissions.
/// A task that represents the asynchronous operation, containing a list of admissions matching the given location.
+ ///
Task> FindByLocation(PatientLocation location);
///
@@ -68,12 +76,14 @@ public interface IAdmissionRepository : IMongoRepository
///
/// The origin value used to filter the admissions.
/// A task that represents the asynchronous operation, containing a collection of matching admissions, or null if no admissions are found for the given origin.
+ ///
Task?> FindByOrigin(string origin);
///
/// Asynchronously inserts a new record into the data store and returns the resulting entity.
///
/// The entity to be inserted.
/// A task that represents the asynchronous insert operation, containing the inserted , or null if no result is returned.
+ ///
Task InsertOneAsyncAndReturn(Admission origin);
///
/// Searches for an admission matching the specified patient number and unit, returning a distinct result.
@@ -81,30 +91,35 @@ public interface IAdmissionRepository : IMongoRepository
/// The patient's identifier used to locate the admission.
/// The unique identifier of the unit to filter the search.
/// A if a matching record is found; otherwise, null.
+ ///
Task SearchByPatientNumberAndDistinctUnit(string patientNumber, ObjectId unitId);
///
/// Asynchronously retrieves a list of admissions associated with the specified unit, excluding Point of Care (PoC) entries.
///
/// The unique identifier of the unit whose admissions are being retrieved.
/// A task that represents the asynchronous operation, containing a list of records linked to the given unit, with PoC entries excluded.
+ ///
Task> GetAdmissionByUnitIdWithOutPoC(ObjectId unitId);
///
/// Retrieves a list of admissions associated with the specified point of care identifier.
///
/// The unique identifier of the point of care used to filter the admissions.
/// A task that represents the asynchronous operation, containing the list of admissions matching the specified point of care identifier.
+ ///
Task> FindByPointOfCareId(ObjectId pocId);
///
/// Asynchronously retrieves a list of admissions associated with the specified unit identifiers.
///
/// The list of unit identifiers used to look up the corresponding admissions.
/// A task that represents the asynchronous operation, containing the list of admissions matching the provided unit identifiers.
+ ///
Task> FindByUnitIds(List unitIds);
///
/// Asynchronously counts the number of records associated with the specified unit identifier.
///
/// The identifier of the unit used to filter the records.
/// A task that represents the asynchronous operation. The task result contains the count of matching records.
+ ///
Task CountByUnitId(ObjectId unitId);
///
@@ -114,6 +129,7 @@ public interface IAdmissionRepository : IMongoRepository
/// The data transfer object containing the new master list option values to apply.
/// The name of the option type to be updated.
/// A task that represents the asynchronous operation, containing the collection of admissions affected by the update.
+ ///
Task> UpdateMasterListOption(List unitIds, UpdateOptionMasterListDto opt,
string typeName);
@@ -124,11 +140,13 @@ public interface IAdmissionRepository : IMongoRepository
/// The option to be removed from the master list.
/// The name of the type associated with the master list option.
/// A task that represents the asynchronous operation, containing the collection of records affected by the deletion.
+ ///
Task> DeleteMasterListOption(List unitIds, OptionList opt, string typeName);
///
/// Asynchronously deletes admissions associated with the specified unit identifier.
///
/// The identifier of the unit whose admissions will be deleted.
/// A task that represents the asynchronous operation, containing a value indicating the result of the deletion.
+ ///
Task DeleteAdmissionsByUnitId(ObjectId unitId);
}
\ No newline at end of file
diff --git a/adas-core.Application/Repositories/Interfaces/IAlarmRepository.cs b/adas-core.Application/Repositories/Interfaces/IAlarmRepository.cs
index d73bd766..b1790a79 100644
--- a/adas-core.Application/Repositories/Interfaces/IAlarmRepository.cs
+++ b/adas-core.Application/Repositories/Interfaces/IAlarmRepository.cs
@@ -13,6 +13,7 @@ public interface IAlarmRepository : IMongoRepository
/// The unique identifier of the patient whose last observations should be aggregated.
/// An optional list of fields used to restrict which observation types are included in the aggregation; when null, all available observations are considered.
/// A task that resolves to the list of aggregated entries representing the patient's latest observations.
+ ///
Task> AggregatedPatientLastObservationsByField(ObjectId patientId,
List? filterObservations = null);
@@ -23,6 +24,7 @@ public interface IAlarmRepository : IMongoRepository
/// An optional list of fields used to restrict which observations are considered. If null, no field-based filtering is applied.
/// The list of configuration observation definitions used to build and aggregate the resulting alarms.
/// A task that represents the asynchronous operation, containing a list of aggregated entries for the patient.
+ ///
Task> AggregatedPatientNotExpiredObservationsByField(ObjectId patientId,
List? filterObservations, List configAlarm);
}
\ No newline at end of file
diff --git a/adas-core.Application/Repositories/Interfaces/IAppointmentArchiveRepository.cs b/adas-core.Application/Repositories/Interfaces/IAppointmentArchiveRepository.cs
index 22cc6be8..7631c986 100644
--- a/adas-core.Application/Repositories/Interfaces/IAppointmentArchiveRepository.cs
+++ b/adas-core.Application/Repositories/Interfaces/IAppointmentArchiveRepository.cs
@@ -8,16 +8,19 @@ public interface IAppointmentArchiveRepository
/// Asynchronously inserts a single patient appointment into the underlying data store.
///
/// The patient appointment entity to be persisted.
+ ///
Task InsertOneAsync(PatientAppointment patientAppointment);
///
/// Asynchronously deletes records that have a date earlier than the specified cutoff date.
///
/// The cutoff date; records dated before this value will be removed.
+ ///
Task DeleteBeforeDate(DateTime date);
///
/// Inserts a batch of patient appointments asynchronously, typically as part of a bulk import or synchronization process.
///
/// The collection of patient appointments to be inserted.
/// A task that represents the asynchronous insert operation, containing a long value that represents the result of the batch insertion.
+ ///
Task InsertBatch(IEnumerable appointment);
}
\ No newline at end of file
diff --git a/adas-core.Application/Repositories/Interfaces/IAppointmentRepository.cs b/adas-core.Application/Repositories/Interfaces/IAppointmentRepository.cs
index 226dd1ed..c035f932 100644
--- a/adas-core.Application/Repositories/Interfaces/IAppointmentRepository.cs
+++ b/adas-core.Application/Repositories/Interfaces/IAppointmentRepository.cs
@@ -12,17 +12,20 @@ public interface IAppointmentRepository : IMongoRepository
///
/// The unique identifier of the patient whose appointments are being retrieved.
/// A task that represents the asynchronous operation, containing a list of objects for the specified patient.
+ ///
Task> GetByPatient(ObjectId patientId);
///
/// Asynchronously inserts a single patient appointment record into the data store.
///
/// The patient appointment entity to be inserted.
+ ///
new Task InsertOneAsync(PatientAppointment appointment);
///
/// Updates an existing patient appointment asynchronously.
///
/// The patient appointment containing the updated information.
+ ///
Task Update(PatientAppointment appointment);
///
/// Updates the field identified by across many records, replacing the existing value with the new value .
@@ -30,22 +33,26 @@ public interface IAppointmentRepository : IMongoRepository
/// The name of the field that contains the to update.
/// The new value to assign to matching records.
/// The current value to be replaced.
+ ///
Task UpdateManyObjectId(string nameId, ObjectId id, ObjectId oldId);
///
/// Asynchronously deletes the entity identified by the specified identifier.
///
/// The ObjectId of the entity to delete.
+ ///
new Task DeleteAsync(ObjectId id);
///
/// Asynchronously retrieves a cursor of records associated with the specified patient identifier.
///
/// The unique of the patient whose appointments are being queried.
/// A that yields the matching patient appointments; the cursor may be empty if no appointments are found for the given patient.
+ ///
Task> FindByPatientIdAsync(ObjectId patientId);
///
/// Asynchronously deletes records associated with the specified patient identifier.
///
/// The unique ObjectId of the patient whose related records should be removed.
+ ///
Task DeleteByPatientId(ObjectId patientId);
///
/// Asynchronously retrieves a matching the specified patient identifier and visit number.
@@ -53,6 +60,7 @@ public interface IAppointmentRepository : IMongoRepository
/// The unique identifier of the patient whose appointment should be located.
/// The visit number used to identify the specific appointment for the patient.
/// A task that represents the asynchronous operation. The task result contains the matching if found; otherwise, null.
+ ///
Task FindByPatientAndVisitNumber(ObjectId patientId, string visitNumber);
///
/// Asynchronously retrieves a patient appointment matching the specified patient identifier and appointment reason.
@@ -61,17 +69,20 @@ public interface IAppointmentRepository : IMongoRepository
/// The unique identifier of the patient whose appointment should be located.
/// The appointment reason used to filter the lookup, or null to match any reason.
/// A that resolves to the matching , or null if none exists.
+ ///
Task FindByPatientAndReason(ObjectId patientId, string? appointmentReason);
///
/// Retrieves a list of patient appointments associated with the specified location.
///
/// The patient location used to filter and retrieve matching appointments.
/// A task that represents the asynchronous operation, containing a list of entries for the given location.
+ ///
Task> FindByLocation(PatientLocation location);
///
/// Asynchronously retrieves the list of patient appointments associated with the specified point of care.
///
/// The point of care used to filter the patient appointments.
/// A task that represents the asynchronous operation. The task result contains a list of patient appointments for the given point of care.
+ ///
Task> FindByPoC(PointOfCare poc);
}
\ No newline at end of file
diff --git a/adas-core.Application/Repositories/Interfaces/IArchivePatientCarePlanRepository.cs b/adas-core.Application/Repositories/Interfaces/IArchivePatientCarePlanRepository.cs
index 1bad7c2c..b88bf1de 100644
--- a/adas-core.Application/Repositories/Interfaces/IArchivePatientCarePlanRepository.cs
+++ b/adas-core.Application/Repositories/Interfaces/IArchivePatientCarePlanRepository.cs
@@ -10,23 +10,27 @@ public interface IArchivePatientCarePlanRepository : IMongoRepository
/// The unique identifier of the patient whose care plans should be retrieved.
/// A task that returns a list of objects for the given patient, or null when no care plans are found.
+ ///
Task?> FindByPatientId(ObjectId patientId);
///
/// Retrieves the list of patient care plans associated with the specified patient identifier.
///
/// The unique identifier of the patient whose care plans are being queried.
/// A task that represents the asynchronous operation. The task result contains a list of for the given patient, or null if no care plans are found.
+ ///
Task?> FindByPatientId(string patientId);
///
/// Asynchronously retrieves the list of care plans associated with the specified patient number, returning null when no matching care plans are found.
///
/// The patient number used to look up the associated care plans.
/// A task representing the asynchronous operation, containing a list of entries for the patient, or null if none exist.
+ ///
Task?> FindByPatientNumber(string patientId);
///
/// Asynchronously retrieves all patient care plans from the data store.
///
/// A task that represents the asynchronous operation, containing a list of all entries.
+ ///
Task> FindAll();
///
@@ -36,6 +40,7 @@ public interface IArchivePatientCarePlanRepository : IMongoRepositoryAn optional legacy patient ID string used as an additional lookup criterion.
/// An optional legacy patient number string used as an additional lookup criterion.
/// A containing a nullable list of records, or null if no matching care plans are found.
+ ///
Task?> FindByIds(ObjectId oldPatientId, string? oldPatientPatientId,
string? oldPatientPatientNumber);
@@ -43,5 +48,6 @@ public interface IArchivePatientCarePlanRepository : IMongoRepository
/// The list of records to be inserted.
+ ///
Task InsertManyAsync(List patientCarePla);
}
\ No newline at end of file
diff --git a/adas-core.Application/Repositories/Interfaces/IAuthorityRepository.cs b/adas-core.Application/Repositories/Interfaces/IAuthorityRepository.cs
index 90b7cf3e..82b5511a 100644
--- a/adas-core.Application/Repositories/Interfaces/IAuthorityRepository.cs
+++ b/adas-core.Application/Repositories/Interfaces/IAuthorityRepository.cs
@@ -10,46 +10,54 @@ public interface IAuthorityRepository : IMongoRepository
///
/// The unique identifier of the authorization to retrieve.
/// A task that represents the asynchronous operation, containing the that matches the specified identifier.
+ ///
public Task GetById(ObjectId authId);
///
/// Creates a new authority assignment for the specified user with the given role name.
///
/// The name of the role to assign as the new authority.
/// The identifier of the user to whom the authority will be assigned.
+ ///
void CreateNewAuthority(string roleName, ObjectId userId);
///
/// Retrieves the list of authorizations (authorities/permissions) associated with the specified user.
///
/// The unique identifier of the user whose authorities are being requested.
/// A task that represents the asynchronous operation. The task result contains the list of entries assigned to the user.
+ ///
public Task> GetUserAuthorities(ObjectId userId);
///
/// Asynchronously retrieves all available authorizations.
///
/// A task that represents the asynchronous operation. The task result contains a list of all objects.
+ ///
public Task> GetAllAuthorities();
///
/// Asynchronously deletes all authorities associated with the specified user.
///
/// The unique identifier of the user whose authorities will be removed.
/// A task that represents the asynchronous operation. The task result is true if authorities were deleted; otherwise, false.
+ ///
public Task DeleteAllAuthoritiesByUser(ObjectId userId);
///
/// Deletes all authorities associated with the specified unit.
///
/// The unique identifier of the unit whose authorities should be removed.
/// A task that resolves to true if the authorities were successfully deleted; otherwise, false.
+ ///
Task DeleteAllAuthoritiesByUnit(ObjectId unitId);
///
/// Deletes all authorities associated with the specified display identifier.
///
/// The identifier of the display whose related authorities should be removed.
/// A task that resolves to a boolean indicating the outcome of the deletion operation.
+ ///
Task DeleteAllAuthoritiesByDisplay(ObjectId displayId);
///
/// Retrieves a list of authorizations associated with the specified unit identifier.
///
/// The unique identifier of the unit whose authorizations are being requested.
/// A task that represents the asynchronous operation, containing a list of objects matching the provided unit identifier.
+ ///
Task> GetByUnitId(ObjectId unitId);
}
\ No newline at end of file
diff --git a/adas-core.Application/Repositories/Interfaces/ICameraRepository.cs b/adas-core.Application/Repositories/Interfaces/ICameraRepository.cs
index aa044190..c85db4dc 100644
--- a/adas-core.Application/Repositories/Interfaces/ICameraRepository.cs
+++ b/adas-core.Application/Repositories/Interfaces/ICameraRepository.cs
@@ -12,30 +12,35 @@ public interface ICameraRepository : IMongoRepository
///
/// The unique identifier of the camera to look up.
/// A task that represents the asynchronous operation. The task result contains the matching , or null if no camera is found with the specified identifier.
+ ///
Task GetById(ObjectId cameraId);
///
/// Asynchronously retrieves a camera by its name, returning null if no matching camera is found.
///
/// The name of the camera to look up.
/// A that resolves to the matching , or null if no camera with the specified name exists.
+ ///
Task GetByName(string name);
///
/// Retrieves the list of objects associated with the specified configuration relays.
///
/// The list of values identifying the configuration relays whose cameras should be returned.
/// A containing the cameras linked to the provided configuration relays; returns an empty list when no matching cameras are found.
+ ///
List GetCameraInList(List configurationRelayList);
///
/// Retrieves a paginated, fluent queryable collection of cameras based on the supplied pagination filter.
///
/// The pagination filter containing the page number and page size used to page the camera results.
/// An representing the paged query of cameras.
+ ///
IFindFluent GetPaginatedCameras(PaginationFilter request);
///
/// Inserts a new camera record into the data store and returns the persisted entity, or null if the camera could not be inserted.
///
/// The instance containing the data to be inserted.
/// A that resolves to the inserted , or null when the insertion is not performed.
+ ///
Task InsertOneCamera(Camera camera);
///
/// Asynchronously updates an existing camera identified by the specified object identifier.
@@ -43,11 +48,13 @@ public interface ICameraRepository : IMongoRepository
/// The unique identifier of the camera to update.
/// The camera object containing the updated information.
/// A task that represents the asynchronous update operation. The task result contains the updated , or null if no camera with the specified identifier was found.
+ ///
Task UpdateCameraAsync(ObjectId objectId, Camera camera);
///
/// Asynchronously searches for cameras whose name matches the specified text.
///
/// The text used to filter cameras by name.
/// A task that represents the asynchronous operation, containing a list of objects matching the search criteria.
+ ///
Task> GetSearchByNameCameras(string textToSearch);
}
\ No newline at end of file
diff --git a/adas-core.Application/Repositories/Interfaces/IConfigObservationRepository.cs b/adas-core.Application/Repositories/Interfaces/IConfigObservationRepository.cs
index 95101666..2c3c60c2 100644
--- a/adas-core.Application/Repositories/Interfaces/IConfigObservationRepository.cs
+++ b/adas-core.Application/Repositories/Interfaces/IConfigObservationRepository.cs
@@ -11,6 +11,7 @@ public interface IConfigObservationRepository : IMongoRepository
/// The unique identifier of the configuration observation to locate.
/// A task that represents the asynchronous operation. The task result contains the if found, or null if no observation matches the specified identifier.
+ ///
Task FindById(ObjectId id);
///
@@ -19,6 +20,7 @@ public interface IConfigObservationRepository : IMongoRepository
/// The configuration observation containing the updated values to persist.
/// A task that resolves to the updated , or null if the observation does not exist.
+ ///
Task Update(ConfigObservation configObservation);
///
@@ -26,18 +28,21 @@ public interface IConfigObservationRepository : IMongoRepository
/// The unique identifier of the configuration observation to delete.
/// A task that represents the asynchronous delete operation. The task result contains the deleted configuration observation, or null if no observation with the specified identifier was found.
+ ///
Task Delete(ObjectId id);
///
/// Asynchronously retrieves all available identifiers, returning them as a list of values.
///
/// A that represents the asynchronous operation, containing a list of all instances found.
+ ///
Task> FindAllIds();
///
/// Retrieves all configuration observations available in the system.
///
/// A task that represents the asynchronous operation. The task result contains a collection of instances.
+ ///
Task> FindAll();
///
@@ -45,28 +50,33 @@ public interface IConfigObservationRepository : IMongoRepository
/// The identifier used to look up the configuration names.
/// A task that represents the asynchronous operation, containing a list of configuration names.
+ ///
Task> GetConfigNames(string id);
///
/// Asynchronously retrieves the list of available configuration names.
///
/// A task that represents the asynchronous operation, containing the list of configuration names.
+ ///
Task> GetConfigNames();
///
/// Asynchronously retrieves the total count of items.
///
/// A task that represents the asynchronous operation, containing the total count as a .
+ ///
Task Count();
///
/// Retrieves a paginated collection of configuration observations based on the specified filter.
///
/// The pagination filter that defines the page size, page number, and any additional criteria used to retrieve the observations.
/// A task that represents the asynchronous operation, containing a collection of items that match the pagination criteria.
+ ///
Task> GetPaginatedItems(PaginationFilter filter);
///
/// Retrieves a configuration observation that matches the specified name.
///
/// The name of the configuration observation to find.
/// A task that represents the asynchronous operation. The task result contains the matching ConfigObservation if found; otherwise, null.
+ ///
Task FindByName(string name);
///
/// Retrieves a matching the specified coding system and code.
@@ -74,18 +84,21 @@ public interface IConfigObservationRepository : IMongoRepositoryThe coding system identifier used to look up the configuration observation.
/// The code value within the specified coding system used to look up the configuration observation.
/// A task that represents the asynchronous operation. The task result contains the matching if found; otherwise, null.
+ ///
Task GetByCodeSysAndCode(string? codingSystem, string? code);
///
/// Asynchronously inserts the specified configuration observation item and returns the persisted entity.
///
/// The configuration observation to insert.
/// A task that represents the asynchronous insert operation, containing the inserted .
+ ///
Task InsertOneAsyncAndReturn(ConfigObservation configObservationItem);
///
/// Asynchronously retrieves all records matching the specified name.
///
/// The name used to look up the configuration observations.
/// A task that represents the asynchronous operation. The task result contains a list of objects matching the given name, or an empty list if none are found.
+ ///
Task> FindAllByName(string name);
///
@@ -96,6 +109,7 @@ public interface IConfigObservationRepository : IMongoRepositoryThe name used to look up the configuration observation item, or if not specified.
/// The original name used to look up the configuration observation item, or if not specified.
/// A task that represents the asynchronous operation. The task result contains the matching item, or if no item matches the specified criteria.
+ ///
Task GetSingleConfigObservationItem(string? code, string? codingSystem, string? name,
string? originalName);
}
\ No newline at end of file
diff --git a/adas-core.Application/Repositories/Interfaces/IConfigPumpsRepository.cs b/adas-core.Application/Repositories/Interfaces/IConfigPumpsRepository.cs
index c061ed21..5dfd2dc5 100644
--- a/adas-core.Application/Repositories/Interfaces/IConfigPumpsRepository.cs
+++ b/adas-core.Application/Repositories/Interfaces/IConfigPumpsRepository.cs
@@ -10,11 +10,13 @@ public interface IConfigPumpsRepository : IMongoRepository
///
/// The unique identifier of the configuration to look up.
/// A task that yields the matching ConfigPumps instance, or null if no configuration is found for the specified id.
+ ///
Task FindById(string id);
///
/// Retrieves all pump configurations asynchronously.
///
/// A task that represents the asynchronous operation, containing a list of if found, or null if no configurations are available.
+ ///
Task?> GetAllConfigs();
///
@@ -22,11 +24,13 @@ public interface IConfigPumpsRepository : IMongoRepository
///
/// The pumps configuration to be persisted.
/// A task that resolves to the updated instance, or if the configuration could not be found.
+ ///
Task UpdateConfig(ConfigPumps config);
///
/// Asynchronously deletes the specified pump configuration.
///
/// The pump configuration to delete.
/// A task that represents the asynchronous operation. The task result contains true if the configuration was successfully deleted; otherwise, false.
+ ///
Task DeleteConfig(ConfigPumps config);
}
\ No newline at end of file
diff --git a/adas-core.Application/Repositories/Interfaces/IConfigUnitsRepository.cs b/adas-core.Application/Repositories/Interfaces/IConfigUnitsRepository.cs
index c9d86c0a..dc6aabc5 100644
--- a/adas-core.Application/Repositories/Interfaces/IConfigUnitsRepository.cs
+++ b/adas-core.Application/Repositories/Interfaces/IConfigUnitsRepository.cs
@@ -10,5 +10,6 @@ public interface IConfigUnitsRepository : IMongoRepository
///
/// The unique identifier of the configuration unit to look up.
/// A task that represents the asynchronous operation, containing the matching or null if no entity is found.
+ ///
Task FindById(string id);
}
\ No newline at end of file
diff --git a/adas-core.Application/Repositories/Interfaces/IDeviceRepository.cs b/adas-core.Application/Repositories/Interfaces/IDeviceRepository.cs
index de13c229..bda99a8f 100644
--- a/adas-core.Application/Repositories/Interfaces/IDeviceRepository.cs
+++ b/adas-core.Application/Repositories/Interfaces/IDeviceRepository.cs
@@ -11,24 +11,28 @@ public interface IDeviceRepository : IMongoRepository
///
/// The MAC address used to look up the device.
/// A task that represents the asynchronous operation, containing the matching or null when no device is found.
+ ///
Task FindByMacAddr(string deviceDtoMacAddr);
///
/// Finds and returns the device matching the specified serial number, or null if no matching device is found.
///
/// The serial number used to look up the device.
/// A instance if a match is found; otherwise, null.
+ ///
Task FindBySerialNumber(string deviceDtoSerialNumber);
///
/// Asynchronously finds a device by its unique identifier (UUID) and returns the matching device, or null if no device is found.
///
/// The UUID string used to look up the device.
/// A that resolves to the matching , or null when no device matches the provided UUID.
+ ///
Task FindByUuid(string deviceDtoUuid);
///
/// Retrieves a device by its unique key identifier.
///
/// The key identifier of the device to look up.
/// A task that represents the asynchronous operation. The task result contains the if a matching device is found, or null if no device corresponds to the specified key.
+ ///
Task FindByKey(string deviceDtoKey);
///
/// Updates the statistics of an existing device identified by the specified identifier.
@@ -36,5 +40,6 @@ public interface IDeviceRepository : IMongoRepository
/// The unique identifier of the device whose statistics will be updated.
/// The device data transfer object representing the existing device to be updated.
/// A task that represents the asynchronous update operation.
+ ///
Task UpdateDeviceStats(ObjectId id,DeviceDto deviceExist);
}
\ No newline at end of file
diff --git a/adas-core.Application/Repositories/Interfaces/IDiagnosisArchiveRepository.cs b/adas-core.Application/Repositories/Interfaces/IDiagnosisArchiveRepository.cs
index c8f94d33..c3a545e8 100644
--- a/adas-core.Application/Repositories/Interfaces/IDiagnosisArchiveRepository.cs
+++ b/adas-core.Application/Repositories/Interfaces/IDiagnosisArchiveRepository.cs
@@ -9,16 +9,19 @@ public interface IDiagnosisArchiveRepository
///
/// The patient diagnosis entity to be persisted.
/// A task that represents the asynchronous insert operation.
+ ///
Task InsertOneAsync(PatientDiagnosis patientDiagnosis);
///
/// Asynchronously deletes items that occurred before the specified cutoff date.
///
/// The cutoff date; items dated prior to this value will be deleted.
+ ///
Task DeleteBeforeDate(DateTime date);
///
/// Inserts a batch of patient diagnosis records into the data store.
///
/// The collection of entities to insert.
/// A representing the asynchronous operation, containing the result of the batch insertion.
+ ///
Task InsertBatch(IEnumerable diagnosis);
}
\ No newline at end of file
diff --git a/adas-core.Application/Repositories/Interfaces/IDiagnosisRepository.cs b/adas-core.Application/Repositories/Interfaces/IDiagnosisRepository.cs
index 27dd3065..f21b6b3b 100644
--- a/adas-core.Application/Repositories/Interfaces/IDiagnosisRepository.cs
+++ b/adas-core.Application/Repositories/Interfaces/IDiagnosisRepository.cs
@@ -11,17 +11,20 @@ public interface IDiagnosisRepository : IMongoRepository
///
/// The unique identifier of the patient whose diagnoses are to be retrieved.
/// A task that represents the asynchronous operation, containing a list of objects for the specified patient.
+ ///
Task> GetByPatient(ObjectId patientId);
///
/// Asynchronously inserts a single patient diagnosis record into the data store.
///
/// The patient diagnosis entity to insert.
+ ///
new Task InsertOneAsync(PatientDiagnosis diagnosis);
///
/// Asynchronously deletes the entity identified by the specified identifier.
///
/// The unique identifier of the entity to delete.
+ ///
new Task DeleteAsync(ObjectId id);
///
/// Updates many records by replacing the existing identified by with the new , scoped to the specified .
@@ -29,17 +32,20 @@ public interface IDiagnosisRepository : IMongoRepository
/// The identifier of the field or collection on which the update is performed.
/// The new value to assign.
/// The existing value to be replaced.
+ ///
Task UpdateManyObjectId(string nameId, ObjectId id, ObjectId oldId);
///
/// Asynchronously finds all patient diagnoses associated with the specified patient identifier, returning a cursor to iterate over the matching documents.
///
/// The unique identifier of the patient whose diagnoses should be retrieved.
/// A task that represents the asynchronous operation, containing an IAsyncCursor of PatientDiagnosis that yields the matching documents.
+ ///
Task> FindByPatientIdAsync(ObjectId patientId);
///
/// Asynchronously deletes records associated with the specified patient identifier.
///
/// The unique of the patient whose related records should be removed.
+ ///
Task DeleteByPatientId(ObjectId patientId);
///
/// Asynchronously retrieves the associated with the specified patient, diagnosis code, and coding system.
@@ -49,5 +55,6 @@ public interface IDiagnosisRepository : IMongoRepository
/// The diagnosis code to match. May be null.
/// The coding system of the diagnosis code (for example, ICD-10 or SNOMED). May be null.
/// A task that resolves to the matching , or null if no diagnosis matches the given criteria.
+ ///
Task FindByPatientIdAndCode(ObjectId patientId, string? diagnosisCode, string? codingSystem);
}
\ No newline at end of file
diff --git a/adas-core.Application/Repositories/Interfaces/IDischargeRepository.cs b/adas-core.Application/Repositories/Interfaces/IDischargeRepository.cs
index 6779e7f1..902553df 100644
--- a/adas-core.Application/Repositories/Interfaces/IDischargeRepository.cs
+++ b/adas-core.Application/Repositories/Interfaces/IDischargeRepository.cs
@@ -12,12 +12,14 @@ public interface IDischargeRepository : IMongoRepository
/// Deletes the entity identified by the specified identifier.
///
/// The unique identifier of the entity to delete.
+ ///
Task Delete(ObjectId id);
///
/// Asynchronously updates an existing discharge record.
///
/// The discharge entity containing the updated information to be persisted.
+ ///
Task Update(Discharge discharge);
///
@@ -25,6 +27,7 @@ public interface IDischargeRepository : IMongoRepository
///
/// The unique identifier of the object whose unit will be updated.
/// The new unit value to assign to the object.
+ ///
Task UpdateUnit(ObjectId id, string unit);
///
@@ -32,12 +35,14 @@ public interface IDischargeRepository : IMongoRepository
///
/// The unique identifier of the patient to update.
/// The patient object containing the updated information to be applied to the existing record.
+ ///
Task UpdatePatient(ObjectId id, Patient patient);
///
/// Asynchronously retrieves all discharge records.
///
/// A task that represents the asynchronous operation. The task result contains a collection of all entities.
+ ///
Task> FindAll();
///
@@ -45,6 +50,7 @@ public interface IDischargeRepository : IMongoRepository
///
/// The unique identifier of the discharge record to find.
/// A task that represents the asynchronous operation. The task result contains the if a matching record is found; otherwise, null.
+ ///
Task FindById(ObjectId id);
///
@@ -52,6 +58,7 @@ public interface IDischargeRepository : IMongoRepository
///
/// The unit identifier used to filter the discharge records.
/// A task that represents the asynchronous operation. The result is an of containing the matching records, or when no records are found.
+ ///
Task?> FindByUnit(string unit);
///
@@ -59,6 +66,7 @@ public interface IDischargeRepository : IMongoRepository
///
/// The ObjectId of the unit whose associated records will be counted.
/// A task that represents the asynchronous operation. The task result contains the count of records for the specified unit.
+ ///
Task CountByUnitId(ObjectId unitId);
///
@@ -66,6 +74,7 @@ public interface IDischargeRepository : IMongoRepository
///
/// The destination identifier used to look up matching discharge records.
/// A task that yields an of matching discharge records, or null if no records are found for the given destination.
+ ///
Task?> FindByDestination(string destination);
///
@@ -74,12 +83,14 @@ public interface IDischargeRepository : IMongoRepository
///
/// The service identifier used to look up matching discharge records.
/// A task that represents the asynchronous operation. The result is an of entries for the specified service, or null if none are found.
+ ///
Task?> FindByService(string service);
///
/// Asynchronously retrieves a collection of records associated with the specified unit identifiers.
///
/// The collection of unit identifiers used to look up the matching discharges. May be null.
/// A task that represents the asynchronous operation, containing a collection of objects, or null when no matching discharges are available.
+ ///
Task?> GetDischargesByUnitIds(IEnumerable? unitIds);
@@ -88,12 +99,14 @@ public interface IDischargeRepository : IMongoRepository
///
/// The patient location used to look up the associated discharge record.
/// A task that represents the asynchronous operation. The task result contains the matching if found; otherwise, null.
+ ///
Task GetDischargeByLocation(PatientLocation location);
///
/// Retrieves the discharge record associated with the specified patient identifier, or if no discharge exists for that patient.
///
/// The unique identifier of the patient whose discharge record is being requested.
/// A that resolves to the matching , or when no record is found.
+ ///
Task GetByPatientId(ObjectId patientId);
///
@@ -101,12 +114,14 @@ public interface IDischargeRepository : IMongoRepository
///
/// The point-of-care identifier used to look up the associated discharges.
/// A task that returns an of records, or if no discharges are found for the given point-of-care identifier.
+ ///
Task?> FindByPoCId(ObjectId pocId);
///
/// Retrieves the discharge associated with the specified point of care identifier.
///
/// The identifier of the point of care used to look up the discharge.
/// A task that returns the matching if one is found; otherwise, null.
+ ///
Task GetDischargeByPointOfCareId(ObjectId poc);
///
@@ -116,6 +131,7 @@ public interface IDischargeRepository : IMongoRepository
/// The update option master list data transfer object containing the new option details.
/// The name of the type to which the master list option applies.
/// A task that represents the asynchronous operation. The task result contains a collection of updated Discharge records.
+ ///
Task> UpdateMasterListOption(List unitIds, UpdateOptionMasterListDto opt,
string typeName);
@@ -126,11 +142,13 @@ public interface IDischargeRepository : IMongoRepository
/// The master list option to delete.
/// The type name associated with the option.
/// A task that represents the asynchronous operation, containing the collection of objects resulting from the deletion.
+ ///
Task> DeleteMasterListOption(List unitIds, OptionList opt, string typeName);
///
/// Deletes the entity associated with the specified unit identifier.
///
/// The unique identifier of the unit whose associated record should be removed.
/// A task that represents the asynchronous operation. The result is true if a record was deleted; otherwise, false.
+ ///
Task DeleteByUnitId(ObjectId unitId);
}
\ No newline at end of file
diff --git a/adas-core.Application/Repositories/Interfaces/IDisplayCardConfigRepository.cs b/adas-core.Application/Repositories/Interfaces/IDisplayCardConfigRepository.cs
index 195c4052..ca1313c4 100644
--- a/adas-core.Application/Repositories/Interfaces/IDisplayCardConfigRepository.cs
+++ b/adas-core.Application/Repositories/Interfaces/IDisplayCardConfigRepository.cs
@@ -10,29 +10,34 @@ public interface IDisplayCardConfigRepository : IMongoRepository
/// Asynchronously retrieves all available card configurations.
///
/// A task that represents the asynchronous operation. The task result contains a list of all items.
+ ///
Task> GetAll();
///
/// Retrieves a card configuration by its unique identifier, returning null when no matching configuration is found.
///
/// The unique identifier of the card configuration to look up.
/// A that yields the matching if found; otherwise, null.
+ ///
Task GetById(ObjectId configId);
///
/// Asynchronously inserts a new into the data store and returns the persisted record, which may include database-generated values.
///
/// The instance to insert.
/// A that yields the inserted , or null if the record could not be persisted.
+ ///
Task InsertOneAsyncAndReturn(CardConfig config);
///
/// Updates a single record based on the provided configuration.
///
/// The to update. May be null to indicate no update payload was provided.
/// A task that resolves to an containing the updated , or null if no matching record was found.
+ ///
Task> UpdateOne(CardConfig? config);
///
/// Deletes a single card configuration identified by the specified identifier, returning the removed configuration when found.
///
/// The unique identifier of the card configuration to delete.
/// A task that represents the asynchronous delete operation. The task result contains the deleted , or null if no configuration with the specified identifier exists.
+ ///
Task DeleteOne(ObjectId configId);
}
\ No newline at end of file
diff --git a/adas-core.Application/Repositories/Interfaces/IDisplayChartConfigRepository.cs b/adas-core.Application/Repositories/Interfaces/IDisplayChartConfigRepository.cs
index ae7d01df..486579bf 100644
--- a/adas-core.Application/Repositories/Interfaces/IDisplayChartConfigRepository.cs
+++ b/adas-core.Application/Repositories/Interfaces/IDisplayChartConfigRepository.cs
@@ -10,29 +10,34 @@ public interface IDisplayChartConfigRepository : IMongoRepository
/// Asynchronously retrieves all chart configurations.
///
/// A task that represents the asynchronous operation, containing a list of objects.
+ ///
Task> GetAll();
///
/// Asynchronously retrieves a by its unique identifier, returning null if no matching configuration is found.
///
/// The identifier of the chart configuration to look up.
/// A task that yields the matching , or null when no configuration exists for the specified id.
+ ///
Task GetById(ObjectId configId);
///
/// Asynchronously inserts a new chart configuration into the data store and returns the persisted entity, which may be null if no record is produced.
///
/// The chart configuration to insert.
/// A task that represents the asynchronous insert operation, containing the inserted or null when the operation yields no result.
+ ///
Task InsertOneAsyncAndReturn(ChartConfig config);
///
/// Updates a single chart configuration and returns the operation result wrapped in an update response.
///
/// The chart configuration to update. May be null.
/// A task containing the update response with the updated chart configuration, which may be null.
+ ///
Task> UpdateOne(ChartConfig? config);
///
/// Deletes a single chart configuration identified by its unique identifier. Returns the deleted configuration, or if no matching configuration was found.
///
/// The unique identifier of the chart configuration to delete.
/// A task that resolves to the deleted , or if no configuration with the specified id exists.
+ ///
Task DeleteOne(ObjectId configId);
}
\ No newline at end of file
diff --git a/adas-core.Application/Repositories/Interfaces/IDisplayConfigRepository.cs b/adas-core.Application/Repositories/Interfaces/IDisplayConfigRepository.cs
index 9ec0d716..02c68294 100644
--- a/adas-core.Application/Repositories/Interfaces/IDisplayConfigRepository.cs
+++ b/adas-core.Application/Repositories/Interfaces/IDisplayConfigRepository.cs
@@ -15,18 +15,21 @@ public interface IDisplayConfigRepository : IMongoRepository
/// Asynchronously retrieves all display configurations.
///
/// A task that represents the asynchronous operation. The task result contains a list of all entries.
+ ///
Task> GetAll();
///
/// Retrieves a paginated set of entities projected as .
///
/// The pagination filter applied to the query.
/// An that produces the paginated results.
+ ///
IFindFluent GetAllPaginated(PaginationFilter request);
///
/// Asynchronously retrieves the list of display configurations that match the specified display type.
///
/// The display type used to filter the returned display configurations.
/// A task that represents the asynchronous operation, containing the list of entries matching the specified type.
+ ///
Task> GetByType(DisplayConfigEnums.DisplayType type);
///
/// Retrieves a entity by its unique identifier asynchronously.
@@ -34,6 +37,7 @@ public interface IDisplayConfigRepository : IMongoRepository
///
/// The unique identifier of the display configuration to retrieve.
/// A task that represents the asynchronous operation. The task result contains the if found, or null if no matching record exists.
+ ///
Task GetById(ObjectId id);
///
/// Asynchronously retrieves the default for the specified display type.
@@ -41,12 +45,14 @@ public interface IDisplayConfigRepository : IMongoRepository
///
/// The display type used to look up the default configuration.
/// A task that represents the asynchronous operation. The task result contains the default for the given type, or null if no default exists.
+ ///
Task GetDefault(DisplayConfigEnums.DisplayType type);
///
/// Asynchronously inserts a new and returns the persisted entity, typically populated with any server-generated values.
///
/// The to insert.
/// A task that represents the asynchronous operation. The task result contains the inserted , or when no result is returned.
+ ///
Task InsertOneAsyncAndReturn(DisplayConfig config);
///
/// Updates the smart display configuration identified by the specified ID with the provided new configuration.
@@ -54,6 +60,7 @@ public interface IDisplayConfigRepository : IMongoRepository
/// The unique identifier of the smart display configuration to update.
/// The new smart display configuration to apply.
/// A task that represents the asynchronous update operation, containing the updated smart display configuration, or null if no configuration with the given ID was found.
+ ///
Task UpdateSmartDisplay(ObjectId displayConfigId, SmartDisplay? newDisplayConfig);
///
@@ -63,6 +70,7 @@ public interface IDisplayConfigRepository : IMongoRepository
/// The new display nurse configuration data, or null if not provided.
/// The list of nurse observations to associate with the configuration.
/// A task that represents the asynchronous operation, containing the updated or null if not found.
+ ///
Task UpdateDisplayNurse(ObjectId displayConfigId, DisplayNurseDto? newDisplayConfig,
List nurseObs);
@@ -73,6 +81,7 @@ public interface IDisplayConfigRepository : IMongoRepository
/// The identifier of the unit whose default display configuration is being requested.
/// The display type used to filter the configuration lookup.
/// A task containing the matching , or null if no default configuration is found for the given unit and display type.
+ ///
Task GetDefaultByUnitIdAndType(ObjectId unitId, DisplayConfigEnums.DisplayType displayType);
///
/// Asynchronously updates the color configuration for the specified config display entry.
@@ -80,6 +89,7 @@ public interface IDisplayConfigRepository : IMongoRepository
/// The unique identifier of the config display whose color configuration will be updated.
/// The new color configuration to apply to the config display.
/// A task that resolves to true if the color configuration was successfully updated; otherwise, false.
+ ///
Task UpdateConfigColor(ObjectId objectIdConfigDisplay, ColorConfig colorConfig);
///
/// Updates the home banner configuration identified by the specified config display ObjectId with the provided list of banner items.
@@ -87,6 +97,7 @@ public interface IDisplayConfigRepository : IMongoRepository
/// The ObjectId of the config display whose home banner set will be updated.
/// The collection of banner items to apply to the home banner set.
/// A task that resolves to true if the home banner set was updated successfully; otherwise, false.
+ ///
Task UpdateSetHomeBanner(ObjectId objectIdConfigDisplay, List bannerItems);
///
/// Updates the base display configuration identified by the specified object identifier with the provided configuration data.
@@ -94,6 +105,7 @@ public interface IDisplayConfigRepository : IMongoRepository
/// The object identifier of the configuration display entry to update.
/// The new base display configuration values to apply.
/// A task that represents the asynchronous operation. The result is true if the update succeeded; otherwise, false.
+ ///
Task UpdateBaseConfig(ObjectId objectIdConfigDisplay, DisplayConfig baseConfig);
///
/// Updates an existing header configuration associated with the specified configuration display identifier.
@@ -101,6 +113,7 @@ public interface IDisplayConfigRepository : IMongoRepository
/// The unique identifier of the configuration display whose header configuration is being updated.
/// The new header configuration values to apply.
/// A task that represents the asynchronous operation. The task result is true if the header configuration was successfully updated; otherwise, false.
+ ///
Task UpdateHeaderConfig(ObjectId objectIdConfigDisplay, HeaderConfig headerConfig);
///
/// Updates the hospital name associated with the specified display configuration.
@@ -108,6 +121,7 @@ public interface IDisplayConfigRepository : IMongoRepository
/// The identifier of the display configuration to update.
/// The new hospital name to apply to the display configuration.
/// A task that represents the asynchronous operation. The task result is true if the update succeeded; otherwise, false.
+ ///
Task UpdateDisplayConfigHospitalName(ObjectId objectIdConfigDisplay, string name);
///
/// Updates the field list associated with the specified configuration display.
@@ -115,29 +129,34 @@ public interface IDisplayConfigRepository : IMongoRepository
/// The identifier of the configuration display whose field list is being updated.
/// The list of fields to apply to the configuration display.
/// A task that resolves to true if the field list was updated successfully; otherwise, false.
+ ///
Task UpdateFieldList(ObjectId objectIdConfigDisplay, List fields);
///
/// Deletes a display configuration identified by the specified object ID.
///
/// The object ID of the display configuration to delete.
/// A task that represents the asynchronous delete operation. The task result contains the deleted display configuration, or null if no configuration was found with the specified ID.
+ ///
Task DeleteDisplayConfig(ObjectId objectIdConfigDisplay);
///
/// Retrieves all display configurations in a compact, minimal representation.
///
/// A task containing a list of objects representing the display configurations.
+ ///
Task> GetAllCompact();
///
/// Retrieves all object identifiers associated with the specified card configuration identifier.
///
/// The identifier of the card configuration whose related objects should be returned.
/// A task that represents the asynchronous operation, containing a list of values linked to the given card configuration.
+ ///
Task> GetAllByCardConfigId(ObjectId cardConfigId);
///
/// Asynchronously retrieves a list of ObjectIds associated with the specified card configuration that are marked as rotating.
///
/// The ObjectId of the card configuration used to filter the results.
/// A task representing the asynchronous operation, containing a list of ObjectIds that match the given card configuration and rotating criteria.
+ ///
Task> GetAllByCardConfigIdAndRotating(ObjectId cardConfigId);
///
/// Updates the card configuration identifier for the specified display configuration and result.
@@ -145,6 +164,7 @@ public interface IDisplayConfigRepository : IMongoRepository
/// The identifier of the display configuration whose card configuration will be updated.
/// The identifier of the result associated with the card configuration update.
/// A task that resolves to true if the update succeeded; otherwise, false.
+ ///
Task UpdateCardConfigId(ObjectId? displayConfigId, ObjectId? resultId);
///
/// Adds a chart identifier to the specified display configuration asynchronously.
@@ -152,18 +172,21 @@ public interface IDisplayConfigRepository : IMongoRepository
/// The identifier of the display configuration to which the chart ID will be added, or null when no specific configuration is targeted.
/// The chart identifier to add.
/// A task that represents the asynchronous operation. The task result is true if the chart identifier was successfully added; otherwise, false.
+ ///
Task AddChartId(ObjectId? displayConfigId, ObjectId newChartIdToAdd);
///
/// Updates the configuration of a chart that was previously deleted, using the specified identifier.
///
/// The identifier of the deleted chart configuration to update.
/// A task that represents the asynchronous update operation, containing the result of the update.
+ ///
Task UpdateDeletedChartConfig(ObjectId deletedId);
///
/// Asynchronously retrieves the chart configuration associated with the specified chart object identifier.
///
/// The unique object identifier of the chart configuration to retrieve.
/// A task that represents the asynchronous operation, containing the associated with the specified identifier.
+ ///
Task GetChartConfig(ObjectId objectIdConfigChart);
///
/// Asynchronously updates the detail configuration identifier, associating it with the specified result identifier.
@@ -171,11 +194,13 @@ public interface IDisplayConfigRepository : IMongoRepository
/// The nullable identifier of the display configuration to update.
/// The nullable identifier of the result to associate with the configuration.
/// A task that represents the asynchronous operation, containing a boolean indicating whether the update was successful.
+ ///
Task UpdateDetailConfigId(ObjectId? displayConfigId, ObjectId? resultId);
///
/// Asynchronously retrieves a list of identifiers associated with the specified card detail base configuration.
///
/// The identifier of the card detail base configuration to filter by.
/// A task that represents the asynchronous operation, containing a list of values matching the provided base configuration identifier.
+ ///
Task> GetAllByCardDetailConfigId(ObjectId baseConfigId);
}
\ No newline at end of file
diff --git a/adas-core.Application/Repositories/Interfaces/IDisplayDetailConfigRepository.cs b/adas-core.Application/Repositories/Interfaces/IDisplayDetailConfigRepository.cs
index 3390d550..f5d2b543 100644
--- a/adas-core.Application/Repositories/Interfaces/IDisplayDetailConfigRepository.cs
+++ b/adas-core.Application/Repositories/Interfaces/IDisplayDetailConfigRepository.cs
@@ -10,6 +10,7 @@ public interface IDisplayDetailConfigRepository : IMongoRepository
/// A task that represents the asynchronous operation. The task result contains a list of all entries.
+ ///
Task> GetAll();
///
/// Retrieves a by its unique identifier.
@@ -17,23 +18,27 @@ public interface IDisplayDetailConfigRepository : IMongoRepository
/// The identifier of the card details configuration to retrieve.
/// A task that represents the asynchronous operation, containing the matching or if not found.
+ ///
Task GetById(ObjectId configId);
///
/// Asynchronously inserts a new card details configuration and returns the inserted entity.
///
/// The card details configuration to insert.
/// A task representing the asynchronous operation, containing the inserted , or null if no entity was returned.
+ ///
Task InsertOneAsyncAndReturn(CardDetailsConfig config);
///
/// Updates a single card details configuration record asynchronously.
///
/// The card details configuration to update. May be .
/// A task that represents the asynchronous operation, containing the update response with the updated or when no configuration is found.
+ ///
Task> UpdateOne(CardDetailsConfig? config);
///
/// Deletes a single identified by its unique identifier.
///
/// The unique identifier of the to delete.
/// A task that represents the asynchronous operation, containing the deleted , or null if no matching configuration was found.
+ ///
Task DeleteOne(ObjectId configId);
}
\ No newline at end of file
diff --git a/adas-core.Application/Repositories/Interfaces/IDisplayRepository.cs b/adas-core.Application/Repositories/Interfaces/IDisplayRepository.cs
index 3e8d16c1..ef7cae2c 100644
--- a/adas-core.Application/Repositories/Interfaces/IDisplayRepository.cs
+++ b/adas-core.Application/Repositories/Interfaces/IDisplayRepository.cs
@@ -14,6 +14,7 @@ public interface IDisplayRepository : IMongoRepository
/// Retrieves every display stored in the collection.
///
/// A representing the asynchronous operation. The task result contains all displays, or an empty list if none exist.
+ ///
Task> GetAll();
@@ -22,6 +23,7 @@ public interface IDisplayRepository : IMongoRepository
///
/// The to filter by.
/// A representing the asynchronous operation. The task result contains the matching displays, or an empty list if none exist.
+ ///
Task> GetByPointOfCare(PointOfCare pointOfCare);
// Task> GetByUser();
@@ -31,6 +33,7 @@ public interface IDisplayRepository : IMongoRepository
///
/// The display name to look up.
/// A representing the asynchronous operation. The task result contains the if found; otherwise, .
+ ///
Task GetByName(string name);
///
@@ -38,6 +41,7 @@ public interface IDisplayRepository : IMongoRepository
///
/// The of the display to retrieve.
/// A representing the asynchronous operation. The task result contains the if found; otherwise, .
+ ///
Task GetById(ObjectId id);
///
@@ -45,6 +49,7 @@ public interface IDisplayRepository : IMongoRepository
///
/// The of the display to retrieve.
/// A representing the asynchronous operation. The task result contains the with its config populated if found; otherwise, .
+ ///
Task GetByIdWithConfigDisplay(ObjectId id);
///
@@ -52,6 +57,7 @@ public interface IDisplayRepository : IMongoRepository
///
/// The of the unit.
/// A representing the asynchronous operation. The task result contains the matching displays, or an empty list if none exist.
+ ///
Task> GetByUnitId(ObjectId id);
///
@@ -59,6 +65,7 @@ public interface IDisplayRepository : IMongoRepository
///
/// The of the display configuration to filter by.
/// A representing the asynchronous operation. The task result contains the matching displays, or an empty list if none exist.
+ ///
Task> GetByConfigId(ObjectId id);
///
@@ -67,6 +74,7 @@ public interface IDisplayRepository : IMongoRepository
/// The of the display to update.
/// The new list of values representing the point-of-cares to associate with the display.
/// A representing the asynchronous operation. The task result contains the updated if the update succeeded; otherwise, .
+ ///
Task UpdatePointOfCareList(ObjectId objectId, List listPocObId);
///
@@ -75,6 +83,7 @@ public interface IDisplayRepository : IMongoRepository
/// The of the display whose configuration should be replaced.
/// The new instance to assign to the display.
/// A representing the asynchronous operation. The task result contains the updated if the update succeeded; otherwise, .
+ ///
Task UpdateConfig(ObjectId oldDisplayId, DisplayConfig newDisplayConfigCast);
///
@@ -83,6 +92,7 @@ public interface IDisplayRepository : IMongoRepository
/// The of the display to update.
/// The of the display-config preset to associate.
/// A representing the asynchronous operation. The task result contains the updated if the update succeeded; otherwise, .
+ ///
Task UpdateConfigPreset(ObjectId objectIdDisplay, ObjectId objectIdConfigDisplay);
///
@@ -91,6 +101,7 @@ public interface IDisplayRepository : IMongoRepository
/// The instance to update. Its is used to identify the document.
/// The new display name.
/// A representing the asynchronous operation. The task result contains the updated .
+ ///
Task UpdateName(Display display, string name);
///
@@ -98,6 +109,7 @@ public interface IDisplayRepository : IMongoRepository
///
/// The containing pagination and filter criteria.
/// An instance that can be used to further refine and execute the query.
+ ///
IFindFluent GetPaginatedDisplays(PaginationFilter filter);
///
@@ -105,6 +117,7 @@ public interface IDisplayRepository : IMongoRepository
///
/// The of the display configuration to check for usage.
/// A representing the asynchronous operation. The task result contains the number of displays referencing the configuration.
+ ///
Task IsDisplayConfigInUse(ObjectId displayConfigId);
///
@@ -113,6 +126,7 @@ public interface IDisplayRepository : IMongoRepository
/// The of the display to update.
/// The new of the display configuration to associate with the display.
/// A representing the asynchronous operation. The task result contains the updated if the update succeeded; otherwise, .
+ ///
Task UpdateConfigId(ObjectId objectId, ObjectId displayConfigId);
///
@@ -120,6 +134,7 @@ public interface IDisplayRepository : IMongoRepository
///
/// The of the unit.
/// A representing the asynchronous operation. The task result contains the number of displays for the unit.
+ ///
Task CountByUnitId(ObjectId unitId);
///
@@ -127,6 +142,7 @@ public interface IDisplayRepository : IMongoRepository
///
/// The of the unit whose displays should be removed.
/// A representing the asynchronous operation. The task result is when at least one display was deleted; otherwise, .
+ ///
Task DeleteManyByUnitId(ObjectId unitId);
///
@@ -134,5 +150,6 @@ public interface IDisplayRepository : IMongoRepository
///
/// The of the card configuration to filter by.
/// A representing the asynchronous operation. The task result contains the matching displays, or an empty list if none exist.
+ ///
Task> GetByCardConfigId(ObjectId configId);
}
\ No newline at end of file
diff --git a/adas-core.Application/Repositories/Interfaces/IHistoricalConfigChangesRepository.cs b/adas-core.Application/Repositories/Interfaces/IHistoricalConfigChangesRepository.cs
index b0ee6f55..5813bfe8 100644
--- a/adas-core.Application/Repositories/Interfaces/IHistoricalConfigChangesRepository.cs
+++ b/adas-core.Application/Repositories/Interfaces/IHistoricalConfigChangesRepository.cs
@@ -12,6 +12,7 @@ public interface IHistoricalConfigChangesRepository : IMongoRepository
///