Stream: terminology
Topic: ValueSet.compose and $validate-code and $expand
Gabriel Kleinoscheg (Jan 20 2021 at 19:24):
@Rob Hausam I just executed the $expand
operation on your server (http://fhir.hausamconsulting.com/) against a ValueSet (http://fhir.hausamconsulting.com/r4/ValueSet/346804/$expand) that I loaded onto that server. The ValueSet has got an .expansion
but no .compose
. As a result the server returned an error. The result is similar, when executing $validate-code
.
Subsequently, is it correct to assume that a ValueSet needs to have a .compose
for $expand
and $validate-code
to work properly? Would $expand
work in this case if the server stored expansions (https://www.hl7.org/fhir/valueset.html#storage)?
Grahame Grieve (Jan 20 2021 at 19:49):
is it correct to assume that a ValueSet needs to have a .compose for $expand and $validate-code to work properly?
that depends on what you mean by "properly". A value set with just an expansion is fragile, or error prone. But a server can choose to support it as it is; tx.fhir.org does (or should).
ryan moehrke (Jan 20 2021 at 20:28):
what do you want to happen? if you already have a valueset with a .expansion you already have the output of $expand, no? the server could be less transparent and serve up the valueset without altering it, but it makes more sense to me that in the situation where the operation is just going to return you a read on the VS it should be transparent about that.
I would be a little more apt to agree for $validate-code but I would also understand if the terminology server doesn't want to validate when they can't verify the integrity of the expansion
Rob Hausam (Jan 20 2021 at 21:44):
@Gabriel Kleinoscheg I'm not actually quite sure what the behavior of HAPI 5.1.0 (which my server is using currently) is in regard to stored expansions. It's something that Rob McClure has discussed with James Agnew, but I'm not entirely sure what that has landed with what HAPI has implemented. I really should know that, though (especially for my own server), so I will try to check that out.
Michael Lawley (Jan 20 2021 at 22:25):
There's also a requirement that the supplied expansion is only usable if the $expand call is made with compatible parameters.
Rob Hausam (Jan 20 2021 at 22:27):
Yes, we've stated that in our discussions. And it's kind of obvious (or probably should be) that it has to be that way. But I'm not sure that we've actually documented that in any detail anywhere in the spec so far?
Michael Lawley (Jan 20 2021 at 22:33):
I think this is clear:
If the value set already has an expansion (e.g., a stored expansion):
- Check that the parameters associated with the $expand operation are consistent with the parameters recorded in the expansion
- If the parameters are inconsistent, then either generate a new expansion, or, if there is no definition (.compose), return an error
- Additional parameters may be applied to an existing expansion if the server has validated that the result will be the same as if the expansion was generated directly from the value set definition (e.g. text filter, designations included).
Rob Hausam (Jan 20 2021 at 22:51):
Yes, I agree that is clear. I wasn't recalling that we had actually included that level of detail.
Gabriel Kleinoscheg (Jan 21 2021 at 09:18):
Thank you all so far, for your answers.
With "to work properly" I meant that $expand
returns an expansion and $validate-code
lets you check if a code is part of the ValueSet (containing only a expansion).
I now want to summarize your answers - please correct me if I'm wrong:
$expand
may return an expansion- if the ValueSet contains a
.compose
(by default retrieving the most current concepts from the referenced CodeSystem) - if the ValueSet contains only an
.expansion
it depends on the server if stored expansions are supported.- For this case, I wonder if there was an expample where I could test this functionality. Especially, what @Michael Lawley mentioned: "Check that the parameters associated with the
$expand
operation are consistent with the parameters recorded in the expansion".
- For this case, I wonder if there was an expample where I could test this functionality. Especially, what @Michael Lawley mentioned: "Check that the parameters associated with the
- if the ValueSet contains a
$validate-code
requires.compose
Grahame Grieve (Jan 21 2021 at 09:49):
tx.fhir.org should return you the expansion. I haven't got around to checking expansion parameters yet
Robert McClure (Jan 21 2021 at 23:33):
This all would be a lot simpler if we worked to include the cpg value set profiles (properly generalized) in FHIR core on value set. Vocab is working to do this. We would then encourage terminology servers (HAPI anyone?) to use these profiles to clarify what the resource can be used to do.
Last updated: Apr 12 2022 at 19:14 UTC