# Interface IPointOfCareRepository

Namespace
  adas_core.Application.Repositories.Interfaces

Assembly
  adas-core.Application.dll

    public interface IPointOfCareRepository : IMongoRepository<PointOfCare>

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

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

## Methods

### CountByUnitId(ObjectId)

Asynchronously counts the number of entities associated with the specified unit identifier.

    Task<long> CountByUnitId(ObjectId unitId)

#### Parameters

`unitId` ObjectId

  The identifier of the unit used to filter the entities to be counted.

#### Returns

Task<long>

  A Task<TResult> that represents the asynchronous operation, containing the total count of matching entities.

### CountVirtualsByUnitId(ObjectId)

Asynchronously counts the number of virtuals associated with the specified unit.

    Task<long> CountVirtualsByUnitId(ObjectId unitId)

#### Parameters

`unitId` ObjectId

  The identifier of the unit whose virtuals will be counted.

#### Returns

Task<long>

  A task that represents the asynchronous operation. The task result contains the count of virtuals for the given unit.

### Delete(ObjectId)

Asynchronously deletes the entity identified by the specified `id`.

    Task Delete(ObjectId id)

#### Parameters

`id` ObjectId

  The MongoDB.Bson.ObjectId of the entity to delete.

#### Returns

Task

### DeleteManyByUnitId(ObjectId)

Deletes multiple records associated with the specified unit identifier asynchronously.

    Task<bool> DeleteManyByUnitId(ObjectId unitId)

#### Parameters

`unitId` ObjectId

  The unique identifier of the unit whose related records should be deleted.

#### Returns

Task<bool>

  A task that represents the asynchronous operation, containing a boolean value indicating whether the deletion was successful.

### FindAllByUnitId(ObjectId)

Retrieves all PointOfCare records associated with the specified unit identifier.

    Task<IEnumerable<PointOfCare>?> FindAllByUnitId(ObjectId unit)

#### Parameters

`unit` ObjectId

  The MongoDB.Bson.ObjectId of the unit whose points of care should be returned.

#### Returns

Task<IEnumerable<PointOfCare>>

  A task that yields an IEnumerable<T> of PointOfCare for the matching unit, or `null` when no results are found.

### FindAllByUnitIdWithDevices(ObjectId)

Retrieves all points of care associated with the specified unit identifier, including their related devices.

    Task<IEnumerable<PointOfCare>?> FindAllByUnitIdWithDevices(ObjectId unitId)

#### Parameters

`unitId` ObjectId

  The unique identifier of the unit whose points of care and associated devices are to be retrieved.

#### Returns

Task<IEnumerable<PointOfCare>>

  A task that represents the asynchronous operation. The task result contains an enumerable collection of points of care with their associated devices, or `null` if no points of care are found for the specified unit.

### FindAllIdBeaconsInUse()

Asynchronously retrieves the set of all ID beacons that are currently in use.

    Task<HashSet<ObjectId>> FindAllIdBeaconsInUse()

#### Returns

Task<HashSet<ObjectId>>

  A task that represents the asynchronous operation. The task result contains a HashSet<T> with the identifiers of all ID beacons currently in use.

### FindAllIdCamerasInUse()

Asynchronously retrieves the set of camera identifiers that are currently in use.

    Task<HashSet<ObjectId>> FindAllIdCamerasInUse()

#### Returns

Task<HashSet<ObjectId>>

  A task that represents the asynchronous operation, containing a hash set of MongoDB.Bson.ObjectId values for all cameras in use.

### FindAllIdRelaysInUse()

Asynchronously retrieves all ID relays that are currently in use, returning them as a hash set for efficient lookup.

    Task<HashSet<ObjectId>> FindAllIdRelaysInUse()

#### Returns

Task<HashSet<ObjectId>>

  A task that represents the asynchronous operation. The task result contains a hash set of the MongoDB.Bson.ObjectId values of all ID relays currently in use.

### FindByBed(string)

Retrieves the points of care associated with the specified bed, returning `null` when no matching points of care are found.

    Task<IEnumerable<PointOfCare>?> FindByBed(string bed)

