Skip to content

Commit 380623c

Browse files
Merge pull request #171 from medizininformatik-initiative/release-v3.1.0
Release v3.1.0
2 parents 7cfd800 + b2bd54b commit 380623c

File tree

343 files changed

+6117
-48398
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

343 files changed

+6117
-48398
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
backend.zip filter=lfs diff=lfs merge=lfs -text
2+
elastic.zip filter=lfs diff=lfs merge=lfs -text
3+
mapping.zip filter=lfs diff=lfs merge=lfs -text
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Generate Ontology
2+
3+
description: 'Generates ontology files'
4+
5+
inputs:
6+
steps_to_run:
7+
required: false
8+
description: 'Optional non-empty list of steps of the ontology generation to run. If not supplied all steps
9+
will be run. The steps to run should be supplied as a JSON array of greater than zero integers
10+
matching the indices of the steps to run.
11+
12+
Examples: "[1, 3, 5, 6]"; "[2]"; "[4, 3, 2]"'
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: Set default
18+
shell: bash
19+
run: echo "GENERATOR_STEPS=--all" >> $GITHUB_ENV
20+
- name: Parsing generator steps to run
21+
shell: bash
22+
if: ${{ inputs.steps_to_run != '' }}
23+
run: |
24+
echo "GENERATOR_STEPS=--step ${{ join(fromJSON(inputs.steps_to_run), ' --step ') }}" >> $GITHUB_ENV
25+
echo "Using generator scripts with arguments $GENERATOR_STEPS"
26+
27+
- name: Save secret to file
28+
shell: bash
29+
id: certificates
30+
run: |
31+
echo "$PRIVATE_KEY" > private-key.pem
32+
echo "$SERVER_CERTIFICATE" > certificate.pem
33+
echo privateKey=$(readlink -f private-key.pem) >> "$GITHUB_OUTPUT"
34+
echo certificate=$(readlink -f certificate.pem) >> "$GITHUB_OUTPUT"
35+
env:
36+
SERVER_CERTIFICATE: ${{ secrets.FDPGPLUS_ONTO_SERVER_CERT }}
37+
PRIVATE_KEY: ${{ secrets.FDPGPLUS_ONTO_SERVER_KEY }}
38+
39+
- name: Run ontology generation
40+
shell: bash
41+
env:
42+
ONTOLOGY_SERVER_ADDRESS: ${{ secrets.FDPGPLUS_ONTO_SERVER_URL }}
43+
SERVER_CERTIFICATE: ${{ steps.certificates.outputs.certificate }}
44+
PRIVATE_KEY: ${{ steps.certificates.outputs.privateKey }}
45+
run: ./generate_full_ontology.sh ${{ GENERATOR_STEPS }}

