Skip to content

Commit

Permalink
Merge pull request #454 from medizininformatik-initiative/release/v6.1.0
Browse files Browse the repository at this point in the history
Release v6.1.0
  • Loading branch information
michael-82 authored Feb 14, 2025
2 parents 7fccff7 + 59798cd commit 5e85d8f
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
needs: tests
runs-on: ubuntu-latest
env:
ONTOLOGY_GIT_TAG: v3.0.2-alpha.2
ONTOLOGY_GIT_TAG: v3.0.2-alpha.5
ELASTIC_HOST: http://localhost:9200
ELASTIC_FILEPATH: https://github.com/medizininformatik-initiative/fhir-ontology-generator/releases/download/TAGPLACEHOLDER/
ELASTIC_FILENAME: elastic.zip
Expand Down
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,42 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [6.1.0] - 2025-02-14

- Based on ontology **[v3.0.0](https://github.com/medizininformatik-initiative/fhir-ontology-generator/releases/tag/v3.1.0)**

### Added
- Added translations to ui profiles ([#430](https://github.com/medizininformatik-initiative/feasibility-backend/issues/430))
### Changed
- Update sq2cql to 0.8.0
- Search in original display text if no translations are found ([#446](https://github.com/medizininformatik-initiative/feasibility-backend/issues/446))
- Change display and translation structure for criteria and concepts ([#382](https://github.com/medizininformatik-initiative/feasibility-backend/issues/382))
- Change codeable-concept/entry endpoint to take a list of ids as query param instead of just one id as path param ([#433](https://github.com/medizininformatik-initiative/feasibility-backend/issues/433))
- Replace @MockBean annotation with @MockitoBean due to deprecation ([#434](https://github.com/medizininformatik-initiative/feasibility-backend/issues/434))
- Replace deprecated calls to bucket4j library ([#424](https://github.com/medizininformatik-initiative/feasibility-backend/issues/424))
- Read ids from downloaded files in integration tests to remove the need to change those each time a new ontology is used ([#428](https://github.com/medizininformatik-initiative/feasibility-backend/issues/428))
### Removed
- @Data Annotation removed from JPA classes ([#332](https://github.com/medizininformatik-initiative/feasibility-backend/issues/332))
### Fixed
- Missing Parameters for DSE profile data added in open api doc ([#431](https://github.com/medizininformatik-initiative/feasibility-backend/issues/431))
### Security
- Update Spring Boot to 3.4.2 ([#437](https://github.com/medizininformatik-initiative/feasibility-backend/issues/437))

## [6.1.0-alpha.2] - 2025-02-12

### Changed
- Update sq2cql to 0.8.0-alpha.1 ([#450](https://github.com/medizininformatik-initiative/feasibility-backend/issues/450))
- Search in original display text if no translations are found ([#446](https://github.com/medizininformatik-initiative/feasibility-backend/issues/446))

## [6.0.5] - 2025-02-03

### Changed
- Update sq2cql to 0.7.0 ([#444](https://github.com/medizininformatik-initiative/feasibility-backend/issues/444))
### Security
- Update Spring Boot to 3.4.2

## [6.1.0-alpha.1] - 2025-01-24

### Added
- Added translations to ui profiles ([#430](https://github.com/medizininformatik-initiative/feasibility-backend/issues/430))
### Changed
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>de.medizininformatik-initiative</groupId>
<artifactId>DataportalBackend</artifactId>
<version>6.1.0-alpha.1</version>
<version>6.1.0</version>

<name>Dataportal Backend</name>
<description>Backend of the Dataportal</description>
Expand All @@ -27,7 +27,7 @@
<java.version>17</java.version>
<mockwebserver.version>4.12.0</mockwebserver.version>
<okhttp3.version>4.10.0</okhttp3.version>
<ontology-tag>v3.0.2-alpha.2</ontology-tag>
<ontology-tag>v3.1.0</ontology-tag>
</properties>

<dependencies>
Expand Down Expand Up @@ -206,7 +206,7 @@
<dependency>
<groupId>de.medizininformatik-initiative</groupId>
<artifactId>sq2cql</artifactId>
<version>0.6.1</version>
<version>0.8.0</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -423,7 +423,7 @@
<goal>download-single</goal>
</goals>
<configuration>
<url>https://github.com/medizininformatik-initiative/fhir-ontology-generator/releases/download/${ontology-tag}/</url>
<url>https://github.com/medizininformatik-initiative/fhir-ontology-generator/releases/download/${ontology-tag}</url>
<fromFile>backend.zip</fromFile>
<toDir>${ontoDirectory.download}</toDir>
</configuration>
Expand All @@ -435,7 +435,7 @@
<goal>download-single</goal>
</goals>
<configuration>
<url>https://github.com/medizininformatik-initiative/fhir-ontology-generator/releases/download/${ontology-tag}/</url>
<url>https://github.com/medizininformatik-initiative/fhir-ontology-generator/releases/download/${ontology-tag}</url>
<fromFile>mapping.zip</fromFile>
<toDir>${ontoDirectory.download}</toDir>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public Map<String, Object> getErrorAttributes(WebRequest webRequest, ErrorAttrib
String originalErrorMessage = super.getMessage(webRequest, null);

try {
return Map.of("issue", List.of(FeasibilityIssue.valueOf(Integer.parseInt(originalErrorMessage))));
return Map.of("issues", List.of(FeasibilityIssue.valueOf(Integer.parseInt(originalErrorMessage))));
} catch (IllegalArgumentException e) {
return super.getErrorAttributes(webRequest, options);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,30 +80,51 @@ private SearchHits<CodeableConceptDocument> findByCodeOrDisplay(String keyword,
});
}

BoolQuery boolQuery;
BoolQuery outerBoolQuery;

if (keyword.isEmpty()) {
boolQuery = new BoolQuery.Builder()
outerBoolQuery = new BoolQuery.Builder()
.filter(filterTerms.isEmpty() ? List.of() : filterTerms)
.build();

} else {
var mmQuery = new MultiMatchQuery.Builder()
// First the "upper" part of the query, when translations are present
var mustMultiMatchQueryWithTranslations = new MultiMatchQuery.Builder()
.query(keyword)
.fields(List.of("display.de", "display.en", "termcode.code^2"))
.build();

boolQuery = new BoolQuery.Builder()
.must(List.of(mmQuery._toQuery()))
var innerBoolQueryMatchTranslations = new BoolQuery.Builder()
.must(List.of(mustMultiMatchQueryWithTranslations._toQuery()))
.filter(filterTerms.isEmpty() ? List.of() : filterTerms)
.build();


// The "lower" part that will only be considered when the translations are empty
var mustMultiMatchQueryWithOriginal = new MultiMatchQuery.Builder()
.query(keyword)
.fields(List.of("display.original", "termcode.code^2"))
.build();

var innerBoolQueryMatchOriginal = new BoolQuery.Builder()
.must(List.of(mustMultiMatchQueryWithOriginal._toQuery()))
.filter(filterTerms.isEmpty() ? List.of() : filterTerms)
.build();

// Combine both parts in the top level bool query
outerBoolQuery = new BoolQuery.Builder()
.should(List.of(innerBoolQueryMatchTranslations._toQuery(), innerBoolQueryMatchOriginal._toQuery()))
.minimumShouldMatch("1")
.build();
}

var query = new NativeQueryBuilder()
.withQuery(boolQuery._toQuery())
.withQuery(outerBoolQuery._toQuery())
.withPageable(pageRequest)
.build();

log.info(query.getQuery().toString());

return operations.search(query, CodeableConceptDocument.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,19 @@ private SearchHits<OntologyListItemDocument> findByNameOrTermcode(String keyword
.filter(filterTerms.isEmpty() ? List.of() : filterTerms)
.build();
} else {
var mmQuery = new MultiMatchQuery.Builder()
var mmQueryWithTranslations = new MultiMatchQuery.Builder()
.query(keyword)
.fields(List.of("display.de", "display.en", "termcode^2"))
.build();

var mmQueryWithOriginal = new MultiMatchQuery.Builder()
.query(keyword)
.fields(List.of("display.original", "termcode^2"))
.build();

boolQuery = new BoolQuery.Builder()
.must(List.of(mmQuery._toQuery()))
.should(List.of(mmQueryWithTranslations._toQuery(), mmQueryWithOriginal._toQuery()))
.minimumShouldMatch("1")
.filter(filterTerms.isEmpty() ? List.of() : filterTerms)
.build();
}
Expand Down
6 changes: 2 additions & 4 deletions src/main/resources/static/v3/api-docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1493,10 +1493,8 @@ components:
type: array
items:
$ref: "#/components/schemas/TermCode"
uiprofile:
type: array
items:
$ref: "#/components/schemas/UiProfileEntry"
uiProfile:
$ref: "#/components/schemas/UiProfileEntry"
UiProfileEntry:
type: object
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
"properties": {
"original": {
"type": "text",
"index": false
"analyzer": "edge_ngram_analyzer_include_punctuation",
"search_analyzer": "lowercase_analyzer"
},
"de": {
"type": "text",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@
"properties": {
"original": {
"type": "text",
"index": false
"analyzer": "edge_ngram_analyzer_include_punctuation",
"search_analyzer": "lowercase_analyzer"
},
"de": {
"type": "text",
Expand Down

0 comments on commit 5e85d8f

Please sign in to comment.