@@ -24,8 +24,8 @@ You might use this utility for:
2424 - [ Oracle Utility Methods] ( #oracle-utility-methods )
2525 - [ Example usage] ( #example-usage )
2626 - [ Oracle Specific Functions] ( #oracle-specific-functions )
27- - [ How to Add New Oracle-Specific Functions] ( #how-to-add-new-oracle-specific-functions )
28- - [ Example Usage] ( #example-usage-1 )
27+ - [ How to Add New Oracle-Specific Functions] ( #how-to-add-new-oracle-specific-functions )
28+ - [ Example Usage] ( #example-usage-1 )
2929
3030## Using the Oracle Utility
3131
@@ -94,23 +94,45 @@ OracleDB().create_subjects_via_sspi(
9494
9595## Oracle Specific Functions
9696
97- This contains SQL queries that can be used to run tests.< br >
98- These are all stored in one location to make it easier to edit the query at a later date and to make it accessible to multiple tests .
97+ Oracle-specific functions are now organized into separate files under ` utils/oracle/oracle_specific_functions/ ` for better maintainability and discoverability.
98+ Each file groups related functions by their domain or purpose .
9999
100- Common values are placed in the ` SqlQueryValues ` class to avoid repeating the same values in the queries.
100+ Below is a table showing the current structure and which functions are found in each file:
101101
102- ## How to Add New Oracle-Specific Functions
102+ | File Name | Functions/Classes Included |
103+ | --------------------------------------------| --------------------------------------------------------------------------------------------------------------|
104+ | ** enums.py** | ` SqlQueryValues ` (common enum values for queries) |
105+ | ** kit_management.py** | ` get_kit_id_from_db ` , ` get_kit_id_logged_from_db ` , ` get_service_management_by_device_id ` ,<br >` update_kit_service_management_entity ` , ` execute_fit_kit_stored_procedures ` |
106+ | ** organisation_parameters.py** | ` set_org_parameter_value ` , ` get_org_parameter_value ` , ` check_parameter ` |
107+ | ** screening_colonoscopist.py** | ` build_accredited_screening_colonoscopist_query ` , ` get_accredited_screening_colonoscopist_in_bcs001 ` |
108+ | ** subject_address.py** | ` check_if_subject_has_temporary_address ` |
109+ | ** subject_appointment.py** | ` get_subjects_for_appointments ` , ` get_subjects_with_booked_appointments ` |
110+ | ** subject_batch.py** | ` get_nhs_no_from_batch_id ` |
111+ | ** supporting_notes.py** | ` get_subjects_by_note_count ` , ` get_supporting_notes ` , ` get_subjects_with_multiple_notes ` |
112+ | ** investigation_dataset.py** | ` get_investigation_dataset_polyp_category ` , ` get_investigation_dataset_polyp_algorithm_size ` ,<br >` get_subjects_for_investigation_dataset_updates ` |
113+ | ** subject_selector.py** | ` SubjectSelector ` (class for subject selection logic) |
103114
104- - Define a new function in ` utils/oracle/oracle_specific_functions.py ` .
105- - Create your SQL query, ` parameterizing ` as needed.
106- - Call the relevant methods from the oracle ` util ` based on your needs (e.g., ` execute_query ` , stored procedure methods, etc.).
107- - Return the result in the appropriate format for your function.
108- - Document the function with a clear docstring.
115+ > ** Note:**
116+ > If you are looking for a specific function, check the relevant file in ` utils/oracle/oracle_specific_functions/ ` .
117+ > Common values used in queries are placed in ` enums.py ` as the ` SqlQueryValues ` class.
109118
110- ## Example Usage
119+ ---
120+
121+ ### How to Add New Oracle-Specific Functions
122+
123+ - Add your new function to the most appropriate file in ` utils/oracle/oracle_specific_functions/ ` .
124+ - If your function does not fit an existing category, create a new file with a descriptive name.
125+ - Document your function with a clear docstring.
126+ - If your function uses common query values, consider adding them to ` enums.py ` .
127+ - Once done add the function to the table above
128+
129+ ---
130+
131+ ### Example Usage
111132
112133``` python
113134from utils.oracle.oracle import OracleDB
135+ from utils.oracle.oracle_specific_functions.enums import SqlQueryValues
114136
115137def example_query () -> pd.DataFrame:
116138 """
0 commit comments