Stream: cda/publish
Topic: Illegally constrained XXX.id from II to string
Sean McIlvenna (Dec 12 2019 at 22:11):
Getting this error in the cda-core-2.0 IG:
org.hl7.fhir.exceptions.DefinitionException: StructureDefinition http://hl7.org/fhir/cda/StructureDefinition/Entity at Entity.id: illegal constrained type http://hl7.org/fhir/cda/StructureDefinition/II from string in http://hl7.org/fhir/StructureDefinition/Element at org.hl7.fhir.r5.conformance.ProfileUtilities.updateFromDefinition(ProfileUtilities.java:2030) at org.hl7.fhir.r5.conformance.ProfileUtilities.processPaths(ProfileUtilities.java:736) at org.hl7.fhir.r5.conformance.ProfileUtilities.generateSnapshot(ProfileUtilities.java:472) at org.hl7.fhir.igtools.publisher.Publisher.generateSnapshot(Publisher.java:3773) at org.hl7.fhir.igtools.publisher.Publisher.generateSnapshots(Publisher.java:3726) at org.hl7.fhir.igtools.publisher.Publisher.loadConformance(Publisher.java:3181) at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:768) at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:656) at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:6622)
Sean McIlvenna (Dec 12 2019 at 22:12):
I believe this is related to other discussions we've had about basing things on Element, and that Element has Element.id
Sean McIlvenna (Dec 12 2019 at 22:12):
@Grahame Grieve , can't remember the solution you proposed... I think maybe you were suggesting creating BaseElement which has BaseElement.id and derives from Element, which is empty.
Sean McIlvenna (Dec 12 2019 at 22:13):
I believe that would solve this
Sean McIlvenna (Dec 12 2019 at 22:13):
But the FHIR spec would have to change baseDefinition references from Element to BaseElement
Sean McIlvenna (Dec 12 2019 at 22:13):
or... maybe instead we could create BaseElement as being the empty profile, and Element derives from BaseElement
Sean McIlvenna (Dec 12 2019 at 22:13):
then no references would need to change
Sean McIlvenna (Dec 12 2019 at 22:13):
and the cda-core-2.0 IG would just need to use a baseDefinition of BaseElement instead of Element
Sean McIlvenna (Dec 12 2019 at 22:16):
Until this is fixed, though, I am going to push a commit that comments out the <type>
constraints on all XXX.id elements so that the build can run succesfully
Grahame Grieve (Dec 12 2019 at 22:23):
I don't follow how that fixes it
Grahame Grieve (Dec 12 2019 at 22:23):
@Oliver Egger did we have any other solution for this?
Grahame Grieve (Dec 12 2019 at 22:23):
I have defined Base formally in R5 now
Sean McIlvenna (Dec 12 2019 at 22:36):
right now, Element has "id" which is of type string
Sean McIlvenna (Dec 12 2019 at 22:36):
in CDA, not all elements have "id"
Sean McIlvenna (Dec 12 2019 at 22:36):
and the ones that do are of type "II"
Sean McIlvenna (Dec 12 2019 at 22:36):
so, CDA elements can currently be based on Element because of that conflict
Sean McIlvenna (Dec 12 2019 at 22:37):
we either need to remove "id" from "Element"
Sean McIlvenna (Dec 12 2019 at 22:37):
or we need to create something new that doesn't have "id" in it that CDA elements can be based on
Oliver Egger (Dec 12 2019 at 22:52):
In the fork I created a Base Element for R4 in the Implementation Guide, since the discussion on Zulip Logical Models was not finished I did not create a pull request.
However if a Base is integrated in R5 I see two options:
1) if you accept a Base Definition in the cda-core-2.0 R4 IG I create a pull request based on the commit above
or
2) change the cda-core-2.0 guide to a R5 version. Since it is a logical model the FHIR version does anyhow not depend much on it .
which approach do you prefer? Given the development of R5 I don't see alternatives to above.
Grahame Grieve (Dec 12 2019 at 22:58):
let me investigate
Grahame Grieve (Dec 13 2019 at 00:42):
ok, so this is what I'm going to use as my test case:
Grahame Grieve (Dec 13 2019 at 00:42):
cda.xml example.xml ii.xml any.xml
Grahame Grieve (Dec 13 2019 at 00:43):
that captures the essence the problem, yes?
Grahame Grieve (Dec 13 2019 at 02:06):
well, that will work next release. So just go ahead and change everything to Base
Grahame Grieve (Dec 13 2019 at 02:09):
next release is not that many hours away :-(
Sean McIlvenna (Dec 13 2019 at 03:20):
so there will be a "Base" type that is empty?
Grahame Grieve (Dec 13 2019 at 03:21):
yes
Sean McIlvenna (Dec 13 2019 at 03:25):
awesome!
Grahame Grieve (Dec 13 2019 at 06:05):
ok so I pushed more to the tests. I'm going to get terminlogy validation working
Grahame Grieve (Dec 13 2019 at 06:19):
and the tests are here:
Grahame Grieve (Dec 13 2019 at 06:29):
https://github.com/FHIR/fhir-test-cases/tree/master/validator/cda
Sean McIlvenna (Dec 13 2019 at 06:47):
ok, please let me know when a new build is ready for me to play with. I'll check out the Base stuff
Oliver Egger (Dec 13 2019 at 07:36):
cool what happens while sleeping :-) will check it out also to test
Grahame Grieve (Dec 13 2019 at 10:57):
ok terminology validation works... sort of.
Grahame Grieve (Dec 13 2019 at 10:58):
we will have to work on CDA value sets - they don't seem to exist in UTG?
Grahame Grieve (Dec 13 2019 at 10:58):
we will also have to work on OID 2 URI translations
Grahame Grieve (Dec 13 2019 at 10:58):
otherwise... I think it's solid
Sean McIlvenna (Dec 13 2019 at 16:25):
I assume the "Base" stuff is not ready, yet? I just got latest and tried with http://hl7.org/fhir/StructureDefinition/Base and it failed
Grahame Grieve (Dec 13 2019 at 19:52):
I haven't released it yet. I will sometime in the next few hours
Sean McIlvenna (Dec 14 2019 at 03:48):
Awesome. Given that your last message was eight hours ago, should I download the latest publisher and try it out?
Grahame Grieve (Dec 14 2019 at 04:09):
yes
Sean McIlvenna (Dec 14 2019 at 04:19):
Hmmm... I must be missing something.
I changed <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Element"/>
to <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Base"/>
and it's giving a NullPointerException
Sean McIlvenna (Dec 14 2019 at 04:25):
and fyi, I removed hl7.fhir.r4.core#4.0.1
from my package cache and had it re-download it
Grahame Grieve (Dec 14 2019 at 04:38):
what's the stack?
Sean McIlvenna (Dec 14 2019 at 05:00):
Stack Dump (for debugging): (00:30.0910) java.lang.NullPointerException at org.hl7.fhir.igtools.publisher.Publisher.generateSnapshot(Publisher.java:3813) at org.hl7.fhir.igtools.publisher.Publisher.generateSnapshots(Publisher.java:3762) at org.hl7.fhir.igtools.publisher.Publisher.loadConformance(Publisher.java:3217) at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:768) at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:655) at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:6662)
Sean McIlvenna (Dec 14 2019 at 22:11):
@Grahame Grieve
Sean McIlvenna (Dec 16 2019 at 17:33):
do I need to point to 4.0.2 or something? don't think so, cause then the ig publisher complains that it only supports 4.0.1
Sean McIlvenna (Dec 16 2019 at 17:34):
I'm not finding StructureDefinition-Base anywhere
Sean McIlvenna (Dec 16 2019 at 17:41):
ok, I see the model shows up in the org.hl7.fhir.r4-4.1.27-SNAPSHOT.jar file
Sean McIlvenna (Dec 16 2019 at 17:41):
but, it's not being downloaded as part of the package that's stored in c:\users\XXX\.fhir
Grahame Grieve (Dec 16 2019 at 19:25):
no, it's implicit. I can't retrospectively define it in the packages, so it's a special case
Grahame Grieve (Dec 16 2019 at 20:13):
so cda-core-2.0 publishes for me... I'm not sure what the problem is, or what's driving your PR to the IG publisher?
Sean McIlvenna (Dec 16 2019 at 21:10):
the PR is just a minor improvement on error handling
Sean McIlvenna (Dec 16 2019 at 21:10):
cda-core-2.0 is definitely not publishing for me
Sean McIlvenna (Dec 16 2019 at 21:11):
Sean McIlvenna (Dec 16 2019 at 21:11):
I would expect to find StructureDefinition-Base.json here
Sean McIlvenna (Dec 16 2019 at 21:11):
can you confirm that it should be?
Grahame Grieve (Dec 16 2019 at 21:41):
no you won't find it there.
Grahame Grieve (Dec 16 2019 at 21:47):
it's a special case because I can't retrospectively define a type as part of a past specification. but I can pretend that it exists in my tooling
Grahame Grieve (Dec 16 2019 at 21:49):
but looking at this, why doesn't Act etc inherit from InfrastructureRoot?
Grahame Grieve (Dec 16 2019 at 22:14):
the IG will build fine next release
Sean McIlvenna (Dec 16 2019 at 22:47):
so it wasn't just me?
Grahame Grieve (Dec 16 2019 at 22:49):
no
Sean McIlvenna (Dec 16 2019 at 23:43):
nice, seems to be working, at least against my local build of the ig publisher after doing a pull from master
Last updated: Apr 12 2022 at 19:14 UTC