.github/actions/set-locale/action.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Set Locale
2+
3+
description: 'Sets system locale'
4+
5+
inputs:
6+
locale:
7+
required: true
8+
description: 'Locale code to set as system locale'
9+
default: 'de_DE.UTF-8'
10+
11+
runs:
12+
using: "composite"
13+
steps:
14+
- name: Set locale
15+
shell: bash
16+
run: |
17+
sudo apt-get update
18+
sudo apt-get install tzdata locales -y
19+
sudo locale-gen ${{ inputs.locale }}
20+
sudo localectl set-locale LANG="${{ inputs.locale }}"
21+
export LANG="${{ inputs.locale }}"
22+
sudo update-locale
23+
locale -a
24+
locale
25+
locale -c -k LC_NUMERIC
26+
localectl status

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ jobs:
6363
files: |
6464
example/fdpg-ontology/elastic.zip
6565
example/fdpg-ontology/backend.zip
66-
example/fdpg-ontology/mapping.zip
66+
example/fdpg-ontology/mapping.zip
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Generate ontology
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
elastic_zip:
7+
description: "Path to the generated elastic.zip file"
8+
value: ${{ steps.save_zips.outputs.elastic_zip }}
9+
mapping_zip:
10+
description: "Path to the generated mapping.zip file"
11+
value: ${{ steps.save_zips.outputs.mapping_zip }}
12+
backend_zip:
13+
description: "Path to the generated backend.zip file"
14+
value: ${{ steps.save_zips.outputs.backend_zip }}
15+
secrets:
16+
FDPGPLUS_ONTO_SERVER_CERT:
17+
required: true
18+
FDPGPLUS_ONTO_SERVER_KEY:
19+
required: true
20+
FDPGPLUS_ONTO_SERVER_URL:
21+
required: true
22+
23+
24+
jobs:
25+
generate_ontology:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout repo
29+
uses: actions/checkout@v4
30+
31+
- name: Set locale
32+
run: |
33+
sudo apt-get update
34+
sudo apt-get install locales -y
35+
sudo locale-gen de_DE.UTF-8
36+
export LANG=de_DE.UTF-8
37+
export LANGUAGE=de_DE.UTF-8
38+
export LC_ALL=de_DE.UTF-8
39+
echo "LANG=de_DE.UTF-8" | sudo tee -a /etc/environment
40+
echo "LC_ALL=de_DE.UTF-8" | sudo tee -a /etc/environment
41+
locale -a
42+
locale
43+
44+
- name: Setup python 3 environment
45+
uses: actions/setup-python@v5
46+
with:
47+
python-version: '3.13'
48+
cache: 'pip'
49+
50+
- name: Install required python modules
51+
run: pip3 install -r requirements.txt
52+
53+
- name: Save secret to file
54+
id: certificates
55+
run: |
56+
echo "$PRIVATE_KEY" > private-key.pem
57+
echo "$SERVER_CERTIFICATE" > certificate.pem
58+
echo privateKey=$(readlink -f private-key.pem) >> "$GITHUB_OUTPUT"
59+
echo certificate=$(readlink -f certificate.pem) >> "$GITHUB_OUTPUT"
60+
env:
61+
SERVER_CERTIFICATE: ${{ secrets.FDPGPLUS_ONTO_SERVER_CERT }}
62+
PRIVATE_KEY: ${{ secrets.FDPGPLUS_ONTO_SERVER_KEY }}
63+
64+
- name: Run ontology generation
65+
env:
66+
ONTOLOGY_SERVER_ADDRESS: ${{ secrets.FDPGPLUS_ONTO_SERVER_URL }}
67+
SERVER_CERTIFICATE: ${{ steps.certificates.outputs.certificate }}
68+
PRIVATE_KEY: ${{ steps.certificates.outputs.privateKey }}
69+
run: ./generate_full_ontology.sh --all
70+
71+
- name: Save ZIP file paths
72+
id: save_zips
73+
run: |
74+
echo "elastic_zip=$(readlink -f example/fdpg-ontology/elastic.zip)" >> "$GITHUB_OUTPUT"
75+
echo "mapping_zip=$(readlink -f example/fdpg-ontology/mapping.zip)" >> "$GITHUB_OUTPUT"
76+
echo "backend_zip=$(readlink -f example/fdpg-ontology/backend.zip)" >> "$GITHUB_OUTPUT"
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Integration Test Base Setup
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
run_integration_tests:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout repo
11+
uses: actions/checkout@v4
12+
13+
- name: Set locale
14+
run: |
15+
sudo apt-get update
16+
sudo apt-get install tzdata locales -y
17+
sudo locale-gen de_DE.UTF-8
18+
sudo localectl set-locale LANG="de_DE.UTF-8"
19+
export LANG="de_DE.UTF-8"
20+
sudo update-locale
21+
locale -a
22+
locale
23+
locale -c -k LC_NUMERIC
24+
localectl status
25+
26+
- name: Setup python 3 environment
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: '3.13'
30+
cache: 'pip'
31+
32+
- name: Install required python modules
33+
run: pip3 install -r requirements.txt
34+
35+
- name: Save secret to file
36+
id: certificates
37+
run: |
38+
echo "$PRIVATE_KEY" > private-key.pem
39+
echo "$SERVER_CERTIFICATE" > certificate.pem
40+
echo privateKey=$(readlink -f private-key.pem) >> "$GITHUB_OUTPUT"
41+
echo certificate=$(readlink -f certificate.pem) >> "$GITHUB_OUTPUT"
42+
env:
43+
SERVER_CERTIFICATE: ${{ secrets.FDPGPLUS_ONTO_SERVER_CERT }}
44+
PRIVATE_KEY: ${{ secrets.FDPGPLUS_ONTO_SERVER_KEY }}
45+
46+
- name: Run ontology generation
47+
env:
48+
ONTOLOGY_SERVER_ADDRESS: ${{ secrets.FDPGPLUS_ONTO_SERVER_URL }}
49+
SERVER_CERTIFICATE: ${{ steps.certificates.outputs.certificate }}
50+
PRIVATE_KEY: ${{ steps.certificates.outputs.privateKey }}
51+
run: ./generate_full_ontology.sh --all
52+
53+
- name: Install testing pytest
54+
run: pip3 install pytest pytest-docker pytest-cov
55+
56+
- name: Run integration tests
57+
run: pytest test/integration -v --cov
58+
59+
- name: Upload Docker logs
60+
uses: actions/upload-artifact@v4
61+
if: ${{ failure() }}
62+
with:
63+
name: docker_logs
64+
path: test/integration/backend/docker_logs

