Replies: 1 comment
-
Could you share a bit more of your channel logic, e.g. the field mapping between inbound DICOM and outbound HL7 message? Maybe this already helps (source transformer script): // DICOM images sometimes come wrapped in 2 attachments where the 2nd is the image
// http://www.mirthproject.org/community/forums/showthread.php?t=218075
logger.debug(msg.toString());
// get attachments
var attachments = AttachmentUtil.getMessageAttachments(connectorMessage);
var attachmentsSize = attachments.size();
//logger.debug("Message ID " + connectorMessage.getMessageId() + " attachments: " + attachmentsSize);
var jpg = "";
// extract image from last attachment
var attachment = attachments.get(attachmentsSize-1);
jpg = FileUtil.encode(attachment.getContent());
if(attachmentsSize == 0 || jpg == ""){
logger.debug("No DICOM image attached, ignoring message.");
destinationSet.removeAll();
return;
}
// Store embedded JPG image in channelMap (bytes encoded as base64 string)
$c('jpg', jpg); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Working off of other's success I almost have this figured out but need help with the image. It does not appear to be embedding the jpeg correctly.
This is the results of a test DICOM i run through my channel:
MSH|^~\&|MIRTH|urolasso|Profile|urolasso|202105221 70037||REF^I12^REF_I12|1.3.12.2.1107.5.4.3.1234567 89012345.19950922.121803.6|P|2.4^NZL^1.0 RF1|||CLN^US |||1.3.12.2.1107.5.4.3.123456789012345.19950922.12 1803.6 PRD|RT|^Associates^Urology||||| PID||556342B|||Rubo DEMO||19951025|M ORC|IN|F1U080:MIRTH:1:1.3.12.2.1107.5.4.3.12345678 9012345.19950922.121803.6||||||||||^Associates^Uro logy||||ATT OBR||PlacerOrderNumber||LIT||||||||||||^Associates ^Urology|||||||||F OBX||ED|JPEG^Display Format In JPEG^99NZATF||^^^Base64^DATA||||||C PV1||O||||||||S70|||||||||1.3.12.2.1107.5.4.3.1234 [56789012345.19950922.121803.6
XML:
see: https://forums.mirthproject.io/forum/mirth-connect/support/178865-dicom-to-hl7-with-embedded-image#post178865
Beta Was this translation helpful? Give feedback.
All reactions