FHIR Chat · StructureDefinition.type for logical model? · conformance

Stream: conformance

Topic: StructureDefinition.type for logical model?


view this post on Zulip Michel Rutten (Nov 05 2018 at 13:28):

I'm trying to determine how Forge should initialize the StructureDefinition.type field for logical models. R4 introduces some additional rules for logical models and StructureDefinition.type, however I don't quite understand:
http://build.fhir.org/structuredefinition-definitions.html#StructureDefinition.type
"Absolute URLs are only allowed in logical models."
- Do logical models have to specify an absolute url? Or are there other options?
- Is this an author-defined url?
- Or should this value be equal to the canonical url?
"For logical models, where the type is a URL, the type name SHOULD start with the tail of the type URL where required."
What does this mean? What "type name" does this refer to?

view this post on Zulip Grahame Grieve (Nov 06 2018 at 07:00):

view this post on Zulip Michel Rutten (Nov 09 2018 at 09:47):

Excellent, thanks for clarification!

view this post on Zulip Alexander Zautke (Dec 05 2018 at 07:49):

Thanks to Michel, Forge is now implementing these rules. Follow-up problem: When trying to validate one of these new logical models I am running into the issue that that the sdf-8 constraint is failing. If we define the type as a URL, "element.first().path = %resource.type" seems to fail. Do we need to exclude logical models in this rule, just like in e.g. sdf-11?

view this post on Zulip Michel Rutten (Dec 10 2018 at 10:48):

Concerning sdf-8, the description of StructureDefinition.type provides some guidance:
http://build.fhir.org/structuredefinition-definitions.html#StructureDefinition.type

"For logical models, where the type is a URL, the type name SHOULD start with the tail of the type URL where required."

I propose we update the sdf-8 invariant expression accordingly.

view this post on Zulip Lloyd McKenzie (Dec 10 2018 at 22:14):

@Grahame Grieve Can we make this fix for R4?

view this post on Zulip Grahame Grieve (Dec 11 2018 at 21:57):

looks like we need to

view this post on Zulip Grahame Grieve (Dec 11 2018 at 21:57):

propose a change on FHIR-I. but wouldn't committee need to vote on this one?

view this post on Zulip Lloyd McKenzie (Dec 11 2018 at 22:12):

We can un-cancel our Monday call if we need to vote on it, but we'd need to pre-apply it. I think it's a no-brainer - shouldn't be controversial

view this post on Zulip Grahame Grieve (Dec 12 2018 at 00:01):

that would be too late to apply it.

view this post on Zulip Grahame Grieve (Dec 12 2018 at 00:01):

it's normative content, and I believe it's the primary expression we are talking about here

view this post on Zulip Lloyd McKenzie (Dec 12 2018 at 03:36):

That's why I said we'd need to pre-apply. The Monday vote would be a formality

view this post on Zulip Lloyd McKenzie (Dec 12 2018 at 03:37):

If it's a situation where it's clearly broken, I think it's a non-substantive technical correction

view this post on Zulip Grahame Grieve (Dec 12 2018 at 04:26):

I feel as though FMG should ok

view this post on Zulip Lloyd McKenzie (Dec 12 2018 at 04:36):

Do you want me to put together the pull request? We can then discuss on the call.

view this post on Zulip Grahame Grieve (Dec 12 2018 at 04:39):

ok

view this post on Zulip Lloyd McKenzie (Dec 12 2018 at 04:52):

Added GF#19762

view this post on Zulip Lloyd McKenzie (Dec 12 2018 at 05:04):

The current invariant is this:
element.first().path = %resource.type and element.tail().all(path.startsWith(%resource.type&'.'))
My proposed change is this:
(kind = 'logical' or element.first().path = %resource.type) and element.tail().all(path.startsWith(%resource.snapshot.element.first().path&'.'))

view this post on Zulip Lloyd McKenzie (Dec 12 2018 at 05:05):

However, there's a problem with 8a too:

view this post on Zulip Lloyd McKenzie (Dec 12 2018 at 05:05):

element.first().path.startsWith(%resource.type) and (element.tail().not() or element.tail().all(path.startsWith(%resource.type&'.')))

view this post on Zulip Lloyd McKenzie (Dec 12 2018 at 05:07):

I can make the first part conditional on whether it's not a logical model. However, for the second part, I can't just grab the first differential element. I need to grab the first differential element, split it by "." and grab the first node.

view this post on Zulip Lloyd McKenzie (Dec 12 2018 at 05:07):

I have no idea if that's possible, or if so, how to do it. @Grahame Grieve @Bryn Rhodes ?

view this post on Zulip Bryn Rhodes (Dec 12 2018 at 05:14):

FHIRPath doesn't define a split operator, no.

view this post on Zulip Bryn Rhodes (Dec 12 2018 at 05:15):

I've tried to come up with a way to do it with repeat or aggregate, but so far, no luck.

view this post on Zulip Bryn Rhodes (Dec 12 2018 at 05:16):

If you always only need the first element in the result of the split, you can just grab that pretty easily with a substring, right?

view this post on Zulip Lloyd McKenzie (Dec 12 2018 at 05:23):

The first path might be "Foo" or "Foo.bar" or "Foo.bar.whatever". In all cases, I want to grab just the string "Foo". Not sure how to do that with substring

view this post on Zulip Grahame Grieve (Dec 12 2018 at 05:26):

I think you should just revoke the entire rules for logical models

view this post on Zulip Lloyd McKenzie (Dec 12 2018 at 05:28):

You still want logical models to have a common name as the root of all the paths

view this post on Zulip Lloyd McKenzie (Dec 12 2018 at 05:28):

I think I can use replaceMatches to turn everything following "." into nothing

view this post on Zulip Lloyd McKenzie (Dec 12 2018 at 05:31):

(kind = 'logical' or element.first().path.startsWith(%resource.type)) and (element.tail().not() or element.tail().all(path.startsWith(%resource.differential.element.first().path.replaceMatches('\..*','')&'.')))

view this post on Zulip Lloyd McKenzie (Dec 12 2018 at 05:32):

Does that look ok?

view this post on Zulip Lloyd McKenzie (Dec 12 2018 at 05:42):

I'm getting this error: .path.replaceMatches('\\..*','')&'.')))' has illegal path (The parameter type 'http://hl7.org/fhirpath/String' is not legal for replaceMatches parameter 1. expecting SINGLETON[http://hl7.org/fhir/StructureDefinition/string]) (src = Publisher)

view this post on Zulip Lloyd McKenzie (Dec 12 2018 at 05:43):

That seems like a build tool error to me? (As the example in the spec is definitely passing a fhirpathString, not a FHIR string)

view this post on Zulip Lloyd McKenzie (Dec 12 2018 at 05:43):

@Grahame Grieve ?

view this post on Zulip Grahame Grieve (Dec 12 2018 at 05:45):

it does look like an error in the code to me

view this post on Zulip Lloyd McKenzie (Dec 12 2018 at 05:46):

Is that something fixable at this point?

view this post on Zulip Grahame Grieve (Dec 12 2018 at 05:47):

it should be. It'll be a few hours though - I'm deep inside generating the extension packages

view this post on Zulip Lloyd McKenzie (Dec 12 2018 at 05:53):

I'll take a stab and see how I go


Last updated: Apr 12 2022 at 19:14 UTC