Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions SORT/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,19 @@ def cast_to_boolean(obj: Any) -> bool:
},
}

# Survey content configuration files
SURVEY_TEMPLATE_DIR = BASE_DIR / "data/survey_config"
SURVEY_TEMPLATES = {
"Nurses": "sort_only_config_nurses.json",
"Midwives": "sort_only_config_midwives.json",
"NMAHPs": "sort_only_config_nmahps.json",
}
DEMOGRAPHY_TEMPLATES = {
"Nurses": "demography_only_config_nurses.json",
"Midwives": "demography_only_config_midwives.json",
"NMAHPs": "demography_only_config_nmahps.json",
}
CONSENT_TEMPLATE = "consent_only_config.json"

# Crispy enables Bootstrap styling on Django forms
# https://django-crispy-forms.readthedocs.io/en/latest/install.html
Expand Down
25 changes: 13 additions & 12 deletions SORT/test/test_case/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ def login_superuser(self):
)

def get(
self,
view_name: str,
expected_status_code: int = HTTPStatus.OK,
login: bool = True,
**kwargs
self,
view_name: str,
expected_status_code: int = HTTPStatus.OK,
login: bool = True,
**kwargs
):
"""
Helper method to make a GET request to one of the views in this app.
Expand All @@ -63,12 +63,12 @@ def get(
return response

def post(
self,
view_name: str,
expected_status_code: int = HTTPStatus.OK,
login: bool = True,
data: dict = None,
**kwargs
self,
view_name: str,
expected_status_code: int = HTTPStatus.OK,
login: bool = True,
data: dict = None,
**kwargs
):
"""
Helper method to make a POST request to one of the views in this app.
Expand All @@ -83,7 +83,8 @@ def post(
if login:
self.login()
response = self.client.post(
django.urls.reverse(view_name, kwargs=kwargs), data=data
path=django.urls.reverse(view_name, kwargs=kwargs),
data=data,
)
self.assertEqual(response.status_code, expected_status_code)
return response
170 changes: 170 additions & 0 deletions data/survey_config/demography_only_config_midwives.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
{
"sections": [
{
"title": "Demographic",
"type": "demographic",
"description": "Please fill in your demographic information",
"fields": [
{
"type": "text",
"label": "What is your age?",
"required": true,
"sublabels": [],
"options": [],
"enforceValueConstraints": false,
"maxNumChar": 500,
"minNumValue": 0,
"maxNumValue": 100,
"textType": "INTEGER_TEXT",
"disabled": false,
"readOnly": true
},
{
"type": "radio",
"label": "What is your gender?",
"description": "",
"required": true,
"sublabels": [],
"options": [
"Male",
"Female",
"Non-binary",
"Prefer not to say"
],
"disabled": false,
"readOnly": true
},
{
"type": "text",
"label": "How long have you been working in your current organisation? (Number of years)",
"required": true,
"sublabels": [],
"options": [],
"enforceValueConstraints": false,
"maxNumChar": 500,
"minNumValue": 0,
"maxNumValue": 100,
"textType": "INTEGER_TEXT",
"disabled": false,
"readOnly": true
},
{
"type": "radio",
"label": "What is your current pay band?",
"required": true,
"sublabels": [],
"options": [
"Band 2",
"Band 3",
"Band 4",
"Band 5",
"Band 6",
"Band 7",
"Band 8a",
"Band 8b",
"Band 8c",
"Band 8d",
"Band 9"
],
"disabled": false,
"readOnly": true
},
{
"type": "radio",
"label": "What is your profession?",
"required": true,
"sublabels": [],
"options": [
"Registered Midwife",
"Community Midwife",
"Hospital Midwife",
"Specialist Midwife",
"Senior Midwife",
"Lead/Manager Midwife",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these options okay? It wasn't clear from the communications with Trixie etc

"Consultant Midwife",
"Research Midwife",
"Maternity Support Worker",
"Midwifery Educator",
"Other"
],
"disabled": false,
"readOnly": true
},
{
"description": "",
"disabled": false,
"enforceValueConstraints": false,
"label": "What is your job title?",
"maxNumChar": 500,
"maxNumValue": 100,
"minNumValue": 0,
"options": [
],
"required": true,
"sublabels": [
],
"textType": "PLAIN_TEXT",
"type": "text",
"readOnly": true
},
{
"type": "radio",
"label": "What is your highest level of qualification?",
"required": true,
"sublabels": [],
"options": [
"No qualification",
"Diploma",
"Degree",
"Masters",
"PhD/Doctorate",
"Other"
],
"disabled": false,
"readOnly": true
},
{
"description": "",
"disabled": false,
"enforceValueConstraints": true,
"label": "How many years have you been qualified?",
"maxNumChar": 500,
"maxNumValue": 100,
"minNumValue": 0,
"options": [],
"required": true,
"sublabels": [],
"textType": "INTEGER_TEXT",
"type": "text",
"readOnly": true
},
{
"type": "radio",
"label": "What is your ethnicity?",
"required": true,
"sublabels": [],
"options": [
"Asian British - Bangladeshi",
"Asian British - Indian",
"Asian British - Pakistani",
"Asian - Chinese",
"Asian - other",
"Black British - African",
"Black British - Caribbean",
"Black British - other",
"Mixed - Black African and White",
"Mixed - Black Asian and White",
"Mixed - Caribbean and White",
"Mixed - other",
"White - British",
"White - Irish",
"White - Romany",
"Other"
],
"disabled": false,
"readOnly": true
}
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"fields": [
{
"type": "text",
"label": "What is your age",
"label": "What is your age?",
"required": true,
"sublabels": [],
"options": [],
Expand All @@ -21,7 +21,7 @@
},
{
"type": "radio",
"label": "Your Gender",
"label": "What is your gender?",
"description": "",
"required": true,
"sublabels": [],
Expand Down Expand Up @@ -50,23 +50,28 @@
},
{
"type": "radio",
"label": "What is your current Band/Grade",
"label": "What is your current pay band?",
"required": true,
"sublabels": [],
"options": [
"Band 2",
"Band 3",
"Band 4",
"Band 5",
"Band 6",
"Band 7",
"Band 8",
"Band 8a",
"Band 8b",
"Band 8c",
"Band 8d",
"Band 9"
],
"disabled": false,
"readOnly": true
},
{
"type": "radio",
"label": "Please describe your current role",
"label": "What is your profession?",
"required": true,
"sublabels": [],
"options": [
Expand Down Expand Up @@ -95,7 +100,7 @@
"description": "",
"disabled": false,
"enforceValueConstraints": false,
"label": "Please provide your job title",
"label": "What is your job title?",
"maxNumChar": 500,
"maxNumValue": 100,
"minNumValue": 0,
Expand All @@ -110,14 +115,16 @@
},
{
"type": "radio",
"label": "Please indicate your highest qualification",
"label": "What is your highest level of qualification?",
"required": true,
"sublabels": [],
"options": [
"No qualification",
"Diploma",
"Degree",
"Masters",
"PhD/Doctorate"
"PhD/Doctorate",
"Other"
],
"disabled": false,
"readOnly": true
Expand All @@ -126,7 +133,7 @@
"description": "",
"disabled": false,
"enforceValueConstraints": true,
"label": "How many years have you been qualified",
"label": "How many years have you been qualified?",
"maxNumChar": 500,
"maxNumValue": 100,
"minNumValue": 0,
Expand Down
Loading
Loading