=== 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:
@@ -34,6 +34,8 @@ public class CalculatedObservationsTest
|
||||
/// is produced for each test.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=dee8bf2 body=3c4f27b -->
|
||||
/// <!-- aidoc-review:v1 severity=low kind=wrong_summary
|
||||
/// "Summary enumerates configured IOptions settings but omits IntravenousLinesCode (intravenous lines codes), which is also assigned in the setup." -->
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
@@ -610,6 +612,8 @@ public class CalculatedObservationsTest
|
||||
/// Verifies that when a previous <see cref="PatientObservation"/> for the same patient and location has already been removed, the intravenous calculation performed by <see cref="CalculatedObservations.Map"/> produces a result of 0.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=ca5324a body=aae89b4 -->
|
||||
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
|
||||
/// "The documentation claims a previous observation 'has already been removed', but the mocked existing observation returned by FindLastObservations has no RemoveTime set (only Action='Insert', Duration, InsertTime, Type, and Location are populated), indicating it has not been removed." -->
|
||||
[Test]
|
||||
public async Task Calculate_Intravenous_Obs_Already_Exist_Removed_Should_Return_0()
|
||||
{
|
||||
@@ -837,6 +841,8 @@ public class CalculatedObservationsTest
|
||||
/// Verifies that mapping a new <see cref="PatientObservation"/> with a "Catéter línea media" type, when two prior intravenous lines exist (one "Catéter EPICUTÁNEO PERIFÉRICO" and one "Catéter Venoso PERIFÉRICO"), inserts an <see cref="PatientObservation"/> named "IntravenousLines" with a summed value of 5 for the given <paramref name="patientId"/>.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=1e74e0a body=1cc02b8 -->
|
||||
/// <!-- aidoc-review:v1 severity=low kind=extra_param
|
||||
/// "<paramref name=\"patientId\"/> refers to a local variable; the method has no parameters" -->
|
||||
[Test]
|
||||
public async Task Calculate_Intravenous_sum_one_middle_line_and_two_Peripheral_should_return_5()
|
||||
{
|
||||
|
||||
@@ -26,6 +26,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Initializes mocked dependencies and configures the dependency injection container required to instantiate the <see cref="CalculatedObservations"/> service under test.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=dee8bf2 body=d74ae8f -->
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
@@ -114,6 +115,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that a PatientObservation with the ventilation mode "PRVC" is mapped to a calculated observation with the value "VCRP".
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=eb9f8ec body=e44fb52 -->
|
||||
[Test]
|
||||
public async Task Calculate_Ventilation_Mode_PRVC_Returns_VCRP()
|
||||
{
|
||||
@@ -137,6 +139,7 @@ public class CalculatedObservationsTest
|
||||
/// Verifies that the calculated observations mapping translates the ventilation mode value "FLUJ.ALTO" (High Flow) into the respiratory support code "OAF".
|
||||
/// Ensures that a patient observation with the name "Resp_Mode" and value "FLUJ.ALTO" produces a non-null mapped result with the expected output value.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=76d5e48 body=d17dc11 -->
|
||||
[Test]
|
||||
public async Task Calculate_Ventilation_Mode_FLUJ_ALTO_Returns_OAF()
|
||||
{
|
||||
@@ -159,6 +162,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that when a patient observation's respiratory mode is neither "PRVC" nor "FLUJ_ALTO" (for example, "VNI PC"), the calculated observation is not mapped to "VCRP" or "OAF".
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=44eb476 body=279d733 -->
|
||||
[Test]
|
||||
public async Task Calculate_Ventilation_Mode_Not_PRVC_Not_FLUJ_ALTO_Returns_Other()
|
||||
{
|
||||
@@ -188,6 +192,7 @@ public class CalculatedObservationsTest
|
||||
/// Verifies that the calculated observations mapping does not produce a Sattc_FiO2 observation
|
||||
/// when the Sattc value is 98, ensuring the calculation is suppressed for this specific input case.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=c417ee7 body=b77cd07 -->
|
||||
[Test]
|
||||
public async Task CalculateSF_Sattc_98_Returns_Not_Sattc_FiO2()
|
||||
{
|
||||
@@ -239,6 +244,7 @@ public class CalculatedObservationsTest
|
||||
/// Verifies that when an FiO2 observation is processed, the Oxygenation Index is calculated and inserted
|
||||
/// using the related P_VAM and PaO2_Tidal observations retrieved for the same patient.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=3315812 body=f686108 -->
|
||||
[Test]
|
||||
public async Task CalculateOxygenationIndex_FiO2_Returns_Oxygenation_Index()
|
||||
{
|
||||
@@ -297,6 +303,7 @@ public class CalculatedObservationsTest
|
||||
/// (computed as <c>P_VAM × FiO2 × 100 / PaO2</c>) that is inserted through the observation service for the same patient.
|
||||
/// </summary>
|
||||
/// <returns>A task that completes when the expected <c>Oxygenation_Index</c> observation has been inserted via the mocked observation service.</returns>
|
||||
/// <!-- aidoc:v1 sig=da07bc9 body=502f5d7 -->
|
||||
[Test]
|
||||
public async Task CalculateOxygenationIndex_P_VAM_Returns_Oxygenation_Index()
|
||||
{
|
||||
@@ -353,6 +360,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that when a PaO2_Tidal observation is mapped, the calculated Oxygenation_Index is derived using the formula P_VAM * FiO2 * 100 / PaO2_Tidal and persisted as an ADAS-coded observation for the same patient.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d5e69ac body=9ff274d -->
|
||||
[Test]
|
||||
public async Task CalculateOxygenationIndex_PaO2_Tidal_Returns_Oxygenation_Index()
|
||||
{
|
||||
@@ -411,6 +419,8 @@ public class CalculatedObservationsTest
|
||||
/// is missing from the patient's most recent observations, even when a PaO2_Tidal observation is provided.
|
||||
/// Ensures that the mapping logic does not insert a new Oxygenation_Index observation in this scenario.
|
||||
/// </summary>
|
||||
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
|
||||
/// "The doc states FiO2 is missing from recent observations, but the code mocks FindLastObservations to return FiO2 (it is present); PaO2_Tidal is the observation missing from the recent observations." -->
|
||||
[Test]
|
||||
public async Task CalculateOxygenationIndex_PaO2_Tidal_Not_Returns_Oxygenation_Index()
|
||||
{
|
||||
@@ -456,6 +466,7 @@ public class CalculatedObservationsTest
|
||||
/// Verifies that the Oxygenation_Index is not calculated or persisted when the PaO2_Tidal observation value is zero.
|
||||
/// Ensures that the mapping logic skips downstream calculation and InsertObservation is never invoked in this edge case.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=b4705b3 body=72f7967 -->
|
||||
[Test]
|
||||
public async Task CalculateOxygenationIndex_PaO2_Tidal_0_Not_Returns_Oxygenation_Index()
|
||||
{
|
||||
@@ -513,6 +524,7 @@ public class CalculatedObservationsTest
|
||||
/// by dividing the PaO2 value by the most recent FiO2 observation for the patient and inserting the result as a new
|
||||
/// PatientObservation with the ADAS coding system.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=087da9c body=91ce4a0 -->
|
||||
[Test]
|
||||
public async Task CalculatePF_PaO2_Returns_PaO2_FiO2()
|
||||
{
|
||||
@@ -566,6 +578,7 @@ public class CalculatedObservationsTest
|
||||
/// when an FiO2 observation is processed, by inserting a new patient observation with the
|
||||
/// expected ratio value and coding system.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=83f8636 body=46adcbd -->
|
||||
[Test]
|
||||
public async Task CalculatePF_FiO2_Returns_PaO2_FiO2()
|
||||
{
|
||||
@@ -616,6 +629,7 @@ public class CalculatedObservationsTest
|
||||
/// Verifies that the PF ratio calculation does not produce a PaO2/FiO2 observation when the FiO2 value is zero.
|
||||
/// Ensures that no calculated observation is inserted for the patient under this condition.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=74e2fba body=e97f55c -->
|
||||
[Test]
|
||||
public async Task CalculatePF_FiO2_0_Not_Returns_PaO2_FiO2()
|
||||
{
|
||||
@@ -661,6 +675,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that when patient observations include a low SpO2 (Sattc) value of 50 and a low FC value of 50, the calculated observations processing triggers a BlueCode alarm by inserting the observation and sending the alarm.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=cb9af03 body=d68c56c -->
|
||||
[Test]
|
||||
public async Task
|
||||
SendAlarm_BlueCode_FC_SpO2_Alarm_True_Returns_SendAlarm_BlueCode()
|
||||
@@ -707,6 +722,7 @@ public class CalculatedObservationsTest
|
||||
/// Verifies that when a BlueCode alarm condition is triggered by FC and TAm observations, the calculated blue code list is generated, the observation is inserted, and the blue code alarm is sent with the expected severity and type.
|
||||
/// </summary>
|
||||
/// <returns>A task that completes when the blue code alarm verification has been executed.</returns>
|
||||
/// <!-- aidoc:v1 sig=8d996ea body=861269c -->
|
||||
[Test]
|
||||
public async Task
|
||||
SendAlarm_BlueCode_FC_TAm_Alarm_True_Returns_SendAlarm_BlueCode()
|
||||
@@ -769,6 +785,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that a BlueCode alarm is not triggered when the heart rate (FC) is at 50 and the mean arterial pressure (TAm) values do not meet the BlueCode criteria.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=593d4af body=9dce27f -->
|
||||
[Test]
|
||||
public async Task SendAlarm_BlueCode_FC_TAm_Alarm_False()
|
||||
{
|
||||
@@ -833,6 +850,7 @@ public class CalculatedObservationsTest
|
||||
/// </summary>
|
||||
/// <param name="value">The object whose string representation will be converted to a double.</param>
|
||||
/// <returns>The parsed <see cref="double"/> value if the conversion succeeds; otherwise, <see langword="null"/>.</returns>
|
||||
/// <!-- aidoc:v1 sig=a1cea6b body=2180954 -->
|
||||
private static double? TryparseDouble(object value)
|
||||
{
|
||||
return double.TryParse(value.ToString(), out var valueParsed) ? valueParsed : null;
|
||||
@@ -951,6 +969,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that a <see cref="PatientObservation"/> representing a pump volumetric air occlusion alarm is correctly mapped by the calculated observations mapper, returning a non-null result with a matching name.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=6fdcb6b body=3319cdd -->
|
||||
[Test]
|
||||
public async Task Map_PatientObservation_Alarm_Pump_Retur_obs()
|
||||
{
|
||||
|
||||
@@ -1137,6 +1137,8 @@ public class CalculatedObservationsTest
|
||||
/// Verifies that <see cref="_calculatedObservations"/>.<see cref="ICalculatedObservations.Map(PatientObservation, bool)"/> correctly computes the diuresis-to-weight ratio as 43.6 when the latest diuresis observation value is 3924 and the current weight observation value is 90, and persists a derived <see cref="PatientObservation"/> named "Diuresis_Weight" for the same <paramref name="patientId"/>.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=b46e7fe body=50dd2ac -->
|
||||
/// <!-- aidoc-review:v1 severity=low kind=extra_param
|
||||
/// "<paramref name=\"patientId\"/> references a local variable, not a method parameter; the test method has no parameters." -->
|
||||
[Test]
|
||||
public async Task CalculateDiuresis_Weight_D_3924_Receive_W_90_Return_43_6()
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -1404,6 +1404,7 @@ public class CalculatedObservationsTest
|
||||
/// the Map method creates and inserts a multivalue observation (Respiratory_Device_Multivalue)
|
||||
/// containing the intervention description extracted from the observation value.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=163c94e body=65cb819 -->
|
||||
[Test]
|
||||
public async Task Map_WithInterventionCodeInObservationValue_CallsCalculateInterventionMultiValueObservation()
|
||||
{
|
||||
@@ -1437,6 +1438,7 @@ public class CalculatedObservationsTest
|
||||
/// Verifies that mapping an <c>Intervention_Out</c> observation updates an existing active multi-value observation
|
||||
/// (e.g., <c>Respiratory_Device_Multivalue</c>) for the patient by setting its end time, rather than inserting a new observation.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d1e8de8 body=707d6a7 -->
|
||||
[Test]
|
||||
public async Task Map_WithInterventionOut_UpdatesExistingMultiValueObservation()
|
||||
{
|
||||
@@ -1483,6 +1485,10 @@ public class CalculatedObservationsTest
|
||||
/// Verifies that when a new "Intervention_In" observation is mapped via <c>Map</c> and the patient's prior "Respiratory_Device_Multivalue" observation is expired (so there is no existing active last observation), a new <see cref="PatientObservation"/> named "Respiratory_Device_Multivalue" is inserted containing the new intervention while the existing expired observation is left untouched.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=4271f27 body=7d4a79d -->
|
||||
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
|
||||
/// "The summary states the newly inserted observation is 'containing the new intervention', but the assertion explicitly checks that the inserted value is NOT equal to the new intervention description (`((string[])o.Value)[0] != newInterventionDescription`). The test allows a value that is neither the old nor the new intervention, contradicting the documented behavior." -->
|
||||
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
|
||||
/// "The summary claims 'the existing expired observation is left untouched', but the test only verifies that UpdateObservation is never called; there is no assertion specifically confirming the expired observation is untouched (e.g., it could still be replaced or modified via a path the mocks don't cover)." -->
|
||||
[Test]
|
||||
public async Task Map_WithNewInterventionNoExistingLastIntervention_NewMultiValueObservation()
|
||||
{
|
||||
@@ -1541,6 +1547,8 @@ public class CalculatedObservationsTest
|
||||
/// new record through <see cref="IObservationService.InsertObservation"/>.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=4e3257d body=697676f -->
|
||||
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
|
||||
/// "The summary states 'the new intervention is appended to the existing multi-value observation via UpdateObservation', but the UpdateObservation assertion verifies the updated observation has Length == 1 with only the existing intervention (and Expired = true), NOT the new intervention appended. The assertions verify the existing observation is expired via UpdateObservation and that no combined InsertObservation occurs, contradicting the described append-via-UpdateObservation behavior." -->
|
||||
[Test]
|
||||
public async Task Map_WithNewInterventionAddsToExistingMultiValueObservation()
|
||||
{
|
||||
@@ -1602,6 +1610,7 @@ public class CalculatedObservationsTest
|
||||
/// Verifies that mapping a surgery observation inserts a new Surgery_Multivalue observation
|
||||
/// when no existing multi-value observation is found, and does not trigger an update.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=a509623 body=817f4ef -->
|
||||
[Test]
|
||||
public async Task Map_WithSurgeryObservation_InsertsNewSurgeryMultiValueObservation()
|
||||
{
|
||||
@@ -1645,6 +1654,7 @@ public class CalculatedObservationsTest
|
||||
/// to be expired and replaced with a new multi-value observation that contains both the previously recorded
|
||||
/// surgery value and the newly mapped surgery value.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=d2c7ca7 body=551d45d -->
|
||||
[Test]
|
||||
public async Task Map_WithSurgeryObservation_UpdatesExistingSurgeryMultiValueObservation()
|
||||
{
|
||||
@@ -1700,6 +1710,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that mapping a Surgery observation updates the existing Surgery_Multivalue observation by expiring the duplicate entry and inserting a new observation with the duplicate value removed.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=46caac9 body=55e3f72 -->
|
||||
[Test]
|
||||
public async Task Map_WithSurgeryObservation_UpdatesExistingSurgeryMultiValueObservation_RemovesDuplicate()
|
||||
{
|
||||
@@ -1754,6 +1765,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that does not insert or update any observation when a surgery observation is provided with a non-string <c>Value</c>.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=e4795ba body=7bfc460 -->
|
||||
[Test]
|
||||
public async Task Map_WithSurgeryObservation_HandlesNonStringValue()
|
||||
{
|
||||
@@ -1782,6 +1794,7 @@ public class CalculatedObservationsTest
|
||||
/// Verifies that the <see cref="CalculatedObservations.Map"/> method, when invoked with a respiratory device multivalue observation
|
||||
/// and no prior observations, inserts a "Complexity" observation with a value of 1.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=09fcb0a body=445a173 -->
|
||||
[Test]
|
||||
public async Task Map_WithRespiratoryDeviceMultiValueObservation_CallsCalculateComplexity_Return1()
|
||||
{
|
||||
@@ -1887,6 +1900,8 @@ public class CalculatedObservationsTest
|
||||
/// </summary>
|
||||
/// <param name="observation">The <see cref="PatientObservation"/> instance passed implicitly to the
|
||||
/// test runner; not directly used as a method argument since this is a parameterless test method.</param>
|
||||
/// <!-- aidoc-review:v1 severity=medium kind=extra_param
|
||||
/// "The test method has no parameters, but the documentation includes a <param name=\"observation\"> tag. While the text acknowledges it is parameterless, the tag itself should not exist." -->
|
||||
[Test]
|
||||
public async Task Map_WithTwoMedicationMultiValueObservation_CalculatesComplexity_Return4()
|
||||
{
|
||||
@@ -1928,6 +1943,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that when a patient has a system multivalue observation, medication multivalue observations, and a newborn weight observation, the mapping process calculates a complexity value of 9 and inserts it as a new "Complexity" observation.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=fdea61e body=5aa8c09 -->
|
||||
[Test]
|
||||
public async Task Map_WithSystemMedicationAndNewbornWeightMultiValueObservation_CalculatesComplexity_Return9()
|
||||
{
|
||||
@@ -2025,6 +2041,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that the <c>Map</c> method correctly calculates a complexity value of 13 when the input observation represents surgery, medication, and newborn weight data, by aggregating the per-section contribution of each observation type.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=9b92aff body=952f1bc -->
|
||||
[Test]
|
||||
public async Task Map_WithSurgeryMedicationMewbornWeightMultiValueObservation_CalculatesComplexity_Returns13()
|
||||
{
|
||||
@@ -2356,6 +2373,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that mapping a patient treatment with no placer order returns the original treatment unchanged.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=4641a92 body=97aa6f6 -->
|
||||
[Test]
|
||||
public async Task Map_TreatmentWithNoPlacerOrder_ReturnsOriginalTreatment()
|
||||
{
|
||||
@@ -2374,6 +2392,7 @@ public class CalculatedObservationsTest
|
||||
/// Verifies that mapping a treatment which has active older treatments sets the order control to <c>XO</c>
|
||||
/// (cancel as a result of a new order being accepted) and does not insert a new observation.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=3fa3c83 body=55a8c26 -->
|
||||
[Test]
|
||||
public async Task Map_TreatmentWithActiveOlderTreatments_SetsOrderControlToXO()
|
||||
{
|
||||
@@ -2399,6 +2418,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that when mapping a patient treatment with no active older treatments, the resulting order control is set to <see cref="OrderControlType.Nw"/> and no patient observation is inserted.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=a3a0846 body=9a069fa -->
|
||||
[Test]
|
||||
public async Task Map_TreatmentWithNoActiveOlderTreatments_SetsOrderControlToNW()
|
||||
{
|
||||
@@ -2423,6 +2443,7 @@ public class CalculatedObservationsTest
|
||||
/// <summary>
|
||||
/// Verifies that when a patient treatment has an end time set, mapping it sets the order control to <see cref="OrderControlType.Dc"/> and does not insert a new observation.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=c977810 body=b9cabf5 -->
|
||||
[Test]
|
||||
public async Task Map_TreatmentWithEndTimeSet_SetsOrderControlToDC()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user