| @@ -1,5 +1,5 @@ | |||||
| package de.uniluebeck.mi.projmi6.model; | package de.uniluebeck.mi.projmi6.model; | ||||
| import java.io.*; | |||||
| /** | /** | ||||
| * A simple, immutable class that wraps an ICD10 code entry from the db. | * A simple, immutable class that wraps an ICD10 code entry from the db. | ||||
| */ | */ | ||||
| @@ -12,7 +12,7 @@ public class Icd10Code { | |||||
| private final int version; | private final int version; | ||||
| public Icd10Code(String icd10Code, String text, int version){ | |||||
| public Icd10Code(String icd10Code, String text, int version) { | |||||
| this.code = icd10Code; | this.code = icd10Code; | ||||
| this.text = text; | this.text = text; | ||||
| this.version = version; | this.version = version; | ||||
| @@ -32,6 +32,18 @@ public class Icd10Code { | |||||
| @Override | @Override | ||||
| public String toString() { | public String toString() { | ||||
| return code+" - "+ text; | |||||
| return code + " - " + text; | |||||
| } | } | ||||
| } | |||||
| public boolean isLastElementANumber(Icd10Code icd10code) { | |||||
| String lastElement = icd10code.getCode().substring(icd10code.getCode().length() - 1); | |||||
| boolean isNumber = false; | |||||
| char[] lastEl = lastElement.toCharArray(); | |||||
| if (Character.isDigit(lastEl[0])) { | |||||
| isNumber = true; | |||||
| } | |||||
| return isNumber; | |||||
| } | |||||
| } | |||||