From 26947260b37c349d21e2679b199a0cbe881be560 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 11 Mar 2024 00:18:40 +1100 Subject: [PATCH] ValueSet validation corrections --- validator/manifest.json | 124 ++++++++++++++++++++++++++++++++++-- validator/vs-bad-props.json | 39 ++++++++++++ 2 files changed, 156 insertions(+), 7 deletions(-) create mode 100644 validator/vs-bad-props.json diff --git a/validator/manifest.json b/validator/manifest.json index 567aeed0..73ce91e3 100644 --- a/validator/manifest.json +++ b/validator/manifest.json @@ -20401,6 +20401,7 @@ "details": { "text": "No System specified, so Concepts and Filters can't be checked" }, + "diagnostics": "[32,8]", "expression": [ "ValueSet.compose.exclude[0]" ] @@ -20996,6 +20997,7 @@ "details": { "text": "The code '1' is not valid in the system http://snomed.info/sct" }, + "diagnostics": "[15,12]", "expression": [ "ValueSet.compose.include[0].concept[0]" ] @@ -21006,6 +21008,7 @@ "details": { "text": "Unknown code '1' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201'" }, + "diagnostics": "[15,12]", "expression": [ "ValueSet.compose.include[0].concept[0]" ] @@ -31974,6 +31977,7 @@ "details": { "text": "URI values in ValueSet.compose.include.system must be absolute. To reference a contained code system, use the full CodeSystem URL and reference it using the http://hl7.org/fhir/StructureDefinition/valueset-system extension" }, + "diagnostics": "[30,8]", "expression": [ "ValueSet.compose.include[0]" ] @@ -32028,6 +32032,7 @@ "details": { "text": "URI values in ValueSet.compose.include.system must be absolute. To reference a contained code system, use the full CodeSystem URL and reference it using the http://hl7.org/fhir/StructureDefinition/valueset-system extension" }, + "diagnostics": "[30,8]", "expression": [ "ValueSet.compose.include[0]" ] @@ -32060,6 +32065,7 @@ "details": { "text": "URI values in ValueSet.compose.include.system must be absolute. To reference a contained code system, use the full CodeSystem URL and reference it using the http://hl7.org/fhir/StructureDefinition/valueset-system extension" }, + "diagnostics": "[30,8]", "expression": [ "ValueSet.compose.include[0]" ] @@ -32114,6 +32120,7 @@ "details": { "text": "URI values in ValueSet.compose.include.system must be absolute. To reference a contained code system, use the full CodeSystem URL and reference it using the http://hl7.org/fhir/StructureDefinition/valueset-system extension" }, + "diagnostics": "[30,8]", "expression": [ "ValueSet.compose.include[0]" ] @@ -46566,6 +46573,7 @@ "details": { "text": "URI values in ValueSet.compose.include.system must be absolute. To reference a contained code system, use the full CodeSystem URL and reference it using the http://hl7.org/fhir/StructureDefinition/valueset-system extension" }, + "diagnostics": "[5,6]", "expression": [ "ValueSet.compose.include[0]" ] @@ -46576,6 +46584,7 @@ "details": { "text": "No matching contained code system found for system '#cs1'" }, + "diagnostics": "[5,6]", "expression": [ "ValueSet.compose.include[0]" ] @@ -46610,6 +46619,7 @@ "details": { "text": "URI values in ValueSet.compose.include.system must be absolute. To reference a contained code system, use the full CodeSystem URL and reference it using the http://hl7.org/fhir/StructureDefinition/valueset-system extension" }, + "diagnostics": "[5,6]", "expression": [ "ValueSet.compose.include[0]" ] @@ -47317,7 +47327,29 @@ "severity": "error", "code": "business-rule", "details": { - "text": "The property 'not-a-code' has no definition. Many terminology tools wont know what to do with it" + "text": "The designation 'Really a test code' has no use and is in the same language ('en-US'), so is not differentiated from the base display ('Test Code')" + }, + "diagnostics": "[1,2]", + "expression": [ + "CodeSystem.concept[0].designation[0]" + ] + }, + { + "severity": "error", + "code": "business-rule", + "details": { + "text": "The designation 'Really a test code (US)' has no use and is in the same language ('en-US'), so is not differentiated from the base display ('Test Code')" + }, + "diagnostics": "[1,2]", + "expression": [ + "CodeSystem.concept[0].designation[1]" + ] + }, + { + "severity": "error", + "code": "business-rule", + "details": { + "text": "The property 'not-a-code' has no definition in CodeSystem.property. Many terminology tools won't know what to do with it" }, "diagnostics": "[1,2]", "expression": [ @@ -47347,25 +47379,103 @@ ] }, { - "severity": "error", + "severity": "warning", "code": "business-rule", "details": { - "text": "The designation 'Really a test code' has no use and is in the same language ('en-US'), so is not differentiated from the base display ('Test Code')" + "text": "The synonym '12' is not also defined in the code system. The Synonym property should only used to declare equivalence to other existing codes" }, "diagnostics": "[1,2]", "expression": [ - "CodeSystem.concept[0].designation[0]" + "CodeSystem.concept[0].property[2]" ] - }, + } + ] + } + } + }, + { + "name": "vs-bad-props", + "file": "vs-bad-props.json", + "version": "4.0", + "explanation": "Bad filters based on code system properties", + "java": { + "outcome": { + "resourceType": "OperationOutcome", + "issue": [ { "severity": "error", "code": "business-rule", "details": { - "text": "The designation 'Really a test code (US)' has no use and is in the same language ('en-US'), so is not differentiated from the base display ('Test Code')" + "text": "When HL7 is publishing a resource, the owning committee must be stated using the http://hl7.org/fhir/StructureDefinition/structuredefinition-wg extension" }, "diagnostics": "[1,2]", "expression": [ - "CodeSystem.concept[0].designation[1]" + "ValueSet" + ] + }, + { + "severity": "error", + "code": "invalid", + "details": { + "text": "The value for a filter based on property 'concept' must be a valid code from the system 'http://snomed.info/sct', and 'something' is not (Unknown code 'something' in the CodeSystem 'http://snomed.info/sct' version 'http://snomed.info/sct/900000000000207008/version/20240201')" + }, + "expression": [ + "ValueSet.compose.include[0].filter[0]" + ] + }, + { + "severity": "warning", + "code": "invalid", + "details": { + "text": "The property '2342342123' is not known for the system 'http://snomed.info/sct', so may not be understood by the terminology ecosystem. Known properties for this system: concept,code,status,inactive,effectiveDate,deprecationDate,retirementDate,notSelectable,parent,child,partOf,synonym,comment,itemWeight,expression,expressions,definitionStatusId,moduleId,normalForm,normalFormTerse,Due to,Associated with,Associated morphology,Has specimen,Specimen source morphology,Specimen source topography,Specimen source identity,Specimen procedure,Part of,Has active ingredient,Subject of information,Causative agent,Associated finding,Component,Severity,Occurrence,Episodicity,Technique,Revision status,Units,After,Access,Method,Priority,Clinical course,Laterality,Associated procedure,Finding site,Direct morphology,Direct substance,Has focus,Has intent,Procedure site,Has definitional manifestation,Indirect morphology,Indirect device,Has interpretation,Interprets,Measurement method,Property,Recipient category,Scale type,Specimen substance,Time aspect,Pathological process,Procedure site - Direct,Procedure site - Indirect,Procedure device,Procedure morphology,Finding context,Procedure context,Temporal context,Subject relationship context,Route of administration,Has dose form,Finding method,Finding informer,Using device,Using energy,Using substance,Surgical approach,Using access device,Role group,Property type,Inheres in,Towards,Characterizes,Process agent,Process duration,Process output,Relative to,Precondition,Direct site,Specified by,Observes,Is about,constraint,410662002,42752001,47429007,116676008,116686009,118168003,118169006,118170007,118171006,127489000,131195008,246075003,246090004,246093002,246112005,246454002,246456000,246501002,246513007,246514001,255234002,260507000,260686004,260870009,263502005,272741003,288556008,363589002,363698007,363699004,363700003,363701004,363702006,363703001,363704007,363705008,363709002,363710007,363713009,363714003,370129005,370130000,370131001,370132008,370133003,370134009,370135005,371881003,405813007,405814001,405815000,405816004,408729009,408730004,408731000,408732007,410675002,411116001,418775008,419066007,424226004,424244007,424361007,424876005,425391005,609096000,704319004,704320005,704321009,704322002,704323007,704324001,704325000,704326004,704327008,704346009,704347000,704647008,718497002,719715003,719722006,726542003,726633004,732943007,732945000,732947008,733722007,733725009,733928003,733930001,733931002,733932009,733933004,734136001,734137005,736472000,736473005,736474004,736475003,736476002,736518005,738774007,762705008,762706009,762949000,762951001,763032000,766939001,774081006,774158006,774159003,774160008,774163005,827081001,836358009,840560000,860779006,860781008,1003703000,1003735000,1142135004,1142136003,1142137007,1142138002,1142139005,1142140007,1142141006,1142142004,1142143009,1148793005,1148965004,1148967007,1148968002,1148969005,1149366004,1149367008,1230370004,320091000221107" + }, + "diagnostics": "[13,8]", + "expression": [ + "ValueSet.compose.include[0].filter[1]" + ] + }, + { + "severity": "error", + "code": "invalid", + "details": { + "text": "The operation 'not-in' is not allowed for property '1142143009'. Allowed ops: =,in" + }, + "diagnostics": "[17,8]", + "expression": [ + "ValueSet.compose.include[0].filter[2]" + ] + }, + { + "severity": "error", + "code": "invalid", + "details": { + "text": "The value for a filter based on property 'notSelectable' must be either 'true' or 'false', not '1'" + }, + "diagnostics": "[24,8]", + "expression": [ + "ValueSet.compose.include[1].filter[0]" + ] + }, + { + "severity": "warning", + "code": "invalid", + "details": { + "text": "The property 'non-selectable' is not known for the system 'http://terminology.hl7.org/CodeSystem/ex-tooth', so may not be understood by the terminology ecosystem. Known properties for this system: concept,code,status,inactive,effectiveDate,deprecationDate,retirementDate,notSelectable,synonym,comment,itemWeight" + }, + "diagnostics": "[28,8]", + "expression": [ + "ValueSet.compose.include[1].filter[1]" + ] + }, + { + "severity": "warning", + "code": "invalid", + "details": { + "text": "The property 'parent' is not known for the system 'http://terminology.hl7.org/CodeSystem/ex-tooth', so may not be understood by the terminology ecosystem. Known properties for this system: concept,code,status,inactive,effectiveDate,deprecationDate,retirementDate,notSelectable,synonym,comment,itemWeight" + }, + "diagnostics": "[32,8]", + "expression": [ + "ValueSet.compose.include[1].filter[2]" ] } ] diff --git a/validator/vs-bad-props.json b/validator/vs-bad-props.json new file mode 100644 index 00000000..fd683c42 --- /dev/null +++ b/validator/vs-bad-props.json @@ -0,0 +1,39 @@ +{ + "resourceType" : "ValueSet", + "id" : "vs-bad-props", + "url": "http://hl7.org/fhir/text/ValueSet/vs-bd-props", + "status" : "draft", + "compose" : { + "include" : [{ + "system" : "http://snomed.info/sct", + "filter" : [{ + "property" : "concept", + "op": "is-a", + "value" : "something" + },{ + "property" : "2342342123", + "op": "not-in", + "value" : "734137005" + },{ + "property" : "1142143009", + "op": "not-in", + "value" : "734137005" + }] + },{ + "system" : "http://terminology.hl7.org/CodeSystem/ex-tooth", + "filter" : [{ + "property" : "notSelectable", + "op": "=", + "value" : "1" + },{ + "property" : "non-selectable", + "op": "=", + "value" : "true" + },{ + "property" : "parent", + "op": "=", + "value" : "something" + }] + }] + } +} \ No newline at end of file