unable to save value from xml to tmp object in MIRTH javascript

809 Views Asked by At

this works : tmp['MSH']['MSH.4']['MSH.4.1'] = "xyz";

tmp[['MSH']['MSH.4']['MSH.4.1']] = "xyz"; //this doesnt work.

I am trying to get the value from json as string with brackets

I need that brackets or any other solution

I am trying to save the value in following location of HL7 message. pls help

LINE NUMBER: 45 DETAILS: TypeError: Cannot read property "MSH.4.1" from undefined at 6520e152-1c7a-41bc-9642-e5f97cd11d98:45 (doTransform) at 6520e152-1c7a-41bc-9642-e5f97cd11d98:48 (doScript) at 6520e152-1c7a-41bc-9642-e5f97cd11d98:50 at com.mirth.connect.server.transformers.JavaScriptFilterTransformer$FilterTransformerTask.call(JavaScriptFilterTransformer.java:134) at com.mirth.connect.server.transformers.JavaScriptFilterTransformer$FilterTransformerTask.call(JavaScriptFilterTransformer.java:100) 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)

1

There are 1 best solutions below

0
On

Try

tmp['MSH']['MSH.4']['MSH.4.1'] = '[xyz]';