Skip to content

Commit b703c70

Browse files
committed
Merge branch 'main' into feature/BCSS-21316-fobtregressiontests-scenario-14
2 parents 281b221 + 1194b33 commit b703c70

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

docs/utility-guides/SubjectSelectionQueryBuilder.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ This approach ensures injection-safe execution (defending against SQL injection
6464

6565
```python
6666
criteria = {
67-
"nhs_number": "1234567890",
68-
"screening_status": "invited"
67+
"nhs number": "1234567890",
68+
"screening status": "invited"
6969
}
7070

7171
user = User(user_id=42, organisation=None) # Optional; used for 'unchanged' logic
@@ -122,9 +122,9 @@ Example:
122122

123123
```python
124124
{
125-
"subject_has_event_status": "ES01",
126-
"subject_age": "> 60",
127-
"date_of_death": "null"
125+
"subject has event status": "ES01",
126+
"subject age": "> 60",
127+
"date of death": "null"
128128
}
129129
```
130130

@@ -134,12 +134,12 @@ Each of those triggers a different clause in the generated SQL.
134134

135135
This gives the builder context about who’s requesting the query, including their organisation and permissions.
136136

137-
Some criteria (like "USER_HUB" or "USER_ORGANISATION") don’t refer to a fixed hub code, but instead dynamically map to the hub or screening centre of the user running the search. That’s where this comes into play.
137+
Some criteria (like "USER HUB" or "USER ORGANISATION") don’t refer to a fixed hub code, but instead dynamically map to the hub or screening centre of the user running the search. That’s where this comes into play.
138138

139139
Example:
140140

141141
```python
142-
"SUBJECT_HUB_CODE": "USER_HUB"
142+
"SUBJECT HUB CODE": "USER HUB"
143143
```
144144

145145
This means “filter by the hub assigned to this user’s organisation,” not a fixed hub like ABC.

subject_criteria_builder/criteria.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4891,5 +4891,10 @@
48914891
"key": "ADD_COLUMN_TO_SELECT_STATEMENT",
48924892
"value_source": "",
48934893
"notes": "Enter the name of the column to add to the select statement, also specify the prefix. E.g. ss.screening_subject_id."
4894+
},
4895+
{
4896+
"key": "ADD_JOIN_TO_FROM_STATEMENT",
4897+
"value_source": "",
4898+
"notes": "Enter the join you wish to add to the query. E.g. 'INNER JOIN sd_address_t adds ON adds.contact_id = c.contact_id'"
48944899
}
48954900
]

0 commit comments

Comments
 (0)