Looking for how to make a PDL check two different phrases.

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Looking for how to make a PDL check two different phrases.

  • Creator
    Topic
  • #55179
    Bruce Howells
    Participant

      Trying to configure a tcp/ip PDL to read and ack two different phrases.  First, vendor sends a single x05 and waits for ack.  Then vendor sends a variable length string of data followed by a line feed.  I can get either one to work using the elements below, but not both.   The PDL program puts out “no more phrases to try” on occasion, which implies that it’s capable of trying multiple phrases, but can’t figure out a way to do this using hci_pd_msg_style. All suggestions welcome, including possible non-pdl solutions.  This is for reading ASTM messages from a medical device interface.

      /**** This works. Ack’s  x05 sent with no lf ***/

      define phrase ping-msg;

       field ping = fixed-array(1,or());

      end phrase;

      /***This basic-msg phrase works. Captures anything ending in lf***/

      define phrase basic-msg;

       field data = variable-array( not( ) );

      ;

      end phrase;

      /*** Problem is how to get PDL utility to check both phrases. Have tried listing both phrases and fields in every way I can imagine. ***

      hci_pd_msg_style acknak phrase:basic-msg

                             field:data

                             ackphrase:ack-msg

                             nakphrase:nak-msg

                             timeout:1000

                             naktries:1

                             tmotries:1

      Thanks

    Viewing 5 reply threads
    • Author
      Replies
      • #84475
        Robert Milfajt
        Participant

          You might want to attach your entire PDL.  Defining the phrase is one thing, but actually writing the code to process the different phrases you could receive is another.  Also, are you expecting an at the end of the feed, i.e, are you getting the then a series of messages, followed by indicating completion?

          Robert Milfajt
          Northwestern Medicine
          Chicago, IL

        • #84476
          Charlie Bursell
          Participant

            As Bob said a copy of your PDL would help.  I would also consider a more literate vendor that knows how to handle TCP/IP comms.    What you have can produce a lot of errors and bad messages.

            A couple of questions.

            You say basic ACK to X05, does this mean you send =X06?  How about after message is received?  Do you ACK that as well?

            I have done similar PDLs many times.  However, remembering how long ago the PDL engine was written and very little changes since, if possible, I would try to figure a better way.

          • #84477
            Bruce Howells
            Participant

              Thanks Robert and Charlie for your input.  To make a long story short,  our lab folks bought some equipment but not the middleware that goes with it.  The vendor claims that it’s possible to do an interface without the middleware.  Middleware is $300K and management wants us to make our best effort. Here’s how the vendor says transactions will work.  Haven’t been able to confirm due to lack of a workable client and limited availability of the equipment at the moment.

              10:52:42 Sent to LIS :

              10:52:42 Received from LIS:

              10:52:42 Sent to LIS :

              (Pipe delimited ASTM record here)

              10:52:42 Received from LIS:

              For our purposes,  “LIS” is Cloverleaf.

              As I said, I have been able to code a “basic-msg” in a PDL cloned from the mlp2_tcp.pdl code that reads and acks the one byte as a fixed length array.  I can also code a “basic-msg” that reads and acks the variable length data record ending in .   What I don’t know how to do is write a pdl that will try to match either one.   So far I’ve only worked with the ” hci_pd_msg_style acknak”  call found in mlp2_tcp.pdl.   All of the examples of more complicatd PDL’s  we have that were written by Cloverleaf folks are “async.”  I haven’t spent the effort to dig deeply into the nuts and bolts of how they work without first exhausting what seemed like the far simpler model found in mlp2_tcp.pdl.  I’ve read every scrap of documentation available in the Cloverleaf help file multiple times, but it’s sort of sparse and I’d appreciate any help you can offer with filling in the gaps.

              Thanks again.

            • #84478
              Charlie Bursell
              Participant

                Try this Bruce.

                I have attached the PDL (lis.pdl).  When I tested I had to substitute some of the special characters but it should be OK

                As for the final ACK after message received it is better if you do that from the engine after receipt of the message.  I have attached a script which you can modify to fit your needs (sendAck.tcl).  It would be the first script in your inbound thread.

                The PDL is set up to send an ACK or NAK.  You may want to send NAK if something wrong with message.

                Let me know how it goes.

              • #84479
                Bruce Howells
                Participant

                  Thanks Charlie.  I’ll check this out hopefully later today and let you know.   Tied up in other issues at the moment.

                • #84480
                  Bruce Howells
                  Participant

                    Sorry, we got dragged elsewhere.  This worked.  Thank you Charlie!

                Viewing 5 reply threads
                • The forum ‘Cloverleaf’ is closed to new topics and replies.