FHIR Chat · References in Parameters · Da Vinci

Stream: Da Vinci

Topic: References in Parameters


view this post on Zulip Bryn Rhodes (Jul 19 2018 at 20:06):

Based on this note I think that using relative paths in the resources in the Parameters is non-conformant. @Nikolai Schwertner @Eric Haas, do you have the same read? So we'd expect to see absolute URLs in the resources being exchanged.

view this post on Zulip Eric Haas (Jul 19 2018 at 20:16):

I agree, but I don't understand the need for absolute references either since I don't know what data reciever is going to do with them. all you need to know the resource Type. we may be missing a formal Graph definition ( I admit I didn't look at the MRP Measure profile - does that define it and can you send me link? ) or back to using a bundle instead as an implicit graph. Good catch. and great to have @Nikolai Schwertner implementing as we create the IG.

view this post on Zulip Bryn Rhodes (Jul 19 2018 at 20:20):

No, I think we still use parameters, but I do wonder whether we can use transient ids in a Parameters resource. @Lloyd McKenzie any thoughts? I assume this isn't the only place people would want to do that.

view this post on Zulip Eric Haas (Jul 19 2018 at 20:27):

My point is at least in MRP assuming the correct resources instances are present you only need to know the resource type to process so the references matter only as a validation.

view this post on Zulip Bryn Rhodes (Jul 19 2018 at 20:27):

Yep, totally agree

view this post on Zulip Lloyd McKenzie (Jul 19 2018 at 20:51):

We wouldn't use relative paths, we'd us local ids - so "#foo"

view this post on Zulip Lloyd McKenzie (Jul 19 2018 at 20:53):

Though that doesn't totally work either because they're in the context of the parent... @Grahame Grieve ?

view this post on Zulip Eric Haas (Jul 19 2018 at 20:57):

?"context of the parent"?

view this post on Zulip Bryn Rhodes (Jul 19 2018 at 21:00):

Right, the parent in a Bundle is the Bundle so you can resolve it, or in a contained element is the containing resource, but in a Parameters, that documentation explicitly says you can't do that.

view this post on Zulip Eric Haas (Jul 19 2018 at 21:01):

so Why not go back to a Bundle?

view this post on Zulip Bryn Rhodes (Jul 19 2018 at 21:09):

Pass a Bundle as the second parameter? Or as the only Parameter?

view this post on Zulip Eric Haas (Jul 19 2018 at 22:02):

only one

view this post on Zulip Eric Haas (Jul 19 2018 at 22:03):

since you need the rel urls to work

view this post on Zulip Eric Haas (Jul 19 2018 at 22:04):

collection become just a return bundle

view this post on Zulip Bryn Rhodes (Jul 19 2018 at 22:11):

I wonder if this is an unintended consequence of this change: GF#17273

view this post on Zulip Bryn Rhodes (Jul 19 2018 at 22:11):

Because now in MeasureReport, we effectively can't reference transient resources, unless we make them contained.

view this post on Zulip Bryn Rhodes (Jul 19 2018 at 22:11):

Which is, I suppose, another option.

view this post on Zulip Lloyd McKenzie (Jul 19 2018 at 22:19):

Contained is to be used when resources cannot stand alone and aren't expected to ever be referenced by anything else. That wouldn't hold here.

view this post on Zulip Bryn Rhodes (Jul 19 2018 at 22:23):

Agree, just trying to figure out how to support the case where the Provider is trying to use $submit-data but doesn't necessarily want to say "I actually have a Task resource at this URL", they just want to communicate that this is what it would look like if I did.

view this post on Zulip Lloyd McKenzie (Jul 19 2018 at 22:26):

I don't understand that. You have a Task or you don't. It may or may not have a RESTful URL. And it may have an intent of proposed or planned rather than requested, but it's still a Task.

view this post on Zulip Bryn Rhodes (Jul 19 2018 at 22:28):

Okay, so if I send you a MeasureReport and it has a reference to a Task by an absolute URL, it's not non-conformant for me to return a 404 when you attempt to resolve that resource reference against my server?

view this post on Zulip Bryn Rhodes (Jul 19 2018 at 22:28):

Just trying to make sure I understand.

view this post on Zulip Lloyd McKenzie (Jul 19 2018 at 22:28):

If the task doesn't exist on your server, it shouldn't have a URL

view this post on Zulip Lloyd McKenzie (Jul 19 2018 at 22:29):

It can (and should) just be a urn:uuid as the fullUrl

view this post on Zulip Bryn Rhodes (Jul 19 2018 at 22:29):

Ah, gotcha.

view this post on Zulip Lloyd McKenzie (Jul 19 2018 at 22:29):

(Should have said "If the task doesn't exist on some server...")

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:05):

so, umm, I've missed some context here.... can someone explain with examples?

view this post on Zulip Eric Haas (Jul 19 2018 at 23:08):

### Examples

Scenario: Provider X submits MRP data for Patient Z to Payer Z

Assumptions: ...TODO...

#### Request using POST Syntax

POST [base]/MeasureReport/measure-mrp/$submit-data

Request body

