CustomModelClassFactories may need to add to or overwrite (parts of) the original eventmap (ca/uhn/hl7v2/parser/eventmap/<version>.properties).
Example: IHE PDQ introduces the event QBP^ZV1 using the QBP_Q21 structure of HL7 v2.5, so this mapping needs to be added to a custom event map. The map file name must be ca/uhn/hl7v2/parser/eventmap/2.5.properties because this is hardcoded in Parser#loadMessageStructures. So, there may be several eventmaps with the same name in the classpath and the probably the wrong one is used.
Proposal: Make Parser#getMessageStructures non-static and get the eventmap resource name from the instances ModelClassFactory (defaults to ca/uhn/hl7v2/parser/eventmap/<version>.properties if the structure can't be found).
Log in to post a comment.