Stream: terminology
Topic: ValueSet partial expansion
Yunwei Wang (Jan 17 2018 at 17:36):
When the $expand operation having count paramter, do I need to indicate in the returned valueset that this is a partial expansion?
Rob Hausam (Jan 17 2018 at 18:34):
That's a good question, Yunwei. I think the answer is no, as expansion.total gives the number of codes in the full (complete) expansion, regardless of paging. Unless 'limitedExpansion' has been requested, then the expansion is expected to be complete. When 'limitedExpansion' has been requested, the server is supposed to "return a limited expansion (a subset) with an indicator that expansion is incomplete". But looking through the spec again I'm not sure how we're supposed to do that for the indicator. It looks like we haven't specified it in ValueSet.expansion. You can't do it with 'parameter', because even if you request 'limitedExpansion', the expansion that was returned could actually be complete. And 'total' can't do it, since if the server is having to limit the number of codes being returned (presumably due to size constraints), it might not even know the total number of codes that would have been returned if the expansion was complete. How are you thinking of doing it?
Yunwei Wang (Jan 17 2018 at 18:52):
What I am currently doing is using toocostly extension for limitedExpansion request. Maybe notclosed extension can also be used here. But I think there should be "isLimited" property under the Valueset.expansion since that is mentioned in that section you mentioned.
I will create a Ballot comments for this.
Peter Jordan (Jan 17 2018 at 19:25):
In addition to Expansion.Total, my server also returns Expansion.Offset plus the value of the count parameter requested by the user. Admittedly the later is only in the narrative - but the combination of total, offset and what was requested should be sufficient to identify partial expansions? However, I do perform the complete expansion internally, and populate the total property, before the offset and count parameters are processed.
Rob Hausam (Jan 17 2018 at 19:32):
@Yunwei Wang Yes, the valueset-toocostly extension is the right one for most cases, I think. I thought we had an extension for it and then missed seeing it - I haven't used it myself so far. It does seem that handling it in core is best, since it is mentioned (but not described) for the operation in the core spec.
Rob Hausam (Jan 17 2018 at 19:36):
@Peter Jordan So what I was thinking of was the case where the server itself isn't able to perform the complete expansion (because it is "too costly" or due to post-coordination or whatever), so then you don't know what the value should be for 'total'.
Peter Jordan (Jan 17 2018 at 20:00):
Spec states that "If the expansion is too large (at the discretion of the server), the server will return an error (OperationOutcome with code too-costly)." I include the limit imposed by my server (9,999 concepts) in the message.
Yunwei Wang (Jan 17 2018 at 20:07):
I just thought about another use case. Server can have value set expansion only. As state in the spec "Some servers, including public value sets servers, only store expansions." So the value set is too big, like 10,000 codes, the read request to the server may get value set with limited expansion.
Peter Jordan (Jan 17 2018 at 20:11):
...but we're discussing the size of the expansion, not the entire value set (which in the case of implicit value sets is the entire code system).
Rob Hausam (Jan 18 2018 at 14:30):
I don't think I understand this comment, @Peter Jordan Since the size of the expansion is tied directly to the value set definition (although also affected by the expansion profile and parameters), I'm not sure what the "entire value set" means that is different from that. For implicit value sets, I think the size of the value set and the expansion is also determined by the implicit value set definition (e.g. "is-a 123456") and not the entire code system. But maybe I'm missing your point.
Peter Jordan (Jan 18 2018 at 19:32):
The size of an implicit value set isn't known until runtime and might (in an extreme case) be 'is-a SNOMED CT Concept'. Obviously, the size is pre-determined for extensional and intensional value sets. Either way, if the server fully expands the value set, and stores the total at that stage, before applying any count and offset parameters in the request, it will be possible to return the size of the full expansion in Expansion.total.
Last updated: Apr 12 2022 at 19:14 UTC