mirror of
https://github.com/pcvolkmer/onkostar-plugin-dnpm.git
synced 2025-07-03 09:42:54 +00:00
Issue #54: Add common EcogService interface
This commit is contained in:
30
src/main/java/DNPM/services/TherapieMitEcogService.java
Normal file
30
src/main/java/DNPM/services/TherapieMitEcogService.java
Normal file
@ -0,0 +1,30 @@
|
||||
package DNPM.services;
|
||||
|
||||
import DNPM.dto.EcogStatusWithDate;
|
||||
import de.itc.onkostar.api.Patient;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* Schnittstelle zum Ermitteln von ECOG-Statusinformationen
|
||||
*
|
||||
* @since 0.6.0
|
||||
*/
|
||||
public interface TherapieMitEcogService {
|
||||
|
||||
/**
|
||||
* Ermittelt den letzten bekannten ECOG-Status aus allen Therapieformularen des Patienten
|
||||
* @param patient Der zu verwendende Patient
|
||||
* @return Der ECOG-Status als String oder leeres Optional
|
||||
*/
|
||||
Optional<String> latestEcogStatus(Patient patient);
|
||||
|
||||
/**
|
||||
* Ermittelt jeden bekannten ECOG-Status aus allen Therapieformularen des Patienten
|
||||
* @param patient Der zu verwendende Patient
|
||||
* @return Eine Liste mit Datum und ECOG-Status als String
|
||||
*/
|
||||
List<EcogStatusWithDate> ecogStatus(Patient patient);
|
||||
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package DNPM.services.strahlentherapie;
|
||||
|
||||
import DNPM.dto.EcogStatusWithDate;
|
||||
import DNPM.services.SettingsService;
|
||||
import de.itc.onkostar.api.IOnkostarApi;
|
||||
import de.itc.onkostar.api.Patient;
|
||||
|
@ -1,70 +1,10 @@
|
||||
package DNPM.services.strahlentherapie;
|
||||
|
||||
import de.itc.onkostar.api.Patient;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import DNPM.services.TherapieMitEcogService;
|
||||
|
||||
/**
|
||||
* Service für Systemtherapieformulare
|
||||
*
|
||||
* @since 0.6.0
|
||||
*/
|
||||
public interface StrahlentherapieService {
|
||||
|
||||
/**
|
||||
* Ermittelt den letzten bekannten ECOG-Status aus allen Systemtherapieformularen des Patienten
|
||||
* @param patient Der zu verwendende Patient
|
||||
* @return Der ECOG-Status als String oder leeres Optional
|
||||
*/
|
||||
Optional<String> latestEcogStatus(Patient patient);
|
||||
|
||||
/**
|
||||
* Ermittelt jeden bekannten ECOG-Status aus allen Strahlentherapieformularen des Patienten
|
||||
* @param patient Der zu verwendende Patient
|
||||
* @return Eine Liste mit Datum und ECOG-Status als String
|
||||
*/
|
||||
List<EcogStatusWithDate> ecogStatus(Patient patient);
|
||||
|
||||
/**
|
||||
* Datenklasse zum Abbilden des ECOG-Status und Datum
|
||||
*/
|
||||
class EcogStatusWithDate {
|
||||
private Date date;
|
||||
private String status;
|
||||
|
||||
public EcogStatusWithDate(Date date, String status) {
|
||||
Assert.notNull(date, "Date cannot be null");
|
||||
Assert.hasText(status, "Status cannot be empty String");
|
||||
Assert.isTrue(isValidEcogCode(status), "Not a valid ADT.LeistungszustandECOG code");
|
||||
this.date = date;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
private boolean isValidEcogCode(String status) {
|
||||
switch (status) {
|
||||
case "0":
|
||||
case "1":
|
||||
case "2":
|
||||
case "3":
|
||||
case "4":
|
||||
case "5":
|
||||
case "U":
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public Date getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public interface StrahlentherapieService extends TherapieMitEcogService {}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package DNPM.services.systemtherapie;
|
||||
|
||||
import DNPM.dto.EcogStatusWithDate;
|
||||
import DNPM.services.SettingsService;
|
||||
import de.itc.onkostar.api.IOnkostarApi;
|
||||
import de.itc.onkostar.api.Patient;
|
||||
|
@ -1,20 +1,17 @@
|
||||
package DNPM.services.systemtherapie;
|
||||
|
||||
import de.itc.onkostar.api.Patient;
|
||||
import DNPM.services.TherapieMitEcogService;
|
||||
import de.itc.onkostar.api.Procedure;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* Service für Systemtherapieformulare
|
||||
*
|
||||
* @since 0.2.0
|
||||
*/
|
||||
public interface SystemtherapieService {
|
||||
public interface SystemtherapieService extends TherapieMitEcogService {
|
||||
/**
|
||||
* Ermittelt eine Zusammenfassung der systemischen Therapien für eine Erkrankung
|
||||
* @param diseaseId Die ID der Erkrankung
|
||||
@ -29,57 +26,4 @@ public interface SystemtherapieService {
|
||||
*/
|
||||
ProzedurToProzedurwerteMapper prozedurToProzedurwerteMapper(Procedure procedure);
|
||||
|
||||
/**
|
||||
* Ermittelt den letzten bekannten ECOG-Status aus allen Systemtherapieformularen des Patienten
|
||||
* @param patient Der zu verwendende Patient
|
||||
* @return Der ECOG-Status als String oder leeres Optional
|
||||
*/
|
||||
Optional<String> latestEcogStatus(Patient patient);
|
||||
|
||||
/**
|
||||
* Ermittelt jeden bekannten ECOG-Status aus allen Systemtherapieformularen des Patienten
|
||||
* @param patient Der zu verwendende Patient
|
||||
* @return Eine Liste mit Datum und ECOG-Status als String
|
||||
*/
|
||||
List<EcogStatusWithDate> ecogStatus(Patient patient);
|
||||
|
||||
/**
|
||||
* Datenklasse zum Abbilden des ECOG-Status und Datum
|
||||
*/
|
||||
class EcogStatusWithDate {
|
||||
private Date date;
|
||||
private String status;
|
||||
|
||||
public EcogStatusWithDate(Date date, String status) {
|
||||
Assert.notNull(date, "Date cannot be null");
|
||||
Assert.hasText(status, "Status cannot be empty String");
|
||||
Assert.isTrue(isValidEcogCode(status), "Not a valid ADT.LeistungszustandECOG code");
|
||||
this.date = date;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
private boolean isValidEcogCode(String status) {
|
||||
switch (status) {
|
||||
case "0":
|
||||
case "1":
|
||||
case "2":
|
||||
case "3":
|
||||
case "4":
|
||||
case "5":
|
||||
case "U":
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public Date getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user