I am currently trying to update a message processor that parses MFNs from HAPI 
2.2 to HAPI 2.3

The sender does not fill out the MFE-5, and the 2.2 version was able to parse 
the message without the MFE-5. This is not the case with HAPI 2.3

In a hopeful attempt I set the InvalidObx2Type and DefaultObx2Type on the 
parser, wondering if it would be generic, but to no avail.

This is my test case, filling out fields that the sending system normally 
sends, and yes, there are very few. Other trigger events are sent, all are 
missing the MFE-5.


@Test
public void TestMFN_M03() throws HL7Exception {

    ModelClassFactory cmf = new 
CustomModelClassFactory("au.gov.qld.health.sit.hl7");
    MFN_M02 mfnM02 = new MFN_M02(cmf);
    mfnM02.getParser().getParserConfiguration().setValidating(false);
    mfnM02.getParser().getParserConfiguration().setInvalidObx2Type("ST");
    mfnM02.getParser().getParserConfiguration().setDefaultObx2Type("ST");
    String message = 
"MSH|^~\\&|MSH-3|MSH-4|MSH-5|MSH-6|20190314071618||MFN^M03|MSH-10|P|2.3|||AL|AL|AUS|ASCII|ENG\r"
 +
            "MFI|BED||UPD|||NE\r" +
            "MFE|MAC|||CGM:10\r";
    mfnM02.parse(message);
    System.out.println(mfnM02.printStructure());
}

Parsing throws this exception:

ca.uhn.hl7v2.HL7Exception: A datatype for MFE-
must be specified in 4-
.

                at 
ca.uhn.hl7v2.parser.FixFieldDataType.fix(FixFieldDataType.java:165)
                at 
ca.uhn.hl7v2.parser.FixFieldDataType.fixMFE4(FixFieldDataType.java:132)
                at ca.uhn.hl7v2.parser.PipeParser.parse(PipeParser.java:406)
                at ca.uhn.hl7v2.parser.PipeParser.parse(PipeParser.java:1169)
                at 
ca.uhn.hl7v2.model.AbstractMessage.parse(AbstractMessage.java:196)
                at au.gov.qld.health.sit.hl7.MFNTest.TestMFN_2(MFNTest.java:67)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:498)
                at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
                at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
                at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
                at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
                at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
                at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
                at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
                at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
                at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
                at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
                at 
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
                at 
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
                at 
org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
                at 
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
                at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
                at 
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
                at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
                at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
                at 
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
                at 
com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
                at 
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
                at 
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

Is there a way to permit them to parse without resorting to String 
pre-processing to insert a value?

Thanks
Ian







********************************************************************************

This email, including any attachments sent with it, is confidential and for the 
sole use of the intended recipient(s). This confidentiality is not waived or 
lost, if you receive it and you are not the intended recipient(s), or if it is 
transmitted/received in error.

Any unauthorised use, alteration, disclosure, distribution or review of this 
email is strictly prohibited. The information contained in this email, 
including any attachment sent with it, may be subject to a statutory duty of 
confidentiality if it relates to health service matters.

If you are not the intended recipient(s), or if you have received this email in 
error, you are asked to immediately notify the sender by telephone collect on 
Australia +61 1800 198 175 or by return email. You should also delete this 
email, and any copies, from your computer system network and destroy any hard 
copies produced.

If not an intended recipient of this email, you must not copy, distribute or 
take any action(s) that relies on it; any form of disclosure, modification, 
distribution and/or publication of this email is also prohibited.

Although Queensland Health takes all reasonable steps to ensure this email does 
not contain malicious software, Queensland Health does not accept 
responsibility for the consequences if any person's computer inadvertently 
suffers any disruption to services, loss of information, harm or is infected 
with a virus, other malicious computer programme or code that may occur as a 
consequence of receiving this email.

Unless stated otherwise, this email represents only the views of the sender and 
not the views of the Queensland Government.

**********************************************************************************
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to