Skip to content

Commit

Permalink
fixed incorrect field numbers for handling MFE-4/MFE-5 varies
Browse files Browse the repository at this point in the history
  • Loading branch information
ohr committed Dec 19, 2016
1 parent 3a10ae0 commit f5859c2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 0 additions & 2 deletions hapi-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@
<version>${commons-cli.version}</version>
<optional>true</optional>
</dependency>
<!--
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.1</version>
</dependency>
-->
</dependencies>
<reporting>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions hapi-base/src/main/java/ca/uhn/hl7v2/parser/PipeParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

}
Expand Down
4 changes: 2 additions & 2 deletions hapi-base/src/main/java/ca/uhn/hl7v2/parser/XMLParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
</properties>
<body>
<release version="2.3" date="TBD">
<action type="fix" dev="Christian Ohr">
Fixed field numbers of handling MFE-4/MFE-5 varies types
</action>
<action type="fix" dev="Christian Ohr" system="newbugs" issue="241">
Consistently use longs in ID generators. Thanks to Samantha Chan for reporting.
</action>
Expand Down

0 comments on commit f5859c2

Please sign in to comment.