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

variant inner end error fix and code-system update #98

Merged
merged 1 commit into from
Apr 5, 2022
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
19 changes: 8 additions & 11 deletions vcf2fhir/fhir_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def add_diagnostic_implication(
if annotation_record['phenotype'] is not None:
associated_phenotype_component = observation.ObservationComponent()
associated_phenotype_component.code = get_codeable_concept(
"http://loinc.org", "81259-4", "Associated phenotype"
"http://loinc.org", "81259-4", "predicted phenotype"
)
associated_phenotype_component\
.valueCodeableConcept = get_codeable_concept(
Expand Down Expand Up @@ -282,14 +282,13 @@ def add_variant_obv(
# only the INFO.END value.
if hasattr(record.INFO, 'CIPOS') and hasattr(record.INFO, 'CIEND'):
inner_start = record.POS + record.INFO['CIPOS'][1]
inner_end = record.INFO['END'] + abs(record.INFO['CIEND'][0])
inner_end = record.INFO['END'] - abs(record.INFO['CIEND'][0])
outer_start = record.POS - abs(record.INFO['CIPOS'][0])
outer_end = record.INFO['END'] + record.INFO['CIEND'][1]
outer_start_end_component = observation.ObservationComponent()
outer_start_end_component.code = get_codeable_concept(
("http://hl7.org/fhir/uv/genomics-reporting" +
"/CodeSystem/TbdCodes"),
"outer-start-end", "Variant outer start and end"
"http://loinc.org", "81301-4",
"Variant outer start-end"
)
outer_start_end_component\
.valueRange = valRange.Range(
Expand All @@ -308,9 +307,8 @@ def add_variant_obv(

inner_start_end_component = observation.ObservationComponent()
inner_start_end_component.code = get_codeable_concept(
("http://hl7.org/fhir/uv/ge" +
"nomics-reporting/CodeSystem/TbdCodes"), "inner-start-end",
"Variant inner start and end"
"http://loinc.org", "81302-2",
"Variant inner start-end"
)
inner_start_end_component\
.valueRange = valRange.Range(
Expand Down Expand Up @@ -341,9 +339,8 @@ def add_variant_obv(

exact_start_end_component = observation.ObservationComponent()
exact_start_end_component.code = get_codeable_concept(
("http://hl7.org/fhir/uv/genomics-reporting/Code" +
"System/TbdCodes"), "exact-start-end",
"Variant exact start and end"
"http://loinc.org", "81254-5",
"Variant exact start-end"
)
exact_start_end_component.valueRange = valRange.Range(
{"low": {"value": int(record.POS)}})
Expand Down
40 changes: 20 additions & 20 deletions vcf2fhir/test/expected_annotation.json
Original file line number Diff line number Diff line change
Expand Up @@ -601,9 +601,9 @@
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/TbdCodes",
"code": "exact-start-end",
"display": "Variant exact start and end"
"system": "http://loinc.org",
"code": "81254-5",
"display": "Variant exact start-end"
}
]
},
Expand Down Expand Up @@ -673,7 +673,7 @@
{
"system": "http://loinc.org",
"code": "81259-4",
"display": "Associated phenotype"
"display": "predicted phenotype"
}
]
},
Expand Down Expand Up @@ -1012,9 +1012,9 @@
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/TbdCodes",
"code": "exact-start-end",
"display": "Variant exact start and end"
"system": "http://loinc.org",
"code": "81254-5",
"display": "Variant exact start-end"
}
]
},
Expand Down Expand Up @@ -1084,7 +1084,7 @@
{
"system": "http://loinc.org",
"code": "81259-4",
"display": "Associated phenotype"
"display": "predicted phenotype"
}
]
},
Expand Down Expand Up @@ -1312,9 +1312,9 @@
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/TbdCodes",
"code": "exact-start-end",
"display": "Variant exact start and end"
"system": "http://loinc.org",
"code": "81254-5",
"display": "Variant exact start-end"
}
]
},
Expand Down Expand Up @@ -1384,7 +1384,7 @@
{
"system": "http://loinc.org",
"code": "81259-4",
"display": "Associated phenotype"
"display": "predicted phenotype"
}
]
},
Expand Down Expand Up @@ -1704,9 +1704,9 @@
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/TbdCodes",
"code": "exact-start-end",
"display": "Variant exact start and end"
"system": "http://loinc.org",
"code": "81254-5",
"display": "Variant exact start-end"
}
]
},
Expand Down Expand Up @@ -1776,7 +1776,7 @@
{
"system": "http://loinc.org",
"code": "81259-4",
"display": "Associated phenotype"
"display": "predicted phenotype"
}
]
},
Expand Down Expand Up @@ -2429,9 +2429,9 @@
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/TbdCodes",
"code": "exact-start-end",
"display": "Variant exact start and end"
"system": "http://loinc.org",
"code": "81254-5",
"display": "Variant exact start-end"
}
]
},
Expand Down Expand Up @@ -2501,7 +2501,7 @@
{
"system": "http://loinc.org",
"code": "81259-4",
"display": "Associated phenotype"
"display": "predicted phenotype"
}
]
},
Expand Down
42 changes: 21 additions & 21 deletions vcf2fhir/test/expected_example1_with_patient.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/TbdCodes",
"code": "exact-start-end",
"display": "Variant exact start and end"
"system": "http://loinc.org",
"code": "81254-5",
"display": "Variant exact start-end"
}
]
},
Expand Down Expand Up @@ -373,9 +373,9 @@
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/TbdCodes",
"code": "exact-start-end",
"display": "Variant exact start and end"
"system": "http://loinc.org",
"code": "81254-5",
"display": "Variant exact start-end"
}
]
},
Expand Down Expand Up @@ -592,9 +592,9 @@
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/TbdCodes",
"code": "exact-start-end",
"display": "Variant exact start and end"
"system": "http://loinc.org",
"code": "81254-5",
"display": "Variant exact start-end"
}
]
},
Expand Down Expand Up @@ -811,9 +811,9 @@
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/TbdCodes",
"code": "exact-start-end",
"display": "Variant exact start and end"
"system": "http://loinc.org",
"code": "81254-5",
"display": "Variant exact start-end"
}
]
},
Expand Down Expand Up @@ -1030,9 +1030,9 @@
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/TbdCodes",
"code": "exact-start-end",
"display": "Variant exact start and end"
"system": "http://loinc.org",
"code": "81254-5",
"display": "Variant exact start-end"
}
]
},
Expand Down Expand Up @@ -1249,9 +1249,9 @@
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/TbdCodes",
"code": "exact-start-end",
"display": "Variant exact start and end"
"system": "http://loinc.org",
"code": "81254-5",
"display": "Variant exact start-end"
}
]
},
Expand Down Expand Up @@ -1468,9 +1468,9 @@
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/TbdCodes",
"code": "exact-start-end",
"display": "Variant exact start and end"
"system": "http://loinc.org",
"code": "81254-5",
"display": "Variant exact start-end"
}
]
},
Expand Down
42 changes: 21 additions & 21 deletions vcf2fhir/test/expected_example1_wo_patient.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/TbdCodes",
"code": "exact-start-end",
"display": "Variant exact start and end"
"system": "http://loinc.org",
"code": "81254-5",
"display": "Variant exact start-end"
}
]
},
Expand Down Expand Up @@ -373,9 +373,9 @@
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/TbdCodes",
"code": "exact-start-end",
"display": "Variant exact start and end"
"system": "http://loinc.org",
"code": "81254-5",
"display": "Variant exact start-end"
}
]
},
Expand Down Expand Up @@ -592,9 +592,9 @@
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/TbdCodes",
"code": "exact-start-end",
"display": "Variant exact start and end"
"system": "http://loinc.org",
"code": "81254-5",
"display": "Variant exact start-end"
}
]
},
Expand Down Expand Up @@ -811,9 +811,9 @@
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/TbdCodes",
"code": "exact-start-end",
"display": "Variant exact start and end"
"system": "http://loinc.org",
"code": "81254-5",
"display": "Variant exact start-end"
}
]
},
Expand Down Expand Up @@ -1030,9 +1030,9 @@
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/TbdCodes",
"code": "exact-start-end",
"display": "Variant exact start and end"
"system": "http://loinc.org",
"code": "81254-5",
"display": "Variant exact start-end"
}
]
},
Expand Down Expand Up @@ -1249,9 +1249,9 @@
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/TbdCodes",
"code": "exact-start-end",
"display": "Variant exact start and end"
"system": "http://loinc.org",
"code": "81254-5",
"display": "Variant exact start-end"
}
]
},
Expand Down Expand Up @@ -1468,9 +1468,9 @@
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/uv/genomics-reporting/CodeSystem/TbdCodes",
"code": "exact-start-end",
"display": "Variant exact start and end"
"system": "http://loinc.org",
"code": "81254-5",
"display": "Variant exact start-end"
}
]
},
Expand Down
Loading