From 45428649e5ac358d552699b33354debb19252e8c Mon Sep 17 00:00:00 2001 From: Kori Kuzma Date: Tue, 23 Jun 2026 11:46:30 -0400 Subject: [PATCH 1/4] feat!: store allele origin as mapping, not extension close #232 --- civicpy/exports/civic_gks_record.py | 7 ++++++- civicpy/tests/test_exports.py | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/civicpy/exports/civic_gks_record.py b/civicpy/exports/civic_gks_record.py index b9d0eba..0c3546b 100644 --- a/civicpy/exports/civic_gks_record.py +++ b/civicpy/exports/civic_gks_record.py @@ -634,7 +634,12 @@ def get_allele_origin_qualifier(record: Evidence | Assertion) -> MappableConcept return MappableConcept( name=VARIANT_ORIGIN_TO_ALLELE_ORIGIN[variant_origin], - extensions=[Extension(name="civic_variant_origin", value=variant_origin)], + mappings=[ + ConceptMapping( + coding=Coding(code="SOMATIC", system="https://civicdb.org"), + relation=Relation.EXACT_MATCH, + ) + ], ) @staticmethod diff --git a/civicpy/tests/test_exports.py b/civicpy/tests/test_exports.py index 2739d52..404bbc0 100644 --- a/civicpy/tests/test_exports.py +++ b/civicpy/tests/test_exports.py @@ -368,7 +368,12 @@ def gks_therapeutic_proposition(gks_mpid33, gks_gid19, gks_tid146, gks_did8): "geneContextQualifier": gks_gid19, "alleleOriginQualifier": { "name": "somatic", - "extensions": [{"name": "civic_variant_origin", "value": "SOMATIC"}], + "mappings": [ + { + "coding": {"code": "SOMATIC", "system": "https://civicdb.org"}, + "relation": "exactMatch", + } + ], }, "predicate": "predictsSensitivityTo", "objectTherapeutic": gks_tid146, From 6b48250cbd45447b01368d36a0b177a6751ed54b Mon Sep 17 00:00:00 2001 From: Kori Kuzma Date: Thu, 25 Jun 2026 08:17:59 -0400 Subject: [PATCH 2/4] dont hardcode + apply aw suggestions --- civicpy/exports/civic_gks_record.py | 10 +++++++++- civicpy/tests/test_exports.py | 8 +++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/civicpy/exports/civic_gks_record.py b/civicpy/exports/civic_gks_record.py index 0c3546b..8ab5058 100644 --- a/civicpy/exports/civic_gks_record.py +++ b/civicpy/exports/civic_gks_record.py @@ -636,7 +636,15 @@ def get_allele_origin_qualifier(record: Evidence | Assertion) -> MappableConcept name=VARIANT_ORIGIN_TO_ALLELE_ORIGIN[variant_origin], mappings=[ ConceptMapping( - coding=Coding(code="SOMATIC", system="https://civicdb.org"), + coding=Coding( + code=variant_origin, + system="CIViC Knowledgebase", + iris=[ + iriReference( + root="https://civic.readthedocs.io/en/latest/model/evidence/origin.html" + ) + ], + ), relation=Relation.EXACT_MATCH, ) ], diff --git a/civicpy/tests/test_exports.py b/civicpy/tests/test_exports.py index 404bbc0..9f0a38c 100644 --- a/civicpy/tests/test_exports.py +++ b/civicpy/tests/test_exports.py @@ -370,7 +370,13 @@ def gks_therapeutic_proposition(gks_mpid33, gks_gid19, gks_tid146, gks_did8): "name": "somatic", "mappings": [ { - "coding": {"code": "SOMATIC", "system": "https://civicdb.org"}, + "coding": { + "code": "SOMATIC", + "system": "CIViC Knowledgebase", + "iris": [ + "https://civic.readthedocs.io/en/latest/model/evidence/origin.html" + ], + }, "relation": "exactMatch", } ], From 36e10774f07977ce1df45b5ff727f18640495dbc Mon Sep 17 00:00:00 2001 From: Kori Kuzma Date: Mon, 29 Jun 2026 16:40:16 -0400 Subject: [PATCH 3/4] Apply suggestion from @korikuzma aw wants this --- civicpy/exports/civic_gks_record.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/civicpy/exports/civic_gks_record.py b/civicpy/exports/civic_gks_record.py index 8ab5058..59e9610 100644 --- a/civicpy/exports/civic_gks_record.py +++ b/civicpy/exports/civic_gks_record.py @@ -638,7 +638,7 @@ def get_allele_origin_qualifier(record: Evidence | Assertion) -> MappableConcept ConceptMapping( coding=Coding( code=variant_origin, - system="CIViC Knowledgebase", + system="https://civicdb.org", iris=[ iriReference( root="https://civic.readthedocs.io/en/latest/model/evidence/origin.html" From 99ba1368b5aef415d970b1aa0650345226a8bd5f Mon Sep 17 00:00:00 2001 From: Kori Kuzma Date: Tue, 30 Jun 2026 10:10:02 -0400 Subject: [PATCH 4/4] update system in tests --- civicpy/tests/test_exports.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/civicpy/tests/test_exports.py b/civicpy/tests/test_exports.py index 1f1ff01..41f23f3 100644 --- a/civicpy/tests/test_exports.py +++ b/civicpy/tests/test_exports.py @@ -372,7 +372,7 @@ def gks_therapeutic_proposition(gks_mpid33, gks_gid19, gks_tid146, gks_did8): { "coding": { "code": "SOMATIC", - "system": "CIViC Knowledgebase", + "system": "https://civicdb.org", "iris": [ "https://civic.readthedocs.io/en/latest/model/evidence/origin.html" ],