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

Hotfixes for type hinting error #203

Merged
merged 5 commits into from
Nov 26, 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
10 changes: 10 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: [[email protected]](mailto:[email protected])

### 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
Expand Down
13 changes: 13 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,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: [[email protected]](mailto:[email protected])

### 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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
)

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