Class CalculatedObservations
- Namespace
- adas_core.Application.Customizations.CHUO
- Assembly
- adas-core.Application.dll
Provides calculated observation data by implementing the ICalculatedObservations contract.
public class CalculatedObservations : ICalculatedObservations
- Inheritance
-
CalculatedObservations
- Implements
- Inherited Members
- Extension Methods
Remarks
Instances are constructed with an IServiceProvider used to resolve dependencies required by the implementation.
Constructors
CalculatedObservations(IServiceProvider)
Provides calculated observation data by implementing the ICalculatedObservations contract.
public CalculatedObservations(IServiceProvider serviceProvider)
Parameters
serviceProviderIServiceProvider
Remarks
Instances are constructed with an IServiceProvider used to resolve dependencies required by the implementation.
Methods
CalculateActiveBolus(ObjectId)
Asynchronously calculates the active bolus for the specified patient.
public Task CalculateActiveBolus(ObjectId patientId)
Parameters
patientIdObjectIdThe unique identifier of the patient for whom the active bolus is being calculated.
Returns
CalculateMedicineObservation(List<Medicine>, ObjectId)
Calculates medicine observations for the specified patient based on the provided active medicines.
public Task CalculateMedicineObservation(List<Medicine> activeMedicines, ObjectId patientId)
Parameters
activeMedicinesList<Medicine>The list of medicines currently active for the patient.
patientIdObjectIdThe identifier of the patient for whom the observation is calculated.
Returns
FixTimeInconsistencyWithLast(PatientObservation)
Resolves time inconsistencies between a new patient observation and the most recent one, returning a corrected observation when a discrepancy is detected.
public Task<PatientObservation?> FixTimeInconsistencyWithLast(PatientObservation newObservation)
Parameters
newObservationPatientObservationThe new patient observation to compare and reconcile against the last stored observation.
Returns
- Task<PatientObservation>
A task that yields the corrected PatientObservation, or
nullwhen no time inconsistency is found.
Exceptions
- NotImplementedException
Thrown because the method has not been implemented yet.
GetActiveTreatmentsByPatient(ObjectId)
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 requested.
Returns
- Task<IEnumerable<PatientTreatment>>
A task that represents the asynchronous operation. The task result contains a collection of nullable PatientTreatment objects representing the patient's active treatments.
Exceptions
- NotImplementedException
Thrown to indicate that the method has not yet been implemented.
Map(PatientDiagnosis)
Maps a PatientDiagnosis instance to a PatientDiagnosis result.
public Task<PatientDiagnosis> Map(PatientDiagnosis diagnosis)
Parameters
diagnosisPatientDiagnosisThe patient diagnosis to be mapped.
Returns
- Task<PatientDiagnosis>
A task representing the asynchronous operation, containing the mapped PatientDiagnosis.
Exceptions
- NotImplementedException
Thrown because the mapping logic has not yet been implemented.
Map(PatientTreatment)
Maps the specified PatientTreatment to a resulting PatientTreatment instance asynchronously.
public Task<PatientTreatment> Map(PatientTreatment treatment)
Parameters
treatmentPatientTreatmentThe patient treatment to be mapped.
Returns
- Task<PatientTreatment>
A task that represents the asynchronous mapping operation, containing the resulting PatientTreatment.
Exceptions
- NotImplementedException
Thrown when the method is invoked, as the mapping has not been implemented.
Map(PumpObservation)
Asynchronously maps the provided PumpObservation instance, returning the same instance as the result.
public Task<PumpObservation> Map(PumpObservation pumpObservation)
Parameters
pumpObservationPumpObservationThe pump observation to map.
Returns
- Task<PumpObservation>
A Task<TResult> containing the provided pump observation.
MapSourceAlarm(PatientObservation, PatientObservationAlarm)
Maps a source alarm onto a PatientObservation, returning the observation as-is without applying the alarm's changes.
public Task<PatientObservation> MapSourceAlarm(PatientObservation obs, PatientObservationAlarm alarmToInsert)
Parameters
obsPatientObservationThe existing patient observation to be returned.
alarmToInsertPatientObservationAlarmThe alarm to be associated with the observation (currently not applied).
Returns
- Task<PatientObservation>
A completed Task<TResult> containing the original observation.
Map<T>(T, bool)
Maps a patient observation by returning it as-is, logging the operation as a trace entry.
public Task<T?> Map<T>(T obs, bool onlyByName = false) where T : BasePatientObservation
Parameters
obsTThe patient observation to map.
onlyByNameboolIndicates whether mapping should be performed by name only.
Returns
- Task<T>
A task containing the provided observation.
Type Parameters
T
PreMapList(List<PatientObservation>)
Performs a pre-mapping step on a list of patient observations before they are inserted. Currently acts as a pass-through, returning the provided list unchanged as a completed task, but can be overridden to apply transformations or validations.
public Task<List<PatientObservation>> PreMapList(List<PatientObservation> listToInsert)
Parameters
listToInsertList<PatientObservation>The list of patient observations to be pre-mapped prior to insertion.
Returns
- Task<List<PatientObservation>>
A completed task containing the provided list of patient observations.
SendAlarm(PatientObservation, string, Name?)
Sends an alarm notification for the specified patient observation, identified by the given 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 of the alarm to send.
codeAlarmEnum.Name?The optional alarm code providing additional classification for the alarm.