Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Quick hotfixes updates (#186, #187, #188) #189

Merged
merged 7 commits into from
Nov 22, 2023
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
14 changes: 14 additions & 0 deletions deploy/cttso-ica-to-pieriandx-cdk/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: [[email protected]](mailto:[email protected])

### 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
Expand Down
2 changes: 1 addition & 1 deletion deploy/cttso-ica-to-pieriandx-cdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
]

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down