#### Parameters

`bed` string

  The bed identifier used to look up the associated points of care.

#### Returns

Task<IEnumerable<PointOfCare>>

  A task that yields an IEnumerable<T> of PointOfCare when matches exist, or `null` if none are found.

### FindByBedAndUnitId(string?, ObjectId)

Asynchronously retrieves the PointOfCare associated with the specified bed within the given unit, returning null if no matching record is found.

    Task<PointOfCare?> FindByBedAndUnitId(string? bed, ObjectId unitId)

#### Parameters

`bed` string

  The bed identifier used to locate the point of care; may be null.

`unitId` ObjectId

  The identifier of the unit in which the bed is located.

#### Returns

Task<PointOfCare>

  A Task<TResult> that yields the matching PointOfCare, or null if none is found.

### FindByFilter(FilterDefinition<PointOfCare>, ProjectionDefinition<PointOfCare>?)

Asynchronously retrieves a list of PointOfCare entities that match the specified filter, optionally applying a projection to shape the returned fields.

    Task<List<PointOfCare>> FindByFilter(FilterDefinition<PointOfCare> filter, ProjectionDefinition<PointOfCare>? projection = null)

#### Parameters

`filter` FilterDefinition<PointOfCare>

  The filter definition used to match PointOfCare entities in the data store.

`projection` ProjectionDefinition<PointOfCare>

  An optional projection definition that limits or shapes the fields returned in each result. If `null`, the full PointOfCare entity is returned.

#### Returns

Task<List<PointOfCare>>

  A task that represents the asynchronous operation, containing a list of PointOfCare entities that satisfy the filter. Returns an empty list when no matching entities are found.

### FindById(ObjectId)

Retrieves a PointOfCare by its identifier, returning `null` when no matching record is found.

    Task<PointOfCare?> FindById(ObjectId id)

#### Parameters

`id` ObjectId

  The unique identifier of the point of care to locate.

#### Returns

Task<PointOfCare>

  A task that yields the matching PointOfCare, or `null` if no record exists for the given identifier.

### FindByIdAllConfig(ObjectId)

Retrieves a PointOfCare entity by its identifier, including all associated configuration data. Returns null when no matching entity is found.

    Task<PointOfCare?> FindByIdAllConfig(ObjectId id)

#### Parameters

`id` ObjectId

  The unique identifier of the point of care to retrieve.

#### Returns

Task<PointOfCare>

  A task that resolves to the matching PointOfCare with all configuration, or null if not found.

### FindByPatientLocation(PatientLocation)

Retrieves the point of care associated with the specified patient location.

    Task<PointOfCare?> FindByPatientLocation(PatientLocation patientLocation)

#### Parameters

`patientLocation` PatientLocation

  The patient location used to look up the corresponding point of care.

#### Returns

Task<PointOfCare>

  A task that represents the asynchronous operation. The task result contains the matching PointOfCare, or `null` if no point of care is found for the given patient location.

### FindByRoom(string)

Asynchronously retrieves the points of care associated with the specified room.

    Task<IEnumerable<PointOfCare>?> FindByRoom(string room)

#### Parameters

`room` string

  The room identifier used to look up the corresponding points of care.

#### Returns

Task<IEnumerable<PointOfCare>>

  A task that represents the asynchronous operation. The result is a collection of PointOfCare matching the specified room, or null if no matching points of care are found.

### FindByUnitAndStatus(ObjectId, PointOfCare, bool)

Retrieves a collection of PointOfCare entities that belong to the specified unit and match the given status. When `excludeVirtual` is `true`, virtual points of care are omitted from the results.

    Task<IEnumerable<PointOfCare>> FindByUnitAndStatus(ObjectId unitId, StatusEnum.PointOfCare status, bool excludeVirtual = false)

#### Parameters

`unitId` ObjectId

  The identifier of the unit whose points of care are being queried.

`status` StatusEnum.PointOfCare

  The point-of-care status used to filter the results.

`excludeVirtual` bool

  When set to `true`, virtual points of care are excluded from the returned collection.

