Skip to content

Commit

Permalink
fix molecConseq FHIR mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
rhdolin committed Jun 14, 2024
1 parent cfca9c8 commit 0eff356
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
.pytest_cache
__pycache__
.venv
utilities/FASTA
14 changes: 10 additions & 4 deletions app/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,17 @@ def create_molecular_consequence_profile(molecular_consequence, subject, vids):
"code": f"{feature_consequence['code']}",
"display": f"{feature_consequence['display']}"}]}})

if 'functionalEffect' in molecular_consequence:
for functionalEffect in molecular_consequence["functionalEffect"]:
resource["component"].append({"code": {"coding": [{"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/tbd-codes-cs",
"code": "functional-effect",
"display": "Functional Effect"}]},
"valueCodeableConcept": {"coding": [{"system": f"{functionalEffect['system']}",
"code": f"{functionalEffect['code']}",
"display": f"{functionalEffect['display']}"}]}})

if 'impact' in molecular_consequence:
resource["component"].append({"code": {"coding": [{"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/tbd-codes-cs",
"code": "functional-effect",
"display": "Functional Effect"}]},
"valueCodeableConcept": {"text": f"{molecular_consequence['impact']}"}})
resource["interpretation"] = [{"text": molecular_consequence['impact']}]

return resource

Expand Down

0 comments on commit 0eff356

Please sign in to comment.