Skip to content

Commit

Permalink
minor bugfixes for heredicare upload
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinDo committed Aug 19, 2024
1 parent 6fbfe74 commit 957f4b4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/common/heredicare_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ def get_variant_items(self, variant, vid, submission_id, post_regexes, transacti
item_name = "REFSEQ"
item_regex = post_regexes[item_name]
new_value = heredicare_variant["REFSEQ"] if transaction_type == 'UPDATE' else preferred_transcript
if not self.is_valid_post_data(new_value, item_regex):
if not self.is_valid_post_data(new_value, item_regex, none_allowed = True):
status = "error"
message = "The " + item_name + " (" + str(new_value) + ") from vid " + str(vid) + " does not match the expected regex pattern: " + item_regex
return all_items, status, message
Expand Down Expand Up @@ -554,7 +554,7 @@ def get_consensus_classification_items(self, variant, vid, submission_id, post_r
status = "error"
message = "The " + item_name + " (" + str(new_value) + ") from vid " + str(vid) + " does not match the expected regex pattern: " + item_regex
return all_items, status, message
old_value = old_value = heredicare_variant["VUSTF_21"] if transaction_type == 'UPDATE' else None #self.get_heredicare_consensus_attribute(variant, vid, "comment")
old_value = heredicare_variant["VUSTF_21"] if transaction_type == 'UPDATE' else None #self.get_heredicare_consensus_attribute(variant, vid, "comment")
new_item = self.get_postable_item(record_id = vid, submission_id = submission_id, item_name = item_name, old_value = old_value, new_value = new_value)
all_items.append(new_item)

Expand All @@ -568,6 +568,9 @@ def is_valid_post_data(self, value, regex, none_allowed = False):
return False
pattern = re.compile(regex)
result = pattern.match(value)
print(regex)
print(result)
print(value)
if result is None:
return False
return True
Expand Down

0 comments on commit 957f4b4

Please sign in to comment.