# Interface IDisplayService

Namespace
  adas_core.Application.Services.Interfaces

Assembly
  adas-core.Application.dll

    public interface IDisplayService

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

## Methods

### CountDisplaysByUnitId(ObjectId)

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

    Task<long> CountDisplaysByUnitId(ObjectId unitId)

#### Parameters

`unitId` ObjectId

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

#### Returns

Task<long>

  A task that represents the asynchronous operation. The task result contains the count of displays linked to the specified unit.

### DeleteDisplay(ObjectId)

Asynchronously deletes the display identified by the specified identifier.

    Task<bool> DeleteDisplay(ObjectId id)

#### Parameters

`id` ObjectId

  The unique identifier of the display to delete.

#### Returns

Task<bool>

  A task that represents the asynchronous operation, containing a value indicating whether the display was successfully deleted.

### DeleteDisplaysByUnitId(ObjectId)

Deletes display records associated with the specified unit identifier.

    Task DeleteDisplaysByUnitId(ObjectId unitId)

#### Parameters

`unitId` ObjectId

  The identifier of the unit whose displays should be removed.

#### Returns

Task

### GetAllAvailablePoc(List<string>, bool)

Retrieves all available Points of Contact (POCs) along with their associated unit information, optionally filtered by the provided display identifiers and allowing exclusion of virtual entries.

    Task<PocAndUnitDto> GetAllAvailablePoc(List<string> displayIds, bool excludeVirtual = false)

#### Parameters

`displayIds` List<string>

  The list of display identifiers used to filter the available POCs.

`excludeVirtual` bool

  When set to `true`, excludes virtual POCs from the results; otherwise, virtual POCs are included.

#### Returns

Task<PocAndUnitDto>

  A task that represents the asynchronous operation. The task result contains a PocAndUnitDto with the matching POCs and their unit details.

### GetAllByUser(string?)

Retrieves all displays along with their associated permissions for the specified user. When `userName` is null, the behavior is determined by the underlying implementation (e.g., returning all displays or an empty result).

    Task<List<DisplayWithPermissionsDto>> GetAllByUser(string? userName)

#### Parameters

`userName` string

  The username used to look up the associated displays and permissions. May be null.

#### Returns

Task<List<DisplayWithPermissionsDto>>

  A task that represents the asynchronous operation, containing a list of DisplayWithPermissionsDto entries for the user.

### GetAllCompact()

Asynchronously retrieves all displays in a compact format containing only minimal identifying information.

    Task<List<DisplayMinimalDto>> GetAllCompact()

#### Returns

Task<List<DisplayMinimalDto>>

  A task that represents the asynchronous operation. The task result contains a list of DisplayMinimalDto objects representing all available displays in a compact projection.

### GetAllDisplaySection()

Asynchronously retrieves all display sections as a minimal display list.

    Task<MinimalDisplayListDto> GetAllDisplaySection()

#### Returns

Task<MinimalDisplayListDto>

  A task that represents the asynchronous operation, containing the MinimalDisplayListDto with the display section data.

### GetAllPocsByDisplayId(ObjectId)

Asynchronously retrieves all Points of Care (POCs) associated with the specified display identifier.

    Task<List<PointOfCare>> GetAllPocsByDisplayId(ObjectId id)

#### Parameters

`id` ObjectId

  The display identifier used to look up the associated Points of Care.

#### Returns

Task<List<PointOfCare>>

  A task representing the asynchronous operation, containing a list of Points of Care matching the specified display identifier.

### GetByCardConfigId(ObjectId)

Retrieves a list of Display entities associated with the specified card configuration identifier.

    Task<List<Display>> GetByCardConfigId(ObjectId configId)

#### Parameters

`configId` ObjectId

  The unique identifier of the card configuration whose associated displays are to be retrieved.

#### Returns

Task<List<Display>>

  A task that represents the asynchronous operation, containing a list of Display objects linked to the given card configuration.

### GetByConfigId(ObjectId)

Retrieves a list of displays associated with the specified configuration identifier.

    Task<List<Display>> GetByConfigId(ObjectId configId)

#### Parameters

`configId` ObjectId

  The unique identifier of the configuration used to filter the displays.

#### Returns

Task<List<Display>>

  A task that represents the asynchronous operation. The task result contains a list of displays matching the specified configuration identifier.

### GetById(ObjectId)

Retrieves a Display entity by its unique identifier.

    Task<Display?> GetById(ObjectId id)

#### Parameters

`id` ObjectId

  The unique identifier of the display to retrieve.

#### Returns

