Exemple #1
0
def get_follow_up_coding_plans(pipeline_name):
    return [
        CodingPlan(
            raw_field="s09_have_voice_raw",
            time_field="s09_have_voice_time",
            coda_filename="TIS_Plus_s09_have_voice.json",
            coding_configurations=[
                CodingConfiguration(
                    coding_mode=CodingModes.SINGLE,
                    code_scheme=CodeSchemes.S09_HAVE_VOICE,
                    cleaner=somali.DemographicCleaner.clean_yes_no,
                    coded_field="s09_have_voice_coded",
                    analysis_file_key="s09_have_voice",
                    fold_strategy=FoldStrategies.assert_label_ids_equal)
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "have voice"),
            raw_field_fold_strategy=FoldStrategies.assert_equal),
        CodingPlan(
            raw_field="s09_suggestions_raw",
            time_field="s09_suggestions_time",
            coda_filename="TIS_Plus_s09_suggestions.json",
            coding_configurations=[
                CodingConfiguration(
                    coding_mode=CodingModes.MULTIPLE,
                    code_scheme=CodeSchemes.S09_SUGGESTIONS,
                    coded_field="s09_suggestions_coded",
                    analysis_file_key="s09_suggestions",
                    fold_strategy=lambda x, y: FoldStrategies.list_of_labels(
                        CodeSchemes.S09_SUGGESTIONS, x, y))
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "suggestions"),
            raw_field_fold_strategy=FoldStrategies.assert_equal)
    ]
def get_follow_up_coding_plans(pipeline_name):
    return [
        CodingPlan(
            raw_field="rqa_s01_programme_evaluation_raw",
            time_field="sent_on",
            coda_filename="OXFAM_WASH_s01_Programme_Evaluation.json",
            icr_filename="oxfam_programme_evaluation.csv",
            coding_configurations=[
                CodingConfiguration(
                    coding_mode=CodingModes.MULTIPLE,
                    code_scheme=CodeSchemes.S01_PROGRAMME_EVALUATION,
                    coded_field="rqa_s01_programme_evaluation_coded",
                    analysis_file_key="rqa_s01_programme_evaluation",
                    fold_strategy=lambda x, y: FoldStrategies.list_of_labels(
                        CodeSchemes.S01_PROGRAMME_EVALUATION, x, y))
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "OXFAM WASH s01 Programme Evaluation"),
            raw_field_fold_strategy=FoldStrategies.concatenate),
        CodingPlan(
            raw_field="rqa_s01_accountability_raw",
            time_field="sent_on",
            coda_filename="OXFAM_WASH_s01_Accountability.json",
            run_id_field="rqa_s01_accountability_run_id",
            icr_filename="oxfam_accountability.csv",
            coding_configurations=[
                CodingConfiguration(
                    coding_mode=CodingModes.MULTIPLE,
                    code_scheme=CodeSchemes.S01_ACCOUNTABILITY,
                    coded_field="rqa_s01_accountability_coded",
                    analysis_file_key="rqa_s01_accountability",
                    fold_strategy=lambda x, y: FoldStrategies.list_of_labels(
                        CodeSchemes.S01_ACCOUNTABILITY, x, y))
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "OXFAM WASH s01 Accountability"),
            raw_field_fold_strategy=FoldStrategies.concatenate),
    ]
Exemple #3
0
def get_rqa_coding_plans(pipeline_name):
    return [
        CodingPlan(raw_field="rqa_s01e01_raw",
                   time_field="sent_on",
                   run_id_field="rqa_s01e01_run_id",
                   coda_filename="TEST_PIPELINE_DANIEL_s01e01.json",
                   icr_filename="s01e01.csv",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.MULTIPLE,
                           code_scheme=CodeSchemes.S01E01,
                           coded_field="rqa_s01e01_coded",
                           analysis_file_key="rqa_s01e01",
                           fold_strategy=lambda x, y: FoldStrategies.list_of_labels(CodeSchemes.S01E01, x, y)
                       )
                   ],
                   ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value("s01e01"),
                   raw_field_fold_strategy=FoldStrategies.concatenate),
    ]
def get_rqa_coding_plans(pipeline_name):
    return [
        CodingPlan(raw_field="rqa_s01e01_raw",
                   time_field="sent_on",
                   run_id_field="rqa_s01e01_run_id",
                   coda_filename="UNICEF_COVID19_SOM_s01e01.json",
                   icr_filename="rqa_s01e01.csv",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.MULTIPLE,
                           code_scheme=CodeSchemes.S01E01,
                           coded_field="rqa_s01e01_coded",
                           analysis_file_key="rqa_s01e01",
                           fold_strategy=lambda x, y: FoldStrategies.list_of_labels(CodeSchemes.S01E01, x, y)
                       )
                   ],
                   ws_code=CodeSchemes.WS_CORRECT_DATASET_SCHEME.get_code_with_match_value("s01e01"),
                   raw_field_fold_strategy=FoldStrategies.concatenate),

        CodingPlan(raw_field="rqa_s01e02_raw",
                   time_field="sent_on",
                   run_id_field="rqa_s01e02_run_id",
                   coda_filename="UNICEF_COVID19_SOM_s01e02.json",
                   icr_filename="rqa_s01e02.csv",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.MULTIPLE,
                           code_scheme=CodeSchemes.S01E02,
                           coded_field="rqa_s01e02_coded",
                           analysis_file_key="rqa_s01e02",
                           fold_strategy=lambda x, y: FoldStrategies.list_of_labels(CodeSchemes.S01E02, x, y)
                       )
                   ],
                   ws_code=CodeSchemes.WS_CORRECT_DATASET_SCHEME.get_code_with_match_value("s01e02"),
                   raw_field_fold_strategy=FoldStrategies.concatenate),

        CodingPlan(raw_field="rqa_s01e03_raw",
                   time_field="sent_on",
                   run_id_field="rqa_s01e03_run_id",
                   coda_filename="UNICEF_COVID19_SOM_s01e03.json",
                   icr_filename="rqa_s01e03.csv",
                   katikati_survey_time_ranges=[("2020-07-24T14:00:00+03:00","2020-07-26T00:00:00+03:00")],
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.MULTIPLE,
                           code_scheme=CodeSchemes.S01E03,
                           coded_field="rqa_s01e03_coded",
                           analysis_file_key="rqa_s01e03",
                           fold_strategy=lambda x, y: FoldStrategies.list_of_labels(CodeSchemes.S01E03, x, y)
                       )
                   ],
                   ws_code=CodeSchemes.WS_CORRECT_DATASET_SCHEME.get_code_with_match_value("s01e03"),
                   raw_field_fold_strategy=FoldStrategies.concatenate),

        CodingPlan(raw_field="rqa_s01e04_raw",
                   time_field="sent_on",
                   run_id_field="rqa_s01e04_run_id",
                   coda_filename="UNICEF_COVID19_SOM_s01e04.json",
                   icr_filename="rqa_s01e04.csv",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.MULTIPLE,
                           code_scheme=CodeSchemes.S01E04,
                           coded_field="rqa_s01e04_coded",
                           analysis_file_key="rqa_s01e04",
                           fold_strategy=lambda x, y: FoldStrategies.list_of_labels(CodeSchemes.S01E04, x, y)
                       )
                   ],
                   ws_code=CodeSchemes.WS_CORRECT_DATASET_SCHEME.get_code_with_match_value("s01e04"),
                   raw_field_fold_strategy=FoldStrategies.concatenate),

        CodingPlan(raw_field="csap_kalkaal_consent_raw",
                   time_field="sent_on",
                   run_id_field="csap_kalkaal_consent_run_id",
                   coda_filename="UNICEF_COVID19_SOM_csap_kalkaal_consent.json",
                   icr_filename="csap_kalkaal_consent.csv",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.MULTIPLE,
                           code_scheme=CodeSchemes.CSAP_KALKAAL_CONSENT,
                           coded_field="csap_kalkaal_consent_coded",
                           analysis_file_key="csap_kalkaal_consent",
                           fold_strategy=lambda x, y: FoldStrategies.list_of_labels(CodeSchemes.CSAP_KALKAAL_CONSENT, x, y)
                       )
                   ],
                   ws_code=CodeSchemes.WS_CORRECT_DATASET_SCHEME.get_code_with_match_value("csap kalkaal consent"),
                   raw_field_fold_strategy=FoldStrategies.concatenate),

        CodingPlan(raw_field="s01_closeout_raw",
                   time_field="sent_on",
                   run_id_field="s01_closeout_run_id",
                   coda_filename="UNICEF_COVID19_SOM_s01_closeout.json",
                   icr_filename="s01_closeout.csv",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.MULTIPLE,
                           code_scheme=CodeSchemes.S01_CLOSEOUT,
                           coded_field="s01_closeout_coded",
                           analysis_file_key="s01_closeout",
                           fold_strategy=lambda x, y: FoldStrategies.list_of_labels(CodeSchemes.S01_CLOSEOUT, x,
                                                                                    y)
                       )
                   ],
                   ws_code=CodeSchemes.WS_CORRECT_DATASET_SCHEME.get_code_with_match_value("s01 closeout"),
                   raw_field_fold_strategy=FoldStrategies.concatenate)
    ]
