Announcement

Collapse
No announcement yet.

can I do hl7 to pdf?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • can I do hl7 to pdf?

    I created a inbound file to file channel and tried to make pdf work. Does v1.3.2 support hl7 to pdf? How does it work?
    thanks,

  • #2
    Re: can I do hl7 to pdf?

    He PDF writer generates PDF, using HTML as a template. So, you need to create a HTML template

    Comment


    • #3
      Re: can I do hl7 to pdf?

      I created a html temp file and it still generates error:

      com.webreach.mirth.model.converters.SerializerExce ption: ca.uhn.hl7v2.parser.EncodingNotSupportedException: Can&#039;t parse message beginning <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      at com.webreach.mirth.model.converters.HAPIMessageSer ializer.deserialize(HAPIMessageSerializer.java:54)
      at com.webreach.mirth.server.mule.transformers.HL7ToM essageObject.doTransform(HL7ToMessageObject.java:8 0)
      at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:197)
      at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:200)
      at org.mule.transformers.AbstractTransformer.transfor m(AbstractTransformer.java:200)
      at org.mule.impl.MuleEvent.getTransformedMessage(Mule Event.java:251)
      at org.mule.routing.inbound.SelectiveConsumer.isMatch (SelectiveConsumer.java:61)
      at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:79)
      at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:492)
      at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:271)
      at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:230)
      at org.mule.providers.file.FileMessageReceiver.proces sFile(FileMessageReceiver.java:183)
      at org.mule.providers.file.FileMessageReceiver.poll(F ileMessageReceiver.java:111)
      at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:73)
      at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
      at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
      at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
      at java.lang.Thread.run(Unknown Source)
      Caused by: ca.uhn.hl7v2.parser.EncodingNotSupportedException: Can&#039;t parse message beginning <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      at ca.uhn.hl7v2.parser.Parser.parse(Parser.java:140)
      at com.webreach.mirth.model.converters.HAPIMessageSer ializer.deserialize(HAPIMessageSerializer.java:52)
      ... 17 more
      ---------------------------------------
      this is my html template:

      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <!-- TemplateBeginEditable name="doctitle" -->
      <title>Untitled Document</title>
      <!-- TemplateEndEditable -->
      <!-- TemplateBeginEditable name="head" -->
      <!-- TemplateEndEditable -->
      <style type="text/css">
      <!--
      .style1 {color: #FF6600}
      .style2 {color: #3366FF}
      .style3 {
      color: #99FF00;
      font-weight: bold;
      font-size: 18px;
      }
      .style4 {
      font-size: 18px;
      font-weight: bold;
      }
      -->
      </style>
      </head>

      <body>
      <p><span class="style3">LEXUS RULES </span></p>
      <p><span class="style4"><BR/>
      <span class="style2">LEXUS RULES </span><BR/>
      </span></p>
      <p><span class="style4"><span class="style1">LEXUS RULES</span></span><BR/>
      </p>
      </body>
      </html>

      Comment


      • #4
        Re: can I do hl7 to pdf?

        ┬┐What kind of input endpoint are you using?

        This seems than your input is HL7-XML, not HL7-ER7: please, mark the "XML pre-encoded" check box at the channel definition panel (at "summary" tab)

        Comment


        • #5
          Re: can I do hl7 to pdf?

          yes, I checked the following check box without success. I also unchecked them to test...
          1. Enabled
          2. Channel will receive XML pre-encoded messages
          3. User transactional endpoints
          4. Synchronize source connector
          -----------------------------------
          I think we are using dtd xhtml 1.0 transitional

          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtm...sitional.dtd">
          <html xmlns="http://www.w3.org/1999/xhtml">
          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
          <!-- TemplateBeginEditable name="doctitle" -->
          <title>Untitled Document</title>
          <!-- TemplateEndEditable -->
          <!-- TemplateBeginEditable name="head" -->
          <!-- TemplateEndEditable -->
          </head>

          <body>

          Lexus rules!

          </body>
          </html>


          Comment


          • #6
            Re: can I do hl7 to pdf?

            Please, could you post your channel, please?

            When I talked about "HTML template" i refer to the template of the PDF endpoint, not the template of the transformer.

            Comment


            • #7
              Re: can I do hl7 to pdf?

              I am not able to post any image here in this message board. maybe it&#039;s my browser...
              Is there an email I can send screen shots?
              are you saying in my source tab, I need to put file name *.pdf ?

              Comment


              • #8
                Re: can I do hl7 to pdf?

                <com.webreach.mirth.model.Channel>
                <id>65024310-ac97-4a20-96ff-76426eebe612</id>
                <name>adt1_pdf</name>
                <description></description>
                <enabled>true</enabled>
                <version>1.3.2</version>
                <revision>164</revision>
                <direction>INBOUND</direction>
                <protocol>HL7</protocol>
                <mode>BROADCAST</mode>
                <sourceConnector>
                <name>sourceConnector</name>
                <properties>
                <property name="sortAttribute">date</property>
                <property name="pollingFrequency">1000</property>
                <property name="DataType">File Reader</property>
                <property name="fileAge">0</property>
                <property name="moveToPattern"></property>
                <property name="charsetEncoding">DEFAULT_ENCODING</property>
                <property name="checkFileAge">0</property>
                <property name="autoDelete">0</property>
                <property name="host">C:/ADT</property>
                <property name="fileFilter">*.*</property>
                <property name="moveToDirectory"></property>
                </properties>
                <transformer>
                <steps/>
                <template></template>
                </transformer>
                <filter>
                <rules/>
                <template></template>
                </filter>
                <transportName>File Reader</transportName>
                </sourceConnector>
                <destinationConnectors>
                <com.webreach.mirth.model.Connector>
                <name>Destination 1</name>
                <properties>
                <property name="DataType">PDF Writer</property>
                <property name="outputPattern">${ORIGINALNAME}&amp;${DATE}.p df</property>
                <property name="password"></property>
                <property name="template">${message.rawData}${message.id}</property>
                <property name="host">C:/ADT/PDFOUTPUT</property>
                <property name="encrypt">0</property>
                </properties>
                <transformer>
                <steps/>
                </transformer>
                <filter>
                <rules/>
                </filter>
                <transportName>PDF Writer</transportName>
                </com.webreach.mirth.model.Connector>
                </destinationConnectors>
                <properties>
                <property name="initialState">started</property>
                <property name="synchronous">true</property>
                <property name="store_messages">true</property>
                <property name="recv_xml_encoded">true</property>
                <property name="encryptData">false</property>
                <property name="transactional">true</property>
                <property name="max_message_age">-1</property>
                <property name="error_messages_only">false</property>
                </properties>
                <preprocessingScript>// Modify the message variable below to pre process data&#x0D;
                return message;&#x0D;</preprocessingScript>
                </com.webreach.mirth.model.Channel>

                Comment


                • #9
                  Re: can I do hl7 to pdf?

                  Ok. I see the problem.

                  1. Create a new channel. An Inboud one.
                  2. Define a File Reader endpoint (he one you&#039;ve defined is ok)
                  3. Define a PDF Write as a destination. In the PDF endpont, in the TextBox titled as "Template", write:
                  Code:
                  <title>Untitled Document</title>
                  
                  Lexus <b>rules!</b>
                  Deploy the channel, and copy an ER7 HL7 file into the directory you configured at the file reader (I&#039;m posting an ER7 example file)
                  Code:
                  MSH|^~\&|ADT-HIS||HL7INSPECTOR||20060101103100||ADT^A02|1|P|2.3
                  EVN|A01|20060101||
                  PID||||4711|Doe^John||19701024|M|||Sesamstreet 11^76137^Karlsruhe^D|||||GS|EV||||
                  PV1||I|S1^23^3^CHI^^1||||||||||||||||1234|||||||||||||||||||||||||200601010930||||||||
                  A very simple PDF will be generated.

                  4. Now, you can configure Mirth to generate customized and complex PDF. You&#039;ll need to create a new Transformer, and map into variables, the differnt ER7 elements. As soon as you define new maps, you will can use themes at hte PDF endpoint template (they&#039;ll apear into the "Source Mappings" box) Just Drag-and-drop the one you want to use into the Template Box.

                  Comment


                  • #10
                    Re: can I do hl7 to pdf?

                    Yes. I create a new channel and put the hl7 file in my file directory. Then I put the simple template for pdf and it&#039;s working!
                    Thank you very much!!

                    Comment


                    • #11
                      Re: can I do hl7 to pdf?

                      I also creted a new transformer and mapped couple variables. then drag them into the template. The pdf looks good. thank you!!!

                      Comment


                      • #12
                        Re: can I do hl7 to pdf?

                        Glad it&#039;s working Julia, thanks Alberto!
                        Chris Lang

                        Comment


                        • #13
                          Re: can I do hl7 to pdf?

                          the hl7 to pdf seems to be working in 1.3.2, but not working for 1.4
                          I can see the pdf file created for 1.4, but unable to open the file. it says the file format is not supported by adobe acrobat.

                          Comment


                          • #14
                            Re: can I do hl7 to pdf?

                            Can you post or email your PDF channel from 1.4 (chrisl [at] webreachinc.com)

                            -Chris
                            Chris Lang

                            Comment


                            • #15
                              Re: can I do hl7 to pdf?

                              oh, it&#039;s my error. I should use destination: "document writer".
                              it does creates pdf file fine.
                              thanks, Cris.

                              Comment

                              Working...
                              X