Skip to content

Commit

Permalink
Fixing ClinVar submission XML generation (#677)
Browse files Browse the repository at this point in the history
Closes: #677
Related-Issue: #677
Projected-Results-Impact: none
  • Loading branch information
holtgrewe committed Sep 20, 2022
1 parent 8e2fe3a commit 6b1db4e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
2 changes: 2 additions & 0 deletions HISTORY.rst
Expand Up @@ -57,6 +57,7 @@ End-User Summary
- Improving Clinvar filter performance (#635).
- Warning in the case of truncated displayed results (#641).
- Improving Clinvar record aggregation (#640).
- Fixing ClinVar submission XML generation (#677).

Full Change List
================
Expand Down Expand Up @@ -112,6 +113,7 @@ Full Change List
- Warning in the case of truncated displayed results (#641).
- Improving Clinvar record aggregation (#640).
- Fixing Docker builds (#660).
- Fixing ClinVar submission XML generation (#677).

------
v1.2.0
Expand Down
3 changes: 3 additions & 0 deletions clinvar_export/clinvar_xml.py
Expand Up @@ -260,6 +260,9 @@ def build_xref(term_id):
"id": phenotype["term_id"],
},
),
**{
"ClinicalFeaturesAffectedStatus": "present",
},
)
for phenotype in submission_individual.phenotypes
],
Expand Down
18 changes: 14 additions & 4 deletions clinvar_export/views_ajax.py
Expand Up @@ -254,10 +254,20 @@ def get(self, request, *args, **kwargs):
"valid": True,
}
else:
result = {
"valid": False,
"details": "\n".join(e.message for e in schema.error_log),
}
ignored_message = (
"Element 'Trait', attribute 'ClinicalFeaturesAffectedStatus': The attribute "
"'ClinicalFeaturesAffectedStatus' is not allowed."
)
filtered_es = [e for e in schema.error_log if e.message != ignored_message]
if filtered_es:
result = {
"valid": False,
"details": "\n".join(e.message for e in filtered_es),
}
else:
result = {
"valid": True,
}
return JsonResponse(result)

def _get_schema(self, root):
Expand Down

0 comments on commit 6b1db4e

Please sign in to comment.