Skip to content

Commit

Permalink
Merge pull request #77 from mihaitodor/omit-evidence-level-none
Browse files Browse the repository at this point in the history
Omit null evidenceLevel for find-subject-tx-implications
  • Loading branch information
rhdolin authored Oct 19, 2023
2 parents 73d2563 + 9eacf9f commit 1283d79
Show file tree
Hide file tree
Showing 3 changed files with 282 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ def create_tx_implication_profile_civic(implication, subject, vids):
"code": f"{ptc['code']}",
"display": f"{ptc['display']}"}]}})

if 'evidenceLevel' in implication:
if 'evidenceLevel' in implication and implication['evidenceLevel']:
resource["component"].append({"code": {"coding": [{"system": "http://loinc.org",
"code": "93044-6",
"display": "Level of evidence"}]},
Expand Down
274 changes: 274 additions & 0 deletions tests/expected_outputs/find_subject_tx_implications/8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,274 @@
{
"resourceType": "Parameters",
"parameter": [
{
"name": "implications",
"part": [
{
"name": "implication",
"resource": {
"resourceType": "Observation",
"id": "dv-6508ea502171de9b6d744454",
"meta": {
"profile": [
"http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/therapeutic-implication"
]
},
"status": "final",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "laboratory"
}
]
}
],
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/tbd-codes-cs",
"code": "therapeutic-implication"
}
]
},
"subject": {
"reference": "Patient/TCGA-DD-A1EH"
},
"derivedFrom": [
{
"reference": "Observation/dv-dd9754abe5954342896ff349289ca20d"
}
],
"component": [
{
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "81259-4",
"display": "phenotypic treatment context"
}
]
},
"valueCodeableConcept": {
"coding": [
{
"system": "https://disease-ontology.org",
"code": "684",
"display": "Hepatocellular carcinoma"
}
]
}
},
{
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "51963-7",
"display": "medication-assessed"
}
]
},
"valueCodeableConcept": {
"coding": [
{
"system": "https://clinicaltrials.gov/",
"code": "NCT05023655",
"display": "NCT05023655"
}
]
}
},
{
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/tbd-codes-cs",
"code": "predicted-therapeutic-implication",
"display": "predicted-therapeutic-implication"
}
]
},
"valueCodeableConcept": {
"text": "Patient eligible for clinical trial"
}
}
]
}
},
{
"name": "variant",
"resource": {
"resourceType": "Observation",
"id": "dv-dd9754abe5954342896ff349289ca20d",
"meta": {
"profile": [
"http://hl7.org/fhir/uv/genomics-reporting/StructureDefinition/variant"
]
},
"status": "final",
"category": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"code": "laboratory"
}
]
}
],
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "69548-6",
"display": "Genetic variant assessment"
}
]
},
"subject": {
"reference": "Patient/TCGA-DD-A1EH"
},
"valueCodeableConcept": {
"coding": [
{
"system": "http://loinc.org",
"code": "LA9633-4",
"display": "present"
}
]
},
"component": [
{
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "48002-0",
"display": "Genomic Source Class"
}
]
},
"valueCodeableConcept": {
"coding": [
{
"system": "http://loinc.org",
"code": "LA6684-0",
"display": "somatic"
}
]
}
},
{
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "48013-7",
"display": "Genomic reference sequence ID"
}
]
},
"valueCodeableConcept": {
"coding": [
{
"system": "http://www.ncbi.nlm.nih.gov/nuccore",
"code": "NC_000001.10"
}
]
}
},
{
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "81252-9",
"display": "Discrete genetic variant"
}
]
},
"valueCodeableConcept": {
"coding": [
{
"system": "https://api.ncbi.nlm.nih.gov/variation/v0/",
"code": "NC_000001.10:27106893::T",
"display": "NC_000001.10:27106893::T"
},
{
"system": "https://clinicaltrials.gov/",
"code": "NCT05023655"
}
]
}
},
{
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "69547-8",
"display": "Genomic Ref allele [ID]"
}
]
},
"valueString": "G"
},
{
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "69551-0",
"display": "Genomic Alt allele [ID]"
}
]
},
"valueString": "GT"
},
{
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "92822-6",
"display": "Genomic coord system"
}
]
},
"valueCodeableConcept": {
"coding": [
{
"system": "http://loinc.org",
"code": "LA30100-4",
"display": "0-based interval counting"
}
]
}
},
{
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "81254-5",
"display": "Variant exact start-end"
}
]
},
"valueRange": {
"low": {
"value": 27106892
}
}
}
]
}
}
]
}
]
}
7 changes: 7 additions & 0 deletions tests/integration_tests/test_subject_phenotype_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ def test_find_subject_tx_implications_7(client):
tu.compare_actual_and_expected_output(f'{tu.FIND_SUBJECT_TX_IMPLICATIONS_OUTPUT_DIR}7.json', response.json)


def test_find_subject_tx_implications_8(client):
url = tu.find_subject_tx_implications_query('subject=TCGA-DD-A1EH&variants=NC_000001.10:27106893::T&conditions=https://disease-ontology.org|684')
response = client.get(url)

tu.compare_actual_and_expected_output(f'{tu.FIND_SUBJECT_TX_IMPLICATIONS_OUTPUT_DIR}8.json', response.json)


"""
Find Subject Dx Implications Tests
----------------------------------
Expand Down

0 comments on commit 1283d79

Please sign in to comment.