Skip to content

Commit 3a63549

Browse files
Updating markdown document to address comments in the Jira ticket
1 parent a32218a commit 3a63549

File tree

1 file changed

+59
-204
lines changed

1 file changed

+59
-204
lines changed
Lines changed: 59 additions & 204 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,24 @@
11
# Utility Guide: Screening Subject Page Searcher
22

3-
The Screening Subject Search utility allows for
3+
The Screening Subject Search utility provides methods for:
44

5-
- searching for relevant subjects using their NHS Number, forename, last name, DOB, postcode, episode closed date, status or latest event status
6-
- verifying the subject's event status using their NHS number
5+
- Searching for subjects using various parameters (NHS Number, forename, surname, DOB, postcode, episode closed date, status, or latest event status)
6+
- Verifying a subject's event status using their NHS number
77

88
## Table of Contents
99

1010
- [Utility Guide: Screening Subject Page Searcher](#utility-guide-screening-subject-page-searcher)
1111
- [Table of Contents](#table-of-contents)
1212
- [Functions Overview](#functions-overview)
1313
- [The page object parameter](#the-page-object-parameter)
14-
- [Verify subject event status by NHS no](#verify-subject-event-status-by-nhs-no)
15-
- [Arguments](#arguments)
16-
- [How This Function Works](#how-this-function-works)
17-
- [Search subject by NHS number](#search-subject-by-nhs-number)
18-
- [Arguments](#arguments-1)
19-
- [How This Function Works](#how-this-function-works-1)
20-
- [Search subject by surname](#search-subject-by-surname)
21-
- [Arguments](#arguments-2)
22-
- [How This Function Works](#how-this-function-works-2)
23-
- [Search subject by forename](#search-subject-by-forename)
24-
- [Arguments](#arguments-3)
25-
- [How This Function Works](#how-this-function-works-3)
26-
- [Search subject by date of birth](#search-subject-by-date-of-birth)
27-
- [Arguments](#arguments-4)
28-
- [How This Function Works](#how-this-function-works-4)
29-
- [Search subject by postcode](#search-subject-by-postcode)
30-
- [Arguments](#arguments-5)
31-
- [How This Function Works](#how-this-function-works-5)
32-
- [Search subject by episode closed date](#search-subject-by-episode-closed-date)
33-
- [Arguments](#arguments-6)
34-
- [How This Function Works](#how-this-function-works-6)
35-
- [Search subject by status](#search-subject-by-status)
36-
- [Arguments](#arguments-7)
37-
- [How This Function Works](#how-this-function-works-7)
38-
- [Search subject by latest event status](#search-subject-by-latest-event-status)
39-
- [Arguments](#arguments-8)
40-
- [How This Function Works](#how-this-function-works-8)
41-
- [Search subject by search area](#search-subject-by-search-area)
42-
- [Required Arguments](#required-arguments)
43-
- [Optional Arguments](#optional-arguments)
44-
- [How This Function Works](#how-this-function-works-9)
45-
- [Check clear filters button works](#check-clear-filters-button-works)
46-
- [Arguments](#arguments-9)
47-
- [How This Function Works](#how-this-function-works-10)
14+
- [Function Summaries \& Example Usage](#function-summaries--example-usage)
15+
- [verify\_subject\_event\_status\_by\_nhs\_no](#verify_subject_event_status_by_nhs_no)
16+
- [Search Functions](#search-functions)
17+
- [check\_clear\_filters\_button\_works](#check_clear_filters_button_works)
4818

4919
## Functions Overview
5020

51-
For this utility we have the following functions:
21+
The following functions are available:
5222

5323
- `verify_subject_event_status_by_nhs_no`
5424
- `search_subject_by_nhs_number`
@@ -64,193 +34,78 @@ For this utility we have the following functions:
6434

6535
### The page object parameter
6636

67-
- Is required for all the listed functions above.
68-
- It is listed as an argument just once to avoid repetition.
37+
All functions require the Playwright `page` object as their first argument.
6938

70-
### Verify subject event status by NHS no
39+
---
7140

72-
This is used to check that the latest event status of a subject has been updated to what is expected.
73-
The provided NHS no is used to search the whole database and then verifies the latest event status is as expected.
41+
### Function Summaries & Example Usage
7442

75-
#### Arguments
43+
#### verify_subject_event_status_by_nhs_no
7644

77-
- `page`:
78-
- Type: `Page`
79-
- This is the playwright page object which is used to tell playwright what page the test is currently on
80-
- `nhs_no`:
81-
- Type: `str`
82-
- This is the subject's NHS number. For example: 123 456 7890
83-
- `latest_event_status`:
84-
- Type: `str`
85-
- This is the expected status of the subject that is being verified
45+
navigates to the subject screening serach page and searches for the provided NHS Number. Then this checks that the latest event status of the subject matches the expected value(s).
8646

87-
#### How This Function Works
47+
**Arguments:**
8848

89-
1. It starts off by navigating to the main menu if not already on this page. This is done to ensure that this can be called from any page
90-
2. Once on the main menu it navigates to the screening subject search page
91-
3. From here it fills in the NHS number filter field with the supplied NHS number and chooses the whole area database as the search area option
92-
4. It then clicks the search button
93-
5. Once the subject is returned, it then verifies that the latest event status matches the supplied event status
49+
- `page`: Playwright page object
50+
- `nhs_no`: `str` — The subject's NHS number
51+
- `latest_event_status`: `str | list[str]` — The expected status or list of statuses to verify
9452

95-
### Search subject by NHS number
53+
**Example:**
9654

97-
This searches for a subject by their NHS Number
55+
```python
56+
verify_subject_event_status_by_nhs_no(page, "1234567890", "S61 - Normal (No Abnormalities Found)")
57+
verify_subject_event_status_by_nhs_no(page, "1234567890", ["S61 - Normal (No Abnormalities Found)", "A158 - High-risk findings"])
58+
```
9859

99-
#### Arguments
60+
---
10061

101-
- `nhs_no`:
102-
- Type: `str`
103-
- This is the subject's NHS number. For example: 123 456 7890
62+
#### Search Functions
10463

105-
#### How This Function Works
64+
All search functions follow a similar pattern: they clear filters, fill in the relevant field, and perform a search.
10665

107-
1. It starts off by clicking on the **Clear filters** button to remove any persisting filters
108-
2. It then fills in the NHS number filter field with the supplied NHS number and clicks the search button
66+
**Available search functions:**
10967

110-
### Search subject by surname
68+
- `search_subject_by_nhs_number(page, nhs_no: str)`
69+
- `search_subject_by_surname(page, surname: str)`
70+
- `search_subject_by_forename(page, forename: str)`
71+
- `search_subject_by_dob(page, dob: str)`
72+
- `search_subject_by_postcode(page, postcode: str)`
73+
- `search_subject_by_episode_closed_date(page, episode_closed_date: str)`
74+
- `search_subject_by_status(page, status: str)`
75+
- `search_subject_by_latest_event_status(page, status: str)`
76+
- `search_subject_by_search_area(page, status: str, search_area: str, code: str = None, gp_practice_code: str = None)`
11177

112-
This searches for a subject by their surname
78+
**Example:**
11379

114-
#### Arguments
80+
```python
81+
search_subject_by_nhs_number(page, "1234567890")
82+
search_subject_by_surname(page, "Smith")
83+
search_subject_by_forename(page, "John")
84+
search_subject_by_dob(page, "1970-01-01")
85+
search_subject_by_postcode(page, "AB12 3CD")
86+
search_subject_by_episode_closed_date(page, "2023-12-31")
87+
search_subject_by_status(page, "Call")
88+
search_subject_by_latest_event_status(page, "S61 - Normal (No Abnormalities Found)")
89+
search_subject_by_search_area(page, "Call", "Whole Database", code="XYZ", gp_practice_code="ABC123")
90+
```
11591

116-
- `surname`:
117-
- Type: `str`
118-
- This is the subject's surname
92+
---
11993

120-
#### How This Function Works
94+
#### check_clear_filters_button_works
12195

122-
1. It starts off by clicking on the **Clear filters** button to remove any persisting filters
123-
2. It then fills in the surname filter field with the supplied surname and clicks the search button
96+
Checks that the "clear filters" button works as intended. It enters the provided NHS number, clicks the clear filters button, and then verifies that the filters are cleared.
12497

125-
### Search subject by forename
98+
**Arguments:**
12699

127-
This searches for a subject by their forename
100+
- `page`: Playwright page object
101+
- `nhs_no`: `str` — The subject's NHS number
128102

129-
#### Arguments
103+
**Example:**
130104

131-
- `forename`:
132-
- Type: `str`
133-
- This is the subject's forename
105+
```python
106+
check_clear_filters_button_works(page, "1234567890")
107+
```
134108

135-
#### How This Function Works
109+
---
136110

137-
1. It starts off by clicking on the **Clear filters** button to remove any persisting filters
138-
2. It then fills in the forename filter field with the supplied forename and clicks the search button
139-
140-
### Search subject by date of birth
141-
142-
This searches for a subject by their date of birth
143-
144-
#### Arguments
145-
146-
- `dob`:
147-
- Type: `str`
148-
- This is the subject's date of birth
149-
150-
#### How This Function Works
151-
152-
1. It starts off by clicking on the **Clear filters** button to remove any persisting filters
153-
2. It then fills in the date of birth filter field with the supplied DOB and clicks the search button
154-
155-
### Search subject by postcode
156-
157-
This searches for a subject by their postcode
158-
159-
#### Arguments
160-
161-
- `postcode`:
162-
- Type: `str`
163-
- This is the subject's postcode
164-
165-
#### How This Function Works
166-
167-
1. It starts off by clicking on the **Clear filters** button to remove any persisting filters
168-
2. It then fills in the postcode filter field with the supplied postcode and clicks the search button
169-
170-
### Search subject by episode closed date
171-
172-
This searches for a subject by their episode closed date
173-
174-
#### Arguments
175-
176-
- `episode_closed_date`:
177-
- Type: `str`
178-
- This is the subject's episode closed date
179-
180-
#### How This Function Works
181-
182-
1. It starts off by clicking on the **Clear filters** button to remove any persisting filters
183-
2. It then fills in the episode closed date filter field with the supplied date and clicks the search button
184-
185-
### Search subject by status
186-
187-
This searches for a subject by their screening status
188-
189-
#### Arguments
190-
191-
- `status`:
192-
- Type: `str`
193-
- This is the subject's screening status
194-
195-
#### How This Function Works
196-
197-
1. It starts off by clicking on the **Clear filters** button to remove any persisting filters
198-
2. It then selects the screening status option that matches the supplied status and clicks the search button
199-
200-
### Search subject by latest event status
201-
202-
This searches for a subject by their latest event status
203-
204-
#### Arguments
205-
206-
- `status`:
207-
- Type: `str`
208-
- This is the subject's latest event status
209-
210-
#### How This Function Works
211-
212-
1. It starts off by clicking on the **Clear filters** button to remove any persisting filters
213-
2. It then selects the episode status option that matches the supplied status and clicks the search button
214-
215-
### Search subject by search area
216-
217-
This searches for a subject by search area
218-
219-
#### Required Arguments
220-
221-
- `status`:
222-
- Type: `str`
223-
- This is the subject's screening status
224-
- `search_area`:
225-
- Type: `str`
226-
- This is the search area option to use
227-
228-
#### Optional Arguments
229-
230-
- `code`:
231-
- Type: `str`
232-
- `gp_practice_code`:
233-
- Type: `str`
234-
235-
#### How This Function Works
236-
237-
1. It starts off by clicking on the **Clear filters** button to remove any persisting filters
238-
2. It then selects the screening status option that matches the supplied status
239-
3. If provided, the code parameter is used to fill the appropriate code filter field
240-
4. If provided, the GP practice code parameter is used to fill the GP Practice in CCG filter field
241-
5. It then clicks the search button
242-
243-
### Check clear filters button works
244-
245-
This checks that the "clear filter" button works as intended
246-
247-
#### Arguments
248-
249-
- `nhs_no`:
250-
- Type: `str`
251-
- This is the subject's NHS number. For example: 123 456 7890
252-
253-
#### How This Function Works
254-
255-
1. It fills in the NHS number filter field with the supplied NHS number and verifies that the NHS number filter field contains the entered value
256-
2. It then clicks the clear filters button and verifies that the NHS number filter field is now empty
111+
For more details on each function's implementation, refer to the source code.

0 commit comments

Comments
 (0)