From b4a6ec7277c869d90662164b3af32c84d773053c Mon Sep 17 00:00:00 2001 From: chgl Date: Mon, 12 Aug 2024 19:54:51 +0200 Subject: [PATCH 1/6] chore(config): drop deprecated SQL_SQL_LINT from disabled linters fixes v8r complaint --- .mega-linter.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.mega-linter.yml b/.mega-linter.yml index 3bf9e5e7..a8c02060 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -20,7 +20,6 @@ DISABLE_LINTERS: - REPOSITORY_DUSTILOCK - SQL_TSQLLINT - MARKDOWN_MARKDOWN_TABLE_FORMATTER - - SQL_SQL_LINT # Oracle Syntax is not supported GROOVY_NPM_GROOVY_LINT_ARGUMENTS: - "--failon=warning" From 8d9722a72ead05d054d19a0f81f5bc180cd87b93 Mon Sep 17 00:00:00 2001 From: chgl Date: Tue, 13 Aug 2024 11:58:20 +0200 Subject: [PATCH 2/6] docs: added scorecard and slsa badges --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 71c40ea1..5695d056 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # obds-to-fhir +[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/bzkf/obds-to-fhir/badge)](https://scorecard.dev/viewer/?uri=github.com/bzkf/obds-to-fhir) +[![SLSA 3](https://slsa.dev/images/gh-badge-level3.svg)](https://slsa.dev) + This project contains a Kafka Stream processor that creates FHIR resources from Onkostar oBDS-XML data and writes them to a FHIR Topic. ## Used FHIR profiles From 6435b064d5c64866cb7fe8cf543455bfc1e61960 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 13 Aug 2024 12:55:13 +0000 Subject: [PATCH 3/6] chore(release): 2.1.3 [skip ci] ## [2.1.3](https://github.com/bzkf/obds-to-fhir/compare/v2.1.2...v2.1.3) (2024-08-13) ### Miscellaneous Chores * **config:** drop deprecated SQL_SQL_LINT from disabled linters ([b4a6ec7](https://github.com/bzkf/obds-to-fhir/commit/b4a6ec7277c869d90662164b3af32c84d773053c)) ### Documentation * added scorecard and slsa badges ([8d9722a](https://github.com/bzkf/obds-to-fhir/commit/8d9722a72ead05d054d19a0f81f5bc180cd87b93)) --- build.gradle | 2 +- src/main/resources/application.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 5edf79ed..f09e33a8 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ plugins { } group = 'org.miracum.streams.ume' -version = '2.1.2' +version = '2.1.3' sourceCompatibility = '21' targetCompatibility = '21' diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index e9dc91d9..3ddb7c79 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,5 +1,5 @@ app: - version: 2.1.2 + version: 2.1.3 enableCheckDigitConv: ${CHECK_DIGIT_CONVERSION:false} fhir: From 76e18ec021b94485569241c22e6d1f8e67de7ad2 Mon Sep 17 00:00:00 2001 From: chgl Date: Tue, 13 Aug 2024 15:05:02 +0200 Subject: [PATCH 4/6] chore(config): dont release on refactor and only on deps chore (#68) --- .releaserc.json | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.releaserc.json b/.releaserc.json index 7c934b22..30e02001 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -7,14 +7,7 @@ "releaseRules": [ { "type": "chore", - "release": "patch" - }, - { - "type": "refactor", - "release": "patch" - }, - { - "type": "style", + "scope": "deps", "release": "patch" }, { From 343c5e386b975c7f6a1a582d194b8f41eeb8934e Mon Sep 17 00:00:00 2001 From: chgl Date: Thu, 15 Aug 2024 13:57:24 +0000 Subject: [PATCH 5/6] docs: added SECURITY.md --- SECURITY.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..e43399d1 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,10 @@ +# Security Policy + +## Supported Versions + +Only the most recent major version is regularly updated and receives security fixes. + +## Reporting a Vulnerability + +Please use the project's [private vulnerability reporting feature](https://github.com/bzkf/obds-to-fhir/security/advisories) +to report any vulnerabilities. For more information, see From 22165f33991e50069ba920d3b771db3c5b64e11f Mon Sep 17 00:00:00 2001 From: Paul-Christian Volkmer Date: Fri, 16 Aug 2024 12:34:58 +0200 Subject: [PATCH 6/6] refactor: some minor code cleanup (#77) * use .getFirst() instead of .get(0) * use of ifPresent(..) * simplify if conditions --- .../ume/obdstofhir/mapper/ObdsConditionMapper.java | 11 +++++------ .../mapper/ObdsMedicationStatementMapper.java | 2 +- .../ume/obdstofhir/mapper/ObdsPatientMapper.java | 2 +- .../ume/obdstofhir/mapper/ObdsProcedureMapper.java | 2 +- .../ume/obdstofhir/processor/ObdsProcessor.java | 4 ++-- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsConditionMapper.java b/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsConditionMapper.java index 9a4f9770..835df85d 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsConditionMapper.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsConditionMapper.java @@ -48,7 +48,7 @@ public Bundle mapOnkoResourcesToCondition( } // get first element of meldungExportList - var meldungExport = meldungExportList.get(0); + var meldungExport = meldungExportList.getFirst(); LOG.debug( "Mapping Meldung {} to {}", getReportingIdFromAdt(meldungExport), ResourceType.Condition); @@ -173,10 +173,9 @@ public Bundle mapOnkoResourcesToCondition( fhirProperties.getSystems().getIdentifierType(), "MR", null))) .setValue(pid))); - var conditionDateString = primDia.getDiagnosedatum(); - if (conditionDateString.isPresent()) { - onkoCondition.setOnset(convertObdsDateToDateTimeType(conditionDateString.get())); - } + primDia + .getDiagnosedatum() + .ifPresent(value -> onkoCondition.setOnset(convertObdsDateToDateTimeType(value))); var stageBackBoneComponentList = new ArrayList(); var evidenceBackBoneComponentList = new ArrayList(); @@ -199,7 +198,7 @@ public Bundle mapOnkoResourcesToCondition( stageBackBoneComponentList.add(conditionStageComponent); } } else { - var profile = obsEntry.getResource().getMeta().getProfile().get(0).getValue(); + var profile = obsEntry.getResource().getMeta().getProfile().getFirst().getValue(); if (profile.equals(fhirProperties.getProfiles().getHistologie())) { // || profile.equals(fhirProperties.getProfiles().getGenVariante())) { Genetische // Variante diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsMedicationStatementMapper.java b/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsMedicationStatementMapper.java index 5ad1b690..272d6643 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsMedicationStatementMapper.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsMedicationStatementMapper.java @@ -45,7 +45,7 @@ public Bundle mapOnkoResourcesToMedicationStatement(List meldungE var bundle = new Bundle(); // get first element of meldungExportList - var meldungExport = meldungExportList.get(0); + var meldungExport = meldungExportList.getFirst(); LOG.debug( "Mapping Meldung {} to {}", diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsPatientMapper.java b/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsPatientMapper.java index 8b3e2436..9f1dd434 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsPatientMapper.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsPatientMapper.java @@ -164,7 +164,7 @@ public Bundle mapOnkoResourcesToPatient(List meldungExportList) { } // address - var patAddess = patData.getMenge_Adresse().getAdresse().get(0); + var patAddess = patData.getMenge_Adresse().getAdresse().getFirst(); if (StringUtils.hasLength(patAddess.getPatienten_PLZ())) { var address = new Address(); address.setPostalCode(patAddess.getPatienten_PLZ()).setType(Address.AddressType.BOTH); diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsProcedureMapper.java b/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsProcedureMapper.java index ca137aff..025d8b20 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsProcedureMapper.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/mapper/ObdsProcedureMapper.java @@ -303,7 +303,7 @@ public Procedure createOpProcedure( // Complication if (op.getMenge_Komplikation() != null && op.getMenge_Komplikation().getOP_Komplikation() != null - && op.getMenge_Komplikation().getOP_Komplikation().size() > 0) { + && !op.getMenge_Komplikation().getOP_Komplikation().isEmpty()) { var complicationConcept = new CodeableConcept(); for (var complication : op.getMenge_Komplikation().getOP_Komplikation()) { complicationConcept.addCoding( diff --git a/src/main/java/org/miracum/streams/ume/obdstofhir/processor/ObdsProcessor.java b/src/main/java/org/miracum/streams/ume/obdstofhir/processor/ObdsProcessor.java index b13a423a..1ed3c07d 100644 --- a/src/main/java/org/miracum/streams/ume/obdstofhir/processor/ObdsProcessor.java +++ b/src/main/java/org/miracum/streams/ume/obdstofhir/processor/ObdsProcessor.java @@ -204,11 +204,11 @@ public ValueMapper, Bundle> getOnkoToConditionBu private static String patientBundleKeySelector(Bundle bundle) { var patients = BundleUtil.toListOfResourcesOfType(ctx, bundle, Patient.class); - if (patients.isEmpty() || patients.size() > 1) { + if (patients.size() != 1) { throw new RuntimeException( String.format("A patient bundle contains %d resources instead of 1", patients.size())); } - var patient = patients.get(0); + var patient = patients.getFirst(); return String.format("%s/%s", patient.getResourceType(), patient.getId()); } }