Skip to content

Commit

Permalink
Merge c150b5e into feeceac
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe committed Sep 20, 2022
2 parents feeceac + c150b5e commit 4c68ebd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
2 changes: 2 additions & 0 deletions HISTORY.rst
Expand Up @@ -16,6 +16,7 @@ End-User Summary
**This will require an import of the updated Clinvar ``20210728c`` data (#296).**
- Warning in the case of truncated displayed results (#641).
- Improving Clinvar record aggregation (#640).
- Fixing ClinVar submission XML generation (#677).

Full Change List
================
Expand All @@ -28,6 +29,7 @@ Full Change List
**This will require an import of the updated Clinvar ``20210728c`` data (#296).**
- Improving Clinvar record aggregation (#640).
- Fixing Docker builds (#660).
- Fixing ClinVar submission XML generation (#677).

-----------------
v1.2.2 (anthenea)
Expand Down
3 changes: 2 additions & 1 deletion clinvar_export/clinvar_xml.py
Expand Up @@ -223,7 +223,8 @@ def build_xref(term_id):
self.em("ElementValueType", "Preferred", **{"val_type": "name"}),
self.em("ElementValue", phenotype["term_name"]),
),
self.em("XRef", **{"db": "HP", "id": phenotype["term_id"],}),
self.em("XRef", **{"db": "HP", "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 @@ -258,10 +258,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 4c68ebd

Please sign in to comment.