=== 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:
julian
2026-06-28 02:50:05 -07:00
parent a19fb90902
commit 586f02a2ca
654 changed files with 5260 additions and 0 deletions
@@ -14,6 +14,7 @@ namespace adas_core.Application.Customizations.BD;
/// <remarks>
/// This type is instantiated with a primary constructor that accepts an <see cref="IServiceProvider"/> to resolve its dependencies.
/// </remarks>
/// <!-- aidoc:v1 sig=c3598e8 -->
public class CalculatedObservations(IServiceProvider serviceProvider) : ICalculatedObservations
{
private readonly ILogger<CalculatedObservations> _logger =
@@ -29,6 +30,8 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// <param name="obs">The patient observation to map.</param>
/// <param name="onlyByName">Indicates whether the mapping should match observations by name only.</param>
/// <returns>A <see cref="Task{T}"/> containing the provided observation.</returns>
/// <!-- aidoc-review:v1 severity=low kind=wrong_returns
/// "The method returns Task<T?> (nullable), but the documentation references Task{T} (non-nullable Task<T>)." -->
public Task<T?> Map<T>(T obs, bool onlyByName = false) where T : BasePatientObservation
{
return Task.FromResult(obs)!;
@@ -39,6 +42,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// </summary>
/// <param name="treatment">The patient treatment instance to map.</param>
/// <returns>A completed <see cref="Task{PatientTreatment}"/> containing the provided treatment.</returns>
/// <!-- aidoc:v1 sig=adce250 body=cf46cd2 -->
public Task<PatientTreatment> Map(PatientTreatment treatment)
{
return Task.FromResult(treatment);
@@ -49,6 +53,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// </summary>
/// <param name="diagnosis">The <see cref="PatientDiagnosis"/> instance to map.</param>
/// <returns>A <see cref="Task{TResult}"/> containing the provided <see cref="PatientDiagnosis"/>.</returns>
/// <!-- aidoc:v1 sig=8ddf601 body=ad326e6 -->
public Task<PatientDiagnosis> Map(PatientDiagnosis diagnosis)
{
return Task.FromResult(diagnosis);
@@ -59,6 +64,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// </summary>
/// <param name="pumpObservation">The pump observation to be mapped.</param>
/// <returns>The mapped pump observation.</returns>
/// <!-- aidoc:v1 sig=50be4c1 body=9b6ad6e -->
public async Task<PumpObservation> Map(PumpObservation pumpObservation)
{
if (pumpObservation.Code == "IHE PCD-04")
@@ -71,6 +77,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// </summary>
/// <param name="activeMedicines">The list of active medicines associated with the patient.</param>
/// <param name="patientId">The unique identifier of the patient for whom the observations are calculated.</param>
/// <!-- aidoc:v1 sig=b7a50a4 body=6805ef5 -->
public Task CalculateMedicineObservation(List<Medicine> activeMedicines, ObjectId patientId)
{
return Task.CompletedTask;
@@ -81,6 +88,8 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// </summary>
/// <param name="patientId">The unique identifier of the patient whose active bolus is being calculated.</param>
/// <returns>A task that represents the asynchronous calculation of the active bolus.</returns>
/// <!-- aidoc-review:v1 severity=high kind=wrong_summary
/// "The summary and returns description state that the method 'calculates' the active bolus, but the body only returns Task.CompletedTask and performs no calculation." -->
public Task CalculateActiveBolus(ObjectId patientId)
{
return Task.CompletedTask;
@@ -92,6 +101,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// <param name="id">The unique <see cref="ObjectId"/> identifier of the patient whose active treatments are being requested.</param>
/// <returns>A task that represents the asynchronous operation, containing an <see cref="IEnumerable{PatientTreatment}"/> of nullable <see cref="PatientTreatment"/> entries for the patient's active treatments.</returns>
/// <exception cref="NotImplementedException">Thrown to indicate that the method is not yet implemented.</exception>
/// <!-- aidoc:v1 sig=db74f82 body=bfa6f2f -->
public Task<IEnumerable<PatientTreatment?>> GetActiveTreatmentsByPatient(ObjectId id)
{
throw new NotImplementedException();
@@ -103,6 +113,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// <param name="newObservation">The new patient observation to be reconciled against the last stored observation.</param>
/// <returns>A task that yields the time-corrected <see cref="PatientObservation"/>, or <c>null</c> when no correction is required or no prior observation exists.</returns>
/// <exception cref="NotImplementedException">Thrown because the method has not been implemented yet.</exception>
/// <!-- aidoc:v1 sig=cb71754 body=bfa6f2f -->
public Task<PatientObservation?> FixTimeInconsistencyWithLast(PatientObservation newObservation)
{
throw new NotImplementedException();
@@ -114,6 +125,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// </summary>
/// <param name="listToInsert">The list of patient observations to be pre-mapped before insertion.</param>
/// <returns>A task containing the provided list of patient observations.</returns>
/// <!-- aidoc:v1 sig=5a37e9b body=0791af0 -->
public Task<List<PatientObservation>> PreMapList(List<PatientObservation> listToInsert)
{
return Task.FromResult(listToInsert);
@@ -126,6 +138,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// <param name="alarmToInsert">The source alarm to be inserted/mapped into the observation.</param>
/// <returns>A <see cref="Task{PatientObservation}"/> that represents the asynchronous mapping operation, returning the resulting patient observation.</returns>
/// <exception cref="NotImplementedException">Thrown because the method has not been implemented yet.</exception>
/// <!-- aidoc:v1 sig=405db8e body=bfa6f2f -->
public Task<PatientObservation> MapSourceAlarm(PatientObservation obs, PatientObservationAlarm alarmToInsert)
{
throw new NotImplementedException();
@@ -139,6 +152,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// <param name="code">The optional alarm code that categorizes the alarm; may be null.</param>
/// <returns>A task that represents the asynchronous alarm sending operation.</returns>
/// <exception cref="NotImplementedException">Thrown because the method is not yet implemented.</exception>
/// <!-- aidoc:v1 sig=90426a4 body=bfa6f2f -->
public Task SendAlarm(PatientObservation obs, string name, AlarmEnum.Name? code)
{
throw new NotImplementedException();
@@ -152,6 +166,7 @@ public class CalculatedObservations(IServiceProvider serviceProvider) : ICalcula
/// </summary>
/// <param name="pumpObservation">The pump observation containing the alarm state, type, timestamps, and identifiers used to build the alarm patient observation.</param>
/// <returns>A completed <see cref="Task"/> representing the insert operation, which never faults since exceptions are caught internally.</returns>
/// <!-- aidoc:v1 sig=8716f6b body=6590257 -->
private Task CreatePumpAlarmObservation(PumpObservation pumpObservation)
{
PatientObservation patientObservationAlarm = new()