Stream: questionnaire
Topic: Candidate Expressions
Brian Postlethwaite (May 20 2020 at 07:45):
Has anyone implemented these as yet?
http://build.fhir.org/ig/HL7/sdc/StructureDefinition-sdc-questionnaire-candidateExpression.html
Better description is on this page (maybe we should copy some of this text onto the extension page itself)
http://build.fhir.org/ig/HL7/sdc/expressions.html
"CandidateExpressions should rarely, if ever, declare a name element." was added to the bottom, and I came up with a great use for that property (and all expressions I'll be putting into my forms) where this is the name that I use from an expression library, so that I can manage them better. (this is kind of like the library extension)
Brian Postlethwaite (May 20 2020 at 07:48):
Could this candidate expression be a "source" for a group level item, and then the child items for the group as they are "selected" from the source then leverage the initialExpression to populate values from that selection?
e.g. Have a CandidateExpression on a group for "Contacts" for the patient, then the items in the group be name, contact number, relationship, then the selection could easily enable selecting a few from the record, then shoving into the responses.
Or select relevant medications and then read the name dose etc.
Lloyd McKenzie (May 20 2020 at 15:03):
@Bryn Rhodes - is that an allows use of the Expression data type? I.e. just specify a name and have it looked up in a library?
Bryn Rhodes (May 20 2020 at 15:15):
Well, we haven't used it that way so far, but it's not an unreasonable thing to do. We currently do that quite a bit, we just do it a bit differently in that the "expression" element is the name of the expression in the library.
Bryn Rhodes (May 20 2020 at 15:16):
And the reference points to the Library containing the expression.
Lloyd McKenzie (May 20 2020 at 15:25):
I think I prefer that approach. It puts code in the code place and leaves name for human rendering
Bryn Rhodes (May 20 2020 at 19:03):
We introduced the media type text/cql.identifier
to support that use case, it would make sense to do the same thing for the FHIRPath case, that would be the signal for the implementation to know that the expression was actually the id of a content element in the referenced library.
Brian Postlethwaite (May 20 2020 at 20:50):
I was still having the expression in the questionnaire (keeping things simple for the renderer), was just a use where I was having it as a management thing.
Brian Postlethwaite (May 20 2020 at 20:51):
I'll log tracker to remove the "rarely provide a name" text
Brian Postlethwaite (May 20 2020 at 21:11):
FHIR-27537
Paul Lynch (May 20 2020 at 21:39):
http://build.fhir.org/ig/HL7/sdc/expressions.html says "name allows the result of the expression to be referenced within other expressions." I am not sure if that makes sense for candidateExpression, but if it did I would expect it to be defining a variable with the result of the candidateExpression expression.
Brian Postlethwaite (May 21 2020 at 22:26):
I created an example of trying out the candidateExpression
on a group value
https://sqlonfhir-r4.azurewebsites.net/fhir/Questionnaire/pre-pop-test-candexpr
Does this make sense to anyone other than me (refer to the contacts item)
Joee Garcia (Jul 09 2020 at 20:19):
Hi @Brian Postlethwaite, Looking at the related JIRA ticket for this: https://jira.hl7.org/browse/FHIR-27537... it seems that your example does not comply with the resolution on this ticket:
Will change "CandidateExpressions should rarely, if ever, declare a name element" to "CandidateExpresssion name can be used for documentation purposes, but will not be exposed for reference in other CQL or FHIRPath expressions.
It references the candidateExpression name "selectedContact" in other FHIRPath expressions (ie for the initialExpression "%selectedContact.telecom.where(system='phone').first().value")
Which is correct? Can the "name" element be used as a reference or not? Can you clarify @Lloyd McKenzie ?
Joee Garcia (Jul 16 2020 at 20:32):
Hi @Brian Postlethwaite, We discussed this issue in the SDC Meeting and have added a change request for it: https://jira.hl7.org/browse/FHIR-28081. Because of this, I've updated the sample questionnaire you submitted (questionnaire-fhirpath-prepop-candexpr) to use calculatedExpression for the child items instead of initialExpression (as initialExpression is only evaluated on initial load and calculatedExpression will work better when selecting/editing the answer linked to the candidateExpression)
Last updated: Apr 12 2022 at 19:14 UTC