1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
package DNPM.dto;
import de.itc.onkostar.api.Procedure;
import java.util.Optional;
public class Variant {
private final Integer id;
private final String shortDescription;
private Variant(
final int id,
final String shortDescription
) {
this.id = id;
this.shortDescription = shortDescription.trim();
}
public Integer getId() {
return id;
}
public String getShortDescription() {
return shortDescription;
}
public static Optional<Variant> fromProcedure(Procedure procedure) {
if (! "OS.Molekulargenetische Untersuchung".equals(procedure.getFormName())) {
return Optional.empty();
}
var ergebnis = procedure.getValue("Ergebnis");
var gene = procedure.getValue("Untersucht");
var exon = procedure.getValue("ExonInt");
var pathogenitaetsklasse = procedure.getValue("Pathogenitaetsklasse");
if (null == gene) {
return Optional.empty();
}
if (ergebnis.getString().equals("P")) {
return Optional.of(
new Variant(
procedure.getId(),
String.format("Einfache Variante: %s, %s, %s", gene.getString(), exon.getString(), pathogenitaetsklasse.getString())
)
);
} else if (ergebnis.getString().equals("CNV")) {
return Optional.of(
new Variant(
procedure.getId(),
String.format("Copy Number Variation: %s, %s, %s", gene.getString(), exon.getString(), pathogenitaetsklasse.getString())
)
);
} else if (ergebnis.getString().equals("F")) {
return Optional.of(
new Variant(
procedure.getId(),
String.format("Fusion: %s, %s, %s", gene.getString(), exon.getString(), pathogenitaetsklasse.getString())
)
);
} else {
return Optional.empty();
}
}
}
|