care.emr.resources.questionnaire.spec module

class EnableOperator(*values)

Bases: str, Enum

exists = 'exists'
equals = 'equals'
not_equals = 'not_equals'
greater = 'greater'
less = 'less'
greater_or_equals = 'greater_or_equals'
less_or_equals = 'less_or_equals'
class EnableBehavior(*values)

Bases: str, Enum

all = 'all'
any = 'any'
class DisabledDisplay(*values)

Bases: str, Enum

hidden = 'hidden'
protected = 'protected'
class QuestionType(*values)

Bases: str, Enum

group = 'group'
boolean = 'boolean'
decimal = 'decimal'
integer = 'integer'
string = 'string'
text = 'text'
display = 'display'
date = 'date'
datetime = 'dateTime'
time = 'time'
choice = 'choice'
url = 'url'
quantity = 'quantity'
structured = 'structured'
class AnswerConstraint(*values)

Bases: str, Enum

required = 'required'
optional = 'optional'
class QuestionnaireStatus(*values)

Bases: str, Enum

active = 'active'
retired = 'retired'
draft = 'draft'
class SubjectType(*values)

Bases: str, Enum

patient = 'patient'
encounter = 'encounter'
class QuestionnaireBaseSpec(*, meta: dict = {})

Bases: EMRResource

model_config: ClassVar[ConfigDict] = {}

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

class Performer(*, meta: dict = {}, performer_type: str, performer_id: str | None, text: str | None)

Bases: QuestionnaireBaseSpec

performer_type: str
performer_id: str | None
text: str | None
model_config: ClassVar[ConfigDict] = {}

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

class EnableWhen(*, meta: dict = {}, question: str, operator: EnableOperator, answer: Any)

Bases: QuestionnaireBaseSpec

question: str
operator: EnableOperator
answer: Any
model_config: ClassVar[ConfigDict] = {}

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

class AnswerOption(*, meta: dict = {}, value: Any, initial_selected: bool = False)

Bases: QuestionnaireBaseSpec

value: Any
initial_selected: bool
classmethod validate_value(value: str, info)
model_config: ClassVar[ConfigDict] = {}

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

class Question(*, meta: dict = {}, link_id: str, id: ~typing.Annotated[~uuid.UUID, ~pydantic.types.UuidVersion(uuid_version=4)] | ~typing.Annotated[~uuid.UUID, ~pydantic.types.UuidVersion(uuid_version=5)] = <factory>, code: ~care.emr.utils.valueset_coding_type.ValueSetBoundCoding.__class_getitem__.<locals>.BoundCoding | None = None, collect_time: bool = False, collect_performer: bool = False, text: str, description: str | None = None, type: ~care.emr.resources.questionnaire.spec.QuestionType, structured_type: str | None = None, enable_when: list[~care.emr.resources.questionnaire.spec.EnableWhen] | None = None, enable_behavior: ~care.emr.resources.questionnaire.spec.EnableBehavior | None = None, disabled_display: ~care.emr.resources.questionnaire.spec.DisabledDisplay | None = None, collect_body_site: bool | None = None, collect_method: bool | None = None, required: bool | None = None, repeats: bool | None = None, read_only: bool | None = None, max_length: int | None = None, answerConstraint: ~care.emr.resources.questionnaire.spec.AnswerConstraint | None = None, answer_option: list[~care.emr.resources.questionnaire.spec.AnswerOption] | None = None, answer_value_set: str | None = None, is_observation: bool | None = None, unit: ~care.emr.utils.valueset_coding_type.ValueSetBoundCoding.__class_getitem__.<locals>.BoundCoding | None = None, questions: list[~care.emr.resources.questionnaire.spec.Question] = [], formula: str | None = None, styling_metadata: dict = {}, is_component: bool = False)

Bases: QuestionnaireBaseSpec

model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}

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

id: Annotated[UUID, UuidVersion(uuid_version=4)] | Annotated[UUID, UuidVersion(uuid_version=5)]
code: BoundCoding | None
collect_time: bool
collect_performer: bool
text: str
description: str | None
type: QuestionType
structured_type: str | None
enable_when: list[EnableWhen] | None
enable_behavior: EnableBehavior | None
disabled_display: DisabledDisplay | None
collect_body_site: bool | None
collect_method: bool | None
required: bool | None
repeats: bool | None
read_only: bool | None
max_length: int | None
answer_constraint: AnswerConstraint | None
answer_option: list[AnswerOption] | None
answer_value_set: str | None
is_observation: bool | None
unit: BoundCoding | None
questions: list[Question]
formula: str | None
styling_metadata: dict
is_component: bool
classmethod validate_value_set(slug)
get_all_ids()
validate_choice_and_group_questions()
class QuestionnaireWriteSpec(*, meta: dict = {}, version: str = '1.0', slug: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=5), MaxLen(max_length=36)]), AfterValidator(func=slug_validator)] | None = None, title: str, description: str | None = None, type: str = 'custom', status: QuestionnaireStatus, subject_type: SubjectType, styling_metadata: dict = {}, questions: list[Question])

Bases: QuestionnaireBaseSpec

version: str
slug: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=5), MaxLen(max_length=36)]), AfterValidator(func=slug_validator)] | None
title: str
description: str | None
type: str
status: QuestionnaireStatus
subject_type: SubjectType
styling_metadata: dict
questions: list[Question]
classmethod validate_slug(slug: str, info)
classmethod validate_title(title: str, info)
get_all_ids()
validate_unique_id()
model_config: ClassVar[ConfigDict] = {}

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

class QuestionnaireSpec(*, meta: dict = {}, version: str = '1.0', slug: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=5), MaxLen(max_length=36)]), AfterValidator(func=slug_validator)] | None = None, title: str, description: str | None = None, type: str = 'custom', status: QuestionnaireStatus, subject_type: SubjectType, styling_metadata: dict = {}, questions: list[Question], organizations: Annotated[list[Annotated[UUID, UuidVersion(uuid_version=4)]], MinLen(min_length=1)], tags: list[Annotated[UUID, UuidVersion(uuid_version=4)]] = [])

Bases: QuestionnaireWriteSpec

organizations: list[Annotated[UUID, UuidVersion(uuid_version=4)]]
tags: list[Annotated[UUID, UuidVersion(uuid_version=4)]]
classmethod validate_tags(tags)
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 QuestionnaireUpdateSpec(*, meta: dict = {}, version: str = '1.0', slug: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=5), MaxLen(max_length=36)]), AfterValidator(func=slug_validator)] | None = None, title: str, description: str | None = None, type: str = 'custom', status: QuestionnaireStatus, subject_type: SubjectType, styling_metadata: dict = {}, questions: list[Question])

Bases: QuestionnaireWriteSpec

model_config: ClassVar[ConfigDict] = {}

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

class QuestionnaireReadSpec(*, meta: dict = {}, id: str, slug: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=5), MaxLen(max_length=36)]), AfterValidator(func=slug_validator)] | None = None, version: str, title: str, description: str | None = None, status: QuestionnaireStatus, subject_type: SubjectType, styling_metadata: dict, questions: list, created_by: UserSpec = {}, updated_by: UserSpec = {}, tags: list[dict] = [])

Bases: QuestionnaireBaseSpec

id: str
slug: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=5), MaxLen(max_length=36)]), AfterValidator(func=slug_validator)] | None
version: str
title: str
description: str | None
status: QuestionnaireStatus
subject_type: SubjectType
styling_metadata: dict
questions: list
created_by: UserSpec
updated_by: UserSpec
tags: list[dict]
classmethod perform_extra_serialization(mapping, obj)
model_config: ClassVar[ConfigDict] = {}

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

class QuestionnaireTagSpec(*, meta: dict = {}, id: Annotated[UUID, UuidVersion(uuid_version=4)] | None = None, name: str, slug: Annotated[str, MinLen(min_length=5), MaxLen(max_length=36), AfterValidator(func=slug_validator)])

Bases: EMRResource

id: Annotated[UUID, UuidVersion(uuid_version=4)] | None
name: str
slug: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MinLen(min_length=5), MaxLen(max_length=36)]), AfterValidator(func=slug_validator)]
classmethod validate_slug(slug: str, info)
classmethod perform_extra_serialization(mapping, obj)
model_config: ClassVar[ConfigDict] = {}

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