From 2f96c8b82237b1ad58ebf5e857d639684856efdb Mon Sep 17 00:00:00 2001 From: Paul-Christian Volkmer Date: Wed, 10 May 2023 10:15:12 +0200 Subject: Verschiebe Klasse Studie in Paket dto --- .../java/DNPM/analyzer/TherapieplanAnalyzer.java | 4 +- src/main/java/DNPM/dto/Studie.java | 91 ++++++++++++++++++++++ .../java/DNPM/services/DefaultStudienService.java | 1 + src/main/java/DNPM/services/Studie.java | 67 ---------------- src/main/java/DNPM/services/StudienService.java | 2 + 5 files changed, 96 insertions(+), 69 deletions(-) create mode 100644 src/main/java/DNPM/dto/Studie.java delete mode 100644 src/main/java/DNPM/services/Studie.java (limited to 'src/main/java') diff --git a/src/main/java/DNPM/analyzer/TherapieplanAnalyzer.java b/src/main/java/DNPM/analyzer/TherapieplanAnalyzer.java index 3024125..780a571 100644 --- a/src/main/java/DNPM/analyzer/TherapieplanAnalyzer.java +++ b/src/main/java/DNPM/analyzer/TherapieplanAnalyzer.java @@ -1,11 +1,11 @@ package DNPM.analyzer; +import DNPM.dto.Studie; import DNPM.security.DelegatingDataBasedPermissionEvaluator; import DNPM.security.PermissionType; -import DNPM.services.Studie; import DNPM.services.StudienService; -import DNPM.services.therapieplan.TherapieplanServiceFactory; import DNPM.services.mtb.MtbService; +import DNPM.services.therapieplan.TherapieplanServiceFactory; import de.itc.onkostar.api.Disease; import de.itc.onkostar.api.Procedure; import de.itc.onkostar.api.analysis.AnalyseTriggerEvent; diff --git a/src/main/java/DNPM/dto/Studie.java b/src/main/java/DNPM/dto/Studie.java new file mode 100644 index 0000000..877cdd0 --- /dev/null +++ b/src/main/java/DNPM/dto/Studie.java @@ -0,0 +1,91 @@ +/* + * MIT License + * + * 2023 Comprehensive Cancer Center Mainfranken + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package DNPM.dto; + +public class Studie { + private final String kategorieName; + private final String code; + private final String studiennummer; + private final String shortDesc; + private final String description; + private final int version; + + public Studie(final String kategorieName, final int version, final String code, final String studiennummer, final String shortDesc, final String description) { + this.kategorieName = kategorieName; + this.version = version; + this.code = code; + this.studiennummer = studiennummer; + this.shortDesc = shortDesc; + this.description = description; + } + + public String getKategorieName() { + return kategorieName; + } + + public int getVersion() { + return version; + } + + public String getCode() { + return code; + } + + public String getStudiennummer() { + return studiennummer; + } + + public String getShortDesc() { + return shortDesc; + } + + public String getDescription() { + return description; + } + + public Type getType() { + if (this.hasNctNumber()) { + return Type.NCT; + } else if (this.hasEudraCtNumber()) { + return Type.EUDRA_CT; + } else { + return Type.UNKNOWN; + } + } + + private boolean hasNctNumber() { + return null != studiennummer && studiennummer.toLowerCase().startsWith("nct"); + } + + private boolean hasEudraCtNumber() { + return null != studiennummer && studiennummer.matches("[0-9]{4}-[0-9]{6}-[0-9]{2}"); + } + + public enum Type { + NCT, + EUDRA_CT, + UNKNOWN + } +} diff --git a/src/main/java/DNPM/services/DefaultStudienService.java b/src/main/java/DNPM/services/DefaultStudienService.java index a4aa328..1f704c4 100644 --- a/src/main/java/DNPM/services/DefaultStudienService.java +++ b/src/main/java/DNPM/services/DefaultStudienService.java @@ -1,5 +1,6 @@ package DNPM.services; +import DNPM.dto.Studie; import org.springframework.jdbc.core.JdbcTemplate; import javax.sql.DataSource; diff --git a/src/main/java/DNPM/services/Studie.java b/src/main/java/DNPM/services/Studie.java deleted file mode 100644 index 2c5d5be..0000000 --- a/src/main/java/DNPM/services/Studie.java +++ /dev/null @@ -1,67 +0,0 @@ -package DNPM.services; - -public class Studie { - private final String kategorieName; - private final String code; - private final String studiennummer; - private final String shortDesc; - private final String description; - private final int version; - - public Studie(final String kategorieName, final int version, final String code, final String studiennummer, final String shortDesc, final String description) { - this.kategorieName = kategorieName; - this.version = version; - this.code = code; - this.studiennummer = studiennummer; - this.shortDesc = shortDesc; - this.description = description; - } - - public String getKategorieName() { - return kategorieName; - } - - public int getVersion() { - return version; - } - - public String getCode() { - return code; - } - - public String getStudiennummer() { - return studiennummer; - } - - public String getShortDesc() { - return shortDesc; - } - - public String getDescription() { - return description; - } - - public Type getType() { - if (this.hasNctNumber()) { - return Type.NCT; - } else if (this.hasEudraCtNumber()) { - return Type.EUDRA_CT; - } else { - return Type.UNKNOWN; - } - } - - private boolean hasNctNumber() { - return null != studiennummer && studiennummer.toLowerCase().startsWith("nct"); - } - - private boolean hasEudraCtNumber() { - return null != studiennummer && studiennummer.matches("[0-9]{4}-[0-9]{6}-[0-9]{2}"); - } - - public enum Type { - NCT, - EUDRA_CT, - UNKNOWN - } -} diff --git a/src/main/java/DNPM/services/StudienService.java b/src/main/java/DNPM/services/StudienService.java index f6245de..dc0187e 100644 --- a/src/main/java/DNPM/services/StudienService.java +++ b/src/main/java/DNPM/services/StudienService.java @@ -1,5 +1,7 @@ package DNPM.services; +import DNPM.dto.Studie; + import java.util.List; public interface StudienService { -- cgit v1.2.3