def get_demog_coding_plans(pipeline_name):
    return [
        CodingPlan(raw_field="gender_raw",
                   time_field="gender_time",
                   coda_filename="UNICEF_COVID19_SOM_gender.json",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.SINGLE,
                           code_scheme=CodeSchemes.GENDER,
                           cleaner=somali.DemographicCleaner.clean_gender,
                           coded_field="gender_coded",
                           analysis_file_key="gender",
                           fold_strategy=FoldStrategies.assert_label_ids_equal
                       )
                   ],
                   ws_code=CodeSchemes.WS_CORRECT_DATASET_SCHEME.get_code_with_match_value("gender"),
                   raw_field_fold_strategy=FoldStrategies.assert_equal),

        CodingPlan(raw_field="age_raw",
                   time_field="age_time",
                   coda_filename="UNICEF_COVID19_SOM_age.json",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.SINGLE,
                           code_scheme=CodeSchemes.AGE,
                           cleaner=lambda text: clean_age_with_range_filter(text),
                           coded_field="age_coded",
                           analysis_file_key="age",
                           fold_strategy=FoldStrategies.assert_label_ids_equal
                       ),
                       CodingConfiguration(
                           coding_mode=CodingModes.SINGLE,
                           code_scheme=CodeSchemes.AGE_CATEGORY,
                           coded_field="age_category_coded",
                           analysis_file_key="age_category",
                           fold_strategy=FoldStrategies.assert_label_ids_equal
                       )
                   ],
                   code_imputation_function=code_imputation_functions.impute_age_category,
                   ws_code=CodeSchemes.WS_CORRECT_DATASET_SCHEME.get_code_with_match_value("age"),
                   raw_field_fold_strategy=FoldStrategies.assert_equal),

        CodingPlan(raw_field="recently_displaced_raw",
                   time_field="recently_displaced_time",
                   coda_filename="UNICEF_COVID19_SOM_recently_displaced.json",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.SINGLE,
                           code_scheme=CodeSchemes.RECENTLY_DISPLACED,
                           cleaner=somali.DemographicCleaner.clean_yes_no,
                           coded_field="recently_displaced_coded",
                           analysis_file_key="recently_displaced",
                           fold_strategy=FoldStrategies.assert_label_ids_equal
                       )
                   ],
                   ws_code=CodeSchemes.WS_CORRECT_DATASET_SCHEME.get_code_with_match_value("recently displaced"),
                   raw_field_fold_strategy=FoldStrategies.assert_equal),

        CodingPlan(raw_field="household_language_raw",
                   time_field="household_language_time",
                   coda_filename="UNICEF_COVID19_SOM_household_language.json",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.SINGLE,
                           code_scheme=CodeSchemes.HOUSEHOLD_LANGUAGE,
                           coded_field="household_language_coded",
                           analysis_file_key="household_language",
                           fold_strategy=FoldStrategies.assert_label_ids_equal
                       )
                   ],
                   ws_code=CodeSchemes.WS_CORRECT_DATASET_SCHEME.get_code_with_match_value("household language"),
                   raw_field_fold_strategy=FoldStrategies.assert_equal),

        CodingPlan(raw_field="location_raw",
                   time_field="location_time",
                   coda_filename="UNICEF_COVID19_SOM_location.json",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.SINGLE,
                           code_scheme=CodeSchemes.MOGADISHU_SUB_DISTRICT,
                           fold_strategy=FoldStrategies.assert_label_ids_equal,
                           cleaner=somali.DemographicCleaner.clean_mogadishu_sub_district,
                           coded_field="mogadishu_sub_district_coded",
                           analysis_file_key="mogadishu_sub_district"
                       ),
                       CodingConfiguration(
                           coding_mode=CodingModes.SINGLE,
                           code_scheme=CodeSchemes.SOMALIA_DISTRICT,
                           cleaner=lambda text: clean_district_if_no_mogadishu_sub_district(text),
                           fold_strategy=FoldStrategies.assert_label_ids_equal,
                           coded_field="district_coded",
                           analysis_file_key="district"
                       ),
                       CodingConfiguration(
                           coding_mode=CodingModes.SINGLE,
                           code_scheme=CodeSchemes.SOMALIA_REGION,
                           fold_strategy=FoldStrategies.assert_label_ids_equal,
                           coded_field="region_coded",
                           analysis_file_key="region",
                       ),
                       CodingConfiguration(
                           coding_mode=CodingModes.SINGLE,
                           code_scheme=CodeSchemes.SOMALIA_STATE,
                           fold_strategy=FoldStrategies.assert_label_ids_equal,
                           coded_field="state_coded",
                           analysis_file_key="state"
                       ),
                       CodingConfiguration(
                           coding_mode=CodingModes.SINGLE,
                           code_scheme=CodeSchemes.SOMALIA_ZONE,
                           fold_strategy=FoldStrategies.assert_label_ids_equal,
                           coded_field="zone_coded",
                           analysis_file_key="zone",
                       )
                   ],
                   code_imputation_function=code_imputation_functions.impute_somalia_location_codes,
                   ws_code=CodeSchemes.WS_CORRECT_DATASET_SCHEME.get_code_with_match_value("location"),
                   raw_field_fold_strategy=FoldStrategies.assert_equal)
    ]
