Skip to content

Commit

Permalink
Merge branch 'master' into sp/cancel-job
Browse files Browse the repository at this point in the history
  • Loading branch information
santosh-pingle authored Jan 29, 2025
2 parents b0f42a6 + 36e2ccf commit 003fe0e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Releases.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023-2024 Google LLC
* Copyright 2023-2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -48,7 +48,7 @@ object Releases {

object Engine : LibraryArtifact {
override val artifactId = "engine"
override val version = "1.1.0"
override val version = "1.2.0"
override val name = "Android FHIR Engine Library"
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023-2024 Google LLC
* Copyright 2023-2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -298,12 +298,6 @@ internal class QuestionnaireViewModel(application: Application, state: SavedStat

private lateinit var currentPageItems: List<QuestionnaireAdapterItem>

/**
* True if the user has tapped the next/previous pagination buttons on the current page. This is
* needed to avoid spewing validation errors before any questions are answered.
*/
private var forceValidation = false

/**
* Map of [QuestionnaireResponseItemAnswerComponent] for
* [Questionnaire.QuestionnaireItemComponent]s that are disabled now. The answers will be used to
Expand Down Expand Up @@ -903,7 +897,6 @@ internal class QuestionnaireViewModel(application: Application, state: SavedStat
val validationResult =
if (
modifiedQuestionnaireResponseItemSet.contains(questionnaireResponseItem) ||
forceValidation ||
isInReviewModeFlow.value
) {
questionnaireResponseItemValidator.validate(
Expand Down Expand Up @@ -1124,13 +1117,14 @@ internal class QuestionnaireViewModel(application: Application, state: SavedStat
it.item.validationResult is NotValidated
}
) {
// Force update validation results for all questions on the current page. This is needed
// when the user has not answered any questions so no validation has been done.
forceValidation = true
// Add all items on the current page to modifiedQuestionnaireResponseItemSet.
// This will ensure that all fields are validated even when they're not filled by the user
currentPageItems.filterIsInstance<QuestionnaireAdapterItem.Question>().forEach {
modifiedQuestionnaireResponseItemSet.add(it.item.getQuestionnaireResponseItem())
}
// Results in a new questionnaire state being generated synchronously, i.e., the current
// thread will be suspended until the new state is generated.
modificationCount.update { it + 1 }
forceValidation = false
}

if (
Expand Down
2 changes: 1 addition & 1 deletion docs/use/api.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# API

* [Engine](api/engine/1.1.0/index.html)
* [Engine](api/engine/1.2.0/index.html)
* [Data Capture](api/data-capture/1.2.0/index.html)
* [Workflow](api/workflow/0.1.0-beta01/index.html)
* [Knowledge](api/knowledge/0.1.0-beta01/index.html)

0 comments on commit 003fe0e

Please sign in to comment.