title: Mirth connect fails on evaluating transformers
body: <p>I'm working with Mirth Connect v3.0.1 and getting stuck on one task, transformation of XML to HL7 v2. I am using a xml template, dragging and dropping values to the hl7 template. </p>
  
  <p>destination 1
  Method: file
  Directory: C:\throw\AXSFLW
  File Name: ${message.encodedData}</p>
  
  <p>In the Transformer:</p>
  
  <p>Message Segment: tmp['PID']['PID.5']['PID.5.1']
  Mapping:         msg['Day']['Patient']['LastName'].toString() </p>
  
  <p>Message Segment: tmp['PID']['PID.5']['PID.5.2']
  Mapping:         msg['Day']['Patient']['FirstName'].toString()</p>
  
  <p>When the source gets a xml file mirth connect fails with this error</p>
  
  <pre><code>Transformer error
  ERROR MESSAGE: Error evaluating transformer
  java.lang.NullPointerException
  at org.mozilla.javascript.xmlimpl.XmlNode$InternalList.add(XmlNode.java:834)
  at org.mozilla.javascript.xmlimpl.XMLList.replace(XMLList.java:55)
  at org.mozilla.javascript.xmlimpl.XMLList.putXMLProperty(XMLList.java:151)
  at org.mozilla.javascript.xmlimpl.XMLList.putXMLProperty(XMLList.java:150)
  at org.mozilla.javascript.xmlimpl.XMLObjectImpl.put(XMLObjectImpl.java:261)
  at org.mozilla.javascript.ScriptRuntime.setObjectElem(ScriptRuntime.java:1571)
  at org.mozilla.javascript.ScriptRuntime.setObjectElem(ScriptRuntime.java:1564)
  at org.mozilla.javascript.Interpreter.doSetElem(Interpreter.java:2227)
  at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1264)
  at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
  at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
  at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
  at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3110)
  at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:120) at     com.mirth.connect.server.util.javascript.JavaScriptTask.executeScript(JavaScriptTask.java:49)
  at com.mirth.connect.server.transformers.JavaScriptFilterTransformer$FilterTransformerTask.call(JavaScriptFilterTransformer.java:123)
  at com.mirth.connect.server.transformers.JavaScriptFilterTransformer$FilterTransformerTask.call(JavaScriptFilterTransformer.java:100)
  at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
  at java.util.concurrent.FutureTask.run(Unknown Source)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  at java.lang.Thread.run(Unknown Source) 
  </code></pre>
  
  <p>Hope somebody can point me to a solution. This seemed to work in Mirth Connect 2.1
  thanks for any help.</p>