From c618b66e20423b5ee806b589cbb907b9653f57f7 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 30 Jan 2025 00:46:15 +1100 Subject: [PATCH] Add matchetype validation tests --- validator/manifest.json | 64 ++++++ validator/matchetype-pattern.json | 320 ++++++++++++++++++++++++++++++ 2 files changed, 384 insertions(+) create mode 100644 validator/matchetype-pattern.json diff --git a/validator/manifest.json b/validator/manifest.json index f6641dec..76930268 100644 --- a/validator/manifest.json +++ b/validator/manifest.json @@ -50867,6 +50867,70 @@ } } }, + { + "name": "matchetype-pattern-1", + "file": "matchetype-pattern.json", + "version": "4.0", + "packages": [ + "hl7.fhir.uv.tools#current" + ], + "matchetype": true, + "java": { + "outcome": { + "resourceType": "OperationOutcome", + "issue": [ + { + "severity": "warning", + "code": "invalid", + "details": { + "text": "The type 'code' does not appear to match the matchetype pattern value '$uuid$'" + }, + "diagnostics": "[70,26]", + "expression": [ + "ValueSet.expansion.contains[0].code" + ] + } + ] + } + } + }, + { + "name": "matchetype-pattern-2", + "file": "matchetype-pattern.json", + "version": "4.0", + "packages": [ + "hl7.fhir.uv.tools#current" + ], + "java": { + "outcome": { + "resourceType": "OperationOutcome", + "issue": [ + { + "severity": "error", + "code": "invalid", + "details": { + "text": "This resource is not allowed to be a matchetype resource (extension http://hl7.org/fhir/tools/StructureDefinition/matchetype is true)" + }, + "diagnostics": "[1,2]", + "expression": [ + "ValueSet" + ] + }, + { + "severity": "warning", + "code": "invalid", + "details": { + "text": "The type 'code' does not appear to match the matchetype pattern value '$uuid$'" + }, + "diagnostics": "[70,26]", + "expression": [ + "ValueSet.expansion.contains[0].code" + ] + } + ] + } + } + }, { "name": "zzz", "file": "zzz.json", diff --git a/validator/matchetype-pattern.json b/validator/matchetype-pattern.json new file mode 100644 index 00000000..545f2c28 --- /dev/null +++ b/validator/matchetype-pattern.json @@ -0,0 +1,320 @@ +{ + "extension" : [ + { + "url" : "http://hl7.org/fhir/tools/StructureDefinition/matchetype-optional", + "valueString" : "id,date,publisher,compose" + }, + { + "url" : "http://hl7.org/fhir/tools/StructureDefinition/matchetype", + "valueBoolean" : true + } + ], + "resourceType" : "ValueSet", + "url" : "http://hl7.org/fhir/test/ValueSet/big", + "version" : "5.0.0", + "name" : "BigValueSetAll", + "title" : "Big ValueSet All", + "status" : "active", + "experimental" : false, + "date" : "2023-04-01", + "publisher" : "FHIR Project", + "compose" : { + "include" : [ + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big" + } + ] + }, + "expansion" : { + "extension" : [ + { + "url" : "http://hl7.org/fhir/tools/StructureDefinition/matchetype-optional", + "valueString" : "total" + }, + { + "url" : "http://hl7.org/fhir/tools/StructureDefinition/matchetype-count", + "valueString" : "contains" + } + ], + "identifier" : "$uuid$", + "timestamp" : "$instant$", + "offset" : 0, + "total" : 2000, + "parameter" : [ + { + "name" : "count", + "valueInteger" : 50 + }, + { + "name" : "offset", + "valueInteger" : 0 + }, + { + "name" : "used-codesystem", + "valueUri" : "http://hl7.org/fhir/test/CodeSystem/big" + }, + { + "extension" : [ + { + "url" : "http://hl7.org/fhir/tools/StructureDefinition/matchetype-optional", + "valueBoolean" : true + } + ], + "name" : "version", + "valueUri" : "http://hl7.org/fhir/test/CodeSystem/big" + } + ], + "contains" : [ + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "$uuid$", + "display" : "Display 1" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code10", + "display" : "Display 10" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code11", + "display" : "Display 11" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code12", + "display" : "Display 12" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code13", + "display" : "Display 13" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code14", + "display" : "Display 14" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code15", + "display" : "Display 15" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code16", + "display" : "Display 16" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code17", + "display" : "Display 17" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code18", + "display" : "Display 18" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code19", + "display" : "Display 19" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code2", + "display" : "Display 2" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code20", + "display" : "Display 20" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code21", + "display" : "Display 21" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code22", + "display" : "Display 22" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code23", + "display" : "Display 23" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code24", + "display" : "Display 24" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code25", + "display" : "Display 25" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code26", + "display" : "Display 26" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code27", + "display" : "Display 27" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code28", + "display" : "Display 28" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code29", + "display" : "Display 29" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code3", + "display" : "Display 3" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code30", + "display" : "Display 30" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code31", + "display" : "Display 31" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code32", + "display" : "Display 32" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code33", + "display" : "Display 33" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code34", + "display" : "Display 34" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code35", + "display" : "Display 35" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code36", + "display" : "Display 36" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code37", + "display" : "Display 37" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code38", + "display" : "Display 38" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code39", + "display" : "Display 39" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code4", + "display" : "Display 4" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code40", + "display" : "Display 40" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code41", + "display" : "Display 41" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code42", + "display" : "Display 42" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code43", + "display" : "Display 43" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code44", + "display" : "Display 44" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code45", + "display" : "Display 45" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code46", + "display" : "Display 46" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code47", + "display" : "Display 47" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code48", + "display" : "Display 48" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code49", + "display" : "Display 49" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code5", + "display" : "Display 5" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code50", + "display" : "Display 50" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code6", + "display" : "Display 6" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code7", + "display" : "Display 7" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code8", + "display" : "Display 8" + }, + { + "system" : "http://hl7.org/fhir/test/CodeSystem/big", + "code" : "code9", + "display" : "Display 9" + } + ] + } +}