=== 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:
@@ -11,6 +11,7 @@ namespace adas_core.Application.Services;
|
||||
/// <summary>
|
||||
/// Implements the <see cref="ICalculatedObservationsService"/> contract, providing a service for working with calculated observations.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=955972a -->
|
||||
public class CalculatedObservationsService : ICalculatedObservationsService
|
||||
{
|
||||
private static ICalculatedObservations? _service;
|
||||
@@ -78,6 +79,7 @@ public class CalculatedObservationsService : ICalculatedObservationsService
|
||||
/// <param name="obs">The patient observation to map.</param>
|
||||
/// <param name="onlyByName">When <c>true</c>, restricts the mapping to lookups by name only.</param>
|
||||
/// <returns>The mapped <see cref="PatientObservation"/>, or <c>null</c> when the service yields no result; the input <paramref name="obs"/> is returned unchanged when no mapping service is configured.</returns>
|
||||
/// <!-- aidoc:v1 sig=4b4df54 body=a7f1fb2 -->
|
||||
public virtual async Task<PatientObservation?> Map(PatientObservation obs, bool onlyByName = false)
|
||||
{
|
||||
if (_service == null) return obs;
|
||||
@@ -94,6 +96,7 @@ public class CalculatedObservationsService : ICalculatedObservationsService
|
||||
/// <param name="obs">The patient observation alarm to be mapped.</param>
|
||||
/// <param name="onlyByName">When true, restricts the mapping to a name-based lookup only.</param>
|
||||
/// <returns>The mapped <see cref="PatientObservationAlarm"/>, or <c>null</c> if the service mapped it to null, or the original <paramref name="obs"/> when no service is configured.</returns>
|
||||
/// <!-- aidoc:v1 sig=550b0f3 body=a7f1fb2 -->
|
||||
public virtual async Task<PatientObservationAlarm?> Map(PatientObservationAlarm obs, bool onlyByName = false)
|
||||
{
|
||||
if (_service == null) return obs;
|
||||
@@ -110,6 +113,7 @@ public class CalculatedObservationsService : ICalculatedObservationsService
|
||||
/// </summary>
|
||||
/// <param name="obs">The pump observation to be mapped.</param>
|
||||
/// <returns>A task that yields the mapped <see cref="PumpObservation"/>, or <see langword="null"/> if no mapping service is available.</returns>
|
||||
/// <!-- aidoc:v1 sig=b69cb93 body=75e8a34 -->
|
||||
public virtual async Task<PumpObservation?> Map(PumpObservation obs)
|
||||
{
|
||||
if (_service == null) return null;
|
||||
@@ -122,6 +126,7 @@ public class CalculatedObservationsService : ICalculatedObservationsService
|
||||
/// </summary>
|
||||
/// <param name="obs">The <see cref="PatientRecordingAlert"/> instance to be mapped.</param>
|
||||
/// <returns>The mapped <see cref="PatientRecordingAlert"/>, the original <paramref name="obs"/> if no service is available, or <c>null</c> if the service returned no result.</returns>
|
||||
/// <!-- aidoc:v1 sig=3678681 body=9648481 -->
|
||||
public async Task<PatientRecordingAlert?> Map(PatientRecordingAlert obs)
|
||||
{
|
||||
if (_service == null) return obs;
|
||||
@@ -137,6 +142,7 @@ public class CalculatedObservationsService : ICalculatedObservationsService
|
||||
/// </summary>
|
||||
/// <param name="treatment">The patient treatment instance to be mapped or transformed.</param>
|
||||
/// <returns>A task that represents the asynchronous mapping operation, containing the mapped <see cref="PatientTreatment"/> or <c>null</c> if the service returns no result.</returns>
|
||||
/// <!-- aidoc:v1 sig=b468f2f body=1c73c0e -->
|
||||
public async Task<PatientTreatment?> Map(PatientTreatment treatment)
|
||||
{
|
||||
if (_service == null) return treatment;
|
||||
@@ -149,6 +155,7 @@ public class CalculatedObservationsService : ICalculatedObservationsService
|
||||
/// </summary>
|
||||
/// <param name="diagnosis">The patient diagnosis to be mapped.</param>
|
||||
/// <returns>A task that yields the mapped <see cref="PatientDiagnosis"/>, or <c>null</c> if the underlying service returns no result.</returns>
|
||||
/// <!-- aidoc:v1 sig=fd30fa4 body=5966a0e -->
|
||||
public virtual async Task<PatientDiagnosis?> Map(PatientDiagnosis diagnosis)
|
||||
{
|
||||
if (_service == null) return diagnosis;
|
||||
@@ -162,6 +169,7 @@ public class CalculatedObservationsService : ICalculatedObservationsService
|
||||
/// </summary>
|
||||
/// <param name="activeMedicines">The list of medicines currently active for the patient.</param>
|
||||
/// <param name="patientId">The unique identifier of the patient whose medicine observations are being calculated.</param>
|
||||
/// <!-- aidoc:v1 sig=0dfd9f3 body=65bf3e9 -->
|
||||
public virtual async Task CalculateMedicineObservation(List<Medicine> activeMedicines, ObjectId patientId)
|
||||
{
|
||||
if (_service != null) await _service.CalculateMedicineObservation(activeMedicines, patientId);
|
||||
@@ -172,6 +180,7 @@ public class CalculatedObservationsService : ICalculatedObservationsService
|
||||
/// If the service dependency is not initialized, the call is skipped silently as a no-op fallback.
|
||||
/// </summary>
|
||||
/// <param name="patientId">The unique identifier of the patient for whom the active bolus opiates calculation is performed.</param>
|
||||
/// <!-- aidoc:v1 sig=e30b38f body=a756e48 -->
|
||||
public async Task CalculateBolusOpiates(ObjectId patientId)
|
||||
{
|
||||
if (_service != null) await _service.CalculateActiveBolus(patientId);
|
||||
@@ -183,6 +192,7 @@ public class CalculatedObservationsService : ICalculatedObservationsService
|
||||
/// </summary>
|
||||
/// <param name="id">The unique identifier of the patient whose active treatments should be retrieved.</param>
|
||||
/// <returns>A task that yields the collection of active <see cref="PatientTreatment"/> entries for the patient, or an empty list when the service is unavailable.</returns>
|
||||
/// <!-- aidoc:v1 sig=4caccd9 body=3a62497 -->
|
||||
public virtual async Task<IEnumerable<PatientTreatment?>> GetActiveTreatmentsByPatient(ObjectId id)
|
||||
{
|
||||
if (_service != null) return await _service.GetActiveTreatmentsByPatient(id);
|
||||
@@ -194,6 +204,7 @@ public class CalculatedObservationsService : ICalculatedObservationsService
|
||||
/// </summary>
|
||||
/// <param name="listToInsert">The list of patient observations to be mapped.</param>
|
||||
/// <returns>A task containing the mapped list of patient observations, or an empty list if no service is configured.</returns>
|
||||
/// <!-- aidoc:v1 sig=8d07ed3 body=5a2680c -->
|
||||
public virtual async Task<List<PatientObservation>> MapList(List<PatientObservation> listToInsert)
|
||||
{
|
||||
if (_service != null) return await _service.PreMapList(listToInsert);
|
||||
@@ -206,6 +217,7 @@ public class CalculatedObservationsService : ICalculatedObservationsService
|
||||
/// <param name="observation">The patient observation onto which the source alarm will be mapped.</param>
|
||||
/// <param name="observationAlarm">The source alarm to be applied to the observation.</param>
|
||||
/// <returns>The <see cref="PatientObservation"/> produced by the service mapping, or the original <paramref name="observation"/> when no service is configured.</returns>
|
||||
/// <!-- aidoc:v1 sig=20c558b body=7b3984c -->
|
||||
public virtual async Task<PatientObservation> MapSourceAlarm(PatientObservation observation,
|
||||
PatientObservationAlarm observationAlarm)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user