8000 Rework Survey and Introduce Task Instructions by jdisho · Pull Request #97 · StanfordBDHG/LLMonFHIR · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Rework Survey and Introduce Task Instructions #97

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

Merged
merged 22 commits into from
May 7, 2025
Merged

Rework Survey and Introduce Task Instructions #97

merged 22 commits into from
May 7, 2025

Conversation

jdisho
Copy link
Member
@jdisho jdisho commented Apr 22, 2025

Rework Survey and Introduce Task Instructions

♻️ Current situation & Problem

In the previous approach, most of the code was added in the two different files making it a bit overwhelming to navigate and understand the code.

⚙️ Release Notes

  • The existing approach has been reorganized into separate files for better organization.
  • File names and objects have been renamed to better reflect their purpose.
  • The main architectural change is in survey state management. Now, FreeTextView, NPSView, and ScaleView each have their own dedicated state object.
  • Added task instructions as a new property to the Survey. These instructions will be displayed before the task begins, helping users understand the purpose of the task.
  • We can now set how many assistant messages we want to get in a survey task before moving to the next one. This helps guide users during the task and may lead to better quality data.
  • Added LimitedCollection (a collection that holds a set number of items and gives an error when full) and LimitedCollectionDictionary (a dictionary where each key links to a collection with a set limit), which handle the work for the feature above.
  • Added an info button that lets users view the survey task instructions anytime.
Simulator Screenshot - iPhone 16 - 2025-05-04 at 08 42 19

Code of Conduct & Contributing Guidelines

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

@jdisho jdisho self-assigned this Apr 22, 2025
@jdisho jdisho changed the title Rework Survey Rework Survey and Introduce Task Instructions Apr 22, 2025
Copy link
codecov bot commented Apr 23, 2025

Codecov Report

Attention: Patch coverage is 0.62112% with 160 lines in your changes missing coverage. Please review.

Project coverage is 23.24%. Comparing base (356cbab) to head (66a3cfa).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...erpretation/UserStudy/UserStudyChatViewModel.swift 0.00% 31 Missing ⚠️
...IRInterpretation/UserStudy/Survey/SurveyView.swift 0.00% 24 Missing ⚠️
...IRInterpretation/UserStudy/UserStudyChatView.swift 0.00% 19 Missing ⚠️
...IRInterpretation/UserStudy/LimitedCollection.swift 0.00% 13 Missing ⚠️
...n/UserStudy/Survey/Views/TaskInstructionView.swift 0.00% 12 Missing ⚠️
...tation/UserStudy/LimitedCollectionDictionary.swift 0.00% 11 Missing ⚠️
...erpretation/UserStudy/Survey/Views/ScaleView.swift 0.00% 8 Missing ⚠️
...retation/UserStudy/Survey/Views/FreeTextView.swift 0.00% 7 Missing ⚠️
...R/FHIRInterpretation/UserStudy/Survey/Survey.swift 0.00% 5 Missing ⚠️
...pretation/UserStudy/Survey/Task/TaskQuestion.swift 0.00% 5 Missing ⚠️
... and 11 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #97      +/-   ##
==========================================
- Coverage   26.48%   23.24%   -3.23%     
==========================================
  Files          44       57      +13     
  Lines         544      624      +80     
==========================================
+ Hits          144      145       +1     
- Misses        400      479      +79     
Files with missing lines Coverage Δ
...nterpretation/UserStudy/UserStudyWelcomeView.swift 2.50% <ø> (ø)
LLMonFHIR/LLMonFHIRDelegate.swift 100.00% <100.00%> (ø)
...pleResources/FHIRMultipleResourceInterpreter.swift 36.37% <0.00%> (ø)
...tipleResources/MultipleResourceChatViewModel.swift 0.00% <0.00%> (ø)
.../MultipleResources/MultipleResourcesChatView.swift 0.00% <0.00%> (ø)
...RInterpretation/UserStudy/Survey/SurveyError.swift 0.00% <0.00%> (ø)
...erpretation/UserStudy/Survey/Task/SurveyTask.swift 0.00% <0.00%> (ø)
...ion/UserStudy/Survey/Task/TaskQuestionAnswer.swift 0.00% <0.00%> (ø)
...ation/UserStudy/Survey/Task/TaskQuestionType.swift 0.00% <0.00%> (ø)
...erStudy/Survey/Views/TaskQuestionSectionView.swift 0.00% <0.00%> (ø)
... and 13 more

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 356cbab...66a3cfa. Read the comment docs.

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

@jdisho jdisho marked this pull request as ready for review May 4, 2025 06:54
@jdisho jdisho requested a review from PSchmiedmayer May 4, 2025 06:58
@jdisho jdisho added the enhancement New feature or request label May 4, 2025
# Update `SpeziAccessGuard`

## ♻️ Current situation & Problem
The problem with the previous approach was that the EnterCodeView was
added as an overlay of the guarded view, which means that when the
EnterCodeView is shown, all the work happening onAppear of the guarded
view will be executed even though the view is not visible.

## ⚙️ Release Notes
StanfordSpezi/SpeziAccessGuard#29
StanfordSpezi/SpeziAccessGuard#30

### Code of Conduct & Contributing Guidelines
By creating and submitting this pull request, you agree to follow our
[Code of
Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md):
- [x] I agree to follow the [Code of
Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md).

Co-authored-by: Paul Schmiedmayer <PSchmiedmayer@users.noreply.github.com>
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 great; only had a few comments.

In the future we should consider using the new ResearchKit SwiftUI views for the work here; their current state is not yet fully tested and defined but it could simply this process in the future.

@jdisho
Copy link
Member Author
jdisho commented May 6, 2025

Thanks for the feedback @PSchmiedmayer.

What complexities do you see right now that these ResearchKit views could help simplify?

@PSchmiedmayer
Copy link
Member

RK could help us to cover some of the UI components we manually implemented for the questions here and the way how we parse information form them. I think it might make sense to look into this, especially their SwiftUI views as they start to make them more stable and extend them. But that is a follow-up PR and even an element that we are trying to work on in ResearchKitOnFHIR and did not yet have the time to do so + the SwiftUI implementation of RK is missing some elements that we reported in the past and they are working on.

@jdisho jdisho merged commit 28e8581 into main May 7, 2025
8 of 9 checks passed
@jdisho jdisho deleted the rework-survey branch May 7, 2025 23:46
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
0