question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

InValueSet on non-Code types

See original GitHub issue

Both of the following expressions seem to be accepted by the CQL2ELM translator, where C is an alias for a FHIR 3.0.0 Condition:

C.category.coding[0].code in "Problem"
C.category.coding[0] in "Problem"

Specifically, they are translated into an InValueSet node, where the immediate child is a FHIRHelpers.toString and a FHIRHelpers.toCode call respectively. The InValueSet definition in clinicalexpression.xsd does seem to allow any Expression:

<xs:complexType name="InValueSet">
  <xs:annotation>
    <xs:documentation>The InValueSet operator returns true if the given code is in the given value set.
Note that this operator explicitly requires a ValueSetRef as its valueset argument. This allows for both static analysis of the value set references within an artifact, as well as the implementation of valueset membership by the target environment as a service call to a terminology server, if desired.</xs:documentation>
  </xs:annotation>
  <xs:complexContent>
    <xs:extension base="Expression">
      <xs:sequence>
        <xs:element name="code" type="Expression"/>
        <xs:element name="valueset" type="ValueSetRef"/>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

Passing any arbitrary expression doesn’t make sense to me though. For example, asking if a DateTime is in a valueset would be nonsensical.

The July 2017 CQL specification indicates that InValueSetRef “Tests a string, code, or concept for membership in a valueset”.

I’m basically looking for clarification of the expected semantics here. If I simply use the code ID String should the InValueSet node return “true” if it is in the valueset for any code system? Alternatively, is this an oversight in the spec and/or the CQL2ELM translator? Perhaps CQL2ELM actually should fail in this instance and the spec just hasn’t been updated accordingly.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
brynrhodescommented, Mar 14, 2018

@WilliamParker After discussion with the CDS WG, the comment was resolved to indicate that a run-time error is the best behavior because attempting to use a string overload with a value set that contains multiple code systems is ambiguous.

0reactions
brynrhodescommented, Mar 16, 2018

The former, the determination can be made entirely within the context of the In evaluation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

InValueSet Function - CSPro Help
The invalueset function determines whether an item's current value is within the permissible ranges of a value set. In addition to specifying the...
Read more >
Insights into the evolution of mammalian telomerase: Platypus ...
The platypus, Ornithorhynchus anatinus, is an important species for evolutionary studies ... The consensus tree was created with burn-in value set to 625....
Read more >
Cryptic Diversity of the European Blind Mole Rat Nannospalax ...
We explored the cryptic speciation of the Nannospalax leucodon species complex, ... sampling every 100th generation, with the burn-in value set to 500....
Read more >
논코드
[NONCODE] Bent Warmer turtleneck · $12.00 ; (SALE) Denny Hart Denim Pants · $16.29 ; dainty slit terry T-shirt · $13.71 ; Lindsay...
Read more >
nq91695_ocr.pdf - TSpace
species, M. oryzae, was segregated from M. grisea based on phylogenetic anal ... that were likely noncoding, sequences lacking homology to known genes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found