# Class PointOfCareController

Namespace
  adas_core.Controllers

Assembly
  adas-core.dll

    [Route("point-of-cares")]
    [ApiController]
    public class PointOfCareController : ControllerBase

Inheritance
  object
  ControllerBase
  PointOfCareController

Inherited Members
  ControllerBase.StatusCode(int)
  ControllerBase.StatusCode(int, object)
  ControllerBase.Content(string)
  ControllerBase.Content(string, string)
  ControllerBase.Content(string, string, Encoding)
  ControllerBase.Content(string, MediaTypeHeaderValue)
  ControllerBase.NoContent()
  ControllerBase.Ok()
  ControllerBase.Ok(object)
  ControllerBase.Redirect(string)
  ControllerBase.RedirectPermanent(string)
  ControllerBase.RedirectPreserveMethod(string)
  ControllerBase.RedirectPermanentPreserveMethod(string)
  ControllerBase.LocalRedirect(string)
  ControllerBase.LocalRedirectPermanent(string)
  ControllerBase.LocalRedirectPreserveMethod(string)
  ControllerBase.LocalRedirectPermanentPreserveMethod(string)
  ControllerBase.RedirectToAction()
  ControllerBase.RedirectToAction(string)
  ControllerBase.RedirectToAction(string, object)
  ControllerBase.RedirectToAction(string, string)
  ControllerBase.RedirectToAction(string, string, object)
  ControllerBase.RedirectToAction(string, string, string)
  ControllerBase.RedirectToAction(string, string, object, string)
  ControllerBase.RedirectToActionPreserveMethod(string, string, object, string)
  ControllerBase.RedirectToActionPermanent(string)
  ControllerBase.RedirectToActionPermanent(string, object)
  ControllerBase.RedirectToActionPermanent(string, string)
  ControllerBase.RedirectToActionPermanent(string, string, string)
  ControllerBase.RedirectToActionPermanent(string, string, object)
  ControllerBase.RedirectToActionPermanent(string, string, object, string)
  ControllerBase.RedirectToActionPermanentPreserveMethod(string, string, object, string)
  ControllerBase.RedirectToRoute(string)
  ControllerBase.RedirectToRoute(object)
  ControllerBase.RedirectToRoute(string, object)
  ControllerBase.RedirectToRoute(string, string)
  ControllerBase.RedirectToRoute(string, object, string)
  ControllerBase.RedirectToRoutePreserveMethod(string, object, string)
  ControllerBase.RedirectToRoutePermanent(string)
  ControllerBase.RedirectToRoutePermanent(object)
  ControllerBase.RedirectToRoutePermanent(string, object)
  ControllerBase.RedirectToRoutePermanent(string, string)
  ControllerBase.RedirectToRoutePermanent(string, object, string)
  ControllerBase.RedirectToRoutePermanentPreserveMethod(string, object, string)
  ControllerBase.RedirectToPage(string)
  ControllerBase.RedirectToPage(string, object)
  ControllerBase.RedirectToPage(string, string)
  ControllerBase.RedirectToPage(string, string, object)
  ControllerBase.RedirectToPage(string, string, string)
  ControllerBase.RedirectToPage(string, string, object, string)
  ControllerBase.RedirectToPagePermanent(string)
  ControllerBase.RedirectToPagePermanent(string, object)
  ControllerBase.RedirectToPagePermanent(string, string)
  ControllerBase.RedirectToPagePermanent(string, string, string)
  ControllerBase.RedirectToPagePermanent(string, string, object, string)
  ControllerBase.RedirectToPagePreserveMethod(string, string, object, string)
  ControllerBase.RedirectToPagePermanentPreserveMethod(string, string, object, string)
  ControllerBase.File(byte[], string)
  ControllerBase.File(byte[], string, bool)
  ControllerBase.File(byte[], string, string)
  ControllerBase.File(byte[], string, string, bool)
  ControllerBase.File(byte[], string, DateTimeOffset?, EntityTagHeaderValue)
  ControllerBase.File(byte[], string, DateTimeOffset?, EntityTagHeaderValue, bool)
  ControllerBase.File(byte[], string, string, DateTimeOffset?, EntityTagHeaderValue)
  ControllerBase.File(byte[], string, string, DateTimeOffset?, EntityTagHeaderValue, bool)
  ControllerBase.File(Stream, string)
  ControllerBase.File(Stream, string, bool)
  ControllerBase.File(Stream, string, string)
  ControllerBase.File(Stream, string, string, bool)
  ControllerBase.File(Stream, string, DateTimeOffset?, EntityTagHeaderValue)
  ControllerBase.File(Stream, string, DateTimeOffset?, EntityTagHeaderValue, bool)
  ControllerBase.File(Stream, string, string, DateTimeOffset?, EntityTagHeaderValue)
  ControllerBase.File(Stream, string, string, DateTimeOffset?, EntityTagHeaderValue, bool)
  ControllerBase.File(string, string)
  ControllerBase.File(string, string, bool)
  ControllerBase.File(string, string, string)
  ControllerBase.File(string, string, string, bool)
  ControllerBase.File(string, string, DateTimeOffset?, EntityTagHeaderValue)
  ControllerBase.File(string, string, DateTimeOffset?, EntityTagHeaderValue, bool)
  ControllerBase.File(string, string, string, DateTimeOffset?, EntityTagHeaderValue)
  ControllerBase.File(string, string, string, DateTimeOffset?, EntityTagHeaderValue, bool)
  ControllerBase.PhysicalFile(string, string)
  ControllerBase.PhysicalFile(string, string, bool)
  ControllerBase.PhysicalFile(string, string, string)
  ControllerBase.PhysicalFile(string, string, string, bool)
  ControllerBase.PhysicalFile(string, string, DateTimeOffset?, EntityTagHeaderValue)
  ControllerBase.PhysicalFile(string, string, DateTimeOffset?, EntityTagHeaderValue, bool)
  ControllerBase.PhysicalFile(string, string, string, DateTimeOffset?, EntityTagHeaderValue)
  ControllerBase.PhysicalFile(string, string, string, DateTimeOffset?, EntityTagHeaderValue, bool)
  ControllerBase.Unauthorized()
  ControllerBase.Unauthorized(object)
  ControllerBase.NotFound()
  ControllerBase.NotFound(object)
  ControllerBase.BadRequest()
  ControllerBase.BadRequest(object)
  ControllerBase.BadRequest(ModelStateDictionary)
  ControllerBase.UnprocessableEntity()
  ControllerBase.UnprocessableEntity(object)
  ControllerBase.UnprocessableEntity(ModelStateDictionary)
  ControllerBase.Conflict()
  ControllerBase.Conflict(object)
  ControllerBase.Conflict(ModelStateDictionary)
  ControllerBase.Problem(string, string, int?, string, string)
  ControllerBase.ValidationProblem(ValidationProblemDetails)
  ControllerBase.ValidationProblem(ModelStateDictionary)
  ControllerBase.ValidationProblem()
  ControllerBase.ValidationProblem(string, string, int?, string, string, ModelStateDictionary)
  ControllerBase.Created()
  ControllerBase.Created(string, object)
  ControllerBase.Created(Uri, object)
  ControllerBase.CreatedAtAction(string, object)
  ControllerBase.CreatedAtAction(string, object, object)
  ControllerBase.CreatedAtAction(string, string, object, object)
  ControllerBase.CreatedAtRoute(string, object)
  ControllerBase.CreatedAtRoute(object, object)
  ControllerBase.CreatedAtRoute(string, object, object)
  ControllerBase.Accepted()
  ControllerBase.Accepted(object)
  ControllerBase.Accepted(Uri)
  ControllerBase.Accepted(string)
  ControllerBase.Accepted(string, object)
  ControllerBase.Accepted(Uri, object)
  ControllerBase.AcceptedAtAction(string)
  ControllerBase.AcceptedAtAction(string, string)
  ControllerBase.AcceptedAtAction(string, object)
  ControllerBase.AcceptedAtAction(string, string, object)
  ControllerBase.AcceptedAtAction(string, object, object)
  ControllerBase.AcceptedAtAction(string, string, object, object)
  ControllerBase.AcceptedAtRoute(object)
  ControllerBase.AcceptedAtRoute(string)
  ControllerBase.AcceptedAtRoute(string, object)
  ControllerBase.AcceptedAtRoute(object, object)
  ControllerBase.AcceptedAtRoute(string, object, object)
  ControllerBase.Challenge()
  ControllerBase.Challenge(params string[])
  ControllerBase.Challenge(AuthenticationProperties)
  ControllerBase.Challenge(AuthenticationProperties, params string[])
  ControllerBase.Forbid()
  ControllerBase.Forbid(params string[])
  ControllerBase.Forbid(AuthenticationProperties)
  ControllerBase.Forbid(AuthenticationProperties, params string[])
  ControllerBase.SignIn(ClaimsPrincipal)
  ControllerBase.SignIn(ClaimsPrincipal, string)
  ControllerBase.SignIn(ClaimsPrincipal, AuthenticationProperties)
  ControllerBase.SignIn(ClaimsPrincipal, AuthenticationProperties, string)
  ControllerBase.SignOut()
  ControllerBase.SignOut(AuthenticationProperties)
  ControllerBase.SignOut(params string[])
  ControllerBase.SignOut(AuthenticationProperties, params string[])
  ControllerBase.TryUpdateModelAsync<TModel>(TModel)
  ControllerBase.TryUpdateModelAsync<TModel>(TModel, string)
  ControllerBase.TryUpdateModelAsync<TModel>(TModel, string, IValueProvider)
  ControllerBase.TryUpdateModelAsync<TModel>(TModel, string, params Expression<Func<TModel, object>>[])
  ControllerBase.TryUpdateModelAsync<TModel>(TModel, string, Func<ModelMetadata, bool>)
  ControllerBase.TryUpdateModelAsync<TModel>(TModel, string, IValueProvider, params Expression<Func<TModel, object>>[])
  ControllerBase.TryUpdateModelAsync<TModel>(TModel, string, IValueProvider, Func<ModelMetadata, bool>)
  ControllerBase.TryUpdateModelAsync(object, Type, string)
  ControllerBase.TryUpdateModelAsync(object, Type, string, IValueProvider, Func<ModelMetadata, bool>)
  ControllerBase.TryValidateModel(object)
  ControllerBase.TryValidateModel(object, string)
  ControllerBase.HttpContext
  ControllerBase.Request
  ControllerBase.Response
  ControllerBase.RouteData
  ControllerBase.ModelState
  ControllerBase.ControllerContext
  ControllerBase.MetadataProvider
  ControllerBase.ModelBinderFactory
  ControllerBase.Url
  ControllerBase.ObjectValidator
  ControllerBase.ProblemDetailsFactory
  ControllerBase.User
  ControllerBase.Empty
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

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

