Announcement

Collapse
No announcement yet.

trouble in mapping to a variable

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

  • trouble in mapping to a variable

    Hi
    I have to map to the following.

    @PID.3.1^71604[email protected]^[email protected]^NHC

    where 71604 should be my variable

    I have done the following
    variable numerodehistoria = msg['QRD']['QRD.8']['QRD.8.1'].toString()

    so it looks like

    @PID.3.1^${numerodehistoria}[email protected]^[email protected] ^NHC

    but the output fails, doesn't map.

    I have do a search, and I have found that I have to click on "parse subcomponents", but does not work. I think it is because it is in between "^" and "~"

    How can I sort it? thanks in advance

  • #2
    If you have field repetitions (denoted by the "~"), then you should check Parse Field Repetitions, and then update your JavaScript to point to the right field (or iterate through multiple fields).
    Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

    Nicholas Rupley
    Work: 949-237-6069
    Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


    - How do I foo?
    - You just bar.

    Comment


    • #3
      Sorry, I dont understand that:
      ...and then update your JavaScript to point to the right field

      Does it mean I have to code it in javascript?

      Comment


      • #4
        Originally posted by Renzo_Passolini View Post
        Sorry, I dont understand that:
        ...and then update your JavaScript to point to the right field

        Does it mean I have to code it in javascript?
        No you don't have to; if you know a specific field that you want to pull data from then you can still just use a Message Builder or Mapper step. Those step types don't currently handle repeating fields automatically though.
        Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

        Nicholas Rupley
        Work: 949-237-6069
        Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


        - How do I foo?
        - You just bar.

        Comment


        • #5
          yes, the inbound message is
          QRD||R|I|1|||1^RD|167112|DEM\r

          So I map it as
          variable numerodehistoria = msg['QRD']['QRD.8']['QRD.8.1'].toString()

          ┬┐Am I right?

          Comment


          • #6
            mapper doesnt run

            I use message builder, tmp['QPD']['QPD.3'][0] mappig msg['QRD']['QRD.8']['QRD.8.1'].toString()

            but the output is @[email protected]^[email protected]^NHC, so is "eating" a repeater...

            Comment

            Working...
            X