Documentation

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.

This HealthInsuranceService class was created by Alejandro Sosa only as a temporary transfer class for the existing logic. The original logic still belongs to Luca Palo.

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
author

Luca Palo original logic

author

Alejandro Sosa temporary HealthInsuranceService class

todo

move logic to Domain Objects and remove this class

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

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
todo

remove - no usage found

Return values
bool

isAnInvalidPeopleCantonalProvider()

Tells you if a canton offers IV (disability) insurance.

public isAnInvalidPeopleCantonalProvider(int $cantonId) : bool
Parameters
$cantonId : int
Tags
todo

remove - no usage found

Return values
bool

mayBeGetInsuranceLegalCategorisation()

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
string

packAsIdNameForSelectBoxWithChangeAction()

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
todo

remove - no usage found

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>

        
On this page

Search results