Api reference
components.be.public.account ¶
account_has_live_health_contract_since ¶
Checks that all companies of an account have had a live health contract in the time between the "since" date and now
Source code in components/be/public/account.py
create_account ¶
Creates a new account with the given name.
get_account_name ¶
Source code in components/be/public/account.py
user_is_account_admin ¶
Source code in components/be/public/account.py
components.be.public.affiliation ¶
get_next_affiliation_date ¶
Returns the next affiliation date for a user on a given date.
Source code in components/be/public/affiliation.py
components.be.public.auth ¶
authorization ¶
business_logic ¶
mfa_push_notification ¶
send_mfa_operation_pending_push_notification ¶
Sends a request to validate an MFA-protected operation
Source code in components/be/public/auth/business_logic/mfa_push_notification.py
components.be.public.blueprints ¶
admin_api_blueprint ¶
admin_tools ¶
init_blueprint ¶
Source code in components/be/public/blueprints/admin_tools.py
load_admin_tools_blueprint ¶
Source code in components/be/public/blueprints/admin_tools.py
assusoft_blueprint ¶
be_core_blueprint ¶
be_core_blueprint
module-attribute
¶
be_core_blueprint = CustomBlueprint(
"be-core",
__name__,
cli_group=None,
template_folder="templates",
static_folder="static",
static_url_path="/static",
)
register_blueprint ¶
Source code in components/be/public/blueprints/be_core_blueprint.py
register_commands ¶
Source code in components/be/public/blueprints/be_core_blueprint.py
billing_blueprint ¶
claim_management_blueprint ¶
components.be.public.clinic ¶
adapter ¶
BE_COMPANIES_WITH_FIVE_THERAPY_CREDITS
module-attribute
¶
BE_COMPANIES_WITH_SIX_THERAPY_CREDITS
module-attribute
¶
BE_COMPANIES_WITH_SIX_THERAPY_CREDITS = [
UUID("92c93177-dd7e-45b0-95ba-705190423cad"),
UUID("f69568ac-21bb-4b45-9174-6594c8490ff2"),
]
BeClinicAdapter ¶
Bases: ClinicAdapter
clinic_consent_ai_publish_date
class-attribute
instance-attribute
¶
get_allowlist_of_dermatology_medical_admins_ids ¶
get_app_base_user_data ¶
Source code in components/be/public/clinic/adapter.py
get_app_user_available_health_services ¶
Source code in components/be/public/clinic/adapter.py
get_app_user_data ¶
Source code in components/be/public/clinic/adapter.py
get_booking_session_package ¶
Source code in components/be/public/clinic/adapter.py
get_coverage_status ¶
get_last_active_id_verification_request_for_user ¶
BE implementation of getting the last active ID verification request for a user. Since Belgium doesn't support ID verification for the clinic, this will raise a NotImplementedError if it's called.
Source code in components/be/public/clinic/adapter.py
has_access_to_orientation_call ¶
Source code in components/be/public/clinic/adapter.py
has_app_user_permission ¶
Source code in components/be/public/clinic/adapter.py
is_app_user_admin_of_company ¶
Source code in components/be/public/clinic/adapter.py
release_date_of_conversations_created_for_therapy_sessions
class-attribute
instance-attribute
¶
request_id_verification_request_for_user ¶
BE implementation of getting or requesting ID verification request for a clinic user. Since BE doesn't support ID verification for clinic users, this will raise a NotImplementedError if it's called.
Source code in components/be/public/clinic/adapter.py
should_request_id_verification_for_user ¶
BE implementation of checking if ID verification should be requested for a clinic user. Since BE doesn't support ID verification for clinic users, this will always return False.
Source code in components/be/public/clinic/adapter.py
update_app_user_phone ¶
Source code in components/be/public/clinic/adapter.py
update_app_user_ssn ¶
Source code in components/be/public/clinic/adapter.py
upload_invoice_as_insurance_document ¶
Source code in components/be/public/clinic/adapter.py
user_has_24_hour_response_guarantee ¶
THERAPY_SESSION_COMPANY_PRICE_IN_CENTS
module-attribute
¶
clinic_eligibility ¶
This module contains the query to get the current or upcoming period of eligibility to the clinic restricted services.
NOTE: the logic could be reused by other services than the Clinic, provided the country-specific rules are the same. If yes, feel free to rename the file and query to a more generic name.
get_coverage_status ¶
Return the start and optionally the end date of the current or upcoming period of eligibility to the clinic restricted services.
Source code in components/be/public/clinic/clinic_eligibility.py
user ¶
update_user_nrn_and_eid ¶
Source code in components/be/public/clinic/user.py
components.be.public.command_log ¶
get_command_logs ¶
Source code in components/be/public/command_log.py
components.be.public.company ¶
company_has_live_health_contract_since ¶
Checks that a company has had a live health contract in the time between the "since" date and now
Source code in components/be/public/company.py
get_account_ids_from_company_ids ¶
Extract account IDs list from company IDs.
Source code in components/be/public/company.py
get_company_admins ¶
Returns list of company admins active on on_date for a specific company.
get_company_display_name ¶
get_company_display_name_and_account_id ¶
get_company_id_of_user ¶
get_company_id_to_account_id ¶
Source code in components/be/public/company.py
get_company_ids_for_account_id ¶
Source code in components/be/public/company.py
get_company_vat ¶
get_employees_invite_emails ¶
Source code in components/be/public/company.py
get_user_admined_company_ids ¶
is_company ¶
components.be.public.coverage_module ¶
CoverageModuleMappingsByHealthPlan
dataclass
¶
Represents the mapping of current coverage modules names to new ones for each health plan.
extract_coverage_module_mappings
classmethod
¶
Creates instance from JSON string containing coverage mappings. Returns None if data is missing or invalid.
Source code in components/be/public/coverage_module.py
from_dict
classmethod
¶
Creates instance from dictionary format.
Source code in components/be/public/coverage_module.py
get_module_mappings_for_health_plan ¶
Returns the coverage mappings for a given health plan.
to_dict ¶
Serializes the mappings to dictionary format.
HealthPlanCoverageMappings
dataclass
¶
Represents mappings from current to new coverage module names for a single health plan.
from_dict
classmethod
¶
Creates instance from a list of tuples format. Validates and transforms string values to CoverageModuleName.
Source code in components/be/public/coverage_module.py
get_mapped_module_name ¶
Returns the mapped coverage module name for a given current module name.
Source code in components/be/public/coverage_module.py
to_dict ¶
Serializes the mappings to a list of tuples format. Converts CoverageModuleName enum values to strings.
Source code in components/be/public/coverage_module.py
components.be.public.customer_health_partner ¶
employees_count ¶
get_employees_count ¶
Source code in components/be/public/customer_health_partner/employees_count.py
get_admin_traits ¶
get_admin_traits_to_notify ¶
Return the list of AdminTraits for admins who should be notified about the well-being assessment report.
Source code in components/be/public/customer_health_partner/get_admin_traits.py
get_company_ids_for_account_company_ids ¶
get_company_ids_for_account_company_ids ¶
Source code in components/be/public/customer_health_partner/get_company_ids_for_account_company_ids.py
components.be.public.events ¶
subscription ¶
subscribe_to_events ¶
All event subscriptions for France should be done here.
Source code in components/be/public/events/subscription.py
components.be.public.feature ¶
components.be.public.global_customer_dashboard ¶
admin ¶
admin_can_edit_rights_target_admin ¶
Source code in components/be/public/global_customer_dashboard/admin.py
edit_admin_entities ¶
edit_admin_entities(
admin_user_id,
added_account_ids,
removed_account_ids,
added_company_ids,
removed_company_ids,
save=True,
)
Source code in components/be/public/global_customer_dashboard/admin.py
get_account_details ¶
Source code in components/be/public/global_customer_dashboard/admin.py
get_admin ¶
Source code in components/be/public/global_customer_dashboard/admin.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | |
get_admined_entities_for_entity_selctor_be ¶
Source code in components/be/public/global_customer_dashboard/admin.py
get_admined_entities_query_api_be ¶
Get Belgium concrete instance of AdminedEntitiesQueryApi, bound to BE models
Source code in components/be/public/global_customer_dashboard/admin.py
get_admined_entity_from_id_be ¶
Source code in components/be/public/global_customer_dashboard/admin.py
get_admins_for_entities ¶
Source code in components/be/public/global_customer_dashboard/admin.py
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | |
get_common_companies_for_admins ¶
Source code in components/be/public/global_customer_dashboard/admin.py
get_company_details ¶
get_invitation_details ¶
Source code in components/be/public/global_customer_dashboard/admin.py
get_onboarded_employees ¶
Source code in components/be/public/global_customer_dashboard/admin.py
get_onboarded_employees_for_account ¶
Source code in components/be/public/global_customer_dashboard/admin.py
get_pending_admin_invitations_for_companies ¶
get_pending_admin_invitations_for_companies(
company_ids,
sort_filter,
sort_direction,
cursor=None,
limit=None,
)
Source code in components/be/public/global_customer_dashboard/admin.py
get_pending_onboardings_for_admined_entity_selector_be ¶
Source code in components/be/public/global_customer_dashboard/admin.py
promote_user_to_admin ¶
Source code in components/be/public/global_customer_dashboard/admin.py
remove_admin ¶
Source code in components/be/public/global_customer_dashboard/admin.py
remove_admin_invitation ¶
send_admin_invitation_email ¶
user_can_admin_entities ¶
Source code in components/be/public/global_customer_dashboard/admin.py
customer_health_partner ¶
get_company_ids_by_external_ids ¶
Get company ids by external ids (VAT number)
:param external_ids: set[str] - The external ids to get the company ids for. :return: dict[str, str | None] - A dictionary mapping external ids to company ids.
Source code in components/be/public/global_customer_dashboard/customer_health_partner.py
get_company_name_from_companies ¶
Source code in components/be/public/global_customer_dashboard/customer_health_partner.py
get_company_names_by_ids ¶
Source code in components/be/public/global_customer_dashboard/customer_health_partner.py
get_user_email_from_id ¶
Source code in components/be/public/global_customer_dashboard/customer_health_partner.py
get_user_info_from_id ¶
Source code in components/be/public/global_customer_dashboard/customer_health_partner.py
get_wellbeing_assessment_feature_summary ¶
Source code in components/be/public/global_customer_dashboard/customer_health_partner.py
validate_company_external_id ¶
Validate a Belgian VAT number. The VAT number should start with 'BE' followed by 10 digits
:param external_id: str - The VAT number to validate. :return: bool - True if the VAT number is valid, False otherwise.
Source code in components/be/public/global_customer_dashboard/customer_health_partner.py
components.be.public.health_contract ¶
does_health_contract_have_affiliation_delay ¶
Returns whether the health contract has an affiliation delay on a given date.
Source code in components/be/public/health_contract.py
get_health_contract_current_or_next_or_last_health_plan_id ¶
Returns the health plan ID of a health contract on a given date.
Source code in components/be/public/health_contract.py
get_health_contract_participation_scheme ¶
Returns the participation scheme of a health contract on a given date.
Source code in components/be/public/health_contract.py
get_health_contract_start_date ¶
Returns the contract start date.
Source code in components/be/public/health_contract.py
get_primary_price_for_individual_contract_on_renewal ¶
get_primary_price_for_individual_contract_on_renewal(
health_contract_id, on_date, new_health_plan_id
)
Calculate the primary price for an individual health contract renewal.
This function retrieves the age of the primary and computes the price given the new health plan's price rules on the default coverage.
Source code in components/be/public/health_contract.py
get_primary_price_increase_percentage_on_renewal ¶
Calculate the percentage increase in the primary price for a health contract renewal.
This function compares the current health plan's primary price with the new health plan's primary price on the default coverage. It determines if there's a price increase and, if so, calculates the percentage of that increase. Returns None if: - There is no price increase or there is a decrease - The contract is not active on the given date
Source code in components/be/public/health_contract.py
components.be.public.health_plan ¶
does_health_plan_default_coverage_have_daily_care ¶
Source code in components/be/public/health_plan.py
does_health_plan_default_coverage_have_hospi ¶
Source code in components/be/public/health_plan.py
get_default_coverage_module_name ¶
Returns the name of the default coverage module for the given health plan and enrollment type.
Source code in components/be/public/health_plan.py
get_health_plan_all_member_prices_in_cents ¶
Returns the default price for primary, partner, child and adult child enrollment types. If a participation scheme is provided, it calculates the price paid by the member.
Source code in components/be/public/health_plan.py
get_health_plan_default_primary_prices ¶
get_health_plan_single_room_contribution_in_cents ¶
Returns the personal contribution in cents for a single room hospitalization.
Source code in components/be/public/health_plan.py
get_health_plans_with_modules_by_ids ¶
Returns the health plans with their coverage modules by their IDs.
Source code in components/be/public/health_plan.py
get_primary_default_coverage_price ¶
Source code in components/be/public/health_plan.py
components.be.public.helpers ¶
front_end ¶
FRONT_END_PATHS
module-attribute
¶
FRONT_END_PATHS = dict(
APP_URL="/dashboard",
DEPENDENT_INVITE_URL="/password_creation",
LOGIN_URL="/login",
MARMOT_URL="/marmot",
MARMOT_CLAIM_MANAGEMENT="/marmot/claim_management",
MARMOT_ACCOUNT_URL="/TODO-TODO-TODO",
MARMOT_USER_URL="/marmot/user/",
MARMOT_COMPANY_URL="/marmot/company/",
PASSWORD_RESET_BASE_URL="/password_reset",
UNSUBSCRIBE_URL="/unsubscribe",
CUSTOMER_ADMIN_ONBOARDING_INVITE_URL="/onboarding/customer-admin-onboarding",
)
init_data_loader ¶
init_data_loader ¶
Create the base data to be populated in fresh local DBs.
Executed by "flask data init".
Please edit the README.md file in components/be when editing this file.
Source code in components/be/public/helpers/init_data_loader.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
templating ¶
configure_templating ¶
Inspired from https://github.com/alan-eu/alan-apps/blob/main/backend/components/fr/internal/helpers/templating.py#L46 ⧉
Source code in components/be/public/helpers/templating.py
components.be.public.scim_api ¶
adapter ¶
BeScimAdapter ¶
Bases: GenericScimAdapter
SCIM adapter for be_api
Source code in components/be/public/scim_api/adapter.py
create_app_user ¶
Create a user with the given first and last name. and returns the user ID.
Source code in components/be/public/scim_api/adapter.py
get_scim_users_data ¶
Returns the first and last name of users from a list of AlanEmployee objects.
Source code in components/be/public/scim_api/adapter.py
get_user_data ¶
Returns user's first and last name by user_id.
Source code in components/be/public/scim_api/adapter.py
test ¶
test_adapter ¶
adapter ¶
profile_service ¶
test_create_app_user ¶
Test create_app_user creates a new user correctly.
Source code in components/be/public/scim_api/test/test_adapter.py
test_get_scim_users_data ¶
Test get_scim_users_data returns correct mapping of user data.
Source code in components/be/public/scim_api/test/test_adapter.py
test_get_user_data ¶
Test get_user_data returns correct user identity.
Source code in components/be/public/scim_api/test/test_adapter.py
components.be.public.services ¶
push_notifications ¶
get_push_notification_logs_for_user ¶
Return a list of all the push notification logs ever created for the given user and notification names.
Source code in components/be/public/services/push_notifications.py
get_push_notification_tokens_for_user ¶
Source code in components/be/public/services/push_notifications.py
push_notification_sender_async ¶
Source code in components/be/public/services/push_notifications.py
push_notification_sender_sync ¶
Source code in components/be/public/services/push_notifications.py
components.be.public.test_data_generator ¶
get_test_data_generation_config ¶
Source code in components/be/internal/admin_tools/test_data_generator/test_data_generation_config.py
components.be.public.user ¶
find_company_ids_wher_user_has_employment ¶
Source code in components/be/public/user.py
find_company_ids_wher_user_is_admin ¶
Source code in components/be/public/user.py
find_user_id_by_email ¶
get_last_itsme_link_for_clinic ¶
Get the last itsme user link for clinic context
Source code in components/be/public/user.py
get_last_itsme_link_for_self_serve_signatory ¶
Get the last itsme user link for self serve signatory context
Source code in components/be/public/user.py
get_user ¶
get_user_active_health_contract_and_plan_ids ¶
Retrieves the IDs of the health contract and plan that the user is currently enrolled in. Returns: A tuple of (health_contract_id, health_plan_id) if user has an active enrollment, None otherwise
Source code in components/be/public/user.py
get_user_capabilities ¶
get_user_email ¶
get_user_for_clinic ¶
Get user data for clinic
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_id
|
UUID
|
user id |
required |
Returns:
| Type | Description |
|---|---|
BeUser
|
Belgium user data |
Source code in components/be/public/user.py
get_user_from_email ¶
get_user_full_name ¶
get_visible_dependents ¶
Source code in components/be/public/user.py
is_user ¶
update_user_phone ¶
Source code in components/be/public/user.py
user_can_write ¶
Source code in components/be/public/user.py
user_has_live_enrollment_since ¶
Checks that a user has had a live enrollment in the time between the "since" date and now