-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add variable Extension support #1059
Comments
The proposed solution is : In the extraction part in ResourceMapper, we can evaluate the expression of the named variable (such as weight) in this example, and then use this evaluated value of the named variable in the subsequent usages of this variable(such as %weight) as given in this example. Let me know if this approach is workable or suggest me better alternatives, I am open to other suggestions. Thanks |
my first question is that do you evaluate the expressions lazily or do you evaluate them before hand? do you cache the values? and if you do how do you update them when the questionnaire answers change? |
As per discussion with @jingtang10 over the call, First, I will explore whether FHIRPath supports the variables to pass them as input parameters to evaluate an expression. If I wouldn't be able to find it, I should ask a question over the Zulip FHIR chat to get an opinion from the community experts. Let's say, if FHIR Path supports the variables to pass them as input parameters to evaluate an expression, then we need to evaluate the variable values before hand and then pass these values to the FHIR path to evaluate further expression (i.e, BMI calculation) Also, I have to explore that does this variable used in the SDC population or not. @jingtang10 Can you please review my comment and let me know If I missed something here, Thanks. |
@jingtang10 , I posted this query over Zulip FHIR Chat and got an answer here. As per the comment, It should work in FHIR Path, I am going to try this out how can we apply this using FHIR Path. |
I tried to evaluate the fhirpath expressions like The solution, I am planning to implement is, Whenever the value of this variable changes (Let's say the user enters the new value of weight/height), we will update this value in the related questionnaireResponse and we will be able to use the value of this variable where needed in the questionnaire in the descendants. One thing to think over that does these variables have their usage in the population or not and if we have, please share some related examples of it, It would be helpful to cover those cases as well. |
The other approach that was suggested by @jingtang10 (please correct me If I wrote something wrong here) in the SDK Dev call is that, The question: When the value of the variable(width/height) changes after user input, how do we calculate the value of the occurrences of Variables where they are used (for example, in the calculated expression)? Do we add some callback to listen this change and update the value of the variable accordingly? Note that we have a separate ticket for CalculatedExpression as well. Variable extensions with expressions are here, The usage of these variables is in the calculation of BMI (with Calculated Expression) is given below, Please share your thoughts on these approaches or/and feel free to suggest a better approach to support variable extension. |
Moreover, I asked a question over zulip chat here related to power() function |
@Tarun-Bhardwaj kindly let us know if we can proceed with suggested above approach |
Just some initial thoughts on how this should be implemented. Please criticize it. |
@joiskash , I see your point and checked the related open issue#910 around it and yeah the assumption (questionnaireResponse.item can be uniquely identified with linkIds) would break when nested items are repeated. |
Sorry, Im not sure I understand the exact difference between the two approaches.. |
The SDC Specification said that,
so what exactly is the meaning of "adding the name of the variable to the FHIRPath's context" here?
|
I asked a query over FHIR zulip chat around variable definition at the questionnaire root level , got a reply here |
Based on Jing’s feedback in a call, I am working on a solution to
Out of these 3, I am done with Step 1 (PR#1328 is updated with it) and now working on Step 2 and then Step 3. |
The PR #1328 is updated with step 1, step 2 and step 3(partially, need to work on unit tests) of the solution mentioned above. cc: @maimoonak @f-odhiambo |
All three steps completed, PR#1328 is ready for review by Google team. |
Summary of Implemented Solution on PR#1328:
|
After removal of The new approach that I am going to implement now is,
|
@shoaibmushtaq25 @Tarun-Bhardwaj what's the status of this issue? |
Hey @fredhersch , PR just approved. Going to merge it hopefully by today. |
Is your feature request related to a problem? Please describe.
Desire to use variable names to perform calculations via SDC.
For example, to calculate BMI: (weight_value/heigh_value*height_value)
Describe the solution you'd like
Implement variable Extension support - see specification
The text was updated successfully, but these errors were encountered: