From f3dc5fc33cf965ef3aee9df65354f6c0da5f1bcf Mon Sep 17 00:00:00 2001 From: sujan Date: Tue, 3 Sep 2024 13:01:51 +0545 Subject: [PATCH] feat: updated xls form to include building_exists condition --- osm_fieldwork/update_form.py | 15 ++++++++++++++- .../xlsforms/fmtm/mandatory_fields.xls | Bin 18432 -> 18432 bytes 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/osm_fieldwork/update_form.py b/osm_fieldwork/update_form.py index 43ecaee2..57815652 100644 --- a/osm_fieldwork/update_form.py +++ b/osm_fieldwork/update_form.py @@ -29,9 +29,22 @@ def merge_sheets(mandatory_df, custom_df, digitisation_df): mandatory_df_filtered = mandatory_df[~mandatory_df["name"].isin(common_fields)] digitisation_df_filtered = digitisation_df[~digitisation_df["name"].isin(common_fields)] + group_row = pd.DataFrame({ + "type": ["begin group"], + "name": ["survey_questions"], + "label": ["Survey Form"], + "relevant": ["${building_exists} = 'yes'"] # Add the relevant condition to display this group only if "Yes" is selected + }) + + end_group_row = pd.DataFrame({ + "type": ["end group"], + "name": ["end_survey_questions"], + "label": ["End Survey Form"] + }) + # Concatenate: mandatory fields at the top, custom common fields, remaining custom fields, and finally append form fields merged_df = pd.concat( - [custom_common_df, mandatory_df_filtered, custom_non_common_df, digitisation_df_filtered], ignore_index=True + [custom_common_df, mandatory_df_filtered, group_row, custom_non_common_df, digitisation_df_filtered, end_group_row], ignore_index=True ) return merged_df diff --git a/osm_fieldwork/xlsforms/fmtm/mandatory_fields.xls b/osm_fieldwork/xlsforms/fmtm/mandatory_fields.xls index 5a9154e4af1bad7ee2c308e75d6475fcff3140fc..a8545c21bbc045a546b295d1c34ae41de44a83a2 100644 GIT binary patch delta 1421 zcmZXUKWr0M9LK-!&aoXQitW(Egvj+v2r(%Utt*m{rcSX^genjUphyHzqr*OuYtuWD zJLgYBL>45Z4vqA-GF7S=;0D?oSUNDUR$iEpSSm4e=;);=62E6V_l)Y3@80M4e((4H zZf~FM?Xzb?nVA9y{i1NI>l^0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