# Interface IDiagnosisService

Namespace
  adas_core.Application.Services.Interfaces

Assembly
  adas-core.Application.dll

    public interface IDiagnosisService : IApiRequestService

Inherited Members
  IApiRequestService.SaveRequestAsync(ApiRequest)
  IApiRequestService.SaveRequest(ApiRequest)

Extension Methods
  NumberUtils.IsNumber(object)
  NumberUtils.ToDouble(object)
  ObjectUtils.ToStr(object?)

## Methods

### Archive(Patient)

Asynchronously archives the specified patient, marking the patient record as archived rather than permanently deleting it.

    Task Archive(Patient patient)

#### Parameters

`patient` Patient

  The patient to archive.

#### Returns

Task

### ArchiveByPatientId(ObjectId)

Archives the records associated with the specified patient identifier.

    Task ArchiveByPatientId(ObjectId id)

#### Parameters

`id` ObjectId

  The unique identifier of the patient whose records will be archived.

#### Returns

Task

### DeleteByPatientId(ObjectId)

Deletes records associated with the specified patient identifier.

    Task DeleteByPatientId(ObjectId id)

#### Parameters

`id` ObjectId

  The unique identifier of the patient whose related records should be removed.

#### Returns

Task

### GetByPatientId(ObjectId)

Retrieves all diagnoses associated with the specified patient identifier.

    Task<List<PatientDiagnosis>> GetByPatientId(ObjectId patientId)

#### Parameters

`patientId` ObjectId

  The unique identifier of the patient whose diagnoses are being retrieved.

#### Returns

Task<List<PatientDiagnosis>>

  A task representing the asynchronous operation, containing a list of PatientDiagnosis records for the specified patient; an empty list is returned if no diagnoses are found.

### ProcessDiagnosis(List<PatientDiagnosis>, Patient, DateTime)

Processes the provided list of patient diagnoses for the specified patient at the given message time.

    Task ProcessDiagnosis(List<PatientDiagnosis> diagnosis, Patient patient, DateTime messageTime)

#### Parameters

`diagnosis` List<PatientDiagnosis>

  The list of patient diagnoses to be processed.

`patient` Patient

  The patient associated with the diagnoses.

`messageTime` DateTime

  The timestamp of the message triggering the diagnosis processing.

#### Returns

Task

### ProcessDiagnosisObservation(ApiRequest, Patient)

Processes a diagnosis observation for the specified patient based on the supplied API request data.

    Task ProcessDiagnosisObservation(ApiRequest apiRequest, Patient patient)

#### Parameters

`apiRequest` ApiRequest

  The API request containing the diagnosis observation payload and contextual information to process.

`patient` Patient

  The patient to whom the diagnosis observation pertains.

#### Returns

Task

### SaveRequest(ApiRequest, Patient)

Persists the specified API request along with its associated patient data.

    Task SaveRequest(ApiRequest apiRequest, Patient patient)

#### Parameters

`apiRequest` ApiRequest

  The API request to be saved.

`patient` Patient

  The patient associated with the API request.

#### Returns

Task

### UpdateManyObjectId(string, ObjectId, ObjectId)

Updates multiple records by replacing the `oldId` with the new `id` in the field identified by `nameId`.

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

#### Parameters

`nameId` string

  The identifier of the field or property whose ObjectId values will be updated.

`id` ObjectId

  The new ObjectId value to assign to the matching records.

`oldId` ObjectId

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

#### Returns

Task