Skip to content

Commit 203cd88

Browse files
Attempting to fix Scan Secrets error by renaming key to key_name
Signed-off-by: Adriano Aru <[email protected]>
1 parent e08bbd6 commit 203cd88

File tree

3 files changed

+147
-147
lines changed

3 files changed

+147
-147
lines changed

docs/SubjectCriteriaBuilderApllication.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Each entry in the file looks like this:
122122

123123
```json
124124
{
125-
"key": "NHS_NUMBER",
125+
"key_name": "NHS_NUMBER",
126126
"value_source": "",
127127
"notes": "Enter the 10-digit NHS Number of the subject you want to search for."
128128
}
@@ -132,7 +132,7 @@ Or, with allowed values and dependencies:
132132

133133
```json
134134
{
135-
"key": "SUBJECT_HUB_CODE",
135+
"key_name": "SUBJECT_HUB_CODE",
136136
"value_source": "SubjectHubCode.by_description",
137137
"notes": "Select the hub or organisation for the subject.",
138138
"allowed_values": [
@@ -145,7 +145,7 @@ Or, with allowed values and dependencies:
145145
}
146146
```
147147

148-
- **`key`:** The unique identifier for the criterion (must match the code).
148+
- **`key_name`:** The unique identifier for the criterion (must match the code).
149149
- **`value_source`:** (Optional) The source of the value, can be left blank. This refers to the class + method used in the subject selection query builder. This is not used by the code but is there to allow easier tracking/mapping.
150150
- **`notes`:** A clear, user-focused description of what the key is and what the user should input.
151151
- **`allowed_values`:** (Optional) An array of allowed values for the dropdown selection.
@@ -154,7 +154,7 @@ Or, with allowed values and dependencies:
154154
#### To add a new criterion
155155

156156
1. Add a new object to the JSON array with the following fields:
157-
- `"key"`: The `Enum` member name (must match the code).
157+
- `"key_name"`: The `Enum` member name (must match the code).
158158
- `"value_source"`: (Optional) The value source, can be left blank.
159159
- `"notes"`: A clear, user-focused description of what the key is and what the user should input.
160160
- `"allowed_values"`: (Optional) An array of allowed values for the dropdown selection.
@@ -164,7 +164,7 @@ Or, with allowed values and dependencies:
164164

165165
#### To edit a criterion
166166

167-
- Find the object with the matching `"key"` and update the `"notes"`, `"allowed_values"`, or `"dependencies"` as needed.
167+
- Find the object with the matching `"key_name"` and update the `"notes"`, `"allowed_values"`, or `"dependencies"` as needed.
168168
- Save the file and reload the app.
169169

170170
#### To remove a criterion
@@ -236,7 +236,7 @@ If you add new keys to the `SubjectSelectionCriteriaKey` `Enum` in your code, yo
236236

237237
```json
238238
{
239-
"key": "SCREENING_STATUS",
239+
"key_name": "SCREENING_STATUS",
240240
"value_source": "ScreeningStatusType.by_description_case_insensitive",
241241
"notes": "Select the current screening status for the subject.",
242242
"allowed_values": [

subject_criteria_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def get_metadata_for_key(enum_key: str) -> dict:
5151
dict: The metadata for the specified criteria key, or an empty dictionary if not found.
5252
"""
5353
for entry in CRITERIA_METADATA:
54-
if entry["key"] == enum_key:
54+
if entry["key_name"] == enum_key:
5555
return entry
5656
return {}
5757

0 commit comments

Comments
 (0)