FHIR Chat · profiling problem with slices · implementers

Stream: implementers

Topic: profiling problem with slices


view this post on Zulip Sean McIlvenna (May 03 2017 at 17:32):

I'm following the examples here https://www.hl7.org/fhir/profiling-examples.html#extensions to define slices for different extension.
However, when I run this through the ig publisher, with some example resources, the example resources are throwing warnings saying "Profile http://hl7.org/fhir/ccda/StructureDefinition/CCDA-on-FHIR-Consultation-Note, Element matches more than one slice" for each of the extensions in the example.

view this post on Zulip Sean McIlvenna (May 03 2017 at 17:33):

CCDA-on-FHIR-Referral-Note.xml
CCDA-on-FHIR-US-Realm-Header.xml
CCDA-on-FHIR-Referral-Note-Example.xml

view this post on Zulip Sean McIlvenna (May 03 2017 at 17:34):

attached is the strucdef for referral note and its base profile us-realm-header, as well as the example instance it is failing on. can someone take a look and tell me what I'm doing wrong?

view this post on Zulip Sean McIlvenna (May 03 2017 at 17:34):

the extensions are defined in the base us-realm-header profile

view this post on Zulip Lloyd McKenzie (May 03 2017 at 20:17):

First, make sure you're using the absolute latest version of the IGPublisher (from build.fhir.org) as several corrections have been made recently.

view this post on Zulip Sean McIlvenna (May 03 2017 at 20:29):

so I shouldn't be using the ig publisher packaged with stu3?

view this post on Zulip Sean McIlvenna (May 03 2017 at 20:30):

seems like the stu3 should be updated (as though it were errata) with these kinds of important changes

view this post on Zulip Sean McIlvenna (May 03 2017 at 20:35):

just downloaded and ran with latest version of ig publisher

view this post on Zulip Sean McIlvenna (May 03 2017 at 20:35):

getting same errors

view this post on Zulip Lloyd McKenzie (May 03 2017 at 20:36):

Ok. I'll have a fix that should go in this weekend that will at least tell you which slices it's finding a match against that are a problem

view this post on Zulip Eric Haas (May 03 2017 at 20:37):

how about a screenshot of the spreadsheet to see how is defined.

view this post on Zulip Eric Haas (May 03 2017 at 20:37):

and a screenshot of the CD snippet of interest

view this post on Zulip Eric Haas (May 03 2017 at 20:38):

I find inspection of the SD usually helps ferret out the issue

view this post on Zulip Sean McIlvenna (May 03 2017 at 20:55):

pasted image

view this post on Zulip Sean McIlvenna (May 03 2017 at 20:55):

interesting... it doesn't show anything about the profile that those extensions are for

view this post on Zulip Eric Haas (May 04 2017 at 02:36):

I didn't see a problem either except the error is for http://hl7.org/fhir/ccda/StructureDefinition/CCDA-on-FHIR-Consultation-Note and the example's declared profile is http://hl7.org/fhir/ccda/StructureDefinition/CCDA-on-FHIR-Referral-Note ..so the error must lie there

view this post on Zulip Sean McIlvenna (May 04 2017 at 04:47):

@Eric Haas sorry that was a copy/paste error. I'm getting the same error for ALL Composition.section slices across all of C-CDA on FHIR's composition profiles.

view this post on Zulip Sean McIlvenna (May 04 2017 at 04:48):

which makes the list of errors quite large...

view this post on Zulip Sean McIlvenna (May 04 2017 at 04:48):

but, if I can figure out why it is producing that error, then I can eliminate a TON of those errors with one code-fix

view this post on Zulip Sean McIlvenna (May 04 2017 at 04:49):

@Grahame Grieve, you mind taking a look at this thread when you get a sec, please?

view this post on Zulip Sean McIlvenna (May 04 2017 at 04:49):

maybe you'll see something...

view this post on Zulip Sean McIlvenna (May 05 2017 at 16:54):

Could still use a hand here if someone wouldn't mind... just not figuring out why these slices aren't working

view this post on Zulip Lloyd McKenzie (May 05 2017 at 19:14):

The discriminator should be expressed relative to the element being sliced. So, for example, when Slicing Composition.section, the discriminator is "code", not "Composition.section.code"

view this post on Zulip Lloyd McKenzie (May 05 2017 at 19:14):

See if that helps and if not, I'll dig deeper

view this post on Zulip Lloyd McKenzie (May 05 2017 at 19:14):

