Table of Contents

Class DefaultCalculatedObservations

Namespace
adas_core.Application.Services
Assembly
adas-core.Application.dll

Provides the default implementation of the ICalculatedObservations interface.

public class DefaultCalculatedObservations : ICalculatedObservations
Inheritance
DefaultCalculatedObservations
Implements
Inherited Members
Extension Methods

Methods

CalculateActiveBolus(ObjectId)

Calculates the active bolus for the specified patient.

public Task CalculateActiveBolus(ObjectId patientId)

Parameters

patientId ObjectId

The unique identifier of the patient whose active bolus is being calculated.

Returns

Task

CalculateMedicineObservation(List<Medicine>, ObjectId)

Asynchronously calculates medicine observations for a patient based on their currently active medicines.

public Task CalculateMedicineObservation(List<Medicine> activeMedicines, ObjectId patientId)

Parameters

activeMedicines List<Medicine>

The list of medicines currently active for the patient, used as the basis for the observation calculation.

patientId ObjectId

The identifier of the patient whose medicine observations are being calculated.

Returns

Task

FixTimeInconsistencyWithLast(PatientObservation)

Processes a new patient observation to address potential time inconsistency with the previous observation, returning the observation unchanged.

public Task<PatientObservation?> FixTimeInconsistencyWithLast(PatientObservation newObservation)

Parameters

newObservation PatientObservation

The new patient observation to evaluate for time consistency with the prior observation.

Returns

Task<PatientObservation>

A task that represents the asynchronous operation, containing the provided patient observation.

GetActiveTreatmentsByPatient(ObjectId)

Retrieves the active treatments associated with the specified patient identifier. Returns an empty collection, typically serving as a stub or fallback when no treatments are available.

public Task<IEnumerable<PatientTreatment?>> GetActiveTreatmentsByPatient(ObjectId id)

Parameters

id ObjectId

The unique identifier of the patient whose active treatments are being retrieved.

Returns

Task<IEnumerable<PatientTreatment>>

A task representing the asynchronous operation, containing an enumerable collection of the patient's active treatments, or an empty collection if none are found.

Map(PatientDiagnosis)

Returns the provided patient diagnosis as-is, wrapped in a completed task for asynchronous compatibility.

public Task<PatientDiagnosis> Map(PatientDiagnosis diagnosis)

Parameters

diagnosis PatientDiagnosis

The patient diagnosis to map.

Returns

Task<PatientDiagnosis>

A task that represents the asynchronous operation, containing the provided patient diagnosis.

Map(PatientTreatment)

Maps a PatientTreatment instance to a completed task, returning the provided treatment unchanged.

public Task<PatientTreatment> Map(PatientTreatment treatment)

Parameters

treatment PatientTreatment

The patient treatment to map.

Returns

Task<PatientTreatment>

A Task<TResult> that completes with the supplied treatment.

Map(PumpObservation)

Maps a PumpObservation instance to a target PumpObservation representation asynchronously.

public Task<PumpObservation> Map(PumpObservation pumpObservation)

Parameters

pumpObservation PumpObservation

The source PumpObservation to be mapped.

Returns

Task<PumpObservation>

A task that represents the asynchronous mapping operation, containing the resulting PumpObservation.

Exceptions

NotImplementedException

Thrown when the method is invoked, as the mapping logic has not been implemented yet.

MapSourceAlarm(PatientObservation, PatientObservationAlarm)

Maps a source alarm onto a PatientObservation and returns the observation wrapped in a completed task. In the current implementation, the observation is returned as-is without applying the supplied alarm.

public Task<PatientObservation> MapSourceAlarm(PatientObservation obs, PatientObservationAlarm alarmToInsert)

Parameters

obs PatientObservation

The patient observation to be returned by the mapping.

alarmToInsert PatientObservationAlarm

The patient observation alarm intended to be associated with the observation.

Returns

Task<PatientObservation>

A completed Task<TResult> containing the PatientObservation.

Map<T>(T, bool)

Returns the provided patient observation as a completed task, preserving the original instance for further processing.

public Task<T?> Map<T>(T obs, bool onlyByName) where T : BasePatientObservation

Parameters

obs T

The patient observation to map.

onlyByName bool

A flag indicating whether mapping should be performed by name only.

Returns

Task<T>

A completed Task<TResult> containing the provided observation.

Type Parameters

T

PreMapList(List<PatientObservation>)

Performs a pre-mapping step on a list of patient observations before further processing, returning the list unchanged.

public Task<List<PatientObservation>> PreMapList(List<PatientObservation> listToInsert)

Parameters

listToInsert List<PatientObservation>

The list of patient observations to be pre-mapped.

Returns

Task<List<PatientObservation>>

A completed task containing the provided list of patient observations.

SendAlarm(PatientObservation, string, Name?)

Sends an alarm notification based on the provided patient observation, associated name, and optional alarm code.

public Task SendAlarm(PatientObservation obs, string name, AlarmEnum.Name? code)

Parameters

obs PatientObservation

The patient observation that triggers the alarm.

name string

The name associated with the alarm being sent.

code AlarmEnum.Name?

The optional alarm code that categorizes the type of alarm; may be null when no specific code applies.

Returns

Task

Exceptions

NotImplementedException

Thrown in all cases, as the method has not been implemented yet.