Details
-
Change Request
-
Resolution: Persuasive with Modification
-
Medium
-
Structured Data Capture (SDC) (FHIR)
-
current
-
FHIR Infrastructure
-
Using Expressions
-
-
Brian Postlethwaite/Paul Lynch: 3-0-0
-
Correction
-
Non-compatible
Description
See https://chat.fhir.org/#narrow/stream/179255-questionnaire/topic/.25resource.2Eanswers.28.29.2Evalue.2Eordinal.28.29.2Esum.28.29, which might have updates.
The SDC PHQ-9 example includes the FHIRPath %resource.answers().value.ordinal().sum() as a calculated expression to compute the sum of the scores. There are a number of issues here that need some correction or clarification.
1) %resource.answers() will return all of the answers for the questionnaire, including the answer that contains the calculated expression. What happens when that total value along with the others is passed to ordinal()? (Note: Lloyd's suggestion is to exclude it, with something like %resource.repeat(item).where(linkId != 'totalScore').answers() – though then I think answers() is equivalent to answer.value, and so it is not really worth having.
2) The page defining answers() says, "The function is equivalent to descendants().where($this is QuestionnaireResponse.item.answer.value)". That expression does not make sense to me. The "is" operator is suppose to take a type specifier (e.g., "$this is Patient").
3) The ordinal() function refers to the ordinalValue extension, which two years ago (FHIR-24672) was voted to be renamed to "itemWeight". I am not sure why that issue has sat for two years, if that is really going to happen, perhaps we should go ahead and rename the "ordinal" function now?
4) The input to ordinal is a bunch of values, presumably Codings, but as noted above might include a total value. When looking for the ordinalValue extensions for this codings, how does the ordinal() implementation know which items the Codings came from? I suppose an implementation might keep internally track of where those Codings came from, but what if someone writes, ("1234-5").combine("23456-7").ordinal() (or otherwise constructs some codes/Codings as input without a Questionnaire item source)?
5) Related to (4), the documentation for ordinal() is unclear on several points. It seems to have the notion that there is a particular element or item in view. There is %context, but that is the item on which the expression sits, which could very well be a sibling of the items with the scores (as in the PHQ-9).
Attachments
Issue Links
- mentioned in
-
Page Loading...