def get_demog_coding_plans(pipeline_name):
    return [
        CodingPlan(
            raw_field="gender_raw",
            time_field="gender_time",
            coda_filename="WorldVision_gender.json",
            coding_configurations=[
                CodingConfiguration(
                    coding_mode=CodingModes.SINGLE,
                    code_scheme=CodeSchemes.GENDER,
                    cleaner=somali.DemographicCleaner.clean_gender,
                    coded_field="gender_coded",
                    analysis_file_key="gender",
                    fold_strategy=FoldStrategies.assert_label_ids_equal)
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "gender"),
            raw_field_fold_strategy=FoldStrategies.assert_equal),
        CodingPlan(
            raw_field="age_raw",
            time_field="age_time",
            coda_filename="WorldVision_age.json",
            coding_configurations=[
                CodingConfiguration(
                    coding_mode=CodingModes.SINGLE,
                    code_scheme=CodeSchemes.AGE,
                    cleaner=clean_age_with_range_filter,
                    coded_field="age_coded",
                    analysis_file_key="age",
                    fold_strategy=FoldStrategies.assert_label_ids_equal),
                CodingConfiguration(
                    coding_mode=CodingModes.SINGLE,
                    code_scheme=CodeSchemes.AGE_CATEGORY,
                    coded_field="age_category_coded",
                    analysis_file_key="age_category",
                    fold_strategy=FoldStrategies.assert_label_ids_equal)
            ],
            code_imputation_function=code_imputation_functions.
            impute_age_category,
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "age"),
            raw_field_fold_strategy=FoldStrategies.assert_equal),
        CodingPlan(
            raw_field="location_raw",
            time_field="location_time",
            coda_filename="WorldVision_location.json",
            coding_configurations=[
                CodingConfiguration(
                    coding_mode=CodingModes.SINGLE,
                    code_scheme=CodeSchemes.KENYA_COUNTY,
                    coded_field="county_coded",
                    analysis_file_key="county",
                    fold_strategy=FoldStrategies.assert_label_ids_equal),
                CodingConfiguration(
                    coding_mode=CodingModes.SINGLE,
                    code_scheme=CodeSchemes.KENYA_CONSTITUENCY,
                    coded_field="constituency_coded",
                    analysis_file_key="constituency",
                    fold_strategy=FoldStrategies.assert_label_ids_equal)
            ],
            code_imputation_function=code_imputation_functions.
            impute_kenya_location_codes,
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "location"),
            raw_field_fold_strategy=FoldStrategies.assert_equal)
    ]
def get_rqa_coding_plans(pipeline_name):
    return [
        CodingPlan(
            raw_field="rqa_s01e01_raw",
            time_field="sent_on",
            run_id_field="rqa_s01e01_run_id",
            coda_filename="WorldVision_s01e01.json",
            icr_filename="s01e01.csv",
            coding_configurations=[
                CodingConfiguration(coding_mode=CodingModes.MULTIPLE,
                                    code_scheme=CodeSchemes.S01E01,
                                    coded_field="rqa_s01e01_coded",
                                    analysis_file_key="rqa_s01e01_",
                                    fold_strategy=lambda x, y: FoldStrategies.
                                    list_of_labels(CodeSchemes.S01E01, x, y))
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "s01e01"),
            raw_field_fold_strategy=FoldStrategies.concatenate),
        CodingPlan(
            raw_field="rqa_s01e02_raw",
            time_field="sent_on",
            run_id_field="rqa_s01e02_run_id",
            coda_filename="WorldVision_s01e02.json",
            icr_filename="s01e02.csv",
            coding_configurations=[
                CodingConfiguration(coding_mode=CodingModes.MULTIPLE,
                                    code_scheme=CodeSchemes.S01E02,
                                    coded_field="rqa_s01e02_coded",
                                    analysis_file_key="rqa_s01e02_",
                                    fold_strategy=lambda x, y: FoldStrategies.
                                    list_of_labels(CodeSchemes.S01E02, x, y))
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "s01e02"),
            raw_field_fold_strategy=FoldStrategies.concatenate),
        CodingPlan(
            raw_field="rqa_s01e03_raw",
            time_field="sent_on",
            run_id_field="rqa_s01e03_run_id",
            coda_filename="WorldVision_s01e03.json",
            icr_filename="s01e03.csv",
            coding_configurations=[
                CodingConfiguration(coding_mode=CodingModes.MULTIPLE,
                                    code_scheme=CodeSchemes.S01E03,
                                    coded_field="rqa_s01e03_coded",
                                    analysis_file_key="rqa_s01e03_",
                                    fold_strategy=lambda x, y: FoldStrategies.
                                    list_of_labels(CodeSchemes.S01E03, x, y))
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "s01e03"),
            raw_field_fold_strategy=FoldStrategies.concatenate),
        CodingPlan(
            raw_field="s01_close_out_raw",
            time_field="sent_on",
            run_id_field="s01_close_out_run_id",
            coda_filename="WorldVision_s01_close_out.json",
            icr_filename="s01_close_out.csv",
            coding_configurations=[
                CodingConfiguration(
                    coding_mode=CodingModes.MULTIPLE,
                    code_scheme=CodeSchemes.S01_CLOSE_OUT,
                    coded_field="s01_close_out_coded",
                    analysis_file_key="s01_close_out_",
                    fold_strategy=lambda x, y: FoldStrategies.list_of_labels(
                        CodeSchemes.S01_CLOSE_OUT, x, y))
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "s01 close-out"),
            raw_field_fold_strategy=FoldStrategies.concatenate)
    ]
