web stats
How to use OpenCSV in channel? - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 11-24-2015, 09:35 AM
cram1986 cram1986 is offline
Mirth Newb
 
Join Date: Mar 2015
Posts: 8
cram1986 is on a distinguished road
Default How to use OpenCSV in channel?

I am new to using Java functions and I am trying to use OpenCSV to read in a CSV file to use as a cross reference file.

I put the OpenCSV.jar file in: C:\Program Files\Mirth Connect\custom-lib

Went into Settings-->Resources and made sure the library was loaded.

I am stuck on how to use the functions within my Javascript step. I can't seem to find any examples of it used in Mirth. Does anyone have any insights?

Thanks!
Reply With Quote
  #2  
Old 11-25-2015, 07:14 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,117
narupley is on a distinguished road
Default

There are many, many examples here on the forums if you search. There's also an article on our wiki about it.

Basically all you do to access a Java class is use "Packages.[package name].[class name]". For example if you wanted to access FileUtils you would use "Packages.org.apache.commons.io.FileUtils". The "Packages." part is optional to common top-level package domains (com/net/org/java/etc.)
__________________
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
  #3  
Old 11-25-2015, 08:30 AM
cram1986 cram1986 is offline
Mirth Newb
 
Join Date: Mar 2015
Posts: 8
cram1986 is on a distinguished road
Default

Thanks Narupley. I did come across that Wiki page, but was having issues getting OpenCSV to work. I will do some more digging.
Reply With Quote
  #4  
Old 11-25-2015, 08:42 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,117
narupley is on a distinguished road
Default

What "doesn't work"? If you give more information, then people here might be able to help.
__________________
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

Tags
csv, import, java, library, opencsv

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:19 AM.


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