.gitignore

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,26 @@ dependencies
1010
/.git/
1111
availability/*.json
1212
!availability/stratum-to-context.json
13-
14-
/.commit
15-
.commit
16-
1713
/example/code_systems_translations/*.json
1814

1915
# FSH
2016
/fsh/*
2117

18+
### Own ###
19+
# Files to edit and store commit messages
20+
/.commit
21+
.commit
22+
# Terminology translations with potentially large size
23+
/example/code_systems_translations/*.json
2224
local-onto-gen.sh
25+
# JetBrains run config export folder
26+
/.run
27+
# Directories holding temporary data which are used for example CI during runs or when testing locally
28+
/test/elastic_search/tmp/
29+
/temp/
30+
**/tmp
31+
**/temp
32+
/test/**/testdata
33+
**/.coverage
34+
# Directories holding docker logs recorded during (intergration) testing
35+
**/docker_logs/

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,46 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1313
### Fixed
1414
### Security
1515

16+
## [3.1.0] - 2025-02-13
17+
18+
| Modul | Version | Changelog |
19+
|------------------|----------------------------------------------------------------------------|--------------|
20+
| MII_DIAGNOSE | "de.medizininformatikinitiative.kerndatensatz.diagnose 2025.0.0-alpha2" | |
21+
| MII_LAB | "de.medizininformatikinitiative.kerndatensatz.laborbefund 2025.0.0-alpha1" | |
22+
| MII_MEDICATION | "de.medizininformatikinitiative.kerndatensatz.medikation 2025.0.0-alpha5" | |
23+
| MII_PERSON | "de.medizininformatikinitiative.kerndatensatz.person 2025.0.0-alpha4" | |
24+
| MII_PROCEDURE | "de.medizininformatikinitiative.kerndatensatz.prozedur 2025.0.0-alpha2" | |
25+
| MII_FALL | "de.medizininformatikinitiative.kerndatensatz.fall 2025.0.0-alpha4" | |
26+
| MII_SPECIMEN | "de.medizininformatikinitiative.kerndatensatz.biobank 2025.0.0" | |
27+
| MII_CONSENT | "de.medizininformatikinitiative.kerndatensatz.consent 1.0.7" | |
28+
| MII_ICU | "de.medizininformatikinitiative.kerndatensatz.icu 2025.0.1" | Added to DSE |
29+
| MII_MOLGEN | "de.medizininformatikinitiative.kerndatensatz.molgen 2025.0.0" | Added to DSE |
30+
| MII_RADIOLOGY | "de.medizininformatikinitiative.kerndatensatz.bildgebung 2025.0.0" | Added to DSE |
31+
| MII_ONKOLOGY | "de.medizininformatikinitiative.kerndatensatz.onkologie 2025.0.2" | Added to DSE |
32+
| MII_PATHOLOGY | "de.medizininformatikinitiative.kerndatensatz.patho 2025.0.2" | Added to DSE |
33+
| MII_MICROBIOLOGY | "de.medizininformatikinitiative.kerndatensatz.mikrobiologie 2025.0.1" | Added to DSE |
34+
| MII_STUDIES | "de.medizininformatikinitiative.kerndatensatz.studie 2025.0.0" | Added to DSE |
35+
36+
37+
### Added
38+
39+
- Added Erweiterungsmodule by @Frontman50 in https://github.com/medizininformatik-initiative/fhir-ontology-generator/pull/165
40+
- Add translations for code systems by @Frontman50 in https://github.com/medizininformatik-initiative/fhir-ontology-generator/pull/121
41+
- Make display translations searchable by @michael-82 in https://github.com/medizininformatik-initiative/fhir-ontology-generator/pull/96
42+
- Extending UI profile for display translations by @Frontman50 in https://github.com/medizininformatik-initiative/fhir-ontology-generator/pull/139
43+
- Addressed empty translation array by @Frontman50 in https://github.com/medizininformatik-initiative/fhir-ontology-generator/pull/151
44+
- Add flag to update translation files on build by @juliangruendner in https://github.com/medizininformatik-initiative/fhir-ontology-generator/pull/150
45+
- Implement type emission for time restriction in CQL mapping by @paulolaup in https://github.com/medizininformatik-initiative/fhir-ontology-generator/pull/157
46+
- blacklisting of too general value sets for filter of dse features by @juliangruendner in https://github.com/medizininformatik-initiative/fhir-ontology-generator/pull/168
47+
- create integration test base setup by @paulolaup in https://github.com/medizininformatik-initiative/fhir-ontology-generator/pull/155
48+
49+
### Fixed
50+
51+
- fix: only make leaf profile tree profiles in dse selectable @juliangruendner in https://github.com/medizininformatik-initiative/fhir-ontology-generator/pull/170
52+
- Index display.original fields in elastic search files by @michael-82 in https://github.com/medizininformatik-initiative/fhir-ontology-generator/pull/153
53+
- Fix usage of wrong hash functions for contextualized termcodes by @paulolaup in https://github.com/medizininformatik-initiative/fhir-ontology-generator/pull/160
54+
- Fix key error by @paulolaup in https://github.com/medizininformatik-initiative/fhir-ontology-generator/pull/142
55+
1656
## [3.0.1]
1757

