dispel.providers.bdh.tasks.pdq39 module#

Functionalities to process pdq39 data.

dispel.providers.bdh.tasks.pdq39.DOMAINS = {'activities_of_daily_living ': range(10, 16), 'bodily_discomfort': range(36, 39), 'cognition': range(29, 33), 'communication': range(33, 36), 'emotional_well_being': range(16, 22), 'mobility': range(0, 10), 'social_support': range(26, 29), 'stigma': range(22, 26)}#

The eight functional domains that were evaluated through the survey.

class dispel.providers.bdh.tasks.pdq39.ExtractDomainScore[source]#

Bases: ExtractStep

Extract PDQ-39 domain score.

__init__(domain, *args, **kwargs)[source]#
Parameters:

domain (str) –

data_set_ids: str | Iterable[str] = 'domain_scores'#

An iterable of data sets to be being processed

get_definition(**kwargs)[source]#

Overwrite get_definition.

Return type:

ValueDefinition

read_pdq_domain_score(data)[source]#

Read pdq normalized score corresponding to the domain.

Parameters:

data (DataFrame) –

Return type:

float

class dispel.providers.bdh.tasks.pdq39.ExtractTotalScore[source]#

Bases: ExtractStep

Extract PDQ-39 total score.

data_set_ids: str | Iterable[str] = 'domain_scores'#

An iterable of data sets to be being processed

definition: ValueDefinition | ValueDefinitionPrototype | None = <dispel.data.measures.MeasureValueDefinitionPrototype object>#

The specification of the measure definition

static read_pdq_total_score(data)[source]#

Read PDQ39 total score.

Parameters:

data (DataFrame) –

Return type:

float

class dispel.providers.bdh.tasks.pdq39.GroupScorePerDomain[source]#

Bases: TransformStep

Transform question scores per domain and creates domain scores.

data_set_ids: str | Iterable[str] = 'score_per_answer_w_category'#

An iterable of data sets to be being processed

definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: count (The number of questions in the domain.)>, <RawDataValueDefinition: domain_score (The sum of the score (between 0 and 4) to each individual answer that belongs to the domain.)>, <RawDataValueDefinition: domain_score_normalized (The domain score normalized between 0 and 100.)>]#
static group_score_per_domain(data)[source]#

Group question scores per domain and creates domain scores.

Parameters:

data (DataFrame) –

Return type:

DataFrame

new_data_set_id: str = 'domain_scores'#
class dispel.providers.bdh.tasks.pdq39.TransformAnswerInScore[source]#

Bases: TransformStep

Transform answers in score between 0 and 4.

data_set_ids: str | Iterable[str] = 'userInput'#

An iterable of data sets to be being processed

definitions: List[RawDataValueDefinition] = [<RawDataValueDefinition: question_number (The question number.)>, <RawDataValueDefinition: answer (The answer to the question with values between 1 and 6.)>, <RawDataValueDefinition: score (The score with values between 0 and 4 (lower the better).)>, <RawDataValueDefinition: domain (The domain of quality of life being assessed by the question.)>]#
new_data_set_id: str = 'score_per_answer_w_category'#
static transform_answer_in_score(data)[source]#

Transform answer into a score between 0 and 4.

Parameters:

data (DataFrame) –

Return type:

DataFrame