Skip to content

Commit 05aee1c

Browse files
committed
Updated investigation datasets pom and util (pair programming with Adriano)
1 parent 6d9b562 commit 05aee1c

File tree

5 files changed

+926
-664
lines changed

5 files changed

+926
-664
lines changed

pages/datasets/investigation_dataset_page.py

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ def __init__(self, page: Page):
2626
self.testing_clinician_link = self.page.locator(
2727
"#UI_CONSULTANT_PIO_SELECT_LINK"
2828
)
29+
self.reporting_radiologist_link = self.page.locator(
30+
"#UI_REPORTING_CLINICIAN_PIO_SELECT_LINK"
31+
)
32+
self.show_contrast_tagging_and_drug_information = self.page.locator(
33+
"#anchorContrastTaggingDrug"
34+
)
2935
self.aspirant_endoscopist_link = self.page.locator(
3036
"#UI_ASPIRANT_ENDOSCOPIST_PIO_SELECT_LINK"
3137
)
@@ -173,6 +179,29 @@ def select_testing_clinician_option_index(self, option: int) -> None:
173179
option_elements.nth(option).wait_for(state="visible")
174180
self.click(option_elements.nth(option))
175181

182+
def select_reporting_radiologist_option_index(self, option: int) -> None:
183+
"""
184+
This method is designed to select a reporting radiologist from the reporting radiologist options.
185+
It clicks on the reporting radiologist link and selects the given option by index.
186+
187+
Args:
188+
option (int): The index of the option to select from the reporting radiologist options.
189+
"""
190+
self.click(self.reporting_radiologist_link)
191+
select_locator = self.page.locator(self.visible_ui_results_string)
192+
select_locator.first.wait_for(state="visible")
193+
# Find all option elements inside the select and click the one at the given index
194+
option_elements = select_locator.first.locator("option")
195+
option_elements.nth(option).wait_for(state="visible")
196+
self.click(option_elements.nth(option))
197+
198+
def click_show_contrast_tagging_and_drug_information(self) -> None:
199+
"""
200+
This method is designed to click on the show contrast tagging and drug information link.
201+
It clicks on the show contrast tagging and drug information link.
202+
"""
203+
self.click(self.show_contrast_tagging_and_drug_information)
204+
176205
def select_aspirant_endoscopist_option(self, option: str) -> None:
177206
"""
178207
This method is designed to select an aspirant endoscopist from the aspirant endoscopist options.
@@ -1240,7 +1269,7 @@ class OutcomeAtTimeOfProcedureOptions(StrEnum):
12401269
UNPLANNED_ADMISSION = "17147~Complications are mandatory"
12411270

12421271

1243-
class LateOutcomeOptions(StrEnum):
1272+
class RadiologyLateOutcomeOptions(StrEnum):
12441273
"""Enum for late outcome options"""
12451274

12461275
NO_COMPLICATIONS = "17216~Complications are not required"
@@ -1489,6 +1518,65 @@ class SedationOptions(StrEnum):
14891518
ASLEEP_AND_UNRESPONSIVE = "17328"
14901519

14911520

1521+
class ExaminationQualityOptions(StrEnum):
1522+
"""Enum for examination quality options"""
1523+
1524+
GOOD = "17016"
1525+
ADEQUATE_FAIR = "17017"
1526+
POOR = "17995~Enema down scope~204376"
1527+
NOT_REPORTED = "202140"
1528+
1529+
1530+
class ScanPositionOptions(StrEnum):
1531+
"""Enum for number of scan positions"""
1532+
1533+
SINGLE = "204373"
1534+
DUAL = "204374"
1535+
TRIPLE = "204375"
1536+
NOT_REPORTED = "202140"
1537+
1538+
1539+
class ProcedureOutcomeOptions(StrEnum):
1540+
"""Enum for outcome at time of procedure"""
1541+
1542+
LEAVE_DEPARTMENT = "17148~Complications are optional"
1543+
UNPLANNED_ADMISSION = "17147~Complications are mandatory"
1544+
1545+
1546+
class SegmentalInadequacyOptions(StrEnum):
1547+
"""Enum for segmental inadequacy"""
1548+
1549+
YES = "17058"
1550+
NO = "17059~~307113"
1551+
1552+
1553+
class IntracolonicSummaryCodeOptions(StrEnum):
1554+
"""Enum for intracolonic summary code"""
1555+
1556+
CX_INADEQUATE_STUDY = "203167~~204409,307112"
1557+
C1_NORMAL_OR_SMALL_POLYPS = "203168"
1558+
C2_POLYPS_6_9MM = "203169~~203178"
1559+
C3A_POLYPS_1_9MM = "203170~~203178"
1560+
C3B_POLYPS_GE_10MM = "203171~~203178"
1561+
C3C_INDETERMINATE_STRICTURE = "203172"
1562+
C4A_MANY_SMALL_POLYPS = "203173~~203178"
1563+
C4B_MANY_POLYPS_GE_10MM = "203174~~203178"
1564+
C5A_COLON_MASS_MALIGNANT = "203175~~203179"
1565+
C5B_NO_TUMOUR_ADDITIONAL = "203176~~203179"
1566+
NOT_REPORTED = "203177"
1567+
1568+
1569+
class ExtracolonicSummaryCodeOptions(StrEnum):
1570+
"""Enum for extracolonic summary code options"""
1571+
1572+
E1_NORMAL_VARIANT = "204382"
1573+
E2_INCIDENTAL_KNOWN = "204383"
1574+
E3_INCOMPLETE_CHARACTERISATION = "204384"
1575+
E4_IMPORTANT_REQUIRES_ACTION = "204385"
1576+
E5_SIGNIFICANT_NEW_FINDING = "204386"
1577+
NOT_REPORTED = "202140"
1578+
1579+
14921580
# Registry of all known Enums to search when matching string values
14931581
ALL_ENUMS: List[type[Enum]] = [
14941582
obj

pages/screening_subject_search/advance_fobt_screening_episode_page.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,9 @@ def record_contact_close_episode_no_contact(self) -> None:
225225
- Selects the outcome 'Close Episode - No Contact'
226226
- Clicks the save button
227227
"""
228-
logging.info("[CONTACT RECORD] Starting contact recording flow with outcome: Close Episode - No Contact")
228+
logging.info(
229+
"[CONTACT RECORD] Starting contact recording flow with outcome: Close Episode - No Contact"
230+
)
229231

230232
# Step 1: Click 'Record Contact with Patient' button
231233
# self.page.get_by_role("button", name="Record Contact with Patient").click()
@@ -263,7 +265,6 @@ def record_contact_close_episode_no_contact(self) -> None:
263265
self.page.locator("input[name='UI_BUTTON_SAVE']").click()
264266
logging.info("[CONTACT RECORD] Contact recording flow completed successfully")
265267

266-
267268
def click_not_suitable_for_diagnostic_tests_button(self) -> None:
268269
"""Click the 'Not Suitable for Diagnostic Tests' button."""
269270
self.safe_accept_dialog(self.not_suitable_for_diagnostic_tests_button)
@@ -275,8 +276,3 @@ def click_cancel_diagnostic_test_button(self) -> None:
275276
def click_post_investigation_appointment_required_button(self) -> None:
276277
"""Click the 'Post-investigation Appointment Required' button."""
277278
self.safe_accept_dialog(self.post_investigation_appointment_required_button)
278-
279-
def click_record_other_post_investigation_contact_button(self) -> None:
280-
"""Click the 'Record other post-investigation contact' button."""
281-
self.safe_accept_dialog(self.record_other_post_investigation_contact_button)
282-

0 commit comments

Comments
 (0)