1858
### Fixed

TerminologService/ValueSetResolver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# from dse.generate_dse_files import logger
88
from model.TreeMap import ContextualizedTermCodeInfo
99
from model.UiDataModel import TermCode
10-
from util.LoggingUtil import init_logger
10+
from util.logging.LoggingUtil import init_logger
1111
from logging import DEBUG
1212

1313
POSSIBLE_CODE_SYSTEMS = ["http://loinc.org", "http://snomed.info/sct"]

TerminologService/valueSetToRoots.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import bisect
2-
import json
31
import logging
4-
import os.path
52
from typing import List
63
import locale
74

@@ -12,7 +9,7 @@
129

1310
from TerminologService.TermServerConstants import TERMINOLOGY_SERVER_ADDRESS, SERVER_CERTIFICATE, PRIVATE_KEY, REQUESTS_SESSION
1411
from model.UiDataModel import TermCode
15-
from util.LoggingUtil import init_logger
12+
from util.logging.LoggingUtil import init_logger
1613

1714
locale.setlocale(locale.LC_ALL, 'de_DE.UTF-8')
1815
logger = init_logger("valueSetToRoots", logging.DEBUG)

combined-consent-generation.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import json
33
from model.helper import del_none
44
from model.UiDataModel import TermCode
5-
from model.MappingDataModel import FhirMapping, FixedFHIRCriteria
5+
from model.MappingDataModel import FhirMapping, FixedFHIRCriteria, CQLTimeRestrictionParameter
66
from model.MappingDataModel import CQLMapping, FixedCQLCriteria
77
from model.TreeMap import TreeMap, TermEntryNode
88
import argparse
@@ -83,7 +83,7 @@ def process_csv(csv_file: str):
8383
fhir_mapping.timeRestrictionParameter = "date"
8484
cql_mapping.key = term_code
8585
cql_mapping.context = context
86-
cql_mapping.timeRestrictionFhirPath = "Consent.datetime"
86+
cql_mapping.timeRestriction = CQLTimeRestrictionParameter("Consent.datetime", ["dateTime"])
8787
cql_mapping.resourceType = "Consent"
8888
cql_mapping.primaryCode= {
8989
"code": "57016-8",
@@ -113,12 +113,12 @@ def process_csv(csv_file: str):
113113

114114

115115
def save_json(filename: str, data):
116-
with open(filename, "w+") as f:
116+
with open(filename, "w+", encoding='UTF-8') as f:
117117
json.dump(data, f, default=lambda o: del_none(o.__dict__))
118118

119119

120120
def append_to_json(filename: str, input_filename: str, data):
121-
with open(input_filename, "r") as f:
121+
with open(input_filename, "r", encoding='UTF-8') as f:
122122
existing_data = json.load(f)
123123
existing_data.extend(data)
124124
save_json(filename, existing_data)
@@ -143,7 +143,7 @@ def generate_js_lookup_table(lookup_table: dict) -> str:
143143
save_json(f"{consent_input_dir}/consent-mappings_cql.json", consents_cql)
144144
save_json(f"{consent_input_dir}/consent-mappings-tree.json", consent_mapping_tree.to_dict())
145145

146-
with open(f"{consent_input_dir}/consent-js-lookup-table.js", "w+") as f:
146+
with open(f"{consent_input_dir}/consent-js-lookup-table.js", "w+", encoding='UTF-8') as f:
147147
f.write(generate_js_lookup_table(lookup_table))
148148

149149
if args.merge_mappings:

0 commit comments

Comments
 (0)