diff --git a/deploy/cttso-ica-to-pieriandx-cdk/Changelog.md b/deploy/cttso-ica-to-pieriandx-cdk/Changelog.md index 6bc280b..8bfcb74 100644 --- a/deploy/cttso-ica-to-pieriandx-cdk/Changelog.md +++ b/deploy/cttso-ica-to-pieriandx-cdk/Changelog.md @@ -3,6 +3,20 @@ 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-22 + +> Author: Alexis Lucattini +> Email: [Alexis.Lucattini@umccr.org](mailto:alexis.lucattini@umccr.org) + +### Hotfixes +* Update disease name to disease label (https://github.com/umccr/cttso-ica-to-pieriandx/pull/188) + * Resolves https://github.com/umccr/cttso-ica-to-pieriandx/issues/183 +* Coerce is_identified to boolean (https://github.com/umccr/cttso-ica-to-pieriandx/pull/187) + * Resolves https://github.com/umccr/cttso-ica-to-pieriandx/issues/184 +* Use comma after needs_redcap column (https://github.com/umccr/cttso-ica-to-pieriandx/pull/186) + * Resolves https://github.com/umccr/cttso-ica-to-pieriandx/issues/185 + + ## 2023-11-08 > Author: Alexis Lucattini diff --git a/deploy/cttso-ica-to-pieriandx-cdk/README.md b/deploy/cttso-ica-to-pieriandx-cdk/README.md index 7a0aecf..eb27e18 100644 --- a/deploy/cttso-ica-to-pieriandx-cdk/README.md +++ b/deploy/cttso-ica-to-pieriandx-cdk/README.md @@ -65,7 +65,7 @@ new_headers = [ "pieriandx_case_identified", "pieriandx_assignee", "pieriandx_disease_code", - "pieriandx_disease_name", + "pieriandx_disease_label", "pieriandx_panel_type", "pieriandx_sample_type", "pieriandx_workflow_id", diff --git a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_defaults_and_launch_validation_workflow/lambda_code.py b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_defaults_and_launch_validation_workflow/lambda_code.py index df6f153..344cce7 100644 --- a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_defaults_and_launch_validation_workflow/lambda_code.py +++ b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_defaults_and_launch_validation_workflow/lambda_code.py @@ -90,10 +90,16 @@ def lambda_handler(event, context): sample_type = VALIDATION_DEFAULTS["sample_type"] # Get is identified - is_identified: str + is_identified: any # Union[str | bool] not supported in python=3.9 if (is_identified := event.get("is_identified", None)) is None: is_identified = VALIDATION_DEFAULTS["is_identified"] + # Coerce is_identified to a boolean value + if isinstance(is_identified, str) and is_identified == 'identified': + is_identified = True + elif isinstance(is_identified, str) and is_identified == 'deidentified': + is_identified = False + # Check disease name if (disease_name := event.get("disease_name", None)) is None: disease_name = VALIDATION_DEFAULTS["disease_name"] diff --git a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_redcap_and_launch_clinical_workflow/lambda_code.py b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_redcap_and_launch_clinical_workflow/lambda_code.py index 403f983..d383ed4 100644 --- a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_redcap_and_launch_clinical_workflow/lambda_code.py +++ b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/get_metadata_from_portal_and_redcap_and_launch_clinical_workflow/lambda_code.py @@ -210,9 +210,16 @@ def lambda_handler(event, context): if (sample_type := event.get("sample_type", None)) is None: sample_type = CLINICAL_DEFAULTS["sample_type"].name.lower() + is_identified: any # Union[str | bool] not supported in python=3.9 if (is_identified := event.get("is_identified", None)) is None: is_identified = CLINICAL_DEFAULTS["is_identified"].name.lower() + # Coerce is_identified to a boolean value + if isinstance(is_identified, str) and is_identified == 'identified': + is_identified = True + elif isinstance(is_identified, str) and is_identified == 'deidentified': + is_identified = False + # Set panel type (if not null) merged_df["panel_type"] = panel_type merged_df["sample_type"] = sample_type 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 ad15344..d7a3510 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 @@ -185,7 +185,7 @@ def get_libraries_for_processing(merged_df) -> pd.DataFrame: * pieriandx_assignee * pieriandx_case_identified * pieriandx_disease_code - * pieriandx_disease_name + * pieriandx_disease_label * pieriandx_panel_type * pieriandx_sample_type :return: A pandas dataframe with the following columns @@ -276,7 +276,7 @@ def get_libraries_for_processing(merged_df) -> pd.DataFrame: "panel", "sample_type", "is_identified", - "needs_redcap" + "needs_redcap", "default_snomed_term" ] @@ -489,7 +489,7 @@ def append_to_cttso_lims(merged_df: pd.DataFrame, cttso_lims_df: pd.DataFrame, e * pieriandx_case_identified * pieriandx_assignee * pieriandx_disease_code - * pieriandx_disease_name + * pieriandx_disease_label * pieriandx_panel_type * pieriandx_sample_type * pieriandx_workflow_id @@ -663,7 +663,7 @@ def get_pieriandx_incomplete_job_df_from_cttso_lims_df(cttso_lims_df: pd.DataFra * pieriandx_case_creation_date * pieriandx_case_identified * pieriandx_disease_code - * pieriandx_disease_name + * pieriandx_disease_label * pieriandx_panel_type * pieriandx_sample_type * pieriandx_workflow_id @@ -697,7 +697,7 @@ def get_pieriandx_incomplete_job_df_from_cttso_lims_df(cttso_lims_df: pd.DataFra * pieriandx_case_creation_date * pieriandx_case_identified * pieriandx_disease_code - * pieriandx_disease_name + * pieriandx_disease_label * pieriandx_panel_type * pieriandx_sample_type * pieriandx_workflow_id @@ -823,7 +823,7 @@ def update_pieriandx_job_status_missing_df(pieriandx_job_status_missing_df, merg * pieriandx_case_accession_number * pieriandx_case_identified * pieriandx_disease_code - * pieriandx_disease_name + * pieriandx_disease_label * pieriandx_panel_type * pieriandx_sample_type * pieriandx_workflow_id @@ -1140,7 +1140,7 @@ def update_cttso_lims(update_df: pd.DataFrame, cttso_lims_df: pd.DataFrame, exce * pieriandx_case_identified * pieriandx_assignee * pieriandx_disease_code - * pieriandx_disease_name + * pieriandx_disease_label * pieriandx_panel_type * pieriandx_sample_type * pieriandx_workflow_id @@ -1192,7 +1192,7 @@ def update_cttso_lims(update_df: pd.DataFrame, cttso_lims_df: pd.DataFrame, exce "pieriandx_assignee", "pieriandx_case_identified", "pieriandx_disease_code", - "pieriandx_disease_name", + "pieriandx_disease_label", "pieriandx_panel_type", "pieriandx_sample_type", "pieriandx_workflow_id", @@ -1249,7 +1249,7 @@ def get_duplicate_case_ids(lims_df: pd.DataFrame) -> List: * pieriandx_case_creation_date * pieriandx_assignee * pieriandx_disease_code - * pieriandx_disease_name + * pieriandx_disease_label * pieriandx_panel_type * pieriandx_sample_type * pieriandx_workflow_id @@ -1447,7 +1447,7 @@ def cleanup_duplicate_rows(merged_df: pd.DataFrame, cttso_lims_df: pd.DataFrame, * pieriandx_case_identified * pieriandx_assignee * pieriandx_disease_code - * pieriandx_disease_name + * pieriandx_disease_label * pieriandx_panel_type * pieriandx_sample_type * pieriandx_workflow_id @@ -1511,7 +1511,7 @@ def cleanup_duplicate_rows(merged_df: pd.DataFrame, cttso_lims_df: pd.DataFrame, * pieriandx_case_identified * pieriandx_assignee * pieriandx_disease_code - * pieriandx_disease_name + * pieriandx_disease_label * pieriandx_panel_type * pieriandx_sample_type * pieriandx_workflow_id @@ -1689,7 +1689,7 @@ def bind_pieriandx_case_submission_time_to_merged_df(merged_df: pd.DataFrame, ct * pieriandx_case_identified * pieriandx_assignee * pieriandx_disease_code - * pieriandx_disease_name + * pieriandx_disease_label * pieriandx_panel_type * pieriandx_sample_type * pieriandx_workflow_id @@ -1722,7 +1722,7 @@ def bind_pieriandx_case_submission_time_to_merged_df(merged_df: pd.DataFrame, ct * pieriandx_case_creation_date * pieriandx_assignee * pieriandx_disease_code - * pieriandx_disease_name + * pieriandx_disease_label * pieriandx_panel_type * pieriandx_sample_type * pieriandx_workflow_id @@ -1970,7 +1970,7 @@ def drop_to_be_deleted_cases(merged_df: pd.DataFrame, cttso_lims_df: pd.DataFram * pieriandx_case_identified * pieriandx_assignee * pieriandx_disease_code - * pieriandx_disease_name + * pieriandx_disease_label * pieriandx_panel_type * pieriandx_sample_type * pieriandx_workflow_id diff --git a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/layers/lambda_utils/gspread_helpers.py b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/layers/lambda_utils/gspread_helpers.py index 162742a..6526467 100644 --- a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/layers/lambda_utils/gspread_helpers.py +++ b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/layers/lambda_utils/gspread_helpers.py @@ -223,7 +223,7 @@ def get_cttso_lims() -> (pd.DataFrame, pd.DataFrame): * pieriandx_case_identified * pieriandx_assignee * pieriandx_disease_code - * pieriandx_disease_name + * pieriandx_disease_label * pieriandx_panel_type * pieriandx_sample_type * pieriandx_workflow_id @@ -302,7 +302,7 @@ def get_deleted_lims_df() -> (pd.DataFrame, pd.DataFrame): * pieriandx_case_identified * pieriandx_assignee * pieriandx_disease_code - * pieriandx_disease_name + * pieriandx_disease_label * pieriandx_panel_type * pieriandx_sample_type * pieriandx_workflow_id diff --git a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/layers/lambda_utils/pieriandx_helpers.py b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/layers/lambda_utils/pieriandx_helpers.py index 6e01185..2b9b5bb 100644 --- a/deploy/cttso-ica-to-pieriandx-cdk/lambdas/layers/lambda_utils/pieriandx_helpers.py +++ b/deploy/cttso-ica-to-pieriandx-cdk/lambdas/layers/lambda_utils/pieriandx_helpers.py @@ -398,7 +398,7 @@ def get_pieriandx_status_for_missing_sample(case_id: str) -> pd.Series: * pieriandx_case_accession_number * pieriandx_case_identified * pieriandx_disease_code - * pieriandx_disease_name + * pieriandx_disease_label * pieriandx_panel_type * pieriandx_workflow_id * pieriandx_workflow_status @@ -440,7 +440,7 @@ def get_pieriandx_status_for_missing_sample(case_id: str) -> pd.Series: "pieriandx_case_accession_number": response.get("specimens")[0].get("accessionNumber"), "pieriandx_case_identified": response.get("identified", False), "pieriandx_disease_code": response.get("disease").get("code"), - "pieriandx_disease_name": response.get("disease").get("name"), + "pieriandx_disease_label": response.get("disease").get("label"), "pieriandx_panel_type": PanelType(response.get("panelName")).name, "pieriandx_sample_type": SampleType(response.get("sampleType")).name, "pieriandx_workflow_id": pd.NA,