def get_rqa_coding_plans(pipeline_name):
    return [
        CodingPlan(
            raw_field="rqa_s01e01_raw",
            time_field="sent_on",
            run_id_field="rqa_s01e01_run_id",
            coda_filename="OXFAM_WASH_s01e01.json",
            icr_filename="s01e01.csv",
            coding_configurations=[
                CodingConfiguration(coding_mode=CodingModes.MULTIPLE,
                                    code_scheme=CodeSchemes.S01E01,
                                    coded_field="rqa_s01e01_coded",
                                    analysis_file_key="rqa_s01e01",
                                    fold_strategy=lambda x, y: FoldStrategies.
                                    list_of_labels(CodeSchemes.S01E01, x, y))
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "OXFAM-WASH s01e01"),
            raw_field_fold_strategy=FoldStrategies.concatenate),
        CodingPlan(
            raw_field="rqa_s01e02_raw",
            time_field="sent_on",
            run_id_field="rqa_s01e02_run_id",
            coda_filename="OXFAM_WASH_s01e02.json",
            icr_filename="s01e02.csv",
            coding_configurations=[
                CodingConfiguration(coding_mode=CodingModes.MULTIPLE,
                                    code_scheme=CodeSchemes.S01E02,
                                    coded_field="rqa_s01e02_coded",
                                    analysis_file_key="rqa_s01e02",
                                    fold_strategy=lambda x, y: FoldStrategies.
                                    list_of_labels(CodeSchemes.S01E02, x, y))
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "OXFAM-WASH s01e02"),
            raw_field_fold_strategy=FoldStrategies.concatenate),
        CodingPlan(
            raw_field="rqa_s01e03_raw",
            time_field="sent_on",
            run_id_field="rqa_s01e03_run_id",
            coda_filename="OXFAM_WASH_s01e03.json",
            icr_filename="s01e03.csv",
            coding_configurations=[
                CodingConfiguration(coding_mode=CodingModes.MULTIPLE,
                                    code_scheme=CodeSchemes.S01E03,
                                    coded_field="rqa_s01e03_coded",
                                    analysis_file_key="rqa_s01e03",
                                    fold_strategy=lambda x, y: FoldStrategies.
                                    list_of_labels(CodeSchemes.S01E03, x, y))
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "OXFAM-WASH s01e03"),
            raw_field_fold_strategy=FoldStrategies.concatenate),
        CodingPlan(
            raw_field="oxfam_beneficiary_consent_raw",
            time_field="sent_on",
            run_id_field="oxfam_beneficiary_consent_run_id",
            coda_filename="OXFAM_WASH_Beneficiary_Consent.json",
            icr_filename="oxfam_beneficiary_consent.csv",
            coding_configurations=[
                CodingConfiguration(
                    coding_mode=CodingModes.MULTIPLE,
                    code_scheme=CodeSchemes.BENEFICIARY_CONSENT,
                    coded_field="oxfam_beneficiary_consent_coded",
                    analysis_file_key="oxfam_beneficiary_consent",
                    fold_strategy=lambda x, y: FoldStrategies.list_of_labels(
                        CodeSchemes.BENEFICIARY_CONSENT, x, y))
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "OXFAM WASH Beneficiary Consent"),
            raw_field_fold_strategy=FoldStrategies.concatenate),
        CodingPlan(
            raw_field="rqa_s01e03_noise_handler_raw",
            time_field="sent_on",
            run_id_field="rqa_s01e03_noise_handler_run_id",
            coda_filename="OXFAM_WASH_s01e03_Noise_Handler.json",
            icr_filename="oxfam_wash_s01e03_noise_handler.csv",
            coding_configurations=[
                CodingConfiguration(
                    coding_mode=CodingModes.MULTIPLE,
                    code_scheme=CodeSchemes.S01E03_NOISE_HANDLER,
                    coded_field="rqa_s01e03_noise_handler_coded",
                    analysis_file_key="rqa_s01e03_s01e03_noise_handler",
                    fold_strategy=lambda x, y: FoldStrategies.list_of_labels(
                        CodeSchemes.S01E03_NOISE_HANDLER, x, y))
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "OXFAM WASH s01e03 Noise Handler"),
            raw_field_fold_strategy=FoldStrategies.concatenate),
        CodingPlan(
            raw_field="s01_close_out_raw",
            time_field="sent_on",
            run_id_field="s01_close_out_run_id",
            coda_filename="OXFAM_WASH_s01_Close_Out.json",
            icr_filename="oxfam_wash_s01_close_out.csv",
            coding_configurations=[
                CodingConfiguration(
                    coding_mode=CodingModes.MULTIPLE,
                    code_scheme=CodeSchemes.S01_CLOSE_OUT,
                    coded_field="s01_close_out_coded",
                    analysis_file_key="s01_close_out",
                    fold_strategy=lambda x, y: FoldStrategies.list_of_labels(
                        CodeSchemes.S01_CLOSE_OUT, x, y))
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "OXFAM WASH S01 Close Out"),
            raw_field_fold_strategy=FoldStrategies.concatenate),
    ]
