Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix molecConseq FHIR mapping #90

Merged
merged 2 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
17 changes: 4 additions & 13 deletions tests/expected_outputs/find_subject_molecular_consequences/1.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,11 @@
}
]
}
},
}
],
"interpretation": [
{
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/tbd-codes-cs",
"code": "functional-effect",
"display": "Functional Effect"
}
]
},
"valueCodeableConcept": {
"text": "MODERATE"
}
"text": "MODERATE"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,20 @@
]
},
"valueCodeableConcept": {
"text": "HIGH"
"coding": [
{
"system": "http://sequenceontology.org",
"code": "SO:0002054",
"display": "loss_of_function_variant"
}
]
}
}
],
"interpretation": [
{
"text": "HIGH"
}
]
}
},
Expand Down
Loading