# Interface IAppointmentService

Namespace
  adas_core.Application.Services.Interfaces

Assembly
  adas-core.Application.dll

    public interface IAppointmentService : 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 record as archived in the system.

    Task Archive(Patient patient)

#### Parameters

`patient` Patient

  The patient whose record should be archived.

#### Returns

Task

### ArchiveByPatientId(ObjectId)

Asynchronously archives records associated with the specified patient identifier.

    Task ArchiveByPatientId(ObjectId id)

#### Parameters

`id` ObjectId

  The MongoDB.Bson.ObjectId of the patient whose related records should be archived.

#### Returns

Task

### DeleteByPatientId(ObjectId)

Deletes a record associated with the specified patient identifier.

    Task DeleteByPatientId(ObjectId id)

#### Parameters

`id` ObjectId

  The MongoDB.Bson.ObjectId of the patient whose related record should be removed.

#### Returns

Task

### FindByLocation(PatientLocation)

Asynchronously retrieves the list of patient appointments associated with the specified location.

    Task<List<PatientAppointment>> FindByLocation(PatientLocation location)

#### Parameters

`location` PatientLocation

  The patient location used to filter and locate the relevant appointments.

#### Returns

Task<List<PatientAppointment>>

  A task that represents the asynchronous operation, containing a list of PatientAppointment items matching the given location.

### FindByPatientIdAsync(ObjectId)

Asynchronously finds all PatientAppointment records associated with the specified patient identifier.

    Task<IAsyncCursor<PatientAppointment>> FindByPatientIdAsync(ObjectId patientId)

#### Parameters

`patientId` ObjectId

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

#### Returns

Task<IAsyncCursor<PatientAppointment>>

  A task that represents the asynchronous operation, containing an MongoDB.Driver.IAsyncCursor<TDocument> for iterating over the matching PatientAppointment documents.

### GetByPatient(ObjectId)

Retrieves all appointments associated with the specified patient asynchronously.

    Task<List<PatientAppointment>> GetByPatient(ObjectId patientId)

#### Parameters

`patientId` ObjectId

  The identifier of the patient whose appointments are being retrieved.

#### Returns

Task<List<PatientAppointment>>

  A task that represents the asynchronous operation, containing a list of PatientAppointment entries for the patient.

### GetTodayByPatient(ObjectId, CancellationToken)

Retrieves the list of patient appointments scheduled for today for the specified patient.

    Task<List<PatientAppointment>> GetTodayByPatient(ObjectId patientId, CancellationToken ct = default)

#### Parameters

`patientId` ObjectId

  The unique identifier of the patient whose appointments are being queried.

`ct` CancellationToken

  A cancellation token to observe while waiting for the task to complete.

#### Returns

Task<List<PatientAppointment>>

  A task that represents the asynchronous operation, containing a list of PatientAppointment entries for the given patient for the current day.

### GetTodayByPoc(ObjectId, CancellationToken)

Retrieves the list of patient appointments scheduled for today at the specified point of care.

    Task<List<PatientAppointment>> GetTodayByPoc(ObjectId pocId, CancellationToken ct = default)

#### Parameters

`pocId` ObjectId

  The identifier of the point of care whose appointments will be returned.

`ct` CancellationToken

  The cancellation token used to cancel the asynchronous operation.

#### Returns

Task<List<PatientAppointment>>

  A task that represents the asynchronous operation, containing a list of today's patient appointments for the specified point of care.

### ProcessApiRequest(ApiRequest, Patient)

Processes an incoming API request in the context of the specified patient, handling the required business logic and returning when the processing completes.

    Task ProcessApiRequest(ApiRequest apiRequest, Patient patient)

#### Parameters

`apiRequest` ApiRequest

  The API request to be processed.

`patient` Patient

  The patient associated with the API request.

#### Returns

Task

### UpdateManyObjectId(string, ObjectId, ObjectId)

Updates multiple records by replacing the old MongoDB.Bson.ObjectId with the new one for the field identified by `nameId`.

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

#### Parameters

`nameId` string

  The name of the field whose MongoDB.Bson.ObjectId value should be updated.

`id` ObjectId

  The new MongoDB.Bson.ObjectId value to set on matching records.

`oldId` ObjectId

  The existing MongoDB.Bson.ObjectId value to be replaced.

#### Returns

Task