{
   "resourceType":"Parameters",
   "parameter":[
      {
         "name":"measurereport",
         "resource":"{"resourceType": "MeasureReport",
         ...}
      },
      {
        "name":"resource",
        "resource":"{"resourceType": "Task",
        ...}
      },
      {
        "name":"resource",
        "resource":"{"resourceType": "Patient",
        ...}
      },
      {
        "name":"resource",
        "resource":"{"resourceType": "Location",
          ...}
      },
      {
        "name":"resource",
        "resource":"{"resourceType": "Practitioner",
        ...}
      },
      {
        "name":"resource",
        "resource":"{"resourceType": "Organization",
        ...}
      },
      {
        "name":"resource",
        "resource":"{"resourceType": "Encounter",
        ...}

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:11):

ok, and what's the question?

view this post on Zulip Eric Haas (Jul 19 2018 at 23:15):

If MeasureReport can't reference Task directly in the Parameters resource. So if we want a reference that resolves what to do. I suggested go back to bundle. I'm not sure what Bryn was suggesting

view this post on Zulip Eric Haas (Jul 19 2018 at 23:16):

I think he was suggesting the resources where created on the fly and are not persisted anywheres

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:16):

MeasureReport needs to reference the Task?

view this post on Zulip Eric Haas (Jul 19 2018 at 23:17):

Technically it does not for the MRP use case since its tightly defined what is to be sent. But not sure about the general case.

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:18):

so the general case is that the task resource has a an id of task1

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:18):

the MeasureReport refers to it as "reference": "Task/task1"

view this post on Zulip Eric Haas (Jul 19 2018 at 23:18):

Y

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:18):

of course that can be a generated UUID

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:19):

the tricky bit is that when you put a resource in a parameters, you have to say which other parameter location(s) the resource could resolve to in the Parameters

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:19):

if it doesn't resolve in the parameters, then you fall back to general resolution rules

view this post on Zulip Eric Haas (Jul 19 2018 at 23:19):

yes and as Bryn pointed out is not supported: https://chat.fhir.org/#narrow/stream/128-DaVinci/subject/References.20in.20Parameters/near/165935

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:20):

what is not supported?

view this post on Zulip Eric Haas (Jul 19 2018 at 23:20):

http://build.fhir.org/parameters.html#ids

view this post on Zulip Eric Haas (Jul 19 2018 at 23:21):

last row

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:22):

umm, I'm not seeing what is not supported...

view this post on Zulip Eric Haas (Jul 19 2018 at 23:22):

"that resources cannot reference content in another resource using an internal reference (except for references inside contained resources)"

view this post on Zulip Eric Haas (Jul 19 2018 at 23:24):

Unless we have misinterpreted that part.

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:26):

I didn't think we were talking about internal references

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:26):

that's why I said "reference" : "Task/task1"

view this post on Zulip Eric Haas (Jul 19 2018 at 23:32):

I thought that was what internal references meant here

view this post on Zulip Eric Haas (Jul 19 2018 at 23:32):

reference inside the Parameters resource between parameters

view this post on Zulip Eric Haas (Jul 19 2018 at 23:34):

So where is the topic of referencing resources within Parameters discussed.

view this post on Zulip Lloyd McKenzie (Jul 19 2018 at 23:34):

For resources inside a Parameters instance, what's the fullUrl?

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:35):

internal reference = "reference" : "#a234234"

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:35):

there is no fullUrl. only relative reference resolution

view this post on Zulip Lloyd McKenzie (Jul 19 2018 at 23:36):

So when you pass something to an operation, you can't indicate where the data actually lives? So if something wants to query more information about a passed argument, it can't?

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:37):

not in the infrastructure, no

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:37):

has to be a parameter, I guess

view this post on Zulip Eric Haas (Jul 19 2018 at 23:37):

or a Bundle

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:37):

could do that too

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:38):

but we're clear about internal, relative and absolute references y?

view this post on Zulip Lloyd McKenzie (Jul 19 2018 at 23:44):

Relative references are only allowed between things that have the same fullUrl - and we don't know what the fullUrl of the things in Parameters are

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:45):

"Relative references are only allowed between things that have the same fullUrl" - you have evidence for that?

view this post on Zulip Lloyd McKenzie (Jul 19 2018 at 23:48):

That's the rule in Batch and in regular REST transactions.

view this post on Zulip Lloyd McKenzie (Jul 19 2018 at 23:50):

You can't have a relative reference in a regular REST operation if the resource lives on a different server than the referencing resource. And in Batch, relative references can only happen if the resource has the same base. That's what the documented resolution rules say.

view this post on Zulip Lloyd McKenzie (Jul 19 2018 at 23:51):

We don't have any resolution rules for Parameters

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:57):

first paragraph: wrong. So far as I can see

view this post on Zulip Lloyd McKenzie (Jul 19 2018 at 23:58):

First paragraph of what?

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:58):

I can't find either of these explicitly stated:

  • You can't have a relative reference in a regular REST operation if the resource lives on a different server than the referencing resource.
  • And in Batch, relative references can only happen if the resource has the same base.

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:59):

I think you've extrapolated and done so slightly wrongly

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:59):

