HealthInsuranceService
in package
Logic originally from HealthInsuranceController and AbstractHealthInsurancesOrganisationController, consolidated here as part of the controller removal (task #48636).
The controllers were being used directly in several legacy scripts, so instead of refactoring everything at once we moved the logic here to have a proper service layer first.
The plan is to eventually get rid of this class too and move all this logic into the corresponding Domain Objects, where it actually belongs.
Tags
Table of Contents
Methods
- __construct() : mixed
- isAllowedInvalidAndHealthInsurance() : bool
- Checks if a Spitex user is allowed to see IV+health insurance combined options for a client; it depends on whether the client's canton actually offers IV.
- isAnInvalidPeopleCantonalProvider() : bool
- Tells you if a canton offers IV (disability) insurance.
- mayBeGetInsuranceLegalCategorisation() : string
- Returns the first 2 chars of the law code name for an insurance.
- packAsIdNameForSelectBoxWithChangeAction() : array<string|int, mixed>
- Select box with all health insurances and no filter - not sure this is still needed anywhere.
- packAsIdNameForTabList() : array<string|int, mixed>
- 3-tab insurance selector: tab1 = already assigned, tab2 = not assigned, tab3 = everything A-Z.
- packForSelectBoxWithChangeAction() : array<string|int, mixed>
- Puts together the array the templates need to render a select box with an onChange action.
- selectBoxArgsRouter() : mixed
- The public entry point - runs the routing logic and wraps the result for the template.
Methods
__construct()
public
__construct() : mixed
isAllowedInvalidAndHealthInsurance()
Checks if a Spitex user is allowed to see IV+health insurance combined options for a client; it depends on whether the client's canton actually offers IV.
public
isAllowedInvalidAndHealthInsurance(int $userId, int $clientId) : bool
Parameters
- $userId : int
- $clientId : int
Tags
Return values
boolisAnInvalidPeopleCantonalProvider()
Tells you if a canton offers IV (disability) insurance.
public
isAnInvalidPeopleCantonalProvider(int $cantonId) : bool
Parameters
- $cantonId : int
Tags
Return values
boolmayBeGetInsuranceLegalCategorisation()
Returns the first 2 chars of the law code name for an insurance.
public
mayBeGetInsuranceLegalCategorisation(int $insuranceId) : string
New ones (id > 79999) go through the HS mapper, old ones through the Organisation.
Parameters
- $insuranceId : int
Return values
stringpackAsIdNameForSelectBoxWithChangeAction()
Select box with all health insurances and no filter - not sure this is still needed anywhere.
public
packAsIdNameForSelectBoxWithChangeAction(int $selected, string $command) : array<string|int, mixed>
Parameters
- $selected : int
- $command : string
Tags
Return values
array<string|int, mixed>packAsIdNameForTabList()
3-tab insurance selector: tab1 = already assigned, tab2 = not assigned, tab3 = everything A-Z.
public
packAsIdNameForTabList(bool $isSpitex, int|null $ownerId) : array<string|int, mixed>
Spitex users scope by client; other providers scope by owner.
Parameters
- $isSpitex : bool
- $ownerId : int|null
Return values
array<string|int, mixed>packForSelectBoxWithChangeAction()
Puts together the array the templates need to render a select box with an onChange action.
public
packForSelectBoxWithChangeAction(string $dataType, string $command, int $selected, array<string|int, mixed> $optionValues) : array<string|int, mixed>
Parameters
- $dataType : string
- $command : string
- $selected : int
- $optionValues : array<string|int, mixed>
Return values
array<string|int, mixed>selectBoxArgsRouter()
The public entry point - runs the routing logic and wraps the result for the template.
public
selectBoxArgsRouter(SelectBoxArgumentObject $sbao) : mixed
Parameters
- $sbao : SelectBoxArgumentObject