diff --git a/efsity/build.gradle.kts b/efsity/build.gradle.kts index bb776e83..15ccdb36 100644 --- a/efsity/build.gradle.kts +++ b/efsity/build.gradle.kts @@ -82,7 +82,7 @@ dependencies { implementation(deps.jsonschemafriend) implementation(deps.picocli) implementation(deps.xstream) - + implementation(deps.snakeyaml) testImplementation(kotlin("test")) testImplementation("junit:junit:4.13.2") testImplementation("org.mockito:mockito-inline:3.12.4") diff --git a/efsity/libs.versions.toml b/efsity/libs.versions.toml index 10ed56ba..a6351a4c 100644 --- a/efsity/libs.versions.toml +++ b/efsity/libs.versions.toml @@ -16,6 +16,7 @@ opencds-cql-version="2.4.0" project-build-sourceEncoding="UTF-8" spotless-version ="6.20.0" xstream="1.4.20" +snakeyaml="2.2" [libraries] caffeine = { module = "com.github.ben-manes.caffeine:caffeine", version.ref = "caffeine-version" } @@ -44,6 +45,7 @@ jackson-core = { module = "com.fasterxml.jackson.core:jackson-core", version.ref jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson-version" } picocli = { module = "info.picocli:picocli", version.ref = "info-picocli-version" } xstream = { module = "com.thoughtworks.xstream:xstream", version.ref = "xstream" } +snakeyaml = {module = "org.yaml:snakeyaml", version.ref = "snakeyaml"} [bundles] cqf-cql = ["cql-to-elm","elm","elm-jackson","model","model-jackson"] diff --git a/efsity/src/main/java/org/smartregister/util/FctUtils.java b/efsity/src/main/java/org/smartregister/util/FctUtils.java index 02a6b601..4073f307 100644 --- a/efsity/src/main/java/org/smartregister/util/FctUtils.java +++ b/efsity/src/main/java/org/smartregister/util/FctUtils.java @@ -166,6 +166,8 @@ public static String getResourceId(String resourcePath) { : resourcePath; } + public static Translatables fetchTranslatables(String translatablesFile) {} + public static T getFhirResource(Class t, String contentAsString) { IParser iParser = FhirContext.forCached(FhirVersionEnum.R4).newJsonParser(); return iParser.parseResource(t, contentAsString); diff --git a/efsity/src/main/java/org/smartregister/util/Translatables.java b/efsity/src/main/java/org/smartregister/util/Translatables.java new file mode 100644 index 00000000..19194e02 --- /dev/null +++ b/efsity/src/main/java/org/smartregister/util/Translatables.java @@ -0,0 +1,26 @@ +package org.smartregister.util; + +import java.util.List; + +public class Translatables { + private List questionnaireTranslatables; + private List configTranslatables; + + // Getters and Setters + + public List getQuestionnaireTranslatables() { + return questionnaireTranslatables; + } + + public void setQuestionnaireTranslatables(List questionnaireTranslatables) { + this.questionnaireTranslatables = questionnaireTranslatables; + } + + public List getConfigTranslatables() { + return configTranslatables; + } + + public void setConfigTranslatables(List configTranslatables) { + this.configTranslatables = configTranslatables; + } +} diff --git a/efsity/src/test/resources/efsity.yaml b/efsity/src/test/resources/efsity.yaml new file mode 100644 index 00000000..292ed681 --- /dev/null +++ b/efsity/src/test/resources/efsity.yaml @@ -0,0 +1,13 @@ +--- +questionnaireTranslatables: + - text + - display + +configTranslatables: + - saveButtonText + - title + - display + - actionButtonText + - message + - primaryText + - secondaryText