diff --git a/.github/scripts/post-elastic-test-queries.sh b/.github/scripts/post-elastic-test-queries.sh index e6db4a06..01a9f0a6 100755 --- a/.github/scripts/post-elastic-test-queries.sh +++ b/.github/scripts/post-elastic-test-queries.sh @@ -2,39 +2,6 @@ curl "$ELASTIC_HOST/_cat/indices" -response=$(curl -s -w "%{http_code}" -o response_body "$ELASTIC_HOST/ontology/_doc/9c2328b0-ac4e-3d69-8f2f-d8b905875348") -http_code="${response: -3}" -json_body=$(cat response_body) - -if [ "$http_code" -eq 200 ]; then - if echo "$json_body" | jq '.found == true' | grep -q true; then - echo "Ontology Document found in elastic search" - else - echo "Empty or nonexistent response from elastic search" - exit 1 - fi -else - echo "Response code $http_code" - exit 1 -fi - - -response=$(curl -s -w "%{http_code}" -o response_body "$ELASTIC_HOST/codeable_concept/_doc/d676be36-7f34-3ea6-9838-c0c9e1ca3dcc") -http_code="${response: -3}" -json_body=$(cat response_body) - -if [ "$http_code" -eq 200 ]; then - if echo "$json_body" | jq '.found == true' | grep -q true; then - echo "Codeable Concept Document found in elastic search" - else - echo "Empty or nonexistent response from elastic search" - exit 1 - fi -else - echo "Response code $http_code" - exit 1 -fi - access_token="$(curl -s --request POST \ --url http://localhost:8083/auth/realms/dataportal/protocol/openid-connect/token \ --header 'Content-Type: application/x-www-form-urlencoded' \ @@ -76,21 +43,5 @@ else exit 1 fi -response=$(curl -s -w "%{http_code}" --header "Authorization: Bearer $access_token" -o response_body "http://localhost:8091/api/v4/codeable-concept/entry/d676be36-7f34-3ea6-9838-c0c9e1ca3dcc") -http_code="${response: -3}" -json_body=$(cat response_body) - -if [ "$http_code" -eq 200 ]; then - if echo "$json_body" | jq -e '.code and .code != ""' | grep -q true; then - echo "OK response with non-empty array" - else - echo "Empty or nonexistent response" - exit 1 - fi -else - echo "Response code $http_code" - exit 1 -fi - echo "All elastic search tests completed" exit 0 \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8f8d7bd..7ff452bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -148,7 +148,7 @@ jobs: needs: tests runs-on: ubuntu-latest env: - ONTOLOGY_GIT_TAG: v3.0.1 + ONTOLOGY_GIT_TAG: v3.0.2-alpha ELASTIC_HOST: http://localhost:9200 ELASTIC_FILEPATH: https://github.com/medizininformatik-initiative/fhir-ontology-generator/releases/download/TAGPLACEHOLDER/ ELASTIC_FILENAME: elastic.zip diff --git a/docker-compose.yml b/docker-compose.yml index 0c2aa0d3..e43bde15 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -139,7 +139,7 @@ services: environment: ES_HOST: http://dataportal-elastic ES_PORT: 9200 - ONTO_GIT_TAG: v3.0.1 + ONTO_GIT_TAG: v3.0.2-alpha ONTO_REPO: https://github.com/medizininformatik-initiative/fhir-ontology-generator/releases/download DOWNLOAD_FILENAME: elastic.zip EXIT_ON_EXISTING_INDICES: false 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 ab8d318d..a6391837 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 184f2c26..794005c8 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/TerminologyService.java b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/TerminologyService.java index 931c669a..9aef25f0 100644 --- a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/TerminologyService.java +++ b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/TerminologyService.java @@ -108,4 +108,14 @@ public List getCriteriaProfileData(List criteriaIds return results; } + + public List addDisplayDataToCriteriaProfileData(List criteriaProfileData, List displayData) { + var result = new ArrayList(); + for (CriteriaProfileData cpd : criteriaProfileData) { + var searchResultEntry = displayData.stream().filter(dd -> cpd.getId().equals(dd.id())).findFirst().orElse(null); + cpd.setDisplay(searchResultEntry == null ? null : searchResultEntry.display()); + result.add(cpd); + } + return result; + } } 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/CriteriaProfileData.java b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/api/CriteriaProfileData.java index 561029b9..6fc5be4d 100644 --- a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/api/CriteriaProfileData.java +++ b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/api/CriteriaProfileData.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; +import de.numcodex.feasibility_gui_backend.common.api.DisplayEntry; import de.numcodex.feasibility_gui_backend.common.api.TermCode; import lombok.Builder; import lombok.Data; @@ -17,6 +18,8 @@ public class CriteriaProfileData { @JsonProperty("id") private String id; + @JsonProperty("display") + private DisplayEntry display; @JsonProperty("context") private TermCode context; @JsonProperty("termCodes") 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/api/RelationEntry.java b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/api/RelationEntry.java new file mode 100644 index 00000000..46edb6d2 --- /dev/null +++ b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/api/RelationEntry.java @@ -0,0 +1,26 @@ +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.OntologyItemRelationsDocument; +import de.numcodex.feasibility_gui_backend.terminology.es.model.Relative; +import lombok.Builder; + +import java.util.Collection; + +@Builder +public record RelationEntry( + DisplayEntry display, + Collection parents, + Collection children, + Collection relatedTerms +) { + + public static RelationEntry of(OntologyItemRelationsDocument document) { + return RelationEntry.builder() + .display(DisplayEntry.of(document.display())) + .parents(document.parents()) + .children(document.children()) + .relatedTerms(document.relatedTerms()) + .build(); + } +} 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..958bbb20 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", "display.en", "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 ee346a7e..51ac928b 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 @@ -7,6 +7,7 @@ import co.elastic.clients.elasticsearch._types.query_dsl.*; import de.numcodex.feasibility_gui_backend.terminology.api.EsSearchResult; import de.numcodex.feasibility_gui_backend.terminology.api.EsSearchResultEntry; +import de.numcodex.feasibility_gui_backend.terminology.api.RelationEntry; import de.numcodex.feasibility_gui_backend.terminology.es.model.*; import de.numcodex.feasibility_gui_backend.terminology.es.repository.OntologyItemEsRepository; import de.numcodex.feasibility_gui_backend.terminology.es.repository.OntologyItemNotFoundException; @@ -53,6 +54,13 @@ public EsSearchResultEntry getSearchResultEntryByHash(String hash) { return EsSearchResultEntry.of(ontologyItem); } + public List getSearchResultEntriesByHash(List hashes) { + var ontologyItems = ontologyListItemEsRepository.findAllById(hashes); + List results = new ArrayList<>(); + ontologyItems.forEach(oi -> results.add(EsSearchResultEntry.of(oi))); + return results; + } + public List getAvailableFilters() { var filterTerms = List.of(filterFields); var list = new ArrayList(); @@ -150,7 +158,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", "display.en", "termcode^2")) .build(); boolQuery = new BoolQuery.Builder() @@ -185,18 +193,21 @@ private SearchHits findByNameOrTermcode(String keyword .withPageable(pageRequest) .build(); + log.info(finalQuery.getQuery().toString()); + return operations.search(finalQuery, OntologyListItemDocument.class); } - public OntologyItemRelationsDocument getOntologyItemRelationsByHash(String hash) { + public RelationEntry getRelationEntryByHash(String hash) { var ontologyItem = ontologyItemEsRepository.findById(hash).orElseThrow(OntologyItemNotFoundException::new); - return OntologyItemRelationsDocument.builder() - .translations(ontologyItem.translations()) + var ontologyItemRelationsDocument = OntologyItemRelationsDocument.builder() + .display(ontologyItem.display()) .parents(ontologyItem.parents()) .children(ontologyItem.children()) .relatedTerms(ontologyItem.relatedTerms()) .build(); + return RelationEntry.of(ontologyItemRelationsDocument); } 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..d557effe --- /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") + String deDe, + @Field(name = "en") + 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/java/de/numcodex/feasibility_gui_backend/terminology/v4/TerminologyRestController.java b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/v4/TerminologyRestController.java index ba6ef2e5..546b20e7 100644 --- a/src/main/java/de/numcodex/feasibility_gui_backend/terminology/v4/TerminologyRestController.java +++ b/src/main/java/de/numcodex/feasibility_gui_backend/terminology/v4/TerminologyRestController.java @@ -4,7 +4,6 @@ import de.numcodex.feasibility_gui_backend.terminology.TerminologyService; import de.numcodex.feasibility_gui_backend.terminology.api.*; import de.numcodex.feasibility_gui_backend.terminology.es.TerminologyEsService; -import de.numcodex.feasibility_gui_backend.terminology.es.model.OntologyItemRelationsDocument; import de.numcodex.feasibility_gui_backend.terminology.es.model.TermFilter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; @@ -37,7 +36,9 @@ public TerminologyRestController(TerminologyService terminologyService, Terminol @GetMapping("criteria-profile-data") public List getCriteriaProfileData(@RequestParam List ids) { - return terminologyService.getCriteriaProfileData(ids); + var criteriaProfileData = terminologyService.getCriteriaProfileData(ids); + var displayData = terminologyEsService.getSearchResultEntriesByHash(ids); + return terminologyService.addDisplayDataToCriteriaProfileData(criteriaProfileData, displayData); } @GetMapping(value = "systems", produces = MediaType.APPLICATION_JSON_VALUE) @@ -51,14 +52,14 @@ public List getAvailableFilters() { } @GetMapping("entry/search") - public EsSearchResult searchOntologyItemsCriteriaQuery2(@RequestParam("searchterm") String keyword, - @RequestParam(value = "criteria-sets", required = false) List criteriaSets, - @RequestParam(value = "contexts", required = false) List contexts, - @RequestParam(value = "kds-modules", required = false) List kdsModules, - @RequestParam(value = "terminologies", required = false) List terminologies, - @RequestParam(value = "availability", required = false, defaultValue = "false") boolean availability, - @RequestParam(value = "page-size", required = false, defaultValue = "20") int pageSize, - @RequestParam(value = "page", required = false, defaultValue = "0") int page) { + public EsSearchResult searchOntologyItemsCriteriaQuery(@RequestParam("searchterm") String keyword, + @RequestParam(value = "criteria-sets", required = false) List criteriaSets, + @RequestParam(value = "contexts", required = false) List contexts, + @RequestParam(value = "kds-modules", required = false) List kdsModules, + @RequestParam(value = "terminologies", required = false) List terminologies, + @RequestParam(value = "availability", required = false, defaultValue = "false") boolean availability, + @RequestParam(value = "page-size", required = false, defaultValue = "20") int pageSize, + @RequestParam(value = "page", required = false, defaultValue = "0") int page) { return terminologyEsService @@ -66,8 +67,8 @@ public EsSearchResult searchOntologyItemsCriteriaQuery2(@RequestParam("searchter } @GetMapping("entry/{hash}/relations") - public OntologyItemRelationsDocument getOntologyItemRelationsByHash(@PathVariable("hash") String hash) { - return terminologyEsService.getOntologyItemRelationsByHash(hash); + public RelationEntry getOntologyItemRelationsByHash(@PathVariable("hash") String hash) { + return terminologyEsService.getRelationEntryByHash(hash); } @GetMapping("entry/{hash}") diff --git a/src/main/resources/static/v3/api-docs/swagger.yaml b/src/main/resources/static/v3/api-docs/swagger.yaml index a5655047..835ac6e6 100644 --- a/src/main/resources/static/v3/api-docs/swagger.yaml +++ b/src/main/resources/static/v3/api-docs/swagger.yaml @@ -758,7 +758,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ElasticSearchResultEntryWithRelations" + $ref: "#/components/schemas/RelationsEntry" 401: description: Unauthorized - please login first 403: @@ -889,7 +889,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/TermCode" + $ref: "#/components/schemas/CodeableConceptEntry" 401: description: Unauthorized - please login first 403: @@ -1317,19 +1317,6 @@ components: type: string examples: - translated entry - DisplayEntry: - type: object - required: - - original - properties: - original: - type: string - examples: - - the original entry - translations: - type: array - items: - $ref: "#/components/schemas/TranslationEntry" ElasticSearchResult: type: object properties: @@ -1341,45 +1328,11 @@ components: type: array items: $ref: "#/components/schemas/ElasticSearchResultEntry" - ElasticSearchResultEntryWithRelations: + RelationsEntry: type: object properties: - name: - type: string - examples: - - Diabetes Mellitus - contextualizedTermcodeHash: - type: string - format: uuid - examples: - - 203e04cd-4f0a-321b-b1ad-9ec6d211e0a8 - availability: - description: Not sure if we want this as numeric value, percentage or just boolean? - type: integer - minimum: 0 - maximum: 100 - examples: - - 94 - context: - type: string - examples: - - Diagnosis - terminology: - type: string - examples: - - icd-10 - termcode: - type: string - examples: - - E10-E14 - kdsModule: - type: string - examples: - - Condition - translations: - type: array - items: - $ref: "#/components/schemas/ElasticSearchTranslationEntry" + display: + $ref: "#/components/schemas/DisplayEntry" parents: type: array items: @@ -1388,14 +1341,16 @@ components: type: array items: $ref: "#/components/schemas/ElasticSearchRelationEntry" + relatedTerms: + type: array + items: + $ref: "#/components/schemas/ElasticSearchRelationEntry" ElasticSearchResultEntry: type: object properties: - name: - type: string - examples: - - Diabetes Mellitus - contextualizedTermcodeHash: + display: + $ref: "#/components/schemas/DisplayEntry" + id: type: string format: uuid examples: @@ -1422,6 +1377,10 @@ components: type: string examples: - Condition + selectable: + type: boolean + examples: + - true ElasticSearchTranslationEntry: type: object properties: @@ -1463,6 +1422,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: @@ -1473,23 +1463,25 @@ components: results: type: array items: - $ref: "#/components/schemas/TermCode" + $ref: "#/components/schemas/CodeableConceptEntry" CriteriaProfileData: type: object properties: id: type: string format: uuid - uiprofile: - type: array - items: - $ref: "#/components/schemas/UiProfileEntry" + display: + $ref: "#/components/schemas/DisplayEntry" + context: + $ref: "#/components/schemas/TermCode" termCodes: type: array items: $ref: "#/components/schemas/TermCode" - context: - $ref: "#/components/schemas/TermCode" + uiprofile: + type: array + items: + $ref: "#/components/schemas/UiProfileEntry" UiProfileEntry: type: object properties: @@ -1577,7 +1569,6 @@ components: - ProfileObservationLaboruntersuchung display: $ref: "#/components/schemas/DisplayEntry" - module: type: string examples: 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 27565b93..ed90f9a1 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 @@ -87,7 +87,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 @@ -122,10 +122,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 5daa7d1b..4e5ecc0d 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 @@ -2,7 +2,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; import de.numcodex.feasibility_gui_backend.common.api.TermCode; +import de.numcodex.feasibility_gui_backend.dse.api.LocalizedValue; 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 +58,20 @@ 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()); + assertTrue(result.getResults().get(0).display().translations().containsAll( + List.of( + LocalizedValue.builder() + .value(dummySearchHitsPage.getSearchHits().get(0).getContent().display().deDe()) + .language("de-DE") + .build(), + LocalizedValue.builder() + .value(dummySearchHitsPage.getSearchHits().get(0).getContent().display().enUs()) + .language("en-US") + .build()) + ) + ); } @Test @@ -68,7 +83,20 @@ 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()); + assertTrue(result.getResults().get(0).display().translations().containsAll( + List.of( + LocalizedValue.builder() + .value(dummySearchHitsPage.getSearchHits().get(0).getContent().display().deDe()) + .language("de-DE") + .build(), + LocalizedValue.builder() + .value(dummySearchHitsPage.getSearchHits().get(0).getContent().display().enUs()) + .language("en-US") + .build()) + ) + ); } @Test @@ -80,7 +108,20 @@ 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()); + assertTrue(result.getResults().get(0).display().translations().containsAll( + List.of( + LocalizedValue.builder() + .value(dummySearchHitsPage.getSearchHits().get(0).getContent().display().deDe()) + .language("de-DE") + .build(), + LocalizedValue.builder() + .value(dummySearchHitsPage.getSearchHits().get(0).getContent().display().enUs()) + .language("en-US") + .build()) + ) + ); } @Test @@ -113,7 +154,20 @@ 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()); + assertTrue(result.display().translations().containsAll( + List.of( + LocalizedValue.builder() + .value(dummyCodeableConceptDocument.display().deDe()) + .language("de-DE") + .build(), + LocalizedValue.builder() + .value(dummyCodeableConceptDocument.display().enUs()) + .language("en-US") + .build() + ) + )); } @Test @@ -150,10 +204,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/TerminologyEsServiceIT.java b/src/test/java/de/numcodex/feasibility_gui_backend/terminology/es/TerminologyEsServiceIT.java index 0919222f..0021e271 100644 --- a/src/test/java/de/numcodex/feasibility_gui_backend/terminology/es/TerminologyEsServiceIT.java +++ b/src/test/java/de/numcodex/feasibility_gui_backend/terminology/es/TerminologyEsServiceIT.java @@ -169,7 +169,7 @@ void testGetSearchResultEntryByHash_throwsOnNotFound() { @Test void testGetSearchRelationsByHash_succeeds() { String entryId = "e2fcb288-0d08-3272-8f32-64b8f1cfe095"; - var relations = assertDoesNotThrow(() -> terminologyEsService.getOntologyItemRelationsByHash(entryId)); + var relations = assertDoesNotThrow(() -> terminologyEsService.getRelationEntryByHash(entryId)); assertThat(relations).isNotNull(); assertThat(relations.parents()).isNotNull(); assertThat(relations.parents()).isNotEmpty(); @@ -178,6 +178,6 @@ void testGetSearchRelationsByHash_succeeds() { @Test void testGetSearchRelationsByHash_throwsOnNotFound() { - assertThrows(OntologyItemNotFoundException.class, () -> terminologyEsService.getOntologyItemRelationsByHash("invalid-id")); + assertThrows(OntologyItemNotFoundException.class, () -> terminologyEsService.getRelationEntryByHash("invalid-id")); } } 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 c8f3e12f..98482be4 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 @@ -1,6 +1,7 @@ package de.numcodex.feasibility_gui_backend.terminology.es; import co.elastic.clients.elasticsearch._types.aggregations.StringTermsBucket; +import de.numcodex.feasibility_gui_backend.common.api.DisplayEntry; import de.numcodex.feasibility_gui_backend.common.api.TermCode; import de.numcodex.feasibility_gui_backend.terminology.api.EsSearchResultEntry; import de.numcodex.feasibility_gui_backend.terminology.es.model.*; @@ -77,7 +78,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()); @@ -175,24 +176,24 @@ void testPerformOntologySearchWithRepoAndPaging_throwsOnInvalidPageSize() { } @Test - void testGetOntologyItemRelationsByHash_succeeds() { + void testGetRelationEntryByHash_succeeds() { String id = UUID.randomUUID().toString(); - OntologyItemDocument dummyOntologyItem = createDummyOntologyItem(id); + var dummyOntologyItem = createDummyOntologyItem(id); doReturn(Optional.of(dummyOntologyItem)).when(ontologyItemEsRepository).findById(any(String.class)); - var ontologyItemRelationsDocument = assertDoesNotThrow(() -> terminologyEsService.getOntologyItemRelationsByHash(id)); - assertThat(ontologyItemRelationsDocument).isNotNull(); - assertThat(ontologyItemRelationsDocument.relatedTerms()).isEqualTo(dummyOntologyItem.relatedTerms()); - assertThat(ontologyItemRelationsDocument.children()).isEqualTo(dummyOntologyItem.children()); - assertThat(ontologyItemRelationsDocument.parents()).isEqualTo(dummyOntologyItem.parents()); - assertThat(ontologyItemRelationsDocument.translations()).isEqualTo(dummyOntologyItem.translations()); + var relationEntry = assertDoesNotThrow(() -> terminologyEsService.getRelationEntryByHash(id)); + assertThat(relationEntry).isNotNull(); + assertThat(relationEntry.relatedTerms()).isEqualTo(dummyOntologyItem.relatedTerms()); + assertThat(relationEntry.children()).isEqualTo(dummyOntologyItem.children()); + assertThat(relationEntry.parents()).isEqualTo(dummyOntologyItem.parents()); + assertThat(relationEntry.display()).isEqualTo(DisplayEntry.of(dummyOntologyItem.display())); } @Test - void testGetOntologyItemRelationsByHash_throwsOnNotFound() { + void testGetRelationEntryByHash_throwsOnNotFound() { doReturn(Optional.empty()).when(ontologyItemEsRepository).findById(any(String.class)); - assertThrows(OntologyItemNotFoundException.class, () -> terminologyEsService.getOntologyItemRelationsByHash("id")); + assertThrows(OntologyItemNotFoundException.class, () -> terminologyEsService.getRelationEntryByHash("id")); } private OntologyListItemDocument createDummyOntologyListItem(String id) { @@ -200,7 +201,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 +210,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..b8074b26 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; @@ -69,6 +71,8 @@ public void testGetCriteriaProfileData_succeedsWith200() throws Exception { var id = UUID.randomUUID(); var criteriaProfileDataList = createCriteriaProfileDataList(List.of(id)); doReturn(criteriaProfileDataList).when(terminologyService).getCriteriaProfileData(anyList()); + doReturn(List.of(createDummyEsSearchResultEntry(id.toString()))).when(terminologyEsService).getSearchResultEntriesByHash(anyList()); + doReturn(criteriaProfileDataList).when(terminologyService).addDisplayDataToCriteriaProfileData(anyList(), anyList()); mockMvc.perform(get(URI.create(PATH_API + PATH_TERMINOLOGY + "/criteria-profile-data")).param("ids", id.toString()).with(csrf())) .andExpect(status().isOk()) @@ -132,7 +136,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())) @@ -152,25 +156,23 @@ public void testSearchOntologyItemsCriteriaQuery_failsOnUnauthorized() throws Ex @Test @WithMockUser(roles = "DATAPORTAL_TEST_USER") public void testGetOntologyItemRelationsByHash_succeeds() throws Exception { - var dummyOntologyItemRelations = createDummyOntologyItemRelations(); - doReturn(dummyOntologyItemRelations).when(terminologyEsService).getOntologyItemRelationsByHash(any(String.class)); + var dummyRelationEntry = createDummyRelationEntry(); + doReturn(dummyRelationEntry).when(terminologyEsService).getRelationEntryByHash(any(String.class)); 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())) - .andExpect(jsonPath("$.parents[0].name").value(dummyOntologyItemRelations.parents().stream().toList().get(0).name())) - .andExpect(jsonPath("$.relatedTerms[0].contextualizedTermcodeHash").value(dummyOntologyItemRelations.relatedTerms().stream().toList().get(0).contextualizedTermcodeHash())) - .andExpect(jsonPath("$.relatedTerms[0].name").value(dummyOntologyItemRelations.relatedTerms().stream().toList().get(0).name())); + .andExpect(jsonPath("$.children[0].contextualizedTermcodeHash").value(dummyRelationEntry.children().stream().toList().get(0).contextualizedTermcodeHash())) + .andExpect(jsonPath("$.children[0].name").value(dummyRelationEntry.children().stream().toList().get(0).name())) + .andExpect(jsonPath("$.parents[0].contextualizedTermcodeHash").value(dummyRelationEntry.parents().stream().toList().get(0).contextualizedTermcodeHash())) + .andExpect(jsonPath("$.parents[0].name").value(dummyRelationEntry.parents().stream().toList().get(0).name())) + .andExpect(jsonPath("$.relatedTerms[0].contextualizedTermcodeHash").value(dummyRelationEntry.relatedTerms().stream().toList().get(0).contextualizedTermcodeHash())) + .andExpect(jsonPath("$.relatedTerms[0].name").value(dummyRelationEntry.relatedTerms().stream().toList().get(0).name())); } @Test public void testGetOntologyItemRelationsByHash_failsOnUnauthorized() throws Exception { - var dummyOntologyItemRelations = createDummyOntologyItemRelations(); - doReturn(dummyOntologyItemRelations).when(terminologyEsService).getOntologyItemRelationsByHash(any(String.class)); + var dummyRelationEntry = createDummyRelationEntry(); + doReturn(dummyRelationEntry).when(terminologyEsService).getRelationEntryByHash(any(String.class)); mockMvc.perform(get(URI.create(PATH_API + PATH_TERMINOLOGY + "/entry/abc/relations")).with(csrf())) .andExpect(status().isUnauthorized()); @@ -179,13 +181,13 @@ public void testGetOntologyItemRelationsByHash_failsOnUnauthorized() throws Exce @Test @WithMockUser(roles = "DATAPORTAL_TEST_USER") public void testGetOntologyItemByHash_succeeds() throws Exception { - var dummySearchResultEntry = createDummyEsSearchResultEntry(); + var dummySearchResultEntry = createDummyEsSearchResultEntry("abc-123"); doReturn(dummySearchResultEntry).when(terminologyEsService).getSearchResultEntryByHash(any(String.class)); 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())) @@ -196,7 +198,7 @@ public void testGetOntologyItemByHash_succeeds() throws Exception { @Test public void testGetOntologyItemByHash_failsOnUnauthorized() throws Exception { - var dummySearchResultEntry = createDummyEsSearchResultEntry(); + var dummySearchResultEntry = createDummyEsSearchResultEntry("abc-123"); doReturn(dummySearchResultEntry).when(terminologyEsService).getSearchResultEntryByHash(any(String.class)); mockMvc.perform(get(URI.create(PATH_API + PATH_TERMINOLOGY + "/entry/abc")).with(csrf())) @@ -255,35 +257,54 @@ private List createCriteriaProfileDataList(List ids) private EsSearchResult createDummyEsSearchResult(int totalHits) { return EsSearchResult.builder() .totalHits(totalHits) - .results(List.of(createDummyEsSearchResultEntry())) + .results(List.of(createDummyEsSearchResultEntry("abc-123"))) .build(); } - private EsSearchResultEntry createDummyEsSearchResultEntry() { + private EsSearchResultEntry createDummyEsSearchResultEntry(String id) { return EsSearchResultEntry.builder() .terminology("some-terminology") .availability(100) .context("some-context") - .id("abc-123") + .id(id) .kdsModule("some-module") - .name("some-name") + .display(createDummyDisplayEntry()) .selectable(true) .build(); } + private Display createDummyDisplay() { + return Display.builder() + .original("some-name") + .deDe("Some German Name") + .enUs("Some English Name") + .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 RelationEntry createDummyRelationEntry() { + return RelationEntry.of(createDummyOntologyItemRelations()); + } + 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") + .display(createDummyDisplay()) .build(); } 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..f43fd4d9 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": "foo", "en": "foo", "de": "föö"}, "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": "bar", "en": "bar", "de": "bär"} ,"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": "baz", "en": "baz", "de": "bäz"},"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..51ef6708 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": { + "type": "text", + "analyzer": "edge_ngram_analyzer_include_punctuation", + "search_analyzer": "lowercase_analyzer" + }, + "en": { + "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..9aacf49f 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": { + "type": "text", + "analyzer": "edge_ngram_analyzer_include_punctuation", + "search_analyzer": "lowercase_analyzer" + }, + "en": { + "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..85cb4eab 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": []} +{"index": {"_index": "ontology", "_id": "e8ae80c5-584d-3453-915a-a58f989a8cfd"}} +{"name": "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": 0, "terminology": "http://fhir.de/CodeSystem/bfarm/ops", "termcode": "5-925.gb", "selectable": true, "context": {"system": "fdpg.mii.cds", "code": "Procedure", "display": "Prozedur", "version": "1.0.0"}, "termcodes": [{"system": "http://fhir.de/CodeSystem/bfarm/ops", "code": "5-925.gb", "display": "Freie Hauttransplantation und Lappenplastik an Haut und Unterhaut bei Verbrennungen und Verätzungen, Empfängerstelle: Permanenter Hautersatz durch allogenes Hauttransplantat, großflächig: Bauchregion", "version": "2024"}], "criteria_sets": [], "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": "Free skin transplantation and flap plasty on skin and subcutaneous tissue for burns and chemical burns, recipient site: Permanent skin replacement by allogenic skin graft, large area: Abdominal region", "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"}, "parents": [{"name": "Freie Hauttransplantation und Lappenplastik an Haut und Unterhaut bei Verbrennungen und Verätzungen, Empfängerstelle: Permanenter Hautersatz durch allogenes Hauttransplantat, großflächig", "contextualized_termcode_hash": "e81b478d-3107-31b2-bf92-8287a1d13c6a"}], "children": [], "related_terms": [], "kds_module": "Prozedur"} {"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": []} +{"name": "Abnormer Blutdruckwert ohne Diagnose", "availability": 0, "terminology": "http://fhir.de/CodeSystem/bfarm/icd-10-gm", "termcode": "R03", "selectable": true, "context": {"system": "fdpg.mii.cds", "code": "Diagnose", "display": "Diagnose", "version": "1.0.0"}, "termcodes": [{"system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm", "code": "R03", "display": "Abnormer Blutdruckwert ohne Diagnose", "version": "2024"}], "criteria_sets": ["http://fdpg.mii.cds/CriteriaSet/Diagnose/icd-10-gm"], "display": {"original": "Abnormer Blutdruckwert ohne Diagnose", "en": "Abnormal blood pressure value without diagnosis", "de": "Abnormer Blutdruckwert ohne Diagnose"}, "parents": [{"name": "Symptome, die das Kreislaufsystem und das Atmungssystem betreffen", "contextualized_termcode_hash": "9b12a688-b786-37ef-95ef-bc96ec96e438"}], "children": [{"name": "Unspezifischer niedriger Blutdruckwert", "contextualized_termcode_hash": "1f2da8e5-15c8-33b3-85a5-075482a90eb5"}, {"name": "Erhöhter Blutdruckwert ohne Diagnose eines Bluthochdrucks", "contextualized_termcode_hash": "1026c3ef-9f0a-3db3-94e7-7615c8041706"}], "related_terms": [], "kds_module": "Diagnose"} {"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": []} +{"name": "Erhöhter Blutdruckwert ohne Diagnose eines Bluthochdrucks", "availability": 0, "terminology": "http://fhir.de/CodeSystem/bfarm/icd-10-gm", "termcode": "R03.0", "selectable": true, "context": {"system": "fdpg.mii.cds", "code": "Diagnose", "display": "Diagnose", "version": "1.0.0"}, "termcodes": [{"system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm", "code": "R03.0", "display": "Erhöhter Blutdruckwert ohne Diagnose eines Bluthochdrucks", "version": "2024"}], "criteria_sets": ["http://fdpg.mii.cds/CriteriaSet/Diagnose/icd-10-gm"], "display": {"original": "Erhöhter Blutdruckwert ohne Diagnose eines Bluthochdrucks", "en": "Elevated blood pressure value without diagnosis of hypertension", "de": "Erhöhter Blutdruckwert ohne Diagnose eines Bluthochdrucks"}, "parents": [{"name": "Abnormer Blutdruckwert ohne Diagnose", "contextualized_termcode_hash": "3667a295-d0cb-3e86-8cb3-1b9b050f6e59"}], "children": [], "related_terms": [], "kds_module": "Diagnose"} {"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": []} +{"name": "Unspezifischer niedriger Blutdruckwert", "availability": 0, "terminology": "http://fhir.de/CodeSystem/bfarm/icd-10-gm", "termcode": "R03.1", "selectable": true, "context": {"system": "fdpg.mii.cds", "code": "Diagnose", "display": "Diagnose", "version": "1.0.0"}, "termcodes": [{"system": "http://fhir.de/CodeSystem/bfarm/icd-10-gm", "code": "R03.1", "display": "Unspezifischer niedriger Blutdruckwert", "version": "2024"}], "criteria_sets": ["http://fdpg.mii.cds/CriteriaSet/Diagnose/icd-10-gm"], "display": {"original": "Unspezifischer niedriger Blutdruckwert", "en": "Non-specific low blood pressure value", "de": "Unspezifischer niedriger Blutdruckwert"}, "parents": [{"name": "Abnormer Blutdruckwert ohne Diagnose", "contextualized_termcode_hash": "3667a295-d0cb-3e86-8cb3-1b9b050f6e59"}], "children": [], "related_terms": [], "kds_module": "Diagnose"} 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" + } + ] }