@@ -337,6 +337,7 @@ def complete_dataset_with_args(
337337 contrast_tagging_and_drug : Optional [dict ] = None ,
338338 tagging_agent_given_drug_information : Optional [dict ] = None ,
339339 radiology_information : Optional [dict ] = None ,
340+ suspected_findings : Optional [dict ] = None ,
340341 extracolonic_summary_code : Optional [str ] = None ,
341342 intracolonic_summary_code : Optional [str ] = None ,
342343 ) -> None :
@@ -355,6 +356,7 @@ def complete_dataset_with_args(
355356 contrast_tagging_and_drug (Optional[dict]): Contrast, tagging agent, and drug information.
356357 tagging_agent_given_drug_information (Optional[dict]): Tagging agent drug types and doses.
357358 radiology_information (Optional[dict]): Radiology section fields.
359+ suspected_findings (Optional[dict])
358360 extracolonic_summary_code (Optional[str]): Extracolonic summary code value.
359361 intracolonic_summary_code (Optional[str]): Intracolonic summary code value.
360362 """
@@ -420,21 +422,31 @@ def complete_dataset_with_args(
420422 "#UI_INTRACOLONIC_SUMMARY_CODE" , intracolonic_summary_code
421423 )
422424
423- # Extracolonic Summary Code
424- if radiology_information ["extracolonic_summary_code" ]:
425- self .investigation_datasets_pom .click_show_suspected_findings_details ()
426-
427- dropdown = self .page .locator ("#UI_EXTRACOLONIC_SUMMARY_CODE" )
428- dropdown .wait_for (state = "visible" )
429- self .page .wait_for_function ("document.querySelector('#UI_EXTRACOLONIC_SUMMARY_CODE').options.length > 1" )
430-
431- dropdown .select_option (value = radiology_information ["extracolonic_summary_code" ])
425+ # Suspected Fndings
426+ if suspected_findings is not None :
427+ logging .info ("Filling out suspected findings" )
428+ self .fill_out_suspected_findings (suspected_findings )
432429
433430 # Save the dataset
434431 logging .info ("Saving the investigation dataset" )
435432 self .investigation_datasets_pom .check_dataset_complete_checkbox ()
436433 self .investigation_datasets_pom .click_save_dataset_button ()
437434
435+ def fill_out_suspected_findings (self , suspected_findings : dict ) -> None :
436+ """ """
437+ self .investigation_datasets_pom .click_show_suspected_findings_details ()
438+
439+ if suspected_findings ["extracolonic summary code" ]:
440+ dropdown = self .page .locator ("#UI_EXTRACOLONIC_SUMMARY_CODE" )
441+ dropdown .wait_for (state = "visible" )
442+ self .page .wait_for_function (
443+ "document.querySelector('#UI_EXTRACOLONIC_SUMMARY_CODE').options.length > 1"
444+ )
445+
446+ dropdown .select_option (
447+ value = suspected_findings ["extracolonic summary code" ]
448+ )
449+
438450 def fill_out_general_information (self , general_information : dict ) -> None :
439451 """
440452 Populates the General Information section of the Investigation Dataset form.
0 commit comments