diff --git a/app/src/main/java/org/dhis2/usescases/troubleshooting/TroubleshootingRepository.kt b/app/src/main/java/org/dhis2/usescases/troubleshooting/TroubleshootingRepository.kt index 001af922db..f0b44329d9 100644 --- a/app/src/main/java/org/dhis2/usescases/troubleshooting/TroubleshootingRepository.kt +++ b/app/src/main/java/org/dhis2/usescases/troubleshooting/TroubleshootingRepository.kt @@ -108,7 +108,6 @@ class TroubleshootingRepository( .blockingGet().toRuleVariableList( d2.trackedEntityModule().trackedEntityAttributes(), d2.dataElementModule().dataElements(), - d2.optionModule().options(), ).mapNotNull { val ruleValueType = it.fieldType val valueKey = when (it) { diff --git a/dhis2-mobile-program-rules/src/main/java/org/dhis2/mobileProgramRules/RuleEngineExtensions.kt b/dhis2-mobile-program-rules/src/main/java/org/dhis2/mobileProgramRules/RuleEngineExtensions.kt index fc208a1bb1..36b7444d32 100644 --- a/dhis2-mobile-program-rules/src/main/java/org/dhis2/mobileProgramRules/RuleEngineExtensions.kt +++ b/dhis2-mobile-program-rules/src/main/java/org/dhis2/mobileProgramRules/RuleEngineExtensions.kt @@ -61,7 +61,6 @@ fun List.toRuleActionList(): List { fun List.toRuleVariableList( attributeRepository: TrackedEntityAttributeCollectionRepository, dataElementRepository: DataElementCollectionRepository, - optionRepository: OptionCollectionRepository, ): List { return mapNotNull { val allowVariable = when { @@ -76,7 +75,7 @@ fun List.toRuleVariableList( else -> isCalculatedValue(it) } if (allowVariable) { - it.toRuleVariable(attributeRepository, dataElementRepository, optionRepository) + it.toRuleVariable(attributeRepository, dataElementRepository) } else { null } @@ -328,7 +327,6 @@ fun ProgramRuleAction.toRuleEngineObject(): RuleAction { fun ProgramRuleVariable.toRuleVariable( attributeRepository: TrackedEntityAttributeCollectionRepository, dataElementRepository: DataElementCollectionRepository, - optionRepository: OptionCollectionRepository, ): RuleVariable { val valueType = when (programRuleVariableSourceType()) { ProgramRuleVariableSourceType.DATAELEMENT_NEWEST_EVENT_PROGRAM_STAGE, diff --git a/dhis2-mobile-program-rules/src/main/java/org/dhis2/mobileProgramRules/RulesRepository.kt b/dhis2-mobile-program-rules/src/main/java/org/dhis2/mobileProgramRules/RulesRepository.kt index 65463724a2..5b9653123c 100644 --- a/dhis2-mobile-program-rules/src/main/java/org/dhis2/mobileProgramRules/RulesRepository.kt +++ b/dhis2-mobile-program-rules/src/main/java/org/dhis2/mobileProgramRules/RulesRepository.kt @@ -2,7 +2,6 @@ package org.dhis2.mobileProgramRules import android.os.Build import android.text.TextUtils.isEmpty -import io.reactivex.Single import kotlinx.datetime.Instant import kotlinx.datetime.TimeZone import kotlinx.datetime.toLocalDateTime @@ -69,23 +68,9 @@ class RulesRepository(private val d2: D2) { .toRuleVariableList( d2.trackedEntityModule().trackedEntityAttributes(), d2.dataElementModule().dataElements(), - d2.optionModule().options(), ) } - fun ruleVariablesProgramStages(programUid: String): Single> { - return d2.programModule().programRuleVariables().byProgramUid().eq(programUid).get() - .toFlowable().flatMapIterable { list -> list } - .map { - it.toRuleVariable( - d2.trackedEntityModule().trackedEntityAttributes(), - d2.dataElementModule().dataElements(), - d2.optionModule().options(), - ) - } - .toList() - } - suspend fun constants(): Map { return d2.constantModule().constants().blockingGet() .associate { constant -> diff --git a/stock-usecase/src/main/java/org/dhis2/android/rtsm/services/rules/RuleValidationHelperImpl.kt b/stock-usecase/src/main/java/org/dhis2/android/rtsm/services/rules/RuleValidationHelperImpl.kt index 436cc2495f..6b0f6c2b3b 100644 --- a/stock-usecase/src/main/java/org/dhis2/android/rtsm/services/rules/RuleValidationHelperImpl.kt +++ b/stock-usecase/src/main/java/org/dhis2/android/rtsm/services/rules/RuleValidationHelperImpl.kt @@ -151,7 +151,6 @@ class RuleValidationHelperImpl @Inject constructor( it.toRuleVariableList( d2.trackedEntityModule().trackedEntityAttributes(), d2.dataElementModule().dataElements(), - d2.optionModule().options(), ) } }