Skip to content

Commit

Permalink
refactor: replace assignment with field declaration (#65)
Browse files Browse the repository at this point in the history
* refactor: replace assignment with field declaration

This also removes obsolete constructor.

* refactor: rename lookup methods

This should remove a detailed description of the
lookup in the method name which is also contained in
the class name.
  • Loading branch information
pcvolkmer authored Aug 13, 2024
1 parent 89070f4 commit 46c1808
Show file tree
Hide file tree
Showing 17 changed files with 295 additions and 364 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,19 @@

public class BeurteilungResidualstatusVsLookup {

private final HashMap<String, String> lookup;
private static final HashMap<String, String> lookup =
new HashMap<>() {
{
put("RX", "Vorhandensein von Residualtumor kann nicht beurteilt werden");
put("R0", "kein Residualtumor");
put("R1", "Mikroskopischer Residualtumor");
put("R1(is)", "In-Situ-Rest");
put("R1(cy+)", "Cytologischer Rest");
put("R2", "Makroskopischer Residualtumor");
}
};

public BeurteilungResidualstatusVsLookup() {
lookup =
new HashMap<>() {
{
put("RX", "Vorhandensein von Residualtumor kann nicht beurteilt werden");
put("R0", "kein Residualtumor");
put("R1", "Mikroskopischer Residualtumor");
put("R1(is)", "In-Situ-Rest");
put("R1(cy+)", "Cytologischer Rest");
put("R2", "Makroskopischer Residualtumor");
}
};
}

public final String lookupBeurteilungResidualstatusDisplay(String code) {
public final String lookupDisplay(String code) {
return lookup.get(code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,21 @@
import java.util.HashMap;

public class DisplayAdtSeitenlokalisationLookup {
private final HashMap<String, String> lookup;
private static final HashMap<String, String> lookup =
new HashMap<>() {
{
put("L", "links");
put("R", "rechts");
put("B", "beidseitig (sollte bei bestimmten Tumoren 2 Meldungen ergeben)");
put("M", "Mittellinie/Mittig");
put(
"T",
"trifft nicht zu (Seitenangabe nicht sinnvoll, einschließlich Systemerkrankungen)");
put("U", "unbekannt");
}
};

public DisplayAdtSeitenlokalisationLookup() {
lookup =
new HashMap<>() {
{
put("L", "links");
put("R", "rechts");
put("B", "beidseitig (sollte bei bestimmten Tumoren 2 Meldungen ergeben)");
put("M", "Mittellinie/Mittig");
put(
"T",
"trifft nicht zu (Seitenangabe nicht sinnvoll, einschließlich Systemerkrankungen)");
put("U", "unbekannt");
}
};
}

public final String lookupAdtSeitenlokalisationDisplay(String code) {
public final String lookupDisplay(String code) {
return lookup.get(code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,25 @@
import java.util.HashMap;

public class FMLokalisationVsLookup {
private final HashMap<String, String> lookup;
private static final HashMap<String, String> lookup =
new HashMap<>() {
{
put("PUL", "Lunge");
put("OSS", "Knochen");
put("HEP", "Leber");
put("BRA", "Hirn");
put("LYM", "Lymphknoten");
put("MAR", "Knochenmark");
put("PLE", "Pleura");
put("PER", "Peritoneum");
put("ADR", "Nebennieren");
put("SKI", "Haut");
put("OTH", "Andere Organe");
put("GEN", "Generalisierte Metastasierung");
}
};

public FMLokalisationVsLookup() {
lookup =
new HashMap<>() {
{
put("PUL", "Lunge");
put("OSS", "Knochen");
put("HEP", "Leber");
put("BRA", "Hirn");
put("LYM", "Lymphknoten");
put("MAR", "Knochenmark");
put("PLE", "Pleura");
put("PER", "Peritoneum");
put("ADR", "Nebennieren");
put("SKI", "Haut");
put("OTH", "Andere Organe");
put("GEN", "Generalisierte Metastasierung");
}
};
}

public final String lookupFMLokalisationVSDisplay(String code) {
public final String lookupDisplay(String code) {
return lookup.get(code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,25 @@

public class GradingLookup {

private final HashMap<String, String> lookup;
private static final HashMap<String, String> lookup =
new HashMap<>() {
{
put("0", "malignes Melanom der Konjunktiva");
put("1", "gut differenziert");
put("2", "mäßig differenziert");
put("3", "schlecht differenziert");
put("4", "undifferenziert");
put("X", "nicht bestimmbar");
put("L", "low grade (G1 oder G2)");
put("M", "intermediate (G2 oder G3)");
put("H", "high grade (G3 oder G4)");
put("B", "Borderline");
put("U", "unbekannt");
put("T", "trifft nicht zu");
}
};

public GradingLookup() {
lookup =
new HashMap<>() {
{
put("0", "malignes Melanom der Konjunktiva");
put("1", "gut differenziert");
put("2", "mäßig differenziert");
put("3", "schlecht differenziert");
put("4", "undifferenziert");
put("X", "nicht bestimmbar");
put("L", "low grade (G1 oder G2)");
put("M", "intermediate (G2 oder G3)");
put("H", "high grade (G3 oder G4)");
put("B", "Borderline");
put("U", "unbekannt");
put("T", "trifft nicht zu");
}
};
}

public final String lookupGradingDisplay(String code) {
public final String lookupDisplay(String code) {
return lookup.get(code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@
import java.util.HashMap;

public class JnuVsLookup {
private final HashMap<String, String> lookup;
private static final HashMap<String, String> lookup =
new HashMap<>() {
{
put("J", "Ja");
put("N", "Nein");
put("U", "unbekannt");
}
};

public JnuVsLookup() {
lookup =
new HashMap<>() {
{
put("J", "Ja");
put("N", "Nein");
put("U", "unbekannt");
}
};
}

public final String lookupJnuDisplay(String code) {
public final String lookupDisplay(String code) {
return lookup.get(code);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,19 @@

public class OPIntentionVsLookup {

private final HashMap<String, String> lookup;
private static final HashMap<String, String> lookup =
new HashMap<>() {
{
put("K", "kurativ");
put("P", "palliativ");
put("D", "diagnostisch");
put("R", "Revision/Komplikation");
put("S", "sonstiges");
put("X", "Fehlende Angabe");
}
};

public OPIntentionVsLookup() {
lookup =
new HashMap<>() {
{
put("K", "kurativ");
put("P", "palliativ");
put("D", "diagnostisch");
put("R", "Revision/Komplikation");
put("S", "sonstiges");
put("X", "Fehlende Angabe");
}
};
}

public final String lookupOPIntentionVSDisplay(String code) {
public final String lookupDisplay(String code) {
return lookup.get(code);
}
}
Loading

0 comments on commit 46c1808

Please sign in to comment.