care.emr.resources.user.spec module

is_valid_username(username)
class UserTypeOptions(*values)

Bases: str, Enum

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

id: Annotated[UUID, UuidVersion(uuid_version=4)] | None
first_name: str
last_name: str
phone_number: str
prefix: str | None
suffix: str | None
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
phone_number: str
geo_organization: Annotated[UUID, UuidVersion(uuid_version=4)] | None
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

password: str | None
username: str
email: str
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

last_login: str
profile_picture_url: str
user_type: str
gender: str
username: str
mfa_enabled: bool
phone_number: str
deleted: bool
classmethod perform_extra_serialization(mapping, obj: User)
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

geo_organization: dict
created_by: UserSpec
email: str
flags: list[str]
classmethod perform_extra_serialization(mapping, obj: User)
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

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]
classmethod perform_extra_serialization(mapping, obj: User) None
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

last_login: str
profile_picture_url: str
user_type: str
gender: str
username: str
classmethod perform_extra_serialization(mapping, obj: User)
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ResetPasswordCheckRequest(*, token: str)

Bases: BaseModel

token: str
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

token: str
password: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ResetPasswordResponse(*, detail: str)

Bases: BaseModel

detail: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ResetPasswordRequestTokenRequest(*, username: str)

Bases: BaseModel

username: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].