Exemple #9
0
def get_rqa_coding_plans(pipeline_name):
    if pipeline_name == "TIS-Plus-Facebook":
        return [
            CodingPlan(
                raw_field="facebook_s09e01_raw",
                time_field="sent_on",
                run_id_field="facebook_s09e01_run_id",
                coda_filename="TIS_Plus_facebook_s09e01.json",
                message_id_fn=lambda td: SHAUtils.sha_string(td[
                    "facebook_s09e01_comment_id"]),
                icr_filename="facebook_s09e01.csv",
                coding_configurations=[
                    CodingConfiguration(
                        coding_mode=CodingModes.MULTIPLE,
                        code_scheme=CodeSchemes.FACEBOOK_S09E01,
                        coded_field="facebook_s09e01_coded",
                        analysis_file_key="facebook_s09e01",
                        fold_strategy=lambda x, y: FoldStrategies.
                        list_of_labels(CodeSchemes.FACEBOOK_S09E01, x, y)),
                    CodingConfiguration(
                        raw_field="facebook_s09e01_comment_reply_to_raw",
                        coding_mode=CodingModes.SINGLE,
                        code_scheme=CodeSchemes.FACEBOOK_COMMENT_REPLY_TO,
                        cleaner=lambda parent: "post"
                        if parent == {} else "comment",
                        coded_field="facebook_s09e01_comment_reply_to_coded",
                        requires_manual_verification=False,
                        analysis_file_key="facebook_s09e01_comment_reply_to",
                        fold_strategy=None,
                        include_in_individuals_file=False),
                    CodingConfiguration(
                        raw_field="facebook_s09e01_post_raw",
                        coding_mode=CodingModes.SINGLE,
                        code_scheme=CodeSchemes.FACEBOOK_POST_TYPE,
                        cleaner=clean_facebook_post_type,
                        coded_field="facebook_s09e01_post_type_coded",
                        requires_manual_verification=False,
                        analysis_file_key="facebook_s09e01_post_type",
                        fold_strategy=None,
                        include_in_individuals_file=False)
                ],
                raw_field_fold_strategy=FoldStrategies.concatenate),
            CodingPlan(
                raw_field="facebook_s09e02_raw",
                time_field="sent_on",
                run_id_field="facebook_s09e02_run_id",
                coda_filename="TIS_Plus_facebook_s09e02.json",
                message_id_fn=lambda td: SHAUtils.sha_string(td[
                    "facebook_s09e02_comment_id"]),
                icr_filename="facebook_s09e02.csv",
                coding_configurations=[
                    CodingConfiguration(
                        coding_mode=CodingModes.MULTIPLE,
                        code_scheme=CodeSchemes.FACEBOOK_S09E02,
                        coded_field="facebook_s09e02_coded",
                        analysis_file_key="facebook_s09e02",
                        fold_strategy=lambda x, y: FoldStrategies.
                        list_of_labels(CodeSchemes.FACEBOOK_S09E02, x, y)),
                    CodingConfiguration(
                        raw_field="facebook_s09e02_comment_reply_to_raw",
                        coding_mode=CodingModes.SINGLE,
                        code_scheme=CodeSchemes.FACEBOOK_COMMENT_REPLY_TO,
                        cleaner=lambda parent: "post"
                        if parent == {} else "comment",
                        coded_field="facebook_s09e02_comment_reply_to_coded",
                        requires_manual_verification=False,
                        analysis_file_key="facebook_s09e02_comment_reply_to",
                        fold_strategy=None,
                        include_in_individuals_file=False),
                    CodingConfiguration(
                        raw_field="facebook_s09e02_post_raw",
                        coding_mode=CodingModes.SINGLE,
                        code_scheme=CodeSchemes.FACEBOOK_POST_TYPE,
                        cleaner=clean_facebook_post_type,
                        coded_field="facebook_s09e02_post_type_coded",
                        requires_manual_verification=False,
                        analysis_file_key="facebook_s09e02_post_type",
                        fold_strategy=None,
                        include_in_individuals_file=False)
                ],
                raw_field_fold_strategy=FoldStrategies.concatenate),
            CodingPlan(
                raw_field="facebook_s09e03_raw",
                time_field="sent_on",
                run_id_field="facebook_s09e03_run_id",
                coda_filename="TIS_Plus_facebook_s09e03.json",
                message_id_fn=lambda td: SHAUtils.sha_string(td[
                    "facebook_s09e03_comment_id"]),
                icr_filename="facebook_s09e03.csv",
                coding_configurations=[
                    CodingConfiguration(
                        coding_mode=CodingModes.MULTIPLE,
                        code_scheme=CodeSchemes.FACEBOOK_S09E03,
                        coded_field="facebook_s09e03_coded",
                        analysis_file_key="facebook_s09e03",
                        fold_strategy=lambda x, y: FoldStrategies.
                        list_of_labels(CodeSchemes.FACEBOOK_S09E03, x, y)),
                    CodingConfiguration(
                        raw_field="facebook_s09e03_comment_reply_to_raw",
                        coding_mode=CodingModes.SINGLE,
                        code_scheme=CodeSchemes.FACEBOOK_COMMENT_REPLY_TO,
                        cleaner=lambda parent: "post"
                        if parent == {} else "comment",
                        coded_field="facebook_s09e03_comment_reply_to_coded",
                        requires_manual_verification=False,
                        analysis_file_key="facebook_s09e03_comment_reply_to",
                        fold_strategy=None,
                        include_in_individuals_file=False),
                    CodingConfiguration(
                        raw_field="facebook_s09e03_post_raw",
                        coding_mode=CodingModes.SINGLE,
                        code_scheme=CodeSchemes.FACEBOOK_POST_TYPE,
                        cleaner=clean_facebook_post_type,
                        coded_field="facebook_s09e03_post_type_coded",
                        requires_manual_verification=False,
                        analysis_file_key="facebook_s09e03_post_type",
                        fold_strategy=None,
                        include_in_individuals_file=False)
                ],
                raw_field_fold_strategy=FoldStrategies.concatenate)
        ]
    else:
        assert pipeline_name == "TIS-Plus-SMS"
        return [
            CodingPlan(raw_field="rqa_s09e01_raw",
                       time_field="sent_on",
                       run_id_field="rqa_s09e01_run_id",
                       coda_filename="TIS_Plus_rqa_s09e01.json",
                       icr_filename="rqa_s09e01.csv",
                       coding_configurations=[
                           CodingConfiguration(
                               coding_mode=CodingModes.MULTIPLE,
                               code_scheme=CodeSchemes.RQA_S09E01,
                               coded_field="rqa_s09e01_coded",
                               analysis_file_key="rqa_s09e01",
                               fold_strategy=lambda x, y: FoldStrategies.
                               list_of_labels(CodeSchemes.RQA_S09E01, x, y))
                       ],
                       ws_code=CodeSchemes.WS_CORRECT_DATASET.
                       get_code_with_match_value("s09e01"),
                       raw_field_fold_strategy=FoldStrategies.concatenate),
            CodingPlan(raw_field="rqa_s09e02_raw",
                       time_field="sent_on",
                       run_id_field="rqa_s09e02_run_id",
                       coda_filename="TIS_Plus_rqa_s09e02.json",
                       icr_filename="rqa_s09e02.csv",
                       coding_configurations=[
                           CodingConfiguration(
                               coding_mode=CodingModes.MULTIPLE,
                               code_scheme=CodeSchemes.RQA_S09E02,
                               coded_field="rqa_s09e02_coded",
                               analysis_file_key="rqa_s09e02",
                               fold_strategy=lambda x, y: FoldStrategies.
                               list_of_labels(CodeSchemes.RQA_S09E02, x, y))
                       ],
                       ws_code=CodeSchemes.WS_CORRECT_DATASET.
                       get_code_with_match_value("s09e02"),
                       raw_field_fold_strategy=FoldStrategies.concatenate),
            CodingPlan(raw_field="rqa_s09e03_raw",
                       time_field="sent_on",
                       run_id_field="rqa_s09e03_run_id",
                       coda_filename="TIS_Plus_rqa_s09e03.json",
                       icr_filename="rqa_s09e03.csv",
                       coding_configurations=[
                           CodingConfiguration(
                               coding_mode=CodingModes.MULTIPLE,
                               code_scheme=CodeSchemes.RQA_S09E03,
                               coded_field="rqa_s09e03_coded",
                               analysis_file_key="rqa_s09e03",
                               fold_strategy=lambda x, y: FoldStrategies.
                               list_of_labels(CodeSchemes.RQA_S09E03, x, y))
                       ],
                       ws_code=CodeSchemes.WS_CORRECT_DATASET.
                       get_code_with_match_value("s09e03"),
                       raw_field_fold_strategy=FoldStrategies.concatenate),
            CodingPlan(
                raw_field="rqa_s09e03_break_raw",
                time_field="sent_on",
                run_id_field="rqa_s09e03_break_run_id",
                coda_filename="TIS_Plus_rqa_s09e03_break.json",
                icr_filename="rqa_s09e03_break.csv",
                coding_configurations=[
                    CodingConfiguration(
                        coding_mode=CodingModes.MULTIPLE,
                        code_scheme=CodeSchemes.RQA_S09E03_BREAK,
                        coded_field="rqa_s09e03_break_coded",
                        analysis_file_key="rqa_s09e03_break",
                        fold_strategy=lambda x, y: FoldStrategies.
                        list_of_labels(CodeSchemes.RQA_S09E03_BREAK, x, y))
                ],
                ws_code=CodeSchemes.WS_CORRECT_DATASET.
                get_code_with_match_value("s09e03 break"),
                raw_field_fold_strategy=FoldStrategies.concatenate),
            CodingPlan(raw_field="rqa_s09e04_raw",
                       time_field="sent_on",
                       run_id_field="rqa_s09e04_run_id",
                       coda_filename="TIS_Plus_rqa_s09e04.json",
                       icr_filename="rqa_s09e04.csv",
                       coding_configurations=[
                           CodingConfiguration(
                               coding_mode=CodingModes.MULTIPLE,
                               code_scheme=CodeSchemes.RQA_S09E04,
                               coded_field="rqa_s09e04_coded",
                               analysis_file_key="rqa_s09e04",
                               fold_strategy=lambda x, y: FoldStrategies.
                               list_of_labels(CodeSchemes.RQA_S09E04, x, y))
                       ],
                       ws_code=CodeSchemes.WS_CORRECT_DATASET.
                       get_code_with_match_value("s09e04"),
                       raw_field_fold_strategy=FoldStrategies.concatenate),
            CodingPlan(raw_field="rqa_s09e05_raw",
                       time_field="sent_on",
                       run_id_field="rqa_s09e05_run_id",
                       coda_filename="TIS_Plus_rqa_s09e05.json",
                       icr_filename="rqa_s09e05.csv",
                       coding_configurations=[
                           CodingConfiguration(
                               coding_mode=CodingModes.MULTIPLE,
                               code_scheme=CodeSchemes.RQA_S09E05,
                               coded_field="rqa_s09e05_coded",
                               analysis_file_key="rqa_s09e05",
                               fold_strategy=lambda x, y: FoldStrategies.
                               list_of_labels(CodeSchemes.RQA_S09E05, x, y))
                       ],
                       ws_code=CodeSchemes.WS_CORRECT_DATASET.
                       get_code_with_match_value("s09e05"),
                       raw_field_fold_strategy=FoldStrategies.concatenate),
            CodingPlan(raw_field="rqa_s09e06_raw",
                       time_field="sent_on",
                       run_id_field="rqa_s09e06_run_id",
                       coda_filename="TIS_Plus_rqa_s09e06.json",
                       icr_filename="rqa_s09e06.csv",
                       coding_configurations=[
                           CodingConfiguration(
                               coding_mode=CodingModes.MULTIPLE,
                               code_scheme=CodeSchemes.RQA_S09E06,
                               coded_field="rqa_s09e06_coded",
                               analysis_file_key="rqa_s09e06",
                               fold_strategy=lambda x, y: FoldStrategies.
                               list_of_labels(CodeSchemes.RQA_S09E06, x, y))
                       ],
                       ws_code=CodeSchemes.WS_CORRECT_DATASET.
                       get_code_with_match_value("s09e06"),
                       raw_field_fold_strategy=FoldStrategies.concatenate),
            CodingPlan(raw_field="rqa_s09e07_raw",
                       time_field="sent_on",
                       run_id_field="rqa_s09e07_run_id",
                       coda_filename="TIS_Plus_rqa_s09e07.json",
                       icr_filename="rqa_s09e07.csv",
                       coding_configurations=[
                           CodingConfiguration(
                               coding_mode=CodingModes.MULTIPLE,
                               code_scheme=CodeSchemes.RQA_S09E07,
                               coded_field="rqa_s09e07_coded",
                               analysis_file_key="rqa_s09e07",
                               fold_strategy=lambda x, y: FoldStrategies.
                               list_of_labels(CodeSchemes.RQA_S09E07, x, y))
                       ],
                       ws_code=CodeSchemes.WS_CORRECT_DATASET.
                       get_code_with_match_value("s09e07"),
                       raw_field_fold_strategy=FoldStrategies.concatenate),
            CodingPlan(raw_field="rqa_s09e08_raw",
                       time_field="sent_on",
                       run_id_field="rqa_s09e08_run_id",
                       coda_filename="TIS_Plus_rqa_s09e08.json",
                       icr_filename="rqa_s09e08.csv",
                       coding_configurations=[
                           CodingConfiguration(
                               coding_mode=CodingModes.MULTIPLE,
                               code_scheme=CodeSchemes.RQA_S09E08,
                               coded_field="rqa_s09e08_coded",
                               analysis_file_key="rqa_s09e08",
                               fold_strategy=lambda x, y: FoldStrategies.
                               list_of_labels(CodeSchemes.RQA_S09E08, x, y))
                       ],
                       ws_code=CodeSchemes.WS_CORRECT_DATASET.
                       get_code_with_match_value("s09e08"),
                       raw_field_fold_strategy=FoldStrategies.concatenate)
        ]
