=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===
This commit is contained in:
@@ -20,6 +20,8 @@ namespace adas_core.Test.Customizations.HUVH.UCIA;
|
||||
/// Marked with <c>TestFixture</c> and assigned <c>Order(2)</c> to control its execution sequence relative to other fixtures.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=d5b9e22 -->
|
||||
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
|
||||
/// "The summary is self-referential and circular: it claims the fixture 'validates the behavior of CalculatedObservationsTest related functionality,' but a test fixture does not validate its own behavior. The class likely tests `CalculatedObservations` functionality, not itself." -->
|
||||
[TestFixture]
|
||||
[Order(2)]
|
||||
public class CalculatedObservationsTest
|
||||
@@ -29,6 +31,7 @@ public class CalculatedObservationsTest
|
||||
/// configuring a service provider with these dependencies, and instantiating the <see cref="CalculatedObservations"/>
|
||||
/// class under test.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=dee8bf2 body=20f8ac4 -->
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
@@ -84,6 +87,7 @@ public class CalculatedObservationsTest
|
||||
/// a RASS observation with a sufficiently low score, recent PSI and TS observations, and an active treatment
|
||||
/// (e.g., Propofol) with a minimum requested give amount that triggers the over-sedation condition.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d154c42 body=997a001 -->
|
||||
[Test]
|
||||
public async Task CalculateOverSedation_Should_Insert_Observation_When_Conditions_Met()
|
||||
{
|
||||
@@ -108,6 +112,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that no over-sedation observation is inserted when the patient's RASS score is not -4 or -5, ensuring the over-sedation calculation only applies for those specific values.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=be8cf87 body=bfc74a1 -->
|
||||
[Test]
|
||||
public async Task CalculateOverSedation_Should_Not_Insert_Observation_When_RASS_Is_Not_Negative4_Or_Negative5()
|
||||
{
|
||||
@@ -123,6 +128,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that no observation is inserted when calculating over-sedation and the patient's PSI (Sedation Intensity Index) is 25 or higher, which indicates the threshold above which the over-sedation mapping should not produce an observation.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=4c7f3e9 body=e6d4e04 -->
|
||||
[Test]
|
||||
public async Task CalculateOverSedation_Should_Not_Insert_Observation_When_PSI_Is_25_Or_Higher()
|
||||
{
|
||||
@@ -144,6 +150,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that the over-sedation calculation does not insert an observation when the patient's TS (Tidal Spontaneous) value is 5 or lower, even with a low RASS score and an elevated PSI value.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=ddfbeb2 body=05fcbdd -->
|
||||
[Test]
|
||||
public async Task CalculateOverSedation_Should_Not_Insert_Observation_When_TS_Is_5_Or_Lower()
|
||||
{
|
||||
@@ -165,6 +172,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that no observation is inserted when the patient has no active treatments that exceed the configured threshold during the over-sedation calculation.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=6d6504a body=40c020e -->
|
||||
[Test]
|
||||
public async Task CalculateOverSedation_Should_Not_Insert_Observation_When_No_Treatments_Exceed_Threshold()
|
||||
{
|
||||
@@ -190,6 +198,7 @@ public class CalculatedObservationsTest
|
||||
/// Verifies that an over-sedation observation is inserted when the calculation is triggered by a PSI observation
|
||||
/// and the patient's last RASS and TS observations, combined with active treatment data, meet the triggering criteria.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=2484ab7 body=6ae0e08 -->
|
||||
[Test]
|
||||
public async Task CalculateOverSedation_Should_Insert_Observation_When_Triggered_By_PSI_Observation()
|
||||
{
|
||||
@@ -215,6 +224,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that the over-sedation calculation logic inserts a new observation when a triggering TS (Twitch Score) observation is received, given the presence of related RASS and PSI observations and an active treatment (e.g., Propofol) meeting the required minimum amount threshold.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=169c7e7 body=b584f23 -->
|
||||
[Test]
|
||||
public async Task CalculateOverSedation_Should_Insert_Observation_When_Triggered_By_TS_Observation()
|
||||
{
|
||||
@@ -246,6 +256,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that when an Inspiratory Pressure (PI) observation is processed and no Compliancia (COMPL) observation is found for the patient, the ventilation mode is set to "VMNI".
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=cdcef7f body=1f1d9d7 -->
|
||||
[Test]
|
||||
public async Task CalculateVentilationMode_Should_Set_VMNI_When_PI_PS_Arrives_Without_COMPL()
|
||||
{
|
||||
@@ -266,6 +277,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that when a "Compliancia" (COMPL) observation is mapped, the ventilation mode is calculated and set to "VMI".
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=76c6409 body=09b9d41 -->
|
||||
[Test]
|
||||
public async Task CalculateVentilationMode_Should_Set_VMI_When_COMPL_Arrives()
|
||||
{
|
||||
@@ -282,6 +294,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that when an Air Flow observation is processed and a CCC Ventilation Mode observation exists for the patient, the calculated ventilation mode is set to the value retrieved from the CCC source (e.g., "CNAF") and persisted via an insert call.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=396d8de body=c8db6fd -->
|
||||
[Test]
|
||||
public async Task CalculateVentilationMode_Should_Set_CCC_Mode_When_AirFlow_Arrives_And_CCC_Has_Mode()
|
||||
{
|
||||
@@ -344,6 +357,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that when a PI observation is processed and a COMPL observation already exists for the patient, no new calculated observation is inserted.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=a3a2ffc body=3e27399 -->
|
||||
[Test]
|
||||
public async Task CalculateVentilationMode_Should_Not_Insert_When_PI_Arrives_And_COMPL_Already_Exists()
|
||||
{
|
||||
@@ -363,6 +377,7 @@ public class CalculatedObservationsTest
|
||||
/// Verifies that no calculated observation is inserted when a PS (Pressure Support) observation is processed
|
||||
/// and a COMPL observation already exists for the patient.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=f7af740 body=6680e7c -->
|
||||
[Test]
|
||||
public async Task CalculateVentilationMode_Should_Not_Insert_When_PS_Arrives_And_COMPL_Already_Exists()
|
||||
{
|
||||
@@ -386,6 +401,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that mapping a <see cref="PatientObservation"/> with Name "ECMO_Location" and Value "VV" returns a non-null result whose value is "VV".
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=c8afb0f body=7f629ed -->
|
||||
[Test]
|
||||
public async Task CalculateEcmoLocation_Should_Return_VV_When_Value_Is_VV()
|
||||
{
|
||||
@@ -398,6 +414,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that the ECMO location calculation returns "VA" when the input observation value is "VA".
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=c311f8b body=5b8882f -->
|
||||
[Test]
|
||||
public async Task CalculateEcmoLocation_Should_Return_VA_When_Value_Is_VA()
|
||||
{
|
||||
@@ -412,6 +429,7 @@ public class CalculatedObservationsTest
|
||||
/// (e.g., "ECCO2r", "VVDL", "VA+V", "VVDL+V", "VV+V", "VVA").
|
||||
/// </summary>
|
||||
/// <param name="inputValue">The ECMO location code assigned to the <see cref="PatientObservation"/> value under test.</param>
|
||||
/// <!-- aidoc:v1 sig=90b3dc0 body=064eda8 -->
|
||||
[Test]
|
||||
[TestCase("ECCO2r")]
|
||||
[TestCase("VVDL")]
|
||||
@@ -430,6 +448,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that the ECMO Location mapping does not alter the observation value when the provided value is not present in the recognized ECMO list, leaving the original value unchanged.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=bfe3e66 body=de3ceb3 -->
|
||||
[Test]
|
||||
public async Task CalculateEcmoLocation_Should_Not_Change_Value_When_Not_In_Ecmo_List()
|
||||
{
|
||||
@@ -443,6 +462,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that the mapping of a <see cref="PatientObservation"/> through the calculated observations mapper returns the original observation unchanged, ensuring the mapping is a no-op for patient observations.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=cd439fd body=1a3d8c5 -->
|
||||
[Test]
|
||||
public async Task CalculateEcmoLocation_Should_Return_Original_Observation_When_Not_PatientObservation()
|
||||
{
|
||||
@@ -460,6 +480,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that an "Over_Analgesia" observation with value "True" is created when the patient has active analgesic treatments (Morfina, Remifentanilo) and the last ANI observation indicates a high value (80), suggesting over-analgesia.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=0e024bd body=5783315 -->
|
||||
[Test]
|
||||
public async Task CalculateOverAnalgesia_Should_Create_Observation_When_Conditions_Are_Met()
|
||||
{
|
||||
@@ -534,6 +555,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that the mapping correctly calculates and inserts the driving pressure (Pmeset minus PEEP) when both source observations are available.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=52ff2df body=3ae93a9 -->
|
||||
[Test]
|
||||
public async Task CalculateDrivingPressure_Should_Calculate_Correctly_When_Both_Observations_Are_Present()
|
||||
{
|
||||
@@ -594,6 +616,7 @@ public class CalculatedObservationsTest
|
||||
/// Verifies that the Rox Index is calculated correctly by dividing the SpO2/FiO2 ratio by the respiratory rate (FR)
|
||||
/// when both required observations are available, and that the result is persisted as a new "Rox_Index" observation.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=3c50640 body=5d52d72 -->
|
||||
[Test]
|
||||
public async Task CalculateRoxIndex_Should_Calculate_Correctly_When_Both_Observations_Are_Present()
|
||||
{
|
||||
@@ -654,6 +677,7 @@ public class CalculatedObservationsTest
|
||||
/// Verifies that the ROX index calculation is not performed when the respiratory rate (FR) is zero,
|
||||
/// preventing a division by zero error.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=30bf581 body=30b6497 -->
|
||||
[Test]
|
||||
public async Task CalculateRoxIndex_Should_Not_Calculate_When_FR_Is_Zero_To_Avoid_Division_By_Zero()
|
||||
{
|
||||
@@ -682,6 +706,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that the diuresis calculation produces the correct value when prior diuresis observations and a weight observation are available for the patient, resulting in a new "Calculated_Diuresis" observation being inserted.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=e5bb5b0 body=2792c9b -->
|
||||
[Test]
|
||||
public async Task CalculateDiuresis_Should_Calculate_Correctly_When_Observations_Are_Available()
|
||||
{
|
||||
@@ -723,6 +748,7 @@ public class CalculatedObservationsTest
|
||||
/// Verifies that diuresis is not calculated when no diuresis observations are found for the patient.
|
||||
/// Ensures the mapping logic skips persistence of a calculated diuresis observation when required prior observations are missing.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=014e5d8 body=794ece0 -->
|
||||
[Test]
|
||||
public async Task CalculateDiuresis_Should_Not_Calculate_If_Diuresis_Observations_Are_Missing()
|
||||
{
|
||||
@@ -747,6 +773,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that the diuresis calculation is not performed when the patient has no weight observation available, ensuring no new observation is inserted.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=c3e7f69 body=c70ddf8 -->
|
||||
[Test]
|
||||
public async Task CalculateDiuresis_Should_Not_Calculate_If_Weight_Is_Invalid()
|
||||
{
|
||||
@@ -778,6 +805,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that the rehabilitation observation mapping sets the status to Alert when the recent rehabilitation values meet the alert condition.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=b72fc81 body=739bfe1 -->
|
||||
[Test]
|
||||
public async Task CalculateRehabilitationAlarm_Should_Set_Alert_When_Condition_Is_Met()
|
||||
{
|
||||
@@ -809,6 +837,7 @@ public class CalculatedObservationsTest
|
||||
/// configured condition is not met, even when the most recent observation values are within an
|
||||
/// expected range and an out-of-range value is present among the evaluated history.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=f5d4651 body=851916f -->
|
||||
[Test]
|
||||
public async Task CalculateRehabilitationAlarm_Should_Not_Set_Alert_When_Condition_Is_Not_Met()
|
||||
{
|
||||
@@ -838,6 +867,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that the <c>Map</c> method does not set an alert for a Rehabilitation observation when its value is greater than 2, returning the original observation unchanged.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=4222131 body=b1c7f39 -->
|
||||
[Test]
|
||||
public async Task CalculateRehabilitationAlarm_Should_Not_Set_Alert_When_Value_Is_Greater_Than_2()
|
||||
{
|
||||
@@ -856,6 +886,7 @@ public class CalculatedObservationsTest
|
||||
/// Verifies that the rehabilitation alarm calculation returns the same observation unchanged when the input observation is not a <see cref="PatientObservation"/>.
|
||||
/// This ensures that the mapping method does not perform any transformation for non-patient observations.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=b686378 body=10526fb -->
|
||||
[Test]
|
||||
public async Task CalculateRehabilitationAlarm_Should_Return_Same_Observation_If_Not_PatientObservation()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user