Copying a field to a repeating segment

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Copying a field to a repeating segment

  • Creator
    Topic
  • #48108
    Mark Brown
    Participant

      I need to copy a field from one segment (non-repeating) to a field in a repeating segment, from one to what-ever.

      Since there is an existing translation, I thought that would be the best place to put it.  But I don’t know how to handle the repeating segments. If I just choose to have a copy for the max number of repeats and there’s only one in the message, then I wind up with max-1 empty segments. I figured there has to be a more effiencent way to do this, but I’m at a loss at how to do it.

      Any ideas?

    Viewing 2 reply threads
    • Author
      Replies
      • #57671
        Ryan Spires
        Participant

          Is the data coming from a repeated field?  What is the determination for how many repeated segs you will need.

          If the data is coming from a repeated field, you could iterate on the repeated field, you should be able to use the %f in the path of the segment outbound to create your segs.

          If I have totally missed your question, give some more details.

          Thanks

          Ryan Spires

        • #57672
          Mark Brown
          Participant

            Here’s a little more info about what I’m trying to do.

            The DG1 segments from our hospital system do not contain a value in the diagnosis date field.  The ancillary system we’re sending to suggested using the message date as the diagnosis date.  Some messages have only one DG1 segment while others have 3 or 4.

            So I want to copy the date from EVN-2 to DG1-5 for each DG1 segment. I tried setting up an Iterate in the xlate, but it only populates the first DG1 segment.

            I thought I was doing what the manual said, so I don’t know what I’m doing wrong.

          • #57673
            Ryan Spires
            Participant

              Ok,

              I understand…

              You should be able, while in your DG1 interation copy a static path from your EVN date field to the iterated variable of the DG1 date field you are trying to populate.

              Then the same date would only get copied when the iteration occurs

              within the segment iteratate for the DG1

              copy

              0(0).EVN.00100.[0]     to   0(0).DG1(%s1).00379.[0]

              This should do what I believe you are asking.

              Make sure you verify the field values I have selected in addition to the variant paths that I have selected.  

              This will place the EVN date/time stamp into every DG1 Diagnosis date time.

              Is this what you are looking for?

              Ryan

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