## Constructors

### PointOfCareController(IPointOfCareService)

    public PointOfCareController(IPointOfCareService pointOfCareService)

#### Parameters

`pointOfCareService` IPointOfCareService

## Methods

### CreateNewPointOfCare(PointOfCare)

Creates a new point of care record by delegating to the point of care service for persistence and returns the result of the insertion operation.

    [HttpPost]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> CreateNewPointOfCare(PointOfCare pointOfCare)

#### Parameters

`pointOfCare` PointOfCare

  The point of care entity supplied in the request body to be created.

#### Returns

Task<IActionResult>

  An IActionResult containing the result of the insertion wrapped in an HTTP 200 OK response.

### DeletePoC(string)

Deletes a Point of Care (PoC) entity identified by the supplied identifier.

    [HttpDelete("{id}")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> DeletePoC(string id)

#### Parameters

`id` string

  The string representation of the PoC's ObjectId to be deleted.

#### Returns

Task<IActionResult>

  An IActionResult representing an HTTP 200 OK response when the deletion succeeds.

#### Exceptions

BadRequestException

  Thrown when `id` is not a valid ObjectId format.

### GetAllPoCByUnitId(string)

Retrieves all Points of Care (PoC) associated with the specified unit identifier.

    [HttpGet("{id}/unit-id")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> GetAllPoCByUnitId(string id)

#### Parameters

`id` string

  The unit identifier expected to be a valid ObjectId.

#### Returns

Task<IActionResult>

  An HTTP 200 response containing the list of Points of Care for the unit, or null if no results are found.

#### Exceptions

BadRequestException

  Thrown when the provided `id` is not a valid ObjectId format.

### GetPaginatedPoCs(PaginationFilter)

Retrieves a paginated list of Points of Care (PoCs) based on the provided pagination filter. Requires authorization with the appropriate role and permission scope.

    [HttpPost("paginated")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> GetPaginatedPoCs(PaginationFilter request)

#### Parameters

`request` PaginationFilter

  The pagination filter containing the paging criteria to apply to the PoCs query.

#### Returns

Task<IActionResult>

  An IActionResult containing the paginated PoCs returned by the service.

#### Exceptions

BadRequestException

  Thrown when the `request` is null.

### GetPoCByUnitIdAndStatus(string, string)

Retrieves Point of Care records filtered by the specified unit identifier and status. Throws a bad request when the unit identifier is not a valid ObjectId or the status cannot be parsed into a known StatusEnum.PointOfCare value.

    [HttpGet("{unitId}/unit-id/{status}/status")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> GetPoCByUnitIdAndStatus(string unitId, string status)

#### Parameters

`unitId` string

  The string representation of the unit's ObjectId used to locate the associated Point of Care records.

`status` string

  The string representation of the status filter, parsed into the StatusEnum.PointOfCare enumeration.

#### Returns

Task<IActionResult>

  An IActionResult containing the Point of Care records that match the provided unit and status.

#### Exceptions

BadRequestException

  Thrown when `unitId` is not a valid ObjectId or `status` cannot be parsed into a StatusEnum.PointOfCare value.

### List()

GetByCodeSysAndCode all PoC list

    [HttpGet]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> List()

#### Returns

Task<IActionResult>

  List<unit></unit>

### SetPointOfCareStatus(string, string)

Updates the status of a point of care, validating that the id is a valid ObjectId and the status maps to a valid StatusEnum.PointOfCare value before delegating to the point of care service.

    [HttpPut("{id}/{status}/status")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> SetPointOfCareStatus(string id, string status)

#### Parameters

`id` string

  The string representation of the point of care identifier to update.

`status` string

  The string representation of the new status to apply.

#### Returns

Task<IActionResult>

  An IActionResult indicating the result of the status update operation.

#### Exceptions

BadRequestException

  Thrown when `id` is not a valid ObjectId or `status` cannot be parsed as a StatusEnum.PointOfCare value.

### UpdatePoC(PointOfCare)

Updates an existing Point of Care record.

    [HttpPut]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> UpdatePoC(PointOfCare poc)

#### Parameters

`poc` PointOfCare

  The Point of Care object containing the updated information, provided in the request body.

#### Returns

Task<IActionResult>

  An IActionResult containing the result of the update operation.

### UpdatePoCConfiguration(string, PointOfCareConfiguration)

Updates the configuration of an existing Point of Care device identified by `id`. Validates that the supplied identifier is a valid ObjectId format before delegating the update to the Point of Care service.

    [HttpPut("{id}/config")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> UpdatePoCConfiguration(string id, PointOfCareConfiguration pocConfig)

#### Parameters

`id` string

  The identifier of the Point of Care whose configuration will be updated.

`pocConfig` PointOfCareConfiguration

  The new configuration payload to apply to the Point of Care.

#### Returns

Task<IActionResult>

  An IActionResult containing an HTTP 200 OK response when the configuration is successfully updated.

#### Exceptions

BadRequestException

  Thrown when `id` cannot be parsed as a valid ObjectId.

### UpdatePoCConfiguration(Unit, string)

Updates the Point of Care (PoC) unit configuration identified by the supplied identifier. Validates that the provided identifier is in a valid ObjectId format before delegating the update to the point of care service.

    [HttpPut("{id}/unit")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> UpdatePoCConfiguration(Unit unit, string id)

#### Parameters

`unit` Unit

  The unit payload containing the configuration changes to apply, supplied in the request body.

`id` string

  The identifier of the PoC whose unit configuration should be updated, expected to be a valid ObjectId.

#### Returns

Task<IActionResult>

  An IActionResult that produces an HTTP 200 (OK) response when the update succeeds.

#### Exceptions

BadRequestException

  Thrown when the supplied `id` cannot be parsed as a valid ObjectId.

### UpdatePoCRelay(PointOfCare)

Updates the relay configuration of a Point of Care (PoC) device based on the provided payload.

    [HttpPut("relay")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    [PermissionAuthorize("Source", "DisplayId")]
    public Task<IActionResult> UpdatePoCRelay(PointOfCare poc)

#### Parameters

`poc` PointOfCare

  The Point of Care object containing the updated relay configuration details.

#### Returns

Task<IActionResult>

  An IActionResult indicating the result of the operation; returns OkResult on successful update.

### VirtualPocList()

GetByCodeSysAndCode all Viirtual PoC list

    [HttpGet("get-all-virtual")]
    [AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
    public IActionResult VirtualPocList()

#### Returns

IActionResult

  List<unit></unit>