Stream: implementers
Topic: Validating error on meta.profile element
Cees de Jonge (Jan 08 2021 at 10:59):
In our profiles (structuredefinitions) we sometimes populate the "meta.profile" element to claim resource conformance.
In the latest Validator (5.2.13) we get an error like:
refers to a resource that has the wrong type. Found StructureDefinition expecting one of []
I am wondering if this is correct, as the definition states the canonical should refer to a resource of type StructureDefinition
Lloyd McKenzie (Jan 08 2021 at 14:14):
StructureDefinition.meta.profile would have to be a profile on StructureDefinition. If you want to identify the profile that your profile is based on, you need to use StructureDefinition.baseDefinition.
Lloyd McKenzie (Jan 08 2021 at 14:15):
What exactly are you sending?
Cees de Jonge (Jan 11 2021 at 07:32):
We are putting indeed the url of a profile on StructureDefinition. This StructureDefinition (profile) we created ourselves and it validates.
Also, if we replace meta.profile with the baseDefinition of the mentioned profile, for example: "http://hl7.org/fhir/StructureDefinition/DetectedIssue", we get the same error.
Lloyd McKenzie (Jan 11 2021 at 15:42):
Can you post exactly what your meta looks like and your error looks like?
Cees de Jonge (Jan 12 2021 at 07:52):
ILSDetectedIssue.structuredefinition.xml PHMDetectedIssue.structuredefinition.xml
When we run:
java -jar ../validator-cli.jar -version 4.0 PHMDetectedIssue.structuredefinition.xml -ig .
The validator produces:
FHIR Validation tool Version 5.2.13 (Git# 5f67b5bad03d). Built 2020-12-24T05:16:59.673Z (19 days old)
Java: 14.0.1 from /Library/Java/JavaVirtualMachines/openjdk-14.0.1.jdk/Contents/Home on x86_64 (64bit). 4096MB available
Paths: Current = /Users/nlv09090/Projects/ILS/Zulip/meta.profile, Package Cache = /Users/nlv09090/.fhir/packages
Params: -version 4.0 PHMDetectedIssue.structuredefinition.xml -ig .
Loading
Load FHIR v4.0 from hl7.fhir.r4.core#4.0.1 - 4575 resources (00:05.0524)
Load hl7.terminology#2.0.0 - 3749 resources (00:01.0060)
Terminology server http://tx.fhir.org - Version 1.9.369 (00:03.0049)
Load . - 2 resources (00:00.0036)
Get set... go (00:00.0071)
Validating
Validate PHMDetectedIssue.structuredefinition.xml 00:00.0354
Done. Times: Loading: 00:10.0213, validation: 00:00.0355FAILURE: 1 errors, 0 warnings, 0 notes
Error @ StructureDefinition.differential.element[1].fixed.ofType(canonical) (line 34, col154) : Canonical URL 'https://www.fhir.philips.com/4.0/StructureDefinition/populationHealthManagement/common/detectedIssue-v1/PHMDetectedIssue' refers to a resource that has the wrong type. Found StructureDefinition expecting one of []
I assume letting meta.profile pointing to itself does not make a difference.
Lloyd McKenzie (Jan 12 2021 at 17:01):
Hmm. What you have seems right to me. @Grahame Grieve ?
Cees de Jonge (Jan 19 2021 at 09:17):
VitalSign-HL7.structuredefinition.xml VitalSign.structuredefinition.xml VitalSign-claim.structuredefinition.xml
@Lloyd McKenzie @Grahame Grieve
Maybe it is not how "meta.profile" is intended, but would it not be great if it could be used to register and validate claims of derived-profiles?
Included an example how we (would) use it, but a recent validator errors on it:
FHIR Validation tool Version 5.2.16 (Git# f815bc8fb8f0). Built 2021-01-14T22:39:23.297Z (4 days old)
Java: 14.0.1 from /Library/Java/JavaVirtualMachines/openjdk-14.0.1.jdk/Contents/Home on x86_64 (64bit). 4096MB available
Paths: Current = /Users/nlv09090/Projects/ILS/validate/meta.profile-test, Package Cache = /Users/nlv09090/.fhir/packages
Params: VitalSign-HL7.structuredefinition.xml VitalSign-claim.structuredefinition.xml VitalSign.structuredefinition.xml -version 4.0 -ig .
Loading
Load FHIR v4.0 from hl7.fhir.r4.core#4.0.1 - 4575 resources (00:04.0309)
Load hl7.terminology#2.0.0 - 3749 resources (00:01.0063)
Terminology server http://tx.fhir.org - Version 1.9.369 (00:01.0327)
Load . - 3 resources (00:00.0051)
Get set... go (00:00.0088)
Validating
Validate VitalSign-HL7.structuredefinition.xml 00:00.0324
Validate VitalSign-claim.structuredefinition.xml 00:00.0082
Validate VitalSign.structuredefinition.xml 00:00.0054
Done. Times: Loading: 00:07.0078, validation: 00:00.0463 (#3)-- VitalSign-HL7.structuredefinition.xml ---------------------------------------------
Success: 0 errors, 0 warnings, 1 notes
Information @ ?? : All OK
-- VitalSign-claim.structuredefinition.xml -----------------------------------------------
FAILURE: 1 errors, 0 warnings, 0 notes
Error @ StructureDefinition.differential.element[0].fixed.ofType(canonical) (line 19, col84) : Canonical URL 'http://hl7.org/fhir/StructureDefinition/vitalsigns' refers to a resource that has the wrong type. Found StructureDefinition expecting one of []
-- VitalSign.structuredefinition.xml -----------------------------------------
Success: 0 errors, 0 warnings, 1 notes
Information @ ?? : All OK
Lloyd McKenzie (Jan 19 2021 at 15:26):
To indicate that one profile is derived from another profile, you use StructureDefinition.baseDefinition
Cees de Jonge (Jan 26 2021 at 07:25):
Sure.
I was hoping the meta.profile could be a way to register conformance claims to other existing derived-profiles. I think this is something more people are interested in. Down the road this could maybe be used to validate these claims.
From what I understand now is that we must not and should not use the meta.profile in derived profiles?
Lloyd McKenzie (Jan 26 2021 at 14:28):
meta.profile on a StructureDefinition would indicate a profile on StructureDefinition. E.g. one that says that short definitions are mandatory or invariants are prohibited. I.e. it's rules for profiling, not an indication of profile relationships.
Last updated: Apr 12 2022 at 19:14 UTC