Skip to content

Commit

Permalink
add conditional requirement on MappableConcept (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
larrybabb authored Nov 16, 2024
1 parent 0f315ae commit 2f8a937
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
1 change: 0 additions & 1 deletion examples/mappable-concept-gene.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
id: HGNC:1101
primaryCode: BRCA2
label: BRCA2 DNA repair associated
conceptType: Gene
mappings:
- coding:
Expand Down
2 changes: 1 addition & 1 deletion schema/gks-core/def/MappableConcept.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Some MappableConcept attributes are inherited from :ref:`Element`.
* - label
-
- string
- 1..1
- 0..1
- A primary name for the concept.
* - primaryCode
-
Expand Down
7 changes: 5 additions & 2 deletions schema/gks-core/gks-core-source.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,11 @@ $defs:
description: >-
A list of mappings to concepts in terminologies or code systems. Each mapping should
include a coding and a relation.
required:
- label
oneOf:
- required:
- label
- required:
- primaryCode

ConceptMapping:
type: object
Expand Down
14 changes: 12 additions & 2 deletions schema/gks-core/json/MappableConcept
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,18 @@
"description": "A list of mappings to concepts in terminologies or code systems. Each mapping should include a coding and a relation."
}
},
"required": [
"label"
"oneOf": [
{
"required": [
"label"
]
},
{
"required": [
"primaryCode"
]
}
],
"required": [],
"additionalProperties": false
}

0 comments on commit 2f8a937

Please sign in to comment.