Stream: IG creation
Topic: Extensions on CodeSystem
Brian Postlethwaite (Jun 20 2019 at 05:38):
My IG has defined a new extension that is to be applied to a code system, however when I use this extension in the IG, it fails to find it and gives validation errors.
(I even created the CodeSystem profile, and referenced it to the CS, and the validator result in the qa.html says it can't find the profile too)
Moving the definition of the extension and profile ahead of the code system doesn't help
Grahame Grieve (Jun 20 2019 at 05:39):
what's the extension?
Brian Postlethwaite (Jun 20 2019 at 05:40):
<StructureDefinition xmlns="http://hl7.org/fhir"> <id value="lga-centrepoint" /> <url value="http://fhir.telstrahealth.com/th-epd/StructureDefinition/lga-centrepoint" /> ... <kind value="primitive-type" /> <abstract value="false" /> <context> <type value="element" /> <expression value="CodeSystem.concept" /> </context> <type value="Extension" /> <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Extension" /> <derivation value="constraint" />
Brian Postlethwaite (Jun 20 2019 at 05:40):
Then using it in my CodeSystem like
<CodeSystem xmlns="http://hl7.org/fhir"> <id value="hcxdir-locality" /> <meta> <profile value="http://fhir.telstrahealth.com/th-epd/StructureDefinition/hcxdir-codesystem"/> </meta> ... <concept id="16986"> <extension url="http://fhir.telstrahealth.com/th-epd/StructureDefinition/lga-centrepoint"> <valueString value="POINT(146.6999019,-36.9153738)" /> </extension> <code value="ABBEYARD, 3737 VIC" /> <display value="ABBEYARD, 3737 VIC" /> </concept>
Brian Postlethwaite (Jun 20 2019 at 05:42):
Then in the QA :
pasted image
Brian Postlethwaite (Jun 20 2019 at 05:43):
The IG does render the codesystem, profile, and extensions correctly, so they are in the guide (and the others don't report any qa errors)
Grahame Grieve (Jun 20 2019 at 07:15):
you have to add http://fhir.telstrahealth.com/th-epd as an allowed extension domain
Brian Postlethwaite (Jun 20 2019 at 07:19):
Where does that go? IG.Json?
Brian Postlethwaite (Jun 20 2019 at 07:19):
That is the canonical base for my whole guide.
Grahame Grieve (Jun 20 2019 at 07:26):
oh then the extension should be recognised.
Grahame Grieve (Jun 20 2019 at 07:26):
I might need to debug it
Brian Postlethwaite (Jun 20 2019 at 07:36):
Ok.
Brian Postlethwaite (Jun 21 2019 at 03:20):
I managed to get debugging this, and discovered that the csvalidator doesn't seem to be configured to resolve references from the IG Publisher - which there is a comment above a little that is used for doing InstanceValidations
https://github.com/HL7/fhir-ig-publisher/blob/1ba4ad3ce5cbe06611a68bea057a60c0abde1152/org.hl7.fhir.publisher.core/src/main/java/org/hl7/fhir/igtools/publisher/Publisher.java#L1371
And probably the same for the ProfileValidator too
@Grahame Grieve does this look right?
Grahame Grieve (Jun 21 2019 at 04:41):
you aren't getting that error from the code System validator....
Brian Postlethwaite (Jun 24 2019 at 03:29):
Have worked it out, any of the resource types that are loaded before StructureDefinition can't have extensions defined in the IG
https://github.com/HL7/fhir-ig-publisher/blob/1ba4ad3ce5cbe06611a68bea057a60c0abde1152/org.hl7.fhir.publisher.core/src/main/java/org/hl7/fhir/igtools/publisher/Publisher.java#L2852
As its during the load(), not the scan() that the extension resource is cached into the context so that the fetcher can find them, and hence validate correctly.
To fix this I moved the StructureDefinition to the top of the load() calls in the block, alternately the scan could cache the StructureDefinitions too.
Eric Haas (Jun 24 2019 at 03:36):
How Does the affect the current igs ?
Brian Postlethwaite (Jun 24 2019 at 04:01):
You would be getting validation errors in your QA report if you were subject to the issue.
My IG had extensions in the CodeSystem, so suffered.
Any Extensions defined in your IG on NamingSystem, CodeSystem, ValueSet, ConceptMap or DataElement types would fail (which mine did)
Grahame Grieve (Jun 24 2019 at 10:38):
that's not such a simple fix. let me think about that. Scan is supposed to pick stuff up like that. can you make an issue report
Brian Postlethwaite (Jun 24 2019 at 12:26):
Sure will do.
(enjoying the drive?)
Grahame Grieve (Jun 24 2019 at 12:41):
today was hard - 550km of wall to wall nothing.... just scrub. Real badlands (port Augusta --> Coober Pedy)
Brett Esler (Jun 24 2019 at 12:42):
Staying in a hole in the ground? Childhood memories ;)
Lynn Laakso (Jun 24 2019 at 12:43):
doing some mining?
Brett Esler (Jun 24 2019 at 12:44):
data or opals?
Grahame Grieve (Jun 24 2019 at 13:02):
hah. we have a van, so we're staying in that. Kath is doing a tour of some holes in the ground tomorrow. I'm heading out on the oodnadatta track
Brian Postlethwaite (Jun 24 2019 at 23:26):
Logged GF#22758
Last updated: Apr 12 2022 at 19:14 UTC