Stream: IG creation
Topic: ValueSet/$expand limit on tx.fhir.org
Max Masnick (Dec 14 2020 at 17:51):
Does anyone know why tx.fhir.org
only returns 200 items when trying to find the LOINC codes with LP31412-7
as an ancestor? There are 214 codes that are descendants per the flatfiles on loinc.org.
Here's the request in question -- note that _limit
has no effect on the number of items in the response as far as I can tell:
curl -X "POST" "http://tx.fhir.org/r4/ValueSet/$expand" \
-H 'Accept: application/json' \
-H 'Content-Type: application/fhir+xml;charset=UTF-8' \
-H 'Accept-Charset: UTF-8' \
-H 'Accept-Encoding: gzip' \
-H 'User-Agent: hapi-fhir-tooling-client' \
-d "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Parameters xmlns=\"http://hl7.org/fhir\"><id value=\"exp-params\"/><parameter><name value=\"system-version\"/><valueUri value=\"http://snomed.info/sct|http://snomed.info/sct/731000124108\"/></parameter><parameter><name value=\"includeDefinition\"/><valueBoolean value=\"false\"/></parameter><parameter><name value=\"excludeNested\"/><valueBoolean value=\"false\"/></parameter><parameter><name value=\"valueSet\"/><resource><ValueSet><status value=\"active\"/><compose><include><system value=\"http://loinc.org\"/><filter><property value=\"ancestor\"/><op value=\"=\"/><value value=\"LP31412-7\"/></filter></include></compose></ValueSet></resource></parameter><parameter><name value=\"_limit\"/><valueString value=\"1000\"/></parameter><parameter><name value=\"_incomplete\"/><valueString value=\"true\"/></parameter></Parameters>"
(cc @Mark Kramer)
Lloyd McKenzie (Dec 14 2020 at 18:02):
@Rob Hausam
Grahame Grieve (Dec 14 2020 at 20:49):
theres' no built in limit to the server. The server thinks that there's 200 codes in that value set expansion, and returns them to you
Rob Hausam (Dec 14 2020 at 20:52):
So that does raise a further question - if the server actually isn't returning the full set of concepts that it should in the expansion.
Grahame Grieve (Dec 14 2020 at 20:56):
if you think that the expansion is actually wrong, what's missing?
Rob Hausam (Dec 14 2020 at 20:57):
@Max Masnick?
Max Masnick (Dec 14 2020 at 22:46):
@Rob Hausam @Grahame Grieve Ah, sorry to jump to conclusions. There are 14 codes that appear in the LOINC hierarchy that don't appear in the tx.fhir.org expansion. Here they are: missing_loinc.txt
I'm not going to claim that these 14 codes should for sure appear in the tx.fhir.org expansion -- there very well may be a good reason they shouldn't. But here they are in case it is indicative of an actual problem. Thanks!
Grahame Grieve (Dec 14 2020 at 23:00):
Is this a difference between loinc versions?
Rob Hausam (Dec 15 2020 at 03:52):
The LOINC versions should be the same. The tx.fhir.org server is on 2.68, which is the latest. When I post the query to tx.fhir.org it returns the parameter "limitedExpansion", so it's obviously not returning everything. If I post the query to https://fhir.loinc.org it tells me that 'total' = 500. The value set definition of the ancestors of LP31412-7 is being interpreted differently by the two servers (looking for ancestors is somewhat unusual, as typically we're looking for descendants - but in this case it may make sense to do that to get what you're wanting in LOINC). The fhir.loinc.org server is returning some codes from the Multi-axial hierarchy like:
<contains>
<system value="http://loinc.org"/>
<code value="LP381385-6"/>
<display value="Choriogonadotropin.alpha subunit free | Serum or Plasma | Chemistry - non-challenge"/>
</contains>
That's perfectly legitimate, but tx.fhir.org apparently isn't doing that (which is also legitimate). So I think there are apples to oranges comparisons going on here. And it probably doesn't affect the results, but I also note that the 'system-version' expansion parameter value is for a SNOMED CT version, while we're expanding a value set defined on the LOINC (I assume that system-version is being ignored, but it's hard to be certain).
Grahame Grieve (Dec 15 2020 at 05:56):
yes it's ignored
Grahame Grieve (Dec 15 2020 at 05:58):
limitedExpansion is only saying that a limited expansion would be ok, but we don't actually have a limited expansion in this context
Mark Kramer (Dec 15 2020 at 12:56):
@Rob Hausam ancestor is correct when you are looking for descendants. It is saying, get me all codes whose ancestor is LP31412-7:
* include codes from system LNC where ancestor = "LP101591-8"
Max Masnick (Dec 15 2020 at 14:31):
Re: <name value=\"system-version\"/><valueUri value=\"http://snomed.info/sct|http://snomed.info/sct/731000124108\"/>
, this comes from the IG publisher -- this is exactly the same request the publisher makes to expand the value set, but in curl
format.
Max Masnick (Dec 15 2020 at 15:01):
The fhir.loinc.org expansion returns 280 LOINC (and some additional LOINC Part codes), which is 64 additional codes than I found when looking at MultiAxialHierarchy.csv
. I'm not sure where these additional codes are coming from yet....maybe some of the LP codes are being used recursively to find additional codes that don't show up if you only search the hierarchy for LP31412-7
?
Max Masnick (Dec 15 2020 at 15:05):
So we have:
tx.fhir.org
: 200 codes (and no LP codes)MultiAxialHierarchy.csv
: 14 additional LOINC (so 214 total), and some additional LP codesfhir.loinc.org
: 64 additional LOINC (so 280 total), and some additional LP codes
@Rob Hausam I don't think we care about the LP codes for the purposes of expanding the value set for the IG. But we still have different counts of the non-LP codes depending on the source, which I believe should be apples-to-apples.
Rob Hausam (Dec 15 2020 at 15:23):
Right, to all of the above points. I was forgetting the details on limitedExpansion. And I think I might not have ever actually tried to use the LOINC 'ancestor' property before. Thinking about it more, it's somewhat similar to using a filter op of 'descendent-of', but states it from the opposite end of the relationships (could be a little confusing). So we're still getting different behavior from the servers in regard to the Multi-axial hierarchy.
Grahame Grieve (Dec 15 2020 at 22:10):
I confirm that this is an indexing bug in tx.fhir.org
Grahame Grieve (Dec 18 2020 at 00:30):
ok is fixed now.
Last updated: Apr 12 2022 at 19:14 UTC