Class CalculatedObservations
- Namespace
- adas_core.Application.Customizations.NursePlan
- Assembly
- adas-core.Application.dll
Provides calculated observations by leveraging services obtained from the injected service provider.
public class CalculatedObservations : ICalculatedObservations
- Inheritance
-
CalculatedObservations
- Implements
- Inherited Members
- Extension Methods
Constructors
CalculatedObservations(IServiceProvider)
Provides calculated observations by leveraging services obtained from the injected service provider.
public CalculatedObservations(IServiceProvider serviceProvider)
Parameters
serviceProviderIServiceProvider
Methods
CalculateActiveBolus(ObjectId)
Asynchronously calculates the active bolus for the specified patient.
public Task CalculateActiveBolus(ObjectId patientId)
Parameters
patientIdObjectIdThe unique identifier of the patient whose active bolus is to be calculated.
Returns
Exceptions
- NotImplementedException
Thrown when the method is invoked, as the calculation logic has not yet been implemented.
CalculateMedicineObservation(List<Medicine>, ObjectId)
Asynchronously calculates a medicine observation for the specified patient based on their active medicines.
public Task CalculateMedicineObservation(List<Medicine> activeMedicines, ObjectId patientId)
Parameters
activeMedicinesList<Medicine>The collection of medicines currently active for the patient.
patientIdObjectIdThe identifier of the patient whose medicine observation is being calculated.
Returns
Exceptions
- NotImplementedException
The method is not yet implemented.
FixTimeInconsistencyWithLast(PatientObservation)
Asynchronously resolves time inconsistencies between the supplied observation and the most recent previous observation, returning a corrected observation or null when no correction is required.
public Task<PatientObservation?> FixTimeInconsistencyWithLast(PatientObservation newObservation)
Parameters
newObservationPatientObservationThe new patient observation whose timestamps may need to be reconciled with the last recorded observation.
Returns
- Task<PatientObservation>
A task that represents the asynchronous operation. The task result contains the fixed PatientObservation, or
nullwhen no time inconsistency is detected.
Exceptions
- NotImplementedException
Thrown because the method has not been implemented yet.
GetActiveTreatmentsByPatient(ObjectId)
Asynchronously retrieves the active treatment records associated with the specified patient.
public Task<IEnumerable<PatientTreatment?>> GetActiveTreatmentsByPatient(ObjectId id)
Parameters
idObjectIdThe unique identifier of the patient whose active treatments are being queried.
Returns
- Task<IEnumerable<PatientTreatment>>
A task representing the asynchronous operation, containing a collection of active PatientTreatment entries, which may include null values, for the specified patient.
Exceptions
- NotImplementedException
The method has not yet been implemented.
Map(PatientDiagnosis)
Maps a PatientDiagnosis instance to a completed task containing the same instance.
public Task<PatientDiagnosis> Map(PatientDiagnosis diagnosis)
Parameters
diagnosisPatientDiagnosisThe patient diagnosis to be returned as a completed task result.
Returns
- Task<PatientDiagnosis>
A completed Task<TResult> containing the provided diagnosis.
Map(PatientTreatment)
Maps a patient treatment to its target representation asynchronously, returning the provided treatment instance unchanged.
public Task<PatientTreatment> Map(PatientTreatment treatment)
Parameters
treatmentPatientTreatmentThe patient treatment to map.
Returns
- Task<PatientTreatment>
A task containing the mapped patient treatment.
Map(PumpObservation)
Asynchronously maps the provided PumpObservation, returning the input instance as the mapping result.
public Task<PumpObservation> Map(PumpObservation pumpObservation)
Parameters
pumpObservationPumpObservationThe PumpObservation to be mapped.
Returns
- Task<PumpObservation>
A task containing the mapped PumpObservation.
MapSourceAlarm(PatientObservation, PatientObservationAlarm)
Returns the provided obs as-is, ignoring the alarmToInsert parameter.
public Task<PatientObservation> MapSourceAlarm(PatientObservation obs, PatientObservationAlarm alarmToInsert)
Parameters
obsPatientObservationThe patient observation to return.
alarmToInsertPatientObservationAlarmThe patient observation alarm; not used in the current implementation.
Returns
- Task<PatientObservation>
A completed task containing the original
obs.
Map<T>(T, bool)
Returns the provided patient observation wrapped in a completed task without modification.
public Task<T?> Map<T>(T obs, bool onlyByName = false) where T : BasePatientObservation
Parameters
obsTThe patient observation to return.
onlyByNameboolReserved flag that is not used in the current implementation.
Returns
- Task<T>
A completed task containing the provided observation.
Type Parameters
T
PreMapList(List<PatientObservation>)
Returns the provided patient observation list unchanged as a pre-mapping step, typically used as a hook before further mapping or insertion operations.
public Task<List<PatientObservation>> PreMapList(List<PatientObservation> listToInsert)
Parameters
listToInsertList<PatientObservation>The list of patient observations to be pre-mapped.
Returns
- Task<List<PatientObservation>>
A completed Task<TResult> containing the original list of patient observations.
SendAlarm(PatientObservation, string, Name?)
Sends an alarm notification based on the specified patient observation, name, and optional alarm code.
public Task SendAlarm(PatientObservation obs, string name, AlarmEnum.Name? code)
Parameters
obsPatientObservationThe patient observation that triggers the alarm.
namestringThe name associated with the alarm.
codeAlarmEnum.Name?The optional alarm code identifying the alarm type.