Iterate Problem, msg type VXR, segs RXA and OBX

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Iterate Problem, msg type VXR, segs RXA and OBX

  • Creator
    Topic
  • #53971
    Johnny Anderson
    Participant

      CL v5.8.5, Sun Solaris 10, HL7 v2.3.1

      I need to xlate an input Friendly Records file to an output msg type VXR.

      Can

    Viewing 16 reply threads
    • Author
      Replies
      • #79710
        Jim Kosloskey
        Participant

          Johnny,

          The way I read your definition it is expecting the 03 record types to be all grouped together followed by the 04 record types like this:

          03

          03

          03

          04

          04

          04

          Based on the data that is not what you want.

          I don’t think the repeat while will suffice as the data sits.

          What might work is to define the 03 and 04 as a group using repeat block. That poses a challenge then to define that repeat block as a repeating set.

          One possible solution is to use an inbound Tcl Proc to add a group designation to the front of the record type like this:

          101

          202

          303

          304

          303

          304

          303

          304

          414

          414

          414

          etc.

          That might make it possible to use the repeat while independently or in conjuction with a repeat block.

          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

        • #79711
          Robert Kersemakers
          Participant

            Jim, I think he is expecting this as input:

            01

            02

            17

            [{

             [{03}]

             [{04}]

             [{14}]

            }]

            13

            06

            07

            99

            I am wondering if your inbound message will conform to the HRL you have defined. Have you run a test-message (Friendly Record Input) against this HRL definition? Because I think that is where things go wrong. I don’t think you can have the ‘group’ 03_04_14 check for ’03’ and then have the ‘segment’ 03 check for the same value ’03’.

            This is a complicated HRL. Normally you will transform such an HRL into a pseudo-HL7 definition, where it’s much easier to iterate through the groups/segments.

            If I were to do this with HRL, I would probably try to transform

            01

            02

            17

            XX

            03

            03

            04

            04

            14

            XX

            03

            04

            XX

            03

            04

            14

            14

            13

            06

            07

            99

            So the XX indicates when a new group 03_04_14 starts. Not sure if this will work though.

            What if there are two 03 segments after each other: 2 groups with one segment or 1 group with 2 segments?

            Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

          • #79712
            Johnny Anderson
            Participant

              Sorry I didn

            • #79713
              Robert Kersemakers
              Participant

                If your HRL-testing tool shows blank, then the HRL definition is false/incorrect. As I said before: I’m not sure you can handle this with an HRL.

                About translating an incoming (HRL-)message into pseudo-HL7: I haven’t done this myself. If I were to do this with your example I would first make a tcl-script that would add an MSH line/segment to the message and then change all 01/02/03 segments into something like S01|, S02| resp. S03| and ending all lines with a CR (/r) and all messages with CR/LF (/r/n). Then define your new segments S01, S02, S03 that have only 1 field (the rest of the line). You can then make a new variant, starting with MSH, S01, S02, S03 and defining all segments/group as you need them.

                Hope this helps.

                Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

              • #79714
                Johnny Anderson
                Participant

                  Jim and Robert, using your suspicions about the HRLs I decided to take another look.  Tried a few changes

                  and stumbled onto this- changed Repeats from 100000 to 100 (attachment 1, slide 1).  Ran testing tool

                  for HRL and got good results plus 98 empty segments.  The Iterates are working now and I have an o/p

                  VXR file for the first time.  

                  There are new problems.  View all slides in attachment 1 and 2.  I

                • #79715
                  Johnny Anderson
                  Participant

                    Still need help.  I’ll take any suggestions from anybody.

                  • #79716
                    Johnny Anderson
                    Participant

                      I’ve corrected problem 2 above on Jan 10.  See attachment.

                      I still have problems 1 and 3.

                    • #79717
                      Robert Kersemakers
                      Participant

                        Again, I’m not sure if you can solve this with an HRL. It has its limits.

                        First and foremost you will need to verify that the inbound message will hold up against the defined HRL. Use the HRL testing tool for this: test the inbound message that you are using with the Xlate against your defined HRL. There is no need to work on your translation as long as this isn’t correct.

                        Sorry, but I can’t help you more.

                        Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands

                      • #79718
                        Bob Richardson
                        Participant

                          Greetings,

                          Read through this post and saw that you could not find an example of a “psuedo HL7 message”.  Years ago I had a similar problem where I could not get the HRL to work for me on a flat file with multiple records of different types comprising its overall structure.

                          So…

                          See attachment for an input layout after I had created my “pseudo”.

                          (1) Decided to create a pseudo HL7 template (variant) to represent the data logically as presented in the file.

                               a. create new HL7 (version 2) variant – my example was a 2.5

                               b. create new fields – usually you can start with field number 13000

                               c. create new Z segments that include the new fields – for me ZOR and ZEX

                               d. create a new Z message type, for me, ZHP_O01

                          (2) Write a Tcl procedure to take the file and create these HL7 messages.

                              This would be the pre translation step.

                          (3) Create the translation using the pseudo HL7 message as the input template now and in my case an XML output.  But this could be another “normal” HL7 V2 output too or a VRL.  Note:  actually HRL works better for OUTPUT it seems (we have exactly one of these now).

                          Lots of work but got me through the “HRL” banging head on wall step!!

                          Hope this proves useful for you.

                        • #79719
                          Johnny Anderson
                          Participant

                            Robert, after reading your advice on Jan 16, I decided to take a closer look at the HRL testing tool.  I found the problem.

                            See attachment 3 , last slide.  The data record type-03 was using the type-17 frl.  I removed that frl, reran and now I have

                            just one problem.  See attachment 1.  I

                          • #79720
                            Jim Kosloskey
                            Participant

                              Johnny,

                              Since you want to create one set of OBX group from 2 sources of input, I recommend you manage your own counter for the OBX group rather than using the %g3 and %g4 counters associated with the ITERATEs.

                              Have you managed your own counters before?

                              Are you comfortable wit doing that?

                              If not let us know and we will help you through it.

                              email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

                            • #79721
                              Johnny Anderson
                              Participant

                                Yes, I know how to managed my own counters.  I’ll give it a try and see what happens, thanks Jim.

                                Also, thanks for that “pseudo HL7 message” advice Bob.  I’m sure I’ll use it sometime.

                              • #79722
                                Johnny Anderson
                                Participant

                                  Jim, I

                                • #79723
                                  Jim Kosloskey
                                  Participant

                                    Johnny,

                                    Only use ONE of your own counters.

                                    I name my own counters 99 (%s99, or %g99, or %f99) so that stands out as an eye catcher but any number you want which is not defined in an ITERATE.

                                    So either pick %g8 or %g9

                                    email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

                                  • #79724
                                    Johnny Anderson
                                    Participant

                                      I talked with Jim offline.  My comments on Jan 22 was a misunderstanding, please ignore.  This is the correct understanding:

                                      Create and increment my own variable (%g99) and use it in the Type-04 logic and in the Type-14 logic.  Not 2 different variables.

                                      After Type-04 logic ends and before Type-14 begins, increment the variable once.  Problem solved.  See attachments for testing results.

                                      Thanks to Jim, Robert, and Bob.

                                    • #79725
                                      Jim Kosloskey
                                      Participant

                                        Excellent piece of work Johnny   ❗

                                        email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

                                      • #79726
                                        Johnny Anderson
                                        Participant

                                          Thanks.

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