diff --git a/src/main/java/de/numcodex/feasibility_gui_backend/common/api/DisplayEntry.java b/src/main/java/de/numcodex/feasibility_gui_backend/common/api/DisplayEntry.java new file mode 100644 index 00000000..6fdb68d7 --- /dev/null +++ b/src/main/java/de/numcodex/feasibility_gui_backend/common/api/DisplayEntry.java @@ -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 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(); + } +} diff --git a/src/main/java/de/numcodex/feasibility_gui_backend/dse/api/DisplayEntry.java b/src/main/java/de/numcodex/feasibility_gui_backend/dse/api/DisplayEntry.java deleted file mode 100644 index 2fae710f..00000000 --- a/src/main/java/de/numcodex/feasibility_gui_backend/dse/api/DisplayEntry.java +++ /dev/null @@ -1,15 +0,0 @@ -package de.numcodex.feasibility_gui_backend.dse.api; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.Builder; - -import java.util.List; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@Builder -public record DisplayEntry( - @JsonProperty String original, - @JsonProperty List translations - ) { -} diff --git a/src/main/java/de/numcodex/feasibility_gui_backend/dse/api/DseProfile.java b/src/main/java/de/numcodex/feasibility_gui_backend/dse/api/DseProfile.java index 0ff50e78..c593f6ac 100644 --- a/src/main/java/de/numcodex/feasibility_gui_backend/dse/api/DseProfile.java +++ b/src/main/java/de/numcodex/feasibility_gui_backend/dse/api/DseProfile.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import de.numcodex.feasibility_gui_backend.common.api.DisplayEntry; import lombok.Builder; import java.util.List; diff --git a/src/main/java/de/numcodex/feasibility_gui_backend/dse/api/DseProfileTreeNode.java b/src/main/java/de/numcodex/feasibility_gui_backend/dse/api/DseProfileTreeNode.java index 4e8f9192..565e1e54 100644 --- a/src/main/java/de/numcodex/feasibility_gui_backend/dse/api/DseProfileTreeNode.java +++ b/src/main/java/de/numcodex/feasibility_gui_backend/dse/api/DseProfileTreeNode.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import de.numcodex.feasibility_gui_backend.common.api.DisplayEntry; import lombok.Builder; import java.util.List; diff --git a/src/main/java/de/numcodex/feasibility_gui_backend/dse/api/Field.java b/src/main/java/de/numcodex/feasibility_gui_backend/dse/api/Field.java index a9312877..eff12544 100644 --- a/src/main/java/de/numcodex/feasibility_gui_backend/dse/api/Field.java +++ b/src/main/java/de/numcodex/feasibility_gui_backend/dse/api/Field.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import de.numcodex.feasibility_gui_backend.common.api.DisplayEntry; import lombok.Builder; import java.util.List; diff --git a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/api/CcSearchResult.java b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/api/CcSearchResult.java index 599c1905..52f9366d 100644 --- a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/api/CcSearchResult.java +++ b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/api/CcSearchResult.java @@ -10,5 +10,5 @@ @Builder public class CcSearchResult { private long totalHits; - private List results; + private List results; } diff --git a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/api/CodeableConceptEntry.java b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/api/CodeableConceptEntry.java new file mode 100644 index 00000000..936e6b2f --- /dev/null +++ b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/api/CodeableConceptEntry.java @@ -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(); + } +} diff --git a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/api/EsSearchResultEntry.java b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/api/EsSearchResultEntry.java index 36a828cb..46453ae1 100644 --- a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/api/EsSearchResultEntry.java +++ b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/api/EsSearchResultEntry.java @@ -1,12 +1,13 @@ package de.numcodex.feasibility_gui_backend.terminology.api; +import de.numcodex.feasibility_gui_backend.common.api.DisplayEntry; import de.numcodex.feasibility_gui_backend.terminology.es.model.OntologyListItemDocument; import lombok.Builder; @Builder public record EsSearchResultEntry( String id, - String name, + DisplayEntry display, int availability, String context, String terminology, @@ -17,7 +18,7 @@ public record EsSearchResultEntry( public static EsSearchResultEntry of(OntologyListItemDocument ontologyListItemDocument) { return EsSearchResultEntry.builder() .id(ontologyListItemDocument.id()) - .name(ontologyListItemDocument.name()) + .display(DisplayEntry.of(ontologyListItemDocument.display())) .availability(ontologyListItemDocument.availability()) .context(ontologyListItemDocument.context().code()) .terminology(ontologyListItemDocument.terminology()) diff --git a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/CodeableConceptService.java b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/CodeableConceptService.java index a4d97f63..9e0ceceb 100644 --- a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/CodeableConceptService.java +++ b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/CodeableConceptService.java @@ -2,8 +2,8 @@ import co.elastic.clients.elasticsearch._types.FieldValue; import co.elastic.clients.elasticsearch._types.query_dsl.*; -import de.numcodex.feasibility_gui_backend.common.api.TermCode; import de.numcodex.feasibility_gui_backend.terminology.api.CcSearchResult; +import de.numcodex.feasibility_gui_backend.terminology.api.CodeableConceptEntry; import de.numcodex.feasibility_gui_backend.terminology.es.model.CodeableConceptDocument; import de.numcodex.feasibility_gui_backend.terminology.es.repository.CodeableConceptEsRepository; import de.numcodex.feasibility_gui_backend.terminology.es.repository.OntologyItemNotFoundException; @@ -47,17 +47,18 @@ public CcSearchResult performCodeableConceptSearchWithRepoAndPaging(String keywo } var searchHitPage = findByCodeOrDisplay(keyword, filterList, PageRequest.of(page, pageSize)); - List codeableConceptEntries = new ArrayList<>(); + List codeableConceptEntries = new ArrayList<>(); - searchHitPage.getSearchHits().forEach(hit -> codeableConceptEntries.add(hit.getContent().termCode())); + searchHitPage.getSearchHits().forEach(hit -> codeableConceptEntries.add(CodeableConceptEntry.of(hit.getContent()))); return CcSearchResult.builder() .totalHits(searchHitPage.getTotalHits()) .results(codeableConceptEntries) .build(); } - public TermCode getSearchResultEntryByCode(String code) { - return repo.findById(code).orElseThrow(OntologyItemNotFoundException::new).termCode(); + public CodeableConceptEntry getSearchResultEntryByCode(String code) { + var document = repo.findById(code).orElseThrow(OntologyItemNotFoundException::new); + return CodeableConceptEntry.of(document); } private SearchHits findByCodeOrDisplay(String keyword, @@ -88,7 +89,7 @@ private SearchHits findByCodeOrDisplay(String keyword, } else { var mmQuery = new MultiMatchQuery.Builder() .query(keyword) - .fields(List.of("termcode.display", "termcode.code^2")) + .fields(List.of("display.de-DE", "display.en-US", "termcode.code^2")) .build(); boolQuery = new BoolQuery.Builder() diff --git a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/TerminologyEsService.java b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/TerminologyEsService.java index 6c54ee55..e7a1d061 100644 --- a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/TerminologyEsService.java +++ b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/TerminologyEsService.java @@ -150,7 +150,7 @@ private SearchHits findByNameOrTermcode(String keyword } else { var mmQuery = new MultiMatchQuery.Builder() .query(keyword) - .fields(List.of("name", "termcode^2")) + .fields(List.of("display.de-DE", "display.en-US", "termcode^2")) .build(); boolQuery = new BoolQuery.Builder() @@ -196,7 +196,7 @@ private SearchHits findByNameOrTermcode(String keyword public OntologyItemRelationsDocument getOntologyItemRelationsByHash(String hash) { var ontologyItem = ontologyItemEsRepository.findById(hash).orElseThrow(OntologyItemNotFoundException::new); return OntologyItemRelationsDocument.builder() - .translations(ontologyItem.translations()) + .display(ontologyItem.display()) .parents(ontologyItem.parents()) .children(ontologyItem.children()) .relatedTerms(ontologyItem.relatedTerms()) diff --git a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/CodeableConceptDocument.java b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/CodeableConceptDocument.java index b14fac62..5b01ff03 100644 --- a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/CodeableConceptDocument.java +++ b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/CodeableConceptDocument.java @@ -13,9 +13,11 @@ @Document(indexName = "codeable_concept") public record CodeableConceptDocument( @Id String id, - @Field(type = FieldType.Nested, includeInParent = true, name = "termcode") + @Field(name = "termcode") TermCode termCode, - @Field(type = FieldType.Nested, includeInParent = true, name = "value_sets") - List valueSets + @Field(name = "value_sets") + List valueSets, + @Field(name = "display") + Display display ) { } diff --git a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/Display.java b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/Display.java new file mode 100644 index 00000000..6e10a011 --- /dev/null +++ b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/Display.java @@ -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 +) { +} diff --git a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/OntologyItemDocument.java b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/OntologyItemDocument.java index 0633ee00..997df07b 100644 --- a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/OntologyItemDocument.java +++ b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/OntologyItemDocument.java @@ -13,20 +13,19 @@ @Document(indexName = "ontology") public record OntologyItemDocument( @Id String id, - String name, int availability, TermCode context, String terminology, String termcode, - @Field(name = "kds_module") String kdsModule, - - @Field(type = FieldType.Nested, includeInParent = true, name = "translations") - Collection translations, - @Field(type = FieldType.Nested, includeInParent = true, name = "parents") + @Field(name = "display") + Display display, + @Field(name = "kds_module") + String kdsModule, + @Field(name = "parents") Collection parents, - @Field(type = FieldType.Nested, includeInParent = true, name = "children") + @Field(name = "children") Collection children, - @Field(type = FieldType.Nested, includeInParent = true, name = "related_terms") + @Field(name = "related_terms") Collection relatedTerms ) { } diff --git a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/OntologyItemRelationsDocument.java b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/OntologyItemRelationsDocument.java index 0099eef3..7e0133aa 100644 --- a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/OntologyItemRelationsDocument.java +++ b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/OntologyItemRelationsDocument.java @@ -10,13 +10,13 @@ @Builder @Document(indexName = "ontology") public record OntologyItemRelationsDocument( - @Field(type = FieldType.Nested, includeInParent = true, name = "translations") - Collection translations, - @Field(type = FieldType.Nested, includeInParent = true, name = "parents") + @Field(name = "display") + Display display, + @Field(name = "parents") Collection parents, - @Field(type = FieldType.Nested, includeInParent = true, name = "children") + @Field(name = "children") Collection children, - @Field(type = FieldType.Nested, includeInParent = true, name = "related_terms") + @Field(name = "related_terms") Collection relatedTerms ) { } diff --git a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/OntologyListItemDocument.java b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/OntologyListItemDocument.java index 629f7173..661a4986 100644 --- a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/OntologyListItemDocument.java +++ b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/OntologyListItemDocument.java @@ -10,7 +10,7 @@ @Document(indexName = "ontology") public record OntologyListItemDocument( @Id String id, - String name, + Display display, int availability, TermCode context, String terminology, diff --git a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/Translation.java b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/Translation.java deleted file mode 100644 index 035221dc..00000000 --- a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/es/model/Translation.java +++ /dev/null @@ -1,10 +0,0 @@ -package de.numcodex.feasibility_gui_backend.terminology.es.model; - -import lombok.Builder; - -@Builder -public record Translation( - String lang, - String value -) { -} diff --git a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/v4/CodeableConceptRestController.java b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/v4/CodeableConceptRestController.java index 792e542b..461da20b 100644 --- a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/v4/CodeableConceptRestController.java +++ b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/v4/CodeableConceptRestController.java @@ -1,7 +1,7 @@ package de.numcodex.feasibility_gui_backend.terminology.v4; -import de.numcodex.feasibility_gui_backend.common.api.TermCode; import de.numcodex.feasibility_gui_backend.terminology.api.CcSearchResult; +import de.numcodex.feasibility_gui_backend.terminology.api.CodeableConceptEntry; import de.numcodex.feasibility_gui_backend.terminology.es.CodeableConceptService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; @@ -34,7 +34,7 @@ public CcSearchResult searchOntologyItemsCriteriaQuery(@RequestParam("searchterm } @GetMapping(value = "/entry/{code}", produces = MediaType.APPLICATION_JSON_VALUE) - public TermCode getCodeableConceptByCode(@PathVariable("code") String code) { + public CodeableConceptEntry getCodeableConceptByCode(@PathVariable("code") String code) { return codeableConceptService.getSearchResultEntryByCode(code); } } diff --git a/src/main/resources/static/v3/api-docs/swagger.yaml b/src/main/resources/static/v3/api-docs/swagger.yaml index 100322c5..d6b01690 100644 --- a/src/main/resources/static/v3/api-docs/swagger.yaml +++ b/src/main/resources/static/v3/api-docs/swagger.yaml @@ -889,7 +889,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/TermCode" + $ref: "#/components/schemas/CodeableConceptEntry" 401: description: Unauthorized - please login first 403: @@ -1363,10 +1363,8 @@ components: ElasticSearchResultEntry: type: object properties: - name: - type: string - examples: - - Diabetes Mellitus + display: + $ref: "#/components/schemas/DisplayEntry" contextualizedTermcodeHash: type: string format: uuid @@ -1435,6 +1433,37 @@ components: type: string examples: - icd10 + LocalizedValue: + type: object + properties: + language: + type: string + examples: + - de-DE + - en-US + value: + type: string + examples: + - localized entry + - lokalisierter Eintrag + DisplayEntry: + type: object + properties: + original: + type: string + examples: + - display entry + translations: + type: array + items: + $ref: "#/components/schemas/LocalizedValue" + CodeableConceptEntry: + type: object + properties: + termCode: + $ref: "#/components/schemas/TermCode" + display: + $ref: "#/components/schemas/DisplayEntry" CodeableConceptSearchResult: type: object properties: @@ -1445,7 +1474,7 @@ components: results: type: array items: - $ref: "#/components/schemas/TermCode" + $ref: "#/components/schemas/CodeableConceptEntry" CriteriaProfileData: type: object properties: diff --git a/src/test/java/de/numcodex/feasibility_gui_backend/dse/DseServiceTest.java b/src/test/java/de/numcodex/feasibility_gui_backend/dse/DseServiceTest.java index a23cf6b1..0bd4a08c 100644 --- a/src/test/java/de/numcodex/feasibility_gui_backend/dse/DseServiceTest.java +++ b/src/test/java/de/numcodex/feasibility_gui_backend/dse/DseServiceTest.java @@ -3,7 +3,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException; -import de.numcodex.feasibility_gui_backend.dse.api.DisplayEntry; +import de.numcodex.feasibility_gui_backend.common.api.DisplayEntry; import de.numcodex.feasibility_gui_backend.dse.api.DseProfileTreeNode; import de.numcodex.feasibility_gui_backend.dse.api.LocalizedValue; import de.numcodex.feasibility_gui_backend.dse.persistence.DseProfile; diff --git a/src/test/java/de/numcodex/feasibility_gui_backend/dse/v4/DseRestControllerIT.java b/src/test/java/de/numcodex/feasibility_gui_backend/dse/v4/DseRestControllerIT.java index f3932f74..78bb530b 100644 --- a/src/test/java/de/numcodex/feasibility_gui_backend/dse/v4/DseRestControllerIT.java +++ b/src/test/java/de/numcodex/feasibility_gui_backend/dse/v4/DseRestControllerIT.java @@ -2,7 +2,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import de.numcodex.feasibility_gui_backend.dse.DseService; -import de.numcodex.feasibility_gui_backend.dse.api.DisplayEntry; +import de.numcodex.feasibility_gui_backend.common.api.DisplayEntry; import de.numcodex.feasibility_gui_backend.dse.api.DseProfile; import de.numcodex.feasibility_gui_backend.dse.api.DseProfileTreeNode; import de.numcodex.feasibility_gui_backend.dse.api.LocalizedValue; diff --git a/src/test/java/de/numcodex/feasibility_gui_backend/terminology/es/CodeableConceptServiceIT.java b/src/test/java/de/numcodex/feasibility_gui_backend/terminology/es/CodeableConceptServiceIT.java index f09a2683..5a93ce15 100644 --- a/src/test/java/de/numcodex/feasibility_gui_backend/terminology/es/CodeableConceptServiceIT.java +++ b/src/test/java/de/numcodex/feasibility_gui_backend/terminology/es/CodeableConceptServiceIT.java @@ -85,7 +85,7 @@ void testPerformCodeableConceptSearchWithRepoAndPaging_findsOne() { assertNotNull(page); assertThat(page.getTotalHits()).isOne(); - Assertions.assertEquals("A1.0", page.getResults().get(0).code()); + Assertions.assertEquals("A1.0", page.getResults().get(0).termCode().code()); } @Test @@ -120,10 +120,10 @@ void testGetSearchResultEntryByCode_succeeds() { var result = assertDoesNotThrow(() -> codeableConceptService.getSearchResultEntryByCode("A1.1")); assertNotNull(result); - Assertions.assertEquals("bar", result.display()); - Assertions.assertEquals("A1.1", result.code()); - Assertions.assertEquals("2012", result.version()); - Assertions.assertEquals("another-system", result.system()); + Assertions.assertEquals("bar", result.termCode().display()); + Assertions.assertEquals("A1.1", result.termCode().code()); + Assertions.assertEquals("2012", result.termCode().version()); + Assertions.assertEquals("another-system", result.termCode().system()); } @Test diff --git a/src/test/java/de/numcodex/feasibility_gui_backend/terminology/es/CodeableConceptServiceTest.java b/src/test/java/de/numcodex/feasibility_gui_backend/terminology/es/CodeableConceptServiceTest.java index 0a8b6bc0..d90ea1ae 100644 --- a/src/test/java/de/numcodex/feasibility_gui_backend/terminology/es/CodeableConceptServiceTest.java +++ b/src/test/java/de/numcodex/feasibility_gui_backend/terminology/es/CodeableConceptServiceTest.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import de.numcodex.feasibility_gui_backend.common.api.TermCode; import de.numcodex.feasibility_gui_backend.terminology.es.model.CodeableConceptDocument; +import de.numcodex.feasibility_gui_backend.terminology.es.model.Display; import de.numcodex.feasibility_gui_backend.terminology.es.repository.CodeableConceptEsRepository; import de.numcodex.feasibility_gui_backend.terminology.es.repository.OntologyItemNotFoundException; import org.junit.jupiter.api.BeforeEach; @@ -56,7 +57,13 @@ void testPerformCodeableConceptSearchWithRepoAndPaging_succeedsWithoutValueSetFi assertNotNull(result); assertEquals(dummySearchHitsPage.getTotalHits(), result.getTotalHits()); - assertEquals(dummySearchHitsPage.getSearchHits().get(0).getContent().termCode(), result.getResults().get(0)); + assertEquals(dummySearchHitsPage.getSearchHits().get(0).getContent().termCode(), result.getResults().get(0).termCode()); + assertEquals(dummySearchHitsPage.getSearchHits().get(0).getContent().display().original(), result.getResults().get(0).display().original()); + assertThat(result.getResults().get(0).display().translations().containsAll( + List.of( + dummySearchHitsPage.getSearchHits().get(0).getContent().display().deDe(), + dummySearchHitsPage.getSearchHits().get(0).getContent().display().enUs())) + ); } @Test @@ -68,7 +75,13 @@ void testPerformCodeableConceptSearchWithRepoAndPaging_succeedsWithNullValueSetF assertNotNull(result); assertEquals(dummySearchHitsPage.getTotalHits(), result.getTotalHits()); - assertEquals(dummySearchHitsPage.getSearchHits().get(0).getContent().termCode(), result.getResults().get(0)); + assertEquals(dummySearchHitsPage.getSearchHits().get(0).getContent().termCode(), result.getResults().get(0).termCode()); + assertEquals(dummySearchHitsPage.getSearchHits().get(0).getContent().display().original(), result.getResults().get(0).display().original()); + assertThat(result.getResults().get(0).display().translations().containsAll( + List.of( + dummySearchHitsPage.getSearchHits().get(0).getContent().display().deDe(), + dummySearchHitsPage.getSearchHits().get(0).getContent().display().enUs())) + ); } @Test @@ -80,7 +93,13 @@ void testPerformCodeableConceptSearchWithRepoAndPaging_succeedsWithValueSetFilte assertNotNull(result); assertEquals(dummySearchHitsPage.getTotalHits(), result.getTotalHits()); - assertEquals(dummySearchHitsPage.getSearchHits().get(0).getContent().termCode(), result.getResults().get(0)); + assertEquals(dummySearchHitsPage.getSearchHits().get(0).getContent().termCode(), result.getResults().get(0).termCode()); + assertEquals(dummySearchHitsPage.getSearchHits().get(0).getContent().display().original(), result.getResults().get(0).display().original()); + assertThat(result.getResults().get(0).display().translations().containsAll( + List.of( + dummySearchHitsPage.getSearchHits().get(0).getContent().display().deDe(), + dummySearchHitsPage.getSearchHits().get(0).getContent().display().enUs())) + ); } @Test @@ -113,7 +132,14 @@ void testGetSearchResultEntryByCode_succeeds() { var result = assertDoesNotThrow(() -> codeableConceptService.getSearchResultEntryByCode("1")); assertNotNull(result); - assertEquals(dummyCodeableConceptDocument.termCode(), result); + assertEquals(dummyCodeableConceptDocument.termCode(), result.termCode()); + assertEquals(dummyCodeableConceptDocument.display().original(), result.display().original()); + assertThat(result.display().translations().containsAll( + List.of( + dummyCodeableConceptDocument.display().deDe(), + dummyCodeableConceptDocument.display().enUs() + ) + )); } @Test @@ -150,10 +176,19 @@ private CodeableConceptDocument createDummyCodeableConceptDocument(String id) { return CodeableConceptDocument.builder() .id(id) .termCode(createDummyTermcode()) + .display(createDummyDisplay()) .valueSets(List.of()) .build(); } + private Display createDummyDisplay() { + return Display.builder() + .original("code-1") + .deDe("Code 1") + .enUs("Code One") + .build(); + } + private TermCode createDummyTermcode() { return TermCode.builder() .code("code-1") diff --git a/src/test/java/de/numcodex/feasibility_gui_backend/terminology/es/TerminologyEsServiceTest.java b/src/test/java/de/numcodex/feasibility_gui_backend/terminology/es/TerminologyEsServiceTest.java index b71ed0ec..0046feba 100644 --- a/src/test/java/de/numcodex/feasibility_gui_backend/terminology/es/TerminologyEsServiceTest.java +++ b/src/test/java/de/numcodex/feasibility_gui_backend/terminology/es/TerminologyEsServiceTest.java @@ -77,7 +77,7 @@ void testGetSearchResultEntryByHash() { assertThat(searchResultEntry).isNotNull(); assertThat(searchResultEntry.id()).isEqualTo(id); assertThat(searchResultEntry.terminology()).isEqualTo(dummyOntologyListItem.terminology()); - assertThat(searchResultEntry.name()).isEqualTo(dummyOntologyListItem.name()); + assertThat(searchResultEntry.display().original()).isEqualTo(dummyOntologyListItem.display().original()); assertThat(searchResultEntry.kdsModule()).isEqualTo(dummyOntologyListItem.kdsModule()); assertThat(searchResultEntry.availability()).isEqualTo(dummyOntologyListItem.availability()); assertThat(searchResultEntry.context()).isEqualTo(dummyOntologyListItem.context().code()); @@ -185,7 +185,7 @@ void testGetOntologyItemRelationsByHash_succeeds() { assertThat(ontologyItemRelationsDocument.relatedTerms()).isEqualTo(dummyOntologyItem.relatedTerms()); assertThat(ontologyItemRelationsDocument.children()).isEqualTo(dummyOntologyItem.children()); assertThat(ontologyItemRelationsDocument.parents()).isEqualTo(dummyOntologyItem.parents()); - assertThat(ontologyItemRelationsDocument.translations()).isEqualTo(dummyOntologyItem.translations()); + assertThat(ontologyItemRelationsDocument.display()).isEqualTo(dummyOntologyItem.display()); } @Test @@ -200,7 +200,7 @@ private OntologyListItemDocument createDummyOntologyListItem(String id) { return OntologyListItemDocument.builder() .id(id) - .name("Some Name") + .display(createDummyDisplay()) .availability(1) .context(termCode) .terminology("Some Terminology") @@ -209,35 +209,34 @@ private OntologyListItemDocument createDummyOntologyListItem(String id) { .build(); } + private Display createDummyDisplay() { + return Display.builder() + .original("Some Name") + .deDe("Some German Name") + .enUs("Some English Name") + .build(); + } + private OntologyItemDocument createDummyOntologyItem(String id) { TermCode termCode = createDummyTermCode(); - Collection translations = List.of(createDummyTranslation(), createDummyTranslation(), createDummyTranslation()); Collection parents = List.of(createDummyRelative(), createDummyRelative()); Collection children = List.of(createDummyRelative(), createDummyRelative(), createDummyRelative(), createDummyRelative()); Collection relatedTerms = List.of(createDummyRelative(), createDummyRelative()); return OntologyItemDocument.builder() .id(id) - .name("Some Name") + .display(createDummyDisplay()) .availability(1) .context(termCode) .terminology("Some Terminology") .termcode("Some Termcode") .kdsModule("Some KDS Module") - .translations(translations) .parents(parents) .children(children) .relatedTerms(relatedTerms) .build(); } - private Translation createDummyTranslation() { - return Translation.builder() - .lang("de") - .value("Lorem Ipsum") - .build(); - } - private Relative createDummyRelative() { return Relative.builder() .contextualizedTermcodeHash(UUID.randomUUID().toString()) diff --git a/src/test/java/de/numcodex/feasibility_gui_backend/terminology/v4/CodeableConceptRestControllerIT.java b/src/test/java/de/numcodex/feasibility_gui_backend/terminology/v4/CodeableConceptRestControllerIT.java index 9811a359..06daa9f8 100644 --- a/src/test/java/de/numcodex/feasibility_gui_backend/terminology/v4/CodeableConceptRestControllerIT.java +++ b/src/test/java/de/numcodex/feasibility_gui_backend/terminology/v4/CodeableConceptRestControllerIT.java @@ -1,10 +1,13 @@ package de.numcodex.feasibility_gui_backend.terminology.v4; import com.fasterxml.jackson.databind.ObjectMapper; +import de.numcodex.feasibility_gui_backend.common.api.DisplayEntry; import de.numcodex.feasibility_gui_backend.common.api.TermCode; +import de.numcodex.feasibility_gui_backend.dse.api.LocalizedValue; import de.numcodex.feasibility_gui_backend.query.ratelimiting.RateLimitingInterceptor; import de.numcodex.feasibility_gui_backend.query.ratelimiting.RateLimitingServiceSpringConfig; import de.numcodex.feasibility_gui_backend.terminology.api.CcSearchResult; +import de.numcodex.feasibility_gui_backend.terminology.api.CodeableConceptEntry; import de.numcodex.feasibility_gui_backend.terminology.es.CodeableConceptService; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; @@ -63,31 +66,54 @@ void testSearchOntologyItemsCriteriaQuery_succeedsWith200() throws Exception { .andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON)) .andExpect(jsonPath("$.totalHits").value(dummyCcSearchResult.getTotalHits())) .andExpect(jsonPath("$.results.length()").value(dummyCcSearchResult.getResults().size())) - .andExpect(jsonPath("$.results[0].code").value(dummyCcSearchResult.getResults().get(0).code())) - .andExpect(jsonPath("$.results[0].system").value(dummyCcSearchResult.getResults().get(0).system())) - .andExpect(jsonPath("$.results[0].version").value(dummyCcSearchResult.getResults().get(0).version())) - .andExpect(jsonPath("$.results[0].display").value(dummyCcSearchResult.getResults().get(0).display())); + .andExpect(jsonPath("$.results[0].termCode.code").value(dummyCcSearchResult.getResults().get(0).termCode().code())) + .andExpect(jsonPath("$.results[0].termCode.system").value(dummyCcSearchResult.getResults().get(0).termCode().system())) + .andExpect(jsonPath("$.results[0].termCode.version").value(dummyCcSearchResult.getResults().get(0).termCode().version())) + .andExpect(jsonPath("$.results[0].termCode.display").value(dummyCcSearchResult.getResults().get(0).termCode().display())); } @Test @WithMockUser(roles = "DATAPORTAL_TEST_USER") void testGetCodeableConceptByCode_succeedsWith200() throws Exception { - TermCode dummyTermcode = createDummyTermcode(); - doReturn(dummyTermcode).when(codeableConceptService).getSearchResultEntryByCode(any(String.class)); + CodeableConceptEntry dummyCodeableConceptEntry = createDummyCodeableConceptEntry(); + doReturn(dummyCodeableConceptEntry).when(codeableConceptService).getSearchResultEntryByCode(any(String.class)); mockMvc.perform(get(URI.create(PATH_API + PATH_CODEABLE_CONCEPT + "/entry/1")).with(csrf())) .andExpect(status().isOk()) .andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON)) - .andExpect(jsonPath("$.code").value(dummyTermcode.code())) - .andExpect(jsonPath("$.system").value(dummyTermcode.system())) - .andExpect(jsonPath("$.version").value(dummyTermcode.version())) - .andExpect(jsonPath("$.display").value(dummyTermcode.display())); + .andExpect(jsonPath("$.termCode.code").value(dummyCodeableConceptEntry.termCode().code())) + .andExpect(jsonPath("$.termCode.system").value(dummyCodeableConceptEntry.termCode().system())) + .andExpect(jsonPath("$.termCode.version").value(dummyCodeableConceptEntry.termCode().version())) + .andExpect(jsonPath("$.termCode.display").value(dummyCodeableConceptEntry.termCode().display())); } private CcSearchResult createDummyCcSearchResult() { return CcSearchResult.builder() .totalHits(1) - .results(List.of(createDummyTermcode())) + .results(List.of(createDummyCodeableConceptEntry())) + .build(); + } + + private CodeableConceptEntry createDummyCodeableConceptEntry() { + return CodeableConceptEntry.builder() + .termCode(createDummyTermcode()) + .display(createDummyDisplayEntry()) + .build(); + } + + private DisplayEntry createDummyDisplayEntry() { + return DisplayEntry.builder() + .original("Code 1") + .translations(List.of( + LocalizedValue.builder() + .value("code 1") + .language("de-DE") + .build(), + LocalizedValue.builder() + .value("code 1") + .language("en-US") + .build() + )) .build(); } diff --git a/src/test/java/de/numcodex/feasibility_gui_backend/terminology/v4/TerminologyRestControllerIT.java b/src/test/java/de/numcodex/feasibility_gui_backend/terminology/v4/TerminologyRestControllerIT.java index 8717c808..9d60026e 100644 --- a/src/test/java/de/numcodex/feasibility_gui_backend/terminology/v4/TerminologyRestControllerIT.java +++ b/src/test/java/de/numcodex/feasibility_gui_backend/terminology/v4/TerminologyRestControllerIT.java @@ -2,7 +2,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; import de.numcodex.feasibility_gui_backend.common.api.Comparator; +import de.numcodex.feasibility_gui_backend.common.api.DisplayEntry; import de.numcodex.feasibility_gui_backend.common.api.TermCode; +import de.numcodex.feasibility_gui_backend.dse.api.LocalizedValue; import de.numcodex.feasibility_gui_backend.query.ratelimiting.RateLimitingInterceptor; import de.numcodex.feasibility_gui_backend.query.ratelimiting.RateLimitingServiceSpringConfig; import de.numcodex.feasibility_gui_backend.terminology.TerminologyService; @@ -132,7 +134,7 @@ public void testSearchOntologyItemsCriteriaQuery_succeeds() throws Exception { .andExpect(status().isOk()) .andExpect(jsonPath("$.totalHits").value(dummyEsSearchResult.totalHits())) .andExpect(jsonPath("$.results[0].id").value(dummyEsSearchResult.results().get(0).id())) - .andExpect(jsonPath("$.results[0].name").value(dummyEsSearchResult.results().get(0).name())) + .andExpect(jsonPath("$.results[0].display.original").value(dummyEsSearchResult.results().get(0).display().original())) .andExpect(jsonPath("$.results[0].terminology").value(dummyEsSearchResult.results().get(0).terminology())) .andExpect(jsonPath("$.results[0].selectable").value(dummyEsSearchResult.results().get(0).selectable())) .andExpect(jsonPath("$.results[0].kdsModule").value(dummyEsSearchResult.results().get(0).kdsModule())) @@ -157,8 +159,6 @@ public void testGetOntologyItemRelationsByHash_succeeds() throws Exception { mockMvc.perform(get(URI.create(PATH_API + PATH_TERMINOLOGY + "/entry/abc/relations")).with(csrf())) .andExpect(status().isOk()) - .andExpect(jsonPath("$.translations[0].lang").value(dummyOntologyItemRelations.translations().stream().toList().get(0).lang())) - .andExpect(jsonPath("$.translations[0].value").value(dummyOntologyItemRelations.translations().stream().toList().get(0).value())) .andExpect(jsonPath("$.children[0].contextualizedTermcodeHash").value(dummyOntologyItemRelations.children().stream().toList().get(0).contextualizedTermcodeHash())) .andExpect(jsonPath("$.children[0].name").value(dummyOntologyItemRelations.children().stream().toList().get(0).name())) .andExpect(jsonPath("$.parents[0].contextualizedTermcodeHash").value(dummyOntologyItemRelations.parents().stream().toList().get(0).contextualizedTermcodeHash())) @@ -185,7 +185,7 @@ public void testGetOntologyItemByHash_succeeds() throws Exception { mockMvc.perform(get(URI.create(PATH_API + PATH_TERMINOLOGY + "/entry/abc")).with(csrf())) .andExpect(status().isOk()) .andExpect(jsonPath("$.id").value(dummySearchResultEntry.id())) - .andExpect(jsonPath("$.name").value(dummySearchResultEntry.name())) + .andExpect(jsonPath("$.display.original").value(dummySearchResultEntry.display().original())) .andExpect(jsonPath("$.availability").value(dummySearchResultEntry.availability())) .andExpect(jsonPath("$.context").value(dummySearchResultEntry.context())) .andExpect(jsonPath("$.terminology").value(dummySearchResultEntry.terminology())) @@ -266,27 +266,33 @@ private EsSearchResultEntry createDummyEsSearchResultEntry() { .context("some-context") .id("abc-123") .kdsModule("some-module") - .name("some-name") + .display(createDummyDisplayEntry()) .selectable(true) .build(); } + private DisplayEntry createDummyDisplayEntry() { + return DisplayEntry.builder() + .original("some-name") + .translations(List.of(createDummyLocalizedValue())) + .build(); + } + + private LocalizedValue createDummyLocalizedValue() { + return LocalizedValue.builder() + .language("de-DE") + .value("some-name") + .build(); + } + private OntologyItemRelationsDocument createDummyOntologyItemRelations() { return OntologyItemRelationsDocument.builder() .relatedTerms(List.of(createDummyRelative())) - .translations(List.of(createDummyTranslation())) .parents(List.of(createDummyRelative())) .children(List.of(createDummyRelative())) .build(); } - private Translation createDummyTranslation() { - return Translation.builder() - .lang("de") - .value("Lorem Ipsum") - .build(); - } - private Relative createDummyRelative() { return Relative.builder() .contextualizedTermcodeHash(UUID.randomUUID().toString()) diff --git a/src/test/resources/de/numcodex/feasibility_gui_backend/terminology/es/cc_testdata.json b/src/test/resources/de/numcodex/feasibility_gui_backend/terminology/es/cc_testdata.json index 6d048900..7298e012 100644 --- a/src/test/resources/de/numcodex/feasibility_gui_backend/terminology/es/cc_testdata.json +++ b/src/test/resources/de/numcodex/feasibility_gui_backend/terminology/es/cc_testdata.json @@ -1,6 +1,6 @@ {"index": {"_index": "codeable_concept", "_id": "A1.0"}} -{"termcode": {"code": "A1.0", "display": "foo", "system": "some-system", "version": 2010}, "value_sets": []} +{"termcode": {"code": "A1.0", "display": "foo", "system": "some-system", "version": 2010}, "display": {"original": "some-system", "en-US": "some-system", "de-DE": "some-system"}, "value_sets": []} {"index": {"_index": "codeable_concept", "_id": "A1.1"}} -{"termcode": {"code": "A1.1", "display": "bar", "system": "another-system", "version": 2012}, "value_sets": ["some-value-set"]} +{"termcode": {"code": "A1.1", "display": "bar", "system": "another-system", "version": 2012}, "display": {"original": "another-system", "en-US": "another-system", "de-DE": "another-system"} ,"value_sets": ["some-value-set"]} {"index": {"_index": "codeable_concept", "_id": "A2.0"}} -{"termcode": {"code": "A2.0", "display": "baz", "system": "some-system", "version": 2023}, "value_sets": []} +{"termcode": {"code": "A2.0", "display": "baz", "system": "some-system", "version": 2023}, "display": {"original": "some-system", "en-US": "some-system", "de-DE": "some-system"},"value_sets": []} diff --git a/src/test/resources/de/numcodex/feasibility_gui_backend/terminology/es/codeable_concept.json b/src/test/resources/de/numcodex/feasibility_gui_backend/terminology/es/codeable_concept.json index 2a9ac497..e043c532 100644 --- a/src/test/resources/de/numcodex/feasibility_gui_backend/terminology/es/codeable_concept.json +++ b/src/test/resources/de/numcodex/feasibility_gui_backend/terminology/es/codeable_concept.json @@ -10,6 +10,24 @@ "letter", "digit" ] + }, + "edge_ngram_tokenizer_include_punctuation": { + "type": "edge_ngram", + "min_gram": 1, + "max_gram": 20, + "token_chars": [ + "letter", + "digit", + "punctuation", + "custom" + ], + "custom_token_chars": [ + "+-_" + ] + }, + "whitespace_tokenizer": { + "type": "simple_pattern_split", + "pattern": " " } }, "analyzer": { @@ -20,9 +38,16 @@ "lowercase" ] }, + "edge_ngram_analyzer_include_punctuation": { + "type": "custom", + "tokenizer": "edge_ngram_tokenizer_include_punctuation", + "filter": [ + "lowercase" + ] + }, "lowercase_analyzer": { "type": "custom", - "tokenizer": "standard", + "tokenizer": "whitespace_tokenizer", "filter": [ "lowercase" ] @@ -36,7 +61,7 @@ "properties": { "code": { "type": "text", - "analyzer": "edge_ngram_analyzer", + "analyzer": "edge_ngram_analyzer_include_punctuation", "search_analyzer": "lowercase_analyzer" }, "display": { @@ -56,6 +81,24 @@ }, "value_sets": { "type": "keyword" + }, + "display": { + "properties": { + "original": { + "type": "text", + "index": false + }, + "de-DE": { + "type": "text", + "analyzer": "edge_ngram_analyzer_include_punctuation", + "search_analyzer": "lowercase_analyzer" + }, + "en-US": { + "type": "text", + "analyzer": "edge_ngram_analyzer_include_punctuation", + "search_analyzer": "lowercase_analyzer" + } + } } } } diff --git a/src/test/resources/de/numcodex/feasibility_gui_backend/terminology/es/ontology.json b/src/test/resources/de/numcodex/feasibility_gui_backend/terminology/es/ontology.json index dc6392a3..d93a532f 100644 --- a/src/test/resources/de/numcodex/feasibility_gui_backend/terminology/es/ontology.json +++ b/src/test/resources/de/numcodex/feasibility_gui_backend/terminology/es/ontology.json @@ -10,6 +10,24 @@ "letter", "digit" ] + }, + "edge_ngram_tokenizer_include_punctuation": { + "type": "edge_ngram", + "min_gram": 1, + "max_gram": 20, + "token_chars": [ + "letter", + "digit", + "punctuation", + "custom" + ], + "custom_token_chars": [ + "+-_" + ] + }, + "whitespace_tokenizer": { + "type": "simple_pattern_split", + "pattern": " " } }, "analyzer": { @@ -20,9 +38,16 @@ "lowercase" ] }, + "edge_ngram_analyzer_include_punctuation": { + "type": "custom", + "tokenizer": "edge_ngram_tokenizer_include_punctuation", + "filter": [ + "lowercase" + ] + }, "lowercase_analyzer": { "type": "custom", - "tokenizer": "standard", + "tokenizer": "whitespace_tokenizer", "filter": [ "lowercase" ] @@ -70,10 +95,23 @@ "kds_module": { "type": "keyword" }, - "name": { - "type": "text", - "analyzer": "edge_ngram_analyzer", - "search_analyzer": "lowercase_analyzer" + "display": { + "properties": { + "original": { + "type": "text", + "index": false + }, + "de-DE": { + "type": "text", + "analyzer": "edge_ngram_analyzer_include_punctuation", + "search_analyzer": "lowercase_analyzer" + }, + "en-US": { + "type": "text", + "analyzer": "edge_ngram_analyzer_include_punctuation", + "search_analyzer": "lowercase_analyzer" + } + } }, "parents": { "properties": { @@ -104,7 +142,7 @@ }, "termcode": { "type": "text", - "analyzer": "edge_ngram_analyzer", + "analyzer": "edge_ngram_analyzer_include_punctuation", "search_analyzer": "lowercase_analyzer" }, "termcodes": { @@ -129,18 +167,6 @@ }, "terminology": { "type": "keyword" - }, - "translations": { - "properties": { - "lang": { - "type": "text", - "index": false - }, - "value": { - "type": "text", - "index": false - } - } } } } diff --git a/src/test/resources/de/numcodex/feasibility_gui_backend/terminology/es/ontology_testdata.json b/src/test/resources/de/numcodex/feasibility_gui_backend/terminology/es/ontology_testdata.json index 47cde683..5f0a9827 100644 --- a/src/test/resources/de/numcodex/feasibility_gui_backend/terminology/es/ontology_testdata.json +++ b/src/test/resources/de/numcodex/feasibility_gui_backend/terminology/es/ontology_testdata.json @@ -1,8 +1,8 @@ {"index": {"_index": "ontology", "_id": "ff34833f-4c39-30fc-87fb-34300a5507a1"}} -{"name": "Freie Hauttransplantation und Lappenplastik an Haut und Unterhaut bei Verbrennungen und Ver\u00e4tzungen, Empf\u00e4ngerstelle: Permanenter Hautersatz durch allogenes Hauttransplantat, gro\u00dffl\u00e4chig: Bauchregion", "availability": 5013, "terminology": "http://fhir.de/CodeSystem/bfarm/ops", "termcode": "5-925.gb", "selectable": true, "context": {"code": "Procedure", "display": "Prozedur", "system": "fdpg.mii.cds", "version": "1.0.0"}, "termcodes": [{"code": "5-925.gb", "display": "Freie Hauttransplantation und Lappenplastik an Haut und Unterhaut bei Verbrennungen und Ver\u00e4tzungen, Empf\u00e4ngerstelle: Permanenter Hautersatz durch allogenes Hauttransplantat, gro\u00dffl\u00e4chig: Bauchregion", "system": "http://fhir.de/CodeSystem/bfarm/ops", "version": "2024"}], "translations": [], "parents": [{"name": "Freie Hauttransplantation und Lappenplastik an Haut und Unterhaut bei Verbrennungen und Ver\u00e4tzungen, Empf\u00e4ngerstelle: Permanenter Hautersatz durch allogenes Hauttransplantat, gro\u00dffl\u00e4chig", "contextualized_termcode_hash": "a131cd96-5a43-3fb0-9385-92c92aa91e8a"}], "children": [], "criteria_sets": [], "related_terms": []} +{"display": {"original": "Freie Hauttransplantation und Lappenplastik an Haut und Unterhaut bei Verbrennungen und Verätzungen, Empfängerstelle: Permanenter Hautersatz durch allogenes Hauttransplantat, großflächig: Bauchregion", "en-US": "Freie Hauttransplantation und Lappenplastik an Haut und Unterhaut bei Verbrennungen und Verätzungen, Empfängerstelle: Permanenter Hautersatz durch allogenes Hauttransplantat, großflächig: Bauchregion", "de-DE": "Freie Hauttransplantation und Lappenplastik an Haut und Unterhaut bei Verbrennungen und Verätzungen, Empfängerstelle: Permanenter Hautersatz durch allogenes Hauttransplantat, großflächig: Bauchregion"}, "availability": 5013, "terminology": "http://fhir.de/CodeSystem/bfarm/ops", "termcode": "5-925.gb", "selectable": true, "context": {"code": "Procedure", "display": "Prozedur", "system": "fdpg.mii.cds", "version": "1.0.0"}, "termcodes": [{"code": "5-925.gb", "display": "Freie Hauttransplantation und Lappenplastik an Haut und Unterhaut bei Verbrennungen und Ver\u00e4tzungen, Empf\u00e4ngerstelle: Permanenter Hautersatz durch allogenes Hauttransplantat, gro\u00dffl\u00e4chig: Bauchregion", "system": "http://fhir.de/CodeSystem/bfarm/ops", "version": "2024"}], "parents": [{"name": "Freie Hauttransplantation und Lappenplastik an Haut und Unterhaut bei Verbrennungen und Ver\u00e4tzungen, Empf\u00e4ngerstelle: Permanenter Hautersatz durch allogenes Hauttransplantat, gro\u00dffl\u00e4chig", "contextualized_termcode_hash": "a131cd96-5a43-3fb0-9385-92c92aa91e8a"}], "children": [], "criteria_sets": [], "related_terms": []} {"index": {"_index": "ontology", "_id": "3ceb21b3-5bd8-30b4-bb18-b222fb7fc748"}} -{"name": "Abnormer Blutdruckwert ohne Diagnose", "availability": 6398, "terminology": "http://fhir.de/CodeSystem/bfarm/icd-10-gm", "termcode": "R03", "selectable": true, "context": {"code": "Diagnose", "display": "Diagnose", "system": "fdpg.mii.cds", "version": "1.0.0"}, "termcodes": [{"code": "R03", "display": "Abnormer Blutdruckwert ohne Diagnose", "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm", "version": "2024"}], "translations": [], "parents": [{"name": "Symptome, die das Kreislaufsystem und das Atmungssystem betreffen", "contextualized_termcode_hash": "d93ef2d0-31a4-3eaf-b16e-f945fd600307"}], "children": [{"name": "Erh\u00f6hter Blutdruckwert ohne Diagnose eines Bluthochdrucks", "contextualized_termcode_hash": "e2fcb288-0d08-3272-8f32-64b8f1cfe095"}, {"name": "Unspezifischer niedriger Blutdruckwert", "contextualized_termcode_hash": "e48709d5-56dd-36e0-9da5-813aa9cbdaea"}], "criteria_sets": [], "related_terms": []} +{"display": {"original": "Abnormer Blutdruckwert ohne Diagnose", "en-US": "Abnormer Blutdruckwert ohne Diagnose", "de-DE": "Abnormer Blutdruckwert ohne Diagnose"}, "availability": 6398, "terminology": "http://fhir.de/CodeSystem/bfarm/icd-10-gm", "termcode": "R03", "selectable": true, "context": {"code": "Diagnose", "display": "Diagnose", "system": "fdpg.mii.cds", "version": "1.0.0"}, "termcodes": [{"code": "R03", "display": "Abnormer Blutdruckwert ohne Diagnose", "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm", "version": "2024"}], "parents": [{"name": "Symptome, die das Kreislaufsystem und das Atmungssystem betreffen", "contextualized_termcode_hash": "d93ef2d0-31a4-3eaf-b16e-f945fd600307"}], "children": [{"name": "Erh\u00f6hter Blutdruckwert ohne Diagnose eines Bluthochdrucks", "contextualized_termcode_hash": "e2fcb288-0d08-3272-8f32-64b8f1cfe095"}, {"name": "Unspezifischer niedriger Blutdruckwert", "contextualized_termcode_hash": "e48709d5-56dd-36e0-9da5-813aa9cbdaea"}], "criteria_sets": [], "related_terms": []} {"index": {"_index": "ontology", "_id": "e2fcb288-0d08-3272-8f32-64b8f1cfe095"}} -{"name": "Erh\u00f6hter Blutdruckwert ohne Diagnose eines Bluthochdrucks", "availability": 1523, "terminology": "http://fhir.de/CodeSystem/bfarm/icd-10-gm", "termcode": "R03.0", "selectable": true, "context": {"code": "Diagnose", "display": "Diagnose", "system": "fdpg.mii.cds", "version": "1.0.0"}, "termcodes": [{"code": "R03.0", "display": "Erh\u00f6hter Blutdruckwert ohne Diagnose eines Bluthochdrucks", "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm", "version": "2024"}], "translations": [], "parents": [{"name": "Abnormer Blutdruckwert ohne Diagnose", "contextualized_termcode_hash": "3ceb21b3-5bd8-30b4-bb18-b222fb7fc748"}], "children": [], "criteria_sets": [], "related_terms": []} +{"display": {"original": "Erhöhter Blutdruckwert ohne Diagnose eines Bluthochdrucks", "en-US": "Erhöhter Blutdruckwert ohne Diagnose eines Bluthochdrucks", "de-DE": "Erhöhter Blutdruckwert ohne Diagnose eines Bluthochdrucks"}, "availability": 1523, "terminology": "http://fhir.de/CodeSystem/bfarm/icd-10-gm", "termcode": "R03.0", "selectable": true, "context": {"code": "Diagnose", "display": "Diagnose", "system": "fdpg.mii.cds", "version": "1.0.0"}, "termcodes": [{"code": "R03.0", "display": "Erh\u00f6hter Blutdruckwert ohne Diagnose eines Bluthochdrucks", "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm", "version": "2024"}], "parents": [{"name": "Abnormer Blutdruckwert ohne Diagnose", "contextualized_termcode_hash": "3ceb21b3-5bd8-30b4-bb18-b222fb7fc748"}], "children": [], "criteria_sets": [], "related_terms": []} {"index": {"_index": "ontology", "_id": "e48709d5-56dd-36e0-9da5-813aa9cbdaea"}} -{"name": "Unspezifischer niedriger Blutdruckwert", "availability": 7922, "terminology": "http://fhir.de/CodeSystem/bfarm/icd-10-gm", "termcode": "R03.1", "selectable": true, "context": {"code": "Diagnose", "display": "Diagnose", "system": "fdpg.mii.cds", "version": "1.0.0"}, "termcodes": [{"code": "R03.1", "display": "Unspezifischer niedriger Blutdruckwert", "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm", "version": "2024"}], "translations": [], "parents": [{"name": "Abnormer Blutdruckwert ohne Diagnose", "contextualized_termcode_hash": "3ceb21b3-5bd8-30b4-bb18-b222fb7fc748"}], "children": [], "criteria_sets": ["http://i.just.made.that.up/for/demo/purposes"], "related_terms": []} +{"display": {"original": "Unspezifischer niedriger Blutdruckwert", "en-US": "Unspezifischer niedriger Blutdruckwert", "de-DE": "Unspezifischer niedriger Blutdruckwert"}, "availability": 7922, "terminology": "http://fhir.de/CodeSystem/bfarm/icd-10-gm", "termcode": "R03.1", "selectable": true, "context": {"code": "Diagnose", "display": "Diagnose", "system": "fdpg.mii.cds", "version": "1.0.0"}, "termcodes": [{"code": "R03.1", "display": "Unspezifischer niedriger Blutdruckwert", "system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm", "version": "2024"}], "parents": [{"name": "Abnormer Blutdruckwert ohne Diagnose", "contextualized_termcode_hash": "3ceb21b3-5bd8-30b4-bb18-b222fb7fc748"}], "children": [], "criteria_sets": ["http://i.just.made.that.up/for/demo/purposes"], "related_terms": []} diff --git a/src/test/resources/ontology/ui_profiles/Category1.json b/src/test/resources/ontology/ui_profiles/Category1.json index 468c1850..7a701c35 100644 --- a/src/test/resources/ontology/ui_profiles/Category1.json +++ b/src/test/resources/ontology/ui_profiles/Category1.json @@ -1,350 +1,962 @@ { - "children": [ + "children": [ + { + "context": { + "code": "Category1", + "display": { + "original": "Category1", + "translations": [ + { + "language": "de-DE", + "value": "Category1" + }, + { + "language": "en-US", + "value": "Category1" + } + ] + }, + "system": "fdpg.mii.cds", + "version": "1.0.0" + }, + "display": { + "original": "Termcode 1_1", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_1" + }, + { + "language": "en-US", + "value": "Termcode 1_1" + } + ] + }, + "id": "0ea8b1d4-43c5-d664-bc37-18b58a0f623c", + "leaf": true, + "selectable": true, + "termCodes": [ { - "context": { - "code": "Category1", - "display": "Category1", - "system": "fdpg.mii.cds", - "version": "1.0.0" + "code": "tc1_1", + "display": { + "original": "Termcode 1_1", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_1" + }, + { + "language": "en-US", + "value": "Termcode 1_1" + } + ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" + } + ] + }, + { + "context": { + "code": "Category1", + "display": { + "original": "Category1", + "translations": [ + { + "language": "de-DE", + "value": "Category1" }, - "display": "Termcode 1_1", - "id": "0ea8b1d4-43c5-d664-bc37-18b58a0f623c", - "leaf": true, - "selectable": true, - "termCodes": [ + { + "language": "en-US", + "value": "Category1" + } + ] + }, + "system": "fdpg.mii.cds", + "version": "1.0.0" + }, + "display": { + "original": "Termcode 1_2", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_2" + }, + { + "language": "en-US", + "value": "Termcode 1_2" + } + ] + }, + "id": "72ceaea9-c1ff-2e94-5fc0-7ba34feca654", + "leaf": true, + "selectable": true, + "termCodes": [ + { + "code": "tc1_2", + "display": { + "original": "Termcode 1_2", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_2" + }, + { + "language": "en-US", + "value": "Termcode 1_2" + } + ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" + } + ] + }, + { + "children": [ + { + "context": { + "code": "Category1", + "display": { + "original": "Category1", + "translations": [ { - "code": "tc1_1", - "display": "Termcode 1_1", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" + "language": "de-DE", + "value": "Category1" + }, + { + "language": "en-US", + "value": "Category1" } + ] + }, + "system": "fdpg.mii.cds", + "version": "1.0.0" + }, + "display": { + "original": "Termcode 1_4", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_4" + }, + { + "language": "en-US", + "value": "Termcode 1_4" + } ] + }, + "id": "43f9c541-1c2d-ee82-949d-f86c3b4def28", + "leaf": true, + "selectable": true, + "termCodes": [ + { + "code": "tc1_4", + "display": { + "original": "Termcode 1_4", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_4" + }, + { + "language": "en-US", + "value": "Termcode 1_4" + } + ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" + } + ] }, { - "context": { + "children": [ + { + "children": [ + { + "context": { + "code": "Category1", + "display": { + "original": "Category1", + "translations": [ + { + "language": "de-DE", + "value": "Category1" + }, + { + "language": "en-US", + "value": "Category1" + } + ] + }, + "system": "fdpg.mii.cds", + "version": "1.0.0" + }, + "display": { + "original": "Termcode 1_5", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_5" + }, + { + "language": "en-US", + "value": "Termcode 1_5" + } + ] + }, + "id": "48d1e121-51ff-88e1-de5a-3d790b39467b", + "leaf": true, + "selectable": true, + "termCodes": [ + { + "code": "tc1_5", + "display": { + "original": "Termcode 1_5", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_5" + }, + { + "language": "en-US", + "value": "Termcode 1_5" + } + ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" + } + ] + } + ], + "context": { "code": "Category1", - "display": "Category1", + "display": { + "original": "Category1", + "translations": [ + { + "language": "de-DE", + "value": "Category1" + }, + { + "language": "en-US", + "value": "Category1" + } + ] + }, "system": "fdpg.mii.cds", "version": "1.0.0" + }, + "display": { + "original": "Termcode 1_6", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_6" + }, + { + "language": "en-US", + "value": "Termcode 1_6" + } + ] + }, + "id": "cab226e5-7ede-27cb-244b-ac3be506dc42", + "leaf": false, + "selectable": true, + "termCodes": [ + { + "code": "tc1_6", + "display": { + "original": "Termcode 1_6", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_6" + }, + { + "language": "en-US", + "value": "Termcode 1_6" + } + ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" + } + ] + } + ], + "context": { + "code": "Category1", + "display": { + "original": "Category1", + "translations": [ + { + "language": "de-DE", + "value": "Category1" + }, + { + "language": "en-US", + "value": "Category1" + } + ] }, - "display": "Termcode 1_2", - "id": "72ceaea9-c1ff-2e94-5fc0-7ba34feca654", - "leaf": true, - "selectable": true, - "termCodes": [ + "system": "fdpg.mii.cds", + "version": "1.0.0" + }, + "display": { + "original": "Termcode 1_7", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_7" + }, + { + "language": "en-US", + "value": "Termcode 1_7" + } + ] + }, + "id": "5aa094b5-2ca9-9540-fce1-7af90ec59d3d", + "leaf": false, + "selectable": true, + "termCodes": [ + { + "code": "tc1_7", + "display": { + "original": "Termcode 1_7", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_7" + }, + { + "language": "en-US", + "value": "Termcode 1_7" + } + ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" + } + ] + }, + { + "context": { + "code": "Category1", + "display": { + "original": "Category1", + "translations": [ { - "code": "tc1_2", - "display": "Termcode 1_2", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" + "language": "de-DE", + "value": "Category1" + }, + { + "language": "en-US", + "value": "Category1" } + ] + }, + "system": "fdpg.mii.cds", + "version": "1.0.0" + }, + "display": { + "original": "Termcode 1_8", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_8" + }, + { + "language": "en-US", + "value": "Termcode 1_8" + } ] + }, + "id": "e1351592-5c58-ad45-e555-deef4f3ed831", + "leaf": true, + "selectable": true, + "termCodes": [ + { + "code": "tc1_8", + "display": { + "original": "Termcode 1_8", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_8" + }, + { + "language": "en-US", + "value": "Termcode 1_8" + } + ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" + } + ] }, { - "children": [ + "context": { + "code": "Category1", + "display": { + "original": "Category1", + "translations": [ { - "context": { - "code": "Category1", - "display": "Category1", - "system": "fdpg.mii.cds", - "version": "1.0.0" - }, - "display": "Termcode 1_4", - "id": "43f9c541-1c2d-ee82-949d-f86c3b4def28", - "leaf": true, - "selectable": true, - "termCodes": [ - { - "code": "tc1_4", - "display": "Termcode 1_4", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" - } - ] + "language": "de-DE", + "value": "Category1" }, { - "children": [ - { - "children": [ - { - "context": { - "code": "Category1", - "display": "Category1", - "system": "fdpg.mii.cds", - "version": "1.0.0" - }, - "display": "Termcode 1_5", - "id": "48d1e121-51ff-88e1-de5a-3d790b39467b", - "leaf": true, - "selectable": true, - "termCodes": [ - { - "code": "tc1_5", - "display": "Termcode 1_5", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" - } - ] - } - ], - "context": { - "code": "Category1", - "display": "Category1", - "system": "fdpg.mii.cds", - "version": "1.0.0" - }, - "display": "Termcode 1_6", - "id": "cab226e5-7ede-27cb-244b-ac3be506dc42", - "leaf": false, - "selectable": true, - "termCodes": [ - { - "code": "tc1_6", - "display": "Termcode 1_6", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" - } - ] - } - ], - "context": { - "code": "Category1", - "display": "Category1", - "system": "fdpg.mii.cds", - "version": "1.0.0" + "language": "en-US", + "value": "Category1" + } + ] + }, + "system": "fdpg.mii.cds", + "version": "1.0.0" + }, + "display": { + "original": "Termcode 1_9", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_9" + }, + { + "language": "en-US", + "value": "Termcode 1_9" + } + ] + }, + "id": "23563999-1f91-7440-5652-b85ed5cb45ac", + "leaf": true, + "selectable": true, + "termCodes": [ + { + "code": "tc1_9", + "display": { + "original": "Termcode 1_9", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_9" + }, + { + "language": "en-US", + "value": "Termcode 1_9" + } + ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" + } + ] + }, + { + "children": [ + { + "context": { + "code": "Category1", + "display": { + "original": "Category1", + "translations": [ + { + "language": "de-DE", + "value": "Category1" }, - "display": "Termcode 1_7", - "id": "5aa094b5-2ca9-9540-fce1-7af90ec59d3d", - "leaf": false, - "selectable": true, - "termCodes": [ - { - "code": "tc1_7", - "display": "Termcode 1_7", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" - } - ] + { + "language": "en-US", + "value": "Category1" + } + ] }, + "system": "fdpg.mii.cds", + "version": "1.0.0" + }, + "display": { + "original": "Termcode 1_10", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_10" + }, + { + "language": "en-US", + "value": "Termcode 1_10" + } + ] + }, + "id": "d4ecb8e1-ddfe-d18f-d78f-25ffea1964cc", + "leaf": true, + "selectable": true, + "termCodes": [ { - "context": { - "code": "Category1", - "display": "Category1", - "system": "fdpg.mii.cds", - "version": "1.0.0" - }, - "display": "Termcode 1_8", - "id": "e1351592-5c58-ad45-e555-deef4f3ed831", - "leaf": true, - "selectable": true, - "termCodes": [ - { - "code": "tc1_8", - "display": "Termcode 1_8", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" - } + "code": "tc1_10", + "display": { + "original": "Termcode 1_10", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_10" + }, + { + "language": "en-US", + "value": "Termcode 1_10" + } ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" + } + ] + }, + { + "context": { + "code": "Category1", + "display": { + "original": "Category1", + "translations": [ + { + "language": "de-DE", + "value": "Category1" + }, + { + "language": "en-US", + "value": "Category1" + } + ] }, + "system": "fdpg.mii.cds", + "version": "1.0.0" + }, + "display": { + "original": "Termcode 1_11", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_11" + }, + { + "language": "en-US", + "value": "Termcode 1_11" + } + ] + }, + "id": "767c6deb-5cd5-b122-e1d8-e35bfe8a8fcd", + "leaf": true, + "selectable": true, + "termCodes": [ { - "context": { - "code": "Category1", - "display": "Category1", - "system": "fdpg.mii.cds", - "version": "1.0.0" - }, - "display": "Termcode 1_9", - "id": "23563999-1f91-7440-5652-b85ed5cb45ac", - "leaf": true, - "selectable": true, - "termCodes": [ - { - "code": "tc1_9", - "display": "Termcode 1_9", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" - } + "code": "tc1_11", + "display": { + "original": "Termcode 1_11", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_11" + }, + { + "language": "en-US", + "value": "Termcode 1_11" + } ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" + } + ] + }, + { + "context": { + "code": "Category1", + "display": { + "original": "Category1", + "translations": [ + { + "language": "de-DE", + "value": "Category1" + }, + { + "language": "en-US", + "value": "Category1" + } + ] }, + "system": "fdpg.mii.cds", + "version": "1.0.0" + }, + "display": { + "original": "Termcode 1_12", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_12" + }, + { + "language": "en-US", + "value": "Termcode 1_12" + } + ] + }, + "id": "cb8f96b1-0431-7a2d-354f-31e4de671f3d", + "leaf": true, + "selectable": true, + "termCodes": [ { - "children": [ - { - "context": { - "code": "Category1", - "display": "Category1", - "system": "fdpg.mii.cds", - "version": "1.0.0" - }, - "display": "Termcode 1_10", - "id": "d4ecb8e1-ddfe-d18f-d78f-25ffea1964cc", - "leaf": true, - "selectable": true, - "termCodes": [ - { - "code": "tc1_10", - "display": "Termcode 1_10", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" - } - ] - }, - { - "context": { - "code": "Category1", - "display": "Category1", - "system": "fdpg.mii.cds", - "version": "1.0.0" - }, - "display": "Termcode 1_11", - "id": "767c6deb-5cd5-b122-e1d8-e35bfe8a8fcd", - "leaf": true, - "selectable": true, - "termCodes": [ - { - "code": "tc1_11", - "display": "Termcode 1_11", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" - } - ] - }, - { - "context": { - "code": "Category1", - "display": "Category1", - "system": "fdpg.mii.cds", - "version": "1.0.0" - }, - "display": "Termcode 1_12", - "id": "cb8f96b1-0431-7a2d-354f-31e4de671f3d", - "leaf": true, - "selectable": true, - "termCodes": [ - { - "code": "tc1_12", - "display": "Termcode 1_12", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" - } - ] - } - ], - "context": { - "code": "Category1", - "display": "Category1", - "system": "fdpg.mii.cds", - "version": "1.0.0" - }, - "display": "Termcode 1_13", - "id": "ed262069-1c6f-85da-8364-649cbd169ba8", - "leaf": false, - "selectable": true, - "termCodes": [ - { - "code": "tc1_13", - "display": "Termcode 1_13", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" - } + "code": "tc1_12", + "display": { + "original": "Termcode 1_12", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_12" + }, + { + "language": "en-US", + "value": "Termcode 1_12" + } ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" + } + ] + } + ], + "context": { + "code": "Category1", + "display": { + "original": "Category1", + "translations": [ + { + "language": "de-DE", + "value": "Category1" }, { - "context": { - "code": "Category1", - "display": "Category1", - "system": "fdpg.mii.cds", - "version": "1.0.0" - }, - "display": "Termcode 1_14", - "id": "0226899f-51de-3253-aa58-73254a64c84c", - "leaf": true, - "selectable": true, - "termCodes": [ - { - "code": "tc1_14", - "display": "Termcode 1_14", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" - } - ] + "language": "en-US", + "value": "Category1" + } + ] + }, + "system": "fdpg.mii.cds", + "version": "1.0.0" + }, + "display": { + "original": "Termcode 1_13", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_13" + }, + { + "language": "en-US", + "value": "Termcode 1_13" + } + ] + }, + "id": "ed262069-1c6f-85da-8364-649cbd169ba8", + "leaf": false, + "selectable": true, + "termCodes": [ + { + "code": "tc1_13", + "display": { + "original": "Termcode 1_13", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_13" + }, + { + "language": "en-US", + "value": "Termcode 1_13" + } + ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" + } + ] + }, + { + "context": { + "code": "Category1", + "display": { + "original": "Category1", + "translations": [ + { + "language": "de-DE", + "value": "Category1" }, { - "children": [ - { - "context": { - "code": "Category1", - "display": "Category1", - "system": "fdpg.mii.cds", - "version": "1.0.0" - }, - "display": "Termcode 1_15", - "id": "48d1e121-51ff-88e1-de5a-3d790b39467b", - "leaf": true, - "selectable": true, - "termCodes": [ - { - "code": "tc1_15", - "display": "Termcode 1_15", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" - } - ] - } - ], - "context": { - "code": "Category1", - "display": "Category1", - "system": "fdpg.mii.cds", - "version": "1.0.0" - }, - "display": "Termcode 1_16", - "id": "d7fd3ba5-f9ba-4655-bf0c-8db8f0a68101", - "leaf": false, - "selectable": true, - "termCodes": [ - { - "code": "tc1_16", - "display": "Termcode 1_16", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" - } - ] + "language": "en-US", + "value": "Category1" } - ], - "context": { + ] + }, + "system": "fdpg.mii.cds", + "version": "1.0.0" + }, + "display": { + "original": "Termcode 1_14", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_14" + }, + { + "language": "en-US", + "value": "Termcode 1_14" + } + ] + }, + "id": "0226899f-51de-3253-aa58-73254a64c84c", + "leaf": true, + "selectable": true, + "termCodes": [ + { + "code": "tc1_14", + "display": { + "original": "Termcode 1_14", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_14" + }, + { + "language": "en-US", + "value": "Termcode 1_14" + } + ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" + } + ] + }, + { + "children": [ + { + "context": { "code": "Category1", - "display": "Category1", + "display": { + "original": "Category1", + "translations": [ + { + "language": "de-DE", + "value": "Category1" + }, + { + "language": "en-US", + "value": "Category1" + } + ] + }, "system": "fdpg.mii.cds", "version": "1.0.0" - }, - "display": "Termcode 1_3", - "id": "5018e5bd-c3ce-3443-c79b-017d98f7fd4d", - "leaf": false, - "selectable": true, - "termCodes": [ + }, + "display": { + "original": "Termcode 1_15", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_15" + }, + { + "language": "en-US", + "value": "Termcode 1_15" + } + ] + }, + "id": "48d1e121-51ff-88e1-de5a-3d790b39467b", + "leaf": true, + "selectable": true, + "termCodes": [ { - "code": "tc1_3", - "display": "Termcode 1_3", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" + "code": "tc1_15", + "display": { + "original": "Termcode 1_15", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_15" + }, + { + "language": "en-US", + "value": "Termcode 1_15" + } + ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" } + ] + } + ], + "context": { + "code": "Category1", + "display": { + "original": "Category1", + "translations": [ + { + "language": "de-DE", + "value": "Category1" + }, + { + "language": "en-US", + "value": "Category1" + } + ] + }, + "system": "fdpg.mii.cds", + "version": "1.0.0" + }, + "display": { + "original": "Termcode 1_16", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_16" + }, + { + "language": "en-US", + "value": "Termcode 1_16" + } ] + }, + "id": "d7fd3ba5-f9ba-4655-bf0c-8db8f0a68101", + "leaf": false, + "selectable": true, + "termCodes": [ + { + "code": "tc1_16", + "display": { + "original": "Termcode 1_16", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_16" + }, + { + "language": "en-US", + "value": "Termcode 1_16" + } + ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" + } + ] } - ], - "context": { + ], + "context": { "code": "Category1", - "display": "Category1", - "system": "fdpg.mii.cds" - }, - "display": "Category1", - "id": "2ec77ac6-2547-2aff-031b-337d9ff80cff", - "leaf": false, - "selectable": false, - "termCodes": [ + "display": { + "original": "Category1", + "translations": [ + { + "language": "de-DE", + "value": "Category1" + }, + { + "language": "en-US", + "value": "Category1" + } + ] + }, + "system": "fdpg.mii.cds", + "version": "1.0.0" + }, + "display": { + "original": "Termcode 1_3", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_3" + }, + { + "language": "en-US", + "value": "Termcode 1_3" + } + ] + }, + "id": "5018e5bd-c3ce-3443-c79b-017d98f7fd4d", + "leaf": false, + "selectable": true, + "termCodes": [ { - "code": "Category1", - "display": "Category1", - "system": "fdpg.mii.cds" + "code": "tc1_3", + "display": { + "original": "Termcode 1_3", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 1_3" + }, + { + "language": "en-US", + "value": "Termcode 1_3" + } + ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" + } + ] + } + ], + "context": { + "code": "Category1", + "display": { + "original": "Category1", + "translations": [ + { + "language": "de-DE", + "value": "Category1" + }, + { + "language": "en-US", + "value": "Category1" } + ] + }, + "system": "fdpg.mii.cds" + }, + "display": { + "original": "Category1", + "translations": [ + { + "language": "de-DE", + "value": "Category1" + }, + { + "language": "en-US", + "value": "Category1" + } ] + }, + "id": "2ec77ac6-2547-2aff-031b-337d9ff80cff", + "leaf": false, + "selectable": false, + "termCodes": [ + { + "code": "Category1", + "display": { + "original": "Category1", + "translations": [ + { + "language": "de-DE", + "value": "Category1" + }, + { + "language": "en-US", + "value": "Category1" + } + ] + }, + "system": "fdpg.mii.cds" + } + ] } diff --git a/src/test/resources/ontology/ui_profiles/Category2.json b/src/test/resources/ontology/ui_profiles/Category2.json index 4ec2bd3b..88b7739e 100644 --- a/src/test/resources/ontology/ui_profiles/Category2.json +++ b/src/test/resources/ontology/ui_profiles/Category2.json @@ -1,60 +1,168 @@ { - "children": [ - { - "context": { - "code": "Category2", - "display": "Category2", - "system": "fdpg.mii.cds", - "version": "1.0.0" + "children": [ + { + "context": { + "code": "Category2", + "display": { + "original": "Category2", + "translations": [ + { + "language": "de-DE", + "value": "Category2" }, - "display": "Termcode 2_1", - "id": "33ca0320-81e5-406f-bdfd-c649e443ddd6", - "leaf": true, - "selectable": true, - "termCodes": [ - { - "code": "tc2_1", - "display": "Termcode 2_1", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" - } - ] + { + "language": "en-US", + "value": "Category2" + } + ] }, + "system": "fdpg.mii.cds", + "version": "1.0.0" + }, + "display": { + "original": "Termcode 2_1", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 2_1" + }, + { + "language": "en-US", + "value": "Termcode 2_1" + } + ] + }, + "id": "33ca0320-81e5-406f-bdfd-c649e443ddd6", + "leaf": true, + "selectable": true, + "termCodes": [ { - "context": { - "code": "Category2", - "display": "Category2", - "system": "fdpg.mii.cds", - "version": "1.0.0" - }, - "display": "Termcode 2_2", - "id": "0da2a746-d23f-4668-9160-51d83edbd02c", - "leaf": true, - "selectable": true, - "termCodes": [ - { - "code": "tc2_2", - "display": "Termcode 2_2", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" - } + "code": "tc2_1", + "display": { + "original": "Termcode 2_1", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 2_1" + }, + { + "language": "en-US", + "value": "Termcode 2_1" + } ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" } - ], - "context": { - "code": "Category2", - "display": "Category2", - "system": "fdpg.mii.cds" + ] }, - "display": "Category2", - "id": "457b3f3b-bf4e-45da-b676-dc63d31942dd", - "leaf": false, - "selectable": false, - "termCodes": [ + { + "context": { + "code": "Category2", + "display": { + "original": "Category2", + "translations": [ + { + "language": "de-DE", + "value": "Category2" + }, + { + "language": "en-US", + "value": "Category2" + } + ] + }, + "system": "fdpg.mii.cds", + "version": "1.0.0" + }, + "display": { + "original": "Termcode 2_2", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 2_2" + }, + { + "language": "en-US", + "value": "Termcode 2_2" + } + ] + }, + "id": "0da2a746-d23f-4668-9160-51d83edbd02c", + "leaf": true, + "selectable": true, + "termCodes": [ { - "code": "Category2", - "display": "Category2", - "system": "fdpg.mii.cds" + "code": "tc2_2", + "display": { + "original": "Termcode 2_2", + "translations": [ + { + "language": "de-DE", + "value": "Termcode 2_2" + }, + { + "language": "en-US", + "value": "Termcode 2_2" + } + ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" } + ] + } + ], + "context": { + "code": "Category2", + "display": { + "original": "Category2", + "translations": [ + { + "language": "de-DE", + "value": "Category2" + }, + { + "language": "en-US", + "value": "Category2" + } + ] + }, + "system": "fdpg.mii.cds" + }, + "display": { + "original": "Category2", + "translations": [ + { + "language": "de-DE", + "value": "Category2" + }, + { + "language": "en-US", + "value": "Category2" + } ] + }, + "id": "457b3f3b-bf4e-45da-b676-dc63d31942dd", + "leaf": false, + "selectable": false, + "termCodes": [ + { + "code": "Category2", + "display": { + "original": "Category2", + "translations": [ + { + "language": "de-DE", + "value": "Category2" + }, + { + "language": "en-US", + "value": "Category2" + } + ] + }, + "system": "fdpg.mii.cds" + } + ] } diff --git a/src/test/resources/ontology/ui_profiles/CategoryA.json b/src/test/resources/ontology/ui_profiles/CategoryA.json index 6936a049..8caf10a8 100644 --- a/src/test/resources/ontology/ui_profiles/CategoryA.json +++ b/src/test/resources/ontology/ui_profiles/CategoryA.json @@ -1,60 +1,168 @@ { - "children": [ - { - "context": { - "code": "CategoryA", - "display": "CategoryA", - "system": "fdpg.mii.cds", - "version": "1.0.0" + "children": [ + { + "context": { + "code": "CategoryA", + "display": { + "original": "CategoryA", + "translations": [ + { + "language": "de-DE", + "value": "CategoryA" }, - "display": "Termcode A_1", - "id": "33ca0320-81e5-406f-bdfd-c649e443ddd6", - "leaf": true, - "selectable": true, - "termCodes": [ - { - "code": "tcA_1", - "display": "Termcode A_1", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" - } - ] + { + "language": "en-US", + "value": "CategoryA" + } + ] }, + "system": "fdpg.mii.cds", + "version": "1.0.0" + }, + "display": { + "original": "Termcode A_1", + "translations": [ + { + "language": "de-DE", + "value": "Termcode A_1" + }, + { + "language": "en-US", + "value": "Termcode A_1" + } + ] + }, + "id": "33ca0320-81e5-406f-bdfd-c649e443ddd6", + "leaf": true, + "selectable": true, + "termCodes": [ { - "context": { - "code": "CategoryA", - "display": "CategoryA", - "system": "fdpg.mii.cds", - "version": "1.0.0" - }, - "display": "Termcode A_2", - "id": "0da2a746-d23f-4668-9160-51d83edbd02c", - "leaf": true, - "selectable": true, - "termCodes": [ - { - "code": "tcA_2", - "display": "Termcode A_2", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" - } + "code": "tcA_1", + "display": { + "original": "Termcode A_1", + "translations": [ + { + "language": "de-DE", + "value": "Termcode A_1" + }, + { + "language": "en-US", + "value": "Termcode A_1" + } ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" } - ], - "context": { - "code": "CategoryA", - "display": "CategoryA", - "system": "fdpg.mii.cds" + ] }, - "display": "CategoryA", - "id": "30a20f30-77db-11ee-b962-0242ac120002", - "leaf": false, - "selectable": false, - "termCodes": [ + { + "context": { + "code": "CategoryA", + "display": { + "original": "CategoryA", + "translations": [ + { + "language": "de-DE", + "value": "CategoryA" + }, + { + "language": "en-US", + "value": "CategoryA" + } + ] + }, + "system": "fdpg.mii.cds", + "version": "1.0.0" + }, + "display": { + "original": "Termcode A_2", + "translations": [ + { + "language": "de-DE", + "value": "Termcode A_2" + }, + { + "language": "en-US", + "value": "Termcode A_2" + } + ] + }, + "id": "0da2a746-d23f-4668-9160-51d83edbd02c", + "leaf": true, + "selectable": true, + "termCodes": [ { - "code": "CategoryA", - "display": "CategoryA", - "system": "fdpg.mii.cds" + "code": "tcA_2", + "display": { + "original": "Termcode A_2", + "translations": [ + { + "language": "de-DE", + "value": "Termcode A_2" + }, + { + "language": "en-US", + "value": "Termcode A_2" + } + ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" } + ] + } + ], + "context": { + "code": "CategoryA", + "display": { + "original": "CategoryA", + "translations": [ + { + "language": "de-DE", + "value": "CategoryA" + }, + { + "language": "en-US", + "value": "CategoryA" + } + ] + }, + "system": "fdpg.mii.cds" + }, + "display": { + "original": "CategoryA", + "translations": [ + { + "language": "de-DE", + "value": "CategoryA" + }, + { + "language": "en-US", + "value": "CategoryA" + } ] + }, + "id": "30a20f30-77db-11ee-b962-0242ac120002", + "leaf": false, + "selectable": false, + "termCodes": [ + { + "code": "CategoryA", + "display": { + "original": "CategoryA", + "translations": [ + { + "language": "de-DE", + "value": "CategoryA" + }, + { + "language": "en-US", + "value": "CategoryA" + } + ] + }, + "system": "fdpg.mii.cds" + } + ] } diff --git a/src/test/resources/ontology/ui_profiles/CategoryB.json b/src/test/resources/ontology/ui_profiles/CategoryB.json index 394b8ee0..675c3568 100644 --- a/src/test/resources/ontology/ui_profiles/CategoryB.json +++ b/src/test/resources/ontology/ui_profiles/CategoryB.json @@ -1,60 +1,168 @@ { - "children": [ - { - "context": { - "code": "CategoryB", - "display": "CategoryB", - "system": "fdpg.mii.cds", - "version": "1.0.0" + "children": [ + { + "context": { + "code": "CategoryB", + "display": { + "original": "CategoryB", + "translations": [ + { + "language": "de-DE", + "value": "CategoryB" }, - "display": "Termcode B_1", - "id": "33ca0320-81e5-406f-bdfd-c649e443ddd6", - "leaf": true, - "selectable": true, - "termCodes": [ - { - "code": "tcB_1", - "display": "Termcode B_1", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" - } - ] + { + "language": "en-US", + "value": "CategoryB" + } + ] }, + "system": "fdpg.mii.cds", + "version": "1.0.0" + }, + "display": { + "original": "Termcode B_1", + "translations": [ + { + "language": "de-DE", + "value": "Termcode B_1" + }, + { + "language": "en-US", + "value": "Termcode B_1" + } + ] + }, + "id": "33ca0320-81e5-406f-bdfd-c649e443ddd6", + "leaf": true, + "selectable": true, + "termCodes": [ { - "context": { - "code": "CategoryB", - "display": "CategoryB", - "system": "fdpg.mii.cds", - "version": "1.0.0" - }, - "display": "Termcode B_2", - "id": "0da2a746-d23f-4668-9160-51d83edbd02c", - "leaf": true, - "selectable": true, - "termCodes": [ - { - "code": "tcB_2", - "display": "Termcode B_2", - "system": "http://some.system/", - "version": "http://some.system/123/version/456" - } + "code": "tcB_1", + "display": { + "original": "Termcode B_1", + "translations": [ + { + "language": "de-DE", + "value": "Termcode B_1" + }, + { + "language": "en-US", + "value": "Termcode B_1" + } ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" } - ], - "context": { - "code": "CategoryB", - "display": "CategoryB", - "system": "fdpg.mii.cds" + ] }, - "display": "CategoryB", - "id": "385d2db8-77db-11ee-b962-0242ac120002", - "leaf": false, - "selectable": false, - "termCodes": [ + { + "context": { + "code": "CategoryB", + "display": { + "original": "CategoryB", + "translations": [ + { + "language": "de-DE", + "value": "CategoryB" + }, + { + "language": "en-US", + "value": "CategoryB" + } + ] + }, + "system": "fdpg.mii.cds", + "version": "1.0.0" + }, + "display": { + "original": "Termcode B_2", + "translations": [ + { + "language": "de-DE", + "value": "Termcode B_2" + }, + { + "language": "en-US", + "value": "Termcode B_2" + } + ] + }, + "id": "0da2a746-d23f-4668-9160-51d83edbd02c", + "leaf": true, + "selectable": true, + "termCodes": [ { - "code": "CategoryB", - "display": "CategoryB", - "system": "fdpg.mii.cds" + "code": "tcB_2", + "display": { + "original": "Termcode B_2", + "translations": [ + { + "language": "de-DE", + "value": "Termcode B_2" + }, + { + "language": "en-US", + "value": "Termcode B_2" + } + ] + }, + "system": "http://some.system/", + "version": "http://some.system/123/version/456" } + ] + } + ], + "context": { + "code": "CategoryB", + "display": { + "original": "CategoryB", + "translations": [ + { + "language": "de-DE", + "value": "CategoryB" + }, + { + "language": "en-US", + "value": "CategoryB" + } + ] + }, + "system": "fdpg.mii.cds" + }, + "display": { + "original": "CategoryB", + "translations": [ + { + "language": "de-DE", + "value": "CategoryB" + }, + { + "language": "en-US", + "value": "CategoryB" + } ] + }, + "id": "385d2db8-77db-11ee-b962-0242ac120002", + "leaf": false, + "selectable": false, + "termCodes": [ + { + "code": "CategoryB", + "display": { + "original": "CategoryB", + "translations": [ + { + "language": "de-DE", + "value": "CategoryB" + }, + { + "language": "en-US", + "value": "CategoryB" + } + ] + }, + "system": "fdpg.mii.cds" + } + ] }