Api reference
components.fr.public.admins ¶
queries ¶
get_account_admins_profile_ids ¶
Get the profile_ids of the admins of an account.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
account_id
|
UUID
|
The id of the account. |
required |
Source code in components/fr/public/admins/queries.py
get_company_admins_profile_ids ¶
Get the profile_ids of the admins of a company.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
company_id
|
int
|
The id of the company. |
required |
Source code in components/fr/public/admins/queries.py
get_user_can_add_and_refer_company ¶
Source code in components/fr/public/admins/queries.py
components.fr.public.auth ¶
authorization ¶
AuthorizationStrategies ¶
authenticated_with_custom_authorization
class-attribute
instance-attribute
¶
authenticated_with_token_fallback
class-attribute
instance-attribute
¶
authenticated_with_token_fallback_with_custom_authorization
class-attribute
instance-attribute
¶
authenticated_with_token_fallback_with_custom_authorization = (
FrAuthenticatedOrTokenWithCustomAuthorizationStrategy
)
FrAlanerAdminStrategy ¶
FrAuthenticatedOrTokenStrategy ¶
FrAuthenticatedOrTokenStrategy(
token_extractor=None,
token_param_name="token",
schemes=None,
allow_deep_link=False,
)
Bases: FrAuthenticatedStrategy
Support either one pair of param name and token extractor or a scheme of multiple pairs of param name and token extractor.
Source code in components/fr/public/auth/authorization.py
authenticator ¶
Source code in components/fr/public/auth/authorization.py
FrAuthenticatedOrTokenWithCustomAuthorizationStrategy ¶
FrAuthenticatedOrTokenWithCustomAuthorizationStrategy(
token_extractor=None,
token_param_name="token",
schemes=None,
allow_deep_link=False,
)
Bases: FrAuthenticatedOrTokenStrategy
Source code in components/fr/public/auth/authorization.py
FrAuthenticatedStrategy ¶
FrAuthenticatedWithCustomAuthorizationStrategy ¶
FrOpenStrategy ¶
FrOwnerOnlyStrategy ¶
Bases: OwnerOnlyStrategy
Source code in components/fr/public/auth/authorization.py
components.fr.public.claim_management ¶
api ¶
schedule_update_insurance_profile_informations_cache ¶
schedule_update_insurance_profile_informations_cache(
insurance_profile_id=None,
insurance_profile_ids=None,
priority=None,
)
Schedule the update of the insurance profile information cache for the given insurance profile
Source code in components/fr/public/claim_management/api.py
upload_alan_therapy_invoice_as_insurance_document ¶
upload_alan_therapy_invoice_as_insurance_document(
file,
start_date,
end_date,
operator_comment,
user_id,
paid_amount,
executant_number,
health_professional,
short_code,
excluded_company_ids=None,
)
Upload internally an insurance document for Alan Therapy
Source code in components/fr/public/claim_management/api.py
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 | |
components.fr.public.clinic ¶
adapter ¶
FrClinicAdapter ¶
Bases: ClinicAdapter
clinic_consent_ai_publish_date
class-attribute
instance-attribute
¶
get_allowlist_of_dermatology_medical_admins_ids ¶
Source code in components/fr/public/clinic/adapter.py
get_app_base_user_data ¶
Source code in components/fr/public/clinic/adapter.py
get_app_user_available_health_services ¶
Source code in components/fr/public/clinic/adapter.py
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 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 | |
get_app_user_data ¶
Source code in components/fr/public/clinic/adapter.py
get_booking_session_package ¶
Source code in components/fr/public/clinic/adapter.py
get_coverage_status ¶
Source code in components/fr/public/clinic/adapter.py
get_last_active_id_verification_request_for_user ¶
FR implementation of getting the last active ID verification request for a user.
Source code in components/fr/public/clinic/adapter.py
has_access_to_orientation_call ¶
Source code in components/fr/public/clinic/adapter.py
has_app_user_permission ¶
Source code in components/fr/public/clinic/adapter.py
is_app_user_admin_of_company ¶
Source code in components/fr/public/clinic/adapter.py
release_date_of_conversations_created_for_therapy_sessions
class-attribute
instance-attribute
¶
request_id_verification_request_for_user ¶
FR implementation of getting or requesting ID verification for a user.
Source code in components/fr/public/clinic/adapter.py
should_request_id_verification_for_user ¶
FR implementation of checking if ID verification should be requested for a user. We request ID verification for internal consultation if: - The feature flag "request_id_verification_for_internal_consultation" is enabled for the user - The user does not have an active ID verification request - The user's identity is not validated
Source code in components/fr/public/clinic/adapter.py
update_app_user_phone ¶
Source code in components/fr/public/clinic/adapter.py
update_app_user_ssn ¶
upload_invoice_as_insurance_document ¶
Source code in components/fr/public/clinic/adapter.py
user_has_24_hour_response_guarantee ¶
Source code in components/fr/public/clinic/adapter.py
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/fr/public/clinic/clinic_eligibility.py
guarantee ¶
THERAPY_SESSION_COMPANY_PRICE_IN_CENTS
module-attribute
¶
get_therapy_sessions_guarantee_package ¶
Get the therapy sessions guarantee data for a user
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_user_id
|
int
|
The user ID |
required |
Returns:
| Type | Description |
|---|---|
BookingSessionPackage
|
The therapy sessions package |
Source code in components/fr/public/clinic/guarantee.py
get_therapy_sessions_reimbursed_data ¶
Get the therapy sessions reimbursed for a user
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
guarantees
|
list[CoverageGuarantee]
|
The user guarantees |
required |
insurance_profile_id
|
int
|
The insurance profile ID |
required |
app_user_id
|
str
|
The user ID |
required |
Source code in components/fr/public/clinic/guarantee.py
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 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 181 182 183 184 | |
get_user_coverage_payload ¶
Source code in components/fr/public/clinic/guarantee.py
id_verification ¶
convert_user_data_id_verification_request_user_info ¶
Converts UserData to IDVerificationRequestUserInfo for FR.
Source code in components/fr/public/clinic/id_verification.py
create_first_name_with_additional_first_names ¶
Creates a first name string that includes additional first names if provided.
Source code in components/fr/public/clinic/id_verification.py
internal_teleconsultation ¶
ALLOWLIST_OF_DERMATOLOGY_MEDICAL_ADMINS_IDS
module-attribute
¶
DERMATOLOGY_TELECONSULTATION_FEATURE_NAME
module-attribute
¶
INTERNAL_TELECONSULTATION_FEATURE_NAME
module-attribute
¶
app_user_has_access_to_dermatology_teleconsultation ¶
Check if the app user has access to dermatology teleconsultation
Source code in components/fr/public/clinic/internal_teleconsultation.py
app_user_has_access_to_internal_teleconsultation ¶
Check if the app user has access to internal teleconsultation
Source code in components/fr/public/clinic/internal_teleconsultation.py
components.fr.public.company ¶
queries ¶
get_all_franchises ¶
get_company_ids_from_account ¶
Source code in components/fr/internal/business_logic/account/queries/account.py
get_default_company_id_for_user ¶
Source code in components/fr/internal/business_logic/company/queries/company.py
components.fr.public.contract ¶
queries ¶
health_contracts ¶
get_health_contract_information ¶
Source code in components/fr/internal/business_logic/contract/queries/health_contracts.py
income ¶
get_dependent_income_brackets_for_subscriptions ¶
Get dependent income brackets for multiple subscriptions from contract discount rules.
This function extracts income brackets from the discount rules associated with each contract. It filters for discounts that are valid on the given date and converts discount rule income brackets to IncomeBracketEntity objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_ids
|
list[int]
|
List of subscription IDs to get dependent brackets for |
required |
on_date
|
date
|
The date to check the income brackets against |
required |
Returns: dict[int, list[IncomeBracketEntity]]: Mapping of subscription_id to dependent brackets
Source code in components/fr/internal/contract/queries/income.py
get_income_brackets_for_subscriptions ¶
Returns income brackets for multiple subscriptions on a specific date. This function is optimized to avoid N+1 queries by batching database operations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_ids
|
list[int]
|
List of subscription IDs to get income brackets for |
required |
on_date
|
date
|
The date to check the income brackets against |
required |
for_target
|
Optional[IncomeBracketTarget]
|
Optional target for which the income brackets are requested |
None
|
Returns: dict[int, list[IncomeBracketEntity]]: Mapping of subscription_id to income brackets Only includes subscriptions that have income brackets
Source code in components/fr/internal/contract/queries/income.py
get_member_type_for_user_on ¶
Source code in components/fr/internal/contract/queries/income.py
get_option_income_brackets_for_subscriptions ¶
Get option income brackets for multiple subscriptions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subscription_ids
|
list[int]
|
List of subscription IDs to get option brackets for |
required |
on_date
|
date
|
The date to check the income brackets against |
required |
Returns: dict[int, list[IncomeBracketEntity]]: Mapping of subscription_id to option brackets
Source code in components/fr/internal/contract/queries/income.py
components.fr.public.customer_health_partner ¶
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/fr/public/customer_health_partner/get_admin_traits.py
components.fr.public.demo_account ¶
components.fr.public.document_parsing ¶
entities ¶
queries ¶
document_category ¶
get_document_categories ¶
Get the list of document categories with display info for document in France For now we only return categories that are handled by the new parsing tool return: list[DocumentCategoryDisplayInfo]
Source code in components/fr/public/document_parsing/queries/document_category.py
get_document_category_label ¶
Retrieve the label for the given document category return: string
Source code in components/fr/public/document_parsing/queries/document_category.py
helpers ¶
HEALTH_DOCUMENT_UPLOAD_URL
module-attribute
¶
REJECTION_BODY_FOR_USER
module-attribute
¶
REJECTION_BODY_FOR_USER = {'default_message': {unreadable: f'🧐 Nous ne parvenons pas à lire les informations sur ce document.
👉 Nous vous invitons à nous le transférer à nouveau :
- dans un format standard type (.JPEG, .PNG ou .PDF),
- En vous assurant que l'image est nette et que la qualité est suffisante.
Transférer une nouvelle version du document :{HEALTH_DOCUMENT_UPLOAD_URL}
', unusable_partial_document: f'🤔 Le document envoyé n'est pas complet. Des informations sont donc manquantes pour pouvoir estimer votre remboursement.
👉 Nous vous invitons à nous le renvoyer dans son intégralité (toutes les pages, chaque page entièrement visible).
💁 Dans le cas d'un décompte de soins, vous pouvez le télécharger depuis le site de la Sécurité Sociale, rubrique "Mes paiements" en cliquant sur "Télécharger un décompte" (la petite flèche située à droite des frais de santé concernés).
Transférer une nouvelle version du document : f{HEALTH_DOCUMENT_UPLOAD_URL}', duplicate: "🤔 On dirait que ce document est déjà en notre possession.\n\n👉 Si c'est une erreur, vous pouvez nous renvoyer le bon document, nous le traiterons rapidement.", beneficiary_not_covered: "🤔 On dirait que ce document concerne un bénéficiaire qui n'est pas couvert par Alan.\n\n👉 Nous ne pouvons donc pas procéder au remboursement.", insufficent_info_for_parsing: "🤔 Le document ne contient pas toutes les informations pour estimer votre remboursement. Il y manque :\n\n- Nom du bénéficiaire\n- Nom du professionnel de santé\n- Numéro d'inscription au registre ADELI du professionnel de santé\n- Type de soin / consultation\n- Prix de l'acte (pour chacun des actes séparément)\n- Base de remboursement de la Sécurité sociale ou BRSS (pour chacun des actes séparément)\n- Répartition du dépassement d'honoraires (sur chacun des actes)\n- Code de regroupement pour chacun des actes mentionnés\n- Code de regroupement pour chacun des éléments de l'équipement optique afin que nous puissions identifier la complexité de vos verres et appliquer la garantie correspondante\n- Date de chaque soin / consultation- Décompte complet et détaillé correspondant\n- Facture acquittée à la réception du colis\n- Devis initial avec les bases des actes envisagés\n- Type de soins ou facture détaillée correspondante\n- Si l'intervention porte sur les deux yeux ou un seul oeil (si oui, lequel ?)\n- Décompte complet et détaillé des soins remboursés, accompagné de ce document\n- Certains codes de regroupements ou codes actes apparaissant dans le document sont périmés et ne doivent plus être utilisés\n\n😀 Cependant sachez qu'en général, nous n'avons pas besoin de facture ! Si votre télétransmission est activée, et que votre soin est couvert par la Sécurité sociale, nous devrions recevoir les infos directement de leur part. Toutefois, si vous trouvez le délai trop long (> 15 jours), vous gardez bien sûr la possibilité :\n- de vérifier sur votre compte Améli si le remboursement a déjà été fait par la Sécurité sociale : si oui, vous pouvez nous transmettre le décompte à la place,\n- et, à défaut, de contacter le professionnel de santé pour savoir s'il a bien fait la déclaration de son côté", non_EU_prescription: "🤔 On dirait que ce document est une ordonnance obtenue en dehors de l'Union Européenne.\n\n👉 Nous acceptons uniquement les ordonnances venant des pays de l'Union Européenne.\n\nTransférer une nouvelle version du document : https://alan.com/app/dashboard?documentUploader=claim", other_insurer_decompte_100: '🧐 Nous ne pouvons pas effectuer de remboursement complémentaire car les soins ont déjà été intégralement pris en charge par votre complémentaire principale. Merci de nous transmettre uniquement des documents pour lesquels il reste des frais à votre charge.', cares_received_abroad: '😎 Alan couvre les soins des séjours à l’étranger sur la base de remboursement de la Sécurité Sociale française.\n\n👉 Pensez donc à conserver l’ensemble des factures acquittées et des justificatifs de paiement lors des soins effectués hors de France.\nEnsuite, adressez ces factures accompagnées du formulaire S3125 « Soins reçus à l’étranger », à votre caisse d’assurance maladie.\n\nVous trouverez ce document sur le site Ameli : https://www.ameli.fr/sites/default/files/formualires/221/s3125.pdf\n\nNous récupérerons ensuite les informations de la Sécurité Sociale (télétransmission ou envoi du décompte de votre part)', secu_decompte_100: '🧐 Nous ne pouvons pas effectuer de remboursement complémentaire car les soins ont déjà été intégralement pris en charge par la sécurité sociale. Merci de nous transmettre uniquement des documents pour lesquels il reste des frais à votre charge.', ask_paid_invoice: f'🤔 Le document indique une demande de règlement de votre part.
👉 Nous vous invitons à nous transférer la facture acquittée (parfois appelée quittance ou bordereau).
Vous avez également la possibilité de nous transférer un décompte de Sécu (si possible au format .PDF pour un traitement automatique ultra-rapide !).
Transférer une nouvelle version du document : {HEALTH_DOCUMENT_UPLOAD_URL}', missing_mt_or_dmt: '🤔 Le document ne contient pas toutes les informations pour estimer votre remboursement.\n\n👉 Nous vous invitons à renseigner le DMT/MT en cliquant sur le bouton ci-dessous ou à nous renvoyer une version contenant les informations suivantes :\n- Code MT ou "Mode de traitement". Ce mode est un code utilisé par l\'Assurance Maladie pour identifier la nature du soin;\n- Code DMT ou "Discipline Médico-tarifaire". Cette discipline est utilisée dans le contexte hospitalier, et permet de caractériser l\'activité de l\'unité médicale ou du service qui vous a fourni le soin.\n\n☎️ Ces informations vous seront fournies en général par l\'hôpital, nous vous invitons à les contacter directement.', etiopathe: "😔 Nous ne pouvons pas couvrir ces soins.\n\n👉 En effet nous ne remboursons les séances d'étiopathie que lorsqu’elles sont dispensées par un professionnel enregistré à l'Institut Français d’Étiopathie.", kine_invoice_without_mezieres: "🤗 Nous avons bien reçu votre facture de kinésithérapie. Elle n'est pas nécessaire pour vous rembourser ! En effet, nous remboursons les actes de kinésithérapie à réception des informations de la Sécurité Sociale.\n\n👉 Si la télétransmission est active, nous devrions recevoir automatiquement ces informations, et nous pourrons calculer votre remboursement dans la foulée.\nSi la sécurité sociale vous a déjà remboursé et que la télétransmission tarde à arriver ou qu’elle est inactive, transférez-nous votre décompte Améli reprenant ces soins depuis votre application Alan.", hospital_receipt: '🤗 Nous avons bien le reçu de paiement pour vos frais hospitaliers.\n\n👉 Ce seul document ne nous permet pas de traiter votre dossier. Si vos soins ont eu lieu en :\nCLINIQUE PRIVEE :\n- Nous avons besoin du bordereau de facturation détaillé acquitté : celui-ci reprend l\'intégralité de vos frais hospitaliers et est à demander au secrétariat de l\'établissement dans lequel vous avez reçu les soins. Sans ce document, nous ne pourrons malheureusement pas traiter votre dossier.\nHOPITAL PUBLIC :\n- Nous avons besoin de l\'avis des sommes à payer détaillé (recto et verso s\'il y en a un).\n- Cependant, dans le cas où vous voyez déjà des soins hospitaliers en attente de traitement depuis votre compte Alan (frais de séjour, consultation anesthésiste à l\'hôpital, consultation chirurgien à l\'hôpital, etc.), n\'hésitez pas à nous contacter afin que nous puissions manuellement rapprocher les informations entre-elles.\n\nN\'hésitez pas à consulter <a href=\'https://alan.com/app/helpV2/a_Mon-remboursement-na-pas-ete-effectue-pour-mes-frais-dhopital\' target="_blank">cet article de notre centre d\'aide</a> pour y voir plus clair', laboratory_invoice: "🤗 Nous avons bien reçu votre facture d'analyses en laboratoire. Elle n'est pas nécessaire pour vous rembourser ! En effet, nous remboursons les actes de laboratoire à réception des informations de la Sécurité Sociale.\n\n👉 Si la télétransmission est active, nous devrions recevoir automatiquement ces informations, et nous pourrons calculer votre remboursement dans la foulée.\nSi la sécurité sociale vous a déjà remboursé et que la télétransmission tarde à arriver ou qu’elle est inactive, transférez-nous votre décompte Améli reprenant ces soins depuis votre application Alan.", titre_de_recette: "🤔 Le document indique que vous avez payé l'intégralité des soins.\n\n👉 Nous vous invitons à envoyer ce document à votre Caisse de Sécurité sociale afin de vous faire rembourser la part qu'ils vous doivent.\n\nLes informations nécessaires à votre remboursement par Alan seront alors disponibles.", acupuncture: '😔 Nous ne pouvons pas couvrir ces soins.\n\n👉 En effet nous ne remboursons les séances d’acupuncture que lorsqu’elles sont dispensées par un médecin diplômé, une sage-femme ou un dentiste (et seulement dans le cas où votre couverture Alan inclut ce type de soin).\n\nTransférer une nouvelle version du document : https://alan.com/app/dashboard?documentUploader=claim', alternative_medicine_quantity_limit_reached: '🤔 Le document ne contient pas toutes les informations pour estimer votre remboursement.\n\n👉 Nous vous invitons à nous renvoyer une version contenant les informations suivantes :\n\n- Date à laquelle chaque soin a été réalisé\n\nTransférer une nouvelle version du document : https://alan.com/app/dashboard?documentUploader=claim', quittance_100: '🤔 Nous avons bien pris connaissance de votre document, et il semblerait que vous ayez réglé l’intégralité de la somme. Vous devez donc l’envoyer à la Sécurité sociale, elle en a besoin pour vous rembourser.\n\n👉 Une fois que nous aurons reçu les informations de remboursements de la part de la Sécu, nous serons en mesure de vous rembourser à notre tour.', hospi_addressed_alan: "🧐 Nous ne pouvons pas vous rembourser cette facture car celle-ci est adressée à Alan.\n\nCela signifie donc que vous n'avez rien réglé. L'établissement doit envoyer la facture à Almérys (notre partenaire de tiers-payant).\n\nNous vous invitons donc à contacter l'établissement afin de leur faire part de cette information.", estimation_already_sent: f'🤭 On dirait que notre estimation vous à déjà été transmis.
👉 Si c’est une erreur, vous pouvez nous renvoyer le bon document. On s’en occupera rapidement!
Transférer une nouvelle version du document : {HEALTH_DOCUMENT_UPLOAD_URL}
', almerys_PEC_rejected: "🤔 Ce document indique qu'une prise en charge a été effectuée auprès d'Almérys et que celle-ci a été rejetée.\n\n 👉 En effet, conformément au refus délivré par Almerys, votre forfait est épuisé et nous ne pouvons donc intervenir.\n\n Si vous avez des questions au sujet de vos forfait, n'hésitez pas à nous contacter directement depuis votre espace Alan.", almerys_PEC_request: f'🤔 Ce document indique qu'une demande de prise en charge a été effectuée auprès d'Almérys. Ce document ne nous est pas destiné et ne nous permet pas de vous rembourser.
👉 Si vous avez réglé des frais, nous vous invitons à nous adresser la facture acquittée.
Transférer une nouvelle version du document : {HEALTH_DOCUMENT_UPLOAD_URL}', arret_de_travail: '🤭 Ce document ne semble pas être lié à un remboursement de soins.\n\n 👉 Si vous souhaitez demander le versement d\'indemnités complémentaires, vous pouvez ajouter ce document depuis la page principale de votre compte Alan sur ordinateur, en sélectionnant l\'onglet "Prévoyance" au centre de l\'écran.\n Si vous ne voyez pas d’onglet “Prévoyance” sur votre espace, c’est peut-être que votre employeur n’a pas souscrit de contrat de Prévoyance avec nous, ou que le dossier d’arrêt de travail n’est pas encore ouvert : dans les deux cas, nous vous inviter à vérifier tout cela avec lui !\n Si vous êtes en portabilité, nous vous invitons à nous contacter pour ouvrir votre dossier.', feuille_de_soins: '😑 Nous avons bien pris connaissance de votre feuille de soin. Il est important de l’envoyer uniquement à la Sécurité sociale, elle en a besoin pour vous rembourser.\n 👉 Une fois votre soin effectué et le remboursement de la Sécu fait, toutes les informations nécessaires seront disponibles pour qu’Alan vous rembourse. Plus besoin de nous envoyer de feuille de soin.', french_state_payment_attestation: " Nous avons bien reçu votre attestation de paiement. Elle n'est pas nécessaire pour vous rembourser ! Si ce n'est pas déjà fait, envoyez-nous le bordereau de facturation acquitté pour ces soins.\n\n 👉 Si vous avez reçu une demande de notre part pour valider que vous avez avancé les soins, merci de valider cela directement sur la page du soin correspondant dans l'application. Si vous n'avez reçu aucune demande de notre part, on est bons ! 👌", hospi_PEC_request: '🤔 Ce document est une demande de prise en charge pour des frais d’hospitalisation.\n\n 👉 Vous pouvez à tout moment et en toute autonomie effectuer votre demande depuis votre compte.\n Depuis un ordinateur :\n - Rendez-vous sur votre espace perso et cliquez en bas à gauche sur “Séjour à l’hôpital”.\n - Une petite explication sur les conditions d’une prise en charge s’affiche, avec le bouton “Demander une prise en charge”.\n - Cliquez dessus et remplissez le formulaire !\n Depuis l’application mobile Alan :\n - Depuis l’onglet “Demandes” (en bas de l’écran), cliquez sur “Séjour à l’hôpital”.', indemnite_journalieres: '🤭 Ce document ne semble pas être lié à un remboursement de soins.\n\n 👉 S\'il s’agit pour vous de justifier de l\'indemnisation de votre arrêt de travail par la Sécu, dans le but de demander le versement de vos indemnités complémentaires, vous pouvez ajouter ce document depuis la page principale de votre compte Alan sur ordinateur, en sélectionnant l\'onglet "Prévoyance" au centre de l\'écran.\n Si vous ne voyez pas d’onglet “Prévoyance” sur votre espace depuis un ordinateur, c’est peut-être que votre employeur n’a pas souscrit de contrat de Prévoyance avec nous, ou qu\'il n\'a pas encore ouvert le dossier d’arrêt de travail : dans les deux cas, nous vous inviter à vérifier tout cela avec lui !\n\n 👉 S\'il s’agit de justifier du maintien de votre portabilité, vous pouvez ajouter ce document, toujours depuis la page principale de votre compte Alan sur ordinateur, en cliquant sur "Couverture - Ex-salarié".', payment_card_ticket: "🤗 Nous avons bien reçu votre ticket de carte bleue. Il n'est pas nécessaire pour vous rembourser ! Si ce n'est pas déjà fait et que le soin effectué n'est pas couvert par la Sécurité sociale, envoyez-nous la facture détaillée et acquittée.\n\n 👉 Si vous avez reçu une demande de notre part pour valider que vous avez avancé les soins, merci de valider cela directement sur la page du soin correspondant dans l'application. Si vous n'avez reçu aucune demande de notre part, on est bons ! 👌", RIB: ' On dirait que ce document n’a pas de rapport avec un remboursement de santé.\n\n 👉 S’il s’agit de mettre à jour votre RIB, vous pouvez le faire directement depuis votre compte:\n - Cliquez sur votre nom tout en haut à droite de l’écran puis sur Mon compte\n - Cliquez sur Coordonnées bancaires au centre de l’écran\n - Cliquez ensuite sur Modifier pour modifier votre RIB.', PEC_request: " Ce document est une demande de prise en charge qui doit être transmise à notre partenaire de tiers-payant.\n\n 👉 Merci d'indiquer à votre professionnel de santé de s’adresser directement à Almerys.", generic_not_usable: f'🤭 On dirait que ce document n’a pas de rapport avec un remboursement de santé.
👉 Si c’est une erreur, vous pouvez nous renvoyer le bon document. On s’en occupera rapidement !
Transférer une nouvelle version du document : {HEALTH_DOCUMENT_UPLOAD_URL}', attestation_perimee: f'👉 Nous vous invitons à nous renvoyer une attestation en cours de validité (datée de moins de 3 mois).
Transférer une nouvelle version du document : {HEALTH_DOCUMENT_UPLOAD_URL}', ss_attestation_incomplete: f'🤭 Le document ne contient pas toutes les informations pour que nous puissions le traiter. Il nous manque des informations concernant le parent de référence.
👉 Nous vous invitons à nous renvoyer une version mentionnant le parent de référence ainsi que les bénéficiaires qui lui sont rattachés.
Transférer une nouvelle version du document : {HEALTH_DOCUMENT_UPLOAD_URL}'}}
SUB_REJECTION_LABEL
module-attribute
¶
SUB_REJECTION_LABEL = {
beneficiary_name_missing: "Le nom du bénéficiaire n'est pas spécifié",
beneficiary_name_not_in_policy: "Le nom du bénéficiaire n'est pas couvert par le contrat",
beneficiary_name_not_matching: "Le nom du bénéficiaire ne correspond pas à celui enregistré sur le contrat",
health_professional_name_missing: "Le nom du professionnel de santé n'est pas spécifié",
health_professional_name_exact_name_unknown: "Le nom exact du professionnel de santé n'est pas spécifié",
health_professional_adeli_missing: "Le Nº ADELI/RPPS n'est pas spécifié",
health_professional_adeli_not_readable: "Le Nº ADELI/RPPS n'est pas complet/lisible",
health_professional_signature_missing: "La signature n'est pas présente",
health_professional_signature_stamp_missing: "Le tampon n'est pas présent",
care_type_unknown: "Le type de soin n'est pas spécifié",
care_act_price_not_separated: "Le prix de chaque soin n'est pas indiqué séparément",
care_act_missing: "Le code de regroupement pour chacun des actes mentionnés n'est pas spécifié",
care_act_optic_equipment_missing: "Le code de regroupement pour chacun des éléments de l’équipement optique n’est pas spécifié",
care_act_expired_code: "Certains codes de regroupements ou codes actes apparaissant dans le document sont périmés et ne doivent plus être utilisés",
care_act_not_specified: "Le détail des actes envisagés n'est pas spécifié",
care_act_eyes_missing: "Oeil(s) non spécifié(s)",
quote_date_missing: "La date n'est pas spécifiée",
quote_date_invalid: "La date n'est pas valide",
quote_date_expired: "Le devis a expiré",
brss_missing: "La BRSS de chaque soin n'est pas spécifiée",
brss_not_separated: "La BRSS de chaque soin n'est pas indiquée séparément",
exceeding_fees_not_separated: "Les dépassements d'honoraires de chaque soin ne sont pas indiqués séparément",
surco_quote_missing: "Le devis initial avec les bases des actes envisagés est manquant",
}
rejection ¶
CATEGORY_REJECTION_REASONS
module-attribute
¶
CATEGORY_REJECTION_REASONS = {
prescription: [
unreadable,
unusable_partial_document,
duplicate,
beneficiary_not_covered,
insufficent_info_for_parsing,
non_EU_prescription,
],
mutuelle_decompte: [
unreadable,
unusable_partial_document,
duplicate,
beneficiary_not_covered,
insufficent_info_for_parsing,
other_insurer_decompte_100,
],
ss_decompte: [
unreadable,
unusable_partial_document,
duplicate,
beneficiary_not_covered,
cares_received_abroad,
insufficent_info_for_parsing,
secu_decompte_100,
],
invoice: [
unreadable,
unusable_partial_document,
duplicate,
ask_paid_invoice,
beneficiary_not_covered,
cares_received_abroad,
insufficent_info_for_parsing,
missing_mt_or_dmt,
etiopathe,
kine_invoice_without_mezieres,
hospital_receipt,
laboratory_invoice,
titre_de_recette,
acupuncture,
alternative_medicine_quantity_limit_reached,
quittance_100,
hospi_addressed_alan,
],
mutuelle_no_coverage_attestation: [
unreadable,
unusable_partial_document,
duplicate,
beneficiary_not_covered,
insufficent_info_for_parsing,
],
birth_or_adoption_certificate: [
unreadable,
unusable_partial_document,
duplicate,
beneficiary_not_covered,
insufficent_info_for_parsing,
],
quote: [
unreadable,
unusable_partial_document,
duplicate,
beneficiary_not_covered,
cares_received_abroad,
insufficent_info_for_parsing,
missing_mt_or_dmt,
etiopathe,
acupuncture,
estimation_already_sent,
],
unsupported: [
unreadable,
duplicate,
beneficiary_not_covered,
insufficent_info_for_parsing,
almerys_PEC_rejected,
almerys_PEC_request,
arret_de_travail,
feuille_de_soins,
french_state_payment_attestation,
hospi_PEC_request,
indemnite_journalieres,
payment_card_ticket,
RIB,
PEC_request,
generic_not_usable,
],
non_claims_prescription: DEFAULT_REJECTION_REASONS,
medical_certificate: DEFAULT_REJECTION_REASONS,
medical_imaging: DEFAULT_REJECTION_REASONS,
medical_results: DEFAULT_REJECTION_REASONS,
cancel_teletransmission_request: DEFAULT_REJECTION_REASONS,
other_health: [
unreadable,
duplicate,
beneficiary_not_covered,
insufficent_info_for_parsing,
almerys_PEC_rejected,
almerys_PEC_request,
arret_de_travail,
feuille_de_soins,
french_state_payment_attestation,
hospi_PEC_request,
indemnite_journalieres,
payment_card_ticket,
RIB,
PEC_request,
generic_not_usable,
],
ss_attestation: [
unreadable,
unusable_partial_document,
duplicate,
beneficiary_not_covered,
insufficent_info_for_parsing,
attestation_perimee,
ss_attestation_incomplete,
],
}
DEFAULT_REJECTION_REASONS
module-attribute
¶
DEFAULT_REJECTION_REASONS = [
unreadable,
unusable_partial_document,
duplicate,
beneficiary_not_covered,
insufficent_info_for_parsing,
non_EU_prescription,
]
get_rejection_reasons_per_category ¶
Get the list of rejection reason for a document category with the default message we want to send to the user return: list[RejectionReason]
Source code in components/fr/public/document_parsing/queries/rejection.py
get_sub_rejection_reasons_per_category ¶
Get the list of sub rejection reason for a document category For now we only return for quote return: dict[str, list[RejectionReason]] | None
Source code in components/fr/public/document_parsing/queries/rejection.py
components.fr.public.dsn ¶
company ¶
Set of functions to query information about companies present in the DSN.
The DSN data model is composed of DSN "companies" and "establishments". A "company" in the context of the module does NOT refer specifically to a DSN "company" but to any entity (usually an "establishment").
get_company_from_siret ¶
Fetch the company based on its SIRET.
Source code in components/fr/public/dsn/company.py
contract_download ¶
get_contracts_download_zip_for_companies ¶
This function is used to download the contracts (both PDF and XML, in ZIP) for a given companies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
company_ids
|
list[int] | set[int]
|
List of company IDs to download contracts for |
required |
Returns:
| Type | Description |
|---|---|
tuple[dict[str, str] | None, bool]
|
tuple[dict[str, str] | None, bool]: Zip attachment and boolean indicating if any FDP was found |
Source code in components/fr/public/dsn/contract_download.py
components.fr.public.employees ¶
employees ¶
get_employees_for_admin_dashboard ¶
get_employees_for_admin_dashboard(
company_ids,
scope_ids,
cursor,
limit,
search,
employee_types,
professional_categories,
ccn_ids,
status_details,
)
Get employees for the admin dashboard. It won't make any admin rights checks, please make sure the user has the rights to see the given companies & scopes. :param company_ids: The companies to fetch the employees from, it will fetch all employees from the companies, except if scopes for those companies are also given :param scope_ids: The scopes to fetch the employees from, if some scopes belong to given companies ids, only employees from those scopes will be fetched :param cursor: The cursor to handle pagination :param limit: The limit of employees to fetch :param search: The search string to filter employees :param employee_types: The employee types to filter :param professional_categories: The professional categories to filter :param ccn_ids: The CCN ids to filter :return: The paginated employees, filtered by given filters
Source code in components/fr/public/employees/employees.py
terminated_employees ¶
get_terminated_employee_details ¶
get_terminated_employees ¶
get_terminated_employees(
company_ids,
operational_scope_ids,
cursor,
limit,
search,
terminated_employee_types,
)
Source code in components/fr/public/employees/terminated_employees.py
get_terminated_employees_counts ¶
Source code in components/fr/public/employees/terminated_employees.py
components.fr.public.employment ¶
fr_country_gateway ¶
FrCountryGateway ¶
Bases: CountryGateway[FrExtendedValues]
Implementation of the Employment Component's CountryGateway for France.
are_companies_in_same_account ¶
Source code in components/fr/public/employment/fr_country_gateway.py
get_account_name ¶
get_blocked_invitations_validation_broadcast_id ¶
get_company_information ¶
Source code in components/fr/public/employment/fr_country_gateway.py
get_consumers_to_notify_for_legacy_backfill ¶
Returns the consumers to notify for the legacy backfill source type.
Source code in components/fr/public/employment/fr_country_gateway.py
get_employee_identifier_for_country ¶
get_employment_consumers ¶
Gets all employment consumers contributed by this country.
Notes: 1. ALL Employment Consumers will be called regardless of the country of origin. 2. The function that will be called must have all local code as LOCAL imports - otherwise, this breaks Canada (where loading non-CA models is forbidden)
Source code in components/fr/public/employment/fr_country_gateway.py
get_retry_function ¶
(Advanced) Get the function used for retrying Core Blocked Movements.
You should generally not need to implement this.
Source code in components/fr/public/employment/fr_country_gateway.py
get_source_detail_for_blocked_movement ¶
Source code in components/fr/public/employment/fr_country_gateway.py
get_upstream_retry_handler ¶
get_user_admined_company_ids ¶
Source code in components/fr/public/employment/fr_country_gateway.py
get_user_full_name ¶
last_stale_invite_notification_email_sent_to_admin_on ¶
Source code in components/fr/public/employment/fr_country_gateway.py
fr_extended_values ¶
EmployeeTerminationType ¶
Bases: AlanBaseEnum
ani_member_declared_new_job
class-attribute
instance-attribute
¶
departure_end_apprentice
class-attribute
instance-attribute
¶
departure_negociated_termination
class-attribute
instance-attribute
¶
departure_resignation
class-attribute
instance-attribute
¶
departure_resignation_with_ani
class-attribute
instance-attribute
¶
departure_termination
class-attribute
instance-attribute
¶
departure_termination_fault
class-attribute
instance-attribute
¶
invited_in_retirement
class-attribute
instance-attribute
¶
retirement_with_ani
class-attribute
instance-attribute
¶
ExemptionType ¶
Bases: AlanBaseEnum
already_covered_indiv
class-attribute
instance-attribute
¶
already_covered_military
class-attribute
instance-attribute
¶
already_covered_other_employer
class-attribute
instance-attribute
¶
already_covered_partner
class-attribute
instance-attribute
¶
already_covered_regime_local
class-attribute
instance-attribute
¶
already_covered_state_agent
class-attribute
instance-attribute
¶
cdd_already_covered
class-attribute
instance-attribute
¶
cdd_less_than_a_year
class-attribute
instance-attribute
¶
cdd_less_than_three_months
class-attribute
instance-attribute
¶
continue_to_refuse_coverage
class-attribute
instance-attribute
¶
health_payment_beneficiary
class-attribute
instance-attribute
¶
FrEmploymentDeclaration
module-attribute
¶
FrExtendedValues ¶
ProfessionalCategory ¶
Bases: AlanBaseEnum
This enum is used to model both the professional category of persons and abstract objects, such as contracts: - persons can be "cadres", "non_cadres", or NULL which models we don't know their professional category; - abstract entities can be "cadres", "non_cadres", or NULL which models we don't have to apply any constraint on the object regarding the professional category. Either way, we want to get rid of the "all" value. It was more targeted at the second use case but it's more coherent to model objects the same way for both kind of objects.
components.fr.public.entities ¶
components.fr.public.enums ¶
components.fr.public.events ¶
subscription ¶
subscribe_to_events ¶
All event subscriptions for France should be done here.
Source code in components/fr/public/events/subscription.py
components.fr.public.feature ¶
app_user_has_access_to_feature_flag ¶
app_user_has_access_to_feature_flag(
app_user_id,
*,
feature_name,
eligible_user_ids_metadata_key="eligible_user_ids",
eligible_company_ids_metadata_key="eligible_company_ids"
)
Generic helper to check whether an app user has access to a feature flag in FR.
The access rules are: - If the feature is enabled for the user directly -> True - Else, if the user ID is present in the feature metadata under eligible_user_ids_metadata_key -> True - Else, if the user's default company is present in the feature metadata under eligible_company_ids_metadata_key -> True - Otherwise -> False
All user IDs here are FR-side integers, but we receive app_user_id as a str.
Source code in components/fr/public/feature.py
is_feature_active ¶
Check if a feature is active :param feature_name: the name of the feature :return: true if the feature with this name is found and active
Source code in components/fr/public/feature.py
components.fr.public.fraud_detection ¶
enums ¶
queries ¶
find_most_recent_fraud_relevant_user_changes ¶
find_most_recent_fraud_relevant_user_changes(
user_ids,
change_type=None,
limit=None,
since=None,
until=None,
)
Source code in components/fr/internal/fraud_detection/business_logic/queries/fraud_relevant_user_change.py
components.fr.public.global_customer_dashboard ¶
admin ¶
get_admined_entities_for_entity_selector_fr ¶
Source code in components/fr/public/global_customer_dashboard/admin.py
get_pending_onboardings_for_admined_entity_selector_fr ¶
Source code in components/fr/public/global_customer_dashboard/admin.py
product_setting ¶
get_account_settings_for_account ¶
Returns the list of activated AccountSetting for the given account :param account_id: The ID of the account we want AccountSetting for :return: The list of activated AccountSetting for this account
Source code in components/fr/public/global_customer_dashboard/product_setting.py
get_account_settings_for_company ¶
Returns the list of activated AccountSetting for the given company :param company_id: The ID of the company we want AccountSetting for :return: The list of activated AccountSetting for this company
Source code in components/fr/public/global_customer_dashboard/product_setting.py
components.fr.public.health_pricing ¶
components.fr.public.operational_scopes ¶
employment_consumer ¶
operational_scopes_employment_change_consumer ¶
Source code in components/fr/public/operational_scopes/employment_consumer.py
components.fr.public.policy ¶
policy ¶
get_n_base_filtered_children_on ¶
Source code in components/fr/public/policy/policy.py
get_n_base_paid_filtered_children_on ¶
Source code in components/fr/public/policy/policy.py
is_policy_change_significant ¶
is_policy_change_significant(
old_policy_id,
new_policy_id,
new_start_date,
old_policy_precomputed_coverage=None,
)
Returns True if the change between two policies is significant, and member notification and action is required.
Returns False if the change can be considered "transparent" and does not require member action.
This function should be used primarily for employee transfer cases.
Source code in components/fr/public/policy/policy.py
is_policy_coverage_different ¶
is_policy_coverage_different(
old_policy_id,
new_policy_id,
last_day_date,
new_start_date,
old_policy_precomputed_coverage=None,
)
Returns True if the coverage differs between the two policies (either in pricing or in actual coverage).
Source code in components/fr/public/policy/policy.py
precompute_policy_coverage_for_policy_comparison ¶
For use with is_policy_change_significant in case you need to cancel the policy afterwards (otherwise, after cancellation, the cost becomes 0)
Source code in components/fr/public/policy/policy.py
components.fr.public.prevoyance ¶
entities ¶
PrevoyanceGuaranteeSpecBeneficiaryEligibilityCriteria
dataclass
¶
PrevoyanceGuaranteeSpecBeneficiaryEligibilityCriteria(
beneficiary_relationship_type,
max_age_at_disability_start_date=None,
min_covered_age=None,
max_covered_age=None,
disabled_max_covered_age=None,
student_max_covered_age=None,
unemployed_without_benefits_max_covered_age=None,
apprentice_max_covered_age=None,
is_dependent=None,
is_under_supervision_or_in_psychiatric_hospital=None,
paid_for_the_funeral=None,
)
Bases: DataClassJsonMixin
This dataclass describes the beneficiary criteria to be eligible to a prevoyance guarantee spec.
Only specific beneficiary could benefit from the coverage of certain guarantees (eg rente education only for children at charge, member in case of work stoppage)
PrevoyanceGuaranteeSpecEligibilityCriteria
dataclass
¶
Bases: DataClassJsonMixin
These criteria determine in which circumstances guarantees are eligible and could be covered.
When in such circumstances, we would only create / suggest claims with the eligible guarantees (eg for a death: death lump sum, rente education, funerals, etc).
Criteria are of different nature: - Event: guarantees only apply to specific events, in specific situation (eg. accidental death) - Member: guarantees eligibility could depend on the member tenure, on the member dependents, on their disability condition etc - Beneficiary: some guarantees only apply to specific beneficiaries (eg rente education only for children at charge)
Exploration can be found here https://docs.google.com/spreadsheets/d/1yyLaVasQnwSVhASZ3c41d7hFkp56RxiRmSwlMBHj2Mg/edit?usp=sharing ⧉ https://docs.google.com/document/d/1qIsYQgD6Iy9dLN61iKAbAD0S-LLHRCcmvE_owSyvFbk/edit?usp=sharing ⧉
PrevoyanceGuaranteeSpecEventEligibilityCriteria
dataclass
¶
PrevoyanceGuaranteeSpecEventEligibilityCriteria(
event_type,
event_user_relationship_type,
death_event_user_min_age=None,
event_is_not_covered_by_secu=None,
event_is_covered_in_parental_leave=None,
event_is_accidental=None,
event_is_accidental_or_after_professional_disease=None,
event_required_assistance_from_third_party=None,
event_is_long_term_condition=None,
work_stoppage_valid_reasons=None,
work_stoppage_min_duration_days=None,
death_is_before_member_death=None,
death_is_simultaneous_partner_death=None,
simultaneous_partner_death_max_delay_months=None,
disability_is_atmp=None,
disability_rate_min=None,
disability_rate_max=None,
disability_categories=None,
)
Bases: DataClassJsonMixin
This dataclass describes the prevoyance event criteria to be eligible to a prevoyance guarantee spec
Guarantee would only cover specific events based on these criteria (eg. type of event, if death is accidental or on the disability rate)
death_is_before_member_death
class-attribute
instance-attribute
¶
death_is_simultaneous_partner_death
class-attribute
instance-attribute
¶
event_is_accidental_or_after_professional_disease
class-attribute
instance-attribute
¶
event_is_covered_in_parental_leave
class-attribute
instance-attribute
¶
event_is_long_term_condition
class-attribute
instance-attribute
¶
event_is_not_covered_by_secu
class-attribute
instance-attribute
¶
event_required_assistance_from_third_party
class-attribute
instance-attribute
¶
simultaneous_partner_death_max_delay_months
class-attribute
instance-attribute
¶
work_stoppage_min_duration_days
class-attribute
instance-attribute
¶
PrevoyanceGuaranteeSpecMemberEligibilityCriteria
dataclass
¶
PrevoyanceGuaranteeSpecMemberEligibilityCriteria(
min_tenure_months=None,
max_tenure_months=None,
max_tenure_or_less_than_200_hours_per_trimester=None,
min_hours_worked_in_trimester=None,
max_hours_worked_in_trimester=None,
min_covered_presence_days=None,
has_dependent_children=None,
has_dependent=None,
is_married_or_pacsed=None,
)
Bases: DataClassJsonMixin
This dataclass describes the member criteria to be eligible to a prevoyance guarantee spec
It could be based on the member tenure in the company at the event date or on their dependents at charge
queries ¶
PrevoyanceCCNContstraintEntity
dataclass
¶
Bases: DataClassJsonMixin
Represents a constraint for a prevoyance contract CCN.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
The unique identifier of the constraint. |
ccn_id |
int
|
The ID of the CCN. |
non_cadre_coverage_required |
bool
|
Indicates if non-cadre coverage for all contracts on the ccn. |
PrevoyanceParticipationCCNContstraintEntity
dataclass
¶
PrevoyanceParticipationCCNContstraintEntity(
id, ccn_id, professional_category, minimum_participation
)
Bases: DataClassJsonMixin
Represents a participation constraint for a prevoyance contract CCN.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
The unique identifier of the constraint. |
ccn_id |
int
|
The ID of the CCN. |
professional_category |
Optional[ProfessionalCategory]
|
The professional category. |
minimum_participation |
float
|
The minimum participation required for the professional category on the ccn. |
get_prevoyance_ccn_constraints ¶
Return the list of PrevoyanceCCNCoinstraints for a list of ccn_ids.
Source code in components/fr/public/prevoyance/queries.py
get_prevoyance_participation_ccn_constraints ¶
Return the list of CCN constraints that apply to the company's prevoyance contract.
Source code in components/fr/public/prevoyance/queries.py
get_work_stoppages_for_users ¶
Get the list of work stoppages for a list of users.
Source code in components/fr/public/prevoyance/queries.py
components.fr.public.queries ¶
command_logs ¶
get_command_logs ¶
Source code in components/fr/public/queries/command_logs.py
policy ¶
get_current_or_future_subscription_info_for_user_on ¶
Source code in components/fr/internal/policy/queries.py
get_subscription_id_for_user_on ¶
Returns user subscription id linked to the user on a given on_date
user_id: The user ID to get affiliation periods for on_date: The date to check the affiliation periods against
Returns:
| Type | Description |
|---|---|
int | None
|
policy contract ID |
Source code in components/fr/internal/policy/queries.py
get_subscription_ids_for_users_on ¶
Returns user subscription ids linked to users on a given on_date
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_ids
|
list[int]
|
List of user IDs to get subscription IDs for |
required |
on_date
|
date
|
The date to check the affiliation periods against |
required |
Returns:
| Type | Description |
|---|---|
dict[int, int]
|
dict[int, int]: Mapping of user_id to subscription_id (contract_id). Only includes users with active subscriptions. |
Source code in components/fr/internal/policy/queries.py
has_active_option_on ¶
Returns whether the user has an active or future option on a given on_date
user_id: The user ID to get affiliation periods for on_date: The date to check the affiliation periods against
Returns:
| Type | Description |
|---|---|
bool
|
boolean |
Source code in components/fr/internal/policy/queries.py
has_active_or_future_children_beneficiary_on ¶
Returns whether the user has an active or future child beneficiary on a given date
user_id: The user ID to get affiliation periods for on_date: The date to check the affiliation periods against
Returns:
| Type | Description |
|---|---|
bool
|
boolean |
Source code in components/fr/internal/policy/queries.py
components.fr.public.scim_api ¶
adapter ¶
FrScimAdapter ¶
Bases: GenericScimAdapter
SCIM adapter for fr_api.
Source code in components/fr/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/fr/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/fr/public/scim_api/adapter.py
get_user_data ¶
Returns user's first and last name by user_id.
Source code in components/fr/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/fr/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/fr/public/scim_api/test/test_adapter.py
test_get_user_data ¶
Test get_user_data returns correct user identity.
Source code in components/fr/public/scim_api/test/test_adapter.py
components.fr.public.services ¶
push_notifications ¶
get_push_notification_logs_for_user ¶
get_push_notification_logs_for_user(
app_name,
app_user_id,
notification_names,
created_at__gte=None,
)
Return a list of all the push notification logs ever created for the given user and notification names.
Source code in components/fr/public/services/push_notifications.py
push_notification_sender_async ¶
Source code in components/fr/internal/push_notifications/push_notification_sender.py
push_notification_sender_sync ¶
Source code in components/fr/internal/push_notifications/push_notification_sender.py
components.fr.public.test_data_generator ¶
get_test_data_generation_config ¶
Source code in components/fr/internal/admin_tools/fixtures/test_data_generation_config.py
components.fr.public.user ¶
create_profile_with_user ¶
create_or_assign_profile_with_authenticatable_user ¶
create_or_assign_profile_with_authenticatable_user(
profile_service,
authentication_service,
email,
prehashed_password,
mfa_required=None,
first_name=None,
last_name=None,
birth_date=None,
language=None,
phone_number=None,
gender=None,
empty_user=None,
)
Helper to create an authenticatable user (with credentials) and helps manage cross-country identities In this method we create a profile without identity elements, then get (or create) the corresponding user and try to set the credentials of this user. Set credentials handles the cases of conflict with existing identities. Finally, we set the profile email address if all steps before didn't raise
Source code in components/fr/public/user/create_profile_with_user.py
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 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 181 182 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 | |
create_profile_with_user ¶
create_profile_with_user(
*,
profile_service,
email=None,
first_name=None,
last_name=None,
birth_date=None,
language=None,
phone_number=None,
gender=None
)
Create a new user (and profile) with the given parameters.
Source code in components/fr/public/user/create_profile_with_user.py
insurance_profile ¶
set_ssn_ntt_on_user ¶
Set the SSN or NTT for an existing user.
Do NOT commit the session.
Source code in components/fr/public/user/insurance_profile.py
user ¶
get_user ¶
Get user data
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_id
|
int
|
user id |
required |
Returns:
| Type | Description |
|---|---|
User
|
French user data |
get_user_for_clinic ¶
Get user data for clinic with linked data
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_id
|
int
|
user id |
required |
Returns:
| Type | Description |
|---|---|
User
|
French user data |
Source code in components/fr/public/user/user.py
get_user_from_email ¶
Source code in components/fr/public/user/user.py
get_user_pro_email_with_perso_fallback ¶
Get the pro email of the user, falling back to personal email if pro email is not set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_id
|
int
|
The user ID |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
The pro email if available, otherwise the personal email. |
Source code in components/fr/public/user/user.py
components.fr.public.validators ¶
ape_validator ¶
ApeValidationError ¶
Bases: Exception
ApeValidator ¶
- Allows to check if a APE code (or NAF) is valid