#### Returns

Task<IEnumerable<PointOfCare>>

  A task that represents the asynchronous operation. The task result contains an IEnumerable<T> of points of care matching the specified unit and status.

### GetAll()

Asynchronously retrieves all available points of care.

    Task<List<PointOfCare>?> GetAll()

#### Returns

Task<List<PointOfCare>>

  A task that represents the asynchronous operation. The task result is a list of PointOfCare instances, or `null` if no points of care are available.

### GetAllConfigs()

Retrieves all Point of Care configurations available in the system.

    Task<List<PointOfCare>?> GetAllConfigs()

#### Returns

Task<List<PointOfCare>>

  A task containing a list of PointOfCare configurations, or `null` if no configurations are found.

### GetAllLocationInfo()

Retrieves all Point of Care location information.

    Task<List<PointOfCare>?> GetAllLocationInfo()

#### Returns

Task<List<PointOfCare>>

  A task that resolves to a list of PointOfCare locations, or `null` if no location data is available.

### GetPaginatedPoCs(PaginationFilter)

Retrieves a paginated, fluent queryable collection of Points of Care (PoCs) based on the provided filter criteria.

    IFindFluent<PointOfCare, PointOfCare> GetPaginatedPoCs(PaginationFilter filter)

#### Parameters

`filter` PaginationFilter

  The pagination filter that defines paging parameters such as page number and page size.

#### Returns

IFindFluent<PointOfCare, PointOfCare>

  An MongoDB.Driver.IFindFluent<TDocument, TProjection> representing the paginated query against the PoCs collection.

### GetPoCConfiguration(ObjectId)

Retrieves the Point of Care configuration associated with the specified identifier. Returns null when no configuration exists for the given identifier.

    Task<PointOfCare?> GetPoCConfiguration(ObjectId pocId)

#### Parameters

`pocId` ObjectId

  The unique identifier of the Point of Care whose configuration is being requested.

#### Returns

Task<PointOfCare>

  A task that resolves to the matching PointOfCare configuration, or null if no configuration is found.

### Update(PointOfCare)

Asynchronously updates the specified PointOfCare entity.

    Task Update(PointOfCare pointOfCare)

#### Parameters

`pointOfCare` PointOfCare

  The PointOfCare instance containing the updated data to be persisted.

#### Returns

Task

### UpdateConfiguration(ObjectId, PointOfCareConfiguration)

Updates the point of care configuration identified by the specified identifier with the provided settings.

    Task UpdateConfiguration(ObjectId id, PointOfCareConfiguration configuration)

#### Parameters

`id` ObjectId

  The unique identifier of the point of care configuration to update.

`configuration` PointOfCareConfiguration

  The new configuration values to apply to the existing point of care record.

#### Returns

Task

### UpdateRelayConfig(ObjectId, List<ObjectId>)

Updates the relay configuration for the specified point of configuration (POC) using the provided list of relay configuration identifiers.

    Task UpdateRelayConfig(ObjectId pocId, List<ObjectId> relayConfig)

#### Parameters

`pocId` ObjectId

  The unique identifier of the point of configuration whose relay configuration will be updated.

`relayConfig` List<ObjectId>

  The list of relay configuration identifiers to apply to the specified POC.

#### Returns

Task

### UpdateRelayConfig(ObjectId, List<Relay>)

Updates the relay configuration associated with the specified point of contact identifier.

    Task UpdateRelayConfig(ObjectId pocId, List<Relay> relayConfig)

#### Parameters

`pocId` ObjectId

  The unique identifier of the point of contact whose relay configuration is being updated.

`relayConfig` List<Relay>

  The collection of relay entries to apply to the configuration.

#### Returns

Task

### UpdateUnitId(ObjectId, Unit)

Updates the unit identifier associated with the specified object.

    Task UpdateUnitId(ObjectId id, Unit unit)

#### Parameters

`id` ObjectId

  The identifier of the object whose unit will be updated.

`unit` Unit

  The unit value to apply to the object.

#### Returns

Task