Skip to content

Commit

Permalink
test cases for conceptmap validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Grahame Grieve committed Sep 5, 2023
1 parent 3e7df8c commit 66827fa
Show file tree
Hide file tree
Showing 5 changed files with 288 additions and 1 deletion.
46 changes: 46 additions & 0 deletions validator/cm-cs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"resourceType" : "CodeSystem",
"id" : "ch-ig-example",
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">Placeholder</div>"
},
"url" : "http://fhir.ch/ig/ch-ig/CodeSystem/ch-ig-example",
"version" : "0.1.0",
"name" : "ChIgExample",
"title" : "CH IG Example",
"status" : "draft",
"experimental" : true,
"date" : "2023-09-05T12:08:22+00:00",
"publisher" : "HL7 Switzerland",
"contact" : [{
"name" : "HL7 Switzerland",
"telecom" : [{
"system" : "url",
"value" : "https://www.hl7.ch/"
}]
}],
"description" : "CH IG Example code system is just an example!",
"jurisdiction" : [{
"coding" : [{
"system" : "urn:iso:std:iso:3166",
"code" : "CHE"
}]
}],
"copyright" : "CC0-1.0",
"caseSensitive" : true,
"content" : "complete",
"count" : 3,
"concept" : [{
"code" : "med",
"display" : "Example med"
},
{
"code" : "pharm",
"display" : "Example pharm"
},
{
"code" : "vac",
"display" : "Example vac"
}]
}
42 changes: 42 additions & 0 deletions validator/cm-vs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"resourceType" : "ValueSet",
"id" : "OrganizationType",
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">Placeholder</div>"
},
"url" : "http://fhir.ch/ig/ch-ig/ValueSet/ch-ig-example",
"version" : "0.1.0",
"name" : "OrganizationType",
"title" : "Organization Type",
"status" : "draft",
"experimental" : true,
"date" : "2023-09-05T12:08:22+00:00",
"publisher" : "HL7 Switzerland",
"contact" : [{
"name" : "HL7 Switzerland",
"telecom" : [{
"system" : "url",
"value" : "https://www.hl7.ch/"
}]
}],
"description" : "Test value set",
"jurisdiction" : [{
"coding" : [{
"system" : "urn:iso:std:iso:3166",
"code" : "CHE"
}]
}],
"copyright" : "CC0-1.0",
"compose" : {
"include" : [{
"system" : "http://fhir.ch/ig/ch-ig/CodeSystem/ch-ig-example",
"concept" : [{
"code" : "pharm"
},
{
"code" : "vac"
}]
}]
}
}
45 changes: 45 additions & 0 deletions validator/cm-vs2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"resourceType" : "ValueSet",
"id" : "OrganizationType",
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">Placeholder</div>"
},
"url" : "http://fhir.ch/ig/ch-ig/ValueSet/OrganizationType",
"version" : "0.1.0",
"name" : "OrganizationType",
"title" : "Organization Type",
"status" : "draft",
"experimental" : true,
"date" : "2023-09-05T12:08:22+00:00",
"publisher" : "HL7 Switzerland",
"contact" : [{
"name" : "HL7 Switzerland",
"telecom" : [{
"system" : "url",
"value" : "https://www.hl7.ch/"
}]
}],
"description" : "Test value set",
"jurisdiction" : [{
"coding" : [{
"system" : "urn:iso:std:iso:3166",
"code" : "CHE"
}]
}],
"copyright" : "CC0-1.0",
"compose" : {
"include" : [{
"system" : "http://snomed.info/sct",
"version" : "http://snomed.info/sct/2011000195101",
"concept" : [{
"code" : "288565001",
"display" : "Medical center (environment)"
},
{
"code" : "264372000",
"display" : "Pharmacy (environment)"
}]
}]
}
}
59 changes: 59 additions & 0 deletions validator/cm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"resourceType" : "ConceptMap",
"id" : "OrganizationTypeToTest",
"text" : {
"status" : "extensions",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">Placeholder</div>"
},
"url" : "http://fhir.ch/ig/ch-ig/ConceptMap/OrganizationTypeToTest",
"version" : "0.1.0",
"name" : "OrganizationType",
"title" : "Organization Type Mapping",
"status" : "active",
"experimental" : true,
"date" : "2023-09-05T12:08:22+00:00",
"publisher" : "HL7 Switzerland",
"contact" : [{
"name" : "HL7 Switzerland",
"telecom" : [{
"system" : "url",
"value" : "https://www.hl7.ch/"
}]
}],
"description" : "Test ConceptMap",
"jurisdiction" : [{
"coding" : [{
"system" : "urn:iso:std:iso:3166",
"code" : "CHE"
}]
}],
"copyright" : "CC0-1.0",
"sourceCanonical" : "http://fhir.ch/ig/ch-ig/ValueSet/ch-ig-example",
"targetCanonical" : "http://fhir.ch/ig/ch-ig/ValueSet/OrganizationType",
"group" : [{
"source" : "http://fhir.ch/ig/ch-ig/CodeSystem/ch-ig-example",
"target" : "http://snomed.info/sct",
"targetVersion" : "http://snomed.info/sct/2011000195101",
"element" : [{
"code" : "med",
"target" : [{
"code" : "264358009",
"equivalence" : "equivalent"
}]
},
{
"code" : "vac",
"target" : [{
"code" : "46224007",
"equivalence" : "equivalent"
}]
},
{
"code" : "pharm",
"target" : [{
"code" : "264372000",
"equivalence" : "equivalent"
}]
}]
}]
}
97 changes: 96 additions & 1 deletion validator/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -33645,7 +33645,102 @@
}
},
{
"todo": "inactive codes: active, inactive, retired against all three valuesets, and without a value set",
"name": "cm",
"file": "cm.json",
"supporting": [
"cm-vs.json", "cm-cs.json"
],
"description": "ConceptMap maps something not in the value set",
"version" : "4.0",
"java": {
"outcome": {
"resourceType" : "OperationOutcome",
"issue" : [{
"severity" : "error",
"code" : "required",
"details" : {
"text" : "The source code 'med' is not valid in the value set http://fhir.ch/ig/ch-ig/ValueSet/ch-ig-example|0.1.0"
},
"diagnostics" : "[38,21]",
"expression" : ["ConceptMap.group[0].element[0].code"]
}]
}
}
},
{
"name": "cm2",
"file": "cm.json",
"supporting": [
"cm-vs2.json", "cm-cs.json"
],
"description": "ConceptMap maps something not in the value set *in snomed*",
"version" : "4.0",
"java": {
"outcome": {
"resourceType" : "OperationOutcome",
"issue" : [{
"severity" : "error",
"code" : "business-rule",
"details" : {
"text" : "The code '46224007' in the system http://snomed.info/sct version http://snomed.info/sct/2011000195101 is not valid in the value set 'http://fhir.ch/ig/ch-ig/ValueSet/OrganizationType'"
},
"diagnostics" : "[47,28]",
"expression" : ["ConceptMap.group[0].element[1].target[0].code"]
}]
}
}
},
{
"name": "mi-use-derived",
"file": "mi-use-derived.xml",
"supporting": [
"mi-defn-base.xml", "mi-use-base.xml", "mi-defn-derived.xml"
],
"description": "Profiling to a derived profile",
"version" : "5.0",
"java": {
"outcome": {
"resourceType": "OperationOutcome"
}
}
},
{
"name": "mi-use-distinct",
"file": "mi-use-distinct.xml",
"supporting": [
"mi-defn-base.xml", "mi-use-base.xml", "mi-defn-distinct.xml"
],
"description": "Profiling to a distinct profile (illegal)",
"version" : "5.0",
"java": {
"outcome": {
"resourceType" : "OperationOutcome",
"issue" : [{
"severity" : "error",
"code" : "exception",
"details" : {
"text" : "Error generating Snapshot: StructureDefinition http://hl7.org/fhir/test/StructureDefinition/mi-use-distinct at Observation.subject: invalid constrained type Reference(http://hl7.org/fhir/test/StructureDefinition/mi-defn-distinct) from Reference(http://hl7.org/fhir/test/StructureDefinition/mi-defn-base) in http://hl7.org/fhir/test/StructureDefinition/mi-use-distinct (this usually arises from a problem in the differential)"
},
"expression" : ["StructureDefinition"]
}]
}
}
},
{
"name": "mi-use-imposed",
"file": "mi-use-imposed.xml",
"supporting": [
"mi-defn-base.xml", "mi-use-base.xml", "mi-defn-imposed.xml"
],
"description": "Profiling to a imposed profile",
"version" : "5.0",
"java": {
"outcome": {
"resourceType": "OperationOutcome"
}
}
},
{
"name": "zzz",
"file": "zzz.json",
"description": "hack to close ups",
Expand Down

0 comments on commit 66827fa

Please sign in to comment.