Exemple #10
0
def get_demog_coding_plans(pipeline_name):
    if pipeline_name == "TIS-Plus-Facebook":
        return []
    else:
        assert pipeline_name == "TIS-Plus-SMS"
        return [
            CodingPlan(
                raw_field="operator_raw",
                coding_configurations=[
                    CodingConfiguration(
                        coding_mode=CodingModes.SINGLE,
                        code_scheme=CodeSchemes.SOMALIA_OPERATOR,
                        coded_field="operator_coded",
                        analysis_file_key="operator",
                        fold_strategy=FoldStrategies.assert_label_ids_equal)
                ],
                raw_field_fold_strategy=FoldStrategies.assert_equal),
            CodingPlan(
                raw_field="location_raw",
                time_field="location_time",
                coda_filename="CSAP_location.json",
                coding_configurations=[
                    CodingConfiguration(
                        coding_mode=CodingModes.SINGLE,
                        code_scheme=CodeSchemes.MOGADISHU_SUB_DISTRICT,
                        cleaner=somali.DemographicCleaner.
                        clean_mogadishu_sub_district,
                        coded_field="mogadishu_sub_district_coded",
                        analysis_file_key="mogadishu_sub_district",
                        fold_strategy=FoldStrategies.assert_label_ids_equal),
                    CodingConfiguration(
                        coding_mode=CodingModes.SINGLE,
                        code_scheme=CodeSchemes.SOMALIA_DISTRICT,
                        cleaner=clean_district_if_no_mogadishu_sub_district,
                        coded_field="district_coded",
                        analysis_file_key="district",
                        fold_strategy=FoldStrategies.assert_label_ids_equal),
                    CodingConfiguration(
                        coding_mode=CodingModes.SINGLE,
                        code_scheme=CodeSchemes.SOMALIA_REGION,
                        coded_field="region_coded",
                        analysis_file_key="region",
                        fold_strategy=FoldStrategies.assert_label_ids_equal),
                    CodingConfiguration(
                        coding_mode=CodingModes.SINGLE,
                        code_scheme=CodeSchemes.SOMALIA_STATE,
                        coded_field="state_coded",
                        analysis_file_key="state",
                        fold_strategy=FoldStrategies.assert_label_ids_equal),
                    CodingConfiguration(
                        coding_mode=CodingModes.SINGLE,
                        code_scheme=CodeSchemes.SOMALIA_ZONE,
                        coded_field="zone_coded",
                        analysis_file_key="zone",
                        fold_strategy=FoldStrategies.assert_label_ids_equal)
                ],
                code_imputation_function=code_imputation_functions.
                impute_somalia_location_codes,
                ws_code=CodeSchemes.WS_CORRECT_DATASET.
                get_code_with_match_value("location"),
                raw_field_fold_strategy=FoldStrategies.assert_equal),
            CodingPlan(
                raw_field="gender_raw",
                time_field="gender_time",
                coda_filename="CSAP_gender.json",
                coding_configurations=[
                    CodingConfiguration(
                        coding_mode=CodingModes.SINGLE,
                        code_scheme=CodeSchemes.GENDER,
                        cleaner=somali.DemographicCleaner.clean_gender,
                        coded_field="gender_coded",
                        analysis_file_key="gender",
                        fold_strategy=FoldStrategies.assert_label_ids_equal)
                ],
                ws_code=CodeSchemes.WS_CORRECT_DATASET.
                get_code_with_match_value("gender"),
                raw_field_fold_strategy=FoldStrategies.assert_equal),
            CodingPlan(
                raw_field="age_raw",
                time_field="age_time",
                coda_filename="CSAP_age.json",
                coding_configurations=[
                    CodingConfiguration(
                        coding_mode=CodingModes.SINGLE,
                        code_scheme=CodeSchemes.AGE,
                        cleaner=clean_age_with_range_filter,
                        coded_field="age_coded",
                        analysis_file_key="age",
                        include_in_theme_distribution=False,
                        fold_strategy=FoldStrategies.assert_label_ids_equal),
                    CodingConfiguration(
                        coding_mode=CodingModes.SINGLE,
                        code_scheme=CodeSchemes.AGE_CATEGORY,
                        coded_field="age_category_coded",
                        analysis_file_key="age_category",
                        fold_strategy=FoldStrategies.assert_label_ids_equal)
                ],
                code_imputation_function=code_imputation_functions.
                impute_age_category,
                ws_code=CodeSchemes.WS_CORRECT_DATASET.
                get_code_with_match_value("age"),
                raw_field_fold_strategy=FoldStrategies.assert_equal),
            CodingPlan(
                raw_field="recently_displaced_raw",
                time_field="recently_displaced_time",
                coda_filename="CSAP_recently_displaced.json",
                coding_configurations=[
                    CodingConfiguration(
                        coding_mode=CodingModes.SINGLE,
                        code_scheme=CodeSchemes.RECENTLY_DISPLACED,
                        cleaner=somali.DemographicCleaner.clean_yes_no,
                        coded_field="recently_displaced_coded",
                        analysis_file_key="recently_displaced",
                        fold_strategy=FoldStrategies.assert_label_ids_equal)
                ],
                ws_code=CodeSchemes.WS_CORRECT_DATASET.
                get_code_with_match_value("recently displaced"),
                raw_field_fold_strategy=FoldStrategies.assert_equal),
            CodingPlan(
                raw_field="in_idp_camp_raw",
                time_field="in_idp_camp_time",
                coda_filename="CSAP_in_idp_camp.json",
                coding_configurations=[
                    CodingConfiguration(
                        coding_mode=CodingModes.SINGLE,
                        code_scheme=CodeSchemes.IN_IDP_CAMP,
                        cleaner=somali.DemographicCleaner.clean_yes_no,
                        coded_field="in_idp_camp_coded",
                        analysis_file_key="in_idp_camp",
                        fold_strategy=FoldStrategies.assert_label_ids_equal)
                ],
                ws_code=CodeSchemes.WS_CORRECT_DATASET.
                get_code_with_match_value("in idp camp"),
                raw_field_fold_strategy=FoldStrategies.assert_equal)
        ]
