Open rbeckman-nextgen opened 4 years ago
Attaching sample DICOM message to reproduce the issue with.
Imported Comment. Original Details: Author: narupley Created: 2014-01-21T09:57:54.000-0800
This has performance issues but does work to avoid the main issue above.
As a workaround for 3.5.2. 3.6.x and later should be able to use Addis' fix below via his attachment channel XML.
Example: var dcmObj = DICOMUtil.byteArrayToDicomObject(FileUtil.decode(msg), false); dcmObj.putString(0x61690010,org.dcm4che2.data.VR.LO,'your text here'); msg = FileUtil.encode(DICOMUtil.dicomObjectToByteArray(dcmObj));
Imported Comment. Original Details: Author: brianda Created: 2019-01-13T21:37:18.000-0800
For those still looking for workaround. Added DICOM raw channel example where edits are done via dcm4che API. - see attachments section.
Imported Comment. Original Details: Author: addis144 Created: 2019-01-22T17:52:04.000-0800
Workaround till ticket is resolved.
Imported Comment. Original Details: Author: addis144 Created: 2019-01-22T17:52:49.000-0800
My example is much slower because it is not using attachments. Addis's example channel is a much better workaround.
Imported Comment. Original Details: Author: brianda Created: 2019-01-23T13:23:16.000-0800
If a DICOM file contains control characters that are invalid for XML (other than pixel data that should already have been taken out by the attachment handler), and the channel has an active transformer, serialization will fail:
[2014-01-21 09:41:41,881] ERROR (Server:146): [Fatal Error] :1:709: Character reference "" is an invalid XML character. [2014-01-21 09:41:41,882] ERROR (com.mirth.connect.model.converters.DocumentSerializer:112): org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 709; Character reference "" is an invalid XML character.
We're currently using SAX to parse the DICOM data to and from XML, and it doesn't allow those invalid characters. We could use XPP instead, but then we'd probably have to recreate the ContentHandlerAdapter from dcm4che that is being used with SAX, and we'd be creating technically invalid XML anyway so that's not really a good option. Maybe a better option is to add a custom ContentHandler that can detect invalid characters and encode to Base64 automatically. Might not be feasible since SAX streams the character data, not sure.
Imported Issue. Original Details: Jira Issue Key: MIRTH-3127 Reporter: narupley Created: 2014-01-21T09:57:14.000-0800