Class PointOfCareController
- Namespace
- adas_core.Controllers
- Assembly
- adas-core.dll
[Route("point-of-cares")]
[ApiController]
public class PointOfCareController : ControllerBase
- Inheritance
-
PointOfCareController
- Inherited Members
- Extension Methods
Constructors
PointOfCareController(IPointOfCareService)
public PointOfCareController(IPointOfCareService pointOfCareService)
Parameters
pointOfCareServiceIPointOfCareService
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
pointOfCarePointOfCareThe 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
idstringThe 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
idis 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
idstringThe 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
idis 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
requestPaginationFilterThe 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
requestis 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
unitIdstringThe string representation of the unit's ObjectId used to locate the associated Point of Care records.
statusstringThe 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
unitIdis not a valid ObjectId orstatuscannot 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
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
idstringThe string representation of the point of care identifier to update.
statusstringThe 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
idis not a valid ObjectId orstatuscannot 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
pocPointOfCareThe 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
idstringThe identifier of the Point of Care whose configuration will be updated.
pocConfigPointOfCareConfigurationThe 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
idcannot 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
unitUnitThe unit payload containing the configuration changes to apply, supplied in the request body.
idstringThe 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
idcannot 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
pocPointOfCareThe 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