web stats
JSON listener - returning empty string - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 11-12-2019, 11:49 AM
Brad_AZ Brad_AZ is offline
Mirth Newb
 
Join Date: Mar 2018
Location: Arizona, USA
Posts: 19
Brad_AZ is on a distinguished road
Default JSON listener - returning empty string

I am trying to set up my first JSON listener. I've gone thru some old info and some current and landed with the attached channel. We are on Mirth 3.8.1. I keep getting this error:

Quote:
99: msg = JSON.parse(connectorMessage.getTransformedData());
100: function doFilter() { phase[0] = 'filter'; return true; }function doTransform() { phase[0] = 'transformer'; logger = Packages.org.apache.log4j.Logger.getLogger(phase[0]);
101:
102:
103: logger.info('test');
LINE NUMBER: 99
DETAILS: SyntaxError: Empty JSON string
Here is my simple message that I am testing with using Postman. Any assistance or direction to other solutions is appreciated.

Quote:
{
"name" : "Brad",
"appt" : "12/12/19"
}
Attached Files
File Type: xml Scheduling_json_in.xml (21.1 KB, 2 views)
__________________
SIG|1|Mirth Certified Interface Analyst^Cancer Treatment Centers of America|
Reply With Quote
  #2  
Old 11-12-2019, 12:00 PM
jackwhaines jackwhaines is offline
 
Join Date: May 2011
Location: Kansas City, Missouri
Posts: 228
jackwhaines is on a distinguished road
Send a message via Skype™ to jackwhaines
Default

Works for me (no data returned) but I did have to set the data types all to JSON.
__________________

-= Jack Haines : Founder/CEO of Healthcare Integrations, LLC
-= jack.haines@HealthcareIntegrations.com
-= Mirth Connect (Advanced)-certified
-= Gold member of HL7.org
-= Available for Mirth Connect channel development and consultation! Schedule a FREE call with me at https://calendly.com/jackhaines
Reply With Quote
  #3  
Old 11-12-2019, 12:44 PM
Brad_AZ Brad_AZ is offline
Mirth Newb
 
Join Date: Mar 2018
Location: Arizona, USA
Posts: 19
Brad_AZ is on a distinguished road
Default

Thanks - I swear I tried that, but that fixes the error inbound. Now on to phase II - HL7 outbound! I have some samples that I can start with for that.
__________________
SIG|1|Mirth Certified Interface Analyst^Cancer Treatment Centers of America|
Reply With Quote
  #4  
Old 11-12-2019, 12:45 PM
jackwhaines jackwhaines is offline
 
Join Date: May 2011
Location: Kansas City, Missouri
Posts: 228
jackwhaines is on a distinguished road
Send a message via Skype™ to jackwhaines
Default

Sweet! Keep us updated!
__________________

-= Jack Haines : Founder/CEO of Healthcare Integrations, LLC
-= jack.haines@HealthcareIntegrations.com
-= Mirth Connect (Advanced)-certified
-= Gold member of HL7.org
-= Available for Mirth Connect channel development and consultation! Schedule a FREE call with me at https://calendly.com/jackhaines
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 05:13 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation