Api reference
components.clinic.public.business_logic ¶
insi_identity ¶
is_identity_verified_for_user ¶
Check if the user's identity is verified.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_user
|
FeatureUser
|
The application user whose identity is to be checked. |
required |
Returns: bool: True if the user's identity is verified, False otherwise.
Source code in components/clinic/public/business_logic/insi_identity.py
medical_conversation ¶
get_first_medical_conversation_for_member ¶
Retrieves the first medical conversation for a given member.
This function acts as a proxy to the internal business logic function
get_first_medical_conversation_for_member to fetch the first medical
conversation associated with the provided app_user.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_user
|
FeatureUser
|
The user for whom the first medical conversation is to be retrieved. |
required |
Returns:
| Type | Description |
|---|---|
Optional[MedicalConversation]
|
Optional[MedicalConversation]: The first medical conversation for the given member, or None if no conversation is found. |
Source code in components/clinic/public/business_logic/medical_conversation.py
mark_conversation_as_deleted ¶
Source code in components/clinic/public/business_logic/medical_conversation.py
therapist_booking_session ¶
get_past_sessions_that_need_invoice_generation_count_for_user ¶
Counts the number of past reimbursed therapist booking sessions waiting for invoicing for a specific user and session type. sessions that are waiting for invoicing are those that are not refunded, are confirmed, and have a valid credit. They ended between now and 2 days ago. (default_delay_in_hours is 48)
Arguments: feature_user (FeatureUser): The user for whom upcoming sessions need to be counted. session_type (TherapistBookingSessionType): The type of therapist session to filter by.
Returns: int: The count of done reimbursed therapist booking sessions matching the provided user and session type.
Source code in components/clinic/public/business_logic/therapist_booking_session.py
get_upcoming_reimbursed_therapist_booking_session_count_for_user ¶
Counts the number of upcoming reimbursed therapist booking sessions for a specific user and session type. Only counts sessions that are not refunded, are confirmed, have a valid credit, and are scheduled for a future date.
Arguments: feature_user (FeatureUser): The user for whom upcoming sessions need to be counted. session_type (TherapistBookingSessionType): The type of therapist session to filter by.
Returns: int: The count of upcoming reimbursed therapist booking sessions matching the provided user and session type.
Source code in components/clinic/public/business_logic/therapist_booking_session.py
user ¶
app_user_has_upcoming_availability_for_alan_consultations ¶
app_user_has_upcoming_availability_for_alan_consultations(
member_app_user,
locale=None,
availability_threshold_in_hours=24,
medical_admins_ids=None,
)
Returns true if the given member is able to book an Alan consultation within the following upcoming parameters: - next availability is within the next availability threshold in hours (24 hours by default)
Source code in components/clinic/public/business_logic/user.py
get_clinic_user_for_french_user ¶
Source code in components/clinic/public/business_logic/user.py
get_medical_admin_for_user ¶
Source code in components/clinic/public/business_logic/user.py
has_app_user_access_to_orientation ¶
Source code in components/clinic/public/business_logic/user.py
update_clinic_consent_for_user ¶
Update the clinic user consent
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
actor_user
|
FeatureUser
|
The actor feature user |
required |
has_given_consent
|
bool
|
The user has given his consent |
required |
delete_existing_data
|
Optional[bool]
|
Has to delete existing data status |
True
|
Source code in components/clinic/public/business_logic/user.py
validate_child_dependent ¶
validate_child_dependent_and_get_feature_user ¶
Validate that a child is a dependent of the current user and return a FeatureUser for the child.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent_user
|
FeatureUser
|
The current user (parent) |
required |
child_app_user_id
|
str
|
The ID of the child to validate |
required |
Source code in components/clinic/public/business_logic/validate_child_dependent.py
components.clinic.public.commands ¶
app_group ¶
register_clinic_commands ¶
Source code in components/clinic/public/commands/app_group.py
booking ¶
notifications ¶
notify_all_scheduled_messages ¶
Source code in components/clinic/public/commands/booking/notifications.py
sessions ¶
cancel_all_future_sessions_for_medical_admin_as_medical_admin ¶
Cancels all future sessions for a given medical admin as if the same medical admin is cancelling them themselves. This is useful when a medical admin is departing Alan, and we want all the members with booked sessions to receive the appropriate notifications for the cancellation.
Source code in components/clinic/public/commands/booking/sessions.py
create_conversation_with_messages_for_future_sessions ¶
Create missing conversation messages for booked sessions that haven't occurred yet.
Source code in components/clinic/public/commands/booking/sessions.py
delete_test_sessions ¶
Source code in components/clinic/public/commands/booking/sessions.py
expire_booking_invites ¶
Source code in components/clinic/public/commands/booking/sessions.py
generate_past_sessions_invoice ¶
Source code in components/clinic/public/commands/booking/sessions.py
generate_sessions_invoices ¶
Source code in components/clinic/public/commands/booking/sessions.py
link_sessions_to_conversations ¶
Link sessions to existing conversations of their type when it has not been done yet. This will ease to retrieve the conversation for a given session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dry_run
|
bool
|
Whether to perform a dry run or not. |
required |
limit
|
int
|
The maximum number of sessions to link to conversations. |
required |
Source code in components/clinic/public/commands/booking/sessions.py
refund_payment_not_linked_to_session ¶
Source code in components/clinic/public/commands/booking/sessions.py
therapists ¶
update_cached_next_availability ¶
Source code in components/clinic/public/commands/booking/therapists.py
clinic_invoices ¶
generate_fake_clinic_invoices ¶
Source code in components/clinic/public/commands/clinic_invoices.py
sync_clinic_monthly_invoice_lines_from_turing ¶
Source code in components/clinic/public/commands/clinic_invoices.py
end_to_end_test ¶
medical_admins ¶
create_medical_admins ¶
Source code in components/clinic/public/commands/medical_admins.py
create_medical_chat_bot ¶
Source code in components/clinic/public/commands/medical_admins.py
set_offline_inactive_medical_admin ¶
Source code in components/clinic/public/commands/medical_admins.py
medical_admins_dataset ¶
MedicalAdminData
dataclass
¶
MedicalAdminData(
first_name,
last_name,
onboarding_status,
accessible_conversation_specialties,
apps_displayed_in,
has_access_to_app_ids,
access_types,
specialty,
country,
languages,
description=None,
experiences=None,
answers_to_proactive_conversation_topics=None,
prod_id=None,
dato_id=None,
first_message_body=None,
avatar=None,
clinic_role=None,
)
answers_to_proactive_conversation_topics
class-attribute
instance-attribute
¶
MedicalAdminExperienceData
dataclass
¶
RAW_MEDICAL_ADMINS
module-attribute
¶
RAW_MEDICAL_ADMINS = [
MedicalAdminData(
first_name="Augustin",
last_name="Beaucote",
specialty=GENERAL_PRACTITIONER,
avatar="http://eu.alan.uploads.s3.eu-central-1.amazonaws.com/manual_upload/9d775ac221a84812a3cc18bae63b7766_doctor_beaucote_headshot.jpg",
description="Je suis médecin généraliste et immunologue et j’ai rejoint Alan début 2020 pour développer les services de santé.\nJ’ai fait mes études en région parisienne à la faculté du Kremlin Bicêtre avant de rejoindre la région de Montpellier en 2015, où j’ai été interne pendant 3 ans.\nJ’ai choisi de me spécialiser en immunologie et j’ai fait des remplacements en cabinet de médecine générale et aux urgences adultes et pédiatriques.",
experiences=[
MedicalAdminExperienceData(
title="Immunothérapies ciblées des maladies",
subtitle="Faculté de médecine de Montpellier",
index=3,
),
MedicalAdminExperienceData(
title="Master 2, Génome et différenciation cellulaire - Hématopoïèse",
subtitle="Université Paris Diderot et IGMM",
index=2,
),
MedicalAdminExperienceData(
title="DESC 2 d'immunologie clinique",
subtitle="Université de Montpellier",
index=1,
),
MedicalAdminExperienceData(
title="Doctorat en Médecine Générale",
subtitle="Faculté de médecine de Montpellier",
index=0,
),
],
apps_displayed_in=[alan_insurance],
accessible_conversation_specialties=[
GENERAL_MEDICINE,
PEDIATRICS,
CHILDCARE,
DIETETICS,
DERMATOLOGY,
PHYSIOTHERAPY,
GYNECOLOGY,
],
clinic_role=CLINIC_ADMIN,
has_access_to_app_ids=[ALAN_FR],
access_types=[CHAT],
answers_to_proactive_conversation_topics=[
SLEEP,
STRESS,
],
country=france,
languages=[french, english],
onboarding_status=COMPLETED,
),
MedicalAdminData(
first_name="Clara",
last_name="Poncelet",
specialty=MIDWIFE,
first_message_body="Je suis Clara, je suis sage-femme, j’exerce en Suisse dans une structure hospitalière et en France comme sage-femme libérale. Je suis aussi maman d’une petite fille depuis fin 2020 !",
avatar="http://eu.alan.uploads.s3.eu-central-1.amazonaws.com/manual_upload/3fec273f3a484072b50029a7ee7a0440_clara_poncelet.jpg",
description="Je suis sage-femme depuis 2015 et heureuse nouvelle arrivée chez Alan.\nCes cinq dernières années sont marquées par mes voyages régionaux car j’ai choisi d’exercer dans différents grands centres hospitaliers afin d’enrichir ma formation.\nDepuis 2019 je fais des remplacements en libéral pour un accompagnement semi-global et j’exerce en Suisse dans une structure hospitalière. Je me forme dans les domaines ouverts aux sages-femmes dès que j’en ai l’occasion pour adapter mes pratiques.\nJe suis maman d’une petite fille depuis fin 2020.",
experiences=[
MedicalAdminExperienceData(
title="Diplôme de sage-femme en 2015",
subtitle="Université de Bourgogne à Dijon",
index=0,
)
],
accessible_conversation_specialties=[GYNECOLOGY],
apps_displayed_in=[alan_insurance],
has_access_to_app_ids=[ALAN_FR],
access_types=[CHAT],
country=france,
languages=[french, english],
onboarding_status=COMPLETED,
),
MedicalAdminData(
first_name="Barbara",
last_name="Dezileaux",
specialty=GENERAL_PRACTITIONER,
avatar="http://eu.alan.uploads.s3.eu-central-1.amazonaws.com/manual_upload/8b28ef4ffbea476c93565ad2d3cd4eb7_doctor_dezileaux_headshot.jpg",
description="Médecin généraliste, j’ai choisi de rejoindre les équipes d’Alan car j’apprécie leur démarche d’aide et de conseil envers leurs utilisateurs.\nJe suis diplômée depuis 2015, après avoir réalisé mes études à Bordeaux puis mon internat à Lille.\nJ’exerce depuis en cabinet libéral et en clinique dans différentes régions de France.\nJ’ai à cœur de me former en continu, en particulier sur les sujets de la maternité et de la périnatalité qui me passionnent.",
experiences=[
MedicalAdminExperienceData(
title="Doctorat en Médecine Générale",
subtitle="Faculté de médecine de Lille",
index=0,
)
],
accessible_conversation_specialties=[
GENERAL_MEDICINE,
PEDIATRICS,
CHILDCARE,
DIETETICS,
DERMATOLOGY,
PHYSIOTHERAPY,
GYNECOLOGY,
],
apps_displayed_in=[alan_insurance],
access_types=[CHAT],
has_access_to_app_ids=[ALAN_FR],
country=france,
languages=[french, english],
onboarding_status=COMPLETED,
),
MedicalAdminData(
first_name="Marion",
last_name="Cosson",
specialty=GENERAL_PRACTITIONER,
clinic_role=CLINIC_ADMIN,
apps_displayed_in=[],
has_access_to_app_ids=[ALAN_FR],
accessible_conversation_specialties=[
GENERAL_MEDICINE,
PEDIATRICS,
CHILDCARE,
DIETETICS,
DERMATOLOGY,
PHYSIOTHERAPY,
GYNECOLOGY,
],
access_types=[CHAT],
country=france,
languages=[french, english, spanish],
onboarding_status=COMPLETED,
),
MedicalAdminData(
first_name="Pauline",
last_name="Lotte",
specialty=CHILDCARE_NURSE,
avatar="http://eu.alan.uploads.s3.eu-central-1.amazonaws.com/manual_upload/9a0297eaf92f4f88a763c9fe3c954983_pauline-lotte.jpg",
description="Je suis infirmière puéricultrice depuis 2007 et installée en libéral depuis 2018. J'interviens chez Alan en tant que spécialiste du sommeil.\nAprès 10 ans de pratique en hôpital pédiatrique et 1 an en direction de crèche, j'ai choisi de travailler en indépendante pour accompagner les parents au plus près de leur quotidien avec bébé.\nJe me suis spécialisée dans plusieurs domaines, et plus spécialement le sommeil du tout-petit.\nJe suis maman d'une petite fille depuis 2019.",
experiences=[
MedicalAdminExperienceData(
title="2006 - Diplôme d'Etat d'Infirmière",
subtitle="IFSI de Reims",
index=10,
),
MedicalAdminExperienceData(
title="2007 - Diplôme d'Etat de Puéricultrice",
subtitle="Ecole de puéricultrice de Reims",
index=9,
),
MedicalAdminExperienceData(
title="2013 - Diplôme Universitaire de prise en charge de la douleur de l'enfant",
subtitle=None,
index=8,
),
MedicalAdminExperienceData(
title="2019 - Instructrice Dunstan Baby Langage",
subtitle="Dunstan Baby Langage France",
index=7,
),
MedicalAdminExperienceData(
title="2019 - Educateur Montessori",
subtitle="Enfance Positive",
index=6,
),
MedicalAdminExperienceData(
title="2020 - Animateur de Signes Associés à la Parole",
subtitle="Eveil et Signes",
index=5,
),
MedicalAdminExperienceData(
title="2020 - Formation Nutrition pédiatrique",
subtitle="EPM nutrition",
index=4,
),
MedicalAdminExperienceData(
title="2020 - Formation au sommeil du bébé de 0 à 5 ans",
subtitle="M. Bilodeau",
index=3,
),
MedicalAdminExperienceData(
title="2020 - Comprendre et accompagner le sommeil de l'enfant",
subtitle="Mandy Roman",
index=2,
),
MedicalAdminExperienceData(
title="2021 - Formation consultation du sommeil, alimentation et rythmes de 0 à 6 ans en avril 2021",
subtitle="Prosom",
index=1,
),
MedicalAdminExperienceData(
title="2021 - Formation sommeil du tout petit et accompagnement parental",
subtitle="Ingrid Bayot",
index=0,
),
],
apps_displayed_in=[alan_insurance],
accessible_conversation_specialties=[CHILDCARE],
has_access_to_app_ids=[ALAN_FR],
access_types=[CHAT],
country=france,
languages=[dutch, english],
onboarding_status=COMPLETED,
),
MedicalAdminData(
first_name="Margaux",
last_name="Degen",
specialty=PSYCHOLOGIST,
accessible_conversation_specialties=[
PSYCHOLOGY,
THERAPY,
],
apps_displayed_in=[alan_insurance],
has_access_to_app_ids=[ALAN_FR],
access_types=[VIDEO],
country=france,
languages=[french, english],
onboarding_status=COMPLETED,
dato_id="148187763",
),
MedicalAdminData(
first_name="Emile",
last_name="Montrois",
specialty=PSYCHOLOGIST,
accessible_conversation_specialties=[
PSYCHOLOGY,
THERAPY,
],
access_types=[VIDEO],
apps_displayed_in=[alan_insurance],
has_access_to_app_ids=[ALAN_FR],
country=france,
languages=[french, english],
onboarding_status=COMPLETED,
dato_id="148184344",
),
MedicalAdminData(
first_name="Florian",
last_name="Ghiazza",
specialty=PHYSIOTHERAPIST,
accessible_conversation_specialties=[
PHYSIOTHERAPY,
BACK_PAIN,
EMERGENCY_PHYSIOTHERAPY,
],
access_types=[CHAT, VIDEO],
apps_displayed_in=[alan_insurance],
has_access_to_app_ids=[ALAN_FR],
country=france,
languages=[french, english],
onboarding_status=COMPLETED,
dato_id="OTiPilFASx-0yBrP2HtLrQ",
prod_id="b65af61b-c455-4c5f-a678-164d165d1f45",
),
MedicalAdminData(
first_name="Diego",
last_name="Ferral-Toro",
specialty=PHYSIOTHERAPIST,
accessible_conversation_specialties=[
PHYSIOTHERAPY,
BACK_PAIN,
EMERGENCY_PHYSIOTHERAPY,
],
access_types=[CHAT, VIDEO],
apps_displayed_in=[alan_insurance],
has_access_to_app_ids=[ALAN_ES],
country=spain,
languages=[spanish, english],
onboarding_status=COMPLETED,
dato_id="XSdL4ehETM-owb_20xEmhg",
prod_id="18eb92d9-3271-4286-91dc-a4e1a8ac5de2",
),
MedicalAdminData(
first_name="Diane",
last_name="Coomans",
specialty=PHYSIOTHERAPIST,
accessible_conversation_specialties=[
PHYSIOTHERAPY,
BACK_PAIN,
EMERGENCY_PHYSIOTHERAPY,
],
access_types=[CHAT, VIDEO],
apps_displayed_in=[alan_insurance],
has_access_to_app_ids=[ALAN_BE],
country=belgium,
languages=[dutch, english],
onboarding_status=COMPLETED,
dato_id="OXi_GJK7TziPCWlkkFWQCw",
prod_id="59ce8029-2aa1-4ff5-81b1-25156ebcf5f1",
),
MedicalAdminData(
first_name="Robin",
last_name="Vervaeke",
specialty=PHYSIOTHERAPIST,
accessible_conversation_specialties=[
PHYSIOTHERAPY,
BACK_PAIN,
EMERGENCY_PHYSIOTHERAPY,
],
access_types=[CHAT, VIDEO],
apps_displayed_in=[alan_insurance],
has_access_to_app_ids=[ALAN_FR, ALAN_ES, ALAN_BE],
country=france,
languages=[french, english],
onboarding_status=COMPLETED,
dato_id="R03pRAdAR1-Hq7_B4A0pAw",
prod_id="59584887-47a7-464d-86c7-4f1a15299eaa",
),
MedicalAdminData(
first_name="Olivier",
last_name="Delarras",
specialty=GENERAL_PRACTITIONER,
accessible_conversation_specialties=[
GENERAL_MEDICINE,
CONSULTATION,
PEDIATRICS,
CHILDCARE,
DIETETICS,
DERMATOLOGY,
PHYSIOTHERAPY,
GYNECOLOGY,
],
access_types=[CHAT, VIDEO],
apps_displayed_in=[alan_insurance],
has_access_to_app_ids=[ALAN_FR, ALAN_ES, ALAN_BE],
country=france,
languages=[french, english],
onboarding_status=COMPLETED,
dato_id="RunHY9MqRXOl4ti7fuhoTw",
prod_id="3c7c88e9-0794-4d23-9a32-002e75ca1f60",
),
]
medical_conversation ¶
close_old_answered_medical_conversations ¶
Source code in components/clinic/public/commands/medical_conversation.py
create_fake_conversations ¶
Create fake conversations for testing purposes only - count: number of fake conversations to create - specialty: medical specialty of the fake conversations to create - app: app of the fake conversations to create - is_closed: whether the fake conversations should be closed or not
Source code in components/clinic/public/commands/medical_conversation.py
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 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 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 281 282 283 284 285 286 287 288 289 290 291 | |
erase_all_conversation_data ¶
Source code in components/clinic/public/commands/medical_conversation.py
resolve_closable_conversations ¶
Source code in components/clinic/public/commands/medical_conversation.py
send_pending_proactive_conversations ¶
Source code in components/clinic/public/commands/medical_conversation.py
update_active_after_for_conversations ¶
This command will update the active_after field on conversations. It's helpful for: - computing it the first time - resetting it from time to time, if we have a bug and we want to fix the values
Source code in components/clinic/public/commands/medical_conversation.py
unread_message_reminders ¶
send_medical_conversations_unread_message_reminders ¶
Source code in components/clinic/public/commands/unread_message_reminders.py
user ¶
delete_clinic_data_for_user ¶
Source code in components/clinic/public/commands/user.py
components.clinic.public.dependencies ¶
BaseUserData
dataclass
¶
Base user data used by the clinic
This is a subset of the UserData class, used when only the basic user data is needed.
Attributes:
| Name | Type | Description |
|---|---|---|
first_name |
str | None
|
The user's first name |
last_name |
str | None
|
The user's last name |
BookingSessionPackage
dataclass
¶
Package available for a booking session type. This includes session's pricing and number of sessions included or reimbursed.
Attributes:
| Name | Type | Description |
|---|---|---|
price_in_cents |
int
|
The price of a session in cents |
reimbursed |
Optional[BookingSessionPackageCount]
|
The reimbursed sessions information (reimbursed by Alan e.g alternative medicine allowance) |
included |
Optional[BookingSessionPackageCount]
|
The included sessions information (covered with Alan) |
BookingSessionPackageCount
dataclass
¶
Count of sessions depends on the type
Attributes:
| Name | Type | Description |
|---|---|---|
count_limit |
int
|
The limit of the session count |
count_remaining |
int | None
|
The remaining session count |
ClinicAdapter ¶
Bases: ABC
Adapter for the clinic
clinic_consent_ai_publish_date
class-attribute
instance-attribute
¶
The release date of the chat x therapy feature - when conversations are created for therapy sessions between member and therapist automatically
get_allowlist_of_dermatology_medical_admins_ids
abstractmethod
¶
Return the list of medical admin IDs allowed for dermatology sessions in this country
get_app_base_user_data
abstractmethod
¶
Get the user data base for the clinic. This is a subset of the user data, used when only the basic user data is needed. It prevents the need to load all the user data when only the basic user data is needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_user_id
|
str
|
The user ID |
required |
compute_key_account_info
|
Whether to compute key account info for the user |
required |
Source code in components/clinic/public/dependencies.py
get_app_user_available_health_services
abstractmethod
¶
Get the available health services for the user
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_user_id
|
str
|
The user ID |
required |
Source code in components/clinic/public/dependencies.py
get_app_user_data
abstractmethod
¶
Get the user data for the clinic
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_user_id
|
str
|
The user ID |
required |
compute_key_account_info
|
bool
|
Whether to compute key account info for the user |
False
|
Source code in components/clinic/public/dependencies.py
get_booking_session_package
abstractmethod
¶
Get the pricing for the booking session for the user
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_user_id
|
str
|
The user ID |
required |
session_type
|
TherapistBookingSessionType
|
The session type |
required |
Returns:
| Type | Description |
|---|---|
BookingSessionPackage | None
|
The booking session package |
BookingSessionPackage | None
|
If None is returned, the session is free |
Source code in components/clinic/public/dependencies.py
get_coverage_status
abstractmethod
¶
Return the start and optionally the end date of the current or upcoming period of eligibility to the clinic restricted services.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_user_id
|
str
|
The user ID |
required |
Source code in components/clinic/public/dependencies.py
get_last_active_id_verification_request_for_user
abstractmethod
¶
Get the last active ID verification request for the user
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_user_id
|
str
|
The user ID |
required |
Source code in components/clinic/public/dependencies.py
has_access_to_orientation_call
abstractmethod
¶
Specifically check if the user has access to the orientation call in countries specifc code
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_user_id
|
str
|
The user ID |
required |
Source code in components/clinic/public/dependencies.py
has_app_user_permission
abstractmethod
¶
Check if the user has an employee permission
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_user_id
|
str
|
The user ID |
required |
permission
|
EmployeePermission
|
The permission |
required |
Source code in components/clinic/public/dependencies.py
is_app_user_admin_of_company
abstractmethod
¶
Check if the user is an admin of the company
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_user_id
|
str
|
The user ID |
required |
app_company_id
|
str
|
The company ID |
required |
Source code in components/clinic/public/dependencies.py
release_date_of_conversations_created_for_therapy_sessions
class-attribute
instance-attribute
¶
request_id_verification_request_for_user
abstractmethod
¶
Get or request ID verification request for the user
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_user_id
|
str
|
The user ID |
required |
user_info
|
ClinicUserDataForIdVerification
|
The user info for the ID verification request |
required |
commit
|
bool
|
Whether to commit the changes |
True
|
Source code in components/clinic/public/dependencies.py
should_request_id_verification_for_user
abstractmethod
¶
Check if the ID verification should be requested for the user
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_user_id
|
str
|
The user ID |
required |
update_app_user_phone
abstractmethod
¶
Update the phone number of the user
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_user_id
|
str
|
The user ID |
required |
phone
|
str | None
|
The phone number |
required |
Source code in components/clinic/public/dependencies.py
update_app_user_ssn
abstractmethod
¶
Update the SSN of the user
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_user_id
|
str
|
The user ID |
required |
ssn
|
str | None
|
The SSN |
required |
commit
|
bool
|
Whether to commit the changes |
False
|
Source code in components/clinic/public/dependencies.py
upload_invoice_as_insurance_document
abstractmethod
¶
Upload the invoice as an insurance document if relevant
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
IO
|
The file |
required |
app_user_id
|
str
|
The user ID |
required |
upload_invoice_data
|
UploadInvoiceData
|
The upload invoice data |
required |
Source code in components/clinic/public/dependencies.py
user_has_24_hour_response_guarantee
abstractmethod
¶
Check if the user has a 24-hour response guarantee (usually based on the company)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_user_id
|
str
|
The user ID |
required |
Source code in components/clinic/public/dependencies.py
validate_session_duration
abstractmethod
¶
Validate the session duration, throwing an error if it's not valid
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session_duration
|
int
|
The session duration |
required |
Source code in components/clinic/public/dependencies.py
ClinicUserDataForIdVerification
dataclass
¶
ClinicUserDataForIdVerification(
first_name,
additional_first_names,
last_name,
birth_last_name,
email,
gender,
date_of_birth,
place_of_birth,
session_id,
)
Data used for ID verification request for the clinic user
Attributes:
| Name | Type | Description |
|---|---|---|
first_name |
str
|
The first name of the user |
last_name |
str
|
The last name of the user |
email |
str
|
The email of the user |
birth_last_name |
str
|
The birth last name of the user |
place_of_birth |
str
|
The place of birth of the user (it's a string representing usually a city or town, to match with the information on ID cards or passports.) |
date_of_birth |
date
|
The date of birth of the user |
gender |
str
|
The gender of the user |
Dependent
dataclass
¶
Dependent of a user, used to represent a family member
DependentType ¶
UploadInvoiceData
dataclass
¶
UploadInvoiceData(
session_id,
starts_at,
ends_at,
paid_amount,
medical_admin_identifier,
medical_admin_name,
)
Data used to upload an invoice as an insurance document
Attributes:
| Name | Type | Description |
|---|---|---|
session_id |
UUID
|
The session ID |
starts_at |
date
|
The start date |
ends_at |
date
|
The end date |
paid_amount |
float
|
The paid amount |
medical_admin_identifier |
Optional[str]
|
The medical admin identifier |
medical_admin_name |
str
|
The medical admin name |
UserData
dataclass
¶
UserData(
first_name,
last_name,
gender,
email,
profile_id,
birth_date,
phone,
country,
address,
ssn,
lang,
is_alaner,
dependents,
is_key_account_or_large_company_and_not_alaner=False,
)
Bases: BaseUserData
Full user data necessary for the clinic
Attributes:
| Name | Type | Description |
|---|---|---|
first_name |
str | None
|
First name |
last_name |
str | None
|
Last name |
gender |
UserGender | None
|
Gender |
email |
str | None
|
|
profile_id |
UUID
|
Profile ID |
birth_date |
date | None
|
Birth date |
phone |
str | None
|
Phone number |
country |
str | None
|
Country |
address |
str | None
|
Address |
ssn |
str | None
|
Social security number |
lang |
Lang
|
Language |
is_alaner |
bool
|
Whether the user is an Alan employee |
dependents |
list[Dependent]
|
List of dependents |
is_key_account_or_large_company_and_not_alaner |
bool
|
Whether the user is a key account or large company and not an Alan employee |
is_key_account_or_large_company_and_not_alaner
class-attribute
instance-attribute
¶
Used only for the alpha (and perhaps beta) releases of Mo-in-Clinic. To be removed afterwards.
get_app_dependency ¶
Get the ClinicAdapter dependency depends on the app name of the user
The app name needs to be passed because the clinic can call the logic from a country to a different one
Ex: Doctors (FR, ES BE) are connected to the FR instance. This instance needs to call BE and ES logic and data
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
app_name
|
str
|
The app name |
required |
Source code in components/clinic/public/dependencies.py
components.clinic.public.entities ¶
components.clinic.public.enums ¶
available_health_service_name ¶
components.clinic.public.events ¶
subscription ¶
subscribe_to_events ¶
All event subscriptions for the Clinic should be done here.