Task<Display>

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

### GetByIdWithPermissions(ObjectId, LocaleEnum)

Asynchronously retrieves a display representation of an entity along with its associated permissions, localized for the specified locale.

    Task<DisplayWithPermissionsDto> GetByIdWithPermissions(ObjectId id, LocaleEnum localeEnum)

#### Parameters

`id` ObjectId

  The unique identifier of the entity to retrieve.

`localeEnum` LocaleEnum

  The locale used to localize the returned display data.

#### Returns

Task<DisplayWithPermissionsDto>

  A task that represents the asynchronous operation, containing the localized display data with permissions.

### GetByName(string)

Retrieves a Display entity by its name asynchronously. Returns `null` when no matching display is found.

    Task<Display?> GetByName(string name)

#### Parameters

`name` string

  The name of the display to look up.

#### Returns

Task<Display>

  A Task<TResult> that resolves to the matching Display, or `null` if none is found.

### GetByPointOfCare(PointOfCare)

Asynchronously retrieves the list of displays associated with the specified point of care.

    Task<List<Display>> GetByPointOfCare(PointOfCare pointOfCare)

#### Parameters

`pointOfCare` PointOfCare

  The point of care used to filter the displays to be returned.

#### Returns

Task<List<Display>>

  A task that represents the asynchronous operation, containing the list of Display items linked to the given point of care.

### GetByType(DisplayType)

Asynchronously retrieves a list of Display entries filtered by the specified display type.

    Task<List<Display>> GetByType(DisplayConfigEnums.DisplayType type)

#### Parameters

`type` DisplayConfigEnums.DisplayType

  The display type used to filter the returned collection.

#### Returns

Task<List<Display>>

  A task that represents the asynchronous operation, containing the list of Display items matching the specified type.

### GetByUnitId(ObjectId)

Retrieves a list of Display records associated with the specified unit identifier.

    Task<List<Display>> GetByUnitId(ObjectId id)

#### Parameters

`id` ObjectId

  The MongoDB.Bson.ObjectId that identifies the unit whose displays are being requested.

#### Returns

Task<List<Display>>

  A task that represents the asynchronous operation, containing a List<T> of displays linked to the given unit.

### GetDisplayConfigLocations(ObjectId)

Retrieves the list of display configuration locations associated with the specified display configuration.

    Task<List<DisplayConfigLocationDto>> GetDisplayConfigLocations(ObjectId displayConfigId)

#### Parameters

`displayConfigId` ObjectId

  The unique identifier of the display configuration whose locations are being retrieved.

#### Returns

Task<List<DisplayConfigLocationDto>>

  A task that represents the asynchronous operation, containing a list of DisplayConfigLocationDto objects for the specified display configuration.

### GetDisplaySectionByUser(DisplayType, ObjectId?, string?, List<Authorization>?)

Retrieves a list of minimal display sections filtered by display type, current display context, user name, and the provided authorizations.

    Task<List<MinimalDisplaySection>> GetDisplaySectionByUser(DisplayConfigEnums.DisplayType type, ObjectId? currentDisplay, string? userName, List<Authorization>? authorizations)

#### Parameters

`type` DisplayConfigEnums.DisplayType

  The display type used to filter the available sections.

`currentDisplay` ObjectId?

  The identifier of the current display, or `null` when no display is selected.

`userName` string

  The user name used to resolve user-specific sections, or `null` if not applicable.

`authorizations` List<Authorization>

  The list of authorizations used to authorize and filter the returned sections, or `null` if no authorization filtering is required.

#### Returns

Task<List<MinimalDisplaySection>>

  A task that yields the list of MinimalDisplaySection instances matching the supplied criteria.

### GetInfo(ObjectId, string?, List<Authorization>?, LocaleEnum?, bool, bool, bool, bool, CancellationToken)

Retrieves the display identified by `id`, optionally populating related data such as point-of-care, patient, display list, and display configuration based on the corresponding fill flags.

    Task<Display?> GetInfo(ObjectId id, string? userName, List<Authorization>? authorizations, LocaleEnum? locale, bool fillPointOfCare = true, bool fillPatientData = false, bool fillDisplayList = true, bool fillDisplayConfig = true, CancellationToken ct = default)

#### Parameters

`id` ObjectId

  The identifier of the display to retrieve.

`userName` string

  The name of the user requesting the display, used for authorization checks.

`authorizations` List<Authorization>

  Optional collection of authorizations used to control access to the display and its related data.

`locale` LocaleEnum?

  Optional locale used to localize the returned display information.

