FHIR Chat · invarient constraints · implementers

Stream: implementers

Topic: invarient constraints


view this post on Zulip Eric Haas (Apr 25 2016 at 21:23):

What if the base constraint says "Only If A is true" and the profile says "Only if A is false"? Is there a way to validate the profile has properly constrained the invarient? Or do you figure it out when you start validate profile instances?

view this post on Zulip Grahame Grieve (Apr 26 2016 at 00:33):

I can't validate that invariants clash like that

view this post on Zulip Grahame Grieve (Apr 26 2016 at 00:33):

there just isn't any instances that can satisfy that profile

view this post on Zulip Lloyd McKenzie (Apr 26 2016 at 01:33):

In principle, we could use OWL to test those (if we figure out an algorithm to express all FluentPaths in OWL), but we're a ways away from that level of sophistication

view this post on Zulip Grahame Grieve (Apr 26 2016 at 01:34):

pfft. in theory. man. I have the full object model and I know as much about the constraints as anyone. And I have no clue how I could realistically infer from what I know that there's ( A) no instances that are valid and ( B) that's not what you want

view this post on Zulip Lloyd McKenzie (Apr 26 2016 at 01:37):

Well, I think we can presume that no valid instances is never the desired outcome. To test, we'd enforce all the constraints and then assert that there's at least one valid instance and see if the reasoner blows up.

view this post on Zulip Lloyd McKenzie (Apr 26 2016 at 01:38):

(but it doesn't blow up if you remove the assertion there's at least one instance)

view this post on Zulip Grahame Grieve (Apr 26 2016 at 01:49):

how do you infer whats' a valid instance from a expression that defines what isn't a valid instance?

view this post on Zulip Grahame Grieve (Apr 26 2016 at 01:49):

that's rather harder than it sounds

view this post on Zulip Lloyd McKenzie (Apr 26 2016 at 13:59):

You don't have to. With the test I described, the reasoner will simply test if any instance is possible. It won't evaluate whether the possible instance is "useful" though.

view this post on Zulip Grahame Grieve (Apr 26 2016 at 14:01):

going to brute force an infinite space, are you?

view this post on Zulip Lloyd McKenzie (Apr 26 2016 at 15:44):

There's nothing brute force about it. If you've got one constraint that says "must have A or B but not both" and a separate constraint that says "If A or B then must be both" and you put those together, then the reasoner will simply say "ok, there can't be any instances of this". If you add a separate assertion that there is an instance, the reasoner will blow up. It doesn't brute force anything, it just checks for consistency. That said, my experience with this sort of testing is it's not exactly super fast. Not the kind of thing we'd want to do at run-time


Last updated: Apr 12 2022 at 19:14 UTC