diff --git a/fucked_data.json b/fucked_data.json new file mode 100644 index 0000000..91c4f5c --- /dev/null +++ b/fucked_data.json @@ -0,0 +1,232 @@ +{ + 'columnmeta_is_stigmatized': 'false', + 'columnmeta_name': 'cih_care', + 'description': 'cih_care from form weekly_covid_infection_history and visit Acute week 2 from pediatric cohort answerdata.tsv.', + 'columnmeta_min': '', + 'HPDS_PATH': '\\phs003461\\recover_pediatric\\acute_week_2\\weekly_covid_infection_history\\cih_care\\', + 'derived_group_id': None, + 'columnmeta_hpds_path': '\\phs003461\\recover_pediatric\\acute_week_2\\weekly_covid_infection_history\\cih_care\\', + 'columnmeta_var_id': 'weekly_covid_infection_history', + 'columnmeta_var_group_description': None, + 'derived_var_description': 'cih_care from form weekly_covid_infection_history and visit Acute week 2 from pediatric cohort answerdata.tsv.', + 'derived_variable_level_data': '{}', + 'data_hierarchy': '', + 'derived_group_description': None, + 'columnmeta_max': '', + 'columnmeta_description': 'cih_care from form weekly_covid_infection_history and visit Acute week 2 from pediatric cohort answerdata.tsv.', + 'derived_study_id': 'phs003461', + 'hashed_var_id': '9ca7dd0ad806dbad3bf00ce358abc174184f005ab40b06b8b3770a5cc8d15f85', + 'columnmeta_data_type': 'categorical', + 'derived_var_id': 'weekly_covid_infection_history', + 'columnmeta_study_id': 'phs003461', + 'is_stigmatized': 'false', + 'derived_var_name': 'cih_care', + 'derived_study_abv_name': 'RECOVER_Pediatric', + 'derived_study_description': 'Researching COVID to Enhance Recovery (RECOVER): Post Acute Sequelae of SARS-CoV-2 (PASC) Pediatric Cohort Study', + 'columnmeta_var_group_id': None, + 'derived_group_name': None, + 'columnmeta_HPDS_PATH': '\\phs003461\\recover_pediatric\\acute_week_2\\weekly_covid_infection_history\\cih_care\\' +} +{ + 'columnmeta_is_stigmatized': 'false', + 'columnmeta_name': 'hcn_adhdcause', + 'description': 'hcn_adhdcause from form special_health_care_needs_screener and visit 24_month_arm_5 from pediatric cohort answerdata.tsv.', + 'columnmeta_min': '', + 'HPDS_PATH': '\\phs003461\\recover_pediatric\\24_month_arm_5\\special_health_care_needs_screener\\hcn_adhdcause\\', + 'derived_group_id': None, + 'columnmeta_hpds_path': '\\phs003461\\recover_pediatric\\24_month_arm_5\\special_health_care_needs_screener\\hcn_adhdcause\\', + 'columnmeta_var_id': 'special_health_care_needs_screener', + 'columnmeta_var_group_description': None, + 'derived_var_description': 'hcn_adhdcause from form special_health_care_needs_screener and visit 24_month_arm_5 from pediatric cohort answerdata.tsv.', + 'derived_variable_level_data': '{}', + 'data_hierarchy': '', + 'derived_group_description': None, + 'columnmeta_max': '', + 'columnmeta_description': 'hcn_adhdcause from form special_health_care_needs_screener and visit 24_month_arm_5 from pediatric cohort answerdata.tsv.', + 'derived_study_id': 'phs003461', + 'hashed_var_id': 'e2319b340b23c63240d82572e93d71820dad9cfdcb0f6faadc990e915568fb48', + 'columnmeta_data_type': 'categorical', + 'derived_var_id': 'special_health_care_needs_screener', + 'columnmeta_study_id': 'phs003461', + 'is_stigmatized': 'false', + 'derived_var_name': 'hcn_adhdcause', + 'derived_study_abv_name': 'RECOVER_Pediatric', + 'derived_study_description': 'Researching COVID to Enhance Recovery (RECOVER): Post Acute Sequelae of SARS-CoV-2 (PASC) Pediatric Cohort Study', + 'columnmeta_var_group_id': None, + 'derived_group_name': None, + 'columnmeta_HPDS_PATH': '\\phs003461\\recover_pediatric\\24_month_arm_5\\special_health_care_needs_screener\\hcn_adhdcause\\' +} +{ + 'columnmeta_is_stigmatized': 'false', + 'columnmeta_name': 'miscpots_colldt', + 'description': 'miscpots_colldt from form related_conditions and visit 12month from pediatric congenital cohort answerdata.tsv.', + 'columnmeta_min': '', + 'HPDS_PATH': '\\phs003461\\recover_pediatric_congenital\\12month\\related_conditions\\miscpots_colldt\\', + 'derived_group_id': None, + 'columnmeta_hpds_path': '\\phs003461\\recover_pediatric_congenital\\12month\\related_conditions\\miscpots_colldt\\', + 'columnmeta_var_id': 'related_conditions', + 'columnmeta_var_group_description': None, + 'derived_var_description': 'miscpots_colldt from form related_conditions and visit 12month from pediatric congenital cohort answerdata.tsv.', + 'derived_variable_level_data': '{}', + 'data_hierarchy': '', + 'derived_group_description': None, + 'columnmeta_max': '', + 'columnmeta_description': 'miscpots_colldt from form related_conditions and visit 12month from pediatric congenital cohort answerdata.tsv.', + 'derived_study_id': 'phs003461', + 'hashed_var_id': '646316e761435c1cde7c3678c3e188c20594df8eba7679200cfa8d6dd90fc5f9', + 'columnmeta_data_type': 'categorical', + 'derived_var_id': 'related_conditions', + 'columnmeta_study_id': 'phs003461', + 'is_stigmatized': 'false', + 'derived_var_name': 'miscpots_colldt', + 'derived_study_abv_name': 'RECOVER_Pediatric', + 'derived_study_description': 'Researching COVID to Enhance Recovery (RECOVER): Post Acute Sequelae of SARS-CoV-2 (PASC) Pediatric Cohort Study', + 'columnmeta_var_group_id': None, + 'derived_group_name': None, + 'columnmeta_HPDS_PATH': '\\phs003461\\recover_pediatric_congenital\\12month\\related_conditions\\miscpots_colldt\\' +} +{ + 'columnmeta_is_stigmatized': 'false', + 'columnmeta_name': 'participant_id', + 'description': '', + 'columnmeta_min': '', + 'HPDS_PATH': '\\phs003461\\recover_pediatric\\24_month_arm_5\\spirometry\\participant_id\\', + 'derived_group_id': None, + 'columnmeta_hpds_path': '\\phs003461\\recover_pediatric\\24_month_arm_5\\spirometry\\participant_id\\', + 'columnmeta_var_id': 'spirometry', + 'columnmeta_var_group_description': None, + 'derived_var_description': '', + 'derived_variable_level_data': '{}', + 'data_hierarchy': '', + 'derived_group_description': None, + 'columnmeta_max': '', + 'columnmeta_description': '', + 'derived_study_id': 'phs003461', + 'hashed_var_id': 'b3e1ad429e14a615446a9841ca4a00b287403b3952c2e2841bdc7f76403b76f4', + 'columnmeta_data_type': 'categorical', + 'derived_var_id': 'spirometry', + 'columnmeta_study_id': 'phs003461', + 'is_stigmatized': 'false', + 'derived_var_name': 'participant_id', + 'derived_study_abv_name': 'RECOVER_Pediatric', + 'derived_study_description': 'Researching COVID to Enhance Recovery (RECOVER): Post Acute Sequelae of SARS-CoV-2 (PASC) Pediatric Cohort Study', + 'columnmeta_var_group_id': None, + 'derived_group_name': None, + 'columnmeta_HPDS_PATH': '\\phs003461\\recover_pediatric\\24_month_arm_5\\spirometry\\participant_id\\' +} +{ + 'columnmeta_is_stigmatized': 'false', + 'columnmeta_name': 'participant_id', + 'description': '', + 'columnmeta_min': '', + 'HPDS_PATH': '\\phs003461\\recover_pediatric\\24_month_arm_5\\visit_form\\participant_id\\', + 'derived_group_id': None, + 'columnmeta_hpds_path': '\\phs003461\\recover_pediatric\\24_month_arm_5\\visit_form\\participant_id\\', + 'columnmeta_var_id': 'visit_form', + 'columnmeta_var_group_description': None, + 'derived_var_description': '', + 'derived_variable_level_data': '{}', + 'data_hierarchy': '', + 'derived_group_description': None, + 'columnmeta_max': '', + 'columnmeta_description': '', + 'derived_study_id': 'phs003461', + 'hashed_var_id': '8e6edfdf3985f65e5740348642823b047341c26d67841cb8f41f697c3ef69433', + 'columnmeta_data_type': 'categorical', + 'derived_var_id': 'visit_form', + 'columnmeta_study_id': 'phs003461', + 'is_stigmatized': 'false', + 'derived_var_name': 'participant_id', + 'derived_study_abv_name': 'RECOVER_Pediatric', + 'derived_study_description': 'Researching COVID to Enhance Recovery (RECOVER): Post Acute Sequelae of SARS-CoV-2 (PASC) Pediatric Cohort Study', + 'columnmeta_var_group_id': None, + 'derived_group_name': None, + 'columnmeta_HPDS_PATH': '\\phs003461\\recover_pediatric\\24_month_arm_5\\visit_form\\participant_id\\' +} +{ + 'columnmeta_is_stigmatized': 'false', + 'columnmeta_name': 'participant_id', + 'description': '', + 'columnmeta_min': '', + 'HPDS_PATH': '\\phs003461\\recover_pediatric\\24_month_arm_5\\visits_data\\participant_id\\', + 'derived_group_id': None, + 'columnmeta_hpds_path': '\\phs003461\\recover_pediatric\\24_month_arm_5\\visits_data\\participant_id\\', + 'columnmeta_var_id': 'visits_data', + 'columnmeta_var_group_description': None, + 'derived_var_description': '', + 'derived_variable_level_data': '{}', + 'data_hierarchy': '', + 'derived_group_description': None, + 'columnmeta_max': '', + 'columnmeta_description': '', + 'derived_study_id': 'phs003461', + 'hashed_var_id': '3a8cae20696355deaa3016ff8e05270f9cb3b4856fe7b9a04fc5dcba9ed8f0fa', + 'columnmeta_data_type': 'categorical', + 'derived_var_id': 'visits_data', + 'columnmeta_study_id': 'phs003461', + 'is_stigmatized': 'false', + 'derived_var_name': 'participant_id', + 'derived_study_abv_name': 'RECOVER_Pediatric', + 'derived_study_description': 'Researching COVID to Enhance Recovery (RECOVER): Post Acute Sequelae of SARS-CoV-2 (PASC) Pediatric Cohort Study', + 'columnmeta_var_group_id': None, + 'derived_group_name': None, + 'columnmeta_HPDS_PATH': '\\phs003461\\recover_pediatric\\24_month_arm_5\\visits_data\\participant_id\\' +} +{ + 'columnmeta_is_stigmatized': 'false', + 'columnmeta_name': 'participant_id', + 'description': '', + 'columnmeta_min': '', + 'HPDS_PATH': '\\phs003461\\recover_pediatric\\follow-up_month_6\\research_labs\\participant_id\\', + 'derived_group_id': None, + 'columnmeta_hpds_path': '\\phs003461\\recover_pediatric\\follow-up_month_6\\research_labs\\participant_id\\', + 'columnmeta_var_id': 'research_labs', + 'columnmeta_var_group_description': None, + 'derived_var_description': '', + 'derived_variable_level_data': '{}', + 'data_hierarchy': '', + 'derived_group_description': None, + 'columnmeta_max': '', + 'columnmeta_description': '', + 'derived_study_id': 'phs003461', + 'hashed_var_id': 'f167930b4fb4de087e688b7d4e6ac107859c5d976f64124e9be8d4259900784d', + 'columnmeta_data_type': 'categorical', + 'derived_var_id': 'research_labs', + 'columnmeta_study_id': 'phs003461', + 'is_stigmatized': 'false', + 'derived_var_name': 'participant_id', + 'derived_study_abv_name': 'RECOVER_Pediatric', + 'derived_study_description': 'Researching COVID to Enhance Recovery (RECOVER): Post Acute Sequelae of SARS-CoV-2 (PASC) Pediatric Cohort Study', + 'columnmeta_var_group_id': None, + 'derived_group_name': None, + 'columnmeta_HPDS_PATH': '\\phs003461\\recover_pediatric\\follow-up_month_6\\research_labs\\participant_id\\' +} +{ + 'columnmeta_is_stigmatized': 'true', + 'columnmeta_name': 'participant_id (mhp_fitbit)', + 'description': 'participant_id for visit type mhp_fitbit in pediatric cohort visits.tsv.', + 'columnmeta_min': '', + 'HPDS_PATH': '\\phs003461\\recover_pediatric_caregiver\\mhp_fitbit\\participant_id', + 'derived_group_id': None, + 'columnmeta_hpds_path': '\\phs003461\\recover_pediatric_caregiver\\mhp_fitbit\\participant_id', + 'columnmeta_var_id': 'participant_id', + 'columnmeta_var_group_description': None, + 'derived_var_description': 'participant_id for visit type mhp_fitbit in pediatric cohort visits.tsv.', + 'derived_variable_level_data': '{}', + 'data_hierarchy': '', + 'derived_group_description': None, + 'columnmeta_max': '', + 'columnmeta_description': 'participant_id for visit type mhp_fitbit in pediatric cohort visits.tsv.', + 'derived_study_id': 'phs003461', + 'hashed_var_id': '5132338ece374ab34264f0c08a5a7f49b85fbbc13fef35352e5572e6e4a5a59e', + 'columnmeta_data_type': 'categorical', + 'derived_var_id': 'participant_id', + 'columnmeta_study_id': 'phs003461', + 'is_stigmatized': 'true', + 'derived_var_name': 'participant_id (mhp_fitbit)', + 'derived_study_abv_name': 'RECOVER_Pediatric', + 'derived_study_description': 'Researching COVID to Enhance Recovery (RECOVER): Post Acute Sequelae of SARS-CoV-2 (PASC) Pediatric Cohort Study', + 'columnmeta_var_group_id': None, + 'derived_group_name': None, + 'columnmeta_HPDS_PATH': '\\phs003461\\recover_pediatric_caregiver\\mhp_fitbit\\participant_id' +} \ No newline at end of file diff --git a/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/SearchResultRowMapper.java b/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/SearchResultRowMapper.java index e0ffe8e..f5565a3 100644 --- a/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/SearchResultRowMapper.java +++ b/src/main/java/edu/harvard/dbmi/avillach/dictionary/legacysearch/SearchResultRowMapper.java @@ -44,20 +44,24 @@ private SearchResult mapSearchResults(ResultSet rs) throws SQLException { String description = rs.getString("description") == null || rs.getString("description").isBlank() ? "" : rs.getString("description"); + String parentName = rs.getString("parentName") == null || rs.getString("parentName").isBlank() ? "" : rs.getString("parentName"); + String parentDisplay = + rs.getString("parentDisplay") == null || rs.getString("parentDisplay").isBlank() ? "" : rs.getString("parentDisplay"); + Metadata metadata = new Metadata( rs.getString("stigmatized"), rs.getString("display"), description, - isContinuous ? String.valueOf(jsonBlobParser.parseMin(rs.getString("values"))) : "", rs.getString("conceptPath"), - rs.getString("parentName"), rs.getString("conceptPath"), rs.getString("name"), rs.getString("parentDisplay"), description, // changed - "{}", "", rs.getString("parentName"), isContinuous ? String.valueOf(jsonBlobParser.parseMax(rs.getString("values"))) : "", - description, rs.getString("dataset"), hashedVarId, rs.getString("conceptType"), rs.getString("name"), rs.getString("dataset"), - rs.getString("stigmatized"), rs.getString("display"), rs.getString("studyAcronym"), rs.getString("dsFullName"), - rs.getString("parentName"), rs.getString("parentDisplay"), rs.getString("conceptPath") + isContinuous ? String.valueOf(jsonBlobParser.parseMin(rs.getString("values"))) : "", rs.getString("conceptPath"), parentName, + rs.getString("conceptPath"), rs.getString("name"), parentDisplay, description, // changed + "{}", "", parentName, isContinuous ? String.valueOf(jsonBlobParser.parseMax(rs.getString("values"))) : "", description, + rs.getString("dataset"), hashedVarId, rs.getString("conceptType"), rs.getString("name"), rs.getString("dataset"), + rs.getString("stigmatized"), rs.getString("display"), rs.getString("studyAcronym"), rs.getString("dsFullName"), parentName, + parentDisplay, rs.getString("conceptPath") ); Result result = new Result( metadata, jsonBlobParser.parseValues(rs.getString("values")), rs.getString("dataset"), - rs.getString("parentName") == null || rs.getString("parentName").isBlank() ? "All Variables" : rs.getString("parentName"), - rs.getString("name"), "categorical".equalsIgnoreCase(rs.getString("conceptType")), isContinuous + parentName == null || parentName.isBlank() ? "All Variables" : parentName, rs.getString("name"), + "categorical".equalsIgnoreCase(rs.getString("conceptType")), isContinuous ); return new SearchResult(result);