Skip to content

Commit

Permalink
Merge branch 'main' into issue-3479
Browse files Browse the repository at this point in the history
  • Loading branch information
hamza-vd authored Sep 26, 2024
2 parents d589963 + a5c2fec commit 24ae15e
Show file tree
Hide file tree
Showing 3 changed files with 9 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 @@ -50,6 +50,7 @@ import org.smartregister.fhircore.engine.domain.model.RepositoryResourceData
import org.smartregister.fhircore.engine.domain.model.RuleConfig
import org.smartregister.fhircore.engine.domain.model.ServiceMemberIcon
import org.smartregister.fhircore.engine.domain.model.ServiceStatus
import org.smartregister.fhircore.engine.rulesengine.services.DateService
import org.smartregister.fhircore.engine.rulesengine.services.LocationService
import org.smartregister.fhircore.engine.util.DispatcherProvider
import org.smartregister.fhircore.engine.util.SharedPreferenceKey
Expand Down Expand Up @@ -102,6 +103,7 @@ constructor(
put(DATA, mutableMapOf<String, Any>().apply { putAll(params) })
put(LOCATION_SERVICE, locationService)
put(SERVICE, rulesEngineService)
put(DATE_SERVICE, DateService)
}
if (repositoryResourceData != null) {
with(repositoryResourceData) {
Expand Down Expand Up @@ -710,6 +712,7 @@ constructor(
companion object {
private const val SERVICE = "service"
private const val LOCATION_SERVICE = "locationService"
private const val DATE_SERVICE = "dateService"
private const val INCLUSIVE_SIX_DIGIT_MINIMUM = 100000
private const val INCLUSIVE_SIX_DIGIT_MAXIMUM = 999999
private const val DEFAULT_REGEX = "(?<=^|,)[\\s,]*(\\w[\\w\\s]*)(?=[\\s,]*$|,)"
Expand Down
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 24ae15e

Please sign in to comment.