Exemple #11
0
        return somali.DemographicCleaner.clean_somalia_district(text)
    else:
        return Codes.NOT_CODED


S01_RQA_CODING_PLAN = [
        CodingPlan(raw_field="diagnostic_s01e01_raw",
                   time_field="sent_on",
                   run_id_field="diagnostic_s01e01_run_id",
                   coda_filename="COVID19_SOM_s01e01.json",
                   icr_filename="diagnostic_s01e01.csv",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.MULTIPLE,
                           code_scheme=CodeSchemes.DIAGNOSTIC_S01E01,
                           coded_field="diagnostic_s01e01_coded",
                           analysis_file_key="diagnostic_s01e01",
                           fold_strategy=lambda x, y: FoldStrategies.list_of_labels(CodeSchemes.DIAGNOSTIC_S01E01, x, y)
                       )
                   ],
                   ws_code=CodeSchemes.WS_CORRECT_DATASET_SCHEME.get_code_with_match_value("covid19 som s01e01"),
                   raw_field_fold_strategy=FoldStrategies.concatenate),

        CodingPlan(raw_field="diagnostic_s01e02_raw",
                   time_field="sent_on",
                   run_id_field="diagnostic_s01e02_run_id",
                   coda_filename="COVID19_SOM_s01e02.json",
                   icr_filename="diagnostic_s01e02.csv",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.MULTIPLE,
def get_rqa_coding_plans(pipeline_name):
    return [
        CodingPlan(raw_field="rqa_s01e01_raw",
                   time_field="sent_on",
                   run_id_field="rqa_s01e01_run_id",
                   coda_filename="UNDP_Kenya_s01e01.json",
                   icr_filename="s01e01.csv",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.MULTIPLE,
                           code_scheme=CodeSchemes.S01E01,
                           coded_field="rqa_s01e01_coded",
                           analysis_file_key="rqa_s01e01",
                           fold_strategy=lambda x, y: FoldStrategies.list_of_labels(CodeSchemes.S01E01, x, y)
                       )
                   ],
                   ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value("UNDP-Kenya s01e01"),
                   raw_field_fold_strategy=FoldStrategies.concatenate),

        CodingPlan(raw_field="rqa_s01e02_raw",
                   time_field="sent_on",
                   run_id_field="rqa_s01e02_run_id",
                   coda_filename="UNDP_Kenya_s01e02.json",
                   icr_filename="s01e02.csv",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.MULTIPLE,
                           code_scheme=CodeSchemes.S01E02,
                           coded_field="rqa_s01e02_coded",
                           analysis_file_key="rqa_s01e02",
                           fold_strategy=lambda x, y: FoldStrategies.list_of_labels(CodeSchemes.S01E02, x, y)
                       )
                   ],
                   ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value("UNDP-Kenya s01e02"),
                   raw_field_fold_strategy=FoldStrategies.concatenate),

        CodingPlan(raw_field="rqa_s01e03_raw",
                   time_field="sent_on",
                   run_id_field="rqa_s01e03_run_id",
                   coda_filename="UNDP_Kenya_s01e03.json",
                   icr_filename="s01e03.csv",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.MULTIPLE,
                           code_scheme=CodeSchemes.S01E03,
                           coded_field="rqa_s01e03_coded",
                           analysis_file_key="rqa_s01e03",
                           fold_strategy=lambda x, y: FoldStrategies.list_of_labels(CodeSchemes.S01E03, x, y)
                       )
                   ],
                   ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value("UNDP-Kenya s01e03"),
                   raw_field_fold_strategy=FoldStrategies.concatenate),

        CodingPlan(raw_field="rqa_s01e04_raw",
                   time_field="sent_on",
                   run_id_field="rqa_s01e04_run_id",
                   coda_filename="UNDP_Kenya_s01e04.json",
                   icr_filename="s01e04.csv",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.MULTIPLE,
                           code_scheme=CodeSchemes.S01E04,
                           coded_field="rqa_s01e04_coded",
                           analysis_file_key="rqa_s01e04",
                           fold_strategy=lambda x, y: FoldStrategies.list_of_labels(CodeSchemes.S01E04, x, y)
                       )
                   ],
                   ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value("UNDP-Kenya s01e04"),
                   raw_field_fold_strategy=FoldStrategies.concatenate),

        CodingPlan(raw_field="rqa_s01e05_raw",
                   time_field="sent_on",
                   run_id_field="rqa_s01e05_run_id",
                   coda_filename="UNDP_Kenya_s01e05.json",
                   icr_filename="s01e05.csv",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.MULTIPLE,
                           code_scheme=CodeSchemes.S01E05,
                           coded_field="rqa_s01e05_coded",
                           analysis_file_key="rqa_s01e05",
                           fold_strategy=lambda x, y: FoldStrategies.list_of_labels(CodeSchemes.S01E05, x, y)
                       )
                   ],
                   ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value("UNDP-Kenya s01e05"),
                   raw_field_fold_strategy=FoldStrategies.concatenate),

        CodingPlan(raw_field="rqa_s01e06_raw",
                   time_field="sent_on",
                   run_id_field="rqa_s01e06_run_id",
                   coda_filename="UNDP_Kenya_s01e06.json",
                   icr_filename="s01e06.csv",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.MULTIPLE,
                           code_scheme=CodeSchemes.S01E06,
                           coded_field="rqa_s01e06_coded",
                           analysis_file_key="rqa_s01e06",
                           fold_strategy=lambda x, y: FoldStrategies.list_of_labels(CodeSchemes.S01E06, x, y)
                       )
                   ],
                   ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value("UNDP-Kenya s01e06"),
                   raw_field_fold_strategy=FoldStrategies.concatenate),

        CodingPlan(raw_field="rqa_s01e07_raw",
                   time_field="sent_on",
                   run_id_field="rqa_s01e07_run_id",
                   coda_filename="UNDP_Kenya_s01e07.json",
                   icr_filename="s01e07.csv",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.MULTIPLE,
                           code_scheme=CodeSchemes.S01E07,
                           coded_field="rqa_s01e07_coded",
                           analysis_file_key="rqa_s01e07",
                           fold_strategy=lambda x, y: FoldStrategies.list_of_labels(CodeSchemes.S01E07, x, y)
                       )
                   ],
                   ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value("UNDP-Kenya s01e07"),
                   raw_field_fold_strategy=FoldStrategies.concatenate),

        CodingPlan(raw_field="rqa_s01e08_raw",
                   time_field="sent_on",
                   run_id_field="rqa_s01e08_run_id",
                   coda_filename="UNDP_Kenya_s01e08.json",
                   icr_filename="s01e08.csv",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.MULTIPLE,
                           code_scheme=CodeSchemes.S01E08,
                           coded_field="rqa_s01e08_coded",
                           analysis_file_key="rqa_s01e08",
                           fold_strategy=lambda x, y: FoldStrategies.list_of_labels(CodeSchemes.S01E08, x, y)
                       )
                   ],
                   ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value("UNDP-Kenya s01e08"),
                   raw_field_fold_strategy=FoldStrategies.concatenate),

        CodingPlan(raw_field="s01_close_out_raw",
                   time_field="sent_on",
                   run_id_field="s01_close_out_run_id",
                   coda_filename="UNDP_Kenya_s01_close_out.json",
                   icr_filename="s01_close_out.csv",
                   coding_configurations=[
                       CodingConfiguration(
                           coding_mode=CodingModes.MULTIPLE,
                           code_scheme=CodeSchemes.S01_CLOSE_OUT,
                           coded_field="s01_close_out_coded",
                           analysis_file_key="s01_close_out",
                           fold_strategy=lambda x, y: FoldStrategies.list_of_labels(CodeSchemes.S01_CLOSE_OUT, x, y)
                       )
                   ],
                   ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value("UNDP-Kenya s01 close out"),
                   raw_field_fold_strategy=FoldStrategies.concatenate)
    ]
