From a648c2d434929fa14f37683f177c2767848f6127 Mon Sep 17 00:00:00 2001 From: Joe Heffer Date: Thu, 19 Mar 2026 15:07:23 +0000 Subject: [PATCH 1/3] fix(survey-config): correct wording for E3/E4 sublabels across all configs Fix double space and update phrasing from "in the use of" to "on the use of" and "in service development/research" to "to support service development/research" for E3 and E4 sublabels in all seven survey config files. Co-Authored-By: Claude Sonnet 4.6 --- data/survey_config/sort_only_config.json | 4 ++-- data/survey_config/sort_only_config_ahp.json | 4 ++-- data/survey_config/sort_only_config_generic.json | 4 ++-- data/survey_config/sort_only_config_midwives.json | 4 ++-- data/survey_config/sort_only_config_nmahps.json | 4 ++-- data/survey_config/sort_only_config_nurses.json | 4 ++-- data/survey_config/sort_only_config_nurses_midwives.json | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/data/survey_config/sort_only_config.json b/data/survey_config/sort_only_config.json index a874f2bc..e749498e 100644 --- a/data/survey_config/sort_only_config.json +++ b/data/survey_config/sort_only_config.json @@ -173,8 +173,8 @@ "sublabels": [ "E1. Our organisation provides training for nurses to enable them to practise effectively in a digitally enabled environment", "E2. Our organisation trains nurses to use and interpret data to make improvements to care (using audit, service evaluation or research)", - "E3. Our organisation has digital nurse leaders in place who can provide advice and guidance in the use of digital technology in service development", - "E4. Our organisation has digital nurse leaders in place who can provide advice and guidance in the use of digital technology in research", + "E3. Our organisation has digital nurse leaders in place who can provide advice and guidance on the use of digital technology to support service development", + "E4. Our organisation has digital nurse leaders in place who can provide advice and guidance on the use of digital technology to support research", "E5. Our organisation has the infrastructure to support visualisation of data using business intelligence tools", "E6. Our organisation has the internal structures that facilitate, support and enable nurse-led digital innovation", "E7. Our organisation has effective partnerships with technology suppliers to support digital developments and innovation that meet the needs of nurses", diff --git a/data/survey_config/sort_only_config_ahp.json b/data/survey_config/sort_only_config_ahp.json index aa041615..4cc9abcc 100644 --- a/data/survey_config/sort_only_config_ahp.json +++ b/data/survey_config/sort_only_config_ahp.json @@ -173,8 +173,8 @@ "sublabels": [ "E1. Our organisation provides training for AHPs to enable them to practise effectively in a digitally enabled environment", "E2. Our organisation trains AHPs to use and interpret data to make improvements to care (using audit, service evaluation or research)", - "E3. Our organisation has digital AHP leaders in place who can provide advice and guidance in the use of digital technology in service development", - "E4. Our organisation has digital AHP leaders in place who can provide advice and guidance in the use of digital technology in research", + "E3. Our organisation has digital AHP leaders in place who can provide advice and guidance on the use of digital technology to support service development", + "E4. Our organisation has digital AHP leaders in place who can provide advice and guidance on the use of digital technology to support research", "E5. Our organisation has the infrastructure to support visualisation of data using business intelligence tools", "E6. Our organisation has the internal structures that facilitate, support and enable AHP-led digital innovation", "E7. Our organisation has effective partnerships with technology suppliers to support digital developments and innovation that meet the needs of AHPs", diff --git a/data/survey_config/sort_only_config_generic.json b/data/survey_config/sort_only_config_generic.json index 17709ad7..5c757e2b 100644 --- a/data/survey_config/sort_only_config_generic.json +++ b/data/survey_config/sort_only_config_generic.json @@ -173,8 +173,8 @@ "sublabels": [ "E1. Our organisation provides training to practise effectively in a digitally enabled environment", "E2. Our organisation trains staff to use and interpret data to make improvements to care (using audit, service evaluation or research)", - "E3. Our organisation has digital leaders in place who can provide advice and guidance in the use of digital technology in service development", - "E4. Our organisation has digital leaders in place who can provide advice and guidance in the use of digital technology in research", + "E3. Our organisation has digital leaders in place who can provide advice and guidance on the use of digital technology to support service development", + "E4. Our organisation has digital leaders in place who can provide advice and guidance on the use of digital technology to support research", "E5. Our organisation has the infrastructure to support visualisation of data using business intelligence tools", "E6. Our organisation has the internal structures that facilitate, support and enable staff-led digital innovation", "E7. Our organisation has effective partnerships with technology suppliers to support digital developments and innovation that meet the needs of staff", diff --git a/data/survey_config/sort_only_config_midwives.json b/data/survey_config/sort_only_config_midwives.json index 9aa2a8f1..9a88acf3 100644 --- a/data/survey_config/sort_only_config_midwives.json +++ b/data/survey_config/sort_only_config_midwives.json @@ -173,8 +173,8 @@ "sublabels": [ "E1. Our organisation provides training for midwives to enable them to practise effectively in a digitally enabled environment", "E2. Our organisation trains midwives to use and interpret data to make improvements to care (using audit, service evaluation or research)", - "E3. Our organisation has digital midwifery leaders in place who can provide advice and guidance in the use of digital technology in service development", - "E4. Our organisation has digital midwifery leaders in place who can provide advice and guidance in the use of digital technology in research", + "E3. Our organisation has digital midwifery leaders in place who can provide advice and guidance on the use of digital technology to support service development", + "E4. Our organisation has digital midwifery leaders in place who can provide advice and guidance on the use of digital technology to support research", "E5. Our organisation has the infrastructure to support visualisation of data using business intelligence tools", "E6. Our organisation has the internal structures that facilitate, support and enable midwifery-led digital innovation", "E7. Our organisation has effective partnerships with technology suppliers to support digital developments and innovation that meet the needs of midwives", diff --git a/data/survey_config/sort_only_config_nmahps.json b/data/survey_config/sort_only_config_nmahps.json index 8721f52c..5a5134b1 100644 --- a/data/survey_config/sort_only_config_nmahps.json +++ b/data/survey_config/sort_only_config_nmahps.json @@ -173,8 +173,8 @@ "sublabels": [ "E1. Our organisation provides training for NMAHPs to enable them to practise effectively in a digitally enabled environment", "E2. Our organisation trains NMAHPs to use and interpret data to make improvements to care (using audit, service evaluation or research)", - "E3. Our organisation has digital NMAHP leaders in place who can provide advice and guidance in the use of digital technology in service development", - "E4. Our organisation has digital NMAHP leaders in place who can provide advice and guidance in the use of digital technology in research", + "E3. Our organisation has digital NMAHP leaders in place who can provide advice and guidance on the use of digital technology to support service development", + "E4. Our organisation has digital NMAHP leaders in place who can provide advice and guidance on the use of digital technology to support research", "E5. Our organisation has the infrastructure to support visualisation of data using business intelligence tools", "E6. Our organisation has the internal structures that facilitate, support and enable NMAHP-led digital innovation", "E7. Our organisation has effective partnerships with technology suppliers to support digital developments and innovation that meet the needs of NMAHPs", diff --git a/data/survey_config/sort_only_config_nurses.json b/data/survey_config/sort_only_config_nurses.json index d951dba7..d44f39b0 100644 --- a/data/survey_config/sort_only_config_nurses.json +++ b/data/survey_config/sort_only_config_nurses.json @@ -173,8 +173,8 @@ "sublabels": [ "E1. Our organisation provides training for nurses to enable them to practise effectively in a digitally enabled environment", "E2. Our organisation trains nurses to use and interpret data to make improvements to care (using audit, service evaluation or research)", - "E3. Our organisation has digital nurse leaders in place who can provide advice and guidance in the use of digital technology in service development", - "E4. Our organisation has digital nurse leaders in place who can provide advice and guidance in the use of digital technology in research", + "E3. Our organisation has digital nurse leaders in place who can provide advice and guidance on the use of digital technology to support service development", + "E4. Our organisation has digital nurse leaders in place who can provide advice and guidance on the use of digital technology to support research", "E5. Our organisation has the infrastructure to support visualisation of data using business intelligence tools", "E6. Our organisation has the internal structures that facilitate, support and enable nurse-led digital innovation", "E7. Our organisation has effective partnerships with technology suppliers to support digital developments and innovation that meet the needs of nurses", diff --git a/data/survey_config/sort_only_config_nurses_midwives.json b/data/survey_config/sort_only_config_nurses_midwives.json index c7315ff5..3edde669 100644 --- a/data/survey_config/sort_only_config_nurses_midwives.json +++ b/data/survey_config/sort_only_config_nurses_midwives.json @@ -173,8 +173,8 @@ "sublabels": [ "E1. Our organisation provides training for nurses and midwives to enable them to practise effectively in a digitally enabled environment", "E2. Our organisation trains nurses and midwives to use and interpret data to make improvements to care (using audit, service evaluation or research)", - "E3. Our organisation has digital nurse and midwife leaders in place who can provide advice and guidance in the use of digital technology in service development", - "E4. Our organisation has digital nurse and midwife leaders in place who can provide advice and guidance in the use of digital technology in research", + "E3. Our organisation has digital nurse and midwife leaders in place who can provide advice and guidance on the use of digital technology to support service development", + "E4. Our organisation has digital nurse and midwife leaders in place who can provide advice and guidance on the use of digital technology to support research", "E5. Our organisation has the infrastructure to support visualisation of data using business intelligence tools", "E6. Our organisation has the internal structures that facilitate, support and enable nurse and midwife-led digital innovation", "E7. Our organisation has effective partnerships with technology suppliers to support digital developments and innovation that meet the needs of nurses and midwives", From 8f8a40c8ca75a9d9ccc550b1ce40cf3313c526af Mon Sep 17 00:00:00 2001 From: Joe Heffer Date: Thu, 19 Mar 2026 15:17:02 +0000 Subject: [PATCH 2/3] test(survey-config): add regression tests for E3/E4 sublabel wording Add TestSurveyConfigSublabels to guard against double spaces and incorrect phrasing in E3/E4 sublabels across all sort_only config files. Co-Authored-By: Claude Sonnet 4.6 --- survey/tests/test_models.py | 54 +++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/survey/tests/test_models.py b/survey/tests/test_models.py index 064065fa..4cb220f4 100644 --- a/survey/tests/test_models.py +++ b/survey/tests/test_models.py @@ -1,3 +1,7 @@ +import json +from pathlib import Path + +from django.conf import settings from django.db import IntegrityError from django.test import TestCase @@ -64,3 +68,53 @@ def test_generic_profession_configuration(self): # Verify fields are accessible self.assertIsNotNone(survey.fields) self.assertTrue(survey.fields) + + +class TestSurveyConfigSublabels(TestCase): + """ + Regression tests for sublabel wording in survey config JSON files. + Guards against double spaces and incorrect phrasing in E3/E4 sublabels. + """ + + def _get_all_sublabels(self, config: dict) -> list[str]: + sublabels = [] + for section in config.get("sections", []): + for field in section.get("fields", []): + sublabels.extend(field.get("sublabels", [])) + return sublabels + + def _load_config(self, filename: str) -> dict: + path = settings.SURVEY_TEMPLATE_DIR / filename + with path.open() as f: + return json.load(f) + + def test_no_double_spaces_in_e3_e4_sublabels(self): + """E3 and E4 sublabels must not contain double spaces.""" + for filename in settings.SURVEY_TEMPLATES.values(): + config = self._load_config(filename) + sublabels = self._get_all_sublabels(config) + for label_prefix in ("E3.", "E4."): + text = next((s for s in sublabels if s.startswith(label_prefix)), None) + if text is None: + continue + self.assertNotIn( + " ", + text, + msg=f"Double space found in {label_prefix} sublabel in {filename!r}: {text!r}", + ) + + def test_e3_e4_sublabel_phrasing(self): + """E3 and E4 sublabels must use 'on the use of … to support' phrasing.""" + for filename in settings.SURVEY_TEMPLATES.values(): + config = self._load_config(filename) + sublabels = self._get_all_sublabels(config) + e3 = next((s for s in sublabels if s.startswith("E3.")), None) + e4 = next((s for s in sublabels if s.startswith("E4.")), None) + for label, text in [("E3", e3), ("E4", e4)]: + if text is None: + continue + self.assertIn( + "on the use of digital technology to support", + text, + msg=f"{label} sublabel in {filename!r} has unexpected phrasing: {text!r}", + ) From 04e4d57c42a2c92b70c37d54bcf221ecec58cd5f Mon Sep 17 00:00:00 2001 From: Joe Heffer Date: Thu, 19 Mar 2026 15:54:01 +0000 Subject: [PATCH 3/3] style: apply linting fix --- survey/tests/test_models.py | 1 - 1 file changed, 1 deletion(-) diff --git a/survey/tests/test_models.py b/survey/tests/test_models.py index 4cb220f4..a9520f0d 100644 --- a/survey/tests/test_models.py +++ b/survey/tests/test_models.py @@ -1,5 +1,4 @@ import json -from pathlib import Path from django.conf import settings from django.db import IntegrityError