Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add variable Extension support (#1328)
* Added root level and item level variable extension support in Questionnaire * Refactored QuestionnaireViewModel to make code more readable * Refactored ancestors logic and add a Path to Variables map to save and retrieve Variables * Refactored variables code to make it more readable * Refactored ancestors variables code to make it readable * Refactored to make the variables update for all siblings and ancestors onAnswerChanges * Code readability improvements * Refactored, removed the extra functions * Move Extension URl to MoreQuestionnaireItemComponents file * Added unit tests for variable extension in QuestionnaireViewModelTest * Add more unit tests for variable extension * Added more unit tests for variable extension for invalid expresssions * Added some documemtation for Variables extensions * Fix spellings * Added unit tests for FHIRPathEnginehostServices * Fix unit test in FHIRPathEngineHostServices * Fixed wrong ArgumentMatchers on FHIRPathEngineHostServices file * Update Variables logic based on PR feedback * Update nullability of updateVariable in quetionnaireViewModel * Docs updated * Docs updated * Added more tests to FHIRPathEngineHostServices * Added more unit test for QuestionnaireViewModel * Update evaluateVariable method to make it re-usable * updated variableName * Removed unnecesary configs and Test runner * Updated code to add dependent variables logic in pathToVariablesMap * Add findDependents logic to find linkid and variable dependents * Fix spotless check * Fix broken unit tests * Fix broken unit tests, make variable null instead of empty * Add more unit tests for QuestionnaireViewModel * Add more unit tests * Fix regex for linkId and variable name * Added more tests * Added documentation * Refactor some unit tests of QuestionnaireViewModel * Added more test coverage * Added more test case and require check for expression language * Fix regex to match variable name * Added missing unit tests for page flow * Fix spotless Check * Fix spotless check * Spotless apply * Changed solution approach, wrote a method to use it to calculate expression on the fly * Remove questionnairePreOrderList * Refactored findVariable method to make it more readable * Removed broken, unrelated unit tests of QuestionnaireViewModel * Make evaluateExpression internal to access it for use and testing * Spotless apply * Added unit tests for root level and questionnaire item, origin variables * Added more tests for variables in QuestionnaireViewModelTest * Added failure cases and their test cases for fhirpath expressions * Remove un-related unit tests * feedback resolved around documentation * Fix some documentation and spotless apply * Revert "Fix some documentation and spotless apply" This reverts commit 9aafd1b. * Refactored documentation * spelling correction * Resolved feedback comments around documentation and immutability of map in catalog/QuestionnaireViewModel * Fix docs * Fix docs , apply spotless * Fix docs , apply spotless * Separate out apis for varaibles expression into ExpressionEvaluator * Changed Junit Assertions to Truth Assertions * Add a unit test, update documentation, spotless apply * Rename unit test * Added more documentation * Improve code readibility in Expression Evaluator and remove commented code * Fix documentation * Update datacapture/src/main/java/com/google/android/fhir/datacapture/fhirpath/ExpressionEvaluator.kt Co-authored-by: Jing Tang <[email protected]> * Update datacapture/src/main/java/com/google/android/fhir/datacapture/fhirpath/ExpressionEvaluator.kt Co-authored-by: Jing Tang <[email protected]> * Update datacapture/src/main/java/com/google/android/fhir/datacapture/fhirpath/ExpressionEvaluator.kt Co-authored-by: Jing Tang <[email protected]> * Update datacapture/src/main/java/com/google/android/fhir/datacapture/fhirpath/ExpressionEvaluator.kt Co-authored-by: Jing Tang <[email protected]> * Update datacapture/src/main/java/com/google/android/fhir/datacapture/fhirpath/ExpressionEvaluator.kt Co-authored-by: Jing Tang <[email protected]> * Update datacapture/src/main/java/com/google/android/fhir/datacapture/fhirpath/ExpressionEvaluator.kt Co-authored-by: Jing Tang <[email protected]> * Added docs, Did refatoring in ExpressionEvaluator * Fix documentation * Update datacapture/src/main/java/com/google/android/fhir/datacapture/fhirpath/ExpressionEvaluator.kt Co-authored-by: Jing Tang <[email protected]> * Update datacapture/src/main/java/com/google/android/fhir/datacapture/fhirpath/ExpressionEvaluator.kt Co-authored-by: Jing Tang <[email protected]> * Update datacapture/src/main/java/com/google/android/fhir/datacapture/fhirpath/ExpressionEvaluator.kt Co-authored-by: Jing Tang <[email protected]> * Update datacapture/src/main/java/com/google/android/fhir/datacapture/fhirpath/ExpressionEvaluator.kt Co-authored-by: Jing Tang <[email protected]> * Update datacapture/src/main/java/com/google/android/fhir/datacapture/fhirpath/ExpressionEvaluator.kt Co-authored-by: Jing Tang <[email protected]> * Refactored methods to make it more readable * Update datacapture/src/main/java/com/google/android/fhir/datacapture/fhirpath/ExpressionEvaluator.kt Co-authored-by: Jing Tang <[email protected]> * Renamed maps and fix documentation * Fix documentation * Renamed variablesMap * Added a todo, apply spotless Co-authored-by: maimoonak <[email protected]> Co-authored-by: Jing Tang <[email protected]>
- Loading branch information