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