def get_rqa_coding_plans(pipeline_name):
    return [
        CodingPlan(
            raw_field="rqa_s01_pilot_raw",
            time_field="sent_on",
            run_id_field="rqa_s01_pilot_run_id",
            coda_filename="COVID19_s01e01.json",
            icr_filename="s01_pilot.csv",
            coding_configurations=[
                CodingConfiguration(
                    coding_mode=CodingModes.MULTIPLE,
                    code_scheme=CodeSchemes.S01_PILOT,
                    coded_field="rqa_s01_pilot_coded",
                    analysis_file_key="rqa_s01_pilot_",
                    fold_strategy=lambda x, y: FoldStrategies.list_of_labels(
                        CodeSchemes.S01_PILOT, x, y))
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "COVID19 s01e01"),
            raw_field_fold_strategy=FoldStrategies.concatenate),
        CodingPlan(
            raw_field="rqa_s01e01_raw",
            time_field="sent_on",
            run_id_field="rqa_s01e01_run_id",
            coda_filename="COVID19_KE_Urban_s01e01.json",
            icr_filename="s01e01.csv",
            coding_configurations=[
                CodingConfiguration(coding_mode=CodingModes.MULTIPLE,
                                    code_scheme=CodeSchemes.S01E01,
                                    coded_field="rqa_s01e01_coded",
                                    analysis_file_key="rqa_s01e01_",
                                    fold_strategy=lambda x, y: FoldStrategies.
                                    list_of_labels(CodeSchemes.S01E01, x, y))
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "COVID19-KE-Urban s01e01"),
            raw_field_fold_strategy=FoldStrategies.concatenate),
        CodingPlan(
            raw_field="rqa_s01e02_raw",
            time_field="sent_on",
            run_id_field="rqa_s01e02_run_id",
            coda_filename="COVID19_KE_Urban_s01e02.json",
            icr_filename="s01e02.csv",
            coding_configurations=[
                CodingConfiguration(coding_mode=CodingModes.MULTIPLE,
                                    code_scheme=CodeSchemes.S01E02,
                                    coded_field="rqa_s01e02_coded",
                                    analysis_file_key="rqa_s01e02_",
                                    fold_strategy=lambda x, y: FoldStrategies.
                                    list_of_labels(CodeSchemes.S01E02, x, y))
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "COVID19-KE-Urban s01e02"),
            raw_field_fold_strategy=FoldStrategies.concatenate),
        CodingPlan(
            raw_field="rqa_s01e03_raw",
            time_field="sent_on",
            run_id_field="rqa_s01e03_run_id",
            coda_filename="COVID19_KE_Urban_s01e03.json",
            icr_filename="s01e03.csv",
            coding_configurations=[
                CodingConfiguration(coding_mode=CodingModes.MULTIPLE,
                                    code_scheme=CodeSchemes.S01E03,
                                    coded_field="rqa_s01e03_coded",
                                    analysis_file_key="rqa_s01e03_",
                                    fold_strategy=lambda x, y: FoldStrategies.
                                    list_of_labels(CodeSchemes.S01E03, x, y))
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "COVID19-KE-Urban s01e03"),
            raw_field_fold_strategy=FoldStrategies.concatenate),
        CodingPlan(
            raw_field="rqa_s01e04_raw",
            time_field="sent_on",
            run_id_field="rqa_s01e04_run_id",
            coda_filename="COVID19_KE_Urban_s01e04.json",
            icr_filename="s01e04.csv",
            coding_configurations=[
                CodingConfiguration(coding_mode=CodingModes.MULTIPLE,
                                    code_scheme=CodeSchemes.S01E04,
                                    coded_field="rqa_s01e04_coded",
                                    analysis_file_key="rqa_s01e04_",
                                    fold_strategy=lambda x, y: FoldStrategies.
                                    list_of_labels(CodeSchemes.S01E04, x, y))
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "COVID19-KE-Urban s01e04"),
            raw_field_fold_strategy=FoldStrategies.concatenate),
        CodingPlan(
            raw_field="rqa_s01e05_raw",
            time_field="sent_on",
            run_id_field="rqa_s01e05_run_id",
            coda_filename="COVID19_KE_Urban_s01e05.json",
            icr_filename="s01e05.csv",
            coding_configurations=[
                CodingConfiguration(coding_mode=CodingModes.MULTIPLE,
                                    code_scheme=CodeSchemes.S01E05,
                                    coded_field="rqa_s01e05_coded",
                                    analysis_file_key="rqa_s01e05_",
                                    fold_strategy=lambda x, y: FoldStrategies.
                                    list_of_labels(CodeSchemes.S01E05, x, y))
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "COVID19-KE-Urban s01e05"),
            raw_field_fold_strategy=FoldStrategies.concatenate),
        CodingPlan(
            raw_field="rqa_s01e06_raw",
            time_field="sent_on",
            run_id_field="rqa_s01e06_run_id",
            coda_filename="COVID19_KE_Urban_s01e06.json",
            icr_filename="s01e06.csv",
            coding_configurations=[
                CodingConfiguration(coding_mode=CodingModes.MULTIPLE,
                                    code_scheme=CodeSchemes.S01E06,
                                    coded_field="rqa_s01e06_coded",
                                    analysis_file_key="rqa_s01e06_",
                                    fold_strategy=lambda x, y: FoldStrategies.
                                    list_of_labels(CodeSchemes.S01E06, x, y))
            ],
            ws_code=CodeSchemes.WS_CORRECT_DATASET.get_code_with_match_value(
                "COVID19-KE-Urban s01e06"),
            raw_field_fold_strategy=FoldStrategies.concatenate)
    ]