web stats
Pulling TIFF file from path in ORM and writing it to another directory. - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 06-12-2019, 10:28 AM
SNaughton SNaughton is offline
What's HL7?
 
Join Date: Dec 2018
Posts: 1
SNaughton is on a distinguished road
Default Pulling TIFF file from path in ORM and writing it to another directory.

Hi All,

Looking for some guidance if possible.

I am receiving the following ORM which has a file path to a .tiff which I would like to pull out and write to another folder (or if I could convert the TIFF to a PDF and write to a folder, even better).

Would anyone be able to give some guidance on how to go about this?

Code:
MSH|^~\&|QDOC|HL7V1.1|AGFA|AGFA|20190611153915||ORM^O01|00115535|P|2.3.1||||||8859/1
PID|||000106722^^^AUT^PI||ZZZRISTEST^Pacs||19350202|M|||Test Test^^^Kilkenny^K^IRL
ORC|XO|QPREQUESTTOPIC_25935^IPLAN|QPREQUEST_25291^RAD|QPREQUEST_25291^IPLAN|SC||^^^^^R|||SNAUGHTON||RA68717^NaughtonTest^StephenTest|||||AUT^Aut Even Hospital||||Aut Even Hospital^^AUT
OBR||QPREQUESTTOPIC_25935^IPLAN|QPREQUEST_25291^RAD|MSKUH^MRI BRAIN^RAD^^^QUADRAT||20190611153915|20190611220000|||||||||RA68717^NaughtonTest^StephenTest||AUT29650|AUT29650|AUT29650||||||||||||||^^^RAD^MRI||20190611220006
OBX|1|TX|PATSTATUS||Outpatient
OBX|1|RP|SCANNED_REQUEST^Referral Note||\E\\E\192.168.9.22\E\Scanned_attachements\E\79DB69C2-1B7C-4107-8F62-8330B0C5A9FF.tiff
ZDS|1.3.51.0.1.1.172.16.20.234.29650.29575^Agfa^Application^DICOM
I have tried adding the following into the Destination Transformed but I think I am way off:

Code:
var fileName = "msg['OBX'][1]['OBX.5']['OBX.5.1'].toString()"

var directory = "E:\Inbound" 
var outFileName = "test.tiff";
var destination = directory +"\\" + outFileName

importPackage(java.io);
importPackage(org.apache.commons.io);
//var file = new java.io.File(directory);
var inputFile = new File(fileName);
var outputFile = new File(destination);
FileUtils.copyFile(inputFile,outputFile);
Thanks,
Stephen Naughton
Reply With Quote
  #2  
Old 07-10-2019, 09:20 AM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 564
kirbykn2 is on a distinguished road
Default

I would channelMap the variables so you can verify the contents. Or use logger.info()
__________________
Kirby

Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

Appliance Version 3.11.2
Mirth Connect Version 3.6.1
Java Version 1.6.0_45-b06
Java (64 bit) Version 1.6.0_45-b06
Java 7 (64 bit) Version 1.7.0_151-b15
Java 8 (64 bit) Version 1.8.0_121-b13
PostgreSQL Version 9.6.3
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 01:08 PM.


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