Skip to content

Commit

Permalink
KPMP-5527: Changes to handle errors seen
Browse files Browse the repository at this point in the history
  • Loading branch information
rlreamy committed Aug 28, 2024
1 parent e29f009 commit b39b29d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion data_management/lib/spectrack_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def get_results(self, url: str, params: dict = {}):
"There was a problem decoding the JSON from: "
+ url
+ " with params "
+ params
+ str(params), error
)
return res_json

Expand Down
7 changes: 5 additions & 2 deletions data_management/services/spectrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ def convert_to_dmd_specimens(self, specimens: list):
specimen["redcap_record_id"] is not None
):
specimen_kit = self.get_specimen_kit(specimen["specimen_kit_id"])
if "Biopsy Kit" in specimen_kit["kit_type_name"]:
if specimen["specimen_kit_id"] and "Biopsy Kit" in specimen_kit["kit_type_name"]:
print(specimen["sample_id"])
print(specimen["redcap_record_id"])
biopsy = self.get_biopsy(specimen["redcap_record_id"])
site = biopsy["collecting_org"]["org_name"]
disease_category = biopsy["disease_category"]
Expand All @@ -71,6 +73,7 @@ def convert_to_dmd_specimens(self, specimens: list):
biopsy_date = None

sample_type = self.get_sample_type(specimen["sample_type_id"])
kit_id = "N/A" if specimen['specimen_kit_id'] is None else specimen['specimen_kit_id']
dmd_specimen_tuple = (
specimen["id"],
specimen["sample_id"],
Expand All @@ -80,7 +83,7 @@ def convert_to_dmd_specimens(self, specimens: list):
specimen["redcap_record_id"],
specimen["level"],
sample_type["sample_type_code"],
specimen["specimen_kit_id"],
kit_id,
specimen_kit["kit_type_name"],
specimen_kit["redcap_project_type"],
site,
Expand Down

0 comments on commit b39b29d

Please sign in to comment.