Announcement

Collapse
No announcement yet.

Receiving strings via TCP connections

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

  • Receiving strings via TCP connections

    Hi all,

    sorry but I forgot that I'm receiving plain text messages via TCP too. In this case I have an added problem, I must process the strings in order to know at what database table has to be written. Six first characters in the string are telling me that.

    How can I do that with best results?, using filters?, using javascript in database writer tab?.

    Thanks in advance for your help,

    Ricard Bernat

  • #2
    Re:Receiving strings via TCP connections

    Hi again,

    I'm reading strings from flat files, but this strings are not HL7-like formatted text, are only strings concatenated. They are position delimited. Can I process this files in order to generate HL7 messages?.

    Nowadays when I define a new channel I don't know what to do with "Incoming Data" field, not XML, not HL7, not X12, etc..

    Any hints about?.

    Ricard Bernat

    Comment


    • #3
      Re:Receiving strings via TCP connections

      You have to write a big preprocessor script in order to convert this into XML in order for Mirth to accept it.
      Brendan Haverlock | Mirth Software Engineer | Mirth Corporation

      Comment


      • #4
        Re:Receiving strings via TCP connections

        Hi again,

        ok, I'll try to do it but, when I try to deploy the channel it appears stopped, and there is no way to change the status to Started. I'll send attached the channel.

        Thanks for your help,

        Ricard Bernat
        Recepcion_mensajes.xml (3916 bytes)

        Comment


        • #5
          Re:Receiving strings via TCP connections

          Is 172.16.1.1 your ip address? You should only change the listener address if you are working with multiple network interfaces. 99% of the time, you can leave it at 127.0.0.1 or localhost
          Chris Lang

          Comment


          • #6
            Re:Receiving strings via TCP connections

            Hi again,

            wow!, I changed the configuration from TCP sender to listener, you are right, I should left 127.0.0.1 as a local IP address!.

            Thanks for the message!,

            Ricard Bernat

            Comment


            • #7
              Re:Receiving strings via TCP connections

              Hi all,

              finally channel runs ok!, but now I have the hardest work, convert this string into a XML message. Any hints or previous works about this?.

              I only need to convert the entire string in a XML message.

              Thanks in advance for your help,

              Ricard Bernat

              Comment


              • #8
                Re:Receiving strings via TCP connections

                Since they are position delimited, you must run "substring" on the string for each field. For example if the first field is at position 0 and is 4 characters:

                Code:
                var xmlString = "<data>";
                var field1 = message.substring(0,4);
                xmlString+= "<field1>"  + field1 + "</field1>";
                //pull out all fields here
                xmlString+= "</data>";
                Chris Lang

                Comment


                • #9
                  Re:Receiving strings via TCP connections

                  Hi Chrisl,

                  ok!, everything is working fine.

                  Thanks for your help,

                  Ricard Bernat

                  Comment

                  Working...
                  X