Documentation modifications

This commit is contained in:
julian
2026-06-27 15:23:26 -07:00
parent a633fe6c06
commit a19fb90902
218 changed files with 2882 additions and 0 deletions
@@ -14,9 +14,17 @@ using Options = Microsoft.Extensions.Options.Options;
namespace adas_core.Test.Services;
/// <summary>
/// Contains unit tests for the <see cref="MedicineService"/> class, verifying its behavior and contracts.
/// </summary>
/// <!-- aidoc:v1 sig=6e8ca9d -->
[TestFixture]
public class MedicineServiceTest
{
/// <summary>
/// Initializes the test dependencies for <see cref="MedicineService"/> unit tests by creating mocks for <see cref="IMedicineRepository"/>, <see cref="ITreatmentService"/>, and <see cref="ILogger{MedicineService}"/>, then constructing the service under test with the required collaborators.
/// </summary>
/// <!-- aidoc:v1 sig=dee8bf2 body=c01c921 -->
[SetUp]
public void Setup()
{
@@ -55,6 +63,11 @@ public class MedicineServiceTest
//private static readonly DateTime now = DateTime.Now;
private static readonly ObjectId PatientId = ObjectId.GenerateNewId();
/// <summary>
/// Verifies that <see cref="MedicineService.GetMedicinesOfTreatments"/> returns an empty result (count of 0) when <see cref="IMedicineRepository.GetMedicineByCodeOrNote"/> yields no <see cref="Medicine"/> items for the supplied <see cref="PatientTreatment"/> entries.
/// </summary>
/// <exception cref="ArgumentNullException">Thrown when the local <see cref="List{PatientTreatment}"/> collection is null.</exception>
/// <!-- aidoc:v1 sig=6587029 body=89ace4d -->
[Test]
public async Task GetMedicinesOfTreatments_Null_Medicine_Return_0()
{
@@ -71,6 +84,11 @@ public class MedicineServiceTest
Assert.That(result.Count(), EqualTo(0));
}
/// <summary>
/// Verifies that <see cref="MedicineService.GetMedicinesOfTreatments"/> returns medicines when the supplied
/// <see cref="List{PatientTreatment}"/> contains codes matching medicines registered in the repository.
/// </summary>
/// <!-- aidoc:v1 sig=9b6ab1e body=dfdcc25 -->
[Test]
public async Task GetMedicinesOfTreatments_Medicines_Return_Medicines()
{
@@ -117,6 +135,10 @@ public class MedicineServiceTest
Assert.That(result.Count(), GreaterThan(0));
}
/// <summary>
/// Tests that <see cref="MedicineService.GetMedicinesOfTreatments"/> returns medicines for a <see cref="PatientTreatment"/> when the medicine repository returns no results for <see cref="MedicineRepository.GetMedicineByCodeOrNote"/>, verifying that the returned medicines contain the identifier and text extracted from <see cref="PatientTreatment.RequestedGiveCodes"/>.
/// </summary>
/// <!-- aidoc:v1 sig=1cd9fc2 body=15ec2c4 -->
[Test]
public async Task GetMedicinesOfTreatments_Not_Get_Medicines_Return_Note_Medicines()
{
@@ -152,6 +174,10 @@ public class MedicineServiceTest
};
}
/// <summary>
/// Verifies that <see cref="MedicineService.GetMedicinesOfTreatments"/> falls back to constructing medicines from the <see cref="PatientTreatment.RequestedGiveCodes"/> text when the medicine repository returns no medicines matching the requested codes.
/// </summary>
/// <!-- aidoc:v1 sig=2beba14 body=6e04063 -->
[Test]
public async Task GetMedicinesOfTreatments_Not_Get_Medicines_Not_Code_identifier_Return_Note_Medicines()
{
@@ -188,6 +214,10 @@ public class MedicineServiceTest
};
}
/// <summary>
/// Verifies that <see cref="MedicineService.GetMedicinesOfTreatments"/> returns an NPT <see cref="Medicine"/> with type <see cref="MedicineEnum.Types.ParenteralNutrition"/> when the <see cref="PatientTreatment"/> notes contain the "NPT" formularybaseformulation comment.
/// </summary>
/// <!-- aidoc:v1 sig=186f001 body=182af67 -->
[Test]
public async Task CalculateParentalNutritionMedicine_Notes_NPT_Return_NPT_Medicine()
{
@@ -226,6 +256,10 @@ public class MedicineServiceTest
};
}
/// <summary>
/// Verifies that when a <see cref="PatientTreatment"/> includes notes indicating "NPT" parenteral nutrition and a lipid formulation comment, <see cref="MedicineService.GetMedicinesOfTreatments"/> resolves the treatment into a <see cref="Medicine"/> named "NPT" of type <see cref="MedicineEnum.Types.ParenteralNutritionLipids"/> with no associated code, even when <see cref="IMedicineRepository.GetMedicineByCodeOrNote"/> returns an empty list.
/// </summary>
/// <!-- aidoc:v1 sig=bfdb93a body=11a42b3 -->
[Test]
public async Task CalculateParentalNutritionMedicine_Notes_NPTL_Return_NPTL_Medicine()
{