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 investigation_dataset_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
PolypReasonLeftInSituOptions,
AntibioticsAdministeredDrugTypeOptions,
OtherDrugsAdministeredDrugTypeOptions,
OtherFindingsDiagnosisOptions,
OtherFindingsLocationOptions,
IVContrastAdministeredOptions,
TaggingAgentDrugAdministeredOptions,
AdditionalBowelPrepAdministeredOptions,
Expand Down Expand Up @@ -79,6 +81,8 @@
"PolypReasonLeftInSituOptions": PolypReasonLeftInSituOptions,
"AntibioticsAdministeredDrugTypeOptions": AntibioticsAdministeredDrugTypeOptions,
"OtherDrugsAdministeredDrugTypeOptions": OtherDrugsAdministeredDrugTypeOptions,
"OtherFindingsDiagnosisOptions": OtherFindingsDiagnosisOptions,
"OtherFindingsLocationOptions": OtherFindingsLocationOptions,
"IVContrastAdministeredOptions": IVContrastAdministeredOptions,
"TaggingAgentDrugAdministeredOptions": TaggingAgentDrugAdministeredOptions,
"AdditionalBowelPrepAdministeredOptions": AdditionalBowelPrepAdministeredOptions,
Expand Down Expand Up @@ -849,6 +853,7 @@ def _render_histology(fields: list, pi: int) -> dict:
"tagging_agent_given_drug_information",
"radiology_information",
"suspected_findings",
"other_findings",
]

SECTION_LABELS = {
Expand All @@ -862,6 +867,7 @@ def _render_histology(fields: list, pi: int) -> dict:
"tagging_agent_given_drug_information": "Tagging Agent Given Drug Information",
"radiology_information": "Radiology Information",
"suspected_findings": "Suspected Findings",
"other_findings": "Other Findings",
}

# --- Main section selection ---
Expand All @@ -881,6 +887,7 @@ def _render_histology(fields: list, pi: int) -> dict:
"tagging_agent_given_drug_information": show_drug_group_section_with_imports,
"radiology_information": show_section_with_imports,
"suspected_findings": show_section_with_imports,
"other_findings": show_drug_group_section_with_imports,
}

selected_key = next(k for k, v in SECTION_LABELS.items() if v == section)
Expand Down
23 changes: 23 additions & 0 deletions investigation_dataset_ui_app/dataset_fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -601,5 +601,28 @@
"optional": false
}
]
},
"other_findings": {
"groups": [
{
"label": "Other Findings",
"fields": [
{
"key": "locationX",
"type": "OtherFindingsLocationOptions",
"description": "Other Findings Location",
"optional": true,
"multiple": true
},
{
"key": "diagnosisX",
"type": "OtherFindingsDiagnosisOptions",
"description": "Other Findings Diagnosis",
"optional": true,
"multiple": true
}
]
}
]
}
}
65 changes: 63 additions & 2 deletions pages/datasets/investigation_dataset_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def __init__(self, page: Page):
self.aspirant_endoscopist_not_present = self.page.locator(
"#UI_ASPIRANT_ENDOSCOPIST_NR"
)
self.show_other_findings_information = self.page.locator("#anchorOtherFindings")
self.show_drug_information_detail = self.page.locator("#anchorDrug")
self.show_suspected_findings = self.page.locator("#anchorRadiologyFindings")
self.drug_type_option1 = self.page.locator("#UI_BOWEL_PREP_DRUG1")
Expand Down Expand Up @@ -371,6 +372,13 @@ def click_show_completion_proof_information(self) -> None:
):
self.click(self.show_completion_proof_information_details)

def click_show_other_findings_information(self) -> None:
"""
Clicks on the show other findings information link if it contains the text "show" (case-insensitive).
"""
if "show" in self.show_other_findings_information.inner_text().lower():
self.click(self.show_other_findings_information)

def click_show_failure_information(self) -> None:
"""
This method is designed to click on the show failure information link.
Expand Down Expand Up @@ -1243,8 +1251,9 @@ def message_is_displayed(self, expected_message: str) -> None:
expected_message (str): The expected warning message text.
"""
actual_message = self.get_warning_message()
assert actual_message is not None and expected_message in actual_message, \
f"Actual warning message displayed is: {actual_message}"
assert (
actual_message is not None and expected_message in actual_message
), f"Actual warning message displayed is: {actual_message}"


def normalize_label(text: str) -> str:
Expand Down Expand Up @@ -1759,6 +1768,58 @@ class PolypTypeLeftInSituOptions(StrEnum):
LYMPHOID_FOLLICLE = "200599~Sub Type Not Applicable"


class OtherFindingsLocationOptions(StrEnum):
"""Enum for Other Findings Location options"""

ANUS = "17231~Scope not inserted clinical reason~204338"
RECTUM = "17232~Scope not inserted clinical reason~204338"
SIGMOID_COLON = "17233"
DESCENDING_COLON = "17234"
SPLENIC_FLEXURE = "17235"
TRANSVERSE_COLON = "17236"
HEPATIC_FLEXURE = "17237"
ASCENDING_COLON = "17238"
CAECUM = "17239~Colonoscopy Complete"
ILEUM = "17240~Colonoscopy Complete"
ANASTOMOSIS = "17241~Colonoscopy Complete"
LEFT_COLON = "17244~Large Bowel Area"
ENTIRE_COLON = "17245~Large Bowel Area"
RIGHT_COLON = "200619~Large Bowel Area"
PATCHY_AREAS = "200618~Large Bowel Area"


class OtherFindingsDiagnosisOptions(StrEnum):
"""Enum for Other Findings Diagnosis options"""

ANAL_FISSURE = "16011~anus or rectum"
ANGIODYSPLASIA = "16007~Large Bowel Areas"
ATTENUATED_FAMILIAL_ADENOMATOUS_POLYPOSIS = "204403~Large Bowel Areas"
BENIGN_SUBMUSCOSAL_LESION = "16015"
COWDENS_SYNDROME = "204404~Large Bowel Areas"
DIVERTICULOSISIS = "16008~Large Bowel Areas"
FISTULA = "16019"
FAMILIAL_ADENOMATOUS_POLYPOSIS = "17648~Large Bowel Areas"
HAEMORRHOIDS = "16009"
ILETIS = "16055"
INFLAMMATORY_BOWEL_DISEASE = "200585~Large Bowel Areas"
ISCHAEMIC_COLITIS = "16065"
JUVENILE_POLYPOSIS = "204405~Large Bowel Areas"
LYMPHOMA = "16070"
MELANOSIS = "16014"
MUCOSAL_PROLAPSE = "16018"
MUT_YH_POLYPOSIS = "204406~Large Bowel Areas"
OBSTRUCTION_OF_COLON = "203071"
OTHER_MALIGNANT_TUMOR = "200584"
PARASITES = "16062"
PEUTZ_JEGHERS_SYNDROME = "204407~Large Bowel Areas"
PNEUMATOSIS_COLI = "16078"
POST_OPERATIVE_APPEARANCE = "16079"
PSEUDOMEMBRANOUS_COLITIS = "16063"
RADIATION_ENTEROCOLITIS = "16066~Large Bowel Areas~204339"
SOLITARY_RECAL_ULCER_SYNDROME = "16067"
STRICTURE = "16006"


# Registry of all known Enums to search when matching string values
ALL_ENUMS: List[type[Enum]] = [
obj
Expand Down
Loading