(And sorry for taking so long to take a quick glance at your instances :()

view this post on Zulip Sean McIlvenna (May 05 2017 at 19:15):

oh man, that's it?!

view this post on Zulip Sean McIlvenna (May 05 2017 at 19:15):

awesome find, if so!

view this post on Zulip Sean McIlvenna (May 05 2017 at 19:41):

Unfortunately it's still showing the same errors

view this post on Zulip Sean McIlvenna (May 05 2017 at 19:43):

Instance: CCDA-on-FHIR-Referral-Note-Example.xml

view this post on Zulip Sean McIlvenna (May 05 2017 at 19:43):

StructureDefinition: CCDA-on-FHIR-Referral-Note.xml

view this post on Zulip Sean McIlvenna (May 05 2017 at 19:44):

Errors: pasted image

view this post on Zulip Lloyd McKenzie (May 05 2017 at 19:47):

Hmmm. You're slicing via pattern. That's supposed to work, but I've never tested it. I usually specify code.coding.system and code.coding.code as dual discriminators and assign fixed values. It's possible pattern slicing doesn't work yet.

view this post on Zulip Sean McIlvenna (May 05 2017 at 19:48):

Well, we could fix the code

view this post on Zulip Sean McIlvenna (May 05 2017 at 19:48):

but, I think we did want to leave it open to pattern

view this post on Zulip Lloyd McKenzie (May 05 2017 at 19:52):

I understand exactly why you're doing what you're doing. It just may be that you're treading in unexplored territory

view this post on Zulip Sean McIlvenna (May 05 2017 at 19:55):

So, how do we go about getting the ig publisher updated to support pattern-based slices?

view this post on Zulip Sean McIlvenna (May 05 2017 at 19:55):

:)

view this post on Zulip Lloyd McKenzie (May 05 2017 at 20:22):

Well, at the moment, it means writing code to turn a pattern into a FHIRPath expression, which is not an easy thing to do. My guess is we'll just handle the obvious one of Coding with code + system and throw an exception when we see anything else. I may have time to do that tomorrow.

view this post on Zulip Sean McIlvenna (May 08 2017 at 15:51):

Note that when I change them to "fixedCodeableConcept" I get the following error:
"Unsupported fixed value type for discriminator(code) for slice"

view this post on Zulip Sean McIlvenna (May 08 2017 at 15:51):

actually... that message is a warning.
and then I still get "Element matches more than one slice" as an error a bunch of times.

view this post on Zulip Sean McIlvenna (May 23 2017 at 19:33):

@Grahame Grieve or @Lloyd McKenzie
Were either of you ever able to take a look at this? Still not sure if this is a limitation of the IG Publisher (or validation logic used by the publisher) or if it is something I am doing wrong with the samples...

view this post on Zulip Lloyd McKenzie (May 23 2017 at 19:49):

You won't be able to use a fixed codeable concept. You'll need to do a fixed system and a fixed code. (and use both as discriminators)

view this post on Zulip Rick Geimer (May 24 2017 at 19:59):

Would be better to get pattern-based slices working in the IG publisher. Lloyd, is this restricted to the IG publisher code, or do you think this is something deeper? If just in the IG publisher I'm happy to take a look early next week and try fixing the bug.

view this post on Zulip Rick Geimer (May 24 2017 at 20:06):

Basically I worry that we are restricting what can be legally expressed in profiles to what we currently support in the IG publisher.

view this post on Zulip Lloyd McKenzie (May 24 2017 at 21:01):

It's not the publisher, but the validator (which is used by the publisher as well as stand-alone)

view this post on Zulip Lloyd McKenzie (May 24 2017 at 21:02):

If you want to take a stab at it @Rick Geimer, you're most welcome. I apologize for not getting to it yet. And realisticly, I won't have bandwidth to look at it for at least another couple of weeks.

view this post on Zulip Rick Geimer (May 24 2017 at 22:11):

Thanks, I'll work with Sean and take a look next week. Worst case will fall back to fixed system and fixed code per your suggestion.

view this post on Zulip Grahame Grieve (May 25 2017 at 03:14):

I can have a look on Monday - need to do a run of validator stuff.

view this post on Zulip Sean McIlvenna (May 30 2017 at 18:03):

I think I found the section of the InstanceValidator that needs to be improved to support fixedCodeableConcept and patternCodeableConcept... and Coding:
https://github.com/hl7-fhir/fhir-svn/blob/master/implementations/java/org.hl7.fhir.validation/src/org/hl7/fhir/r4/validation/InstanceValidator.java
Line #3478
private boolean valueMatchesCriteria(Element value, ElementDefinition criteria) throws FHIRException { ... }

view this post on Zulip Grahame Grieve (May 30 2017 at 18:46):

can you turn this into a test case ?- that is: a structure definition, and an instance that fails and one that succeeds

view this post on Zulip Sean McIlvenna (May 30 2017 at 18:57):

well, I have examples of SD's that should succeed... how do you want me to modify it so that it fails? (it is already failing)

view this post on Zulip Grahame Grieve (May 30 2017 at 18:59):

an instance that fails, not a SD that fails

view this post on Zulip Grahame Grieve (May 30 2017 at 19:00):

e.g. that is not valid against the SD

view this post on Zulip Sean McIlvenna (May 30 2017 at 19:00):

Oh gotcha.. Yes, I will get those created and attach them here

view this post on Zulip Grahame Grieve (May 30 2017 at 19:02):

thanks

view this post on Zulip Sean McIlvenna (May 30 2017 at 19:18):

Structure Definition: CCDA-on-FHIR-Referral-Note-orig.xml
Uses patternCodeableConcept for Composition.section.code, discriminates on Composition.section.code

view this post on Zulip Sean McIlvenna (May 30 2017 at 19:18):

Bad example: CCDA-on-FHIR-Referral-Note-Example-bad.xml

view this post on Zulip Sean McIlvenna (May 30 2017 at 19:19):

Good example: CCDA-on-FHIR-Referral-Note-Example.xml

view this post on Zulip Sean McIlvenna (May 30 2017 at 19:19):

the bad example duplicates one of the section, when it should be 1..1

view this post on Zulip Sean McIlvenna (May 30 2017 at 19:19):

and it also has an improper code for one of the sections

view this post on Zulip Sean McIlvenna (May 30 2017 at 19:19):

that section should not be matched to any slices

view this post on Zulip Sean McIlvenna (May 31 2017 at 21:18):

Is this what you were looking for @Grahame Grieve ?

view this post on Zulip Grahame Grieve (May 31 2017 at 23:35):

probably - got distracted and haven't got to it yet. hopefully today

view this post on Zulip Sean McIlvenna (Jun 06 2017 at 19:40):

Did you ever get to this @Grahame Grieve ?

view this post on Zulip Grahame Grieve (Jun 07 2017 at 12:34):

so I've spent about 8 hours on this now. Lloyd, umm, 'improved' the validator with the upshot that it's been ignoring profiles altogther

view this post on Zulip Grahame Grieve (Jun 07 2017 at 12:34):

now I have figured that out, and also figured out your canonical url mismatch ('_' vs '-')

view this post on Zulip Grahame Grieve (Jun 07 2017 at 12:35):

I'm finally debugging the actual slice code at last

view this post on Zulip Sean McIlvenna (Jun 07 2017 at 17:11):

well, good to hear there is progress (I think?) :)

view this post on Zulip Sean McIlvenna (Jun 07 2017 at 17:11):

sounds frustrating, though...

view this post on Zulip Sean McIlvenna (Jun 07 2017 at 17:12):

and yes, there have been problems with _ vs. - cause at one point the ig publisher wasn't handling dashes very well, so we converted them to underscores. Been a mess since then. trying to normalize them all now.

view this post on Zulip Lloyd McKenzie (Jun 07 2017 at 17:44):

I'm pretty sure it wasn't ignoring all profiles, but appologize for contributing to the problem.

view this post on Zulip Grahame Grieve (Jun 07 2017 at 20:51):

ok I just committed an update to the validator. @Sean McIlvenna, the validator says that your example good resources is missing some required slices. I haven't had a chance to check that yet - can you have a look at that?

view this post on Zulip Grahame Grieve (Jun 07 2017 at 20:51):

I'll be back on it in a few hours time

view this post on Zulip Grahame Grieve (Jun 07 2017 at 22:04):

this i swrong:

        <element id="111256">
            <path value="Composition.section.title"/>
            <sliceName value="section_slice_pos2"/>
            <short value="title"/>
            <definition value="SHALL contain exactly one [1..1] title (CONF:2219-2079)."/>
            <min value="1"/>
            <max value="1"/>
        </element>

view this post on Zulip Grahame Grieve (Jun 07 2017 at 22:04):

don't repeat the slice name on the parts of the slice, just on the first entry

view this post on Zulip Grahame Grieve (Jun 07 2017 at 22:05):

(deleted)

view this post on Zulip Grahame Grieve (Jun 07 2017 at 22:10):

And you're still using the wrong system URL for LOINC

view this post on Zulip Grahame Grieve (Jun 07 2017 at 22:22):

and also, pattern is case sensitive. are you sure you want to specify the display in the pattern?

view this post on Zulip Grahame Grieve (Jun 07 2017 at 22:33):

ok, all fixed. You should compare what I ended up with (ccda*.xml in build\tests\validation-examples) with what you gave me - will show the minimum changes I had to make to get the tests working.


Last updated: Apr 12 2022 at 19:14 UTC