HAPI Prevent MessageIDGenerator (used to generate message control IDs for ACK messages, for example in SimpleServer) from throwing an exception if it is not able to parse the value found in id_file. Previously if something went wrong and this file was blank, a hard to debug exception was thrown. Now, control ID sequencing is simply reset to zero. Thanks to an anonymous bug submittor. Fix an issue where inserting/removing a repetition of the very last field in a segment fails due to an incorrect range check in AbstractSegment. Thanks Rodolfo for submitting! Where multiple structures are marked as associated with the same trigger event (example: ORN_O02 and ORR_O02 are both indicated as matching trigger ORR^O02) the parser will favour the structure whose name matches the event type and trigger (ORR_O02 in the previous example) when parsing a message with no structure explicitly defined in MSH-9-3. Fix an issue where subcomponents within a Varies (OBX-5) value are incorrectly handled. For example, if OBX-2 specifies a composite type, and the first component is also a composite, the first subcomponent (represented by the text F1C2 below) would be lost. OBX||AD|||F1C1&F1C2^F2C1 ]]> Correct a PipeParser parsing issue: When a message is being parsed which contains multiple unexpected segments, any unexpected segments after the first one may appear out of order if the message is re-encoded. When encoding a group using the PipeParser where the first segment is required, but no data has been populated in that segment, the empty segment is now still encoded if needed as a blank segment in order to give parsers a hint about which group further segments are in. For example, in an ORU^R01 message with a populated OBX segment, but no data in the mandatory OBR segment which begins the ORDER_OBSERVATION group (see reference]]>), the message would still contain an empty OBR segment when encoded: MSH|^~\&|REG|W|||201103230042||ORU^R01|32153168|P|2.5 OBR| OBX||ST|||Value Data ]]> Previously, the following encoding would have occurred, which would have incorrectly been parsed as having a custom OBX segment instead of having a normal ORDER_OBSERVATION group: MSH|^~\&|REG|W|||201103230042||ORU^R01|32153168|P|2.5 OBX||ST|||Value Data ]]> HAPI libraries are now available in the Maven Central Repo. Thanks to Francis De Brabandere for figuring out how to make this happen! (Regression in 1.0-beta1) Some structures contained incorrect version information which led to inability to parse Z segments Message types now have a convenience method initQuickstart which sets default values to MSH segment (field separator, message type, etc) HAPI now has a Maven plugin which generates Message/Group/Segment struxctures based on an HL7 conformance profile. See the conformance]]> page for more information. Allow users of HAPI SimpleServer to create an Application that handles errors. The provided patch adds an interface, which should be implemented by exception aware Applications. The application can then re-dispatch the provided ACK, or a create a completely new message. Correct XML encoding of OMD_O03. (OMD_O03.DIET was incorrectly being encoded simply as "DIE") Correct the spelling of the name TIMING in a number of group structures (e.g. OML_O21_TIMING which was previously OML_O21_TIIMING) Update structure classes source generator to use an Apache Velocity based template instead of simple hard-coded string concatenation. This will make it much easier to add new features to the structures in the future. Message now has a method Message#printStructure()]]>, which returns a useful String for debugging containing a description of the entire structure of the message GenericParser ignores custom ModelClassFactory implementations passed into its constructor. Thanks to John R for reporting. XML parser now parses subsequent datatype components correctly when a component is missing. E.g. if ED.1 is missing but ED.2 is present: Previously, ED.2 would be parsed as ED.1. Parsing OBX-5 failed when value (as indicated by OBX-2) was a type which requires a table number (IS or ID). HAPI now defaults to table 0. Parsing OBX-5 failed when value (as indicated by OBX-2) was a type which requires a table number (IS or ID). HAPI now defaults to table 0. Add check to ConnectionHub to avoid returning a connection which was explicitly closed. Also update "send and receive" example in documentation to show correct way of discarding a connection using ConnectionHub. HAPI now logs the current version as it is being initialized, for troubleshooting purposes. Add getters and setters to DT, TM, and TS data types to get and set values using standard Java Date and Calendar objects. (Examples here and here]]>) Add factory method]]> to PipeParser which returns an instance with validation disabled (useful for one-liner parse routines) Add system property]]> to allow OBX-2 to contain invalid values and still parse Correct an issue where a NullPointerException occurs if a mandatory segment at the end of a message is not present Correct regression introduced in 1.0-beta1 where a second segment within a group with the same name (i.e. the two PID segments in an ADT^A17) fails to parse correctly. Provide default implementation of new abstract method "createNewTypeWithoutReflection" on AbstractSegment class to prevent breaking existing user defined types. Thanks to Christian Ohr for reporting. Clean up logging in ServerSocketStreamSource (used by HL7Server) so that it doesn't spew unneccesary logs while waiting for a connection Remove all test suites (not tests, just the suites), as they cause maven to execute tests twice, and clean up test execution. Full test suie execution is down to ~90 seconds from 10 mins. CanonicalModelClassFactory (always returns the same version), and CustomModelClassFactory (provides easy way to use custom structure packages)]]> Fix a bug where formatting escape sequences were stripped from messages (i.e. leave sequences such as /.br/ alone) Overhaul Escape class (handles HL7 escape sequences) to dramatically improve performance Fix NullPointerException in DefaultValidator when no table present for an ID datatype Allow parsing of unknown message types for 2.5.1 and 2.6 messages Convert HAPI source version JDK 5.0. This allows the use (and begins a gradual conversion) to generics by HAPI's internal structures. Support for JDK1.4 will still remain through version specific JARs produced by RetroTranslator. Add getNames() method to Segment, to allow programatic access to segment's field names (needed by hUnit) Fix serialization of HAPI Message objects. Also added serialVersionUID to a number of core classes. Fix a memory leak in Escape.java when lots of different encoding chars are used Modify ProcessorImpl (HL7Server processing class) to use an ExecutorService instead of spawning a new thread for each message to generate ACKs. Fix XML parsing of seg groups containing more than one instance of the same segment (e.g. A17) Add constructors to all parser types allowing a custom model factory Fix XML parsing of seg groups containing more than one instance of the same segment (e.g. A17) Added isRunning() method to SimpleServer Add NULLDT datatype, to be used in withdrawn fields. Note that default validation expects this datatype to be empty, but custom validation does not need to enforce this. Add setEncoding method to XmlParser to allow text encoding to be specified when creating XML messages. In response to mailing list query from Fernando Ramírez Sánchez Add single argument constructor to ID datatype, to allow it to be used in OBX-5 New HAPI maven repository now available at http://hl7api.sourceforge.net/m2/ Make PipeParser not crash on empty segments (meaning segments with just a segment name, no field separator or fields) NullPointerException if OBX-2 is invalid and OBX-5 is set Parsing fails when (pipe) is used as non-field separator Allow Parser to accept a null ValidationContext, which will prevent any attempt at validating messages from being made. Allow Parsers now get their default validation context from ValidationContextFactory if none is supplied Allow A new system property (See Varies JavaDoc) may be specified to supply a default datatype to be assumed for OBX-5 if none is found in OBX-2. A missing OBX-2 is not a valid case, but this property would allow a user to work around problems receiving from a bad message source Remove JDK 5 dependency hapi 0.4.3 Class Parser : Multi-threading conflict can occur Unescaping in XMLParser.getCriticalResponseData() PipeParser.getCriticalResponseData() does not use version NullPointerException on garbage messages Class ExtraComponents not Serializable "I" instead of "PID" freezes the parser validation contexts are not used during parsing Error generating error responses for XML messages SIU S12 Segment Issue DFT-P03 - incorrect message structure NM integer magnitude limited to java int ORU_R01_OBSERVATION incorrectly defined OBX-5 type assignment only operates on first rep Missing Code in Version 2.5 ORL_O34 message incorrectly defined