`fillPointOfCare` bool

  When `true`, includes the associated point-of-care data in the result.

`fillPatientData` bool

  When `true`, includes the associated patient data in the result.

`fillDisplayList` bool

  When `true`, includes the display list in the result.

`fillDisplayConfig` bool

  When `true`, includes the display configuration in the result.

`ct` CancellationToken

  Token used to cancel the asynchronous operation.

#### Returns

Task<Display>

  A Task<TResult> that resolves to the Display if found, or `null` if no display matches the specified `id`.

### GetPaginatedDisplays(PaginationFilter)

Retrieves a paginated collection of displays based on the provided filter criteria.

    Task<PaginationResponse<Display>> GetPaginatedDisplays(PaginationFilter filter)

#### Parameters

`filter` PaginationFilter

  The pagination filter that defines the page size, page number, and any additional filtering criteria for the display results.

#### Returns

Task<PaginationResponse<Display>>

  A task that represents the asynchronous operation, containing a PaginationResponse<T> with the requested page of displays and pagination metadata.

### InsertOne(Display)

Inserts a new display record into the data store and returns the persisted entity.

    Task<Display> InsertOne(Display display)

#### Parameters

`display` Display

  The display entity to insert.

#### Returns

Task<Display>

  A task that represents the asynchronous operation, containing the inserted Display.

### InsertOneTest()

Asynchronously inserts a single test Display record and returns the persisted result.

    Task<Display> InsertOneTest()

#### Returns

Task<Display>

  A Task<TResult> that represents the asynchronous insert operation, containing the inserted Display.

### IsDisplayConfigInUse(ObjectId)

Asynchronously determines whether the specified display configuration is currently in use.

    Task<bool> IsDisplayConfigInUse(ObjectId displayConfigId)

#### Parameters

`displayConfigId` ObjectId

  The identifier of the display configuration to check.

#### Returns

Task<bool>

  A task that represents the asynchronous operation. The task result is `true` if the display configuration is in use; otherwise, `false`.

### UpdateConfig(Display, DisplayConfig?)

Updates the configuration of an existing display using the provided new configuration.

    Task<Display?> UpdateConfig(Display oldDisplay, DisplayConfig? newDisplayConfig)

#### Parameters

`oldDisplay` Display

  The current display whose configuration will be updated.

`newDisplayConfig` DisplayConfig

  The new display configuration to apply, or null to leave the configuration unchanged.

#### Returns

Task<Display>

  A task that represents the asynchronous operation. The task result contains the updated Display, or null if the update was not performed.

### UpdateConfigId(Display, ObjectId)

Updates the configuration identifier associated with the specified display.

    Task<Display?> UpdateConfigId(Display oldDisplay, ObjectId configId)

#### Parameters

`oldDisplay` Display

  The existing display whose configuration identifier will be updated.

`configId` ObjectId

  The new configuration identifier to associate with the display.

#### Returns

Task<Display>

  A task that resolves to the updated Display, or `null` if no result is available.

### UpdateConfigPreset(ObjectId, ObjectId)

Updates the configuration preset associated with the specified display using the provided configuration display.

    Task<Display?> UpdateConfigPreset(ObjectId objectIdDisplay, ObjectId objectIdConfigDisplay)

#### Parameters

`objectIdDisplay` ObjectId

  The unique identifier of the display whose configuration preset will be updated.

`objectIdConfigDisplay` ObjectId

  The unique identifier of the configuration display to apply as the preset.

#### Returns

Task<Display>

  A task that resolves to the updated Display, or `null` if no matching display is found.

### UpdateName(ObjectId, string)

Updates the name of the entity identified by the given identifier and returns the resulting Display.

    Task<Display?> UpdateName(ObjectId id, string name)

#### Parameters

`id` ObjectId

  The identifier of the entity whose name should be updated.

`name` string

  The new name to apply to the entity.

#### Returns

Task<Display>

  A task that represents the asynchronous update operation, containing the updated Display or `null` if no entity was found.

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

Updates the point of care list associated with the specified object identifier, replacing or merging it with the provided list of point of care object identifiers.

    Task<Display?> UpdatePointOfCareList(ObjectId objectId, List<ObjectId> listPocObId)

#### Parameters

`objectId` ObjectId

  The identifier of the object whose point of care list is being updated.

`listPocObId` List<ObjectId>

  The collection of point of care object identifiers to apply to the target object.

#### Returns

Task<Display>

  A task that represents the asynchronous operation, containing the resulting Display when the update succeeds, or `null` when no matching object is found.