Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dynamic configuration via a global file #238

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion efsity/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 2 additions & 0 deletions efsity/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down Expand Up @@ -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"]
Expand Down
2 changes: 2 additions & 0 deletions efsity/src/main/java/org/smartregister/util/FctUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ public static String getResourceId(String resourcePath) {
: resourcePath;
}

public static Translatables fetchTranslatables(String translatablesFile) {}

public static <T extends IBaseResource> T getFhirResource(Class<T> t, String contentAsString) {
IParser iParser = FhirContext.forCached(FhirVersionEnum.R4).newJsonParser();
return iParser.parseResource(t, contentAsString);
Expand Down
26 changes: 26 additions & 0 deletions efsity/src/main/java/org/smartregister/util/Translatables.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.smartregister.util;

import java.util.List;

public class Translatables {
private List<String> questionnaireTranslatables;
private List<String> configTranslatables;

// Getters and Setters

public List<String> getQuestionnaireTranslatables() {
return questionnaireTranslatables;
}

public void setQuestionnaireTranslatables(List<String> questionnaireTranslatables) {
this.questionnaireTranslatables = questionnaireTranslatables;
}

public List<String> getConfigTranslatables() {
return configTranslatables;
}

public void setConfigTranslatables(List<String> configTranslatables) {
this.configTranslatables = configTranslatables;
}
}
13 changes: 13 additions & 0 deletions efsity/src/test/resources/efsity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
questionnaireTranslatables:
- text
- display

configTranslatables:
- saveButtonText
- title
- display
- actionButtonText
- message
- primaryText
- secondaryText
Loading