0

I have the folliwing medication order

<MedicationOrder xmlns="http://hl7.org/fhir">
<id value="medicationOrder-0"/>
<identifier>
    <value value="843c3f2a-2704-11e5-b345-feff819cdc9f"/>
</identifier>
<dateWritten value="2015-03-09"/>
<status value="active"/>
<dateEnded value="2015-04-09"/>
<reasonCodeableConcept>
     <coding>
        <system value="http://hl7.org.co/fhir/vs/cie-10"/>
        <code value="D300"/>
        <display value="Malignant Tumor Internal the upper quadrant of the breast"/>
    </coding>
</reasonCodeableConcept>
<medicationCodeableConcept>
    <coding id="cum">
        <system value="http://hl7.org.co/fhir/vs/cum"/>
        <code value="16135"/>
        <display value="ACETAMINOFEN 2/350 MG/MG"/>
    </coding>
</medicationCodeableConcept>
<dosageInstruction>
    <timing>
        <repeat>
            <boundsPeriod>
                <start value="2015-03-09"/>
                <end value="2015-04-09"/>
            </boundsPeriod>
            <period value="8"/>
            <periodUnits value="d"/>
        </repeat>
    </timing>
</dosageInstruction></MedicationOrder>

I'm parsing the previous resource on windows, I don't have a problems there, but I'm try parsing on WebLogoc 12.1.2.0, show the following exeption:

java.lang.NullPointerException
at java.math.BigDecimal.<init>(BigDecimal.java:739)
at org.hl7.fhir.instance.model.DecimalType.<init>(DecimalType.java:83)
at org.hl7.fhir.instance.formats.XmlParser.parseDecimal(XmlParser.java:343)
at org.hl7.fhir.instance.formats.XmlParser.parseTimingTimingRepeatComponent(XmlParser.java:979)
at org.hl7.fhir.instance.formats.XmlParser.parseTiming(XmlParser.java:946)
at org.hl7.fhir.instance.formats.XmlParser.parseMedicationOrderMedicationOrderDosageInstructionComponent(XmlParser.java:6599)
at org.hl7.fhir.instance.formats.XmlParser.parseMedicationOrder(XmlParser.java:6572)
at org.hl7.fhir.instance.formats.XmlParser.parseResource(XmlParser.java:10125)
at org.hl7.fhir.instance.formats.XmlParserBase.parseResourceContained(XmlParserBase.java:294)
at org.hl7.fhir.instance.formats.XmlParser.parseDomainResourceContent(XmlParser.java:1212)
at org.hl7.fhir.instance.formats.XmlParser.parseComposition(XmlParser.java:2955)
at org.hl7.fhir.instance.formats.XmlParser.parseResource(XmlParser.java:10045)
at org.hl7.fhir.instance.formats.XmlParserBase.parse(XmlParserBase.java:94)
at org.hl7.fhir.instance.formats.XmlParserBase.parse(XmlParserBase.java:82)
at org.hl7.fhir.instance.formats.ParserBase.parse(ParserBase.java:56)
at org.hl7.fhir.instance.formats.ParserBase.parse(ParserBase.java:51)

in the tag period the value is 8, I don'n know the reazon this generate null.

the Java source code is the following:

@POST
@Consumes(MediaType.APPLICATION_XML)
public Response createMedicationOrder(String message) {
    MedicationOrder medicationOrder;
    try {
        XmlParser xmlParser = new XmlParser();
        medicationOrder = (MedicationOrder) xmlParser.parse(message); // Generate the error
    } catch (Exception e) {
        return Response.status(Status.NOT_ACCEPTABLE.ordinal()).entity(messageError).build();
    }
    Response res = createExternalOrder(medicationOrder);
    return res; 

}

This problem does not occur in WebLogic 12.1.1.0, can not be done about it, because the stack trace presented in the library does not say much of the problem.

More information:

Laguaje: Java 6 WebLogic: 12.1.2.0 ApiFhir: fhir-dstu2-1.0.1.7108.jar

edandr555
  • 1
  • 2

2 Answers2

0

Is switching to HAPI's Parser an option for you? You may well have reasons not to, but if it's an option you'll be able to use the same data model with a more battle-tested parser.

James Agnew
  • 701
  • 4
  • 3
  • James, thanks for your answer, but right now I do not hapi Fhir the implementation, because it would have to do a full migration and at this time is not possible. it is possible to obtain the source code fhir? – edandr555 Nov 08 '16 at 13:36
  • This is an old version. The current code base is here: http://gforge.hl7.org/svn/fhir/trunk/build/implementations/java/org.hl7.fhir.dstu2 - try that – Grahame Grieve Nov 08 '16 at 20:57
0

The problem was the class loader, the solution was set the tag wls:prefer-web-inf-classes = true in weblogic.xml and put libraries on web-inf/lib.

edandr555
  • 1
  • 2