web stats
How do I read from sql server - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 09-26-2011, 10:07 AM
romed romed is offline
Mirth Newb
 
Join Date: Sep 2011
Posts: 14
romed is on a distinguished road
Default How do I read from sql server

Hi,

I'm new to hl7 and Mirth, so I have no idea what I'm doing. Can somebody explain to me how I read from sql server using Mirth? I set up a channel, on the source tab I set Connector Type: Database Reader

Driver: Sql Server/Sybase
I entered a url, username and password

If I now click on the Select button, the pop up appears and if I click on Get Tables, nothing happens.......not sure where to go from here. Thanks
Reply With Quote
  #2  
Old 09-26-2011, 10:56 AM
mlehmann mlehmann is offline
Mirth Newb
 
Join Date: Apr 2011
Posts: 11
mlehmann is on a distinguished road
Default

could you please post what you have for URL?
Reply With Quote
  #3  
Old 09-26-2011, 11:21 AM
romed romed is offline
Mirth Newb
 
Join Date: Sep 2011
Posts: 14
romed is on a distinguished road
Default Here is my url

jdbc:jtds:sqlserver://192.168.200.250/MirthDatabase;instance=dev

I got it to work where I'm using hl7 browser, I have this as my sql query:
SELECT PatientID,
FirstName,
LastName,
Address,
DOB,
Gender,
HomePhone
from Patients

In Destinations I set the Directory to c:/MirthFolder
and FileName to ${message.id}

Template: ${message.encodedData}

Now, I was able to get it to write to the file, but it wrote about 60 times, then I stopped it. How do I make it write only once?

Thanks in advance...
Reply With Quote
  #4  
Old 09-27-2011, 03:57 AM
mlehmann mlehmann is offline
Mirth Newb
 
Join Date: Apr 2011
Posts: 11
mlehmann is on a distinguished road
Default

If you were able to get it to write, your database properties are fine. To make it only write once, you need to have a flag in your database which changes once Mirth gets it's hands on it.

For database reader, there is a section for "Run on-update statement." In there, you would write an update SQL statement to update the flag for that database entry.
Reply With Quote
  #5  
Old 10-18-2011, 04:26 PM
UmerRazi UmerRazi is offline
What's HL7?
 
Join Date: Jun 2011
Posts: 3
UmerRazi is on a distinguished road
Default Need Help

I have same problem to connect with the sql data base. I have created a channel and now I want to read from SQL data base. I have used the following in the URL field
jdbc:jtds:sqlserver://hostort/dbname (host=localhost, port=1433, dbname=mydatabase)
Driver = sql Server
Use Java script is set to yes
after this when I click select, new window pops up, then clicked get tables but I do not get any tables. Please help me to know how can I get tables in sql database
Reply With Quote
  #6  
Old 10-18-2011, 08:20 PM
jcsites jcsites is offline
What's HL7?
 
Join Date: Sep 2011
Location: usa
Posts: 1
jcsites is on a distinguished road
Default

Quote:
Originally Posted by romed View Post
Hi,

I'm new to hl7 and Mirth, so I have no idea what I'm doing. Can somebody explain to me how I read from sql server using Mirth? I set up a channel, on the source tab I set Connector Type: Database Reader

Driver: Sql Server/Sybase
I entered a url, username and password

If I now click on the Select button, the pop up appears and if I click on Get Tables, nothing happens.......not sure where to go from here. Thanks
we are having the same problem here. I hope someone here could help us...
__________________
we were born to succeed, not to fail
Reply With Quote
  #7  
Old 10-19-2011, 03:44 AM
StefanScholte StefanScholte is offline
 
Join Date: May 2009
Location: Netherlands, Harderwijk
Posts: 321
StefanScholte is on a distinguished road
Default

To Retrieve metadata (that is get Table is) you need special permissions.
check in SQLServer if the user has these permissions.
Reply With Quote
  #8  
Old 02-23-2020, 12:05 PM
MirthGuy2019 MirthGuy2019 is offline
Mirth Newb
 
Join Date: Feb 2020
Posts: 7
MirthGuy2019 is on a distinguished road
Default

Hello. Please watch this tutorial. I think you can find the solution there.
https://youtu.be/fLMotBERd8w
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 11:39 PM.


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