No announcement yet.

BasicDicomObject to XML with Mirth Utils

  • Filter
  • Time
  • Show
Clear All
new posts

  • BasicDicomObject to XML with Mirth Utils


    I try to serialize my DICOM object to a XML file.
    I can either provide a BasicDicomObject or a ByteArray of the DICOM file.

    Anyhow, when I try to use the DICOMSerializer() of Mirth, it is expecting a String.

    But a string out of what? A reference to an actual file? a ByteArray.toString()?
    I want to avoid writing anything in the filesystem so I am dealing mostly with bytearrays and Input- and OutputStreams.

    any help is appriciated!!!

    thank you very much

    I also tried to use DICOMUtil.getDICOMMessage() but I have not the data from the type "message" to do that.
    I created a new messageObject and set the RawData to my ByteArrayOutputStream.toString(). Now I try to do DICOMUtil.getDICOMMessage(message) but it ends in an error telling me my data is undefined. Do I have to set more attributes?
    Last edited by gkittlaus; 01-21-2014, 06:46 AM.

  • #2
    The toXML() method takes in a Base64 encoded string.
    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.


    • #3
      Perfect, works just fine now
      Now I found actually an easier way to do whhat I wanted.

      I encoded my DICOM Object base64 and stored it in the variable DICOMMESSAGE.

      After sending it to the PACS the bytes pixel data was missing.
      Is the DICOM sender clearing this data out?
      Should I use another variable? Do I have to put the bytes of the JPG data in another variable?