Skip to content

FormStep visibilityRule from enableWhen#91

Draft
pauljohanneskraft wants to merge 3 commits intomainfrom
form-step-visibility-rule
Draft

FormStep visibilityRule from enableWhen#91
pauljohanneskraft wants to merge 3 commits intomainfrom
form-step-visibility-rule

Conversation

@pauljohanneskraft
Copy link
Contributor

FormStep visibilityRule from enableWhen

♻️ Current situation & Problem

Currently, a nested item's enableWhen property is simply ignored. With these changes, we introduce a translation from the enableWhen property in FHIR to the visibilityRule property of a ORKFormStep.

⚙️ Release Notes

  • Introduces visibilityRule generated from enableWhen property in a FHIR questionnaire

📚 Documentation

Please ensure that you properly document any additions in conformance to Spezi Documentation Guide.
You can use this section to describe your solution, but we encourage contributors to document your reasoning and changes using in-line documentation.

✅ Testing

Please ensure that the PR meets the testing requirements set by CodeCov and that new functionality is appropriately tested.
This section describes important information about the tests and why some elements might not be testable.

Code of Conduct & Contributing Guidelines

By creating and submitting this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

@pauljohanneskraft pauljohanneskraft force-pushed the form-step-visibility-rule branch from b0566a7 to f8d3729 Compare April 25, 2025 16:09
@pauljohanneskraft pauljohanneskraft changed the base branch from main to nested-skips April 25, 2025 16:10
@codecov
Copy link

codecov bot commented Apr 25, 2025

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.

Project coverage is 85.84%. Comparing base (e4470f7) to head (f8d3729).

Files with missing lines Patch % Lines
...hKitOnFHIR/FHIRToResearchKit/NavigationRules.swift 83.34% 1 Missing ⚠️
...RToResearchKit/QuestionnaireItem+ResearchKit.swift 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff                @@
##           nested-skips      #91      +/-   ##
================================================
- Coverage         87.84%   85.84%   -2.00%     
================================================
  Files                28       28              
  Lines               485      487       +2     
================================================
- Hits                426      418       -8     
- Misses               59       69      +10     
Files with missing lines Coverage Δ
...hKitOnFHIR/FHIRToResearchKit/NavigationRules.swift 88.24% <83.34%> (-5.51%) ⬇️
...RToResearchKit/QuestionnaireItem+ResearchKit.swift 52.39% <0.00%> (-7.61%) ⬇️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e4470f7...f8d3729. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@PSchmiedmayer PSchmiedmayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me; would love to get an review from @vishnuravi as well 👍

@PSchmiedmayer PSchmiedmayer added the enhancement New feature or request label Apr 26, 2025
Base automatically changed from nested-skips to main May 12, 2025 20:45
@pauljohanneskraft
Copy link
Contributor Author

Unfortunately, I have noticed that this implementation doesn't actually work... To really make this work, we would probably need to rewrite some parts of this library as a whole (e.g. we would need to have access to previously created steps within the task, which is not possible with the current setup). I actually planned to use enableWhen within questionnaires in ENGAGE-HF, but ultimately decided against using enableWhen for individual parts of steps and simply using it on a step-by-step level instead.

This is still definitely an interesting problem to solve, but I'm not sure, if I can do the whole refactoring very soon - happy to explain the problem in more detail though, if someone is willing to take this over!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments