web stats
MirthConnect: Database Write Success but no data in database - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 02-14-2013, 09:41 AM
HL7MadeEasy HL7MadeEasy is offline
Mirth Newb
 
Join Date: Nov 2012
Posts: 19
HL7MadeEasy is on a distinguished road
Default MirthConnect: Database Write Success but no data in database

Hi,

I have a channel in Mirthconnect which read HL7 messages and then extract relevant information and write to SQL server database. It is showing some unusual behaviour, on the Mirthconnect Message log it shows "SUCCESS: Database write success" but no data found in the database. It works fine and writes data most of the time but sometimes it does this. Normally if there is an error writing data (executing the Javascript) it shows error details in Mirthconnect and I understand that but how come it is showing "Write success" and then no data in the database.

Can anyone shed some light on this? Anyone experienced this?

Thanks.
Reply With Quote
  #2  
Old 02-14-2013, 10:01 AM
upstart33 upstart33 is offline
Mirth Guru
 
Join Date: Dec 2010
Location: Chicago, IL.
Posts: 461
upstart33 is on a distinguished road
Default

Could it be that the channel is executing everything, including the call to insert data into the database, but there is no actual data to be inserted?

Maybe "Success: Database Write Success" it Mirth's way of saying that it made the call to the database successfully.
Reply With Quote
  #3  
Old 02-14-2013, 10:12 AM
HL7MadeEasy HL7MadeEasy is offline
Mirth Newb
 
Join Date: Nov 2012
Posts: 19
HL7MadeEasy is on a distinguished road
Default

Hi,

There is data available to be inserted because I can see from the message repository that message has data in it.

Thanks.
Reply With Quote
  #4  
Old 02-14-2013, 10:23 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,126
narupley is on a distinguished road
Default

Quote:
Originally Posted by HL7MadeEasy View Post
Hi,

There is data available to be inserted because I can see from the message repository that message has data in it.

Thanks.
That probably has to do with how your channel is set up and what your insert statement is doing. Chances are that a conditional clause is causing no rows to be affected even when you think they should be.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #5  
Old 02-14-2013, 12:14 PM
HL7MadeEasy HL7MadeEasy is offline
Mirth Newb
 
Join Date: Nov 2012
Posts: 19
HL7MadeEasy is on a distinguished road
Default

Hi,

I have copied the HL7 message which was sent to Mirth (the message that recorded "Database write success" but did not store data in my application's database) using the View Message option and resent it to mirthconnect using HL7Inspector to simulate the situation and this time it has been stored in my database (extracted information) as it should be so I can confirm that the conditions in my scripts are becoming true and messages are in correct format. It is just happening randomly (not always) and it is difficult to point to anything since there is no pattern of this issue. It is really frustrating.

Thanks.
Reply With Quote
  #6  
Old 02-14-2013, 12:18 PM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,126
narupley is on a distinguished road
Default

Quote:
Originally Posted by HL7MadeEasy View Post
Hi,

I have copied the HL7 message which was sent to Mirth (the message that recorded "Database write success" but did not store data in my application's database) using the View Message option and resent it to mirthconnect using HL7Inspector to simulate the situation and this time it has been stored in my database (extracted information) as it should be so I can confirm that the conditions in my scripts are becoming true and messages are in correct format. It is just happening randomly (not always) and it is difficult to point to anything since there is no pattern of this issue. It is really frustrating.

Thanks.
That definitely seems like it's an issue with the insert query and/or the database itself. Perhaps one of the conditionals is dependent on something that wasn't true at first but that became true shortly after. If you're having trouble figuring out what it is, post the channel here so that we may troubleshoot.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #7  
Old 04-20-2014, 02:27 PM
nnah nnah is offline
Mirth Newb
 
Join Date: May 2011
Posts: 10
nnah is on a distinguished road
Default Data not filling into database

I am having issue with data filling into the database. Mirth Connect shows success: Database write success. But there's no data in the database. I am attaching my channel for someone to help.

I've seen a couple threads with people reporting the same problem but no real solution.
Attached Files
File Type: xml ADTFeed.xml (10.5 KB, 29 views)
Reply With Quote
  #8  
Old 04-21-2014, 06:32 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,126
narupley is on a distinguished road
Default

Quote:
Originally Posted by nnah View Post
I am having issue with data filling into the database. Mirth Connect shows success: Database write success. But there's no data in the database. I am attaching my channel for someone to help.

I've seen a couple threads with people reporting the same problem but no real solution.
That's because the very first line of your filter is incorrect.

Code:
if(msg['MSH']['MSH.9']['MSG.9.1'] == "ADT" && msg['MSH']['MSH.9']['MSG.9.2'] == "A01")
It should be:

Code:
if(msg['MSH']['MSH.9']['MSH.9.1'] == "ADT" && msg['MSH']['MSH.9']['MSH.9.2'] == "A01")
Also since you're doing all of that database logic in the filter, you don't have to use a Database Writer destination at all. You can just use a Channel Writer (none) instead.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #9  
Old 04-22-2014, 07:21 AM
nnah nnah is offline
Mirth Newb
 
Join Date: May 2011
Posts: 10
nnah is on a distinguished road
Default

Thanks, missed the typo. Is there any downside of doing the logic in the filter
Reply With Quote
  #10  
Old 04-22-2014, 08:00 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,126
narupley is on a distinguished road
Default

Quote:
Originally Posted by nnah View Post
Thanks, missed the typo. Is there any downside of doing the logic in the filter
Not really any downside per se.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
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 09:59 AM.


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