Interface ICalculatedObservations
- Namespace
- adas_core.Application.Services.Interfaces
- Assembly
- adas-core.Application.dll
public interface ICalculatedObservations
- Extension Methods
Methods
CalculateActiveBolus(ObjectId)
Calculates the active bolus for the specified patient.
Task CalculateActiveBolus(ObjectId patientId)
Parameters
patientIdObjectIdThe unique identifier of the patient whose active bolus is to be calculated.
Returns
CalculateMedicineObservation(List<Medicine>, ObjectId)
Asynchronously calculates a medicine observation for a patient based on their active medicines.
Task CalculateMedicineObservation(List<Medicine> activeMedicines, ObjectId patientId)
Parameters
activeMedicinesList<Medicine>The list of medicines currently active for the patient.
patientIdObjectIdThe unique identifier of the patient whose observation is being calculated.
Returns
FixTimeInconsistencyWithLast(PatientObservation)
Resolves time inconsistencies between the new observation and the last stored observation, returning a corrected version when applicable.
Task<PatientObservation?> FixTimeInconsistencyWithLast(PatientObservation newObservation)
Parameters
newObservationPatientObservationThe new patient observation to validate and reconcile against the previous observation's time information.
Returns
- Task<PatientObservation>
A task that yields the fixed PatientObservation, or
nullwhen no time inconsistency is detected or no correction is required.
GetActiveTreatmentsByPatient(ObjectId)
Retrieves the active treatments associated with a specific patient by their unique identifier.
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 that represents the asynchronous operation, containing a collection of nullable PatientTreatment entries that represent the active treatments for the specified patient.
Map(PatientDiagnosis)
Asynchronously maps a PatientDiagnosis to a PatientDiagnosis representation.
Task<PatientDiagnosis> Map(PatientDiagnosis diagnosis)
Parameters
diagnosisPatientDiagnosisThe patient diagnosis to be mapped.
Returns
- Task<PatientDiagnosis>
A task that represents the asynchronous mapping operation, containing the mapped PatientDiagnosis.
Map(PatientTreatment)
Asynchronously maps the specified treatment to a PatientTreatment result.
Task<PatientTreatment> Map(PatientTreatment treatment)
Parameters
treatmentPatientTreatmentThe patient treatment instance to map.
Returns
- Task<PatientTreatment>
A task that represents the asynchronous mapping operation. The task result contains the mapped PatientTreatment.
Map(PumpObservation)
Asynchronously maps the specified PumpObservation to a PumpObservation result.
Task<PumpObservation> Map(PumpObservation pumpObservation)
Parameters
pumpObservationPumpObservationThe PumpObservation to be mapped.
Returns
- Task<PumpObservation>
A Task<TResult> representing the asynchronous operation, containing the mapped PumpObservation.
MapSourceAlarm(PatientObservation, PatientObservationAlarm)
Maps the source alarm onto the specified patient observation and returns the resulting observation.
Task<PatientObservation> MapSourceAlarm(PatientObservation obs, PatientObservationAlarm alarmToInsert)
Parameters
obsPatientObservationThe patient observation to which the source alarm will be mapped.
alarmToInsertPatientObservationAlarmThe patient observation alarm to insert and map as the source alarm.
Returns
- Task<PatientObservation>
A task representing the asynchronous operation, containing the patient observation with the source alarm mapped.
Map<T>(T, bool)
Asynchronously maps a patient observation to a corresponding target type, optionally restricting the mapping to name-based matching only.
Task<T?> Map<T>(T obs, bool onlyByName = false) where T : BasePatientObservation
Parameters
obsTThe source patient observation to be mapped.
onlyByNameboolWhen set to
true, the mapping is performed considering only the observation name; otherwise, additional mapping criteria are applied. Defaults tofalse.
Returns
- Task<T>
A Task<TResult> that represents the asynchronous mapping operation. The result is the mapped observation of type
T, ornullwhen no matching mapping is found.
Type Parameters
T
PreMapList(List<PatientObservation>)
Performs pre-insertion mapping on a list of patient observations, transforming or preparing the data before it is persisted.
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 task that represents the asynchronous operation, containing the mapped list of patient observations.
SendAlarm(PatientObservation, string, Name?)
Sends an alarm associated with the specified patient observation, optionally classified by an alarm code.
Task SendAlarm(PatientObservation obs, string name, AlarmEnum.Name? code)
Parameters
obsPatientObservationThe patient observation that triggered the alarm.
namestringThe name associated with the alarm.
codeAlarmEnum.Name?An optional alarm code categorizing the type of alarm to send.