diff --git a/hapi-base/pom.xml b/hapi-base/pom.xml
index 20cdcafa4..ccf1dc7d5 100644
--- a/hapi-base/pom.xml
+++ b/hapi-base/pom.xml
@@ -40,13 +40,11 @@
${commons-cli.version}
true
-
diff --git a/hapi-base/src/main/java/ca/uhn/hl7v2/parser/FixFieldDataType.java b/hapi-base/src/main/java/ca/uhn/hl7v2/parser/FixFieldDataType.java
index c3db2fedf..3f45d0460 100644
--- a/hapi-base/src/main/java/ca/uhn/hl7v2/parser/FixFieldDataType.java
+++ b/hapi-base/src/main/java/ca/uhn/hl7v2/parser/FixFieldDataType.java
@@ -123,13 +123,13 @@ public static void fixOBX5(Segment segment, ModelClassFactory factory, ParserCon
fix(segment, 2, 5, defaultOBX2Type, invalidOBX2Type, factory, parserConfiguration);
}
- public static void fixMFE3(Segment segment, ModelClassFactory factory, ParserConfiguration parserConfiguration)
+ public static void fixMFE4(Segment segment, ModelClassFactory factory, ParserConfiguration parserConfiguration)
throws HL7Exception {
if (!(segment.getName().contains("MFE")) &&
Version.versionOf(segment.getMessage().getVersion()).isGreaterThan(Version.V23)) {
throw new IllegalArgumentException("Expected MFE segment, but was: " + segment.getName());
}
- fix(segment, 4, 3, null, null, factory, parserConfiguration);
+ fix(segment, 5, 4, null, null, factory, parserConfiguration);
}
/**
diff --git a/hapi-base/src/main/java/ca/uhn/hl7v2/parser/PipeParser.java b/hapi-base/src/main/java/ca/uhn/hl7v2/parser/PipeParser.java
index 61ae59ada..e46dca1cc 100644
--- a/hapi-base/src/main/java/ca/uhn/hl7v2/parser/PipeParser.java
+++ b/hapi-base/src/main/java/ca/uhn/hl7v2/parser/PipeParser.java
@@ -400,10 +400,10 @@ public void parse(Segment destination, String segment, EncodingCharacters encodi
if (destination.getClass().getName().contains("OBX")) {
FixFieldDataType.fixOBX5(destination, getFactory(), getHapiContext().getParserConfiguration());
}
- // set data type of MFE-3
+ // set data type of MFE-4
if (destination.getClass().getName().contains("MFE") &&
Version.versionOf(destination.getMessage().getVersion()).isGreaterThan(Version.V23)) {
- FixFieldDataType.fixMFE3(destination, getFactory(), getHapiContext().getParserConfiguration());
+ FixFieldDataType.fixMFE4(destination, getFactory(), getHapiContext().getParserConfiguration());
}
}
diff --git a/hapi-base/src/main/java/ca/uhn/hl7v2/parser/XMLParser.java b/hapi-base/src/main/java/ca/uhn/hl7v2/parser/XMLParser.java
index 9807ae3c5..055b75d32 100644
--- a/hapi-base/src/main/java/ca/uhn/hl7v2/parser/XMLParser.java
+++ b/hapi-base/src/main/java/ca/uhn/hl7v2/parser/XMLParser.java
@@ -308,10 +308,10 @@ public void parse(Segment segmentObject, Element segmentElement) throws HL7Excep
if (segmentObject.getClass().getName().contains("OBX")) {
FixFieldDataType.fixOBX5(segmentObject, getFactory(), getHapiContext().getParserConfiguration());
}
- // set data type of MFE-3
+ // set data type of MFE-4
if (segmentObject.getClass().getName().contains("MFE") &&
Version.versionOf(segmentObject.getMessage().getVersion()).isGreaterThan(Version.V23)) {
- FixFieldDataType.fixMFE3(segmentObject, getFactory(), getHapiContext().getParserConfiguration());
+ FixFieldDataType.fixMFE4(segmentObject, getFactory(), getHapiContext().getParserConfiguration());
}
}
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index c05e577b5..853a9a26c 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -6,6 +6,9 @@
+
+ Fixed field numbers of handling MFE-4/MFE-5 varies types
+
Consistently use longs in ID generators. Thanks to Samantha Chan for reporting.