-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#382 - Change display and translations structure for criteria and con…
…cepts - remove nested declaration from elastic search documents (seems to be unnecessary, but should be monitored) - modify swagger file to match new responses - adapt tests to the new structure - Change responses to codeable concept and terminology replies to the new structure
- Loading branch information
1 parent
c29091a
commit 57631fd
Showing
33 changed files
with
1,749 additions
and
586 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
src/main/java/de/numcodex/feasibility_gui_backend/common/api/DisplayEntry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package de.numcodex.feasibility_gui_backend.common.api; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import de.numcodex.feasibility_gui_backend.dse.api.LocalizedValue; | ||
import de.numcodex.feasibility_gui_backend.terminology.es.model.Display; | ||
import lombok.Builder; | ||
|
||
import java.util.List; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
@Builder | ||
public record DisplayEntry( | ||
@JsonProperty String original, | ||
@JsonProperty List<LocalizedValue> translations | ||
) { | ||
|
||
public static DisplayEntry of(Display display) { | ||
return DisplayEntry.builder() | ||
.original(display.original()) | ||
.translations(List.of( | ||
LocalizedValue.builder() | ||
.language("de-DE") | ||
.value(display.deDe()) | ||
.build(), | ||
LocalizedValue.builder() | ||
.language("en-US") | ||
.value(display.enUs()) | ||
.build() | ||
)) | ||
.build(); | ||
} | ||
} |
15 changes: 0 additions & 15 deletions
15
src/main/java/de/numcodex/feasibility_gui_backend/dse/api/DisplayEntry.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/de/numcodex/feasibility_gui_backend/terminology/api/CodeableConceptEntry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package de.numcodex.feasibility_gui_backend.terminology.api; | ||
|
||
import de.numcodex.feasibility_gui_backend.common.api.TermCode; | ||
import de.numcodex.feasibility_gui_backend.common.api.DisplayEntry; | ||
import de.numcodex.feasibility_gui_backend.dse.api.LocalizedValue; | ||
import de.numcodex.feasibility_gui_backend.terminology.es.model.CodeableConceptDocument; | ||
import lombok.Builder; | ||
|
||
import java.util.List; | ||
|
||
@Builder | ||
public record CodeableConceptEntry( | ||
TermCode termCode, | ||
DisplayEntry display | ||
) { | ||
public static CodeableConceptEntry of(CodeableConceptDocument document) { | ||
return CodeableConceptEntry.builder() | ||
.termCode(document.termCode()) | ||
.display(DisplayEntry.builder() | ||
.original(document.display().original()) | ||
.translations(List.of( | ||
LocalizedValue.builder() | ||
.language("de-DE") | ||
.value(document.display().deDe()) | ||
.build(), | ||
LocalizedValue.builder() | ||
.language("en-US") | ||
.value(document.display().enUs()) | ||
.build() | ||
)) | ||
.build() | ||
) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/Display.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package de.numcodex.feasibility_gui_backend.terminology.es.model; | ||
|
||
import lombok.Builder; | ||
import org.springframework.data.elasticsearch.annotations.Field; | ||
|
||
@Builder | ||
public record Display( | ||
String original, | ||
@Field(name = "de-DE") | ||
String deDe, | ||
@Field(name = "en-US") | ||
String enUs | ||
) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/Translation.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.