-
Notifications
You must be signed in to change notification settings - Fork 252
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 Launch and Submission Timestamps to QR #2400
base: master
Are you sure you want to change the base?
Add Launch and Submission Timestamps to QR #2400
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
…nsrp/android-fhir into add-launch-and-submission-timestamps
@hamza-vd Please update the branch to latest. |
@aditya-07 this is done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should not implicitly do this for all Questionnaires as it might be undesirable to receive unexpected items in QuestionnaireResponse.
We should consider adding the flag to either DataCaptureConfig or via QuestionnaireFragment.args!
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
…nsrp/android-fhir into add-launch-and-submission-timestamps
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireFragment.kt
Outdated
Show resolved
Hide resolved
# Conflicts: # datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireFragment.kt
datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
Outdated
Show resolved
Hide resolved
...e/src/main/java/com/google/android/fhir/datacapture/extensions/MoreQuestionnaireResponses.kt
Outdated
Show resolved
Hide resolved
internal fun QuestionnaireResponse.addLaunchTimestamp() { | ||
val noLaunchTimeStampExists = | ||
this.extension.none { | ||
it.url == "http:https://github.com/google-android/questionnaire-launch-timestamp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't hardcode values like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is addressed
...e/src/main/java/com/google/android/fhir/datacapture/extensions/MoreQuestionnaireResponses.kt
Show resolved
Hide resolved
# Conflicts: # datacapture/src/main/java/com/google/android/fhir/datacapture/QuestionnaireViewModel.kt
} | ||
set(value) { | ||
val noLaunchTimeStampExists = this.extension.none { it.url == EXTENSION_LAUNCH_TIMESTAMP } | ||
if (noLaunchTimeStampExists) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this extension already exists we probably should update the value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to track the metric from the point the user has opened the Questionnaire until submission. The original timestamp should remain as is even if user navigates away from the questionnaire and later resumes on it. cc: @qiarie
...c/test/java/com/google/android/fhir/datacapture/extensions/MoreQuestionnaireResponsesTest.kt
Outdated
Show resolved
Hide resolved
} | ||
|
||
@Test | ||
fun `test setLaunchTimestamp should not override previously added extension if any`() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we want this behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed here
...c/test/java/com/google/android/fhir/datacapture/extensions/MoreQuestionnaireResponsesTest.kt
Outdated
Show resolved
Hide resolved
…extensions/MoreQuestionnaireResponsesTest.kt Co-authored-by: Jing Tang <[email protected]>
7c1534d
to
8121c88
Compare
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #2372
Description
PR adds
QuestionnaireItemComponent
andQuestionnaireResponseItemComponent
for form launch and submission timestampsAlternative(s) considered
N/A
Type
Feature
Screenshots (if applicable)
Checklist
./gradlew spotlessApply
and./gradlew spotlessCheck
to check my code follows the style guide of this project../gradlew check
and./gradlew connectedCheck
to test my changes locally.cc: @f-odhiambo @qiarie