# Interface IPointOfCareService

Namespace
  adas_core.Application.Services.Interfaces

Assembly
  adas-core.Application.dll

    public interface IPointOfCareService

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

## Methods

### CheckNextAdmission(ObjectId?)

Checks the next admission for the specified patient location.

    void CheckNextAdmission(ObjectId? patientLocation)

#### Parameters

`patientLocation` ObjectId?

  The optional identifier of the patient location to check.

### CountPoCsByUnitId(ObjectId)

Asynchronously counts the number of Points of Contact (PoCs) associated with the specified unit identifier.

    Task<long> CountPoCsByUnitId(ObjectId unitId)

#### Parameters

`unitId` ObjectId

  The unique identifier of the unit whose PoCs should be counted.

#### Returns

Task<long>

  A task that represents the asynchronous operation, containing the total number of PoCs linked to the given unit.

### CountVirtualPoCsByUnitId(ObjectId)

Asynchronously retrieves the total number of virtual Proofs of Concept (PoCs) associated with the specified unit.

    Task<long> CountVirtualPoCsByUnitId(ObjectId unitId)

#### Parameters

`unitId` ObjectId

  The unique identifier of the unit whose virtual PoCs should be counted.

#### Returns

Task<long>

  A Task<TResult> that represents the asynchronous operation, containing the count of virtual PoCs for the given unit.

### Delete(ObjectId)

Asynchronously deletes the entity identified by the specified identifier.

    Task Delete(ObjectId id)

#### Parameters

`id` ObjectId

  The unique identifier of the entity to delete.

#### Returns

Task

  A task that represents the asynchronous delete operation.

### DeletePoCsByUnitId(ObjectId)

Deletes all PoCs associated with the specified unit identifier.

    Task DeletePoCsByUnitId(ObjectId unitId)

#### Parameters

`unitId` ObjectId

  The unique identifier of the unit whose PoCs should be removed.

#### Returns

Task

### FindAllByUnitId(ObjectId)

Asynchronously retrieves all PointOfCare records associated with the specified unit identifier.

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

#### Parameters

`unit` ObjectId

  The unique identifier of the unit whose PointOfCare records should be retrieved.

#### Returns

Task<IEnumerable<PointOfCare>>

  A task that returns a collection of PointOfCare records for the specified unit, or `null` if no records are found.

### FindAllByUnitIdWithDevices(ObjectId)

Retrieves all Point of Care entries associated with the specified unit, including their related devices.

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

#### Parameters

`unitId` ObjectId

  The unique identifier of the unit whose Point of Care entries should be retrieved.

#### Returns

Task<IEnumerable<PointOfCare>>

  A task that represents the asynchronous operation. The task result contains a collection of Point of Care entries with their devices, or `null` if no entries are found for the given unit.

### FindAllByUnitIds(List<ObjectId>)

Retrieves all points of care associated with the specified unit identifiers.

    Task<List<PointOfCare>> FindAllByUnitIds(List<ObjectId> unitIds)

#### Parameters

`unitIds` List<ObjectId>

  The list of unit identifiers used to look up the associated points of care.

#### Returns

Task<List<PointOfCare>>

  A task that represents the asynchronous operation, containing the list of points of care matching the provided unit identifiers.

### FindAllIdBeaconsInUse()

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

    Task<HashSet<ObjectId>> FindAllIdBeaconsInUse()

#### Returns

Task<HashSet<ObjectId>>

  A task containing a HashSet<T> of the ID beacons that are active or in use.

### FindAllIdCamerasInUse()

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

    Task<HashSet<ObjectId>> FindAllIdCamerasInUse()

#### Returns

Task<HashSet<ObjectId>>

  A task that represents the asynchronous operation. The task result contains a HashSet of ObjectId values representing the cameras currently in use.

### FindAllIdRelaysInUse()

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

    Task<HashSet<ObjectId>> FindAllIdRelaysInUse()

#### Returns

Task<HashSet<ObjectId>>

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

### FindByBed(string)

Asynchronously retrieves the collection of points of care associated with the specified bed.

    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 represents the asynchronous operation. The task result contains a collection of PointOfCare instances matching the bed, or `null` if no match is found.

### FindByBedAndUnitId(string?, ObjectId?)

Retrieves a PointOfCare associated with the specified bed and unit identifier, returning `null` when 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.

`unitId` ObjectId?

  The MongoDB MongoDB.Bson.ObjectId of the unit the point of care belongs to.

#### Returns

Task<PointOfCare>

  A Task<TResult> that resolves to the matching PointOfCare or `null` if no record matches the supplied bed and unit.

### FindById(ObjectId)

Asynchronously retrieves a PointOfCare entity by its unique identifier, returning null if no matching record is found.

    Task<PointOfCare?> FindById(ObjectId id)

#### Parameters

`id` ObjectId

  The unique identifier of the PointOfCare to look up.

#### Returns

Task<PointOfCare>

  A task that represents the asynchronous lookup operation. The task result contains the matching PointOfCare if found, or null when no entity with the specified identifier exists.

### FindByIdAllConfig(ObjectId)

Retrieves a PointOfCare entity by its identifier, including all of its associated configuration data.

    Task<PointOfCare?> FindByIdAllConfig(ObjectId id)

#### Parameters

`id` ObjectId

  The MongoDB.Bson.ObjectId of the PointOfCare to locate.

#### Returns

Task<PointOfCare>

  A task that yields the matching PointOfCare with its full configuration, or `null` if no entity is found for the supplied identifier.

### FindByRoom(string)

Asynchronously retrieves the collection of 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 associated Points of Care.

#### Returns

Task<IEnumerable<PointOfCare>>

  A task that represents the asynchronous operation. The task result contains an enumerable of Points of Care found for the given room, or `null` if no matching results are found.

