Table of Contents

Class RecordingAlertService

Namespace
adas_core.Application.Services
Assembly
adas-core.Application.dll
public class RecordingAlertService : IRecordingAlertService, IApiRequestService
Inheritance
RecordingAlertService
Implements
Inherited Members
Extension Methods

Constructors

RecordingAlertService(Lazy<IPatientService>, IConfigObservationService, IRecordingAlertRepository, IRecordingAlertArchiveRepository, ILogger<RecordingAlertService>, IClientMessageService, ISubscribersService, IHttpContextAccessor, ILocalAuditService)

public RecordingAlertService(Lazy<IPatientService> patientService, IConfigObservationService configObservationService, IRecordingAlertRepository recordingAlertRepository, IRecordingAlertArchiveRepository recordingAlertArchiveRepository, ILogger<RecordingAlertService> logger, IClientMessageService clientMessageService, ISubscribersService subscribersService, IHttpContextAccessor httpContextAccessor, ILocalAuditService auditService)

Parameters

patientService Lazy<IPatientService>
configObservationService IConfigObservationService
recordingAlertRepository IRecordingAlertRepository
recordingAlertArchiveRepository IRecordingAlertArchiveRepository
logger ILogger<RecordingAlertService>
clientMessageService IClientMessageService
subscribersService ISubscribersService
httpContextAccessor IHttpContextAccessor
auditService ILocalAuditService

Methods

Archive(Patient)

Archives the specified patient by delegating to the patient identifier-based archive method.

public Task Archive(Patient patient)

Parameters

patient Patient

The patient to be archived.

Returns

Task

A task that represents the asynchronous archive operation.

ArchiveByPatientId(ObjectId)

Archives all recording alerts associated with the specified patient identifier by copying them to the archive repository and then deleting them from the source repository.

public Task ArchiveByPatientId(ObjectId id)

Parameters

id ObjectId

The unique identifier of the patient whose recording alerts should be archived.

Returns

Task

DeleteByPatientId(ObjectId)

Deletes all recording alerts associated with the specified patient identifier by delegating to the recording alert repository.

public Task DeleteByPatientId(ObjectId id)

Parameters

id ObjectId

The unique identifier of the patient whose recording alerts should be removed.

Returns

Task

FindLastRecordingAlert(ObjectId, int)

Retrieves the most recent patient recording alerts by aggregating the last observations for the specified patient.

public Task<List<PatientRecordingAlert>> FindLastRecordingAlert(ObjectId patientId, int num = 2)

Parameters

patientId ObjectId

The unique identifier of the patient whose recording alerts are being queried.

num int

The maximum number of recent alerts to return. Defaults to 2.

Returns

Task<List<PatientRecordingAlert>>

A task that represents the asynchronous operation, containing a list of the patient's most recent PatientRecordingAlert entries.

SaveRequest(ApiRequest)

Saves observation data from an API request, processing ORU_R01, ORU_R40, and RecordingAlert types by resolving the associated patient and persisting each recording alert. If the request lacks both patient and location identifiers, or no matching patient is found, the request is ignored.

public Task SaveRequest(ApiRequest apiRequest)

Parameters

apiRequest ApiRequest

The API request containing patient or location identifiers and the recording alerts to persist.

Returns

Task

Exceptions

ApiRequestException

Thrown when apiRequest.Type is not a valid type for Observations.

SaveRequestAsync(ApiRequest)

Asynchronously saves the specified API request by executing the save operation on a background thread.

public Task SaveRequestAsync(ApiRequest apiRequest)

Parameters

apiRequest ApiRequest

The API request to save.

Returns

Task

A task that represents the asynchronous save operation.

UpdateManyObjectId(string, ObjectId, ObjectId)

Updates multiple recording alert records, replacing the oldId with the new id filtered by the specified nameId.

public Task UpdateManyObjectId(string nameId, ObjectId id, ObjectId oldId)

Parameters

nameId string

The name identifier used to filter the records to update.

id ObjectId

The new MongoDB.Bson.ObjectId value to assign to the matching records.

oldId ObjectId

The existing MongoDB.Bson.ObjectId value to be replaced in the matching records.

Returns

Task