care.emr.resources.user.spec module¶
- is_valid_username(username)¶
- class UserTypeOptions(*values)¶
-
- doctor = 'doctor'¶
- nurse = 'nurse'¶
- staff = 'staff'¶
- volunteer = 'volunteer'¶
- administrator = 'administrator'¶
- class UserTypeRoleMapping(*values)¶
Bases:
Enum- doctor = Role(name='Doctor', description='Doctor at some facility')¶
- nurse = Role(name='Nurse', description='Nurse at some facility')¶
- staff = Role(name='Staff', description='Staff at some facility')¶
- volunteer = Role(name='Volunteer', description='Volunteer at some facility')¶
- administrator = Role(name='Administrator', description='Administrator at a given boundary')¶
- class UserBaseSpec(*, meta: dict = {}, id: Annotated[UUID, UuidVersion(uuid_version=4)] | None = None, first_name: str, last_name: str, phone_number: Annotated[str, MaxLen(max_length=14)], prefix: Annotated[str | None, MaxLen(max_length=10)] = None, suffix: Annotated[str | None, MaxLen(max_length=50)] = None)¶
Bases:
EMRResource- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class UserUpdateSpec(*, meta: dict = {}, id: Annotated[UUID, UuidVersion(uuid_version=4)] | None = None, first_name: str, last_name: str, phone_number: Annotated[str, MaxLen(max_length=14)], prefix: Annotated[str | None, MaxLen(max_length=10)] = None, suffix: Annotated[str | None, MaxLen(max_length=50)] = None, user_type: UserTypeOptions, gender: GenderChoices, geo_organization: Annotated[UUID, UuidVersion(uuid_version=4)] | None = None)¶
Bases:
UserBaseSpec- user_type: UserTypeOptions¶
- gender: GenderChoices¶
- perform_extra_deserialization(is_update, obj)¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class UserCreateSpec(*, meta: dict = {}, id: Annotated[UUID, UuidVersion(uuid_version=4)] | None = None, first_name: str, last_name: str, phone_number: Annotated[str, MaxLen(max_length=14)], prefix: Annotated[str | None, MaxLen(max_length=10)] = None, suffix: Annotated[str | None, MaxLen(max_length=50)] = None, user_type: UserTypeOptions, gender: GenderChoices, geo_organization: Annotated[UUID, UuidVersion(uuid_version=4)] | None = None, password: str | None = None, username: str, email: str)¶
Bases:
UserUpdateSpec- classmethod validate_username(username)¶
- classmethod validate_phone_number(phone_number)¶
- classmethod validate_user_email(email)¶
- classmethod validate_password(password)¶
- perform_extra_deserialization(is_update, obj)¶
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class UserSpec(*, meta: dict = {}, id: Annotated[UUID, UuidVersion(uuid_version=4)] | None = None, first_name: str, last_name: str, phone_number: Annotated[str, MaxLen(max_length=14)], prefix: Annotated[str | None, MaxLen(max_length=10)] = None, suffix: Annotated[str | None, MaxLen(max_length=50)] = None, last_login: str, profile_picture_url: str, user_type: str, gender: str, username: str, mfa_enabled: bool = False, deleted: bool = False)¶
Bases:
UserBaseSpec- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class UserRetrieveSpec(*, meta: dict = {}, id: Annotated[UUID, UuidVersion(uuid_version=4)] | None = None, first_name: str, last_name: str, phone_number: Annotated[str, MaxLen(max_length=14)], prefix: Annotated[str | None, MaxLen(max_length=10)] = None, suffix: Annotated[str | None, MaxLen(max_length=50)] = None, last_login: str, profile_picture_url: str, user_type: str, gender: str, username: str, mfa_enabled: bool = False, deleted: bool = False, geo_organization: dict, created_by: UserSpec, email: str, flags: list[str] = [])¶
Bases:
UserSpec- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class CurrentUserRetrieveSpec(*, meta: dict = {}, id: Annotated[UUID, UuidVersion(uuid_version=4)] | None = None, first_name: str, last_name: str, phone_number: Annotated[str, MaxLen(max_length=14)], prefix: Annotated[str | None, MaxLen(max_length=10)] = None, suffix: Annotated[str | None, MaxLen(max_length=50)] = None, last_login: str, profile_picture_url: str, user_type: str, gender: str, username: str, mfa_enabled: bool = False, deleted: bool = False, geo_organization: dict, created_by: UserSpec, email: str, flags: list[str] = [], is_superuser: bool, qualification: str | None, doctor_experience_commenced_on: str | None, doctor_medical_council_registration: str | None, weekly_working_hours: str | None, alt_phone_number: str | None, date_of_birth: str | None, verified: bool, pf_endpoint: str | None, pf_p256dh: str | None, pf_auth: str | None, organizations: list[dict], facilities: list[dict], permissions: list[str])¶
Bases:
UserRetrieveSpec- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class PublicUserReadSpec(*, meta: dict = {}, id: Annotated[UUID, UuidVersion(uuid_version=4)] | None = None, first_name: str, last_name: str, phone_number: Annotated[str, MaxLen(max_length=14)], prefix: Annotated[str | None, MaxLen(max_length=10)] = None, suffix: Annotated[str | None, MaxLen(max_length=50)] = None, last_login: str, profile_picture_url: str, user_type: str, gender: str, username: str)¶
Bases:
UserBaseSpec- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ResetPasswordCheckRequest(*, token: str)¶
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ResetPasswordConfirmRequest(*, token: str, password: str)¶
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].