diff --git a/src/commonMain/kotlin/org/hisp/dhis/rules/api/RuleEngineContext.kt b/src/commonMain/kotlin/org/hisp/dhis/rules/api/RuleEngineContext.kt index e28895cd..eb2e973b 100644 --- a/src/commonMain/kotlin/org/hisp/dhis/rules/api/RuleEngineContext.kt +++ b/src/commonMain/kotlin/org/hisp/dhis/rules/api/RuleEngineContext.kt @@ -1,8 +1,6 @@ package org.hisp.dhis.rules.api import org.hisp.dhis.rules.models.Rule -import org.hisp.dhis.rules.models.RuleEnrollment -import org.hisp.dhis.rules.models.RuleEvent import org.hisp.dhis.rules.models.RuleVariable data class RuleEngineContext( diff --git a/src/commonMain/kotlin/org/hisp/dhis/rules/engine/RuleConditionEvaluator.kt b/src/commonMain/kotlin/org/hisp/dhis/rules/engine/RuleConditionEvaluator.kt index 4b6eaf4f..50577304 100644 --- a/src/commonMain/kotlin/org/hisp/dhis/rules/engine/RuleConditionEvaluator.kt +++ b/src/commonMain/kotlin/org/hisp/dhis/rules/engine/RuleConditionEvaluator.kt @@ -4,11 +4,10 @@ import org.hisp.dhis.lib.expression.Expression import org.hisp.dhis.lib.expression.spi.ExpressionData import org.hisp.dhis.lib.expression.spi.IllegalExpressionException import org.hisp.dhis.rules.createLogger -import org.hisp.dhis.rules.models.Rule -import org.hisp.dhis.rules.models.* import org.hisp.dhis.rules.engine.RuleEvaluationResult.Companion.errorRule import org.hisp.dhis.rules.engine.RuleEvaluationResult.Companion.evaluatedResult import org.hisp.dhis.rules.engine.RuleEvaluationResult.Companion.notEvaluatedResult +import org.hisp.dhis.rules.models.* import org.hisp.dhis.rules.utils.unwrapVariableName internal class RuleConditionEvaluator { diff --git a/src/commonMain/kotlin/org/hisp/dhis/rules/engine/RuleEngineMultipleExecution.kt b/src/commonMain/kotlin/org/hisp/dhis/rules/engine/RuleEngineMultipleExecution.kt index efcfbf03..11b83508 100644 --- a/src/commonMain/kotlin/org/hisp/dhis/rules/engine/RuleEngineMultipleExecution.kt +++ b/src/commonMain/kotlin/org/hisp/dhis/rules/engine/RuleEngineMultipleExecution.kt @@ -1,6 +1,5 @@ package org.hisp.dhis.rules.engine -import org.hisp.dhis.rules.models.Rule import org.hisp.dhis.rules.models.* internal class RuleEngineMultipleExecution { diff --git a/src/commonMain/kotlin/org/hisp/dhis/rules/engine/RuleVariableValueMapBuilder.kt b/src/commonMain/kotlin/org/hisp/dhis/rules/engine/RuleVariableValueMapBuilder.kt index 636d75da..3e9dddd5 100644 --- a/src/commonMain/kotlin/org/hisp/dhis/rules/engine/RuleVariableValueMapBuilder.kt +++ b/src/commonMain/kotlin/org/hisp/dhis/rules/engine/RuleVariableValueMapBuilder.kt @@ -6,8 +6,6 @@ import kotlinx.datetime.toLocalDateTime import org.hisp.dhis.rules.models.* import org.hisp.dhis.rules.utils.RuleEngineUtils import org.hisp.dhis.rules.utils.currentDate -import kotlin.collections.ArrayList -import kotlin.collections.HashMap internal class RuleVariableValueMapBuilder private constructor() { val allConstantValues: MutableMap = HashMap() diff --git a/src/commonMain/kotlin/org/hisp/dhis/rules/models/Option.kt b/src/commonMain/kotlin/org/hisp/dhis/rules/models/Option.kt index 51eae686..43b597a3 100644 --- a/src/commonMain/kotlin/org/hisp/dhis/rules/models/Option.kt +++ b/src/commonMain/kotlin/org/hisp/dhis/rules/models/Option.kt @@ -1,6 +1,8 @@ package org.hisp.dhis.rules.models -/** - * @author rajazubair - */ +import kotlin.js.ExperimentalJsExport +import kotlin.js.JsExport + +@JsExport +@OptIn(ExperimentalJsExport::class) data class Option(val name: String, val code: String) diff --git a/src/commonMain/kotlin/org/hisp/dhis/rules/models/RuleAttributeValue.kt b/src/commonMain/kotlin/org/hisp/dhis/rules/models/RuleAttributeValue.kt index 404b3542..353b14e1 100644 --- a/src/commonMain/kotlin/org/hisp/dhis/rules/models/RuleAttributeValue.kt +++ b/src/commonMain/kotlin/org/hisp/dhis/rules/models/RuleAttributeValue.kt @@ -1,5 +1,10 @@ package org.hisp.dhis.rules.models +import kotlin.js.ExperimentalJsExport +import kotlin.js.JsExport + +@JsExport +@OptIn(ExperimentalJsExport::class) data class RuleAttributeValue( val trackedEntityAttribute: String, val value: String diff --git a/src/commonMain/kotlin/org/hisp/dhis/rules/models/RuleValidationResult.kt b/src/commonMain/kotlin/org/hisp/dhis/rules/models/RuleValidationResult.kt index 33afd4c4..0cd218ae 100644 --- a/src/commonMain/kotlin/org/hisp/dhis/rules/models/RuleValidationResult.kt +++ b/src/commonMain/kotlin/org/hisp/dhis/rules/models/RuleValidationResult.kt @@ -1,5 +1,7 @@ package org.hisp.dhis.rules.models +import kotlin.js.ExperimentalJsExport +import kotlin.js.JsExport import kotlin.jvm.JvmOverloads /* @@ -30,6 +32,8 @@ import kotlin.jvm.JvmOverloads * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +@JsExport +@OptIn(ExperimentalJsExport::class) data class RuleValidationResult @JvmOverloads constructor( val valid: Boolean, val errorMessage: String? = null, diff --git a/src/commonMain/kotlin/org/hisp/dhis/rules/models/RuleVariable.kt b/src/commonMain/kotlin/org/hisp/dhis/rules/models/RuleVariable.kt index 9013a37c..aafd86a0 100644 --- a/src/commonMain/kotlin/org/hisp/dhis/rules/models/RuleVariable.kt +++ b/src/commonMain/kotlin/org/hisp/dhis/rules/models/RuleVariable.kt @@ -1,10 +1,13 @@ package org.hisp.dhis.rules.models import org.hisp.dhis.rules.engine.RuleVariableValue -import org.hisp.dhis.rules.engine.RuleVariableValueMapBuilder interface RuleVariable { + val name: String + val useCodeForOptionSet: Boolean val options: List