I am extending the MFN_M01 message as this is provided by a 3rd party to an app
that I am working on. I extended the MFN_M01 class for example:
DCS,RXD and MTN extend AbstractGroup and in a package com.mypackage.
sbs.v25.group. However, none of DCS,RXD or MTN are loaded in the custom model,
even though the custom segments are loaded when encountered by the parser. I
adopted HAPI because I wanted to replace the home grown implementation being
used but unfortunately encountering numerous issues. Casting the class to TFM
also results in a class cast exception because the message type/trigger, field
9 is MFN_M01.
public class TFM extends MFN_M01 {
public TFM(ModelClassFactory theFactory) {
super(theFactory);
init(theFactory);
}
private void init(ModelClassFactory factory) {
try {
this.add(DCS.class, true,
false);
this.add(RXD.class, true,
true,false);
this.add(MTN.class, true,
true,false);
} catch(HL7Exception e) {
log.error("Unexpected error
creating TFM", e);
}
}
Best Regards.
------------------------------------------------------------------------------
_______________________________________________
Hl7api-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hl7api-devel