Help with "iteration" in translation

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Help with "iteration" in translation

  • Creator
    Topic
  • #50946
    Tom Arrowsmith
    Participant

      I am trying to write my first translation with the “iterate” function…. and need some help.

      First, here’s an example of an HL7 message I want to translate:

      MSH|^~&|PCM|L|RAD|L|20090605133706|OkToBundle|ORM^O01|94520|P|2.2|||AL|NE

      PID|1|00001316|0001205^^^ST02L^MR^L||DIAMOND^NEIL^S||19450506000000|M||||||||||0915600007^^^L|678-90-1234

      PV1|1|O|RAD^^^L||||255^COOK^RANDOLPH^B^^MD^MD|||MED|||||||255^COOK^RANDOLPH^B^^MD^MD|OP||SP|||||||||||||||||||L|||||20090605132100

      ORC|PA|315795^PCM|315795^PCM|41943|SC||1^STAT^O1^20090605133600^20090605133600^4||20090605133702|ISADANG^DANG^ANH^N^^DP^SA||255^COOK^RANDOLPH^B^^MD^MD|MED||20090605133702|||MED|ISADANG^DANG^ANH^N^^DP^SA

      OBR|1|315795^PCM|315795^PCM|30210^CCL EKG PRE OR POST PROC^PCM||20090605133702||||||||||255^COOK^RANDOLPH^B^^MD^MD|||||||||||1^STAT^01^20090605133600^20090605133600^4|||BO2^BED W/O2|^CHEST PAIN

      OBX|1|ST|CODPROMPT-ISOL^PATIENT IN ISOLATION|1|STANDARD PRECAUTIONS

      ORC|NW|315796^PCM||41943|SC||1^^^20090605133600^^4|315795&PCM|20090605133702|ISADANG^DANG^ANH^N^^DP^SA||255^COOK^RANDOLPH^B^^MD^MD|MED||20090605133702|||MED|ISADANG^DANG^ANH^N^^DP^SA

      OBR|1|315796^PCM||30210^CCL EKG PRE OR POST PROC^PCM||20090605133702||||||||||255^COOK^RANDOLPH^B^^MD^MD|||||||||||1^STAT^01^20090605133600^^4|||BO2^BED W/O2|^CHEST PAIN|||||20090605133600

      OBX|1|ST|CODPROMPT-ISOL^PATIENT IN ISOLATION|1|STANDARD PRECAUTIONS

      Note that it has two OBR segments – and the values I wish to blank out are in the OBR-27.2 and the OBR-27.3 (“STAT” and “01”, respectively)

      The translate I have written blanks out the appropriate values in the 1st instance of the OBR, but not the second.

      I defined 2 iterate statements:

      the first iterate details – ENGINE=group, basis=2(0).1(0), variable=%g1

      then subordinate to the first iteration is the second –

      The 2nd iterate details – ENGINE=field, basis=2(0).1(%g1).0(0).OBR.00221, variable=%f1

      Then I have the staement –

      @null @null -> {2(0).1(0).0(0).OBR.00221(%f1).[1] {2(0).1(0).0(0).OBR.00221(%f1).[2]

      This all succeeds in correcting one of the OBR statements, but not both…

      Any help would be appreciated!

      Thanks!

      Tom Arrowsmith

      (703) 779-5474

    Viewing 3 reply threads
    • Author
      Replies
      • #68148
        Tom Rioux
        Participant

          In your copy statements, you are missing the %g1 variable in your destination fields.   Try it like this:

          @null -> {2(0).1(%g1).0(0).OBR.00221(%f1).[1]

          @null -> {2(0).1(%g1).0(0).OBR.00221(%f1).[2]

          Hope this helps…

          Tom

        • #68149
          Tom Arrowsmith
          Participant

            Yes… that makes sense.

            Unfortunately, even after the addition of the group variable to the copy statement, I still don’t get it to work. Is the group defined correctly?

            Thanks again for your help!

            Tom

          • #68150
            Tom Rioux
            Participant

              One question I have is do you have OBR.27 set up as a repeating field in your variant?  If not, then the field iteration is unnecessary.   Try taking that out.   If it still doesn’t work, then take you sample message and run it through the HL7 tester in the testing tool.   Turn the detail level up to about 3 or 4.  Then look at your grouping and it will give you an idea of how it is grouping and where your iterations should be.

              Hope this helps…

              Tom

            • #68151
              Keith McLeod
              Participant

                Look at ‘Iterate Over OBR’, I had put some info regarding iteration that may help….in this

                https://usspvlclovertch2.infor.com/viewtopic.php?t=3654&highlight=iterate

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