web stats
Mirth Community - View Single Post - HTTP Listener - JSON Array
View Single Post
  #1  
Old 03-11-2017, 07:06 AM
iamawake iamawake is offline
Mirth Newb
 
Join Date: Nov 2016
Posts: 7
iamawake is on a distinguished road
Default HTTP Listener - JSON Array

I have a channel with an HTTP Listener source and I need to create an HL7 message from the JSON being sent. Does anyone have an example of how I can iterate through multiple child records being sent in the JSON message? I have not worked with JSON before so I apologize if this question is ridiculously simple. Below is a similar example of what this channel would be receiving. Since there would be an array sent, I would like to have a for each loop somehow but not sure how to grab the values. Thank you in advance for any assistance.

{
"id": "12345",
"location": "LMNOP",
"visitList":
[{
"field01": "aaaaa",
"field02": "bbbbb",
"field03": "ccccc",
"field04": "ddddd"
},
{
"field01": "eeeee",
"field02": "fffff",
"field03": "ggggg",
"field04": "hhhhh"
},
{
"field01": "iiiii",
"field02": "jjjjj",
"field03": "kkkkk",
"field04": "lllll"
}]
}
Reply With Quote