Class BoxController
- Namespace
- adas_core.Controllers
- Assembly
- adas-core.dll
Provides API endpoints for managing box-related operations, including units, patients, and insulation lists.
[Route("Box")]
[ApiController]
public class BoxController : ControllerBase
- Inheritance
-
BoxController
- Inherited Members
- Extension Methods
Constructors
BoxController(IUnitService, IPatientService, IMasterListService<InsulationList>, IPointOfCareService, IUserService)
Initializes a new instance of the BoxController class.
public BoxController(IUnitService unitService, IPatientService patientService, IMasterListService<InsulationList> isulationListService, IPointOfCareService pointOfCareService, IUserService userService)
Parameters
unitServiceIUnitServiceThe service used to manage unit-related operations.
patientServiceIPatientServiceThe service used to manage patient-related operations.
isulationListServiceIMasterListService<InsulationList>The master list service used to manage insulation list operations.
pointOfCareServiceIPointOfCareServiceThe service used to manage point of care operations.
userServiceIUserServiceThe service used to manage user-related operations.
Exceptions
- ArgumentNullException
Thrown when any of the provided service dependencies is
null.
Methods
SwitchData(string, string)
Switches the data for a given box number based on the specified action type. For the "Isolation" action, it randomly selects an option from the unit's insulation list and updates the patient's master list with the new option; the "Mobility" action is not yet implemented.
[HttpGet("{boxNumber}/{elementSwitjAction}/switch-data")]
[AuthorizeRoles(PermissionEnum.RolesType.AuthSome)]
public Task<IActionResult> SwitchData(string boxNumber, string elementSwitjAction)
Parameters
boxNumberstringThe box number used to locate the associated unit and point of care.
elementSwitjActionstringThe action that determines which observation list to switch (e.g., "Isolation", "Mobility").
Returns
- Task<IActionResult>
An IActionResult indicating the result of the operation.
Exceptions
- UnauthorizedException
Thrown when the current user identity name is not available in the HTTP context.