From 5a28c23d16c6b8f6339aa6d315f34f86c6ab6472 Mon Sep 17 00:00:00 2001 From: alexiswl <8197659+alexiswl@users.noreply.github.com> Date: Mon, 27 Nov 2023 09:13:25 +1100 Subject: [PATCH 1/3] Dont hardcode ntc subject id --- .../lambda_code.py | 37 ++++++++++--------- .../lambdas/layers/lambda_utils/globals.py | 2 + 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/launch_available_payloads_and_update_cttso_lims_sheet/lambda_code.py b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/launch_available_payloads_and_update_cttso_lims_sheet/lambda_code.py index 9c6c3c8..233d523 100644 --- a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/launch_available_payloads_and_update_cttso_lims_sheet/lambda_code.py +++ b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/launch_available_payloads_and_update_cttso_lims_sheet/lambda_code.py @@ -61,7 +61,8 @@ REDCAP_APIS_LAMBDA_FUNCTION_ARN_SSM_PARAMETER, \ CLINICAL_LAMBDA_FUNCTION_SSM_PARAMETER_PATH, \ VALIDATION_LAMBDA_FUNCTION_ARN_SSM_PARAMETER_PATH, \ - MAX_SUBMISSIONS_PER_LIMS_UPDATE_CYCLE, MAX_ATTEMPTS_WAKE_LAMBDAS, EVENT_RULE_FUNCTION_NAME_SSM_PARAMETER_PATH + MAX_SUBMISSIONS_PER_LIMS_UPDATE_CYCLE, MAX_ATTEMPTS_WAKE_LAMBDAS, EVENT_RULE_FUNCTION_NAME_SSM_PARAMETER_PATH, \ + NTC_SUBJECT_ID logger = get_logger() @@ -228,23 +229,23 @@ def get_libraries_for_processing(merged_df) -> pd.DataFrame: one_week_ago = (datetime.now() - timedelta(days=7)).date() to_process_df = merged_df.query( - "(" - " pieriandx_case_id.isnull() and " - " ( pieriandx_submission_time.isnull() or pieriandx_submission_time < @one_week_ago ) and " - " not in_pieriandx and " - " not portal_wfr_id.isnull() and " - " portal_wfr_status == 'Succeeded' and " - " portal_is_failed_run == False and " - " ( " - " ( " - " not redcap_is_complete.isnull() and redcap_is_complete.str.lower() == 'complete' " - " ) or " - " ( " - " glims_needs_redcap == False " - " ) " - " ) and " - " not subject_id == 'SBJ00006' " - ") ", + f"(" + f" pieriandx_case_id.isnull() and " + f" ( pieriandx_submission_time.isnull() or pieriandx_submission_time < @one_week_ago ) and " + f" not in_pieriandx and " + f" not portal_wfr_id.isnull() and " + f" portal_wfr_status == 'Succeeded' and " + f" portal_is_failed_run == False and " + f" ( " + f" ( " + f" not redcap_is_complete.isnull() and redcap_is_complete.str.lower() == 'complete' " + f" ) or " + f" ( " + f" glims_needs_redcap == False " + f" ) " + f" ) and " + f" not subject_id == '{NTC_SUBJECT_ID}' " + f") ", engine="python" # Required for the isnull bit - https://stackoverflow.com/a/54099389/6946787 ) diff --git a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/layers/lambda_utils/globals.py b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/layers/lambda_utils/globals.py index 224d37d..1ffbaa9 100644 --- a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/layers/lambda_utils/globals.py +++ b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/layers/lambda_utils/globals.py @@ -194,3 +194,5 @@ class SampleType(Enum): rf"umccr__automated__{PORTAL_CTTSO_WORKFLOW_TYPE_NAME}__(SBJ\d{{5}})__(L\d{{7}})__\S+" ) + +NTC_SUBJECT_ID = "SBJ00006" From b4ab270fea0790c5cf067f62fda1959f5a7511cf Mon Sep 17 00:00:00 2001 From: Alexis Lucattini Date: Mon, 27 Nov 2023 09:14:57 +1100 Subject: [PATCH 2/3] Fix union syntax for python 3.9 is_identified is always a string for lims deployment Resolves #200 --- .../lambda_code.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/launch_available_payloads_and_update_cttso_lims_sheet/lambda_code.py b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/launch_available_payloads_and_update_cttso_lims_sheet/lambda_code.py index 9c6c3c8..9194f63 100644 --- a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/launch_available_payloads_and_update_cttso_lims_sheet/lambda_code.py +++ b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/launch_available_payloads_and_update_cttso_lims_sheet/lambda_code.py @@ -290,7 +290,7 @@ def get_libraries_for_processing(merged_df) -> pd.DataFrame: ] -def submit_library_to_pieriandx(subject_id: str, library_id: str, workflow_run_id: str, lambda_arn: str, panel_type: str, sample_type: str, is_identified: Union[bool | str], default_snomed_term: str): +def submit_library_to_pieriandx(subject_id: str, library_id: str, workflow_run_id: str, lambda_arn: str, panel_type: str, sample_type: str, is_identified: str, default_snomed_term: str): """ Submit library to pieriandx :param is_identified: From 508c0e5e7fca71841b144b0e362fa969570d7bf8 Mon Sep 17 00:00:00 2001 From: Alexis Lucattini Date: Mon, 27 Nov 2023 09:21:25 +1100 Subject: [PATCH 3/3] Hotfixes for type hinting error ## PRs #201 #202 ## Bugs #200 Also moved NaT error into module changelog --- Changelog.md | 10 ++++++++++ deploy/cttso-ica-to-pieriandx-cdk/Changelog.md | 13 +++++++++++++ 2 files changed, 23 insertions(+) diff --git a/Changelog.md b/Changelog.md index ecc76bb..fe363b8 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,6 +4,16 @@ Changes in this log refer only to changes that make it to the 'main' branch. and For changes in deployment, please see the [deployment changelog](deploy/cttso-ica-to-pieriandx-cdk/Changelog.md) +## 2023-11-22 + +> Author: Alexis Lucattini +> Email: [Alexis.Lucattini@umccr.org](mailto:alexis.lucattini@umccr.org) + +### Hotfixes +* Fix deidentified samples where NAT instead of NaT null value was used (https://github.com/umccr/cttso-ica-to-pieriandx/pull/198) + * Resolves https://github.com/umccr/cttso-ica-to-pieriandx/issues/197 + + ## 2023-11-08 > Author: Alexis Lucattini diff --git a/deploy/cttso-ica-to-pieriandx-cdk/Changelog.md b/deploy/cttso-ica-to-pieriandx-cdk/Changelog.md index d80020c..1844b46 100644 --- a/deploy/cttso-ica-to-pieriandx-cdk/Changelog.md +++ b/deploy/cttso-ica-to-pieriandx-cdk/Changelog.md @@ -3,6 +3,19 @@ Changes in this log refer only to changes that make it to the 'main' branch and are nested under deploy/cttso-ica-to-pieriandx-cdk. +## 2023-11-27 + +> Author: Alexis Lucattini +> Email: [Alexis.Lucattini@umccr.org](mailto:alexis.lucattini@umccr.org) + +### Hotfixes +* lims maker lambda fails on type hinting for multiple types (https://github.com/umccr/cttso-ica-to-pieriandx/pull/201) + * Resolves https://github.com/umccr/cttso-ica-to-pieriandx/issues/200 + +### Enhancements +* Use global var for NTC Subject ID (https://github.com/umccr/cttso-ica-to-pieriandx/pull/202) + + ## 2023-11-22 > Author: Alexis Lucattini