### FindByUnitAndStatus(ObjectId, PointOfCare, bool)

Retrieves the points of care associated with the specified unit and point-of-care status, optionally excluding virtual ones.

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

#### Parameters

`unitId` ObjectId

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

`poc` StatusEnum.PointOfCare

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

`excludeVirtual` bool

  When `true`, virtual points of care are excluded from the results; otherwise, they are included.

#### Returns

Task<IEnumerable<PointOfCare>>

  A task that returns the matching collection of PointOfCare entries.

### FindPoCByPatientId(ObjectId)

Retrieves the Point of Care associated with the specified patient identifier.

    Task<PointOfCare?> FindPoCByPatientId(ObjectId patientId)

#### Parameters

`patientId` ObjectId

  The unique identifier of the patient whose Point of Care is being looked up.

#### Returns

Task<PointOfCare>

  A task that yields the PointOfCare associated with the patient, or `null` if no Point of Care is found for the given patient identifier.

### FindPoCByPatientNumber(string)

Asynchronously retrieves the Point of Care (PoC) associated with the specified patient number. Returns `null` if no matching Point of Care is found for the given patient number.

    Task<PointOfCare?> FindPoCByPatientNumber(string patientNumber)

#### Parameters

`patientNumber` string

  The unique patient number used to look up the associated Point of Care.

#### Returns

Task<PointOfCare>

  A task that represents the asynchronous operation. The task result contains the PointOfCare if found, or `null` if no match exists.

### GetAll()

Retrieves all PointOfCare records asynchronously.

    Task<List<PointOfCare>> GetAll()

#### Returns

Task<List<PointOfCare>>

  A task that represents the asynchronous operation. The task result contains a list of all PointOfCare entries.

### GetAllConfigs()

Asynchronously retrieves all PointOfCare configurations.

    Task<List<PointOfCare>> GetAllConfigs()

#### Returns

Task<List<PointOfCare>>

  A task that represents the asynchronous operation. The task result contains a list of all PointOfCare configurations.

### GetAllLocationInfo()

Asynchronously retrieves all point-of-care location information.

    Task<List<PointOfCare>> GetAllLocationInfo()

#### Returns

Task<List<PointOfCare>>

  A task representing the asynchronous operation, containing a list of all PointOfCare locations.

### GetInfo(ObjectId, LocaleEnum?, bool, CancellationToken)

Retrieves the information of a point of care by its identifier, optionally localized and enriched with patient data. Returns `null` when no point of care matches the specified identifier.

    Task<PointOfCare?> GetInfo(ObjectId id, LocaleEnum? locale = null, bool fillPatientData = true, CancellationToken ct = default)

#### Parameters

`id` ObjectId

  The identifier of the point of care to retrieve.

`locale` LocaleEnum?

  Optional locale used to localize the retrieved point of care information; when `null`, the default locale is used.

`fillPatientData` bool

  When `true`, associated patient data is included in the result; when `false`, only the point of care information is returned.

`ct` CancellationToken

  Token to cancel the asynchronous operation.

#### Returns

Task<PointOfCare>

  A task that yields the PointOfCare corresponding to the given identifier, or `null` if it is not found.

### GetPaginatedPoCs(PaginationFilter)

Retrieves a paginated collection of Points of Care based on the provided filter.

    Task<PaginationResponse<PointOfCare>> GetPaginatedPoCs(PaginationFilter filter)

#### Parameters

`filter` PaginationFilter

  The pagination parameters used to control page size and page number.

#### Returns

Task<PaginationResponse<PointOfCare>>

  A task that represents the asynchronous operation, containing the paginated response of Points of Care.

### InsertPointOfCare(PointOfCare)

Inserts a new PointOfCare record into the system.

    Task<PointOfCare?> InsertPointOfCare(PointOfCare pointOfCare)

#### Parameters

`pointOfCare` PointOfCare

  The PointOfCare entity to be inserted.

#### Returns

Task<PointOfCare>

  A Task<TResult> containing the inserted PointOfCare, or `null` if the insertion was not performed.

### SetPointOfCareStatus(ObjectId, PointOfCare)

Asynchronously sets the Point of Care status for the entity identified by the specified identifier.

    Task SetPointOfCareStatus(ObjectId id, StatusEnum.PointOfCare status)

#### Parameters

`id` ObjectId

  The unique identifier of the entity whose Point of Care status will be updated.

`status` StatusEnum.PointOfCare

  The Point of Care status to assign to the entity.

#### Returns

Task

  A task that represents the asynchronous status update operation.

### Update(PointOfCare)

Updates an existing point of care record with the provided information.

    Task<PointOfCare?> Update(PointOfCare pointOfCare)

#### Parameters

`pointOfCare` PointOfCare

  The point of care entity containing the updated data.

#### Returns

Task<PointOfCare>

  A task representing the asynchronous operation, containing the updated point of care, or null if no matching record was found.

### UpdateConfiguration(ObjectId, PointOfCareConfiguration)

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

    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 data to apply.

#### Returns

Task

### UpdateRelayConfig(PointOfCare)

Updates the relay configuration associated with the specified point-of-care device.

    Task UpdateRelayConfig(PointOfCare poc)

#### Parameters

`poc` PointOfCare

  The point-of-care device whose relay configuration should be updated.

#### Returns

Task

### UpdateUnit(ObjectId, Unit)

Asynchronously updates an existing unit identified by the specified identifier with the provided unit data.

    Task UpdateUnit(ObjectId id, Unit unit)

#### Parameters

`id` ObjectId

  The unique identifier of the unit to update.

`unit` Unit

  The unit data to apply to the existing record.

#### Returns

Task