Commit ab4695c7 authored by Marco Descher's avatar Marco Descher
Browse files

[11507] Do not allow "null" as valid labitem name

parent 2152dc0d
Pipeline #5266 passed with stages
in 2 minutes and 11 seconds
MSH|^~\&|MOLIS|ZURANA|Analytica|HL7|20180611111048||ORU^R01|5574831|P|2.5|||NE|AL||8859/1|
PID||1|1^^^MOLIS^PI||Testperson^Armeswesen^^^^^L||19900510|M|||GUTSTRASSE 95^^ZUERICH^^8055|||||||
PV1||N|MUHEL||||||||||||||||3229||||||||||||||||||||||||||
ORC|SC|3291303^01|0118234867||CM||^^^^^R|||||MUHEL^^^^^^^^^^^^MOLIS~MUHEL^MUHEIM LEANDER^^^^^^CORPRESC^^^^^MOLIS~Y280631^MUHEIM LEANDER^^^^^^CORPRESC^^^^^AGRNB
OBR|1600|||1600^|||20180607105500|||||||20180607155105|||||||||||||||||||||||||||||||||
OBR|1603|||1603^|||20180607105500|||||||20180607155105|||||||||||||||||||||||||||||||||
OBX|160379|NM|FERR^Ferritin^^^FERRITIN||66|ug/l| 22 - 322||||F||||||
OBR|2800|||2800^|||20180607105500|||||||20180607155105|||||||||||||||||||||||||||||||||
OBR|2802|||2802^|||20180607105500|||||||20180607155105|||||||||||||||||||||||||||||||||
OBX|280203|NM|TSH^TSH basal^^^TSH BASAL||57.01|mU/l|0.55 - 4.78|H|||F||||||
OBX|280218|NM|FT4^Freies Thyroxin (FT4)^^^FREIES T4||5.2|pmol/l|11.5 - 22.7|L|||F||||||
\ No newline at end of file
MSH|^~\&|MOLIS|ZURANA|Analytica|HL7|20180607172018||ORU^R01|5548162|P|2.5|||NE|AL||8859/1|
PID||8545|1364451^^^MOLIS^PI||Testperson^Armeswesen^^^^^L||19900510|M|||Täfernstrasse 16^^DAETTWIL^^5405|||||||
PV1||N|BUAND||||||||||||||||8545||||||||||||||||||||||||||
ORC|SC|3291388^01|0118234870||CM||^^^^^R|||||BUAND^^^^^^^^^^^^MOLIS~BUAND^BURKHART ANDREAS^^^^^^CORPRESC^^^^^MOLIS~Y280631^BURKHART ANDREAS^^^^^^CORPRESC^^^^^AGRNB
OBR|1400|||1400^|||20180607125500|||||||20180607155124|||||||||||||||||||||||||||||||||
OBR|1403|||1403^|||20180607125500|||||||20180607155124|||||||||||||||||||||||||||||||||
OBX|140312|NM|HBA1^HbA1c^^^HBA1C||5.1|%| < 5.7||||F||||||
NTE|||Bemerkung zu HbA1c:
NTE|||Risikobereiche gemäss American Diabetes Association (ADA) 2016 Guidelines:
NTE|||Normbereich: < 5.7 %
NTE|||Erhöhtes Diabetesrisiko: 5.7 - 6.4 %
NTE|||Kriterium für Diabetesdiagnose: > 6.5 %
NTE|||Zielwerte unter Therapie gemäss American Diabetes Association (ADA) 2016 Guidelines:
NTE|||ideal : < 7.0 %
NTE|||akzeptabel : 7.0 - 8.0 %
NTE|||ungenügend : > 8.0 %
\ No newline at end of file
......@@ -109,4 +109,61 @@ public class Test_HL7_v25_Imports {
assertNull(lrd.getUnit());
assertEquals(LabResultStatus.FINAL, lrd.getResultStatus());
}
@Test
public void testLabItemName_11507() throws IOException, ElexisException{
File importFile = new File(PlatformHelper.getBasePath("ch.elexis.core.hl7.v2x.tests"),
"rsc/Analytica/HBA1.hl7");
List<HL7Reader> hl7Readers = HL7ReaderFactory.INSTANCE.getReader(importFile);
assertNotNull(hl7Readers);
assertEquals(1, hl7Readers.size());
HL7Reader reader = hl7Readers.get(0);
assertEquals(HL7ReaderV25.class, reader.getClass());
ObservationMessage observationMsg = reader.readObservation(resolver, false);
List<IValueType> observations = observationMsg.getObservations();
assertEquals(1, observations.size());
LabResultData lrd = (LabResultData) observations.get(0);
assertEquals("HbA1c", lrd.getName());
assertEquals("HBA1", lrd.getCode());
assertTrue(lrd.getValue().equals("5.1"));
assertNull(lrd.getFlag());
assertTrue(lrd.getComment().startsWith("Bemerkung zu HbA1c"));
assertEquals("< 5.7", lrd.getRange());
assertEquals("%", lrd.getUnit());
assertEquals(LabResultStatus.FINAL, lrd.getResultStatus());
}
@Test
public void testLabItemName_11507_2() throws IOException, ElexisException{
File importFile = new File(PlatformHelper.getBasePath("ch.elexis.core.hl7.v2x.tests"),
"rsc/Analytica/Ferritin.hl7");
List<HL7Reader> hl7Readers = HL7ReaderFactory.INSTANCE.getReader(importFile);
assertNotNull(hl7Readers);
assertEquals(1, hl7Readers.size());
HL7Reader reader = hl7Readers.get(0);
assertEquals(HL7ReaderV25.class, reader.getClass());
ObservationMessage observationMsg = reader.readObservation(resolver, false);
List<IValueType> observations = observationMsg.getObservations();
assertEquals(3, observations.size());
boolean found = false;
for (IValueType iValueType : observations) {
LabResultData lrd = (LabResultData) iValueType;
if ("Ferritin".equals(lrd.getName())) {
assertEquals("FERR", lrd.getCode());
assertTrue(lrd.getValue().equals("66"));
assertNull(lrd.getFlag());
assertNull(lrd.getComment());
assertEquals("ug/l", lrd.getUnit());
assertEquals("22 - 322", lrd.getRange());
assertEquals(LabResultStatus.FINAL, lrd.getResultStatus());
found = true;
}
}
assertTrue(found);
}
}
......@@ -60,7 +60,7 @@ public class HL7Helper {
public static String determineName(List<String> possibleNames){
String ret = "";
for (String possibleName : possibleNames) {
if (possibleName != null) {
if (possibleName != null && !"null".equals(possibleName)) {
int possibleNonDigitCount = getNonDigitCharacters(possibleName);
int retNonDigitCount = getNonDigitCharacters(ret);
if (possibleNonDigitCount > retNonDigitCount) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment