# Interface IPatientArchiveRepository

Namespace
  adas_core.Application.Repositories.Interfaces

Assembly
  adas-core.Application.dll

    public interface IPatientArchiveRepository : IMongoRepository<Patient>

Inherited Members
  IMongoRepository<Patient>.Collection
  IMongoRepository<Patient>.GetCollectionName()
  IMongoRepository<Patient>.InsertOneAsync(Patient)
  IMongoRepository<Patient>.DeleteAsync(ObjectId)
  IMongoRepository<Patient>.UpdateOneAsync(ObjectId, Patient)

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

## Methods

### FindAll()

Retrieves all patients from the data source.

    Task<List<Patient>> FindAll()

#### Returns

Task<List<Patient>>

  A task that represents the asynchronous operation, containing a list of all Patient entities.

### FindByPatientNumber(string)

Retrieves a Patient matching the specified patient number, returning null if no matching patient is found.

    Task<Patient?> FindByPatientNumber(string patientNumber)

#### Parameters

`patientNumber` string

  The unique patient number used to look up the patient.

#### Returns

Task<Patient>

  A Patient instance if a match is found; otherwise, null.

### SearchByPatientNumberAndDistinctUnit(string, ObjectId)

Searches for a patient by patient number within a specific distinct unit.

    Task<Patient?> SearchByPatientNumberAndDistinctUnit(string patientNumber, ObjectId unitId)

#### Parameters

`patientNumber` string

  The patient number used to locate the patient.

`unitId` ObjectId

  The identifier of the distinct unit in which to perform the search.

#### Returns

Task<Patient>

  A task that represents the asynchronous operation. The task result contains the matching Patient if found; otherwise, `null`.