Skip to content

Commit

Permalink
Add summary mode (#3500)
Browse files Browse the repository at this point in the history
Co-authored-by: Elly Kitoto <[email protected]>
  • Loading branch information
FikriMilano and ellykits authored Sep 26, 2024
1 parent 7008e53 commit a5c2fec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ enum class QuestionnaireType {
DEFAULT,
EDIT,
READ_ONLY,
SUMMARY,
}

fun QuestionnaireConfig.isDefault() =
Expand All @@ -32,3 +33,6 @@ fun QuestionnaireConfig.isEditable() =

fun QuestionnaireConfig.isReadOnly() =
QuestionnaireType.valueOf(this.type) == QuestionnaireType.READ_ONLY

fun QuestionnaireConfig.isSummary() =
QuestionnaireType.valueOf(this.type) == QuestionnaireType.SUMMARY
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import org.smartregister.fhircore.engine.configuration.QuestionnaireConfig
import org.smartregister.fhircore.engine.configuration.app.LocationLogOptions
import org.smartregister.fhircore.engine.domain.model.ActionParameter
import org.smartregister.fhircore.engine.domain.model.isReadOnly
import org.smartregister.fhircore.engine.domain.model.isSummary
import org.smartregister.fhircore.engine.ui.base.AlertDialogue
import org.smartregister.fhircore.engine.ui.base.BaseMultiLanguageActivity
import org.smartregister.fhircore.engine.util.DispatcherProvider
Expand Down Expand Up @@ -282,6 +283,7 @@ class QuestionnaireActivity : BaseMultiLanguageActivity() {
)
.showAsterisk(this.questionnaireConfig.showRequiredTextAsterisk)
.showRequiredText(this.questionnaireConfig.showRequiredText)
.setIsReadOnly(questionnaireConfig.isSummary())
.apply {
if (questionnaireResponse != null) {
questionnaireResponse
Expand Down

0 comments on commit a5c2fec

Please sign in to comment.