FHIR Chat · Illegally constrained XXX.id from II to string · cda/publish

Stream: cda/publish

Topic: Illegally constrained XXX.id from II to string


view this post on Zulip 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)

view this post on Zulip 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

view this post on Zulip 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.

view this post on Zulip Sean McIlvenna (Dec 12 2019 at 22:13):

I believe that would solve this

view this post on Zulip Sean McIlvenna (Dec 12 2019 at 22:13):

But the FHIR spec would have to change baseDefinition references from Element to BaseElement

view this post on Zulip 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

view this post on Zulip Sean McIlvenna (Dec 12 2019 at 22:13):

then no references would need to change

view this post on Zulip 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

view this post on Zulip 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

view this post on Zulip Grahame Grieve (Dec 12 2019 at 22:23):

I don't follow how that fixes it

view this post on Zulip Grahame Grieve (Dec 12 2019 at 22:23):

@Oliver Egger did we have any other solution for this?

view this post on Zulip Grahame Grieve (Dec 12 2019 at 22:23):

I have defined Base formally in R5 now

view this post on Zulip Sean McIlvenna (Dec 12 2019 at 22:36):

right now, Element has "id" which is of type string

view this post on Zulip Sean McIlvenna (Dec 12 2019 at 22:36):

in CDA, not all elements have "id"

view this post on Zulip Sean McIlvenna (Dec 12 2019 at 22:36):

and the ones that do are of type "II"

view this post on Zulip Sean McIlvenna (Dec 12 2019 at 22:36):

so, CDA elements can currently be based on Element because of that conflict

view this post on Zulip Sean McIlvenna (Dec 12 2019 at 22:37):

we either need to remove "id" from "Element"

view this post on Zulip 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

view this post on Zulip 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.

view this post on Zulip Grahame Grieve (Dec 12 2019 at 22:58):

let me investigate

view this post on Zulip Grahame Grieve (Dec 13 2019 at 00:42):

ok, so this is what I'm going to use as my test case:

view this post on Zulip Grahame Grieve (Dec 13 2019 at 00:42):

cda.xml example.xml ii.xml any.xml

view this post on Zulip Grahame Grieve (Dec 13 2019 at 00:43):

that captures the essence the problem, yes?

view this post on Zulip Grahame Grieve (Dec 13 2019 at 02:06):

well, that will work next release. So just go ahead and change everything to Base

view this post on Zulip Grahame Grieve (Dec 13 2019 at 02:09):

next release is not that many hours away :-(

view this post on Zulip Sean McIlvenna (Dec 13 2019 at 03:20):

so there will be a "Base" type that is empty?

view this post on Zulip Grahame Grieve (Dec 13 2019 at 03:21):

yes

view this post on Zulip Sean McIlvenna (Dec 13 2019 at 03:25):

awesome!

view this post on Zulip Grahame Grieve (Dec 13 2019 at 06:05):

ok so I pushed more to the tests. I'm going to get terminlogy validation working

view this post on Zulip Grahame Grieve (Dec 13 2019 at 06:19):

and the tests are here:

view this post on Zulip Grahame Grieve (Dec 13 2019 at 06:29):

https://github.com/FHIR/fhir-test-cases/tree/master/validator/cda

view this post on Zulip 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

view this post on Zulip Oliver Egger (Dec 13 2019 at 07:36):

cool what happens while sleeping :-) will check it out also to test

view this post on Zulip Grahame Grieve (Dec 13 2019 at 10:57):

ok terminology validation works... sort of.

view this post on Zulip 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?

view this post on Zulip Grahame Grieve (Dec 13 2019 at 10:58):

we will also have to work on OID 2 URI translations

view this post on Zulip Grahame Grieve (Dec 13 2019 at 10:58):

otherwise... I think it's solid

view this post on Zulip 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

view this post on Zulip Grahame Grieve (Dec 13 2019 at 19:52):

I haven't released it yet. I will sometime in the next few hours

view this post on Zulip 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?

view this post on Zulip Grahame Grieve (Dec 14 2019 at 04:09):

yes

view this post on Zulip 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

view this post on Zulip 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

view this post on Zulip Grahame Grieve (Dec 14 2019 at 04:38):

what's the stack?

view this post on Zulip 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)

view this post on Zulip Sean McIlvenna (Dec 14 2019 at 22:11):

@Grahame Grieve

view this post on Zulip 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

view this post on Zulip Sean McIlvenna (Dec 16 2019 at 17:34):

I'm not finding StructureDefinition-Base anywhere

view this post on Zulip 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

view this post on Zulip 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

view this post on Zulip 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

view this post on Zulip 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?

view this post on Zulip Sean McIlvenna (Dec 16 2019 at 21:10):

the PR is just a minor improvement on error handling

view this post on Zulip Sean McIlvenna (Dec 16 2019 at 21:10):

cda-core-2.0 is definitely not publishing for me

view this post on Zulip Sean McIlvenna (Dec 16 2019 at 21:11):

pasted image

view this post on Zulip Sean McIlvenna (Dec 16 2019 at 21:11):

I would expect to find StructureDefinition-Base.json here

view this post on Zulip Sean McIlvenna (Dec 16 2019 at 21:11):

can you confirm that it should be?

view this post on Zulip Grahame Grieve (Dec 16 2019 at 21:41):

no you won't find it there.

view this post on Zulip 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

view this post on Zulip Grahame Grieve (Dec 16 2019 at 21:49):

but looking at this, why doesn't Act etc inherit from InfrastructureRoot?

view this post on Zulip Grahame Grieve (Dec 16 2019 at 22:14):

the IG will build fine next release

view this post on Zulip Sean McIlvenna (Dec 16 2019 at 22:47):

so it wasn't just me?

view this post on Zulip Grahame Grieve (Dec 16 2019 at 22:49):

no

view this post on Zulip 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