Closed giacomodeliberali closed 3 years ago
Your test case examples work fine in the online demo. The case that is failing is using some other example (the linkIds do not match the example you provided). Can you provide an updated sample quesitionnaire that shows the issue? I tried using https://lforms-smart-fhir.nlm.nih.gov/v/r4/fhir/Questionnaire/44249-1-x (which has scored answers), and the expression item.answerOption.extension.where(url='http://hl7.org/fhir/StructureDefinition/ordinalValue').value finds the valueDecimals.
Using the provided questionnaire:
%q1_value
, in order to quickly check the return value of the next expressionq1_value
expression with %questionnaire.item.where(linkId = '/44250-9').answerOption.where(value.code=%resource.item.where(linkId = '/44250-9').answer.value.code).extension.where(url=%scoreExt).value
(I replaced the valueCoding
and valueDecimal
with value
, but this does not evaluate properly)value
only for the valueCoding
seems to work, but not for decimal %questionnaire.item.where(linkId = '/44250-9').answerOption.where(value.code=%resource.item.where(linkId = '/44250-9').answer.value.code).extension.where(url=%scoreExt).valueDecimal
(this evaluates properly)The same expression evaluated in the demo item.where(linkId = '/44250-9').answerOption.where(value.code='LA6569-3').extension.where(url='http://hl7.org/fhir/StructureDefinition/ordinalValue').value
correctly returns the value decimal 1.
Hi @plynchnlm , were you be able to reproduce the issue? We continue having some difficulties running the expressions created in the builder in our .NET backend
Sorry for the delay. I've been out. I have confirmed the problem. The expression "%questionnaire.item.where(linkId = '/44250-9').answerOption[1].extension[1].value" does not work in LHC-Forms, but does in fhirpath.js (if you define %questionnaire, or replace it with %context). It looks like it will be fixed by updating fhirpath.js in our "lforms" package, on which formbuilder-lhcforms depends for rendering forms. (At least, I tried updating lforms, and it fixed the issue there.) We will try to get this out soon.
This should be fixed in the current version which we just made live.
Hi, I'm having some troubles with the FHIRPath expressions.
Using the online demo tool i would expect:
descendants().item.where(linkId = '/922').answer.value
should equaltrue
descendants().item.where(linkId = '/922').answer.valueBoolean
should equaltrue
descendants().item.where(linkId = '/8511').answer.value.code
should equalF
descendants().item.where(linkId = '/8511').answer.valueCoding.code
should equalF
descendants().item.where(linkId = '/192').answer.value
should equal13
<-- not workingdescendants().item.where(linkId = '/192').answer.valueDecimal
should equal13
but the builder expression engine does not support the
.value
(it only supports the typed value, such asvalueCoding
, not anymore in the FhirPath spec). Is there any chance that you can update it to the latest version? Or at least guide me on how to update it locally?Edit: Actually expressions not evaluating properly seem to be only the ones which use
valueDecimal
.