nulling out PV1-8 specific component

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf nulling out PV1-8 specific component

  • Creator
    Topic
  • #50219
    Duy Nguyen
    Participant

    I have spent too much time trying to figure this out.  Can you guys point me in the right direction?  I need to null out part of a component field where it starts with the tilde, ” ~ ” character and having no luck with copying @null and pathcopying @null to the 1(0).0(0).PV1.00138(0).[2]

    Here is the example:

    PV1|1|O|1189-6311|||||20045^TEST MD~1122 NE 13TH STREET~ORI ROOM 288A~OKLAHOMA CITY,OK~73117~405-271-4647|||||||||||

    Desired OUTPUT:

    PV1|1|O|1189-6311|||||20045^TEST MD|||||||||||

    Thanks!

Viewing 8 reply threads
  • Author
    Replies
    • #65241
      Jim Kosloskey
      Participant

      Duy,

      That is a field repetition not a component.

      You will need to reference that in the field repetition portion of the address path 1(0).0(0).PV1.00138(0) for the first repetition (20045^TEST MD) 1(0).0(0).PV1.00138(1) for the second repetition (1122 NE 13TH STREET), etc.

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

    • #65242
      Jim Kosloskey
      Participant

      Duy,

      That is a field repetition not a component.

      You will need to reference that in the field repetition portion of the address path 1(0).0(0).PV1.00138(0) for the first repetition (20045^TEST MD) 1(0).0(0).PV1.00138(1) for the second repetition (1122 NE 13TH STREET), etc.

      The tilde ~ is normally the field repetition separator and the carat ^ is normally the component separator.

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

    • #65243
      Rentian Huang
      Participant

      PATHCOPY

      and then:

      COPY @null to 1(0).0(0).PV1.00138(0).[1].(1)

      COPY @null to 1(0).0(0).PV1.00138(0).[1].(2)

      COPY @null to 1(0).0(0).PV1.00138(0).[1].(3)

      COPY @null to 1(0).0(0).PV1.00138(0).[1].(4)

      OR don’t do PATH COPY but COPY each field specifically, without the 4 above mentioned subfield repititions.

    • #65244
      Rob Abbott
      Keymaster

      Quote:

      COPY @null to 1(0).0(0).PV1.00138(0).[1].(1)

      COPY @null to 1(0).0(0).PV1.00138(0).[1].(2)

      COPY @null to 1(0).0(0).PV1.00138(0).[1].(3)

      COPY @null to 1(0).0(0).PV1.00138(0).[1].(4)

      These paths are incorrect … should read

      COPY @null to 1(0).0(0).PV1.00138(1).[1]

      COPY @null to 1(0).0(0).PV1.00138(2).[1]

      COPY @null to 1(0).0(0).PV1.00138(3).[1]

      COPY @null to 1(0).0(0).PV1.00138(4).[1]

      Rob Abbott
      Cloverleaf Emeritus

    • #65245
      Duy Nguyen
      Participant

      Thanks everyone..I got it to work.  =)

    • #65246
      Vince Angulo
      Participant

      Just curious, would this accomplish the same thing:

      pathcopy @null -> 1(0).0(0).PV1.00138

      copy 1(0).0(0).PV1.00138(0) -> 1(0).0(0).PV1.00138(0)

      That is, null out the whole field then only copy in the first iteration?

      Thanks,

    • #65247
      Rentian Huang
      Participant

      Rob, should they be like this and why not? Thanks!

      COPY @null to 1(0).0(0).PV1.00138(1).[0]

      COPY @null to 1(0).0(0).PV1.00138(2).[0]

      COPY @null to 1(0).0(0).PV1.00138(3).[0]

      COPY @null to 1(0).0(0).PV1.00138(4).[0]

    • #65248
      Robert Milfajt
      Participant

      Quote:


      Just curious, would this accomplish the same thing:

      pathcopy @null -> 1(0).0(0).PV1.00138

      copy 1(0).0(0).PV1.00138(0) -> 1(0).0(0).PV1.00138(0)

      I set this up in one of my test translations and modified a test data file to have the data shown in the original message of this chain, and the answer to your question, at least for CL 5.5 rev1 on AIX 5.3, is YES.

      🙂

      Robert Milfajt
      Northwestern Medicine
      Chicago, IL

    • #65249
      John Mercogliano
      Participant

      Duy,

       Because this is a repetition, I have found that the best way is to use an iterate with the field as your basis and use pathcopy to null out each iteration. Then just copy the first iteration over.

      Code:


      { { OP ITERATE }
         { BASIS 0(0).PV1.00138 }
         { VAR %f1 }
         { TYPE field }
         { BODY {
             { { OP PATHCOPY }
                 { ERR 0 }
                 { IN @null }
                 { OUT 0(0).PV1.00138(%f1) }
             }
         }}
      }
      { { OP COPY }
         { ERR 0 }
         { IN 0(0).PV1.00138(0) }
         { OUT 0(0).PV1.00138(0) }
      }

      Here is an xlate snippet to demonstrate.

      John Mercogliano
      Sentara Healthcare
      Hampton Roads, VA

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

Forum Statistics

Registered Users
5,126
Forums
28
Topics
9,296
Replies
34,439
Topic Tags
287
Empty Topic Tags
10