but we do have a problem:

If the fullUrl starts with urn:uuid: or urn:oid:, then append the id to the base URL

view this post on Zulip Grahame Grieve (Jul 19 2018 at 23:59):

what base URL?

view this post on Zulip Lloyd McKenzie (Jul 19 2018 at 23:59):

http://build.fhir.org/references.html#literal: a relative URL, which is relative to the Service Base URL, or, if processing a resource from a bundle, which is relative to the base URL implied by the Bundle.entry.fullUrl (see Resolving References in Bundles)

view this post on Zulip Grahame Grieve (Jul 20 2018 at 00:31):

soI did not not think to look there, but you are extrapolating. but we could certainly clarify resolution in a parameters resource. The key thing is that you can only resolve using relative references, and only to specified parameters

view this post on Zulip Lloyd McKenzie (Jul 20 2018 at 01:00):

Extrapolation is all you can do in the absence of specific guidance :)

If you can only resolve using relative references, does that mean that we can't assume that any of the relative references are or can refer to elements on the server on which the operation is being invoked? If it can include a mixture, how do we differentiate? I'm beginning to think that having fullUrl on Parameters.parameter (required and allowed only if parameter.resource is present) would be a good idea.

view this post on Zulip Grahame Grieve (Jul 20 2018 at 01:01):

in the absence of guidance it creates less confusion if you admit the absence rather than stating that your expectations are law

view this post on Zulip Grahame Grieve (Jul 20 2018 at 01:02):

what I proposed above is that for some parameters, you indicate that they can resolve in other parameters, and that either way you fall back to local resolution rules

view this post on Zulip Grahame Grieve (Jul 20 2018 at 01:02):

the difference with Bundle is that we anticipate cross server resolution is necessary. I don't see that this is an issue for operations

view this post on Zulip Lloyd McKenzie (Jul 20 2018 at 01:07):

Ok, so you treat all elements in the Parameters instance as potentially resolvable within the instance. It they don't, you expect them to resolve on the target server. If they don't resolve there, it's an error. If they resolve in both places (in the instance and on the server), the resource in the Parameters is interpreted to be the same as the one on the server?

view this post on Zulip Lloyd McKenzie (Jul 20 2018 at 01:07):

(though possibly a different version)

view this post on Zulip Grahame Grieve (Jul 20 2018 at 01:07):

well, I think it needs to be specified on the parameters in the defintion - it depends on why a parameter is provided.

view this post on Zulip Grahame Grieve (Jul 20 2018 at 01:07):

but parameters overrides if there's a match

view this post on Zulip Lloyd McKenzie (Jul 20 2018 at 01:09):

I'm not thrilled with the idea that resolution behaves differently based on non-computable rules. That makes general-purpose validation of the instance impossible

view this post on Zulip Grahame Grieve (Jul 20 2018 at 01:09):

can add it to operation definition if we want

view this post on Zulip Lloyd McKenzie (Jul 20 2018 at 01:11):

So "local-only" (in Parameters, not on server), "server-only", "both", "either"?

view this post on Zulip Grahame Grieve (Jul 20 2018 at 01:11):

nominate which parameter might be a place to look for resolution.

view this post on Zulip Grahame Grieve (Jul 20 2018 at 01:12):

there's places where you don't want to resolve because of the operation semantics

view this post on Zulip Grahame Grieve (Jul 20 2018 at 01:12):

Eric's example above: "resource" is provided to be a resolve target

view this post on Zulip Lloyd McKenzie (Jul 20 2018 at 01:12):

But that could be different for different references - that gets evil fast.

view this post on Zulip Grahame Grieve (Jul 20 2018 at 01:13):

don't see that would matter

view this post on Zulip Grahame Grieve (Jul 20 2018 at 01:13):

just list the possible resolutions.

view this post on Zulip Grahame Grieve (Jul 20 2018 at 01:13):

anyway, should be an extension for now

view this post on Zulip Lloyd McKenzie (Jul 20 2018 at 01:13):

So "these are the parameter paths where some of the references in this resource might resolve to"?

view this post on Zulip Grahame Grieve (Jul 20 2018 at 01:14):

y something like that

view this post on Zulip Grahame Grieve (Jul 20 2018 at 01:14):

else server resolves locally. and decides what to do if there's no match

view this post on Zulip Lloyd McKenzie (Jul 20 2018 at 01:14):

I think just saying "might resolve somewhere in the Parameters instance" should be sufficient. It's not like it's hard to check across everything in the resource.

view this post on Zulip Lloyd McKenzie (Jul 20 2018 at 01:15):

The question is knowing whether it's supposed to resolve or not

view this post on Zulip Lloyd McKenzie (Jul 20 2018 at 01:16):

Or I guess more useful would be "Is there an expectation this parameter will be pointed to by something" and if so, from where.

view this post on Zulip Grahame Grieve (Jul 20 2018 at 01:17):

y nicer that way round

view this post on Zulip Lloyd McKenzie (Jul 20 2018 at 01:32):

GF#17508, GF#17509


Last updated: Apr 12 2022 at 19:14 UTC